Text to Model Transformation [message #635033] |
Mon, 25 October 2010 09:30  |
Eclipse User |
|
|
|
Hello everyone,
at first I will give u a short resumee about what I want to do in general.
I've got a DSL script, which is based on a Xtext grammar.
The main goal is to visualize the script in some kind of UML Activity diagramm.
I've got some ideas about using jface data binding and gmf, but here it's absolutely necessary to have some Datamodel in the beginning ( Ecore-Model e.g.) And thats where I stuck right now.
How do I transform the DSL script into an Ecore Model ?
Maybe I am totally on a wrong track , are there different approaches ? The Model-View-Controller attempt appeared to me the right thing to do it.
Thanks for your help
Greets
Tim
|
|
|
|
|
Re: Text to Model Transformation [message #635127 is a reply to message #635088] |
Mon, 25 October 2010 13:00   |
Eclipse User |
|
|
|
Tim,
Comments below.
Tim Joussen wrote:
> thanks for the fast answer
>
> I got the ecore model of the xtext grammar thats right.
> The thing is to visualize the dsl script that is written in the
> editor, which is based on the Xtext grammar. And to make some diagramm
> out of the script I have to transform it into kind of Metamodel,
> preferably to an ecore model , which GMF is able to work with
Again, I think there is a meta-level mismatch. You have an Ecore model
for the DSL. GMF can work with that to let you visualize instances of
your DSL graphically. If you literally want to convert instances of
your DSL to Ecore, that's another story. Things like XSDEcoreBuilder
will convert XML Schema instances of Ecore instances, so you could look
at how that's done. But given that I know nothing about your DSL,
there's nothing concrete I can say about mapping it to Ecore or whether
it even make sense. It wouldn't make sense, for example, to map the
Library model to Ecore...
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04435 seconds