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?
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.
Karsten Thoms Messages: 353 Registered: July 2009 Location: Dortmund
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.
Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de