[antlr-interest] ANTLR wanting to consume weird characters when using negation

Petteri Räty betelgeuse at gentoo.org
Sat Apr 9 01:56:24 PDT 2011


I am trying to get the attached grammar to match from one token to the
next. The generated code has this if which doesn't look correct to me:

if ( (input.LA(1)>='\u0000' &&
input.LA(1)<='\u0004')||(input.LA(1)>='\u0006' && input.LA(1)<='\uFFFF') ) {
            	        input.consume();

 }

I don't see why it should consume \u0005 which seems to be some kind of
a non printable character. I am using antlr 3.3. Is this a bug in ANTLR
or am I just doing something wrong?

Regards,
Petteri
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_negation.g
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20110409/dfa6b392/attachment.pl 


More information about the antlr-interest mailing list