Hi all,
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 ...
In the above scenario, if the flag is set to true, the rule is alowed
to contain an additional optional token T2.
The above solution does not work because I get a "failed predicate"
error when isT2Alowed is false. The same applies when I use normal
predicates as in: ({ isT2Alowed }? T2?)
Any solution to this besides branching the whole rule in two
alternatives, one that contains the T2 and one that doesn't? (that
will make my grammar ugly and is also not scalable if there are
multiple such tokens that depend on different flags)
Thanks!
Regards,
Gabriel
--
MSc Gabriel Petrovay
MCSA, MCDBA, MCAD
Mobile: +41(0)787978034
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
-~----------~----~----~----~------~----~------~--~---