public class Parser
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Parser.QueryPart |
| Constructor and Description |
|---|
Parser(java.lang.String oql,
QueryNameSpace nameSpace)
Creates a parser which will generate a parse tree from a series of tokens.
|
| Modifier and Type | Method and Description |
|---|---|
Token |
consume()
Consumes the next token
It also keep currentToken and nextToken updated.
|
Token |
consume(TokenType tokenType)
Consumes the next token if it has the given type, otherwise an OQLSyntaxException is thrown.
|
Token |
getCurrentToken() |
QueryNameSpace |
getNameSpace()
the query namespace, which holds information about roots and joins.
|
Token |
getNextToken() |
ParseTreeNode |
getParseTree() |
java.lang.String |
getQueryString() |
java.lang.String |
getRootAlias() |
boolean |
hasParameters()
Convenience Method to decide whether this Query or any of its Subquerie declare any parameters.
|
QueryExpressionNode |
parse()
Generates the parse tree for the tokens provided by the Lexer passed in the constructor.
|
QueryExpressionNode |
parse(Token prefix) |
public Parser(java.lang.String oql,
QueryNameSpace nameSpace)
throws OQLSyntaxException
oql - he string representation of the OQL QueryOQLSyntaxException - thrown if the query doesn't have at least two lexical tokenspublic java.lang.String getQueryString()
public boolean hasParameters()
public ParseTreeNode getParseTree()
public java.lang.String getRootAlias()
public QueryExpressionNode parse() throws OQLSyntaxException
OQLSyntaxException - thrown by match.public QueryExpressionNode parse(Token prefix) throws OQLSyntaxException
OQLSyntaxExceptionpublic QueryNameSpace getNameSpace()
public Token getCurrentToken()
public Token getNextToken()
public Token consume(TokenType tokenType) throws OQLSyntaxException
tokenType - The token type to compare the current token to.OQLSyntaxExceptionpublic Token consume() throws OQLSyntaxException
OQLSyntaxExceptionCopyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.