public class ExtendedXQueryParser extends QueryParser
ExpressionParser.TemporaryContainer
executable, importedModules, queryVersion, XQUERY10, XQUERY30
allowXPath30Syntax, catchDepth, codeInjector, defaultContainer, env, language, languageVersion, nameChecker, rangeVariables, scanOnly, SEQUENCE_TYPE, t, XPATH, XQUERY, XSLT_PATTERN
Constructor and Description |
---|
ExtendedXQueryParser(String queryVersion,
boolean updating) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkForClauseAllowingEmpty(ForClause clause)
Check a ForClause for an "outer for"
|
protected Binding |
findRangeVariable(StructuredQName qName)
Locate a range variable with a given name.
|
int |
getPermittedFunctions()
Get the permitted set of standard functions in this environment
|
protected boolean |
isNamespaceTestAllowed()
Ask whether the syntax namespace-node() is allowed in a node kind test.
|
protected boolean |
isReservedInQuery(String uri) |
protected Expression |
makeCurriedFunction(int offset,
StructuredQName name,
Expression[] args,
IntSet placeMarkers)
Process a function call in which one or more of the argument positions are
represented as "?" placemarkers (indicating partial application or currying)
|
QueryParser |
newParser()
Create a new parser of the same kind
|
protected Map<StructuredQName,Annotation> |
parseAnnotations()
Parse the annotations that can appear in a variable or function declaration
|
protected void |
parseContextItemDeclaration()
Parse a context item declaration.
|
protected void |
parseCountClause(List<Clause> clauseList)
Parse a LetClause.
|
protected void |
parseDecimalFormatDeclaration()
Parse a named decimal format declaration.
|
protected void |
parseDefaultDecimalFormat()
Parse a default decimal format declaration
"declare" "default" "decimal-format" (property "=" string-literal)*
|
protected Expression |
parseDynamicFunctionCall(Expression functionItem)
Parse a dynamic function call
|
Expression |
parseExprSingle()
Parse an ExprSingle
|
Expression |
parseFunctionArgument()
Parse a function argument.
|
ItemType |
parseFunctionItemType()
Parse the item type used for function items (XQuery 3.0 higher order functions)
Syntax (changed by WG decision on 2009-09-22):
function '(' '*' ') |
function '(' (SeqType (',' SeqType)*)? ')' 'as' SeqType
The "function(" has already been read
|
protected void |
parseGroupByClause(List<Clause> clauseList)
Parse a Group By clause.
|
protected Expression |
parseInlineFunction(Map<StructuredQName,Annotation> annotations)
Parse an inline function
"function" "(" ParamList? ")" ("as" SequenceType)? EnclosedExpr
On entry, "function (" has already been read
|
protected Expression |
parseLiteralFunctionItem()
Parse a literal function item (introduced in XQuery 3.0)
Syntax: QName # integer
The QName and # have already been read
|
protected Expression |
parseMapExpression()
Parse a map expression.
|
ItemType |
parseMapItemType()
Parse the item type used for function items (XPath 3.0)
Syntax:
map '(' '*' ') |
map '(' ItemType ',' SeqType ')' 'as' SeqType
For backwards compatibility with Saxon 9.2 we allow the "*" to be omitted for the time being
The "map(" has already been read
|
protected Expression |
parseNamedNamespaceConstructor(int offset)
Parse a namespace node constructor of the form
namespace name { expr }
|
protected Expression |
parseNamespaceConstructor(int offset)
Parse a computed namespace constructor of the form
namespace {expr}{expr}
|
protected void |
parseOutputDeclaration(StructuredQName varName,
String value) |
protected ItemType |
parseParenthesizedItemType()
Parse a parenthesized item type (allowed in XQuery 3.0 and XPath 3.0 only)
|
protected void |
parseRevalidationDeclaration()
Parse the "declare revalidation" declaration (XQuery Update).
|
protected Expression |
parseSwitchExpression()
Parse a Switch Expression.
|
protected Expression |
parseTryCatchExpression()
Parse a Try/Catch Expression.
|
protected void |
parseUpdatingFunctionDeclaration()
Parse an updating function declaration (allowed in XQuery Update only)
|
protected void |
parseWindowClause(List<Clause> clauseList)
Parse a tumbling or sliding window clause.
|
applyModuleImport, atStartOfRelativePath, customizeTokenizer, getExecutable, getLanguage, grumble, isReservedFunctionName, lookAhead, makeLetExpression, makeSimpleContent, makeStringJoin, makeStringLiteral, makeXQueryExpression, normalizeEQName, parseConstructor, parseExtensionExpression, parseFLWORExpression, parseFunctionDeclaration, parseLibraryModule, parseTypeswitchExpression, parseValidateExpression, readCollationName, setDefaultValue, setDisableCycleChecks, setExecutable, stringify, testPermittedAxis, URILiteral
currentTokenDisplay, declareRangeVariable, disallowedAtStartOfRelativePath, expect, getCodeInjector, getDefaultContainer, getNameChecker, getRangeVariables, getStaticContext, getTokenizer, grumble, grumble, grumble, isKeyword, makeLocalNameTest, makeNameCode, makeNamespaceTest, makeNameTest, makeNodeName, makeStructuredQName, makeStructuredQNameSilently, makeTracer, nextToken, parse, parseBasicStep, parseBinaryExpression, parseExpression, parseFunctionCall, parseItemType, parseNodeTest, parseNumericLiteral, parsePathExpression, parsePredicate, parseRelativePath, parseRemainingPath, parseSequenceType, parseSequenceType, parseSimpleMappingExpression, parseStepExpression, parseStringLiteral, parseTypePattern, parseVariableReference, reportMissingFunction, resolveFunctionName, setCodeInjector, setDefaultContainer, setLanguage, setLocation, setLocation, setLocation, setRangeVariables, setRangeVariableStack, setScanOnly, undeclareRangeVariable, warning
public ExtendedXQueryParser(String queryVersion, boolean updating)
public QueryParser newParser()
newParser
in class QueryParser
public int getPermittedFunctions()
getPermittedFunctions
in class QueryParser
protected boolean isReservedInQuery(String uri)
isReservedInQuery
in class ExpressionParser
protected Map<StructuredQName,Annotation> parseAnnotations() throws XPathException
parseAnnotations
in class ExpressionParser
XPathException
protected void parseOutputDeclaration(StructuredQName varName, String value) throws XPathException
parseOutputDeclaration
in class QueryParser
XPathException
protected Expression parseLiteralFunctionItem() throws XPathException
parseLiteralFunctionItem
in class ExpressionParser
XPathException
- if a static error is encounteredpublic ItemType parseFunctionItemType() throws XPathException
parseFunctionItemType
in class ExpressionParser
XPathException
- if a static error occurs (including the case
where XPath 3.0 syntax is not enabled)public Expression parseFunctionArgument() throws XPathException
parseFunctionArgument
in class ExpressionParser
XPathException
- if the argument expression does not parse correctlypublic ItemType parseMapItemType() throws XPathException
parseMapItemType
in class ExpressionParser
XPathException
- if a parsing error occurs or if the map syntax
is not availableprotected ItemType parseParenthesizedItemType() throws XPathException
parseParenthesizedItemType
in class ExpressionParser
XPathException
- if a syntax error is foundprotected Expression parseDynamicFunctionCall(Expression functionItem) throws XPathException
parseDynamicFunctionCall
in class ExpressionParser
functionItem
- the expression that determines the function to be calledXPathException
- if a static error is foundprotected Expression parseInlineFunction(Map<StructuredQName,Annotation> annotations) throws XPathException
parseInlineFunction
in class ExpressionParser
annotations
- the function annotations, which have already been read, or null if there are noneXPathException
- if a syntax error is foundprotected Expression makeCurriedFunction(int offset, StructuredQName name, Expression[] args, IntSet placeMarkers) throws XPathException
makeCurriedFunction
in class ExpressionParser
offset
- the location of the expression in the query sourcename
- the function name (as if there were no currying)args
- the arguments (with EmptySequence in the placemarker positions)placeMarkers
- the positions of the placemarkers @return the curried functionXPathException
- if the syntax is incorrectprotected Expression parseMapExpression() throws XPathException
parseMapExpression
in class ExpressionParser
XPathException
protected Binding findRangeVariable(StructuredQName qName)
findRangeVariable
in class ExpressionParser
qName
- identifies the name of the range variableprotected Expression parseTryCatchExpression() throws XPathException
parseTryCatchExpression
in class QueryParser
XPathException
- if a static error is foundprotected void checkForClauseAllowingEmpty(ForClause clause) throws XPathException
checkForClauseAllowingEmpty
in class QueryParser
clause
- the clause to be checkedXPathException
- if invalidprotected void parseCountClause(List<Clause> clauseList) throws XPathException
parseCountClause
in class QueryParser
clauseList
- - the components of the parsed LetClause are appended to the
supplied listXPathException
protected void parseGroupByClause(List<Clause> clauseList) throws XPathException
parseGroupByClause
in class QueryParser
clauseList
- the list of clauses for the expression, to which this
clause will be addedXPathException
protected void parseWindowClause(List<Clause> clauseList) throws XPathException
parseWindowClause
in class QueryParser
clauseList
- the list of clauses for the expression, to which this
clause will be addedXPathException
protected Expression parseNamespaceConstructor(int offset) throws XPathException
parseNamespaceConstructor
in class QueryParser
offset
- the location of the expression in the query sourceXPathException
- in the event of a syntax errorprotected Expression parseNamedNamespaceConstructor(int offset) throws XPathException
parseNamedNamespaceConstructor
in class QueryParser
offset
- the location of the expression in the query sourceXPathException
- in the event of a syntax errorprotected boolean isNamespaceTestAllowed()
isNamespaceTestAllowed
in class ExpressionParser
protected Expression parseSwitchExpression() throws XPathException
parseSwitchExpression
in class ExpressionParser
XPathException
- if a static error is foundprotected void parseContextItemDeclaration() throws XPathException
parseContextItemDeclaration
in class QueryParser
XPathException
protected void parseDecimalFormatDeclaration() throws XPathException
parseDecimalFormatDeclaration
in class QueryParser
XPathException
protected void parseDefaultDecimalFormat() throws XPathException
parseDefaultDecimalFormat
in class QueryParser
XPathException
protected void parseRevalidationDeclaration() throws XPathException
parseRevalidationDeclaration
in class QueryParser
XPathException
protected void parseUpdatingFunctionDeclaration() throws XPathException
parseUpdatingFunctionDeclaration
in class QueryParser
XPathException
- if parsing fails or if updating functions are not allowedpublic Expression parseExprSingle() throws XPathException
parseExprSingle
in class ExpressionParser
XPathException
- if any error is encounteredCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.