Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » Text to Model Transformation
Text to Model Transformation [message #635033] Mon, 25 October 2010 13:30 Go to next message
No real name is currently offline No real nameFriend
Messages: 12
Registered: October 2010
Junior Member
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 #635045 is a reply to message #635033] Mon, 25 October 2010 14:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Tim,

Comments below.

junk.mrt@gmx.net wrote:
> 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 ?
I'm not sure if we're off on some meta-level mismatch. If you have an
Xtext grammar, you already have an Ecore model for your DSL. If you
want to transform an instance of this Ecore model to be an instance of
Ecore itself, that's another question. But given you want to visualize
your instance graphically, I don't see a need for that.
> 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.
GMF should already be able to work directly with the Ecore model you
derive from your Xtext grammar...
>
> Thanks for your help
>
> Greets Tim


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Text to Model Transformation [message #635088 is a reply to message #635045] Mon, 25 October 2010 15:32 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 12
Registered: October 2010
Junior Member
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
Re: Text to Model Transformation [message #635127 is a reply to message #635088] Mon, 25 October 2010 17:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
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...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Text to Model Transformation [message #635190 is a reply to message #635088] Mon, 25 October 2010 22:18 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Tim,

please have a look at the GMF integration example and the xtext
documentation (F1 in eclipse or www.xtext.org).

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 25.10.10 17:32, schrieb Tim Joussen:
> 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
Re: Text to Model Transformation [message #635310 is a reply to message #635190] Tue, 26 October 2010 11:28 Go to previous message
No real name is currently offline No real nameFriend
Messages: 12
Registered: October 2010
Junior Member
I think you were right about the Meta-Meta Problem Smile

http://www.eclipse.org/Xtext/documentation/1_0_0/images/emf-integration.png

this pic from the xtext guide makes it a bit easier to me to understand how the transformation from xtext to ecore works.

for more detailed questions I will post sooner or later Wink

thanks fpor your help!
Previous Topic:Data type and configuring to existing DB
Next Topic:Interrogating ecore model and programmatically generating model instances
Goto Forum:
  


Current Time: Thu Mar 28 19:09:15 GMT 2024

Powered by FUDForum. Page generated in 0.02741 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top