Recognized, but not accepted token |
Top Previous Next |
Messages > Recognized, but not accepted token
If the execution of a TETRA program was broken by an error, there may be a hint to a matching but not recognized token in the log window. Presumably an error occurred inside of the interpreter before the parser could accept the token. Or a return-statement was put in front of the ascertainment of the next token inadvertently.
Example:
ID {{ return true; }} NUMBER
A number NUMBER is expected after the first identifier ID here. However, NUMBER cannot be recognized since the production is exited before by return.
Another possibility is, that a global scanner for regular expressions was used, although two tokens of this scanner can conflict.
If, for example, a little table consists of the columns version and price of a product and these tokens are defined as:
Version = \d\.\d\d Price = \d\d?\.\d\d
that means a price can have one or two digits in front of the point and a version only one. The content of the table can be parsed by:
Table = ( Version Price )*
If a global scanner is used, it is not clear, whether a number with one digit in front of the dot will be recognized by Price or by Version. If the number is in the first column, nevertheless Price might recognize it. In this case the parsing is stopped and the error message occurs, that Price matched, but was not accepted. By using local scanners, this is no problem. A number in the first column will be always only tested by Version and a number in the second column always only by Price.
|
This page belongs to the TextTransformer Documentation |
Home Content German |