|
|
|
Re: Mapping from DSL specific ecore to a model ecore [message #1228967 is a reply to message #1228928] |
Wed, 08 January 2014 12:49 |
Mark Hoffmann Messages: 113 Registered: July 2009 Location: Jena |
Senior Member |
|
|
Hi,
I don't wanna do the transformation when executing MWE to generate the stuff!
The transformation should be done, when I use the generated editor typing code in my DSL and save the file.
So the ordinary use case is:
- create a DSL and generate the editor from it
- launch the generated bundles
- use the editor to write code in my DSL's grammar.
- save the file and you get the DSL's EMF Resource with the model in it
- generate any code using the generated xtend generator class
What I want is:
- create a DSL and generate the editor from it
- launch the generated bundles
- use the editor to write code in my DSL's grammar.
- save the file and you get the DSL's EMF Resource with the model in it
- transform this data model into a model instance of the customers ecore
- generate any code using the generated xtend generator class from the model of the customers ecore
I already tried to import the big ecore and created a DSL from it, but the result was not very good. Even if I deleted unnecessary stuff and changed the grammar I didn't achieved a good result.
But I can create an instance of the complex model from the DSL's model which was created from scratch. For this I have to create corresponding objects in the big model, set a lot of default values, non containing cross references and so on. It doesn't matter for me, if I do this in code or using m2m.
I just wanted to know, if there is a good place to start this transformation, when saving the code in my DSL editor. Thats why I came to the idea, do this in the xtend generator class. But my feeling says this is not a good place to do such a transformation.
I cannot change the big model, because its the one from the customer.
Regards,
Mark
[Updated on: Wed, 08 January 2014 13:13] Report message to a moderator
|
|
|
|
Re: Mapping from DSL specific ecore to a model ecore [message #1228982 is a reply to message #1228969] |
Wed, 08 January 2014 13:32 |
Mark Hoffmann Messages: 113 Registered: July 2009 Location: Jena |
Senior Member |
|
|
Hi,
no, I am not sure if it is impossible, but creating the DSL from srcatch was not as expensive as modifying the imported one, that resulted in language that I and the customer dont really wanted.
In any case I would need a hook, where I can set non containing references, default values and so on after the syntax is valid. Something like postProcess or preCodeGenerate ...
Mark
[Updated on: Wed, 08 January 2014 13:33] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04243 seconds