A class to read xquery forms.
appendNamedEntity
public void appendNamedEntity(String name)
booleanValue
public static Expression booleanValue(Expression exp)
Coerce the value of an expresison to a boolean value.
error
public void error(char severity,
String message)
- error in interface Lexer
getDelimited
public void getDelimited(String delimiter)
throws java.io.IOException,
SyntaxException
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.
isNamePart
public static boolean isNamePart(char ch)
isNameStart
public static boolean isNameStart(char ch)
makeFunctionExp
public static Expression makeFunctionExp(String className,
String name)
makeFunctionExp
public static Expression makeFunctionExp(String className,
String fieldName,
String name)
mark
public void mark()
throws java.io.IOException
- mark in interface Lexer
match
public boolean match(String word)
parseFLWRInner
public Expression parseFLWRInner(boolean isFor)
throws java.io.IOException,
SyntaxException
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 top
parsing, and return a result as if we instead saw a
'return make-tuple($x, ...)'. The 'order by' clause will get
parser by the outer-mot 'for' or 'let'.
parseFunctionDefinition
public Expression parseFunctionDefinition(int declLine,
int declColumn)
throws java.io.IOException,
SyntaxException
parseOptionalTypeDeclaration
public Expression parseOptionalTypeDeclaration()
throws java.io.IOException,
SyntaxException
Parse: ["as" SequenceType]
parseQuantifiedExpr
public Expression parseQuantifiedExpr(boolean isEvery)
throws java.io.IOException,
SyntaxException
Parse a some- or an every-expression.
Assume the 'some'/'every'-token has been seen, and we've read '$'.
parseVariable
public Object parseVariable()
throws java.io.IOException,
SyntaxException
Parse a Variable.
readObject
public Object readObject()
throws java.io.IOException,
SyntaxException
reset
public void reset()
throws java.io.IOException
- reset in interface Lexer
stringValue
public static Expression stringValue(Expression exp)
Coerce the value of an expresison to a string value.
syntaxError
public Expression syntaxError(String message)
throws java.io.IOException,
SyntaxException
Handle syntax errors (at rewrite time).
message
- an error message to print out