Top Description Fields Constructors Methods
org.hibernate.hql.internal.ast

public Class SqlASTFactory

extends ASTFactory
implements HqlSqlTokenTypes
Class Inheritance
All Implemented Interfaces
org.hibernate.hql.internal.antlr.HqlSqlTokenTypes
Imports
java.lang.reflect.Constructor, org.hibernate.hql.internal.antlr.HqlSqlTokenTypes, org.hibernate.hql.internal.ast.tree.AggregateNode, .BetweenOperatorNode, .BinaryArithmeticOperatorNode, .BinaryLogicOperatorNode, .BooleanLiteralNode, .CastFunctionNode, .FkRefNode, .NullNode, .SearchedCaseNode, .SimpleCaseNode, .CollectionFunction, .ConstructorNode, .CountNode, .DeleteStatement, .DotNode, .FromClause, .FromElement, .IdentNode, .ImpliedFromElement, .InLogicOperatorNode, .IndexNode, .InitializeableNode, .InsertStatement, .IntoClause, .IsNotNullLogicOperatorNode, .IsNullLogicOperatorNode, .JavaConstantNode, .LiteralNode, .MapEntryNode, .MapKeyNode, .MapValueNode, .MethodNode, .OrderByClause, .ParameterNode, .QueryNode, .ResultVariableRefNode, .SelectClause, .SelectExpressionImpl, .SessionFactoryAwareNode, .SqlFragment, .SqlNode, .UnaryArithmeticNode, .UnaryLogicOperatorNode, .UpdateStatement, antlr.ASTFactory, .Token, antlr.collections.AST

Custom AST factory the intermediate tree that causes ANTLR to create specialized AST nodes, given the AST node type (from HqlSqlTokenTypes). HqlSqlWalker registers this factory with itself when it is initialized.
Author
Joshua

Field Summary

Modifier and TypeField and Description
private HqlSqlWalker
Inherited from antlr.ASTFactory:
theASTNodeTypetheASTNodeTypeClasstokenTypeToASTClassMap

Constructor Summary

AccessConstructor and Description
public
SqlASTFactory(HqlSqlWalker walker)

Create factory with a specific mapping from token type to Java AST node type.

Method Summary

Modifier and TypeMethod and Description
protected AST

Returns:

The instantiated and initialized node.
create
(Class<T>
The class to instantiate.
c
)

Overrides antlr.ASTFactory.create.

Actually instantiate the AST node.
protected AST
public Class<T>

Returns:

Class - The AST node class to instantiate.
getASTNodeType
(int
The token type.
tokenType
)

Overrides antlr.ASTFactory.getASTNodeType.

Returns the class for a given token type (a.k.a. AST node type).
private void
Inherited from antlr.ASTFactory:
addASTChildcreatecreatecreatecreatecreatecreatecreatecreatedupdupListdupTreeerrorgetTokenTypeToASTClassMapmakemakemakeASTRootsetASTNodeClasssetASTNodeClasssetASTNodeTypesetTokenTypeASTNodeTypesetTokenTypeToASTClassMap

Field Detail

walkerback to summary
private HqlSqlWalker walker

Constructor Detail

SqlASTFactoryback to summary
public SqlASTFactory(HqlSqlWalker walker)

Create factory with a specific mapping from token type to Java AST node type. Your subclasses of ASTFactory can override and reuse the map stuff.

Method Detail

createback to summary
protected AST create(Class<T> c)

Overrides antlr.ASTFactory.create.

Actually instantiate the AST node.

Parameters
c:Class<T>

The class to instantiate.

Returns:AST

The instantiated and initialized node.

createUsingCtorback to summary
protected AST createUsingCtor(Token token, String className)

Overrides antlr.ASTFactory.createUsingCtor.

Annotations
@SuppressWarnings:unchecked
getASTNodeTypeback to summary
public Class<T> getASTNodeType(int tokenType)

Overrides antlr.ASTFactory.getASTNodeType.

Returns the class for a given token type (a.k.a. AST node type).

Parameters
tokenType:int

The token type.

Returns:Class<T>

Class - The AST node class to instantiate.

initializeSqlNodeback to summary
private void initializeSqlNode(AST t)