public abstract class EJBQLParser
extends antlr.LLkParser
Modifier and Type | Field and Description |
---|---|
protected NodeFactory |
factory
The factory to create parse tree nodes.
|
Modifier | Constructor and Description |
---|---|
protected |
EJBQLParser(antlr.ParserSharedInputState state,
int k_) |
protected |
EJBQLParser(antlr.TokenBuffer tokenBuf,
int k_) |
protected |
EJBQLParser(antlr.TokenStream lexer,
int k) |
Modifier and Type | Method and Description |
---|---|
void |
addError(Exception e)
INTERNAL
Add the exception to the list of errors.
|
static String |
ANTLRVersion()
INTERNAL
Returns the ANTLR version currently used.
|
static EJBQLParser |
buildParserFor(String queryText)
INTERNAL
Creates a parser for the specified query string.
|
static EJBQLParser |
buildParserFor(String queryName,
String queryText)
INTERNAL
Creates a parser for the specified query string.
|
static EJBQLParseTree |
buildParseTree(String queryText)
INTERNAL
Builds a parser, parses the specified query string and returns the
parse tree.
|
static EJBQLParseTree |
buildParseTree(String queryName,
String queryText)
INTERNAL
Builds a parser, parses the specified query string and returns the
parse tree.
|
abstract void |
document()
This is the parser start method.
|
protected EJBQLException |
generateException()
INTERNAL
Generate an exception which encapsulates all the exceptions generated
by this parser.
|
List |
getErrors()
INTERNAL
Returns the list of errors found during the parsing process.
|
NodeFactory |
getNodeFactory()
INTERNAL
Returns the factory used by the parser to create a parse tree and parse
tree nodes.
|
EJBQLParseTree |
getParseTree()
INTERNAL
Returns the parse tree created by a successful run of the parse
method.
|
String |
getQueryInfo()
INTERNAL
Return the the query text prefixed by the query name in case of a
named query.
|
String |
getQueryName()
INTERNAL
Return the name of the current query being compiled.
|
String |
getQueryText()
INTERNAL
Return the text of the current query being compiled.
|
abstract Object |
getRootNode()
Returns the root node after representing the parse tree for the current
query string.
|
protected EJBQLException |
handleANTLRException(antlr.ANTLRException ex)
INTERNAL
Map an exception thrown by the ANTLR generated code to an
EJBQLException.
|
boolean |
hasErrors()
INTERNAL
Returns true if there were errors during the parsing process.
|
EJBQLParseTree |
parse()
INTERNAL
Parse the query string that was specified on parser creation.
|
void |
reportError(antlr.RecognitionException ex)
Method called by the ANTLR generated code in case of an error.
|
void |
setNodeFactory(NodeFactory factory)
INTERNAL
Set the factory used by the parser to create a parse tree and parse
tree nodes.
|
void |
setQueryName(String queryName)
INTERNAL
Set the name of the current query being compiled.
|
void |
setQueryText(String queryText)
INTERNAL
Set the text of the current query being compiled.
|
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, panic, recover, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
protected NodeFactory factory
protected EJBQLParser(antlr.TokenBuffer tokenBuf, int k_)
protected EJBQLParser(antlr.ParserSharedInputState state, int k_)
protected EJBQLParser(antlr.TokenStream lexer, int k)
public static String ANTLRVersion() throws Exception
Exception
public static EJBQLParseTree buildParseTree(String queryText) throws EJBQLException
EJBQLException
public static EJBQLParseTree buildParseTree(String queryName, String queryText) throws EJBQLException
EJBQLException
public static EJBQLParser buildParserFor(String queryText) throws EJBQLException
EJBQLException
public static EJBQLParser buildParserFor(String queryName, String queryText) throws EJBQLException
EJBQLException
public EJBQLParseTree parse() throws EJBQLException
EJBQLException
public EJBQLParseTree getParseTree()
public String getQueryText()
public void setQueryText(String queryText)
public String getQueryName()
null
if the current query is a dynamic query and not a named
query.public void setQueryName(String queryName)
public String getQueryInfo()
public void setNodeFactory(NodeFactory factory)
public NodeFactory getNodeFactory()
public List getErrors()
public boolean hasErrors()
public void addError(Exception e)
protected EJBQLException generateException()
protected EJBQLException handleANTLRException(antlr.ANTLRException ex)
public void reportError(antlr.RecognitionException ex)
reportError
in class antlr.Parser
public abstract void document() throws antlr.RecognitionException, antlr.TokenStreamException
antlr.RecognitionException
antlr.TokenStreamException
public abstract Object getRootNode()
Copyright © 2022. All rights reserved.