Class SqlASTFactory

java.lang.Object
antlr.ASTFactory
org.hibernate.hql.ast.SqlASTFactory
All Implemented Interfaces:
HqlSqlTokenTypes

public class SqlASTFactory extends antlr.ASTFactory implements HqlSqlTokenTypes
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.
  • Constructor Details

    • SqlASTFactory

      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 Details

    • getASTNodeType

      public Class getASTNodeType(int tokenType)
      Returns the class for a given token type (a.k.a. AST node type).
      Overrides:
      getASTNodeType in class antlr.ASTFactory
      Parameters:
      tokenType - The token type.
      Returns:
      Class - The AST node class to instantiate.
    • createUsingCtor

      protected antlr.collections.AST createUsingCtor(antlr.Token token, String className)
      Overrides:
      createUsingCtor in class antlr.ASTFactory
    • create

      protected antlr.collections.AST create(Class c)
      Actually instantiate the AST node.
      Overrides:
      create in class antlr.ASTFactory
      Parameters:
      c - The class to instantiate.
      Returns:
      The instantiated and initialized node.