简体   繁体   中英

Ecore model to Xtext

I have a complete EMF-Metamodell (ecore) created. Now I want to try Code-Generation with Xtext2, because I found somewhere that xtext2 is better for code generation than xpand.

I created a new Project with Eclipse and imported my existing ecore-model. I use the new Project with Xtend to do the code-generation.

  1. I dont like the default convertion to xtext. To many curly braces and other stuff. Can I define somehow how I want it converted?
  2. When I change my Meta-Model (ecore) how can I enforce an update of the xtext file?
  3. Is there a better way to achieve my goals?

If you've chosen xtext as your model-to-test generation technology, why not use it to also generate the xtext source from the ecore model? This is a standard templating approach.

As for enforcing a re-gen when your score source changes, create an Eclipse builder and configure your ecore project to invoke the build on any resource change within the project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM