public virtual object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
 {
     Debug.Assert((assignmentExpression != null));
     Debug.Assert((assignmentExpression.Left != null));
     Debug.Assert((assignmentExpression.Right != null));
     assignmentExpression.Left.AcceptVisitor(this, data);
     return assignmentExpression.Right.AcceptVisitor(this, data);
 }
 public override object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
 {
     if (assignmentExpression.Op == AssignmentOperatorType.Add) {
         AddEventHandler(assignmentExpression.Left, assignmentExpression.Right, data);
     } else {
         if (assignmentExpression.Left is IdentifierExpression) {
             AddStmt(new CodeAssignStatement((CodeExpression)assignmentExpression.Left.AcceptVisitor(this, null), (CodeExpression)assignmentExpression.Right.AcceptVisitor(this, null)));
         } else {
             AddStmt(new CodeAssignStatement((CodeExpression)assignmentExpression.Left.AcceptVisitor(this, null), (CodeExpression)assignmentExpression.Right.AcceptVisitor(this, null)));
         }
     }
     return null;
 }
 public override sealed object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
 {
     this.BeginVisit(assignmentExpression);
     object result = this.TrackedVisitAssignmentExpression(assignmentExpression, data);
     this.EndVisit(assignmentExpression);
     return result;
 }
 public virtual object TrackedVisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
 {
     return base.VisitAssignmentExpression(assignmentExpression, data);
 }
 public virtual object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
 {
     throw new global::System.NotImplementedException("AssignmentExpression");
 }
Esempio n. 6
0
        void ExpressionStatement(out Statement statement)
        {
            Expression expr = null;
            Expression val = null;
            AssignmentOperatorType op;
            Location startLoc = la.Location;

            bool mustBeAssignment = la.kind == Tokens.Plus  || la.kind == Tokens.Minus ||
                                    la.kind == Tokens.Not   || la.kind == Tokens.Times;

            SimpleExpr(out expr);
            if (StartOf(46)) {
            AssignmentOperator(out op);
            Expr(out val);
            expr = new AssignmentExpression(expr, op, val);
                expr.StartLocation = startLoc;
                expr.EndLocation = t.EndLocation;

            } else if (la.kind == 1 || la.kind == 21 || la.kind == 111) {
            if (mustBeAssignment) Error("error in assignment.");
            } else SynErr(312);
            if(expr is MemberReferenceExpression || expr is IdentifierExpression) {
                Location endLocation = expr.EndLocation;
                expr = new InvocationExpression(expr);
                expr.StartLocation = startLoc;
                expr.EndLocation = endLocation;
            }
            statement = new ExpressionStatement(expr);
        }
 public virtual object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
 {
     Debug.Assert((assignmentExpression != null));
     Debug.Assert((assignmentExpression.Left != null));
     Debug.Assert((assignmentExpression.Right != null));
     nodeStack.Push(assignmentExpression.Left);
     assignmentExpression.Left.AcceptVisitor(this, data);
     assignmentExpression.Left = ((Expression)(nodeStack.Pop()));
     nodeStack.Push(assignmentExpression.Right);
     assignmentExpression.Right.AcceptVisitor(this, data);
     assignmentExpression.Right = ((Expression)(nodeStack.Pop()));
     return null;
 }