示例#1
0
文件: Main.cpp 项目: dbenn/cgp
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();
	}
}
示例#2
0
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;
	}
}