public virtual T VisitAugAssignNode(AugAssignNode n) { T a = n.lhs.Accept(this); T b = n.rhs.Accept(this); return(default(T)); }
public object VisitAugAssignNode(AugAssignNode n) { WriteLine(n.kind + " - " + n.op); Indent(); Visit(n.lhs); Visit(n.rhs); Dedent(); return(null); }
public override MIPSRegister VisitAugAssignNode(AugAssignNode n) { var lhs = Gen(n.lhs); var rhs = Gen(n.rhs); switch (n.op) { case "*=": { emit.Emit("mul", lhs, lhs, rhs); } break; case "/=": { emit.Emit("quo", lhs, lhs, rhs); } break; case "%=": { emit.Emit("rem", lhs, lhs, rhs); } break; case "+=": { emit.Emit("add", lhs, lhs, rhs); } break; case "-=": { emit.Emit("sub", lhs, lhs, rhs); } break; case "<<=": { emit.Emit("sllv", lhs, lhs, rhs); } break; case ">>=": { emit.Emit("srav", lhs, lhs, rhs); } break; case "&=": { emit.Emit("and", lhs, lhs, rhs); } break; case "^=": { emit.Emit("xor", lhs, lhs, rhs); } break; case "|=": { emit.Emit("or", lhs, lhs, rhs); } break; } return(null); }
public override LLVMRegister VisitAugAssignNode(AugAssignNode n) { throw new NotImplementedException(); }
public override object VisitAugAssignNode(AugAssignNode n) { Visit(n.lhs); Visit(n.rhs); return(null); }
public override object VisitAugAssignNode(AugAssignNode n) { Visit(n.lhs); Visit(n.rhs); semanticChecker.CheckAndReport(n.lhs.Type.Match(n.rhs.Type), n.sourceLoc, "Type mismatch - AugAssign"); return(null); }
public override LData VisitAugAssignNode(AugAssignNode n) { LData lhs = Visit(n.lhs); LData rhs = Visit(n.rhs); switch (n.op) { case "*=": { dynamic newval = lhs.GetValue() * rhs.GetValue(); lhs.SetValue(newval); } break; case "/=": { dynamic newval = lhs.GetValue() / rhs.GetValue(); lhs.SetValue(newval); } break; case "%=": { dynamic newval = lhs.GetValue() % rhs.GetValue(); lhs.SetValue(newval); } break; case "+=": { dynamic newval = lhs.GetValue() + rhs.GetValue(); lhs.SetValue(newval); } break; case "-=": { dynamic newval = lhs.GetValue() - rhs.GetValue(); lhs.SetValue(newval); } break; case "<<=": { dynamic newval = lhs.GetValue() << rhs.GetValue(); lhs.SetValue(newval); } break; case ">>=": { dynamic newval = lhs.GetValue() >> rhs.GetValue(); lhs.SetValue(newval); } break; case "&=": { dynamic newval = lhs.GetValue() & rhs.GetValue(); lhs.SetValue(newval); } break; case "^=": { dynamic newval = lhs.GetValue() ^ rhs.GetValue(); lhs.SetValue(newval); } break; case "|=": { dynamic newval = lhs.GetValue() | rhs.GetValue(); lhs.SetValue(newval); } break; } return(lhs); }