public class ParserExtension
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ParserExtension.TemporaryXSLTVariableBinding |
Constructor and Description |
---|
ParserExtension() |
Modifier and Type | Method and Description |
---|---|
Expression |
bindNumericParameterReference(XPathParser p) |
Expression |
createDynamicCurriedFunction(XPathParser p,
Expression functionItem,
java.util.ArrayList<Expression> args,
IntSet placeMarkers) |
static Expression |
curryFunction(Expression functionExp,
Expression[] args,
IntSet placeMarkers)
Process a function expression in which one or more of the argument positions are
represented as "?" placemarkers (indicating partial application or currying)
|
void |
handleExternalFunctionDeclaration(XQueryParser p,
XQueryFunction func) |
Expression |
makeCurriedFunction(XPathParser parser,
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)
|
Expression |
parseDotFunction(XPathParser p) |
protected Expression |
parseExtendedExprSingle(XPathParser p) |
ItemType |
parseExtendedItemType(XPathParser p)
Parse an ItemType within a SequenceType
|
protected Expression |
parseForMemberExpression(XPathParser p)
Parse a for-member expression (Saxon extension):
for member $x in expr return expr
|
ItemType |
parseFunctionItemType(XPathParser p,
AnnotationList annotations)
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
For backwards compatibility with Saxon 9.2 we allow the "*" to be omitted for the time being
The "function(" has already been read
|
Expression |
parseNamedFunctionReference(XPathParser p)
Parse a literal function item (function#arity).
|
void |
parseRevalidationDeclaration(XQueryParser p)
Parse the "declare revalidation" declaration.
|
void |
parseTypeAliasDeclaration(XQueryParser p)
Parse a type alias declaration.
|
Expression |
parseTypePattern(XPathParser p)
Parse an extended XSLT pattern in the form ~itemType (predicate)*
|
Expression |
parseUnderscoreFunction(XPathParser p) |
void |
parseUpdatingFunctionDeclaration(XQueryParser p)
Parse an updating function declaration (allowed in XQuery Update only)
|
public Expression parseNamedFunctionReference(XPathParser p) throws XPathException
p
- the parserXPathException
- in the event of a syntax errorpublic ItemType parseFunctionItemType(XPathParser p, AnnotationList annotations) throws XPathException
p
- the XPath parserannotations
- the list of annotation assertions for this function item typeXPathException
- if a static error is foundpublic ItemType parseExtendedItemType(XPathParser p) throws XPathException
p
- the XPath parserXPathException
- if a static error is foundpublic Expression parseTypePattern(XPathParser p) throws XPathException
p
- the XPath parserXPathException
- if a static error is foundpublic Expression parseDotFunction(XPathParser p) throws XPathException
XPathException
public Expression parseUnderscoreFunction(XPathParser p) throws XPathException
XPathException
public Expression bindNumericParameterReference(XPathParser p) throws XPathException
XPathException
public Expression makeCurriedFunction(XPathParser parser, int offset, StructuredQName name, Expression[] args, IntSet placeMarkers) throws XPathException
parser
- the XPath parseroffset
- offset in the query source of the start of the expressionname
- the function call (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 a dynamic error occurspublic static Expression curryFunction(Expression functionExp, Expression[] args, IntSet placeMarkers)
functionExp
- an expression that returns the function to be curriedargs
- the arguments (with EmptySequence in the placemarker positions)placeMarkers
- the positions of the placemarkerspublic Expression createDynamicCurriedFunction(XPathParser p, Expression functionItem, java.util.ArrayList<Expression> args, IntSet placeMarkers)
public void handleExternalFunctionDeclaration(XQueryParser p, XQueryFunction func) throws XPathException
XPathException
public void parseTypeAliasDeclaration(XQueryParser p) throws XPathException
p
- the XPath parserXPathException
- if parsing failspublic void parseRevalidationDeclaration(XQueryParser p) throws XPathException
p
- the XPath parserXPathException
- if the syntax is incorrect, or is not allowed in this XQuery processorpublic void parseUpdatingFunctionDeclaration(XQueryParser p) throws XPathException
p
- the XPath parserXPathException
- if parsing fails PathMapor if updating functions are not allowedprotected Expression parseExtendedExprSingle(XPathParser p) throws XPathException
XPathException
protected Expression parseForMemberExpression(XPathParser p) throws XPathException
p
- the XPath parserXPathException
- if any error is encounteredCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.