コード例 #1
0
 internal XPathConjunctExpr(XPathExprType type, ValueDataType returnType, XPathExpr left, XPathExpr right) : base(type, returnType)
 {
     if ((left == null) || (right == null))
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new QueryCompileException(QueryCompileError.InvalidExpression));
     }
     base.SubExpr.Add(left);
     base.SubExpr.Add(right);
 }
 internal XPathConjunctExpr(XPathExprType type, ValueDataType returnType, XPathExpr left, XPathExpr right) : base(type, returnType)
 {
     if ((left == null) || (right == null))
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new QueryCompileException(QueryCompileError.InvalidExpression));
     }
     base.SubExpr.Add(left);
     base.SubExpr.Add(right);
 }
コード例 #3
0
            private void CompileStringLiteralEquality(XPathRelationExpr expr)
            {
                bool          flag = XPathExprType.String == expr.Left.Type;
                XPathExprType type = expr.Right.Type;

                this.CompileExpression(flag ? expr.Right : expr.Left);
                string literal = flag ? ((XPathStringExpr)expr.Left).String : ((XPathStringExpr)expr.Right).String;

                this.codeBlock.Append(new StringEqualsOpcode(literal));
            }
コード例 #4
0
            private void CompileNumberRelation(XPathRelationExpr expr)
            {
                if (expr.Op == RelationOperator.Eq)
                {
                    this.CompileNumberLiteralEquality(expr);
                }
                else
                {
                    bool          flag = XPathExprType.Number == expr.Left.Type;
                    XPathExprType type = expr.Right.Type;
                    this.CompileExpression(flag ? expr.Right : expr.Left);
                    XPathNumberExpr expr2  = flag ? ((XPathNumberExpr)expr.Left) : ((XPathNumberExpr)expr.Right);
                    double          number = expr2.Number;
                    if (expr2.Negate)
                    {
                        expr2.Negate = false;
                        number       = -number;
                    }
                    if (flag)
                    {
                        switch (expr.Op)
                        {
                        case RelationOperator.Gt:
                            expr.Op = RelationOperator.Lt;
                            break;

                        case RelationOperator.Ge:
                            expr.Op = RelationOperator.Le;
                            break;

                        case RelationOperator.Lt:
                            expr.Op = RelationOperator.Gt;
                            break;

                        case RelationOperator.Le:
                            expr.Op = RelationOperator.Ge;
                            break;
                        }
                    }
                    if ((this.compiler.flags & QueryCompilerFlags.InverseQuery) != QueryCompilerFlags.None)
                    {
                        this.codeBlock.Append(new NumberIntervalOpcode(number, expr.Op));
                    }
                    else
                    {
                        this.codeBlock.Append(new NumberRelationOpcode(number, expr.Op));
                    }
                }
            }
コード例 #5
0
 internal void AddBooleanExpression(XPathExprType boolExprType, XPathExpr expr)
 {
     if (boolExprType == expr.Type)
     {
         XPathExprList subExpr = expr.SubExpr;
         for (int i = 0; i < subExpr.Count; i++)
         {
             this.AddBooleanExpression(boolExprType, subExpr[i]);
         }
     }
     else
     {
         this.Add(expr);
     }
 }
コード例 #6
0
 internal void AddBooleanExpression(XPathExprType boolExprType, XPathExpr expr)
 {
     if (boolExprType == expr.Type)
     {
         XPathExprList subExpr = expr.SubExpr;
         for (int i = 0; i < subExpr.Count; i++)
         {
             this.AddBooleanExpression(boolExprType, subExpr[i]);
         }
     }
     else
     {
         this.Add(expr);
     }
 }
コード例 #7
0
            private void CompileNumberLiteralEquality(XPathRelationExpr expr)
            {
                bool          flag = XPathExprType.Number == expr.Left.Type;
                XPathExprType type = expr.Right.Type;

                this.CompileExpression(flag ? expr.Right : expr.Left);
                XPathNumberExpr expr2  = flag ? ((XPathNumberExpr)expr.Left) : ((XPathNumberExpr)expr.Right);
                double          number = expr2.Number;

                if (expr2.Negate)
                {
                    expr2.Negate = false;
                    number       = -number;
                }
                this.codeBlock.Append(new NumberEqualsOpcode(number));
            }
コード例 #8
0
ファイル: XPathExpr.cs プロジェクト: dox0/DotNet471RS3
        internal void AddBooleanExpression(XPathExprType boolExprType, XPathExpr expr)
        {
            Fx.Assert(boolExprType == this.type, "");

            // An boolean sub0expression that is of the same type as its container should be merged and flattened
            // into its parent
            if (boolExprType == expr.Type)
            {
                XPathExprList subExprList = expr.SubExpr;
                for (int i = 0; i < subExprList.Count; ++i)
                {
                    this.AddBooleanExpression(boolExprType, subExprList[i]);
                }
            }
            else
            {
                this.Add(expr);
            }
        }
 internal XPathLiteralExpr(XPathExprType type, ValueDataType returnType) : base(type, returnType)
 {
 }
コード例 #10
0
 internal XPathExpr(XPathExprType type, ValueDataType returnType, XPathExprList subExpr) : this(type, returnType)
 {
     this.subExpr = subExpr;
 }
コード例 #11
0
 internal XPathExpr(XPathExprType type, ValueDataType returnType)
 {
     this.type = type;
     this.returnType = returnType;
 }
コード例 #12
0
 internal XPathExpr(XPathExprType type, ValueDataType returnType, XPathExprList subExpr) : this(type, returnType)
 {
     this.subExpr = subExpr;
 }
コード例 #13
0
 internal XPathExpr(XPathExprType type, ValueDataType returnType)
 {
     this.type       = type;
     this.returnType = returnType;
 }
コード例 #14
0
        internal void AddBooleanExpression(XPathExprType boolExprType, XPathExpr expr)
        {
            Fx.Assert(boolExprType == this.type, "");

            // An boolean sub0expression that is of the same type as its container should be merged and flattened
            // into its parent
            if (boolExprType == expr.Type)
            {
                XPathExprList subExprList = expr.SubExpr;
                for (int i = 0; i < subExprList.Count; ++i)
                {
                    this.AddBooleanExpression(boolExprType, subExprList[i]);
                }
            }
            else
            {
                this.Add(expr);
            }
        }
コード例 #15
0
 internal XPathLiteralExpr(XPathExprType type, ValueDataType returnType) : base(type, returnType)
 {
 }