Example #1
0
 public ArithmeticExpression(IComparisonOperand left, IComparisonOperand right, ArithmeticOperator
                             op)
 {
     this._op    = op;
     this._left  = left;
     this._right = right;
 }
Example #2
0
		public ThreeWayComparison(FieldValue left, IComparisonOperand right, bool swapped
			)
		{
			this._left = left;
			this._right = right;
			_swapped = swapped;
		}
 private ITypeRef ArithmeticType(IComparisonOperand operand)
 {
     if (operand is ConstValue)
     {
         return(PrimitiveType(((ConstValue)operand).Value().GetType()));
     }
     if (operand is FieldValue)
     {
         return(((FieldValue)operand).Field.Type);
     }
     if (operand is ArithmeticExpression)
     {
         ArithmeticExpression expr  = (ArithmeticExpression)operand;
         ITypeRef             left  = ArithmeticType(expr.Left());
         ITypeRef             right = ArithmeticType(expr.Right());
         if (left == DoubleType() || right == DoubleType())
         {
             return(DoubleType());
         }
         if (left == FloatType() || right == FloatType())
         {
             return(FloatType());
         }
         if (left == LongType() || right == LongType())
         {
             return(LongType());
         }
         return(IntType());
     }
     return(null);
 }
Example #4
0
		public ArithmeticExpression(IComparisonOperand left, IComparisonOperand right, ArithmeticOperator
			 op)
		{
			this._op = op;
			this._left = left;
			this._right = right;
		}
Example #5
0
 public ThreeWayComparison(FieldValue left, IComparisonOperand right, bool swapped
                           )
 {
     this._left  = left;
     this._right = right;
     _swapped    = swapped;
 }
Example #6
0
		public MethodCallValue(IMethodRef method, Db4objects.Db4o.Instrumentation.Api.CallingConvention
			 callingConvention, IComparisonOperandAnchor parent, IComparisonOperand[] args) : 
			base(parent)
		{
			_method = method;
			_args = args;
			_callingConvention = callingConvention;
		}
        private ITypeRef DeduceFieldClass(IComparisonOperand fieldValue)
        {
            TypeDeducingVisitor visitor = new TypeDeducingVisitor(_methodBuilder.References,
                                                                  _predicateClass);

            fieldValue.Accept(visitor);
            return(visitor.OperandClass());
        }
Example #8
0
 public MethodCallValue(IMethodRef method, CallingConvention
     callingConvention, IComparisonOperandAnchor parent, IComparisonOperand[] args) :
         base(parent)
 {
     _method = method;
     _args = args;
     _callingConvention = callingConvention;
 }
Example #9
0
        public override void ExitComparisonExpressionWithOperator([NotNull] RuleSetGrammarParser.ComparisonExpressionWithOperatorContext context)
        {
            // popping order matters
            IComparisonOperand   right = this.comparisonOperands.Pop();
            IComparisonOperand   left  = this.comparisonOperands.Pop();
            string               op    = context.GetChild(1).GetText();
            ComparisonExpression expr  = new ComparisonExpression(op, left, right);

            this.logicalExpressions.Push(expr);
        }
Example #10
0
 public ComparisonExpression(FieldValue left, IComparisonOperand right, ComparisonOperator
     op)
 {
     if (left == null || right == null || op == null)
     {
         throw new ArgumentNullException();
     }
     _left = left;
     _right = right;
     _op = op;
 }
Example #11
0
 public ComparisonExpression(FieldValue left, IComparisonOperand right, ComparisonOperator
                             op)
 {
     if (left == null || right == null || op == null)
     {
         throw new ArgumentNullException();
     }
     this._left  = left;
     this._right = right;
     this._op    = op;
 }
Example #12
0
            private IEnumerator FieldNames(FieldValue fieldValue)
            {
                Collection4        coll  = new Collection4();
                IComparisonOperand curOp = fieldValue;

                while (curOp is FieldValue)
                {
                    FieldValue curField = (FieldValue)curOp;
                    coll.Prepend(curField.FieldName());
                    curOp = curField.Parent();
                }
                return(coll.GetEnumerator());
            }
 private ITypeRef DeduceFieldClass(IComparisonOperand fieldValue)
 {
     var visitor = new TypeDeducingVisitor(_methodBuilder.References,
         _predicateClass);
     fieldValue.Accept(visitor);
     return visitor.OperandClass();
 }
		public ArrayAccessValue(ComparisonOperandDescendant parent, IComparisonOperand index
			) : base(parent)
		{
			_index = index;
		}
 private ITypeRef ArithmeticType(IComparisonOperand operand)
 {
     if (operand is ConstValue)
     {
         return PrimitiveType(((ConstValue) operand).Value().GetType());
     }
     if (operand is FieldValue)
     {
         return ((FieldValue) operand).Field.Type;
     }
     if (operand is ArithmeticExpression)
     {
         var expr = (ArithmeticExpression) operand;
         var left = ArithmeticType(expr.Left());
         var right = ArithmeticType(expr.Right());
         if (left == DoubleType() || right == DoubleType())
         {
             return DoubleType();
         }
         if (left == FloatType() || right == FloatType())
         {
             return FloatType();
         }
         if (left == LongType() || right == LongType())
         {
             return LongType();
         }
         return IntType();
     }
     return null;
 }
 public ArrayAccessValue(ComparisonOperandDescendant parent, IComparisonOperand index
                         ) : base(parent)
 {
     _index = index;
 }
 public ComparisonExpression(string op, IComparisonOperand left, IComparisonOperand right) : base("comp")
 {
     this.op    = op;
     this.left  = left;
     this.right = right;
 }