Instance of Ecore.ecore [message #1129055] |
Tue, 08 October 2013 04:40  |
Eclipse User |
|
|
|
Hello,
My first post here !
In my project, I have a model-to-Model transformation using Atl.
It maps the AST ecore metamodel generated by Xtext to the metamodel of Ecore itself (Ecore.ecore).
So, when I write some class definitions in my Xtext DSL, I get an XMI instance of Ecore.ecore (for instance: MyClass!name is mapped to Eclass!name).
My question is: how can I generate the Ecore metamodel from this XMI file ?
I hope it is clear enough, I am quite new to MDE.
Thanks in advance !
Aurel
|
|
|
|
Re: Instance of Ecore.ecore [message #1163893 is a reply to message #1129961] |
Thu, 31 October 2013 05:37  |
Eclipse User |
|
|
|
Hello Ed Merks, sorry for the late response !
My question was more about transforming a Xtext DSL code into an ecore representation.
I managed to do it, it is not super easy but it basically works that way:
1) DslCode.mydsl===parsed into "Ecore AST" representation (using Xtext) then serialized using EMF api===> DslCode.xmi
2) DslCode.xmi ===Mydsl.ecore-to-Ecore.ecore ATL transformation===> DslCodeEcoreRepresentation.xmi
3) DslCodeEcoreRepresentation.xmi ===Deserialization using EMF api==> DslCodeEcoreRepresentation.ecore
Then you can produce the genmodel and generate Java code (for free).
It just works perfectly and is very time saving compared to other solutions (Xtend templates or DoSwitch+Dynamic Ecore).
If somebody is interested, I help, just post a message here.
|
|
|
Powered by
FUDForum. Page generated in 0.35400 seconds