BoundExpression BindIncDec(AST.IncDecEx expr) { // bind variable reference var varref = (BoundReferenceExpression)BindExpression(expr.Variable, BoundAccess.ReadAndWrite); // resolve kind UnaryOperationKind kind; if (expr.Inc) { kind = (expr.Post) ? UnaryOperationKind.OperatorPostfixIncrement : UnaryOperationKind.OperatorPrefixIncrement; } else { kind = (expr.Post) ? UnaryOperationKind.OperatorPostfixDecrement : UnaryOperationKind.OperatorPrefixDecrement; } // return(new BoundIncDecEx(varref, kind)); }
/// <summary> /// Visit variable that is incremented (or decremented). /// </summary> /// <param name="x"></param> virtual public void VisitIncDecEx(IncDecEx x) { VisitElement(x.Variable); }