Package gnu.xquery.lang
Class XQParser
java.lang.Object
java.io.Reader
gnu.text.Lexer
gnu.xquery.lang.XQParser
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
A class to read xquery forms.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]static final CastableAsstatic final QuoteExpstatic final InstanceOfstatic QuoteExpstatic QuoteExpstatic Expressionstatic final Convertstatic booleanstatic booleanFields inherited from class gnu.text.Lexer
nesting, port, tentative, tokenBuffer, tokenBufferLength -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendNamedEntity(String name) static ExpressionbooleanValue(Expression exp) Coerce the value of an expresison to a boolean value.voidvoidvoidvoidvoidgetDelimited(String delimiter) Scan until a given delimiter.voidhandleOption(Symbol name, String value) static ExpressionmakeFunctionExp(String className, String name) static ExpressionmakeFunctionExp(String className, String fieldName, String name) voidmark()Start tentative parsing.booleanvoidmaybeSetLine(Declaration decl, int line, int column) voidmaybeSetLine(Expression exp, int line, int column) voidmaybeSetLine(Expression exp, int startLine, int startColumn, int endLine, int endColumn) protected SymbolnamespaceResolve(String name, boolean function) parse(Compilation comp) Parse an expression.parseFLWRExpression(boolean isFor) parseFLWRInner(boolean isFor) Parse a let- or a for-expression.parseFunctionDefinition(int declLine, int declColumn) parseNamedNodeType(boolean attribute) Parse: ["as" SequenceType]parseQuantifiedExpr(boolean isEvery) Parse a some- or an every-expression.Parse a Variable.voidreset()Stop tentative parsing.voidsetInteractive(boolean v) voidsetStaticBaseUri(String uri) syntaxError(String message) syntaxError(String message, String code) Handle syntax errors (at rewrite time).Methods inherited from class gnu.text.Lexer
checkErrors, checkNext, clearErrors, close, eofError, error, error, fatal, getColumnNumber, getErrors, getLineNumber, getMessages, getName, getPort, isInteractive, isTentative, peek, popNesting, pushNesting, read, read, readCodePoint, readDelimited, readDigits, readDigitsInBuffer, readIntDigits, readOptionalExponent, readUnicodeChar, seenErrors, setMessages, setTentative, skip, skip_quick, tokenBufferAppend, tokenBufferString, unread, unread, unread_quickMethods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, ready, skip, transferTo
-
Field Details
-
warnOldVersion
public static boolean warnOldVersion -
warnHidePreviousDeclaration
public static boolean warnHidePreviousDeclaration -
instanceOf
-
castableAs
-
treatAs
-
functionNamespacePath
-
makeChildAxisStep
-
makeDescendantAxisStep
-
makeText
-
getExternalFunction
-
axisNames
-
-
Constructor Details
-
XQParser
-
-
Method Details
-
setStaticBaseUri
-
getStaticBaseUri
-
resolveAgainstBaseUri
-
mark
Description copied from class:LexerStart tentative parsing. Must be followed by a reset.- Overrides:
markin classLexer- Throws:
IOException
-
reset
Description copied from class:LexerStop tentative parsing. Return to position where we called mark.- Overrides:
resetin classLexer- Throws:
IOException
-
getDelimited
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.- Throws:
IOExceptionSyntaxException
-
appendNamedEntity
-
setInteractive
public void setInteractive(boolean v) - Overrides:
setInteractivein classLexer
-
parseNamedNodeType
- Throws:
IOExceptionSyntaxException
-
parseOptionalTypeDeclaration
Parse: ["as" SequenceType]- Throws:
IOExceptionSyntaxException
-
parseDataType
- Throws:
IOExceptionSyntaxException
-
parseMaybeKindTest
- Throws:
IOExceptionSyntaxException
-
parseItemType
- Throws:
IOExceptionSyntaxException
-
booleanValue
Coerce the value of an expresison to a boolean value. -
parseIfExpr
- Throws:
IOExceptionSyntaxException
-
match
-
parseVariable
Parse a Variable.- Throws:
IOExceptionSyntaxException
-
parseVariableDeclaration
- Throws:
IOExceptionSyntaxException
-
parseFLWRExpression
- Throws:
IOExceptionSyntaxException
-
parseFLWRInner
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'.- Throws:
IOExceptionSyntaxException
-
parseQuantifiedExpr
Parse a some- or an every-expression. Assume the 'some'/'every'-token has been seen, and we've read '$'.- Throws:
IOExceptionSyntaxException
-
parseFunctionDefinition
public Expression parseFunctionDefinition(int declLine, int declColumn) throws IOException, SyntaxException - Throws:
IOExceptionSyntaxException
-
readObject
- Throws:
IOExceptionSyntaxException
-
namespaceResolve
-
parse
Parse an expression. Return null on EOF.- Throws:
IOExceptionSyntaxException
-
handleOption
-
makeFunctionExp
-
makeFunctionExp
-
error
-
error
-
declError
- Throws:
IOExceptionSyntaxException
-
syntaxError
Handle syntax errors (at rewrite time).- Parameters:
message- an error message to print out- Returns:
- an ErrorExp
- Throws:
IOExceptionSyntaxException
-
syntaxError
- Throws:
IOExceptionSyntaxException
-
eofError
- Overrides:
eofErrorin classLexer- Throws:
SyntaxException
-
fatal
- Throws:
SyntaxException
-
maybeSetLine
-
maybeSetLine
public void maybeSetLine(Expression exp, int startLine, int startColumn, int endLine, int endColumn) -
maybeSetLine
-