[antlr-interest] Cannot understand why parser accepts input...

Bern.McCarty at bentley.com Bern.McCarty at bentley.com
Fri Dec 7 04:17:32 PST 2007


...but when I enter a clearly invalid input into the interpreter such as
simply "3" or "B=3C the console contains no errors or warnings at all.

How could a mode that allows incorrect input without even issuing a
complaint/warning possibly be helpful? Is there a way to turn it off?

Thanks,
-Bern



-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Gavin Lambert
Sent: Friday, December 07, 2007 3:23 AM
To: Bern McCarty; antlr-interest at antlr.org
Subject: Re: [antlr-interest] Cannot understand why parser accepts
input...

At 17:45 7/12/2007, Bern.McCarty at bentley.com wrote:

>Why does the below grammer successfully parse the input " B ==3C" 
>When there are no numerals allowed anywhere in the grammer?

It's an automatic error-recovery thing.  When ANTLRv3 encounters a 
character it can't figure out, it prints an error to the console 
(by default), drops the character, and then tries again.



More information about the antlr-interest mailing list