[antlr-interest] How to know if parse successfully

Nigel Sheridan-Smith nbsherid at secsme.org.au
Tue Feb 8 13:29:32 PST 2005



> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of niry
> Sent: Tuesday, 8 February 2005 6:39 PM
> To: antlr-interest at antlr.org
> Subject: Re: RE: [antlr-interest] How to know if parse successfully
>=20
> >
> >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:(
> >

You might want to look at the "paraphrase" option in the reference =
manual if
you want to replace "EOF" with your own text to be reported back to the
user...

Nigel


--
Nigel Sheridan-Smith
PhD research student

Faculty of Engineering
University of Technology, Sydney
Phone: 02 9514 7946
Fax: 02 9514 2435




More information about the antlr-interest mailing list