Package org.hibernate.hql.antlr
Class HqlBaseParser
java.lang.Object
antlr.Parser
antlr.LLkParser
org.hibernate.hql.antlr.HqlBaseParser
- All Implemented Interfaces:
HqlTokenTypes
- Direct Known Subclasses:
HqlParser
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 '//##'.
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 '//##'.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]static final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetstatic final antlr.collections.impl.BitSetFields inherited from class antlr.Parser
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepthFields inherited from interface org.hibernate.hql.antlr.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, ENTRY, 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, KEY, LE, LEADING, LEFT, LIKE, LITERAL_ascending, LITERAL_by, LITERAL_descending, LT, MAX, MEMBER, METHOD_CALL, MIN, MINUS, MOD, NE, NEW, NOT, NOT_BETWEEN, NOT_IN, NOT_LIKE, NULL, NULL_TREE_LOOKAHEAD, NUM_BIG_DECIMAL, NUM_BIG_INTEGER, 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, VALUE, VECTOR_EXPR, VERSIONED, WEIRD_IDENT, WHEN, WHERE, WITH, WS -
Constructor Summary
ConstructorsModifierConstructorDescriptionHqlBaseParser(antlr.TokenBuffer tokenBuf) protectedHqlBaseParser(antlr.TokenBuffer tokenBuf, int k) HqlBaseParser(antlr.TokenStream lexer) protectedHqlBaseParser(antlr.TokenStream lexer, int k) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal voidfinal voidalias()final voidfinal voidfinal voidasAlias()final voidfinal voidfinal voidatom()final voidprotected voidfinal voidfinal voidfinal voidfinal voidfinal voidconstant()final voidfinal voidfinal voidfinal voidfinal voidfinal voidexprList()final voidfinal voidfinal voidfromJoin()final voidfinal voidvoidThis method looks ahead and converts .This method is overriden in the sub class in order to provide the 'keyword as identifier' hack.final voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidinList()final voidfinal voidfinal voidbooleanisFilter()Returns true if this is a filter query, false if not.final voidfinal voidfinal voidfinal voidfinal voidfinal voidReturns the negated equivalent of the expression.final voidfinal voidnewValue()final voidfinal voidfinal voidfinal voidfinal voidpath()final voidReturns the 'cleaned up' version of a comparison operator sub-tree.voidprocessMemberOf(antlr.Token n, antlr.collections.AST p, antlr.ASTPair currentAST) final voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidvoidsetFilter(boolean f) Sets the filter flag.final voidfinal voidfinal voidsubQuery()final voidfinal voidunion()final voidfinal voidvoidfinal voidfinal voidfinal voidMethods inherited from class antlr.LLkParser
consume, LA, LT, traceIn, traceOutMethods 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
-
Field Details
-
_tokenNames
-
_tokenSet_0
-
_tokenSet_1
-
_tokenSet_2
-
_tokenSet_3
-
_tokenSet_4
-
_tokenSet_5
-
_tokenSet_6
-
_tokenSet_7
-
_tokenSet_8
-
_tokenSet_9
-
_tokenSet_10
-
_tokenSet_11
-
_tokenSet_12
-
_tokenSet_13
-
_tokenSet_14
-
_tokenSet_15
-
_tokenSet_16
-
_tokenSet_17
-
_tokenSet_18
-
_tokenSet_19
-
_tokenSet_20
-
_tokenSet_21
-
_tokenSet_22
-
_tokenSet_23
-
_tokenSet_24
-
_tokenSet_25
-
_tokenSet_26
-
_tokenSet_27
-
_tokenSet_28
-
_tokenSet_29
-
_tokenSet_30
-
_tokenSet_31
-
_tokenSet_32
-
_tokenSet_33
-
_tokenSet_34
-
_tokenSet_35
-
-
Constructor Details
-
HqlBaseParser
-
HqlBaseParser
-
HqlBaseParser
-
HqlBaseParser
-
-
Method Details
-
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.RecognitionExceptionantlr.TokenStreamException
-
handleDotIdent
This method looks ahead and converts .into . IDENT when appropriate. - Throws:
antlr.TokenStreamException
-
negateNode
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
- Throws:
antlr.TokenStreamException
-
processMemberOf
-
statement
-
updateStatement
-
deleteStatement
-
selectStatement
-
insertStatement
-
optionalFromTokenFromClause
public final void optionalFromTokenFromClause() throws antlr.RecognitionException, antlr.TokenStreamException -
setClause
-
whereClause
-
assignment
-
stateField
-
newValue
-
path
-
concatenation
-
asAlias
-
queryRule
-
intoClause
-
insertablePropertySpec
public final void insertablePropertySpec() throws antlr.RecognitionException, antlr.TokenStreamException -
-
union
-
selectFrom
-
groupByClause
-
orderByClause
-
selectClause
-
fromClause
-
selectedPropertiesList
public final void selectedPropertiesList() throws antlr.RecognitionException, antlr.TokenStreamException -
newExpression
-
selectObject
-
identifier
-
fromRange
-
fromJoin
-
propertyFetch
-
withClause
-
logicalExpression
-
fromClassOrOuterQueryPath
public final void fromClassOrOuterQueryPath() throws antlr.RecognitionException, antlr.TokenStreamException -
inClassDeclaration
public final void inClassDeclaration() throws antlr.RecognitionException, antlr.TokenStreamException -
inCollectionDeclaration
public final void inCollectionDeclaration() throws antlr.RecognitionException, antlr.TokenStreamException -
inCollectionElementsDeclaration
public final void inCollectionElementsDeclaration() throws antlr.RecognitionException, antlr.TokenStreamException -
alias
-
expression
-
havingClause
-
orderElement
-
ascendingOrDescending
public final void ascendingOrDescending() throws antlr.RecognitionException, antlr.TokenStreamException -
aliasedExpression
-
logicalOrExpression
public final void logicalOrExpression() throws antlr.RecognitionException, antlr.TokenStreamException -
logicalAndExpression
public final void logicalAndExpression() throws antlr.RecognitionException, antlr.TokenStreamException -
negatedExpression
-
equalityExpression
public final void equalityExpression() throws antlr.RecognitionException, antlr.TokenStreamException -
relationalExpression
public final void relationalExpression() throws antlr.RecognitionException, antlr.TokenStreamException -
additiveExpression
public final void additiveExpression() throws antlr.RecognitionException, antlr.TokenStreamException -
inList
-
betweenList
-
likeEscape
-
compoundExpr
-
multiplyExpression
public final void multiplyExpression() throws antlr.RecognitionException, antlr.TokenStreamException -
unaryExpression
-
caseExpression
-
quantifiedExpression
public final void quantifiedExpression() throws antlr.RecognitionException, antlr.TokenStreamException -
atom
-
whenClause
-
elseClause
-
altWhenClause
-
collectionExpr
-
subQuery
-
exprList
-
identPrimary
-
constant
-
parameter
-
expressionOrVector
public final void expressionOrVector() throws antlr.RecognitionException, antlr.TokenStreamException -
vectorExpr
-
aggregate
-
buildTokenTypeASTClassMap
protected void buildTokenTypeASTClassMap()
-