Child pages
  • Textual Modeling with Xtext

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The predefined grammar contains one grammar rule for each meta model class. This general structure can be kept in most cases.
  • Ecore enumerations (EEnum) must be defined with an enum grammar rule (see documentation). This is not correct in the predefined grammar and is marked with a TODO note.
  • At some points you will need to reference other elements, which need to have some kind of identifier string in order to do this. If those elements do not have a string attribute yet, you need to modify the meta model and add such an attribute.
  • There are some predefined terminal rules that can be reused and are already imported in the grammar file. Click on org.eclipse.xtext.common.Terminals at the top of the document and hit F3 to see those terminal definitions.

Test the new grammar by re-generating the code (after the first time, the GenerateTuring workflow should be available in the run configurations menu) and starting a test instance of Eclipse. Use your newly designed textual syntax for writing a Turing Machine that copies the input word infinitely often.

Formatting