Class QueryParser


  • public class QueryParser
    extends InputParser
    Parser for XQuery expressions.
    Author:
    BaseX Team 2005-22, BSD License, Christian Gruen
    • Field Detail

      • moduleURIs

        public final TokenSet moduleURIs
        URIs of modules loaded by the current file.
    • Method Detail

      • module

        public final void module​(String path,
                                 String uri,
                                 InputInfo ii)
                          throws QueryException
        Parses the specified module, checking function and variable references at the end.
        Parameters:
        path - file path
        uri - base URI of module
        ii - input info
        Throws:
        QueryException - query exception
      • error

        public QueryException error​(QueryError error,
                                    InputInfo ii,
                                    Object... arg)
        Creates the specified error.
        Parameters:
        error - error to be thrown
        ii - input info
        arg - error arguments
        Returns:
        error
      • isLibrary

        public static boolean isLibrary​(String query)
        Checks if the specified XQuery string is a library module.
        Parameters:
        query - query string
        Returns:
        result of check
      • removeComments

        public static String removeComments​(String query,
                                            int max)
        Removes comments from the specified string and returns the first characters of a query.
        Parameters:
        query - query string
        max - maximum length of string to return
        Returns:
        result