org.makumba.providers.query.mql
Class HqlBaseParser
java.lang.Object
antlr.Parser
antlr.LLkParser
org.makumba.providers.query.mql.HqlBaseParser
- All Implemented Interfaces:
- HqlTokenTypes
- Direct Known Subclasses:
- HqlParser
public class HqlBaseParser
- extends antlr.LLkParser
- implements HqlTokenTypes
Hibernate Query Language Grammar
This grammar parses the query language for Hibernate (an Open Source, Object-Relational
mapping library). A partial BNF grammar description is available for reference here:
http://www.hibernate.org/Documentation/HQLBNF
Text from the original reference BNF is prefixed with '//##'.
- Author:
- Joshua Davis (pgmjsd@sourceforge.net)
Fields inherited from class antlr.Parser |
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth |
Fields inherited from interface org.makumba.providers.query.mql.HqlTokenTypes |
AGGREGATE, ALIAS, ALL, AND, ANY, AS, ASCENDING, AVG, BETWEEN, BOTH, CASE, CASE2, CLASS, CLOSE, CLOSE_BRACKET, COLON, COMMA, CONCAT, CONSTANT, CONSTRUCTOR, COUNT, DELETE, DESCENDING, DISTINCT, DIV, DOT, ELEMENTS, ELSE, EMPTY, END, EOF, EQ, ESCAPE, ESCqs, EXISTS, EXPONENT, EXPR_LIST, FALSE, FETCH, FILTER_ENTITY, FLOAT_SUFFIX, FROM, FULL, GE, GROUP, GT, HAVING, HEX_DIGIT, ID_LETTER, ID_START_LETTER, IDENT, IN, IN_LIST, INDEX_OP, INDICES, INNER, INSERT, INTO, IS, IS_NOT_NULL, IS_NULL, JAVA_CONSTANT, JOIN, LE, LEADING, LEFT, LIKE, LITERAL_ascending, LITERAL_by, LITERAL_descending, LT, MAX, MEMBER, METHOD_CALL, MIN, MINUS, NE, NEW, NOT, NOT_BETWEEN, NOT_IN, NOT_LIKE, NULL, NULL_TREE_LOOKAHEAD, NUM_DOUBLE, NUM_FLOAT, NUM_INT, NUM_LONG, OBJECT, OF, ON, OPEN, OPEN_BRACKET, OR, ORDER, ORDER_ELEMENT, OUTER, PARAM, PLUS, PROPERTIES, QUERY, QUOTED_STRING, RANGE, RIGHT, ROW_STAR, SELECT, SELECT_FROM, SET, SOME, SQL_NE, STAR, SUM, THEN, TRAILING, TRUE, UNARY_MINUS, UNARY_PLUS, UNION, UPDATE, VECTOR_EXPR, VERSIONED, WEIRD_IDENT, WHEN, WHERE, WITH, WS |
Methods inherited from class antlr.LLkParser |
consume, LA, LT, traceIn, traceOut |
Methods inherited from class antlr.Parser |
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, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_tokenNames
public static final String[] _tokenNames
_tokenSet_0
public static final antlr.collections.impl.BitSet _tokenSet_0
_tokenSet_1
public static final antlr.collections.impl.BitSet _tokenSet_1
_tokenSet_2
public static final antlr.collections.impl.BitSet _tokenSet_2
_tokenSet_3
public static final antlr.collections.impl.BitSet _tokenSet_3
_tokenSet_4
public static final antlr.collections.impl.BitSet _tokenSet_4
_tokenSet_5
public static final antlr.collections.impl.BitSet _tokenSet_5
_tokenSet_6
public static final antlr.collections.impl.BitSet _tokenSet_6
_tokenSet_7
public static final antlr.collections.impl.BitSet _tokenSet_7
_tokenSet_8
public static final antlr.collections.impl.BitSet _tokenSet_8
_tokenSet_9
public static final antlr.collections.impl.BitSet _tokenSet_9
_tokenSet_10
public static final antlr.collections.impl.BitSet _tokenSet_10
_tokenSet_11
public static final antlr.collections.impl.BitSet _tokenSet_11
_tokenSet_12
public static final antlr.collections.impl.BitSet _tokenSet_12
_tokenSet_13
public static final antlr.collections.impl.BitSet _tokenSet_13
_tokenSet_14
public static final antlr.collections.impl.BitSet _tokenSet_14
_tokenSet_15
public static final antlr.collections.impl.BitSet _tokenSet_15
_tokenSet_16
public static final antlr.collections.impl.BitSet _tokenSet_16
_tokenSet_17
public static final antlr.collections.impl.BitSet _tokenSet_17
_tokenSet_18
public static final antlr.collections.impl.BitSet _tokenSet_18
_tokenSet_19
public static final antlr.collections.impl.BitSet _tokenSet_19
_tokenSet_20
public static final antlr.collections.impl.BitSet _tokenSet_20
_tokenSet_21
public static final antlr.collections.impl.BitSet _tokenSet_21
_tokenSet_22
public static final antlr.collections.impl.BitSet _tokenSet_22
_tokenSet_23
public static final antlr.collections.impl.BitSet _tokenSet_23
_tokenSet_24
public static final antlr.collections.impl.BitSet _tokenSet_24
_tokenSet_25
public static final antlr.collections.impl.BitSet _tokenSet_25
_tokenSet_26
public static final antlr.collections.impl.BitSet _tokenSet_26
_tokenSet_27
public static final antlr.collections.impl.BitSet _tokenSet_27
_tokenSet_28
public static final antlr.collections.impl.BitSet _tokenSet_28
_tokenSet_29
public static final antlr.collections.impl.BitSet _tokenSet_29
_tokenSet_30
public static final antlr.collections.impl.BitSet _tokenSet_30
_tokenSet_31
public static final antlr.collections.impl.BitSet _tokenSet_31
_tokenSet_32
public static final antlr.collections.impl.BitSet _tokenSet_32
_tokenSet_33
public static final antlr.collections.impl.BitSet _tokenSet_33
_tokenSet_34
public static final antlr.collections.impl.BitSet _tokenSet_34
_tokenSet_35
public static final antlr.collections.impl.BitSet _tokenSet_35
HqlBaseParser
protected HqlBaseParser(antlr.TokenBuffer tokenBuf,
int k)
HqlBaseParser
public HqlBaseParser(antlr.TokenBuffer tokenBuf)
HqlBaseParser
protected HqlBaseParser(antlr.TokenStream lexer,
int k)
HqlBaseParser
public HqlBaseParser(antlr.TokenStream lexer)
HqlBaseParser
public HqlBaseParser(antlr.ParserSharedInputState state)
setFilter
public void setFilter(boolean f)
- Sets the filter flag.
- Parameters:
f
- True for a filter query, false for a normal query.
isFilter
public boolean isFilter()
- Returns true if this is a filter query, false if not.
- Returns:
- true if this is a filter query, false if not.
handleIdentifierError
public antlr.collections.AST handleIdentifierError(antlr.Token token,
antlr.RecognitionException ex)
throws antlr.RecognitionException,
antlr.TokenStreamException
- This method is overriden in the sub class in order to provide the
'keyword as identifier' hack.
- Parameters:
token
- The token to retry as an identifier.ex
- The exception to throw if it cannot be retried as an identifier.
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
handleDotIdent
public void handleDotIdent()
throws antlr.TokenStreamException
- This method looks ahead and converts . into . IDENT when
appropriate.
- Throws:
antlr.TokenStreamException
negateNode
public antlr.collections.AST negateNode(antlr.collections.AST x)
- Returns the negated equivalent of the expression.
- Parameters:
x
- The expression to negate.
processEqualityExpression
public antlr.collections.AST processEqualityExpression(antlr.collections.AST x)
throws antlr.RecognitionException
- Returns the 'cleaned up' version of a comparison operator sub-tree.
- Parameters:
x
- The comparison operator to clean up.
- Throws:
antlr.RecognitionException
weakKeywords
public void weakKeywords()
throws antlr.TokenStreamException
- Throws:
antlr.TokenStreamException
processMemberOf
public void processMemberOf(antlr.Token n,
antlr.collections.AST p,
antlr.ASTPair currentAST)
statement
public final void statement()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
updateStatement
public final void updateStatement()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
deleteStatement
public final void deleteStatement()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
selectStatement
public final void selectStatement()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
insertStatement
public final void insertStatement()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
optionalFromTokenFromClause
public final void optionalFromTokenFromClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
setClause
public final void setClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
whereClause
public final void whereClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
assignment
public final void assignment()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
stateField
public final void stateField()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
newValue
public final void newValue()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
path
public final void path()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
concatenation
public final void concatenation()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
asAlias
public final void asAlias()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
queryRule
public final void queryRule()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
intoClause
public final void intoClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
insertablePropertySpec
public final void insertablePropertySpec()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
primaryExpression
public final void primaryExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
union
public final void union()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
selectFrom
public final void selectFrom()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
groupByClause
public final void groupByClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
orderByClause
public final void orderByClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
selectClause
public final void selectClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
fromClause
public final void fromClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
selectedPropertiesList
public final void selectedPropertiesList()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
newExpression
public final void newExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
selectObject
public final void selectObject()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
identifier
public final void identifier()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
fromRange
public final void fromRange()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
fromJoin
public final void fromJoin()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
propertyFetch
public final void propertyFetch()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
withClause
public final void withClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
logicalExpression
public final void logicalExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
fromClassOrOuterQueryPath
public final void fromClassOrOuterQueryPath()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
inClassDeclaration
public final void inClassDeclaration()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
inCollectionDeclaration
public final void inCollectionDeclaration()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
inCollectionElementsDeclaration
public final void inCollectionElementsDeclaration()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
alias
public final void alias()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
expression
public final void expression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
havingClause
public final void havingClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
orderElement
public final void orderElement()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
ascendingOrDescending
public final void ascendingOrDescending()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
aliasedExpression
public final void aliasedExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
logicalOrExpression
public final void logicalOrExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
logicalAndExpression
public final void logicalAndExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
negatedExpression
public final void negatedExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
equalityExpression
public final void equalityExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
relationalExpression
public final void relationalExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
additiveExpression
public final void additiveExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
inList
public final void inList()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
betweenList
public final void betweenList()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
likeEscape
public final void likeEscape()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
compoundExpr
public final void compoundExpr()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
multiplyExpression
public final void multiplyExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
unaryExpression
public final void unaryExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
caseExpression
public final void caseExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
quantifiedExpression
public final void quantifiedExpression()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
atom
public final void atom()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
whenClause
public final void whenClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
elseClause
public final void elseClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
altWhenClause
public final void altWhenClause()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
collectionExpr
public final void collectionExpr()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
subQuery
public final void subQuery()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
exprList
public final void exprList()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
identPrimary
public final void identPrimary()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
constant
public final void constant()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
expressionOrVector
public final void expressionOrVector()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
vectorExpr
public final void vectorExpr()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
aggregate
public final void aggregate()
throws antlr.RecognitionException,
antlr.TokenStreamException
- Throws:
antlr.RecognitionException
antlr.TokenStreamException
buildTokenTypeASTClassMap
protected void buildTokenTypeASTClassMap()