org.hibernate.hql.antlr
Class HqlSqlBaseWalker
java.lang.Object
antlr.TreeParser
org.hibernate.hql.antlr.HqlSqlBaseWalker
- All Implemented Interfaces:
- HqlSqlTokenTypes
- Direct Known Subclasses:
- HqlSqlWalker
public class HqlSqlBaseWalker
- extends antlr.TreeParser
- implements HqlSqlTokenTypes
Hibernate Query Language to SQL Tree Transform.
This is a tree grammar that transforms an HQL AST into a intermediate SQL AST
with bindings to Hibernate interfaces (Queryable, etc.). The Hibernate specific methods
are all implemented in the HqlSqlWalker subclass, allowing the ANTLR-generated class
to have only the minimum dependencies on the Hibernate code base. This will also allow
the sub-class to be easily edited using an IDE (most IDE's don't support ANTLR).
NOTE: The java class is generated from hql-sql.g by ANTLR.
DO NOT EDIT THE GENERATED JAVA SOURCE CODE.
- Author:
- Joshua Davis (joshua@hibernate.org)
Fields inherited from class antlr.TreeParser |
_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNames, traceDepth |
Fields inherited from interface org.hibernate.hql.antlr.HqlSqlTokenTypes |
AGGREGATE, ALIAS, ALIAS_REF, ALL, AND, ANY, AS, ASCENDING, AVG, BETWEEN, BOGUS, 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, FILTERS, FLOAT_SUFFIX, FROM, FROM_FRAGMENT, FULL, GE, GROUP, GT, HAVING, HEX_DIGIT, ID_LETTER, ID_START_LETTER, IDENT, IMPLIED_FROM, IN, IN_LIST, INDEX_OP, INDICES, INNER, INSERT, INTO, IS, IS_NOT_NULL, IS_NULL, JAVA_CONSTANT, JOIN, JOIN_FRAGMENT, LE, LEADING, LEFT, LEFT_OUTER, LIKE, LITERAL_ascending, LITERAL_by, LITERAL_descending, LT, MAX, MEMBER, METHOD_CALL, METHOD_NAME, MIN, MINUS, NAMED_PARAM, 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, PROPERTY_REF, QUERY, QUOTED_STRING, RANGE, RIGHT, RIGHT_OUTER, ROW_STAR, SELECT, SELECT_CLAUSE, SELECT_COLUMNS, SELECT_EXPR, SELECT_FROM, SET, SOME, SQL_NE, SQL_TOKEN, STAR, SUM, THEN, THETA_JOINS, TRAILING, TRUE, UNARY_MINUS, UNARY_PLUS, UNION, UPDATE, VECTOR_EXPR, VERSIONED, WEIRD_IDENT, WHEN, WHERE, WITH, WS |
Method Summary |
void |
addrExpr(antlr.collections.AST _t,
boolean root)
|
void |
addrExprLhs(antlr.collections.AST _t)
|
void |
aggregateExpr(antlr.collections.AST _t)
|
void |
aliasedSelectExpr(antlr.collections.AST _t)
|
void |
aliasRef(antlr.collections.AST _t)
|
void |
arithmeticExpr(antlr.collections.AST _t)
|
void |
assignment(antlr.collections.AST _t)
|
protected void |
beforeSelectClause()
|
void |
caseExpr(antlr.collections.AST _t)
|
void |
collectionFunction(antlr.collections.AST _t)
|
void |
collectionFunctionOrSubselect(antlr.collections.AST _t)
|
void |
comparisonExpr(antlr.collections.AST _t)
|
void |
constant(antlr.collections.AST _t)
|
void |
constructor(antlr.collections.AST _t)
|
void |
count(antlr.collections.AST _t)
|
protected antlr.collections.AST |
createFromElement(String path,
antlr.collections.AST alias,
antlr.collections.AST propertyFetch)
|
protected antlr.collections.AST |
createFromFilterElement(antlr.collections.AST filterEntity,
antlr.collections.AST alias)
|
protected void |
createFromJoinElement(antlr.collections.AST path,
antlr.collections.AST alias,
int joinType,
antlr.collections.AST fetch,
antlr.collections.AST propertyFetch,
antlr.collections.AST with)
|
protected antlr.collections.AST |
createIntoClause(String path,
antlr.collections.AST propertySpec)
|
void |
deleteStatement(antlr.collections.AST _t)
|
protected void |
evaluateAssignment(antlr.collections.AST eq)
|
void |
expr(antlr.collections.AST _t)
|
void |
exprOrSubquery(antlr.collections.AST _t)
|
void |
fromClause(antlr.collections.AST _t)
|
void |
fromElement(antlr.collections.AST _t)
|
void |
fromElementList(antlr.collections.AST _t)
|
void |
functionCall(antlr.collections.AST _t)
|
protected antlr.collections.AST |
generateNamedParameter(antlr.collections.AST delimiterNode,
antlr.collections.AST nameNode)
|
protected antlr.collections.AST |
generatePositionalParameter(antlr.collections.AST inputNode)
|
int |
getCurrentClauseType()
|
int |
getCurrentStatementType()
|
int |
getCurrentTopLevelClauseType()
|
int |
getStatementType()
|
void |
groupClause(antlr.collections.AST _t)
|
void |
identifier(antlr.collections.AST _t)
|
void |
inRhs(antlr.collections.AST _t)
|
void |
insertablePropertySpec(antlr.collections.AST _t)
|
void |
insertStatement(antlr.collections.AST _t)
|
void |
intoClause(antlr.collections.AST _t)
|
boolean |
isComparativeExpressionClause()
|
boolean |
isInCase()
|
boolean |
isInFrom()
|
boolean |
isInFunctionCall()
|
boolean |
isInSelect()
|
protected boolean |
isNonQualifiedPropertyRef(antlr.collections.AST ident)
|
boolean |
isSelectStatement()
|
boolean |
isSubQuery()
|
void |
joinElement(antlr.collections.AST _t)
|
int |
joinType(antlr.collections.AST _t)
|
void |
literal(antlr.collections.AST _t)
|
void |
logicalExpr(antlr.collections.AST _t)
|
protected void |
lookupAlias(antlr.collections.AST ident)
|
protected antlr.collections.AST |
lookupNonQualifiedProperty(antlr.collections.AST property)
|
protected antlr.collections.AST |
lookupProperty(antlr.collections.AST dot,
boolean root,
boolean inSelect)
|
void |
newValue(antlr.collections.AST _t)
|
void |
numericInteger(antlr.collections.AST _t)
|
void |
orderClause(antlr.collections.AST _t)
|
void |
orderExprs(antlr.collections.AST _t)
|
void |
parameter(antlr.collections.AST _t)
|
String |
path(antlr.collections.AST _t)
|
void |
pathAsIdent(antlr.collections.AST _t)
|
protected void |
postProcessDelete(antlr.collections.AST delete)
|
protected void |
postProcessInsert(antlr.collections.AST insert)
|
protected void |
postProcessUpdate(antlr.collections.AST update)
|
protected void |
prepareArithmeticOperator(antlr.collections.AST operator)
|
protected void |
prepareFromClauseInputTree(antlr.collections.AST fromClauseInput)
Pre-process the from clause input tree. |
protected void |
prepareLogicOperator(antlr.collections.AST operator)
|
protected void |
prepareVersioned(antlr.collections.AST updateNode,
antlr.collections.AST versionedNode)
|
protected void |
processBoolean(antlr.collections.AST constant)
|
protected void |
processConstant(antlr.collections.AST constant)
|
protected void |
processConstructor(antlr.collections.AST constructor)
|
protected void |
processFunction(antlr.collections.AST functionCall,
boolean inSelect)
|
protected void |
processIndex(antlr.collections.AST indexOp)
|
protected void |
processNumericLiteral(antlr.collections.AST literal)
|
protected void |
processQuery(antlr.collections.AST select,
antlr.collections.AST query)
|
void |
propertyName(antlr.collections.AST _t)
|
void |
propertyRef(antlr.collections.AST _t)
|
void |
propertyRefLhs(antlr.collections.AST _t)
|
protected void |
pushFromClause(antlr.collections.AST fromClause,
antlr.collections.AST inputFromNode)
Sets the current 'FROM' context. |
void |
query(antlr.collections.AST _t)
|
protected void |
resolve(antlr.collections.AST node)
|
protected void |
resolveSelectExpression(antlr.collections.AST dotNode)
|
void |
selectClause(antlr.collections.AST _t)
|
void |
selectExpr(antlr.collections.AST _t)
|
void |
selectExprList(antlr.collections.AST _t)
|
void |
selectStatement(antlr.collections.AST _t)
|
protected void |
setAlias(antlr.collections.AST selectExpr,
antlr.collections.AST ident)
|
void |
setClause(antlr.collections.AST _t)
|
protected void |
setImpliedJoinType(int joinType)
|
void |
statement(antlr.collections.AST _t)
|
void |
updateStatement(antlr.collections.AST _t)
|
void |
whereClause(antlr.collections.AST _t)
|
void |
withClause(antlr.collections.AST _t)
|
Methods inherited from class antlr.TreeParser |
getAST, getASTFactory, getTokenName, getTokenNames, match, match, matchNot, panic, reportError, reportError, reportWarning, setASTFactory, setASTNodeClass, setASTNodeType, traceIn, traceIndent, traceOut |
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
HqlSqlBaseWalker
public HqlSqlBaseWalker()
isSubQuery
public final boolean isSubQuery()
isInFrom
public final boolean isInFrom()
isInFunctionCall
public final boolean isInFunctionCall()
isInSelect
public final boolean isInSelect()
isInCase
public final boolean isInCase()
getStatementType
public final int getStatementType()
getCurrentClauseType
public final int getCurrentClauseType()
getCurrentTopLevelClauseType
public final int getCurrentTopLevelClauseType()
getCurrentStatementType
public final int getCurrentStatementType()
isComparativeExpressionClause
public final boolean isComparativeExpressionClause()
isSelectStatement
public final boolean isSelectStatement()
evaluateAssignment
protected void evaluateAssignment(antlr.collections.AST eq)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
prepareFromClauseInputTree
protected void prepareFromClauseInputTree(antlr.collections.AST fromClauseInput)
- Pre-process the from clause input tree.
pushFromClause
protected void pushFromClause(antlr.collections.AST fromClause,
antlr.collections.AST inputFromNode)
- Sets the current 'FROM' context.
createFromElement
protected antlr.collections.AST createFromElement(String path,
antlr.collections.AST alias,
antlr.collections.AST propertyFetch)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
createFromJoinElement
protected void createFromJoinElement(antlr.collections.AST path,
antlr.collections.AST alias,
int joinType,
antlr.collections.AST fetch,
antlr.collections.AST propertyFetch,
antlr.collections.AST with)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
createFromFilterElement
protected antlr.collections.AST createFromFilterElement(antlr.collections.AST filterEntity,
antlr.collections.AST alias)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
processQuery
protected void processQuery(antlr.collections.AST select,
antlr.collections.AST query)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
postProcessUpdate
protected void postProcessUpdate(antlr.collections.AST update)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
postProcessDelete
protected void postProcessDelete(antlr.collections.AST delete)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
postProcessInsert
protected void postProcessInsert(antlr.collections.AST insert)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
beforeSelectClause
protected void beforeSelectClause()
throws antlr.SemanticException
- Throws:
antlr.SemanticException
processIndex
protected void processIndex(antlr.collections.AST indexOp)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
processConstant
protected void processConstant(antlr.collections.AST constant)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
processBoolean
protected void processBoolean(antlr.collections.AST constant)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
processNumericLiteral
protected void processNumericLiteral(antlr.collections.AST literal)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
resolve
protected void resolve(antlr.collections.AST node)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
resolveSelectExpression
protected void resolveSelectExpression(antlr.collections.AST dotNode)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
processFunction
protected void processFunction(antlr.collections.AST functionCall,
boolean inSelect)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
processConstructor
protected void processConstructor(antlr.collections.AST constructor)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
generateNamedParameter
protected antlr.collections.AST generateNamedParameter(antlr.collections.AST delimiterNode,
antlr.collections.AST nameNode)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
generatePositionalParameter
protected antlr.collections.AST generatePositionalParameter(antlr.collections.AST inputNode)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
lookupAlias
protected void lookupAlias(antlr.collections.AST ident)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
setAlias
protected void setAlias(antlr.collections.AST selectExpr,
antlr.collections.AST ident)
lookupProperty
protected antlr.collections.AST lookupProperty(antlr.collections.AST dot,
boolean root,
boolean inSelect)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
isNonQualifiedPropertyRef
protected boolean isNonQualifiedPropertyRef(antlr.collections.AST ident)
lookupNonQualifiedProperty
protected antlr.collections.AST lookupNonQualifiedProperty(antlr.collections.AST property)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
setImpliedJoinType
protected void setImpliedJoinType(int joinType)
createIntoClause
protected antlr.collections.AST createIntoClause(String path,
antlr.collections.AST propertySpec)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
prepareVersioned
protected void prepareVersioned(antlr.collections.AST updateNode,
antlr.collections.AST versionedNode)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
prepareLogicOperator
protected void prepareLogicOperator(antlr.collections.AST operator)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
prepareArithmeticOperator
protected void prepareArithmeticOperator(antlr.collections.AST operator)
throws antlr.SemanticException
- Throws:
antlr.SemanticException
statement
public final void statement(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
selectStatement
public final void selectStatement(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
updateStatement
public final void updateStatement(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
deleteStatement
public final void deleteStatement(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
insertStatement
public final void insertStatement(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
query
public final void query(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
fromClause
public final void fromClause(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
setClause
public final void setClause(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
whereClause
public final void whereClause(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
intoClause
public final void intoClause(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
path
public final String path(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
insertablePropertySpec
public final void insertablePropertySpec(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
assignment
public final void assignment(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
propertyRef
public final void propertyRef(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
newValue
public final void newValue(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
expr
public final void expr(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
selectClause
public final void selectClause(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
groupClause
public final void groupClause(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
orderClause
public final void orderClause(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
orderExprs
public final void orderExprs(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
logicalExpr
public final void logicalExpr(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
selectExprList
public final void selectExprList(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
selectExpr
public final void selectExpr(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
aliasedSelectExpr
public final void aliasedSelectExpr(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
identifier
public final void identifier(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
aliasRef
public final void aliasRef(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
constructor
public final void constructor(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
functionCall
public final void functionCall(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
count
public final void count(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
collectionFunction
public final void collectionFunction(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
literal
public final void literal(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
arithmeticExpr
public final void arithmeticExpr(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
aggregateExpr
public final void aggregateExpr(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
fromElementList
public final void fromElementList(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
fromElement
public final void fromElement(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
joinElement
public final void joinElement(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
joinType
public final int joinType(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
pathAsIdent
public final void pathAsIdent(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
withClause
public final void withClause(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
comparisonExpr
public final void comparisonExpr(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
exprOrSubquery
public final void exprOrSubquery(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
inRhs
public final void inRhs(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
collectionFunctionOrSubselect
public final void collectionFunctionOrSubselect(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
addrExpr
public final void addrExpr(antlr.collections.AST _t,
boolean root)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
constant
public final void constant(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
parameter
public final void parameter(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
caseExpr
public final void caseExpr(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
addrExprLhs
public final void addrExprLhs(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
propertyName
public final void propertyName(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
propertyRefLhs
public final void propertyRefLhs(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
numericInteger
public final void numericInteger(antlr.collections.AST _t)
throws antlr.RecognitionException
- Throws:
antlr.RecognitionException