[antlr-interest] ArrayIndexOutOfBoundsException
Gavin Lambert
antlr at mirality.co.nz
Sat Feb 2 03:13:45 PST 2008
At 23:45 2/02/2008, Steve Bennett wrote:
>Frustratingly, when I try to look up the traceback in the
>generated code, the line numbers don't seem to match. For
>example, synpred38 is labelled as being on line 23214, but
>it should be 18939-18951. In the generated code I do see
>the failed call to predict. Is there some debugging code
>I could put in that might shed light?
Presumably you're using ANTLRworks' debug mode, then, rather than
running it directly?
Open up ANTLRworks' Preferences page and have a look at the Output
Path on the first page. It'll either be set to "Same as grammar"
or a custom path. Either way, open up that folder.
Now start a debugging session. (That's important -- "Generate
Code" produces a release build, while starting the debugger
produces a debug build. They're slightly different.) The
generated lexer and parser files in the output folder should now
be up to date, and match what ANTLRworks is actually running with.
More information about the antlr-interest
mailing list