Beispiel #1
0
void
dopass_codegen(Program_ptr ast, SymTab * st)
{
    Codegen *codegen = new Codegen(stdout, st); //create the visitor
    ast->accept(codegen);                           //walk the tree with the visitor above
    delete codegen;
}
Beispiel #2
0
void dopass_constantfolding(Program_ptr ast, SymTab* st) {
        ConstantFolding* constant_folding = new ConstantFolding(stderr, st); //create the visitor
	LatticeElemMap *map = new LatticeElemMap();
        map = ast->accept(constant_folding, map); //walk the tree with the visitor above
	delete map;
	delete constant_folding;
}
Beispiel #3
0
void dopass_ast2dot(Program_ptr ast) {
    Ast2dot* ast2dot = new Ast2dot(stdout); //create the visitor
    ast->accept(ast2dot); //walk the tree with the visitor above
    ast2dot->finish(); // finalize the printout
    delete ast2dot;
}
Beispiel #4
0
void dopass_typecheck(Program_ptr ast, SymTab* st) {
    Typecheck* typecheck = new Typecheck(stderr, st); //create the visitor
    ast->accept(typecheck); //walk the tree with the visitor above
    delete typecheck;
}