Markus,
Thanks - almost totally worked! The only thing that needed change was
unit: {IsUnit(input.LT(1).Text)}?=> WORD;
instead of
unit: {IsUnit(input.LA(1).Text)}?=> WORD;
Cheers, Sven
>>> Markus wrote:
I don't know much about your grammar, but if you want to do this then
gated semantic predicates might help:
unit: {IsUnit(input.LA(1).Text)}?=> WORD;
This uses the IsUnit method to decide if the next token is a unit
without taking the token off the token stream. If IsUnit returns false
the unit rule will be invisible to the parser and it will try to find
another rule that matches.
Markus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address