[antlr-interest] Resolving single quote in lexer

avoidboredom avoidboredom at yahoo.com
Thu Jun 26 13:38:45 PDT 2003


I am doing a lexer for visual basic. The problem is single character 
literals and comments both start with single quote. I have rules that 
work work for single characters 
SINGLE_QUOTE (ESC|~'\'') '\''
and comments
SINGLE_QUOTE ( ~'\u000D'  )*  
However I don't know how to put them both in the same lexer! 
When I do, the lexer gives priority to the single character rule. I 
have tried combinations of using or (|) but this doesn't seem to 
work. Also, increasing lookahead didn't help.

Thanks in advance.


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list