Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » M2T reverse direction
M2T reverse direction [message #650802] Wed, 26 January 2011 11:08 Go to next message
mipl  is currently offline mipl
Messages: 7
Registered: August 2010
Junior Member
Hi All,
I have a problem:
there is a text file and I created its metamodel with ecore. Right now I would like to parse the text file and build on the top of it the model based on the ecore metamodel. Unfortunately I don't know where to start, as I read the Xtext description normally it operate in direction opposite to what I want. IS there any way to solve this problem?

Kind regards,
Re: M2T reverse direction [message #650805 is a reply to message #650802] Wed, 26 January 2011 11:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6213
Registered: July 2009
Senior Member
Hi,

i am not sure if i understand your post.
can you post some sample code / textfile / etc
expected input and output.

~Christian
Re: M2T reverse direction [message #650810 is a reply to message #650802] Wed, 26 January 2011 11:43 Go to previous messageGo to next message
mipl  is currently offline mipl
Messages: 7
Registered: August 2010
Junior Member
Hi all,
I'll try to be more clear.
I have a log file in a text format. I build a meta model of this log file with Ecore. Right now I would like to generate a model of this text file. It would give a possibility to use any model to model transformations.
I see it as something opposite to the way how for example Xpand is working, where you have metamodel, build model and generate the text representation. Right now I have text representation, metamodel and woudl like to generate a model based on that.

kind regards,
Re: M2T reverse direction [message #650846 is a reply to message #650802] Wed, 26 January 2011 14:26 Go to previous message
Karsten Thoms is currently offline Karsten Thoms
Messages: 353
Registered: July 2009
Location: Dortmund
Senior Member

Then you should give Xtext a try. With Xtext you define the "grammar" of your log file format (an example line would help!) and it creates a parser for you. Although you could map the grammar to your metamodel it might be better for an easy start to let Xtext generate the metamodel for you. It might differ a bit from yours.

Regards,
~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Previous Topic:Problems integrating a workflow in a plugin
Next Topic:[Acceleo 3] - Expression in <init> clause of template
Goto Forum:
  


Current Time: Fri Aug 22 19:36:36 EDT 2014

Powered by FUDForum. Page generated in 0.01667 seconds