|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--net.sf.saxon.expr.ExpressionParser
|
+--net.sf.saxon.query.QueryParser
This class defines extensions to the XPath parser to handle the additional syntax supported in XQuery
| Nested Class Summary |
| Nested classes inherited from class net.sf.saxon.expr.ExpressionParser |
ExpressionParser.ForClause |
| Field Summary | |
protected Executable |
executable
|
| Fields inherited from class net.sf.saxon.expr.ExpressionParser |
env, rangeVariables, scanOnly, t |
| Constructor Summary | |
QueryParser()
|
|
| Method Summary | |
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)
Report a parsing error |
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 |
parseForExpression()
Parse a FLWOR expression. |
void |
parseLibraryModule(java.lang.String queryString,
StaticQueryContext env)
Parse a library module. |
Expression |
parseQuery(java.lang.String queryString,
int start,
int terminator,
StaticQueryContext env)
Parse a top-level Query. |
protected Expression |
parseTypeswitchExpression()
Parse a Typeswitch Expression. |
protected Expression |
parseValidateExpression()
Parse a Validate Expression. |
void |
setExecutable(Executable exec)
Set the executable used for this query expression |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Executable executable
| Constructor Detail |
public QueryParser()
| Method Detail |
public XQueryExpression makeXQueryExpression(java.lang.String query,
StaticQueryContext staticContext,
Configuration config)
throws XPathException
XPathExceptionpublic Executable getExecutable()
public void setExecutable(Executable exec)
public final Expression parseQuery(java.lang.String queryString,
int start,
int terminator,
StaticQueryContext env)
throws XPathException
queryString - The text of the querystart - Offset of the start of the queryterminator - Token expected to follow the query (usually Token.EOF)env - The static context
XPathException - if the expression contains a syntax error
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 error
protected void grumble(java.lang.String message)
throws StaticError
grumble in class ExpressionParsermessage - the error message
StaticError - always thrown: an exception containing the
supplied message
protected Expression parseForExpression()
throws StaticError
[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)?
parseForExpression in class ExpressionParserStaticError - if any error is encountered
protected Expression parseTypeswitchExpression()
throws StaticError
parseTypeswitchExpression in class ExpressionParserStaticError
protected Expression parseValidateExpression()
throws StaticError
parseValidateExpression in class ExpressionParserStaticError
protected 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||