Hi,
I have a special area in this language that has symbols within a table
structure that are normally used in other tokens in other areas of the language
(like a couple digits, a couple letters and a couple symbols). So I am trying
to setup the lexer to accept these table tokens only when in a table. Based on
what I have been able to dig up, I believe gated semantic predicates are a
valid way to disable rules in the lexer. However, I am seeing issues with this
with ANTLR 3.2 and the java language target.
So I expected a lexer rules like this to do the trick:
Level0 : {inTable}?=> '0';
But that actually creates a very strange loop when inTable is false. I
basically throws a FailedPredicateException (which I would not have expected
for a gated predicate) and then retries the same token with the same rule,
obviously resulting in an infinite loop.
Can someone clarify whether this is allowed and if so whether there is some
trick to using it? I am stumped.
Thanks
Jeff
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.