XText Ecore Model to XText Code

309 views Asked by At

The more I figure out how XText works and what it does the more I like it. I'm using it in several areas of my development and have a feature I'd like to build where I want to programmatically construct an ecore model based on the generated Xtext model for my DSL and then reverse engineer that model back into DSL code. I suppose I could build a code generator for doing this unique to each DSL but it would be great if XText had a generic feature allowing me to take an in memory model of my DSL and generate the DSL code like it nicely does from code to ecore model. Can’t find much online and wondering if anyone might be able to help. Thanks! - Duncan Krebs

1

There are 1 answers

0
Sebastian Zarnekow On BEST ANSWER

Please have a look at the chapter on serialization in the reference documentation. It describes exactly what you are looking for.