At 06:23 26/04/2009, Gabriel Petrovay wrote:
>This is my problem. I only know at runtime of a rule is alowed
to
>contain a token based on o flag in the parser. Moreover, this
>token, if alowed, is optional.
>
>Example:
>rule : T1 ({ isT2Alowed }?=> T2?) T3 ...
I haven't tested this, but in theory it should work:
rule : T1 ({ isT2Allowed }? => T2)? T3 ...
(When you use a predicate, lookahead is still checked -- so the T2
will still be optional even when isT2Allowed.)
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---