| java.lang.Object net.sf.saxon.expr.ExpressionParser net.sf.saxon.query.QueryParser
QueryParser | class QueryParser extends ExpressionParser (Code) | | This class defines extensions to the XPath parser to handle the additional
syntax supported in XQuery
|
importedModules | public Set importedModules(Code) | | |
namespacesToBeSealed | List namespacesToBeSealed(Code) | | |
QueryParser | protected QueryParser()(Code) | | Protected Constructor: this class should be instantiated via the StaticQueryContext
|
applyModuleImport | public void applyModuleImport(Import mImport) throws StaticError(Code) | | |
getExecutable | public Executable getExecutable()(Code) | | Get the executable containing this expression.
|
getLanguage | protected String getLanguage()(Code) | | Get the current language (XPath or XQuery)
|
makeStringJoin | public static Expression makeStringJoin(Expression exp, StaticContext env)(Code) | | Make a string-join expression that concatenates the string-values of items in
a sequence with intervening spaces. This may be simplified later as a result
of type-checking.
|
makeStringLiteral | protected StringValue makeStringLiteral(String token) throws StaticError(Code) | | Method to make a string literal from a token identified as a string
literal. This is trivial in XPath, but in XQuery the method is overridden
to identify pseudo-XML character and entity references
Parameters: token - The string value of the string literal, after dereferencing entity andcharacter references |
parseConstructor | protected Expression parseConstructor() throws StaticError(Code) | | Parse a node constructor. This is allowed only in XQuery. This method handles
both the XML-like "direct" constructors, and the XQuery-based "computed"
constructors.
an Expression for evaluating the parsed constructor throws: net.sf.saxon.trans.StaticError - in the event of a syntax error. |
parseExtensionExpression | protected Expression parseExtensionExpression() throws StaticError(Code) | | Parse an Extension Expression.
Syntax: "(#" QName arbitrary-text "#)")+ "{" expr? "}"
Currenly Saxon does not recognize any extension expressions, so the pragma is ignored and
the following expression is returned. (We don't even check the QName)
|
parseForExpression | protected Expression parseForExpression() throws StaticError(Code) | | Parse a FLWOR expression. This replaces the XPath "for" expression.
Full syntax:
[41] FLWORExpr ::= (ForClause | LetClause)+
WhereClause? OrderByClause?
"return" ExprSingle
[42] ForClause ::= <"for" "$"> VarName TypeDeclaration? PositionalVar? "in" ExprSingle
("," "$" VarName TypeDeclaration? PositionalVar? "in" ExprSingle)*
[43] PositionalVar ::= "at" "$" VarName
[44] LetClause ::= <"let" "$"> VarName TypeDeclaration? ":=" ExprSingle
("," "$" VarName TypeDeclaration? ":=" ExprSingle)*
[45] WhereClause ::= "where" Expr
[46] OrderByClause ::= (<"order" "by"> | <"stable" "order" "by">) OrderSpecList
[47] OrderSpecList ::= OrderSpec ("," OrderSpec)*
[48] OrderSpec ::= ExprSingle OrderModifier
[49] OrderModifier ::= ("ascending" | "descending")?
(<"empty" "greatest"> | <"empty" "least">)?
("collation" StringLiteral)?
the resulting subexpression throws: net.sf.saxon.trans.StaticError - if any error is encountered |
parseLibraryModule | final public void parseLibraryModule(String queryString, StaticQueryContext env) throws StaticError(Code) | | Parse a library module.
Prolog? Expression
Parameters: queryString - The text of the library module. Parameters: env - The static context. The result of parsinga library module is that the static context is populated with a set of functiondeclarations and variable declarations. Each library module must have its ownstatic context objext. throws: net.sf.saxon.trans.StaticError - if the expression contains a syntax error |
parseTypeswitchExpression | protected Expression parseTypeswitchExpression() throws StaticError(Code) | | Parse a Typeswitch Expression.
This construct is XQuery-only.
TypeswitchExpr ::=
"typeswitch" "(" Expr ")"
CaseClause+
"default" ("$" VarName)? "return" ExprSingle
CaseClause ::=
"case" ("$" VarName "as")? SequenceType "return" Expr
|
parseValidateExpression | protected Expression parseValidateExpression() throws StaticError(Code) | | Parse a Validate Expression.
This construct is XQuery-only. The syntax allows:
validate mode? { Expr }
mode ::= "strict" | "lax"
|
setDefaultValue | public Expression setDefaultValue(String exp)(Code) | | Parse the expression (inside a string literal) used to define default values
for external variables. This requires instantiating a nested XPath parser.
|
setExecutable | public void setExecutable(Executable exec)(Code) | | Set the executable used for this query expression
|
Methods inherited from net.sf.saxon.expr.ExpressionParser | protected String currentTokenDisplay()(Code)(Java Doc) protected void declareRangeVariable(VariableDeclaration declaration) throws StaticError(Code)(Java Doc) protected void expect(int token) throws StaticError(Code)(Java Doc) protected String getLanguage()(Code)(Java Doc) public Stack getRangeVariableStack()(Code)(Java Doc) public Tokenizer getTokenizer()(Code)(Java Doc) protected void grumble(String message) throws StaticError(Code)(Java Doc) protected void grumble(String message, String errorCode) throws StaticError(Code)(Java Doc) protected boolean isKeyword(String s)(Code)(Java Doc) public LocalNameTest makeLocalNameTest(short nodeType, String localName) throws StaticError(Code)(Java Doc) final public int makeNameCode(String qname, boolean useDefault) throws StaticError(Code)(Java Doc) public NameTest makeNameTest(short nodeType, String qname, boolean useDefault) throws StaticError(Code)(Java Doc) public NamespaceTest makeNamespaceTest(short nodeType, String prefix) throws StaticError(Code)(Java Doc) protected StringValue makeStringLiteral(String currentTokenValue) throws StaticError(Code)(Java Doc) protected Expression makeTracer(int startOffset, Expression exp, int construct, int objectNameCode)(Code)(Java Doc) protected void nextToken() throws StaticError(Code)(Java Doc) public Expression parse(String expression, int start, int terminator, int lineNumber, StaticContext env) throws StaticError(Code)(Java Doc) protected Expression parseConstructor() throws StaticError(Code)(Java Doc) protected Expression parseExprSingle() throws StaticError(Code)(Java Doc) protected Expression parseExpression() throws StaticError(Code)(Java Doc) protected Expression parseExtensionExpression() throws StaticError(Code)(Java Doc) protected Expression parseForExpression() throws StaticError(Code)(Java Doc) protected Expression parseMappingExpression() throws StaticError(Code)(Java Doc) protected NodeTest parseNodeTest(short nodeType) throws StaticError(Code)(Java Doc) public Pattern parsePattern(String pattern, StaticContext env) throws StaticError(Code)(Java Doc) protected Expression parseRelativePath() throws StaticError(Code)(Java Doc) protected Expression parseRemainingPath(Expression start) throws StaticError(Code)(Java Doc) public SequenceType parseSequenceType(String input, StaticContext env) throws StaticError(Code)(Java Doc) protected SequenceType parseSequenceType() throws StaticError(Code)(Java Doc) protected Expression parseStepExpression() throws StaticError(Code)(Java Doc) protected Expression parseTypeswitchExpression() throws StaticError(Code)(Java Doc) protected Expression parseValidateExpression() throws StaticError(Code)(Java Doc) protected void setLocation(Expression exp)(Code)(Java Doc) protected void setLocation(Expression exp, int offset)(Code)(Java Doc) public void setRangeVariableStack(Stack stack)(Code)(Java Doc) public void setScanOnly(boolean scanOnly)(Code)(Java Doc) protected void undeclareRangeVariable()(Code)(Java Doc) protected void warning(String message) throws StaticError(Code)(Java Doc)
|
|
|