Switching to an imported Ecore model
During the development of a more complex Xtext DSL, at some point, you might find the automatic Xtext Ecore inference mechanism too restrictive and you might want to have full control on the Ecore model of the AST. The Ecore model is also a very important API to all kinds of Xtext services, which you may want to to control more directly. In such cases, you can decide to switch to an imported and manually maintained Ecore model, starting from the one Xtext inferred for you from the grammar. In this section, we will detail the manual procedure to perform such a switching. we will detail the manual procedure to perform such a switching.
First of all, we create a new DSL that we will use as an example, using the following settings:
- Project name:
org.example.customgreetings
. - Name:
org.example.customgreetings.Greetings
. - Extensions:
greetings
.
Press Next.
In the next page, choose Maven as the Preferred Build System.
The DSL itself is not important, so we simply use...