|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.expr.ExpressionParser
net.sf.saxon.query.QueryParser
public class QueryParser
This class defines extensions to the XPath parser to handle the additional syntax supported in XQuery
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.saxon.expr.ExpressionParser |
---|
ExpressionParser.ForClause, ExpressionParser.TemporaryContainer |
Field Summary | |
---|---|
protected Executable |
executable
|
java.util.Set |
importedModules
|
Fields inherited from class net.sf.saxon.expr.ExpressionParser |
---|
compileWithTracing, env, language, nameChecker, rangeVariables, scanOnly, SEQUENCE_TYPE, t, XPATH, XQUERY, XSLT_PATTERN |
Constructor Summary | |
---|---|
QueryParser()
Constructor for internal use: this class should be instantiated via the QueryModule |
Method Summary | |
---|---|
void |
applyModuleImport(net.sf.saxon.query.QueryParser.Import mImport)
|
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,
java.lang.String errorCode)
Report a static error |
static Expression |
makeStringJoin(Expression exp,
StaticContext env)
Make a string-join expression that concatenates the string-values of items in a sequence with intervening spaces. |
protected Literal |
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,
QueryModule staticContext,
Configuration config)
Create an XQueryExpression |
protected Expression |
parseConstructor()
Parse a node constructor. |
protected Expression |
parseExtensionExpression()
Parse an Extension Expression. |
protected Expression |
parseForExpression()
Parse a FLWOR expression. |
protected void |
parseFunctionDeclaration(boolean isUpdating)
Parse a function declaration. |
void |
parseLibraryModule(java.lang.String queryString,
QueryModule env)
Parse a library module. |
protected void |
parseRevalidationDeclaration()
Parse the "declare revalidation" declaration. |
protected Expression |
parseTypeswitchExpression()
Parse a Typeswitch Expression. |
protected void |
parseUpdatingFunctionDeclaration()
Parse an updating function declaration (allowed in XQuery Update only) |
protected Expression |
parseValidateExpression()
Parse a Validate Expression. |
Expression |
setDefaultValue(java.lang.String exp)
Parse the expression (inside a string literal) used to define default values for external variables. |
void |
setDisableCycleChecks(boolean disable)
Disable checks for certain kinds of cycle. |
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
public java.util.Set importedModules
Constructor Detail |
---|
public QueryParser()
Method Detail |
---|
public XQueryExpression makeXQueryExpression(java.lang.String query, QueryModule staticContext, Configuration config) throws XPathException
query
- the source text of the querystaticContext
- the static context of the queryconfig
- the Saxon configuration
XPathException
public Executable getExecutable()
public void setExecutable(Executable exec)
exec
- the executablepublic void setDisableCycleChecks(boolean disable)
declare option saxon:allow-cycles "true"
disable
- true if checks for import cycles are to be suppressed, that is,
if cycles should be allowedpublic final void parseLibraryModule(java.lang.String queryString, QueryModule env) throws XPathException
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.
XPathException
- if the expression contains a syntax errorprotected void grumble(java.lang.String message, java.lang.String errorCode) throws XPathException
grumble
in class ExpressionParser
message
- the error messageerrorCode
- the error code
XPathException
- always thrown: an exception containing the
supplied messageprotected void parseRevalidationDeclaration() throws XPathException
XPathException
public void applyModuleImport(net.sf.saxon.query.QueryParser.Import mImport) throws XPathException
XPathException
protected void parseFunctionDeclaration(boolean isUpdating) throws XPathException
Syntax:
<"declare" "function">
On entry, the "define function" has already been recognized
XPathException
- if a syntax error is foundprotected void parseUpdatingFunctionDeclaration() throws XPathException
XPathException
public Expression setDefaultValue(java.lang.String exp)
exp
- holds the expression used to define a default value
protected Expression parseForExpression() throws XPathException
parseForExpression
in class ExpressionParser
XPathException
- if any error is encounteredpublic static Expression makeStringJoin(Expression exp, StaticContext env)
exp
- the base expression, evaluating to a sequenceenv
- the static context
protected Expression parseTypeswitchExpression() throws XPathException
parseTypeswitchExpression
in class ExpressionParser
XPathException
protected Expression parseValidateExpression() throws XPathException
parseValidateExpression
in class ExpressionParser
XPathException
protected Expression parseExtensionExpression() throws XPathException
parseExtensionExpression
in class ExpressionParser
XPathException
protected Expression parseConstructor() throws XPathException
parseConstructor
in class ExpressionParser
XPathException
- in the event of a syntax error.protected Literal makeStringLiteral(java.lang.String token) throws XPathException
makeStringLiteral
in class ExpressionParser
token
- the string as written (or as returned by the tokenizer)
XPathException
protected java.lang.String getLanguage()
getLanguage
in class ExpressionParser
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |