Package org.exist.xquery.parser

Examples of org.exist.xquery.parser.XQueryLexer


     *
     * @param is
     * @return The guessed encoding.
     */
    protected final static String guessXQueryEncoding(InputStream is) {
        final XQueryLexer lexer = new XQueryLexer(null, new InputStreamReader(is));
        final DeclScanner scanner = new DeclScanner(lexer);
        try {
            scanner.versionDecl();
        } catch (final RecognitionException e) {
            //Nothing to do
View Full Code Here


     * @param is
     * @return QName describing the module namespace or null if the source is not
     * a module.
     */
    protected final static QName getModuleDecl(InputStream is) {
        final XQueryLexer lexer = new XQueryLexer(null, new InputStreamReader(is));
        final DeclScanner scanner = new DeclScanner(lexer);
        try {
            scanner.versionDecl();
        } catch (final RecognitionException e) {
            //Nothing to do
View Full Code Here

           
            session.registerContext(context);
           
            // TODO(pkaminsk2): why replicate XQuery.compile here?
           
            final XQueryLexer lexer = new XQueryLexer(context, new StringReader(xpath));
            final XQueryParser parser = new XQueryParser(lexer);
            final XQueryTreeParser treeParser = new XQueryTreeParser(context);
            parser.xpath();
            if (parser.foundErrors()) {
                LOG.debug(parser.getErrorMessage());
View Full Code Here

    } catch (IOException e1) {
      return;//TODO: report error???
    }
   
      long start = System.currentTimeMillis();
        XQueryLexer lexer = new XQueryLexer(context, reader);
    XQueryParser parser = new XQueryParser(lexer);
    XQueryTreeParser treeParser = new XQueryTreeParser(context);
    try {
            if (xpointer)
                parser.xpointer();
View Full Code Here

      for (final Iterator<Map.Entry<String, Object>> i = variables.entrySet().iterator(); i.hasNext(); ) {
        entry = (Map.Entry<String, Object>) i.next();
        context.declareVariable(entry.getKey().toString(), entry.getValue());
      }
      // TODO(pkaminsk2): why replicate XQuery.compile here?
      final XQueryLexer lexer = new XQueryLexer(context, new StringReader(select));
      final XQueryParser parser = new XQueryParser(lexer);
      final XQueryTreeParser treeParser = new XQueryTreeParser(context);
      parser.xpath();
      if (parser.foundErrors()) {
        throw new SAXException(parser.getErrorMessage());
View Full Code Here

        // TODO(pkaminsk2): why replicate XQuery.compile here?
        DBBroker broker = null;
        try {
            broker = pool.get(user);
            final XQueryContext context = new XQueryContext(pool, accessCtx);
            final XQueryLexer lexer = new XQueryLexer(context, new StringReader(sortExpr));
            final XQueryParser parser = new XQueryParser(lexer);
            final XQueryTreeParser treeParser = new XQueryTreeParser(context);
            parser.xpath();
            if (parser.foundErrors()) {
                //TODO : error ?
View Full Code Here

         <|wolf77|> HTTPUtils.addLastModifiedHeader( result, context );
      <|wolf77|> in line 184 of XQuery.java, because it introduces another dependency on HTTP.
       */
     
      final long start = System.currentTimeMillis();
        final XQueryLexer lexer = new XQueryLexer(context, reader);
        final XQueryParser parser = new XQueryParser(lexer);
        final XQueryTreeParser treeParser = new XQueryTreeParser(context);
        try {
            if(xpointer) {
                parser.xpointer();
View Full Code Here

      new XQueryContext(context.getBroker().getBrokerPool(), AccessContext.VALIDATION_INTERNAL);
   
    if (getArgumentCount() == 2 && args[1].hasOne()) {
      pContext.setModuleLoadPath(args[1].getStringValue());
    }
    final XQueryLexer lexer = new XQueryLexer(pContext, new StringReader(expr));
    final XQueryParser parser = new XQueryParser(lexer);
    // shares the context of the outer expression
    final XQueryTreeParser astParser = new XQueryTreeParser(pContext);
    try {
        parser.xpath();
View Full Code Here

      }

      try {
              // parse the query into the internal syntax tree
        XQueryContext context = new XQueryContext(broker.getBrokerPool(), AccessContext.TEST);
        XQueryLexer lexer = new XQueryLexer(context, new StringReader(query));
        XQueryParser xparser = new XQueryParser(lexer);
        XQueryTreeParser treeParser = new XQueryTreeParser(context);
        xparser.xpath();
        if (xparser.foundErrors()) {
          System.err.println(xparser.getErrorMessage());
View Full Code Here

TOP

Related Classes of org.exist.xquery.parser.XQueryLexer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.