[antlr-interest] Failing upon illigal input termination

Vitaliy Vitaliy at dbsophic.com
Sun Nov 9 00:00:19 PST 2008


That's very reasonable.
I just wish it would have been documented anywhere..

Again, IMHO, Antlr is an amazing tool for an open source project, with so much power to it,
I just wish it would have been better documented.

Anyway, Thanks again,
Vitaliy

-----Original Message-----
From: Johannes Luber [mailto:jaluber at gmx.de]
Sent: Thursday, November 06, 2008 22:12
To: Vitaliy
Cc: Gavin Lambert; antlr-interest at antlr.org
Subject: Re: [antlr-interest] Failing upon illigal input termination

Vitaliy schrieb:
> Gavin,
>
> Thanks so much!!!
> That did it!
>
> Wasted so much time on this one..
> Wonder why this is not the default behavior?

Because ANTLR doesn't know which rule should be the starting rule. Using
an option to specify this rule falls short for people who need several
rules with EOF. Then again those people may not use such an option anyway.

Johannes
>
> Anyway, Thanks again!!
>
> Vitaliy
>
> -----Original Message-----
> From: Gavin Lambert [mailto:antlr at mirality.co.nz]
> Sent: Thursday, November 06, 2008 09:41
> To: Vitaliy; antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Failing upon illigal input termination
>
> At 04:55 6/11/2008, Vitaliy wrote:
>> That is, If we've got the input:
>> LegalStatement1,
>> LegalStatement2,
>> ...
>> LegalStatementN,
>> IllegalStatement,
>>
>> Antlr would stop on LegalStatementN,
>> Instead of reporting an error for IllegalStatement.
>>
>> What can I do to achieve this behavior?
>
> Add EOF to the end of your top-level parser rule.
>
>
>
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 3589 (20081106) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 3591 (20081106) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>






__________ Information from ESET NOD32 Antivirus, version of virus signature database 3597 (20081108) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 3597 (20081108) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



More information about the antlr-interest mailing list