Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » JvmModelInferrer for CodeGeneration from existing model(Using code generation parts of Xtext without having a textual language)
JvmModelInferrer for CodeGeneration from existing model [message #1723207] Fri, 12 February 2016 13:37 Go to next message
Christian Fuss is currently offline Christian FussFriend
Messages: 3
Registered: February 2016
Junior Member
I am using Xtend extensively now since a bit more than one year and I love it.

Currently I am writing a code generator translating an EMF model into Java code. My current approach is using Xtend and its template expressions, but the generator is growing ever more complex and now I wondered how I could make use of the JvmModelGenerator to create the code. The EMF model is provided by the users and comes from some other tool.

I have been implementing a few Xtend ActiveAnnotations lately and got to love the JvmModel and hoped this could be applied to my code generator easily. I would like to do a model transformation from my EMF model to the JvmModel and kick off the JvmModelGenerator, but I do not find a starting point. Are there any examples how to use these parts of Xtext without having your own language?
Re: JvmModelInferrer for CodeGeneration from existing model [message #1723567 is a reply to message #1723207] Tue, 16 February 2016 15:39 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 83
Registered: January 2016
Location: Kiel

I'm not sure if this really pays off if you don't use Xtext and Java type references resp. xbase expressions. Haven't heard that somebody tried this before, too, but it should work like this:
- transform your EMF models to instances of the 'types' ecore file (JvmGenericType and the like).
- See DocumentationAdapter, TypeProvider, and CompilationStrategyAdapter, to add comments, method bodies and lookup types.
- inject the JvmModelGenerator and call internalDoGenerate with the resulted jvm classes.

Let us know how it worked in case you try it.
Previous Topic:Problems with XSemantics in Xtext
Next Topic:Missing import statement in generated emf classes
Goto Forum:

Current Time: Sat Oct 01 20:03:45 GMT 2022

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

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

Back to the top