[antlr-interest] C# Bug in CharScanner
open.zone at virgin.net
Wed Jun 8 02:33:57 PDT 2005
Thanks Dr. Kocker. My apologies for the dealy in repsonding to your report.
This is indeed an issue with ANTLR/C# and will be fixed in the next 2.x
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Dr. Hartmut Kocher
Sent: 31 May 2005 22:57
To: antlr-interest at antlr.org
Subject: [antlr-interest] C# Bug in CharScanner
I think I found a bug in the C# CharScanner:
The rewind() method does not take into account the case insensitive flag.
Therefore, if the scanner is rewound after a wrong prediction, it throws an
exception if the case of a case insensitive token does not match.
I think the correct implementation should be:
public virtual void rewind(int pos)
cached_LA2 = inputState.input.LA(2);
cached_LA1 = inputState.input.LA(1);
cached_LA2 = toLower(inputState.input.LA(2));
cached_LA1 = toLower(inputState.input.LA(1));
Dr. Hartmut Kocher
Cortex Brainware GmbH
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the antlr-interest