While lexing/parsing an input for an antlr grammar I would like to have an exception on errors which are the same errors as when using the grun alias from the antlr websites quickstart window.
I deactivated both parser and lexer error listeners with
lexer.removeErrorListeners();
parser.removeErrorListeners();
because they reported ambiguities and other stuff which I do not care about since the parsing process was successful.
How can I devise an error listener which reports errors which come from unsuccessful parsing?