public override void gen(int begin, int after) { if (Expr is FuncCall) { if (t == null) { emitfunSet(Expr, Id); } else { emitfunSet(Expr, t); } } else { if (t == null) { CurrentGenerator.Set(Id, Expr.gen()); } else { CurrentGenerator.Set(t, Expr.gen()); } } }
public override Expr reduce() { Expr x = gen(); Temp t = new Temp(Type); CurrentGenerator.Temp(t); CurrentGenerator.Set(t, x); return(t); }
public override Expr gen() { int f = CurrentGenerator.AllocLabel(); int a = CurrentGenerator.AllocLabel(); Temp t = new Temp(Type); CurrentGenerator.Temp(t); jumping(0, f); CurrentGenerator.Set(t, Constant.True); CurrentGenerator.Goto(a); CurrentGenerator.Label(f); CurrentGenerator.Set(t, Constant.False); CurrentGenerator.Label(a); return(t); }