示例#1
0
 public JoinNode(IQueryPlanNode left, IQueryPlanNode right, ObjectName leftVar, Operator joinOp, Expression rightExpression)
     : base(left, right)
 {
     this.leftVar = leftVar;
     this.joinOp = joinOp;
     this.rightExpression = rightExpression;
 }
            private Expression DoPrepare(Expression expression)
            {
                if (preparer.CanPrepare(expression))
                    expression = preparer.Prepare(expression);

                return expression;
            }
示例#3
0
 public SimpleSelectNode(IQueryPlanNode child, ObjectName leftVar, Operator op, Expression rightExpression)
     : base(child)
 {
     this.leftVar = leftVar;
     this.op = op;
     this.rightExpression = rightExpression;
 }
示例#4
0
        public TypeIsExpression(Expression expression, DataType typeOperand)
        {
            if (typeOperand == null)
                throw new ArgumentNullException("typeOperand");

            TypeOperand = typeOperand;
            Expression = expression;
        }
        public AssignmentStatement(Expression member, Expression assignExpression)
        {
            if (member == null)
                throw new ArgumentNullException("member");

            AssignExpression = assignExpression;
            Member = member;
        }
            public IList<CorrelatedVariable> Discover(Expression expression, ref int level, IList<CorrelatedVariable> list)
            {
                variables = list;
                queryLevel = level;

                Visit(expression);
                return variables;
            }
示例#7
0
 /// <summary>
 /// Groups over the given columns from the child.
 /// </summary>
 /// <param name="child"></param>
 /// <param name="columns"></param>
 /// <param name="groupMaxColumn"></param>
 /// <param name="functionList"></param>
 /// <param name="nameList"></param>
 public GroupNode(IQueryPlanNode child, ObjectName[] columns, ObjectName groupMaxColumn, Expression[] functionList, string[] nameList)
     : base(child)
 {
     this.columns = columns;
     this.groupMaxColumn = groupMaxColumn;
     this.functionList = functionList;
     this.nameList = nameList;
 }
示例#8
0
        protected virtual Expression Visit(Expression exp)
        {
            if (exp == null)
                return null;

            switch (exp.ExpressionType) {
                case ExpressionType.Negative:
                case ExpressionType.Positive:
                case ExpressionType.Not:
                    return VisitUnary((UnaryExpression) exp);
                case ExpressionType.Add:
                case ExpressionType.Subtract:
                case ExpressionType.Multiply:
                case ExpressionType.Divide:
                case ExpressionType.Modulo:
                case ExpressionType.And:
                case ExpressionType.Or:
                case ExpressionType.Smaller:
                case ExpressionType.SmallerOrEqual:
                case ExpressionType.Greater:
                case ExpressionType.GreaterOrEqual:
                case ExpressionType.Equal:
                case ExpressionType.NotEqual:
                case ExpressionType.Is:
                case ExpressionType.Like:
                case ExpressionType.Any:
                case ExpressionType.All:
                    return VisitBinary((BinaryExpression) exp);
                case ExpressionType.Conditional:
                    return VisitConditional((ConditionalExpression) exp);
                case ExpressionType.Constant:
                    return VisitConstant((ConstantExpression) exp);
                case ExpressionType.Variable:
                    return VisitVariable((VariableExpression) exp);
                case ExpressionType.CorrelatedVariable:
                    return VisitCorrelatedVariable((CorrelatedVariableExpression) exp);
                case ExpressionType.Call:
                    return VisitFunctionCall((FunctionCallExpression) exp);
                case ExpressionType.Query:
                    return VisitQuery((QueryExpression) exp);
                case ExpressionType.Subset:
                    return VisitSubset((SubsetExpression) exp);
                default:
                    throw new Exception(string.Format("Unhandled expression type: '{0}'", exp.ExpressionType));
            }
        }
示例#9
0
        public static BinaryExpression Binary(Expression first, ExpressionType type, Expression second)
        {
            if (type == ExpressionType.Equal)
                return Equal(first, second);
            if (type == ExpressionType.NotEqual)
                return NotEqual(first, second);
            if (type == ExpressionType.Smaller)
                return Smaller(first, second);
            if (type == ExpressionType.Greater)
                return Greater(first, second);
            if (type == ExpressionType.SmallerOrEqual)
                return SmallerOrEqual(first, second);
            if (type == ExpressionType.GreaterOrEqual)
                return GreaterOrEqual(first, second);

            if (type == ExpressionType.Add)
                return Add(first, second);
            if (type == ExpressionType.Multiply)
                return Multiply(first, second);
            if (type == ExpressionType.Subset)
                return Subtract(first, second);
            if (type == ExpressionType.Divide)
                return Divide(first, second);
            if (type == ExpressionType.Modulo)
                return Modulo(first, second);
            if (type == ExpressionType.Exponent)
                return Exponent(first, second);

            if (type == ExpressionType.Like)
                return Like(first, second);

            if (type == ExpressionType.And)
                return And(first, second);
            if (type == ExpressionType.Or)
                return Or(first, second);

            throw new NotSupportedException();
        }
 public MultiColumnEquiSelectNode(IQueryPlanNode child, ObjectName[] columns, Expression[] values)
     : base(child)
 {
     this.columns = columns;
     this.values = values;
 }
示例#11
0
 public ConstantSelectNode(IQueryPlanNode child, Expression exp)
     : base(child)
 {
     expression = exp;
 }
 public SmallerOrEqualExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
示例#13
0
 public Expression PrepareExpression(Expression expression)
 {
     return Visit(expression);
 }
 public FunctionalSelectNode(IQueryPlanNode child, Expression expression)
     : base(child)
 {
     this.expression = expression;
 }
 public DataType FindReturnType(Expression expression)
 {
     Visit(expression);
     return returnType;
 }
 public ConditionalExpression(Expression test, Expression ifTrue)
     : this(test, ifTrue, null)
 {
 }
示例#17
0
 protected UnaryExpression(Expression operand)
 {
     Operand = operand;
 }
示例#18
0
 public IsExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
示例#19
0
 public LikeExpression(Expression left, Expression right)
     : this(left, right, null)
 {
 }
示例#20
0
 public MultiplyExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
示例#21
0
 public EqualExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
示例#22
0
 public IList<Expression> Break(Expression expression)
 {
     Visit(expression);
     return list;
 }
示例#23
0
 public LikeExpression(Expression left, Expression right, Expression escape)
     : base(left, right)
 {
     Escape = escape;
 }
示例#24
0
 public bool Explore(Expression expression)
 {
     Visit(expression);
     return aggregateFound;
 }
示例#25
0
 public bool Inspect(Expression expression)
 {
     Visit(expression);
     return hasSubQuery;
 }
示例#26
0
 public SubsetExpression(Expression child)
     : base(child)
 {
 }
示例#27
0
 public SubtractExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
示例#28
0
 public ExponentExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
 public ConditionalExpression(Expression test, Expression ifTrue, Expression ifFalse)
 {
     IfFalse = ifFalse;
     IfTrue = ifTrue;
     Test = test;
 }
示例#30
0
 public DivideExpression(Expression left, Expression right)
     : base(left, right)
 {
 }