[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2t] xtext for metamodeling

Hi,

What is the best way to generate an ecore model from an xtext model? I want to use xtext to define a metamodel, and then create model instances that are themselves emf models.

Some portion of my xtext metamodel defines an entity structure that maps to ecore in a straightforward way. I was originally using xpand to generate java objects for my xtext model entities, but I found I was needing to build in features like reflective accessor methods that are already present in emf. So I'm thinking that rather than using m2t to instantiate an ecore model from my xtext model, it would be better to use m2m xtend to do so.

In order to do this, there are a few things I need to know how to do:
1. How do I execute a m2m transformation on a model instance using xtend? Writing the xtend file is easy, and I also see there is a XtendComponent workflow component that I'm assuming would do the job; I just haven't seen any examples of how to wire things up in the mwe workflow file.
2. How do I write out the generated ecore model once it has been transformed? I also see there is a org.eclipse.emf.mwe.utils.Writer workflow component, but again I'm looking for an example of how to wire it up in the mwe file.


Thanks,
Edwin