Parsing of ecore models [message #1089258] |
Sun, 18 August 2013 08:19  |
Eclipse User |
|
|
|
Hi everyone,
First my use case: I want to extend my EMF editor so that users can import other ecore models, which differs in structure and naming. For example I've got ecoreA, which represents my EMF Editor. EcoreB describes a part of EcoreA, but with difference in structure and naming.
So when a user wants now to import an instance of ecoreB, there must be something like a parser which translates the ecoreB instance so that it fit in for ecoreA.
So what would be the best way to realize this? Are there any tools which I could use?
At the moment, I've extended the context menu with an Import menu item, which opens a FileDialog by clicking. This should be the hooking point for importig the other ecore instance and parse it.
I'm a little bit afraid that it could be a little bit complicated to include it then into the main model. Maybe there are some examples already?
Cheers,
Phil
|
|
|
|
|
|
|
|
|
Re: Parsing of ecore models [message #1105270 is a reply to message #1105252] |
Mon, 09 September 2013 11:55  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.10877 seconds