[antlr-interest] [c target] debugging using antlrworks
Юрушкин Михаил
yurushkin at rambler.ru
Tue Oct 6 06:40:16 PDT 2009
> >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.
It's not MY parser.. I used code example from ANTLRWORKS
("C/hoistedPredicates" example).
I generated debug version of this project, but debugger doesnt work
correctly (see my last message).
Could u check this example (with the antlrworks debugger)? If you'll get
positive result, please, send me your project! Your example will help me
very mutch!
have a nice working day,
Michael
More information about the antlr-interest
mailing list