|Re: interdependence between your Ecore and your Grammar(editor) [message #898655 is a reply to message #898540]
||Fri, 27 July 2012 05:47
| Ed Merks
Registered: July 2009
On 26/07/2012 4:37 PM, frank fotso wrote:
> i wanted to know if after creating your ecore model and then
> generating your DSL grammar and your editor, you have to regenerate it
> (grammar) every time you change your ecore model.
> that means if i create an Ecore call paul.ecore and from that i
> generate the paul.genmodel and then generate paul's grammar(xtext) and
> to finish i create my editor with that grammar . if now i wanted to
> modify my ecore model by adding somes €attributes to a specific class
> or add somes €classes for example. should i regenerate the genModel
> and the grammar ?
If you create a GenModel from Ecore, there's generally no need to
regenerate the GenModel. You can invoke Reload... if you like, but the
GenModel does an analysis when it's open to make sure it's properly
wrapped the Ecore model it's currently using and that will, for example,
create new GenFeatures to wrap any new EStructuralFeatures and new
GenClassifiers to wrap any new EClassifiers, as well as clean up broken
proxies for removed things.
> or there is a way for me to apply ecore model changes directly in my
> old xtext grammar without generating a new grammar evry time i make a
> change in my ecre model.
I imagine the tool that produces the grammar isn't incremental and
doesn't do merging, and that even if it did, it's result would be no
different from what you see now, i.e., a new grammar with some changes
in it that reflect the changes in your Ecore. Of course you'd need to
run the workflow to generate the other project artifacts each time too.
Powered by FUDForum
. Page generated in 0.14447 seconds