[antlr-interest] Does overriding display not turn off messages sent to std error?

John B. Brodie jbb at acm.org
Thu Sep 1 17:52:20 PDT 2011


Greetings!

This is just off the top of my head, so is probably a bogus answer.....

On Thu, 2011-09-01 at 19:26 -0500, Dejas Ninethousand wrote:
> I have this entry in my grammar file:
> 
> @members
> {
> 
> @Override
> public void displayRecognitionError(String[] tokenNames,
> RecognitionException e)
> {
>         errors.add(new ErrorWrapper(getErrorMessage(e, tokenNames), e.line,
> e.c));
> }
> }
> 
> but when using the parser I still see a lot of messages like:
> 
> line 1:427908 no viable alternative at character ')'
> line 1:427909 no viable alternative at character ')'
> 
> sent to std error. I thought override displayRecognitionError prevented
> that.
> 

i think that those errors are coming from your lexer.

and you have only overridden the parser's error display routine.





More information about the antlr-interest mailing list