public void visit(IrProg p) { funcs = p.funcs; IrFunc mf = findFunc("main"); if (null == mf) throw new Exception("main function not found"); //sp = sp - mf.varCnt - mf.argCnt - 1; mf.accept(this); //sp = sp + mf.varCnt + mf.argCnt + 1; }
public IrProg visit(IrProg t) { return new IrProg(t.funcs.accept(this)); }