public override void VisitAssignmentExpression(AssignmentExpression expression)
        {
            base.VisitAssignmentExpression(expression);

            Identifier identifier = expression.FindIdentifier();

            if (identifier == null)
            {
                return;
            }

            switch (expression.Operator)
            {
            case AssignmentOperatorType.BitwiseOr:
            case AssignmentOperatorType.BitwiseAnd:
            case AssignmentOperatorType.ExclusiveOr:
            case AssignmentOperatorType.Add:
            case AssignmentOperatorType.Subtract:
            case AssignmentOperatorType.Divide:
            case AssignmentOperatorType.Modulus:
            case AssignmentOperatorType.Multiply:
            case AssignmentOperatorType.ShiftLeft:
            case AssignmentOperatorType.ShiftRight:
            case AssignmentOperatorType.Assign:
                this.lineMap[this.id++] = expression.StartLocation.Line;
                break;
            }
        }
Beispiel #2
0
        public override void VisitAssignmentExpression(AssignmentExpression expression)
        {
            base.VisitAssignmentExpression (expression);

            Identifier identifier = expression.FindIdentifier();
            if (identifier == null)
                return;

            switch (expression.Operator)
            {
                case AssignmentOperatorType.BitwiseOr:
                case AssignmentOperatorType.BitwiseAnd:
                case AssignmentOperatorType.ExclusiveOr:
                case AssignmentOperatorType.Add:
                case AssignmentOperatorType.Subtract:
                case AssignmentOperatorType.Divide:
                case AssignmentOperatorType.Modulus:
                case AssignmentOperatorType.Multiply:
                case AssignmentOperatorType.ShiftLeft:
                case AssignmentOperatorType.ShiftRight:
                {
                    BinaryOperatorType op = GetComplexAssignOperator (expression.Operator);
                    Expression right = new BinaryOperatorExpression (new IdentifierExpression (identifier.Name), op, expression.Right.Clone());

                    expression.Operator = AssignmentOperatorType.Assign;
                    expression.Right = GetAssignmentExpression (identifier, right);

                    break;
                }

                case AssignmentOperatorType.Assign:
                    expression.Right = GetAssignmentExpression (identifier, expression.Right);
                    break;
            }
        }
Beispiel #3
0
        public override void VisitAssignmentExpression(AssignmentExpression expression)
        {
            base.VisitAssignmentExpression (expression);

            Identifier identifier = expression.FindIdentifier();
            if (identifier == null)
                return;

            switch (expression.Operator)
            {
                case AssignmentOperatorType.BitwiseOr:
                case AssignmentOperatorType.BitwiseAnd:
                case AssignmentOperatorType.ExclusiveOr:
                case AssignmentOperatorType.Add:
                case AssignmentOperatorType.Subtract:
                case AssignmentOperatorType.Divide:
                case AssignmentOperatorType.Modulus:
                case AssignmentOperatorType.Multiply:
                case AssignmentOperatorType.ShiftLeft:
                case AssignmentOperatorType.ShiftRight:
                case AssignmentOperatorType.Assign:
                    this.lineMap[this.id++] = expression.StartLocation.Line;
                    break;
            }
        }
        public override void VisitAssignmentExpression(AssignmentExpression expression)
        {
            base.VisitAssignmentExpression(expression);

            Identifier identifier = expression.FindIdentifier();

            if (identifier == null)
            {
                return;
            }

            switch (expression.Operator)
            {
            case AssignmentOperatorType.BitwiseOr:
            case AssignmentOperatorType.BitwiseAnd:
            case AssignmentOperatorType.ExclusiveOr:
            case AssignmentOperatorType.Add:
            case AssignmentOperatorType.Subtract:
            case AssignmentOperatorType.Divide:
            case AssignmentOperatorType.Modulus:
            case AssignmentOperatorType.Multiply:
            case AssignmentOperatorType.ShiftLeft:
            case AssignmentOperatorType.ShiftRight:
            {
                BinaryOperatorType op    = GetComplexAssignOperator(expression.Operator);
                Expression         right = new BinaryOperatorExpression(new IdentifierExpression(identifier.Name), op, expression.Right.Clone());

                expression.Operator = AssignmentOperatorType.Assign;
                expression.Right    = GetAssignmentExpression(identifier, right);

                break;
            }

            case AssignmentOperatorType.Assign:
                expression.Right = GetAssignmentExpression(identifier, expression.Right);
                break;
            }
        }