" ;\n"+
"b : r=a {###"+action+"!!!}\n" +
" ;");
Tool antlr = newTool();
antlr.setOutputDirectory(null); // write to /dev/null
CodeGenerator generator = new CodeGenerator(antlr, g, "Java");
g.setCodeGenerator(generator);
generator.genRecognizer(); // codegen phase sets some vars we need
ST codeST = generator.getRecognizerST();
String code = codeST.render();
String found = code.substring(code.indexOf("###")+3,code.indexOf("!!!"));
assertEquals(expecting, found);
assertEquals("unexpected errors: "+equeue, 0, equeue.errors.size());