Complex look-ahead

Top  Previous  Next

Examples > Java > Complex look ahead


In the block statement production the same production is called for a look-ahead, which shall be executed in the success case:


IF( LocalVariableDeclaration() )

LocalVariableDeclaration ";"




| Statement





Attention: depending on the fact whether the testing of all literal tokens is activated in the project options or not, the call of LocalVariableDeclaration for a look-ahead can have different results.  For example, if the token return - one of the alternatives of Statement - follows, it will be recognized as an identifier ident, if not all literal tokens are tested, but only the first set of LocalVariableDeclaration. So e.g. "return true;" would be interpreted as a local variable declaration, what surely is wrong.





Indirectly further look-ahead parsers can be invoked while testing, whether LocalVariableDeclaration matches the actual text or not.


This page belongs to the TextTransformer Documentation

Home  Content  German