Exemple #1
0
 internal Query BuildPatternQuery(string query, bool allowVar, bool allowKey)
 {
     this.allowVar     = allowVar;
     this.allowKey     = allowKey;
     this.allowCurrent = false;
     return(this.Build(XPathParser.ParseXPathPattern(query), query));
 }
Exemple #2
0
 internal Query Build(string query, bool allowVar, bool allowKey)
 {
     this.allowVar     = allowVar;
     this.allowKey     = allowKey;
     this.allowCurrent = true;
     return(this.Build(XPathParser.ParseXPathExpresion(query), query));
 }
Exemple #3
0
        public static AstNode ParseXPathPattern(string xpathPattern)
        {
            XPathParser parser = new XPathParser(xpathPattern);
            AstNode     result = parser.ParsePattern();

            if (parser._scanner.Kind != XPathScanner.LexKind.Eof)
            {
                throw XPathException.Create(SR.Xp_InvalidToken, parser._scanner.SourceText);
            }
            return(result);
        }
        public static AstNode ParseXPathPattern(string xpathPattern)
        {
            XPathScanner scanner = new XPathScanner(xpathPattern);
            AstNode      node    = new XPathParser(scanner).ParsePattern(null);

            if (scanner.Kind != XPathScanner.LexKind.Eof)
            {
                throw XPathException.Create("Xp_InvalidToken", scanner.SourceText);
            }
            return(node);
        }
Exemple #5
0
        public static AstNode ParseXPathExpression(string xpathExpression)
        {
            XPathScanner scanner = new XPathScanner(xpathExpression);
            XPathParser  parser  = new XPathParser(scanner);
            AstNode      result  = parser.ParseExpression(null);

            if (scanner.Kind != XPathScanner.LexKind.Eof)
            {
                throw XPathException.Create(SR.Xp_InvalidToken, scanner.SourceText);
            }
            return(result);
        }