|
|
|
|
|
Re: Generate Xtext grammar from Ecore file without the project wizard [message #1859576 is a reply to message #1859478] |
Fri, 16 June 2023 11:03 |
Kaan B. Y. Messages: 15 Registered: June 2023 |
Junior Member |
|
|
Hello,
I have a metamodel created in EMF. I would like to generate code using models of this metamodel. The metamodel contains Rust templates, for example there is an EClass named ConstructorImplementation that contains an EList of Fields. My code generator is supposed to "fill out" Xtend templates with the relevant values from the model (e.g. name of a Field) and then write the generated code in a Rust file.
At least what I've understood from the video that Tamas, is that no Xtext grammar is required to write Xtend methods, if the Ecore model already exists on its own. I deleted the automatically generated Xtext file (I used the project wizard "New Xtext Project from Existing Ecore Model...") and the Xtend file was still valid, as the types were being imported from the respective EMF project, and not from the Ecore model implied through the Xtext grammar (which, in return, was generated using the Rust template metamodel).
Now I am not sure how am I supposed to approach this. Can I just load some serialized model file and invoke the root generate method in my Xtend code generation class?
Is Xtend even meant for such an use case?
Thanks in advance.
Regards
K.
[Updated on: Fri, 16 June 2023 11:07] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04241 seconds