[antlr-interest] Strange Mismatched Token Exception

Nicolai Mainiero nicolai at mainiero.de
Fri Jan 12 08:23:03 PST 2007


Hi,

Am 12.01.2007 um 11:11 schrieb David Holroyd:

> On Fri, Jan 12, 2007 at 10:43:19AM +0100, Nicolai Mainiero wrote:
>> mismatched token: [@2,26:26='(',<44>,1:26]; expecting type '('
>
> Could it be that some other lexer rule than the one you expect has
> matched the '(' character?
>
> Look in the generated code, at the constants defined for token types,
> and see what kind that one actually is (I think the 44 is the numeric
> type value in the error message, but it might be one of the other
> numbers).
>
> Another possibility is that you've made a grammar change, and  
> recompiled
> the lexer but not the parser (or vice versa) so the constants are out
> of sync between the .class files.
>

It seems that the lexer and parser were actually out of sync. Thanks  
for this hint.

Greets Nicolai

>
> hope that helps,
> dave
>
> -- 
> http://david.holroyd.me.uk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2421 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20070112/74ac596f/attachment.bin 


More information about the antlr-interest mailing list