| ... |
... |
@@ -48,5 +48,15 @@ |
| 48 |
48 |
|
| 49 |
49 |
* The predefined grammar contains one grammar rule for each meta model class. This general structure can be kept in most cases. |
| 50 |
50 |
* Ecore enumerations (EEnum) must be defined with an {{code language="none"}}enum{{/code}} grammar rule (see documentation). This is not correct in the predefined grammar and is marked with a TODO note. |
|
51 |
+* 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. |
|
52 |
+* There are some predefined terminal rules that can be reused and are already imported in the grammar file. Click on {{code language="none"}}org.eclipse.xtext.common.Terminals{{/code}} at the top of the document and hit F3 to see those terminal definitions. |
| 51 |
51 |
|
|
54 |
+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. |
|
55 |
+ |
|
56 |
+= Formatting = |
|
57 |
+ |
|
58 |
+Xtext supports automatic formatting, which is available in the text editor with right-click → //Format// or ctrl+shift+F. However, the formatter must be configured in order to generate good results. Write a formatter configuration that fits well to your syntax by editing the generated file {{code language="none"}}TuringFormatter{{/code}} in the {{code language="none"}}formatting{{/code}} subpackage. Learn how this is done by reading the Xtext reference documentation → Runtime Concepts → Formatting. |
|
59 |
+ |
|
60 |
+= Parsing = |
|
61 |
+ |
| 52 |
52 |
|