[antlr-interest] ANTLRWorks /debugger question?

Jim Idle jimi at temporal-wave.com
Tue Oct 7 07:16:48 PDT 2008


On Tue, 2008-10-07 at 09:51 +0200, Joost Kraaijeveld wrote:

> Hi, 
> 
> I have a grammar that if I do a "check grammar" reports that it is OK.
> If I run it through the debugger the debugger stops in the end, but the
> left (stop?) button in the debugger screen stays black. and the debugger
> active.
> 
> My question: should the debugger stop after parsing the file? Is so, I
> assume that my (very simple but than too difficult for me) grammar is
> not correct: is there something special about handling EOF ?


No, it does not stop the debugger because if you look at the debugging
controls, you can now step backwards through the parse, rewind to the
start and so on, so if the debugger stopped when your parser finishes,
you would not be able to do that. 

The only thing about EOF is that you should tell your parser to expect
EOF, if there is anything special to you about EOF. IN other words, if
you parser should stop at the end of valid input, and not complain about
anything that follows valid input, then don't put an EOF marker in the
parser, but if the parser should try to consume all the available input,
then do place an EOF at the end of your top rule. The debugger won't
stop when it gets there though for the same reasons as above.

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081007/ba18e2cd/attachment.html 


More information about the antlr-interest mailing list