ErrorQueue equeue = new ErrorQueue();
ErrorManager.setErrorListener(equeue);
Grammar g = new Grammar(
"lexer grammar t;\n"+
"R : 'r' {"+action+"};\n");
Tool antlr = newTool();
CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
g.setCodeGenerator(generator);
generator.genRecognizer(); // forces load of templates
ActionTranslator translator =
new ActionTranslator(generator,