[antlr-interest] How does one suppress 'no viable alternative at character' warning messages

Tim Halloran hallorant at gmail.com
Wed Sep 17 13:50:57 PDT 2008


Max,

Thanks for the reference I update the wiki to include the solution I came up
with.

Regards,
Tim

On Wed, Sep 17, 2008 at 4:18 PM, Markus Stoeger <spamhole at gmx.at> wrote:

> Terence Parr schrieb:
> > Try overriding  nextToken()...hmm...that might be hard.
> >
> Would this FAQ solve Tim's problem?
> http://www.antlr.org/wiki/pages/viewpage.action?pageId=5341217
>
> We used that today and it worked. It makes any unmatched character stop
> the whole thing. The method explained in the book's chapter 10.4 about
> exiting the recognizer on the first error only works for the parser, but
> not for the lexer. The lexer still accepts unknown characters and
> continues.
>
> I think it would be great if error reporting and recovery were
> configurable or at least easier to modify than by overriding methods.
> (Correctly) overriding methods is quite complicated and hard to get
> right imo. Especially when you're new to antlr and don't know the
> internals very well yet it's quite easy to screw it up (I have
> experience with screwing it up ;-).
>
> Max
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080917/0c6ec9d4/attachment.html 


More information about the antlr-interest mailing list