|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.saxon.expr.parser.ExpressionParser
com.saxonica.expr.XPath30Parser
public class XPath30Parser
Parser extension for new syntax in XPath 3.0.
This contains code duplicated with the XQuery1.1 parser. This is handled by putting the common code into static methods of this class, which are invoked from both the XPath30Parser and the XQuery11Parser.
| Nested Class Summary | |
|---|---|
static class |
XPath30Parser.InlineFunctionDetails
|
static class |
XPath30Parser.TemporaryXSLTVariableBinding
|
| Nested classes/interfaces inherited from class net.sf.saxon.expr.parser.ExpressionParser |
|---|
ExpressionParser.TemporaryContainer |
| Field Summary |
|---|
| Fields inherited from class net.sf.saxon.expr.parser.ExpressionParser |
|---|
allowXPath30Syntax, defaultContainer, env, language, nameChecker, rangeVariables, scanOnly, SEQUENCE_TYPE, t, XPATH, XQUERY, XSLT_PATTERN |
| Constructor Summary | |
|---|---|
XPath30Parser()
|
|
| Method Summary | |
|---|---|
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) |
static Binding |
findOuterRangeVariable(StructuredQName qName,
Stack<XPath30Parser.InlineFunctionDetails> inlineFunctionStack,
StaticContext env)
|
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. |
static Expression |
makeCurriedFunction(ExpressionParser parser,
StaticContext env,
Container container,
int offset,
StructuredQName name,
Expression[] args,
IntSet placeMarkers)
|
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) |
protected Expression |
parseDynamicFunctionCall(Expression functionItem)
Parse a dynamic function call |
static Expression |
parseDynamicFunctionCall(Expression functionItem,
ExpressionParser p)
|
Expression |
parseFunctionArgument()
Parse a function argument. |
ItemType |
parseFunctionItemType()
Parse the item type used for function items (XQuery 1.1 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 TODO: remove support for the old syntax The "function(" has already been read |
static ItemType |
parseFunctionItemType(ExpressionParser p)
|
protected Expression |
parseInlineFunction()
Parse an inline function "function" "(" ParamList? ")" ("as" SequenceType)? EnclosedExpr On entry, "function (" has already been read |
static Expression |
parseInlineFunction(ExpressionParser p,
Stack<XPath30Parser.InlineFunctionDetails> inlineFunctionStack)
|
protected Expression |
parseLiteralFunctionItem()
Parse a literal function item (introduced in XQuery 3.0 and XPath 3.0) Syntax: QName # integer The QName and # have already been read |
static Expression |
parseLiteralFunctionItem(ExpressionParser p)
|
protected Expression |
parseMapExpression()
Parse a map expression. |
protected static Expression |
parseMapExpression(ExpressionParser parser)
|
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 "function(" has already been read |
static ItemType |
parseMapItemType(ExpressionParser p)
|
protected ItemType |
parseParenthesizedItemType()
Parse a parenthesized item type (allowed in XQuery 3.0 and XPath 3.0 only) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XPath30Parser()
| Method Detail |
|---|
public int getPermittedFunctions()
protected Expression parseLiteralFunctionItem()
throws XPathException
parseLiteralFunctionItem in class ExpressionParserXPathException - if a static error is encountered
public static Expression parseLiteralFunctionItem(ExpressionParser p)
throws XPathException
XPathException
public ItemType parseFunctionItemType()
throws XPathException
parseFunctionItemType in class ExpressionParserXPathException - if a static error occurs (including the case
where XPath 3.0 syntax is not enabled)
public static ItemType parseFunctionItemType(ExpressionParser p)
throws XPathException
XPathException
public Expression parseFunctionArgument()
throws XPathException
parseFunctionArgument in class ExpressionParserXPathException - if the argument expression does not parse correctly
public ItemType parseMapItemType()
throws XPathException
parseMapItemType in class ExpressionParserXPathException - if a parsing error occurs or if the map syntax
is not available
public static ItemType parseMapItemType(ExpressionParser p)
throws XPathException
XPathException
protected ItemType parseParenthesizedItemType()
throws XPathException
parseParenthesizedItemType in class ExpressionParserXPathException - if a syntax error is found
protected Expression parseDynamicFunctionCall(Expression functionItem)
throws XPathException
parseDynamicFunctionCall in class ExpressionParserfunctionItem - the expression that determines the function to be called
XPathException - if a static error is found
public static Expression parseDynamicFunctionCall(Expression functionItem,
ExpressionParser p)
throws XPathException
XPathException
protected Expression parseInlineFunction()
throws XPathException
parseInlineFunction in class ExpressionParserXPathException - if a syntax error is found
public static Expression parseInlineFunction(ExpressionParser p,
Stack<XPath30Parser.InlineFunctionDetails> inlineFunctionStack)
throws XPathException
XPathException
protected Expression makeCurriedFunction(int offset,
StructuredQName name,
Expression[] args,
IntSet placeMarkers)
throws XPathException
makeCurriedFunction in class ExpressionParseroffset - 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 function
XPathException
public static Expression makeCurriedFunction(ExpressionParser parser,
StaticContext env,
Container container,
int offset,
StructuredQName name,
Expression[] args,
IntSet placeMarkers)
throws XPathException
XPathException
public 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 placemarkers
protected Expression parseMapExpression()
throws XPathException
parseMapExpression in class ExpressionParserXPathException
protected static Expression parseMapExpression(ExpressionParser parser)
throws XPathException
XPathExceptionprotected Binding findRangeVariable(StructuredQName qName)
findRangeVariable in class ExpressionParserqName - identifies the name of the range variable
public static Binding findOuterRangeVariable(StructuredQName qName,
Stack<XPath30Parser.InlineFunctionDetails> inlineFunctionStack,
StaticContext env)
protected boolean isNamespaceTestAllowed()
isNamespaceTestAllowed in class ExpressionParser
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||