Package org.basex.query
Class QueryParser
- java.lang.Object
-
- org.basex.util.InputParser
-
- org.basex.query.QueryParser
-
public class QueryParser extends InputParser
Parser for XQuery expressions.- Author:
- BaseX Team 2005-22, BSD License, Christian Gruen
-
-
Field Summary
Fields Modifier and Type Field Description TokenSet
moduleURIs
URIs of modules loaded by the current file.QueryContext
qc
Query context.StaticContext
sc
Static context.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryException
error(QueryError error, InputInfo ii, Object... arg)
Creates the specified error.static boolean
isLibrary(String query)
Checks if the specified XQuery string is a library module.void
module(String path, String uri, InputInfo ii)
Parses the specified module, checking function and variable references at the end.static String
removeComments(String query, int max)
Removes comments from the specified string and returns the first characters of a query.
-
-
-
Field Detail
-
moduleURIs
public final TokenSet moduleURIs
URIs of modules loaded by the current file.
-
qc
public final QueryContext qc
Query context.
-
sc
public final StaticContext sc
Static context.
-
-
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 pathuri
- base URI of moduleii
- 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 thrownii
- input infoarg
- 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
-
-