[antlr-interest] Lexer Bug?

Adam Bishop (DSLWN) AdamB at datacom.co.nz
Thu Feb 9 19:07:15 PST 2006


If I define a lexer rule:

NOT_EQUALS : "<>" | "!=" ;

 

It matches the string "<="

 

The lexer nextToken method shows:

 

else if ((LA(1)=='!'||LA(1)=='<') && (LA(2)=='='||LA(2)=='>') && (true)
&& (true) && (true) && (true) && (true) && (true)) {

 

which is flawed.

 

I have solved my problem for this by moving the definition of
LESS_THAN_OR_EQUALS above the definition of NOT_EQUALS.

 

Is this a bug, or am I doing something flawed?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060210/424fa9c8/attachment.html


More information about the antlr-interest mailing list