Saving AST of xText runtime model as an ecore model [message #1808396] |
Sun, 23 June 2019 21:34 |
J Bouwhuis Messages: 17 Registered: April 2019 |
Junior Member |
|
|
I am creating a DSL in xText which I then compile and run in the xText runtime environment. In this runtime environment I can then of course create a new file * file.dslextension * in which I can write a model according the DSL specification (the latter can of course be viewed as the meta-model of the model I am writing in the runtime environment). So far everything is fine.
Now I want to export this model (NOTE: NOT the ecore specification of the meta-model, which is the DSL specification) to an ecore model. A similar question has been asked on StackOverflow, but I don't know how to implement that solution in Eclipse (and hence I don't even know if that solution works). So basically what I want is to export the AST (which is an ecore model itself) of the model I create in the xText runtime environment to an actual ecore file containing the model. I want to use that ecore file afterwards for making transformations with the QVTo language.
I tried to read tutorials on how to adapt the xTend files in the org.xtext.example.generator package, but all these tutorials focus on creating proprietary transformations for very specific cases. I just want xText to automatically generate an ecore file of the models (DSL instances) that I write in the xText runtime environment.
P.S. I also cross-posted this on stackoverflow
[Updated on: Sun, 23 June 2019 21:35] Report message to a moderator
|
|
|
Re: Saving AST of xText runtime model as an ecore model [message #1808398 is a reply to message #1808396] |
Mon, 24 June 2019 04:27 |
|
hi, can you be a bit more specific on what you actual problem is.
EcoreFactory.eINSTANCE.createEPackage creates a package
EcoreFactory.eINSTANCE.createEClass creates a class
do a model 2 model transformation using these
the with-expression and create methods in xtend might come handy for that purpose
you could call this from the generator. or a custom command or ... (insert your requirement here)
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03015 seconds