public void PostWalk(AugAssignStatement node) { PostProcess(node); }
// AugAssignStatement public bool Walk(AugAssignStatement node) { return Process(node); }
public override void PostWalk(AugAssignStatement node) { node.Left.Walk(fdef); }
// AugAssignStmt public override bool Walk(AugAssignStatement node) { return true; }
public override bool Walk(AugAssignStatement node) { Emit(node); return false; }
public virtual void PostWalk(AugAssignStatement node) { }
// AugAssignStatement public virtual bool Walk(AugAssignStatement node) { return true; }
// AugAssignStmt public override bool Walk(AugAssignStatement node) { node.Left.Walk(define); return true; }
//expr_stmt: testlist (augassign testlist | ('=' testlist)*) //augassign: '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' | '^=' | '<<=' | '>>=' | '**=' | '//=' private Statement ParseExprStmt() { Expression lhs = ParseTestListAsExpr(false); if (MaybeEat(TokenKind.Assign)) { List<Expression> l = new List<Expression>(); l.Add(lhs); do { Expression e = ParseTestListAsExpr(false); l.Add(e); } while (MaybeEat(TokenKind.Assign)); int last = l.Count - 1; Expression rhs = (Expression)l[last]; l.RemoveAt(last); Expression[] lhss = l.ToArray(); //We check for legal assignment targets during code generation rather than parsing Statement ret = new AssignStatement(lhss, rhs); ret.SetLoc(GetExternal(), lhs.Start, GetEnd()); return ret; } else { BinaryOperator op = GetAssignOp(PeekToken()); if (op == null) { Statement ret = new ExpressionStatement(lhs); ret.SetLoc(GetExternal(), lhs.Start, GetEnd()); return ret; } else { NextToken(); Expression rhs = ParseTestListAsExpr(false); Statement ret = new AugAssignStatement(op, lhs, rhs); ret.SetLoc(GetExternal(), lhs.Start, GetEnd()); return ret; } } }