[antlr-interest] [c target] debugging using antlrworks
Gavin Lambert
antlr at mirality.co.nz
Mon Oct 5 13:51:02 PDT 2009
At 10:48 5/10/2009, =?koi8-r?B?4NLV28vJziDtycjBycw=?= wrote:
>I used your grammar (with small modification). the same
result...
Don't forget to use Reply All to keep replies on-list...
>1) I generate lexer and parser using -debug option.
>2) I run my project. It starts to listen antlrworks (standard
port,
>I checked).
>3) I open MyParser.g grammar and click "Remote debug". I use
>standard port.
>4) My parser continies to work... and stops when it reach
> "DBG->enterRule(DBG, getGrammarFileName(), (const char
>*)"statement");" line
>5) In this procedure parser transmits some info to debugger and
>waits.
>6) I click "Step forward" and parser continies it work and
>returns.. In AntlrWorks I tried to use breakpoints and "step
>over" button - no results.
Possibly your parser is not matching anything. Try adding EOF to
the end of your top-level rule; this tells it that it must consume
all the input or generate an error.
Remember, the ANTLRWorks debugger is useless for finding problems
with lexer rules; you really need to write unit tests in order to
verify those before worrying about what's going on in your parser
rules.
More information about the antlr-interest
mailing list