Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Using code generation with Xbase, instead of JVMinferrer
Using code generation with Xbase, instead of JVMinferrer [message #1758110] Thu, 23 March 2017 15:33 Go to next message
Rodrigo Ruiz is currently offline Rodrigo RuizFriend
Messages: 28
Registered: March 2017
Junior Member
Hi,
in a new grammar i'm taking advantage of most Xbase rules, and xtext generates me an AbstractModelInferrer for it.
Is it possible to use a generator instead of that inferrer?
I have a lot of references that won't be present at infer time and i think a generator would be more suitable for my needs.
Thanks for your help, it's very appreciated.
Re: Using code generation with Xbase, instead of JVMinferrer [message #1758111 is a reply to message #1758110] Thu, 23 March 2017 15:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
i assume you have a basic missunderstanding

xbase is JvmModelInferrer + JvmModelGenerator + XbaseCompiler

=> there is actually a generator.

how it depends on your usecase if

- you adapt the JvmModelGenerator (Xbases IGenerator)
- adapt xbase itself and introduce new concepts (XbasetypeComputer + XbaseCompiler)
- or can do it with the inferrer any way.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Using code generation with Xbase, instead of JVMinferrer [message #1758137 is a reply to message #1758110] Thu, 23 March 2017 19:26 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

By 'generator' you mean a template based generator with Xtend? You could bind a new instance of IGenerator and inject both the JvmModelGenerator (which was bound by default) and the template generator and delegate to both. When you have to compile Xbase expressions from there things become a bit tricky, but basically you would inject and use the XbaseCompiler.
Re: Using code generation with Xbase, instead of JVMinferrer [message #1758143 is a reply to message #1758137] Thu, 23 March 2017 20:02 Go to previous message
Rodrigo Ruiz is currently offline Rodrigo RuizFriend
Messages: 28
Registered: March 2017
Junior Member
Thanks! By generator i mean an "AbstractGenerator" that is automatically created by the wizard.
I'll try your approach creating and binding a new Generator, used for some expressions and the inferrer for the XBase expressions and i'll see how it goes.
Thanks again!
Previous Topic:Cross Reference to nested Elements
Next Topic:String Annotation Value that is a constant attribute
Goto Forum:
  


Current Time: Thu Apr 25 19:49:33 GMT 2024

Powered by FUDForum. Page generated in 0.03167 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top