[antlr-interest] Limiting tokens selected by lexer in antlr3

Frederick N. Brier fbrier at multideck.com
Mon Jul 16 14:06:17 PDT 2007


I created a simple parsing grammar, but two of the tokens utilize 
slightly different alphanumeric letters, but one should only be selected 
within one set of parser rules and the rest of the time, the other 
should be generated.  I am using antlr3.  I have read about filters and 
trees, and ASTs, but have gotten pretty confused.  How do I from a 
parser rule, tell the lexer to pick one rule over another?  When I exit 
the rule, it should go back to generating the other token.  Please feel 
free to point me at any documentation or examples you know of.  Thank you.

Fred


More information about the antlr-interest mailing list