[antlr-interest] How to disable error messages
Benjamin Niemann
pink at odahoda.de
Sat Jun 14 11:10:30 PDT 2008
Hi Jack,
Are you possibly feeding non-ascii data as a byte string into the
parser? If you are parsing non-ascii data, you have to decode it into
a unicode string before handing it off to ANTLR.
And now to surpressing the messages (if you really want that): the
easiest way is probably to override the emitErrorMessage methods of
your lexer and parser classes.
-Ben
On Sat, Jun 14, 2008 at 7:53 PM, JLIST <jlist9 at gmail.com> wrote:
> Hi,
>
> I'm using Python code generated by Antlr. I'm getting a lot
> of errors like this:
>
> line 1:0 no viable alternative at character '\xe6'
>
> The grammar works OK so I'd like to disable these errors from
> the console after starting the program. I wonder if there is a
> simple way to turn that off from code?
>
> Thanks,
> Jack
>
>
More information about the antlr-interest
mailing list