[antlr-interest] Antlr, Errors, and the console

Andreas Stefik stefika at gmail.com
Tue Jun 14 13:08:05 PDT 2011


Hey folks,

Simple question. I want to turn off the default behavior of reporting
lexer/parser errors to the console. The most obvious way I could think
was to just override a few methods:

@lexer::members {
    public void reportError(RecognitionException e) { //override and do nothing
    }
}

@members{
	public void reportError(RecognitionException e) {
    	}
}

This seems to work. While I don't immediately see a problem in my
application (with limited testing so far), is there a different/easier
way I am supposed to be doing this? Will this cause potential problems
(perhaps antlr uses this internally for something important)?

Stefik


More information about the antlr-interest mailing list