Esempio n. 1
0
 public override bool Equals(object obj)
 {
     if (this == obj)
     {
         return(true);
     }
     if (obj == null || obj.GetType() != GetType())
     {
         return(false);
     }
     Db4objects.Db4o.NativeQueries.Expr.Cmp.Operand.ArithmeticExpression casted = (Db4objects.Db4o.NativeQueries.Expr.Cmp.Operand.ArithmeticExpression
                                                                                   )obj;
     return(_left.Equals(casted._left) && _right.Equals(casted._right) && _op.Equals(casted
                                                                                     ._op));
 }
        public void Visit(ArithmeticExpression operand)
        {
            operand.Left().Accept(this);
            var left = _value;
            operand.Right().Accept(this);
            var right = _value;
            switch (operand.Op().Id())
            {
                case ArithmeticOperator.AddId:
                {
                    _value = Add(left, right);
                    break;
                }

                case ArithmeticOperator.SubtractId:
                {
                    _value = Subtract(left, right);
                    break;
                }

                case ArithmeticOperator.MultiplyId:
                {
                    _value = Multiply(left, right);
                    break;
                }

                case ArithmeticOperator.DivideId:
                {
                    _value = Divide(left, right);
                    break;
                }

                case ArithmeticOperator.ModuloId:
                {
                    _value = Modulo(left, right);
                    break;
                }
            }
        }
 public virtual void Visit(ArithmeticExpression operand)
 {
     operand.Left().Accept(this);
     operand.Right().Accept(this);
 }
        public virtual void Visit(ArithmeticExpression operand)
        {
            var oldInArithmetic = _inArithmetic;
            _inArithmetic = true;
            operand.Left().Accept(this);
            operand.Right().Accept(this);
            var operandType = ArithmeticType(operand);
            switch (operand.Op().Id())
            {
                case ArithmeticOperator.AddId:
                {
                    _methodBuilder.Add(operandType);
                    break;
                }

                case ArithmeticOperator.SubtractId:
                {
                    _methodBuilder.Subtract(operandType);
                    break;
                }

                case ArithmeticOperator.MultiplyId:
                {
                    _methodBuilder.Multiply(operandType);
                    break;
                }

                case ArithmeticOperator.DivideId:
                {
                    _methodBuilder.Divide(operandType);
                    break;
                }

                case ArithmeticOperator.ModuloId:
                {
                    _methodBuilder.Modulo(operandType);
                    break;
                }

                default:
                {
                    throw new Exception("Unknown operand: " + operand.Op());
                }
            }
            Box(_opClass, !oldInArithmetic);
            _inArithmetic = oldInArithmetic;
        }
		public virtual void Visit(ArithmeticExpression operand)
		{
		}