[antlr-interest] How to know if parse successfully

Ric Klaren ric.klaren at gmail.com
Tue Feb 8 01:36:17 PST 2005


On Tue, 8 Feb 2005 15:39:07 +0800, niry <niry at 263.net> wrote:
> >Maybe you are trying to do line-by-line parsing? Add the EOF token to the
> >end of your main production/rule. That will force matching of only one
> >expression at a time.
> Yes! You have answered my another question:"2. what's up with the error detect? confused! (niry)"
> After I posted that question, I added a EOF to the end of my main rule.
> mmm, anyway, when input is not suited for the rule, some error message like "expect EOF" appears,
> looks more than professional:(

This might be of interest if you do line by line parsing.

http://www.jguru.com/faq/view.jsp?EID=893706

Cheers,

Ric


More information about the antlr-interest mailing list