Beispiel #1
0
        public void Visit(MinusOperator @operator)
        {
            @operator.LeftNode.Accept(this);
            var leftValue = this.Result;

            @operator.RightNode.Accept(this);
            var rightValue = this.Result;

            if (leftValue == null || rightValue == null)
            {
                Result = null;
            }
            else
            {
                try
                {
                    Result = checked (leftValue - rightValue);
                }
                catch
                {
                    ErrorHandler.PrintError(Errors.Overflow);
                    Result = null;
                }
            }
        }
Beispiel #2
0
 public void Visit(MinusOperator @operator)
 {
     ParenthesizedExpression.Append("(");
     @operator.LeftNode.Accept(this);
     ParenthesizedExpression.Append("-");
     @operator.RightNode.Accept(this);
     ParenthesizedExpression.Append(")");
 }
Beispiel #3
0
        public void Visit(MinusOperator @operator)
        {
            @operator.LeftNode.Accept(this);
            var leftValue = this.Result;

            @operator.RightNode.Accept(this);
            var rightValue = this.Result;

            Result = leftValue - rightValue;
        }