| gnu.text.Lexer gnu.xquery.lang.XQParser
XQParser | public class XQParser extends Lexer (Code) | | A class to read xquery forms.
|
Method Summary | |
public void | appendNamedEntity(String name) | public static Expression | booleanValue(Expression exp) Coerce the value of an expresison to a boolean value. | static ApplyExp | castQName(Expression value) Generate code to cast argument to a QName
(which is implemented using Symbol ). | void | checkAllowedNamespaceDeclaration(String prefix, String uri, boolean inConstructor) | void | checkSeparator(char ch) | public Expression | declError(String message) | public void | eofError(String msg) | public void | error(char severity, String message, String code) | public void | error(char severity, String message) | public void | fatal(String msg, String code) | static Path | fixupStaticBaseUri(Path path) | int | getAxis() | public void | getDelimited(String delimiter) Scan until a given delimiter. | int | getRawToken() | public String | getStaticBaseUri() | public void | handleOption(Symbol name, String value) | static Expression | makeBinary(Expression func, Expression exp1, Expression exp2) | Expression | makeBinary(int op, Expression exp1, Expression exp2) | static Expression | makeExprSequence(Expression exp1, Expression exp2) | public static Expression | makeFunctionExp(String className, String name) | public static Expression | makeFunctionExp(String className, String fieldName, String name) | static Expression | makeNamedNodeType(boolean attribute, Expression qname) | public void | mark() | boolean | match(String word1, String word2, boolean force) | public boolean | match(String word) | public void | maybeSetLine(Expression exp, int line, int column) | public void | maybeSetLine(Declaration decl, int line, int column) | protected Symbol | namespaceResolve(String name, boolean function) | public Expression | parse(Compilation comp) Parse an expression.
Return null on EOF. | Expression | parseBinaryExpr(int prio) | void | parseContent(char delimiter, Vector result) Parse ElementContent (delimiter == '<') or AttributeContent (otherwise). | public Expression | parseDataType() | Expression | parseElementConstructor() Parse ElementConstructor.
Assume initial
'<' has been processed,
and we're looking at the next token..
Reads through end of the end tag. | Expression | parseEnclosedExpr() Parse an EnclosedExpr. | void | parseEntityOrCharRef() | Expression | parseExpr() | Expression | parseExprSequence(int rightToken, boolean optional) | final Expression | parseExprSingle() | public Expression | parseFLWRExpression(boolean isFor) | public Expression | parseFLWRInner(boolean isFor) Parse a let- or a for-expression.
Assume the 'let'/'for'-token has been seen, and we've read '$'.
If we see the 'order' keyword of an 'order by' clause then we stop
parsing, and return a result as if we instead saw a
'return make-tuple($x, ...)'. | public Expression | parseFunctionDefinition(int declLine, int declColumn) | public Expression | parseIfExpr() | Expression | parseIntersectExceptExpr() | public Expression | parseItemType() | public Expression | parseMaybeKindTest() | Expression | parseMaybePrimaryExpr() Try to parse a PrimaryExpr. | Expression | parseNameTest(boolean attribute) Returns an expression that evaluates to a Symbol.
The expression will normally be constant
folded to a Symbol, but we cannot do that yet. | public Expression | parseNamedNodeType(boolean attribute) | Expression | parseNodeTest(int axis) | public Expression | parseOptionalTypeDeclaration() | Expression | parseParenExpr() Parse ParenthesizedExpr. | Expression | parsePathExpr() | Expression | parsePrimaryExpr() Parse a PrimaryExpr. | public Expression | parseQuantifiedExpr(boolean isEvery) Parse a some- or an every-expression.
Assume the 'some'/'every'-token has been seen, and we've read '$'. | Expression | parseRelativePathExpr(Expression exp) | void | parseSeparator() | Expression | parseStepExpr() | Expression | parseStepQualifiers(Expression exp, int axis) | Expression | parseTypeSwitch() | Object | parseURILiteral() Parse a URILiteral .. | Expression | parseUnaryExpr() | Expression | parseUnionExpr() | public Object | parseVariable() Parse a Variable. | public Declaration | parseVariableDeclaration() | Expression | parseXMLConstructor(int next, boolean inElementContent) Parse an ElementConstructor or other constructs starting with '<'. | final int | peekNonSpace(String message) Do skipSpace followed by unread to find next non-space character. | int | peekOperand() Process token, assuming we are in operand context. | int | peekOperator() Return the current token, assuming it is in operator context. | void | pushNamespace(String prefix, String uri) | public Object | readObject() | public void | reset() | public String | resolveAgainstBaseUri(String uri) | public void | setInteractive(boolean v) | public void | setStaticBaseUri(String uri) | final void | skipComment() | final void | skipOldComment() | final int | skipSpace() Skip whitespace.
Sets 'index' to the that of the next non-whitespace character,
and returns that. | final int | skipSpace(boolean verticalToo) | final void | skipToSemicolon() | public Expression | syntaxError(String message, String code) Handle syntax errors (at rewrite time). | public Expression | syntaxError(String message) | String | tokenString() Helper method for debugging. | void | warnOldVersion(String message) | Expression | wrapWithBaseUri(Expression exp) |
ARROW_TOKEN | final static int ARROW_TOKEN(Code) | | |
ATTRIBUTE_TOKEN | final static int ATTRIBUTE_TOKEN(Code) | | |
AXIS_ANCESTOR | final static int AXIS_ANCESTOR(Code) | | |
AXIS_ANCESTOR_OR_SELF | final static int AXIS_ANCESTOR_OR_SELF(Code) | | |
AXIS_ATTRIBUTE | final static int AXIS_ATTRIBUTE(Code) | | |
AXIS_CHILD | final static int AXIS_CHILD(Code) | | |
AXIS_DESCENDANT | final static int AXIS_DESCENDANT(Code) | | |
AXIS_DESCENDANT_OR_SELF | final static int AXIS_DESCENDANT_OR_SELF(Code) | | |
AXIS_FOLLOWING | final static int AXIS_FOLLOWING(Code) | | |
AXIS_FOLLOWING_SIBLING | final static int AXIS_FOLLOWING_SIBLING(Code) | | |
AXIS_NAMESPACE | final static int AXIS_NAMESPACE(Code) | | |
AXIS_PARENT | final static int AXIS_PARENT(Code) | | |
AXIS_PRECEDING | final static int AXIS_PRECEDING(Code) | | |
AXIS_PRECEDING_SIBLING | final static int AXIS_PRECEDING_SIBLING(Code) | | |
AXIS_SELF | final static int AXIS_SELF(Code) | | |
CASE_DOLLAR_TOKEN | final static int CASE_DOLLAR_TOKEN(Code) | | |
COLON_COLON_TOKEN | final static int COLON_COLON_TOKEN(Code) | | |
COLON_EQUAL_TOKEN | final static int COLON_EQUAL_TOKEN(Code) | | |
COMMENT_TOKEN | final static int COMMENT_TOKEN(Code) | | |
COUNT_OP_AXIS | final static int COUNT_OP_AXIS(Code) | | |
DECIMAL_TOKEN | final static char DECIMAL_TOKEN(Code) | | |
DECLARE_BASE_URI_TOKEN | final static int DECLARE_BASE_URI_TOKEN(Code) | | |
DECLARE_BOUNDARY_SPACE_TOKEN | final static int DECLARE_BOUNDARY_SPACE_TOKEN(Code) | | |
DECLARE_CONSTRUCTION_TOKEN | final static int DECLARE_CONSTRUCTION_TOKEN(Code) | | |
DECLARE_COPY_NAMESPACES_TOKEN | final static int DECLARE_COPY_NAMESPACES_TOKEN(Code) | | |
DECLARE_FUNCTION_TOKEN | final static int DECLARE_FUNCTION_TOKEN(Code) | | |
DECLARE_NAMESPACE_TOKEN | final static int DECLARE_NAMESPACE_TOKEN(Code) | | |
DECLARE_OPTION_TOKEN | final static int DECLARE_OPTION_TOKEN(Code) | | |
DECLARE_ORDERING_TOKEN | final static int DECLARE_ORDERING_TOKEN(Code) | | |
DECLARE_VARIABLE_TOKEN | final static int DECLARE_VARIABLE_TOKEN(Code) | | |
DEFAULT_COLLATION_TOKEN | final static int DEFAULT_COLLATION_TOKEN(Code) | | |
DEFAULT_ELEMENT_TOKEN | final static int DEFAULT_ELEMENT_TOKEN(Code) | | |
DEFAULT_FUNCTION_TOKEN | final static int DEFAULT_FUNCTION_TOKEN(Code) | | |
DEFAULT_ORDER_TOKEN | final static int DEFAULT_ORDER_TOKEN(Code) | | |
DEFINE_QNAME_TOKEN | final static int DEFINE_QNAME_TOKEN(Code) | | |
DOCUMENT_TOKEN | final static int DOCUMENT_TOKEN(Code) | | |
DOTDOT_TOKEN | final static int DOTDOT_TOKEN(Code) | | |
DOT_VARNAME | final static Symbol DOT_VARNAME(Code) | | The internal name of the variable containing '.', the context node.
|
DOUBLE_TOKEN | final static char DOUBLE_TOKEN(Code) | | |
ELEMENT_TOKEN | final static int ELEMENT_TOKEN(Code) | | |
EOF_TOKEN | final static int EOF_TOKEN(Code) | | |
EOL_TOKEN | final static int EOL_TOKEN(Code) | | |
EVERY_DOLLAR_TOKEN | final static int EVERY_DOLLAR_TOKEN(Code) | | |
FNAME_TOKEN | final static int FNAME_TOKEN(Code) | | |
FOR_DOLLAR_TOKEN | final static int FOR_DOLLAR_TOKEN(Code) | | |
IF_LPAREN_TOKEN | final static int IF_LPAREN_TOKEN(Code) | | |
IMPORT_MODULE_TOKEN | final static int IMPORT_MODULE_TOKEN(Code) | | |
IMPORT_SCHEMA_TOKEN | final static int IMPORT_SCHEMA_TOKEN(Code) | | |
INTEGER_TOKEN | final static char INTEGER_TOKEN(Code) | | |
LAST_VARNAME | final static Symbol LAST_VARNAME(Code) | | The pseduo-function last() is mapped to a reference to this variable.
|
LET_DOLLAR_TOKEN | final static int LET_DOLLAR_TOKEN(Code) | | |
MODULE_NAMESPACE_TOKEN | final static int MODULE_NAMESPACE_TOKEN(Code) | | |
NCNAME_COLON_TOKEN | final static int NCNAME_COLON_TOKEN(Code) | | A non-qualified (simple) name (NCName) followed by a colon.
The colon is not followed by another NCNAME (in which it would
be a QNAME_TOKEN instead).
The tokenBuffer contains the name (which does not contain the ':').
|
NCNAME_TOKEN | final static int NCNAME_TOKEN(Code) | | A non-qualified (simple) name (NCName).
The tokenBuffer contains the name (which does not contain a ':').
|
OP_ADD | final static int OP_ADD(Code) | | |
OP_AND | final static int OP_AND(Code) | | |
OP_ATTRIBUTE | final static int OP_ATTRIBUTE(Code) | | |
OP_AXIS_FIRST | final static int OP_AXIS_FIRST(Code) | | |
OP_BASE | final static int OP_BASE(Code) | | |
OP_CASTABLE_AS | final static int OP_CASTABLE_AS(Code) | | |
OP_CAST_AS | final static int OP_CAST_AS(Code) | | |
OP_COMMENT | final static int OP_COMMENT(Code) | | |
OP_DIV | final static int OP_DIV(Code) | | |
OP_DOCUMENT | final static int OP_DOCUMENT(Code) | | |
OP_ELEMENT | final static int OP_ELEMENT(Code) | | |
OP_EMPTY_SEQUENCE | final static int OP_EMPTY_SEQUENCE(Code) | | |
OP_EQ | final static int OP_EQ(Code) | | |
OP_EQU | final static int OP_EQU(Code) | | |
OP_EXCEPT | final static int OP_EXCEPT(Code) | | |
OP_GE | final static int OP_GE(Code) | | |
OP_GEQ | final static int OP_GEQ(Code) | | |
OP_GRT | final static int OP_GRT(Code) | | |
OP_GRTGRT | final static int OP_GRTGRT(Code) | | |
OP_GT | final static int OP_GT(Code) | | |
OP_IDIV | final static int OP_IDIV(Code) | | |
OP_INSTANCEOF | final static int OP_INSTANCEOF(Code) | | |
OP_INTERSECT | final static int OP_INTERSECT(Code) | | |
OP_IS | final static int OP_IS(Code) | | |
OP_ISNOT | final static int OP_ISNOT(Code) | | |
OP_ITEM | final static int OP_ITEM(Code) | | |
OP_LE | final static int OP_LE(Code) | | |
OP_LEQ | final static int OP_LEQ(Code) | | |
OP_LSS | final static int OP_LSS(Code) | | |
OP_LSSLSS | final static int OP_LSSLSS(Code) | | |
OP_LT | final static int OP_LT(Code) | | |
OP_MOD | final static int OP_MOD(Code) | | |
OP_MUL | final static int OP_MUL(Code) | | |
OP_NE | final static int OP_NE(Code) | | |
OP_NEQ | final static int OP_NEQ(Code) | | |
OP_NODE | final static int OP_NODE(Code) | | |
OP_OR | final static int OP_OR(Code) | | |
OP_PI | final static int OP_PI(Code) | | |
OP_RANGE_TO | final static int OP_RANGE_TO(Code) | | |
OP_SCHEMA_ATTRIBUTE | final static int OP_SCHEMA_ATTRIBUTE(Code) | | |
OP_SCHEMA_ELEMENT | final static int OP_SCHEMA_ELEMENT(Code) | | |
OP_SUB | final static int OP_SUB(Code) | | |
OP_TEXT | final static int OP_TEXT(Code) | | |
OP_TREAT_AS | final static int OP_TREAT_AS(Code) | | |
OP_UNION | final static int OP_UNION(Code) | | |
OP_WHERE | final static int OP_WHERE(Code) | | |
ORDERED_LBRACE_TOKEN | final static int ORDERED_LBRACE_TOKEN(Code) | | |
PI_TOKEN | final static int PI_TOKEN(Code) | | |
POSITION_VARNAME | final static Symbol POSITION_VARNAME(Code) | | The pseduo-function position() is mapped to a reference.
|
PRAGMA_START_TOKEN | final static int PRAGMA_START_TOKEN(Code) | | |
QNAME_TOKEN | final static int QNAME_TOKEN(Code) | | A Qualified name (QName).
The tokenBuffer contains the full name, which contains one ':'.
|
SLASHSLASH_TOKEN | final static int SLASHSLASH_TOKEN(Code) | | |
SOME_DOLLAR_TOKEN | final static int SOME_DOLLAR_TOKEN(Code) | | |
STRING_TOKEN | final static int STRING_TOKEN(Code) | | |
TEXT_TOKEN | final static int TEXT_TOKEN(Code) | | |
TYPESWITCH_LPAREN_TOKEN | final static int TYPESWITCH_LPAREN_TOKEN(Code) | | |
UNORDERED_LBRACE_TOKEN | final static int UNORDERED_LBRACE_TOKEN(Code) | | |
VALIDATE_LBRACE_TOKEN | final static int VALIDATE_LBRACE_TOKEN(Code) | | |
XQUERY_VERSION_TOKEN | final static int XQUERY_VERSION_TOKEN(Code) | | |
baseURIDeclarationSeen | boolean baseURIDeclarationSeen(Code) | | |
boundarySpaceDeclarationSeen | boolean boundarySpaceDeclarationSeen(Code) | | |
boundarySpacePreserve | boolean boundarySpacePreserve(Code) | | |
commentCount | int commentCount(Code) | | |
constructionModeDeclarationSeen | boolean constructionModeDeclarationSeen(Code) | | True if a construction mode declaration has been seen.
|
constructionModeStrip | boolean constructionModeStrip(Code) | | The static construction mode. True if "strip"; false if "preserve".
|
constructorNamespaces | NamespaceBinding constructorNamespaces(Code) | | Chain of namespace bindings from namespace declaration attributes
in outer direct element constructors. This is only non-empty during
resolve time, but it is declared here so namespaceResolve can use it.
|
copyNamespacesDeclarationSeen | boolean copyNamespacesDeclarationSeen(Code) | | True if we've seen a 'copy-namespaces' declaration'.
|
copyNamespacesMode | int copyNamespacesMode(Code) | | |
curColumn | int curColumn(Code) | | Value of getColumnNumber() at start of current token.
Sometimes set otherwise, to report errors.
|
curLine | int curLine(Code) | | Value of getLineNumber() at start of current token.
Sometimes set otherwise, to report errors.
|
defaultElementNamespace | String defaultElementNamespace(Code) | | |
defaultEmptyOrder | char defaultEmptyOrder(Code) | | The default order for empty sequences.
Either 'L' (for "least") or 'G' (for "greatest").
|
emptyOrderDeclarationSeen | boolean emptyOrderDeclarationSeen(Code) | | |
enclosedExpressionsSeen | int enclosedExpressionsSeen(Code) | | Count of enclosed expressions seen in element or attribute content.
|
errorIfComment | String errorIfComment(Code) | | An error message if comments are disallowed. Normally null.
|
flworDecls | Declaration[] flworDecls(Code) | | Stack of currently active for/let Declarations.
|
flworDeclsCount | int flworDeclsCount(Code) | | |
flworDeclsFirst | int flworDeclsFirst(Code) | | |
getExternalFunction | final public static QuoteExp getExternalFunction(Code) | | |
makeDescendantAxisStep | public static QuoteExp makeDescendantAxisStep(Code) | | |
orderingModeSeen | boolean orderingModeSeen(Code) | | |
orderingModeUnordered | boolean orderingModeUnordered(Code) | | |
parseContext | int parseContext(Code) | | Normally null.
'C' means parsing the type of a 'cast as' or 'castable as'.
|
parseCount | int parseCount(Code) | | |
prologNamespaces | NamespaceBinding prologNamespaces(Code) | | Chain of namespace bindings from declarations in prolog,
followed by the builtinNamespaces.
|
seenDeclaration | boolean seenDeclaration(Code) | | True if we've seen a VarDecl, FunctionDecl, or OptionDecl.
|
seenPosition | int seenPosition(Code) | | |
warnHidePreviousDeclaration | public static boolean warnHidePreviousDeclaration(Code) | | |
warnOldVersion | public static boolean warnOldVersion(Code) | | |
appendNamedEntity | public void appendNamedEntity(String name)(Code) | | |
castQName | static ApplyExp castQName(Expression value)(Code) | | Generate code to cast argument to a QName
(which is implemented using Symbol ).
|
checkAllowedNamespaceDeclaration | void checkAllowedNamespaceDeclaration(String prefix, String uri, boolean inConstructor)(Code) | | |
checkSeparator | void checkSeparator(char ch)(Code) | | |
getDelimited | public void getDelimited(String delimiter) throws java.io.IOException, SyntaxException(Code) | | Scan until a given delimiter.
On success, text upto the delimiter is in then tokenBuffer (with
tokenBufferLength marking its length); the delimiter is not included.
|
maybeSetLine | public void maybeSetLine(Expression exp, int line, int column)(Code) | | |
parseContent | void parseContent(char delimiter, Vector result) throws java.io.IOException, SyntaxException(Code) | | Parse ElementContent (delimiter == '<') or AttributeContent (otherwise).
Parameters: delimiter - is '<' if parsing ElementContent, is either '\'' or'\"' if parsing AttributeContent depending on the starting quote Parameters: result - a buffer to place the resulting Expressions. |
parseElementConstructor | Expression parseElementConstructor() throws java.io.IOException, SyntaxException(Code) | | Parse ElementConstructor.
Assume initial
'<' has been processed,
and we're looking at the next token..
Reads through end of the end tag. FIXME
|
parseFLWRInner | public Expression parseFLWRInner(boolean isFor) throws java.io.IOException, SyntaxException(Code) | | Parse a let- or a for-expression.
Assume the 'let'/'for'-token has been seen, and we've read '$'.
If we see the 'order' keyword of an 'order by' clause then we stop
parsing, and return a result as if we instead saw a
'return make-tuple($x, ...)'. The 'order by' clause will get
parsed by the outer-most 'for' or 'let'.
|
parseXMLConstructor | Expression parseXMLConstructor(int next, boolean inElementContent) throws java.io.IOException, SyntaxException(Code) | | Parse an ElementConstructor or other constructs starting with '<'.
Assume initial '<' has been processed.
Parameters: next - next character (after '<'). |
peekOperator | int peekOperator() throws java.io.IOException, SyntaxException(Code) | | Return the current token, assuming it is in operator context.
Resolve NCNAME_TOKEN (identifier) to 'and', 'or', 'div', etc.
|
setInteractive | public void setInteractive(boolean v)(Code) | | |
setStaticBaseUri | public void setStaticBaseUri(String uri)(Code) | | |
skipSpace | final int skipSpace() throws java.io.IOException, SyntaxException(Code) | | Skip whitespace.
Sets 'index' to the that of the next non-whitespace character,
and returns that. If there are no more non-space characters,
returns ' '.
|
tokenString | String tokenString()(Code) | | Helper method for debugging.
|
Methods inherited from gnu.text.Lexer | public boolean checkErrors(PrintWriter out, int max)(Code)(Java Doc) public boolean checkNext(char ch) throws java.io.IOException(Code)(Java Doc) public void clearErrors()(Code)(Java Doc) public void close() throws java.io.IOException(Code)(Java Doc) public void eofError(String msg) throws SyntaxException(Code)(Java Doc) public void eofError(String message, int startLine, int startColumn) throws SyntaxException(Code)(Java Doc) public void error(char severity, String filename, int line, int column, String message)(Code)(Java Doc) public void error(char severity, String message)(Code)(Java Doc) public void error(String message)(Code)(Java Doc) public void fatal(String message) throws SyntaxException(Code)(Java Doc) public int getColumnNumber()(Code)(Java Doc) public SourceError getErrors()(Code)(Java Doc) public int getLineNumber()(Code)(Java Doc) public SourceMessages getMessages()(Code)(Java Doc) public String getName()(Code)(Java Doc) final public LineBufferedReader getPort()(Code)(Java Doc) public boolean isInteractive()(Code)(Java Doc) public void mark() throws java.io.IOException(Code)(Java Doc) public int peek() throws java.io.IOException(Code)(Java Doc) public void popNesting(char save)(Code)(Java Doc) public char pushNesting(char promptChar)(Code)(Java Doc) public int read() throws java.io.IOException(Code)(Java Doc) public int read(char[] buf, int offset, int length) throws java.io.IOException(Code)(Java Doc) public static long readDigitsInBuffer(LineBufferedReader port, int radix)(Code)(Java Doc) public int readOptionalExponent() throws java.io.IOException(Code)(Java Doc) public void reset() throws java.io.IOException(Code)(Java Doc) public boolean seenErrors()(Code)(Java Doc) public void setInteractive(boolean v)(Code)(Java Doc) public void setMessages(SourceMessages messages)(Code)(Java Doc) public void skip() throws java.io.IOException(Code)(Java Doc) protected void skip_quick() throws java.io.IOException(Code)(Java Doc) public void tokenBufferAppend(int ch)(Code)(Java Doc) public void unread(int ch) throws java.io.IOException(Code)(Java Doc) protected void unread() throws java.io.IOException(Code)(Java Doc) protected void unread_quick() throws java.io.IOException(Code)(Java Doc)
|
|
|