[antlr-interest] Strange Mismatched Token Exception

David Holroyd dave at badgers-in-foil.co.uk
Fri Jan 12 02:11:13 PST 2007


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.


hope that helps,
dave

-- 
http://david.holroyd.me.uk/


More information about the antlr-interest mailing list