static void doTreeAction(const string& f, RefAST t) { if ( t==nullAST ) return; JavaTreeParser tparse; try { tparse.compilationUnit(t); // System.out.println("successful walk of result AST for "+f); } catch (RecognitionException& e) { cerr << e.getMessage() << endl; // e.printStackTrace(); } }
static void doTreeAction( ASTFactory& factory, RefAST t) { if ( t == nullAST ) return; JavaTreeParser tparse; tparse.initializeASTFactory(factory); tparse.setASTFactory(&factory); try { tparse.compilationUnit(t); } catch (ANTLRException& e) { cerr << e.toString() << endl; } }