コード例 #1
0
        private XPathExpr ParseOrExpression()
        {
            XPathExpr expr = this.ParseAndExpression();

            if ((expr == null) || (this.NextToken(XPathTokenID.Or) == null))
            {
                return(expr);
            }
            XPathExpr expr2 = new XPathExpr(XPathExprType.Or, ValueDataType.Boolean);

            expr2.AddBooleanExpression(XPathExprType.Or, expr);
            do
            {
                expr = this.ParseAndExpression();
                if (expr == null)
                {
                    this.ThrowError(QueryCompileError.InvalidExpression);
                }
                expr2.AddBooleanExpression(XPathExprType.Or, expr);
            }while (this.NextToken(XPathTokenID.Or) != null);
            return(expr2);
        }
コード例 #2
0
ファイル: XPathParser.cs プロジェクト: dox0/DotNet471RS3
        XPathExpr ParseOrExpression()
        {
            XPathExpr andExpr = this.ParseAndExpression();

            if (null != andExpr && null != this.NextToken(XPathTokenID.Or))
            {
                XPathExpr orExpr = new XPathExpr(XPathExprType.Or, ValueDataType.Boolean);

                orExpr.AddBooleanExpression(XPathExprType.Or, andExpr);
                do
                {
                    andExpr = this.ParseAndExpression();
                    if (andExpr == null)
                    {
                        this.ThrowError(QueryCompileError.InvalidExpression);
                    }
                    orExpr.AddBooleanExpression(XPathExprType.Or, andExpr);
                } while (null != this.NextToken(XPathTokenID.Or));

                return(orExpr);
            }

            return(andExpr);
        }
コード例 #3
0
ファイル: XPathParser.cs プロジェクト: dox0/DotNet471RS3
        XPathExpr ParseAndExpression()
        {
            XPathExpr eqExpr = this.ParseEqualityExpression();

            if (null != eqExpr && null != this.NextToken(XPathTokenID.And))
            {
                XPathExpr andExpr = new XPathExpr(XPathExprType.And, ValueDataType.Boolean);

                andExpr.AddBooleanExpression(XPathExprType.And, eqExpr);
                do
                {
                    eqExpr = this.ParseEqualityExpression();
                    if (eqExpr == null)
                    {
                        this.ThrowError(QueryCompileError.InvalidExpression);
                    }
                    andExpr.AddBooleanExpression(XPathExprType.And, eqExpr);
                } while (null != this.NextToken(XPathTokenID.And));

                return(andExpr);
            }

            return(eqExpr);
        }
コード例 #4
0
        XPathExpr ParseOrExpression()
        {
            XPathExpr andExpr = this.ParseAndExpression();

            if (null != andExpr && null != this.NextToken(XPathTokenID.Or))
            {
                XPathExpr orExpr = new XPathExpr(XPathExprType.Or, ValueDataType.Boolean);

                orExpr.AddBooleanExpression(XPathExprType.Or, andExpr);
                do
                {
                    andExpr = this.ParseAndExpression();
                    if (andExpr == null)
                        this.ThrowError(QueryCompileError.InvalidExpression);
                    orExpr.AddBooleanExpression(XPathExprType.Or, andExpr);
                } while (null != this.NextToken(XPathTokenID.Or));

                return orExpr;
            }

            return andExpr;
        }
コード例 #5
0
        XPathExpr ParseAndExpression()
        {
            XPathExpr eqExpr = this.ParseEqualityExpression();

            if (null != eqExpr && null != this.NextToken(XPathTokenID.And))
            {
                XPathExpr andExpr = new XPathExpr(XPathExprType.And, ValueDataType.Boolean);

                andExpr.AddBooleanExpression(XPathExprType.And, eqExpr);
                do
                {
                    eqExpr = this.ParseEqualityExpression();
                    if (eqExpr == null)
                        this.ThrowError(QueryCompileError.InvalidExpression);
                    andExpr.AddBooleanExpression(XPathExprType.And, eqExpr);
                } while (null != this.NextToken(XPathTokenID.And));

                return andExpr;
            }

            return eqExpr;
        }
コード例 #6
0
 private XPathExpr ParseOrExpression()
 {
     XPathExpr expr = this.ParseAndExpression();
     if ((expr == null) || (this.NextToken(XPathTokenID.Or) == null))
     {
         return expr;
     }
     XPathExpr expr2 = new XPathExpr(XPathExprType.Or, ValueDataType.Boolean);
     expr2.AddBooleanExpression(XPathExprType.Or, expr);
     do
     {
         expr = this.ParseAndExpression();
         if (expr == null)
         {
             this.ThrowError(QueryCompileError.InvalidExpression);
         }
         expr2.AddBooleanExpression(XPathExprType.Or, expr);
     }
     while (this.NextToken(XPathTokenID.Or) != null);
     return expr2;
 }