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; }
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; }
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; }
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; }