Semantic actions

Top  Previous  Next

Examples > Cocor import > Semantic actions


The semantic actions are included into the brackets {_ and _} as not interpretable code in the transformed text, because it has not to be assumed, that these actions are interpretable.

You can remove the actions totally. To do so, you have to disable the code inside of double braces "{{...}}" for the interpreter in the productions Attribs and SemText. This can be done in the local options of these productions. Then the interpreter will not write the code for the semantic actions into the target text. Only the code for the pure parser is generated.





For the production SemText the local options are already activated, as the testing of all literal tokens has to be turned off. This is necessary as in principle SemText is:


SemText ::=  "(." SKIP ".)"


If for example the literal token "(" would follow the opening bracket "(." in the text, it would be recognized as next token, because literal tokens have a proference before the tokens of a SKIP recognition. If however, the scanner only tests the tokens, which may actually occur according to the actual grammar rule, all other tokens of the project are no problem for the recognition of SemText.


This page belongs to the TextTransformer Documentation

Home  Content  German