Skip to main content


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 16:08 Go to next message
mipl  is currently offline mipl Friend
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 16:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: M2T reverse direction [message #650810 is a reply to message #650802] Wed, 26 January 2011 16:43 Go to previous messageGo to next message
mipl  is currently offline mipl Friend
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 19:26 Go to previous message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
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, EMF, Eclipse IDE?
Go to: http://devhub.karakun.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: Wed Apr 24 16:23:09 GMT 2024

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

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

Back to the top