Package org.hibernate.hql.antlr
Class SqlGeneratorBase
java.lang.Object
antlr.TreeParser
org.hibernate.hql.antlr.SqlGeneratorBase
- All Implemented Interfaces:
SqlTokenTypes
- Direct Known Subclasses:
SqlGenerator
SQL Generator Tree Parser, providing SQL rendering of SQL ASTs produced by the previous phase, HqlSqlWalker. All
syntax decoration such as extra spaces, lack of spaces, extra parens, etc. should be added by this class.
This grammar processes the HQL/SQL AST and produces an SQL string. The intent is to move dialect-specific code into a sub-class that will override some of the methods, just like the other two grammars in this system.
This grammar processes the HQL/SQL AST and produces an SQL string. The intent is to move dialect-specific code into a sub-class that will override some of the methods, just like the other two grammars in this system.
-
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.BitSetFields inherited from class antlr.TreeParser
_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNames, traceDepthFields inherited from interface org.hibernate.hql.antlr.SqlTokenTypes
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, ENTRY, 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, KEY, LE, LEADING, LEFT, LEFT_OUTER, LIKE, LITERAL_ascending, LITERAL_by, LITERAL_descending, LT, MAX, MEMBER, METHOD_CALL, METHOD_NAME, MIN, MINUS, MOD, NAMED_PARAM, 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, PROPERTY_REF, QUERY, QUOTED_STRING, RANGE, RESULT_VARIABLE_REF, RIGHT, RIGHT_OUTER, ROW_STAR, SELECT, SELECT_CLAUSE, SELECT_COLUMNS, SELECT_EXPR, SELECT_FROM, SET, SOME, SQL_NE, SQL_NODE, SQL_TOKEN, STAR, SUM, THEN, THETA_JOINS, TRAILING, TRUE, UNARY_MINUS, UNARY_PLUS, UNION, UPDATE, VALUE, VECTOR_EXPR, VERSIONED, WEIRD_IDENT, WHEN, WHERE, WITH, WS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal voidfinal voidfinal voidfinal voidprotected voidfinal voidfinal voidbooleanExpr(antlr.collections.AST _t, boolean parens) final voidbooleanOp(antlr.collections.AST _t, boolean parens) final voidprotected voidcommaBetweenParameters(String comma) final voidcomparisonExpr(antlr.collections.AST _t, boolean parens) final voidfinal voidfinal voidfinal voidfinal voidfinal voidprotected voidfinal voidfinal voidfinal voidfinal voidprotected voidfinal voidprotected intReturns the last character written to the output, or -1 if there isn't one.protected StringBufferfinal voidprotected booleanfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidprotected voidprotected voidprotected voidAdd a aspace if the previous token was not a space or a parenthesis.final voidfinal voidprotected voidprotected voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidprotected voidseparator(antlr.collections.AST n, String sep) final voidfinal voidfinal voidfinal voidfinal voidfinal voidtableJoin(antlr.collections.AST _t, antlr.collections.AST parent) final voidfinal voidfinal voidfinal voidfinal voidMethods inherited from class antlr.TreeParser
getAST, getASTFactory, getTokenName, getTokenNames, match, match, matchNot, panic, reportError, reportError, reportWarning, setASTFactory, setASTNodeClass, setASTNodeType, traceIn, traceIndent, traceOut
-
Field Details
-
_tokenNames
-
_tokenSet_0
-
_tokenSet_1
-
_tokenSet_2
-
_tokenSet_3
-
_tokenSet_4
-
_tokenSet_5
-
-
Constructor Details
-
SqlGeneratorBase
public SqlGeneratorBase()
-
-
Method Details
-
out
-
getLastChar
protected int getLastChar()Returns the last character written to the output, or -1 if there isn't one. -
optionalSpace
protected void optionalSpace()Add a aspace if the previous token was not a space or a parenthesis. -
out
-
separator
-
hasText
-
fromFragmentSeparator
-
nestedFromFragment
-
getStringBuffer
-
nyi
-
beginFunctionTemplate
-
endFunctionTemplate
-
commaBetweenParameters
-
statement
- Throws:
antlr.RecognitionException
-
selectStatement
- Throws:
antlr.RecognitionException
-
updateStatement
- Throws:
antlr.RecognitionException
-
deleteStatement
- Throws:
antlr.RecognitionException
-
insertStatement
- Throws:
antlr.RecognitionException
-
selectClause
- Throws:
antlr.RecognitionException
-
from
- Throws:
antlr.RecognitionException
-
whereExpr
- Throws:
antlr.RecognitionException
-
groupExprs
- Throws:
antlr.RecognitionException
-
booleanExpr
public final void booleanExpr(antlr.collections.AST _t, boolean parens) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
orderExprs
- Throws:
antlr.RecognitionException
-
fromTable
- Throws:
antlr.RecognitionException
-
setClause
- Throws:
antlr.RecognitionException
-
whereClause
- Throws:
antlr.RecognitionException
-
comparisonExpr
public final void comparisonExpr(antlr.collections.AST _t, boolean parens) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
whereClauseExpr
- Throws:
antlr.RecognitionException
-
conditionList
- Throws:
antlr.RecognitionException
-
expr
- Throws:
antlr.RecognitionException
-
orderDirection
- Throws:
antlr.RecognitionException
-
filters
- Throws:
antlr.RecognitionException
-
thetaJoins
- Throws:
antlr.RecognitionException
-
sqlToken
- Throws:
antlr.RecognitionException
-
distinctOrAll
- Throws:
antlr.RecognitionException
-
selectColumn
- Throws:
antlr.RecognitionException
-
selectExpr
- Throws:
antlr.RecognitionException
-
selectAtom
- Throws:
antlr.RecognitionException
-
mapComponentReference
- Throws:
antlr.RecognitionException
-
count
- Throws:
antlr.RecognitionException
-
methodCall
- Throws:
antlr.RecognitionException
-
aggregate
- Throws:
antlr.RecognitionException
-
constant
- Throws:
antlr.RecognitionException
-
arithmeticExpr
- Throws:
antlr.RecognitionException
-
countExpr
- Throws:
antlr.RecognitionException
-
simpleExpr
- Throws:
antlr.RecognitionException
-
tableJoin
public final void tableJoin(antlr.collections.AST _t, antlr.collections.AST parent) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
booleanOp
public final void booleanOp(antlr.collections.AST _t, boolean parens) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
binaryComparisonExpression
public final void binaryComparisonExpression(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
exoticComparisonExpression
public final void exoticComparisonExpression(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
likeEscape
- Throws:
antlr.RecognitionException
-
inList
- Throws:
antlr.RecognitionException
-
quantified
- Throws:
antlr.RecognitionException
-
parenSelect
- Throws:
antlr.RecognitionException
-
simpleExprList
- Throws:
antlr.RecognitionException
-
addrExpr
- Throws:
antlr.RecognitionException
-
parameter
- Throws:
antlr.RecognitionException
-
additiveExpr
- Throws:
antlr.RecognitionException
-
multiplicativeExpr
- Throws:
antlr.RecognitionException
-
nestedExprAfterMinusDiv
public final void nestedExprAfterMinusDiv(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
caseExpr
- Throws:
antlr.RecognitionException
-
nestedExpr
- Throws:
antlr.RecognitionException
-
arguments
- Throws:
antlr.RecognitionException
-