|
Re: Parsing of ecore models [message #1090616 is a reply to message #1089258] |
Tue, 20 August 2013 12:04 |
Daniel Strueber Messages: 14 Registered: March 2011 |
Junior Member |
|
|
To my impression, writing a dedicated parser would be a rather low-level solution to your use case. Since EMF provides a parser for EcoreB models out of the box, you might as well use this parser and then use model transformation to convert your EcoreB model (parsed by EMF's default mechanism) into an EcoreA model.
Such a model transformation would then involve two steps: You define some conversion rules and then you execute them on some input EcoreB model. If you employ a model transformation engine that comes along with an API, such as EMF Henshin, the second step can be executed from your context menu just as you described.
You might check out the Ecore-to-RDB example for a model-to-model-transformation in Henshin. Note that at this moment we're still resolving some compatibility issues with Eclipse Kepler. To give Henshin a try, you should thus use Eclipse Juno.
Regards,
Daniel
[Updated on: Tue, 20 August 2013 14:10] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Parsing of ecore models [message #1105270 is a reply to message #1105252] |
Mon, 09 September 2013 15:55 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Phil,
Comments below.
On 09/09/2013 5:34 PM, Phil H wrote:
> Hi Ed,
>
> as you told me, I used my genmodel to generate test code, but this
> doesn't work..
What specifically doesn't work?
> What I have now is a project containing the ecore, genmodel and the
> generated test code..
Better to generate it to a different project. So it sounds like it did
work and you've just not found the XyzExample.java?
>
> What I still haven't understand yet if it's enough to have just the
> ecore model, or need I also the gen model and generate all the code?
That depends.
> I expected that the ecore model would be sufficient..
For many models it's possible just to use dynamic Ecore. E.g., if you
right click on an EClass in the model, you can invoke Create Dynamic
Instance. But if you're going to write a model to model
transformation, you probably want to do that with the generated API for
the two models.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04048 seconds