class QueryParser extends ExpressionParser
ExpressionParser.ForClause, ExpressionParser.TemporaryContainer| Modifier and Type | Field and Description |
|---|---|
protected Executable |
executable |
java.util.Set |
importedModules |
(package private) java.util.List |
moduleImports |
(package private) java.util.List |
namespacesToBeSealed |
(package private) java.util.List |
schemaImports |
env, language, nameChecker, rangeVariables, scanOnly, SEQUENCE_TYPE, t, XPATH, XQUERY, XSLT_PATTERN| Modifier | Constructor and Description |
|---|---|
protected |
QueryParser()
Protected Constructor: this class should be instantiated via the StaticQueryContext
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyModuleImport(net.sf.saxon.query.QueryParser.Import mImport) |
Executable |
getExecutable()
Get the executable containing this expression.
|
protected java.lang.String |
getLanguage()
Get the current language (XPath or XQuery)
|
protected void |
grumble(java.lang.String message,
java.lang.String errorCode)
Report a static error
|
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 StringValue |
makeStringLiteral(java.lang.String token)
Method to make a string literal from a token identified as a string
literal.
|
XQueryExpression |
makeXQueryExpression(java.lang.String query,
StaticQueryContext staticContext,
Configuration config)
Create an XQueryExpression
|
protected Expression |
parseConstructor()
Parse a node constructor.
|
protected Expression |
parseExtensionExpression()
Parse an Extension Expression.
|
protected Expression |
parseForExpression()
Parse a FLWOR expression.
|
void |
parseLibraryModule(java.lang.String queryString,
StaticQueryContext env)
Parse a library module.
|
protected Expression |
parseTypeswitchExpression()
Parse a Typeswitch Expression.
|
protected Expression |
parseValidateExpression()
Parse a Validate Expression.
|
Expression |
setDefaultValue(java.lang.String exp)
Parse the expression (inside a string literal) used to define default values
for external variables.
|
void |
setExecutable(Executable exec)
Set the executable used for this query expression
|
currentTokenDisplay, declareRangeVariable, expect, getRangeVariableStack, getTokenizer, grumble, isKeyword, makeLocalNameTest, makeNameCode, makeNamespaceTest, makeNameTest, makeTracer, nextToken, parse, parseExpression, parseExprSingle, parseFunctionCall, parseMappingExpression, parseNodeTest, parsePattern, parseRelativePath, parseRemainingPath, parseSequenceType, parseSequenceType, parseStepExpression, setLocation, setLocation, setRangeVariableStack, setScanOnly, undeclareRangeVariable, warningprotected Executable executable
public java.util.Set importedModules
java.util.List namespacesToBeSealed
java.util.List schemaImports
java.util.List moduleImports
protected QueryParser()
public XQueryExpression makeXQueryExpression(java.lang.String query, StaticQueryContext staticContext, Configuration config) throws XPathException
XPathExceptionpublic Executable getExecutable()
public void setExecutable(Executable exec)
public final void parseLibraryModule(java.lang.String queryString,
StaticQueryContext env)
throws StaticError
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.StaticError - if the expression contains a syntax errorprotected void grumble(java.lang.String message,
java.lang.String errorCode)
throws StaticError
grumble in class ExpressionParsermessage - the error messageerrorCode - the error codeStaticError - always thrown: an exception containing the
supplied messagepublic void applyModuleImport(net.sf.saxon.query.QueryParser.Import mImport)
throws StaticError
StaticErrorpublic Expression setDefaultValue(java.lang.String exp)
protected Expression parseForExpression() throws StaticError
parseForExpression in class ExpressionParserStaticError - if any error is encounteredpublic static Expression makeStringJoin(Expression exp, StaticContext env)
protected Expression parseTypeswitchExpression() throws StaticError
parseTypeswitchExpression in class ExpressionParserStaticErrorprotected Expression parseValidateExpression() throws StaticError
parseValidateExpression in class ExpressionParserStaticErrorprotected Expression parseExtensionExpression() throws StaticError
parseExtensionExpression in class ExpressionParserStaticErrorprotected Expression parseConstructor() throws StaticError
parseConstructor in class ExpressionParserStaticError - in the event of a syntax error.protected StringValue makeStringLiteral(java.lang.String token) throws StaticError
makeStringLiteral in class ExpressionParsertoken - StaticErrorprotected java.lang.String getLanguage()
getLanguage in class ExpressionParser