Exemplo n.º 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;
 }
Exemplo n.º 2
0
            private Expression DoPrepare(Expression expression)
            {
                if (preparer.CanPrepare(expression))
                    expression = preparer.Prepare(expression);

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

            TypeOperand = typeOperand;
            Expression = expression;
        }
Exemplo n.º 5
0
        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;
            }
Exemplo n.º 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;
 }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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;
 }
Exemplo n.º 11
0
 public ConstantSelectNode(IQueryPlanNode child, Expression exp)
     : base(child)
 {
     expression = exp;
 }
 public SmallerOrEqualExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
Exemplo n.º 13
0
 public Expression PrepareExpression(Expression expression)
 {
     return Visit(expression);
 }
Exemplo n.º 14
0
 public FunctionalSelectNode(IQueryPlanNode child, Expression expression)
     : base(child)
 {
     this.expression = expression;
 }
Exemplo n.º 15
0
 public DataType FindReturnType(Expression expression)
 {
     Visit(expression);
     return returnType;
 }
Exemplo n.º 16
0
 public ConditionalExpression(Expression test, Expression ifTrue)
     : this(test, ifTrue, null)
 {
 }
Exemplo n.º 17
0
 protected UnaryExpression(Expression operand)
 {
     Operand = operand;
 }
Exemplo n.º 18
0
 public IsExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
Exemplo n.º 19
0
 public LikeExpression(Expression left, Expression right)
     : this(left, right, null)
 {
 }
Exemplo n.º 20
0
 public MultiplyExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
Exemplo n.º 21
0
 public EqualExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
Exemplo n.º 22
0
 public IList<Expression> Break(Expression expression)
 {
     Visit(expression);
     return list;
 }
Exemplo n.º 23
0
 public LikeExpression(Expression left, Expression right, Expression escape)
     : base(left, right)
 {
     Escape = escape;
 }
Exemplo n.º 24
0
 public bool Explore(Expression expression)
 {
     Visit(expression);
     return aggregateFound;
 }
Exemplo n.º 25
0
 public bool Inspect(Expression expression)
 {
     Visit(expression);
     return hasSubQuery;
 }
Exemplo n.º 26
0
 public SubsetExpression(Expression child)
     : base(child)
 {
 }
Exemplo n.º 27
0
 public SubtractExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
Exemplo n.º 28
0
 public ExponentExpression(Expression left, Expression right)
     : base(left, right)
 {
 }
Exemplo n.º 29
0
 public ConditionalExpression(Expression test, Expression ifTrue, Expression ifFalse)
 {
     IfFalse = ifFalse;
     IfTrue = ifTrue;
     Test = test;
 }
Exemplo n.º 30
0
 public DivideExpression(Expression left, Expression right)
     : base(left, right)
 {
 }