Package org.basex.query
Class QueryParser
java.lang.Object
org.basex.util.InputParser
org.basex.query.QueryParser
- Direct Known Subclasses:
QuerySuggest
Parser for XQuery expressions.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal TokenSetModules loaded by the current file.final TokenMapNamespaces.final QueryContextQuery context.final StaticContextStatic context. -
Constructor Summary
ConstructorsConstructorDescriptionQueryParser(String query, String uri, QueryContext qctx, StaticContext sctx) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionerror(QueryError error, InputInfo ii, Object... arg) Creates the specified error.final voidParses the specified module, checking function and variable references at the end.final LibraryModuleparseLibrary(boolean check) Parses a library module.final MainModuleParses a main module.
-
Field Details
-
modules
Modules loaded by the current file. -
namespaces
Namespaces. -
qc
Query context. -
sc
Static context.
-
-
Constructor Details
-
QueryParser
Constructor.- Parameters:
query- query stringuri- base URI (can benull; only passed on if not bound to static context yet)qctx- query contextsctx- static context (can benull)
-
-
Method Details
-
parseMain
Parses a main module. Parses the "MainModule" rule. Parses the "Setter" rule. Parses the "QueryBody (= Expr)" rule.- Returns:
- resulting root expression
- Throws:
QueryException- query exception
-
parseLibrary
Parses a library module. Parses the "ModuleDecl" rule.- Parameters:
check- check functions and variables- Returns:
- name of the module
- Throws:
QueryException- query exception
-
module
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
Creates the specified error.- Parameters:
error- error to be thrownii- input infoarg- error arguments- Returns:
- error
-