EMF generates non-Java code

Is there a way to generate ECore model code that is not Java? I have a metamodel that represents an html layout (forms, inputs, buttons) and I want to generate html.

How can i do this? What other tools should I use? A link to a tutorial would be ideal because I have not found it yet.

+3
source share
2 answers

I think the best way to approach this is to create your own metamode in Ecore, as you have already done, then generate Java code and possibly also an EMF tree editor to create models. (Please note that the Java code for the metamodel must be generated so that the resulting models can be traversed and interpreted using EMF tools. This way you do not create other languages ​​directly from Ecore - this is done in a separate step as described below),

Next, use XPand, the Xtext template language, to generate HTML from your models. Here is a blog post explaining how to create an HTML form from a model:

http://www.peterfriese.de/getting-started-with-code-generation-with-xpand/

" " , . XPand, , , Jet.

+3

, , .

, Xpands - EMF -Java-

JET, ecore. - Java Java , .genmodel.

0

Source: https://habr.com/ru/post/1782744/


All Articles