public void gen(int b, int a) { int label = newlabel(); expr.jumping(0, a); emitlabel(label); stmt.gen(label, a); }
public void gen(int b, int a) { after = a; int label = newlabel(); stmt.gen(b, label); emitlabel(label); expr.jumping(b, 0); }
public void gen(int b, int a) { if (stmt1 == Stmt.Null) { stmt2.gen(b, a); } else if (stmt2 == Stmt.Null) { stmt1.gen(b, a); } else { int label = newlabel(); stmt1.gen(b, label); emitlabel(label); stmt2.gen(label, a); } }
public void gen(int b, int a) { after = a; expr.jumping(0, a); int label = newlabel(); emitlabel(label); stmt.gen(label, b); emit("goto L" + b); }
public void program() { Stmt s = block(); int begin = s.newlabel(); int after = s.newlabel(); s.emitlabel(begin); s.gen(begin, after); s.emitlabel(after); }
public void gen(int b, int a) { int label1 = newlabel(); int label2 = newlabel(); expr.jumping(0, label2); emitlabel(label1); stmt1.gen(label1, a); emit("goto L" + a); emitlabel(label2); stmt2.gen(label2, a); }