ANTLRv3Lexer lex = new ANTLRv3Lexer(input);
tokens = new TokenRewriteStream(lex);
ANTLRv3Parser g = new ANTLRv3Parser(tokens);
ANTLRv3Parser.grammarDef_return r = g.grammarDef();
CommonTree t = (CommonTree)r.getTree();
if (tree_option) System.out.println(t.toStringTree());
rewrite(g.getTreeAdaptor(),t,g.getTokenNames());
}
public void rewrite(TreeAdaptor adaptor, CommonTree t, String[] tokenNames) throws Exception {
TreeWizard wiz = new TreeWizard(adaptor, tokenNames);