net.sf.saxon.query
public class QueryParser extends ExpressionParser
Nested Class Summary | |
---|---|
protected static class | QueryParser.LetClause |
Field Summary | |
---|---|
protected Executable | executable |
Set | importedModules |
List | moduleImports |
List | namespacesToBeSealed |
protected String | queryVersion |
List | schemaImports |
Constructor Summary | |
---|---|
QueryParser()
Constructor for internal use: this class should be instantiated via the QueryModule |
Method Summary | |
---|---|
void | applyModuleImport(QueryParser.Import mImport) |
Executable | getExecutable()
Get the executable containing this expression. |
protected String | getLanguage()
Get the current language (XPath or XQuery) |
int | getPermittedFunctions()
Get the permitted set of standard functions in this environment |
protected void | grumble(String message, StructuredQName errorCode)
Report a static error
|
protected void | lookAhead()
Lookahead one token, catching any exception thrown by the tokenizer. |
protected void | makeSimpleContent(Expression content, SimpleNodeConstructor inst, int offset)
Make the instructions for the children of a node with simple content (attribute, text, PI, etc)
|
static Expression | makeStringJoin(Expression exp, StaticContext env)
Make a string-join expression that concatenates the string-values of items in
a sequence with intervening spaces. |
protected Literal | makeStringLiteral(String token)
Method to make a string literal from a token identified as a string
literal. |
XQueryExpression | makeXQueryExpression(String query, QueryModule staticContext, Configuration config)
Create an XQueryExpression |
QueryParser | newParser()
Create a new parser of the same kind |
protected Expression | parseConstructor()
Parse a node constructor. |
protected void | parseContextItemDeclaration()
Parse a context item declaration. |
protected void | parseDecimalFormatDeclaration()
Parse the "declare decimal-format" declaration.
|
protected void | parseDefaultDecimalFormat() |
protected Expression | parseExtensionExpression()
Parse an Extension Expression.
|
protected Expression | parseForExpression()
Parse a FLWOR expression. |
protected void | parseFunctionDeclaration(boolean isUpdating)
Parse a function declaration.
|
protected void | parseGroupByClause(List clauseList)
Parse a Group By clause.
|
void | parseLibraryModule(String queryString, QueryModule env)
Parse a library module.
|
protected Expression | parseNamedNamespaceConstructor(int offset) |
protected Expression | parseNamespaceConstructor(int offset) |
protected void | parseOuterForClause(List clauseList)
Parse an "outer for" clause - XQuery 1.1 only |
protected void | parseRevalidationDeclaration()
Parse the "declare revalidation" declaration.
|
protected Expression | parseTypeswitchExpression()
Parse a Typeswitch Expression.
|
protected void | parseUpdatingFunctionDeclaration()
Parse an updating function declaration (allowed in XQuery Update only) |
protected Expression | parseValidateExpression()
Parse a Validate Expression.
|
protected Expression | processGroupingExpression(List<FLWORClause> clauseList, Expression action)
Process a grouping expression
Not supported in 1.0; subclassed in the XQuery 1.1 parser |
protected String | readCollationName() |
Expression | setDefaultValue(String exp)
Parse the expression (inside a string literal) used to define default values
for external variables. |
void | setDisableCycleChecks(boolean disable)
Disable checks for certain kinds of cycle. |
void | setExecutable(Executable exec)
Set the executable used for this query expression |
Returns: the executable
Parameters: message the error message
Throws: XPathException always thrown: an exception containing the supplied message
Parameters: content the expression making up the simple content inst the skeletal instruction for creating the node offset the character position of this construct within the source query
Parameters: exp the base expression, evaluating to a sequence env the static context
Returns: a call on string-join to create a string containing the representations of the items in the sequence separated by spaces.
Parameters: token the string as written (or as returned by the tokenizer)
Returns: The string value of the string literal, after dereferencing entity and character references
Parameters: query the source text of the query staticContext the static context of the query config the Saxon configuration
Returns: the compiled XQuery expression
Returns: an Expression for evaluating the parsed constructor
Throws: XPathException in the event of a syntax error.
Returns: the resulting subexpression
Throws: XPathException if any error is encountered
Syntax:
<"declare" "function"> QName "(" ParamList? ")" ("as" SequenceType)?
(EnclosedExpr | "external")
On entry, the "define function" has already been recognized
Throws: XPathException if a syntax error is found
Throws: XPathException
Parameters: queryString The text of the library module. env The static context. The result of parsing a library module is that the static context is populated with a set of function declarations and variable declarations. Each library module must have its own static context objext.
Throws: XPathException if the expression contains a syntax error
Parameters: clauseList
Throws: XPathException
Throws: XPathException
Parameters: clauseList the list of clauses (for, let, group by) action the return clause, optionally wrapped with if-then-else to reflect the where clause
Throws: XPathException
Parameters: exp holds the expression used to define a default value
Returns: the compiled expression that computes the default value
declare option saxon:allow-cycles "true"
Parameters: disable true if checks for import cycles are to be suppressed, that is, if cycles should be allowed
Parameters: exec the executable