Pattern for returning errors from ANTLR in data structures, not STDERR

My ANTLR parser is embedded in other code. I've decided that reporting errors out of the parser would be better handled as a list of errors instead of having them sent to stderr.

In the v4 prerelease stuff, there is an example. Tool.java has

Tool.java

	public void error(Message msg) {
		if ( listeners.size()==0 ) {
			defaultListener.error(msg);
			return;
		}
		for (ANTLRToolListener l : listeners) l.error(msg);
	}

using ANTLRToolListener.java then in ToolANTLRParser.java I do:

	public void displayRecognitionError(String[] tokenNames,
										RecognitionException e)
	{
		String msg = getParserErrorMessage(this, e);
		if ( paraphrases.size()>0 ) {
			String paraphrase = (String)paraphrases.peek();
			msg = msg+" while "+paraphrase;
		}
	//	List stack = getRuleInvocationStack(e, this.getClass().getName());
	//	msg += ", rule stack = "+stack;
		tool.errMgr.syntaxError(ErrorType.SYNTAX_ERROR, getSourceName(), e.token, e, msg);
	}

which forces all msgs from antlr to shunt to Tool.error(), which announces to listeners.

For testing, i have unit tests use this ErrorQueue.java as a listener to the tool like so:

			Tool antlr = newTool(optionsA);
			antlr.addListener(equeue);