Package antlr

Examples of antlr.ASTFactory


  @Deprecated
  private ColumnHelper() {
  }

  public static void generateSingleScalarColumn(HqlSqlWalkerNode node, int i) {
    ASTFactory factory = node.getASTFactory();
    ASTUtil.createSibling( factory, SqlTokenTypes.SELECT_COLUMNS, " as " + NameGenerator.scalarName( i, 0 ), node );
  }
View Full Code Here


  public static void generateScalarColumns(HqlSqlWalkerNode node, String[] sqlColumns, int i) {
    if ( sqlColumns.length == 1 ) {
      generateSingleScalarColumn( node, i );
    }
    else {
      ASTFactory factory = node.getASTFactory();
      AST n = node;
      n.setText( sqlColumns[0] )// Use the DOT node to emit the first column name.
      // Create the column names, folled by the column aliases.
      for ( int j = 0; j < sqlColumns.length; j++ ) {
        if ( j > 0 ) {
View Full Code Here

    LOG.debugf( "createFromElementInSubselect() : %s -> %s", path, fromElement );
    return fromElement;
  }

  private FromElement evaluateFromElementPath(String path, String classAlias) throws SemanticException {
    ASTFactory factory = fromClause.getASTFactory();
    FromReferenceNode pathNode = (FromReferenceNode) PathHelper.parsePath( path, factory );
    pathNode.recursiveResolve(
        // This is the root level node.
        FromReferenceNode.ROOT_LEVEL,
        // Generate an explicit from clause at the root.
View Full Code Here

protected HqlBaseParser(TokenBuffer tokenBuf, int k) {
  super(tokenBuf,k);
  tokenNames = _tokenNames;
  buildTokenTypeASTClassMap();
  astFactory = new ASTFactory(getTokenTypeToASTClassMap());
}
View Full Code Here

protected HqlBaseParser(TokenStream lexer, int k) {
  super(lexer,k);
  tokenNames = _tokenNames;
  buildTokenTypeASTClassMap();
  astFactory = new ASTFactory(getTokenTypeToASTClassMap());
}
View Full Code Here

public HqlBaseParser(ParserSharedInputState state) {
  super(state,3);
  tokenNames = _tokenNames;
  buildTokenTypeASTClassMap();
  astFactory = new ASTFactory(getTokenTypeToASTClassMap());
}
View Full Code Here

        if ( !collectionElementType.isEntityType() ) {
          throw new QueryException( "collection of values in filter: this" );
        }

        String collectionElementEntityName = persister.getElementPersister().getEntityName();
        ASTFactory inputAstFactory = hqlParser.getASTFactory();
        AST fromElement = ASTUtil.create( inputAstFactory, HqlTokenTypes.FILTER_ENTITY, collectionElementEntityName );
        ASTUtil.createSibling( inputAstFactory, HqlTokenTypes.ALIAS, "this", fromElement );
        fromClauseInput.addChild( fromElement );
        // Show the modified AST.
        if ( log.isDebugEnabled() ) {
View Full Code Here

   */
  private ColumnHelper() {
  }

  public static void generateSingleScalarColumn(HqlSqlWalkerNode node, int i) {
    ASTFactory factory = node.getASTFactory();
    ASTUtil.createSibling( factory, SqlTokenTypes.SELECT_COLUMNS, " as " + NameGenerator.scalarName( i, 0 ), node );
  }
View Full Code Here

  public static void generateScalarColumns(HqlSqlWalkerNode node, String sqlColumns[], int i) {
    if ( sqlColumns.length == 1 ) {
      generateSingleScalarColumn( node, i );
    }
    else {
      ASTFactory factory = node.getASTFactory();
      AST n = node;
      n.setText( sqlColumns[0] )// Use the DOT node to emit the first column name.
      // Create the column names, folled by the column aliases.
      for ( int j = 0; j < sqlColumns.length; j++ ) {
        if ( j > 0 ) {
View Full Code Here

    }
    return fromElement;
  }

  private FromElement evaluateFromElementPath(String path, String classAlias) throws SemanticException {
    ASTFactory factory = fromClause.getASTFactory();
    FromReferenceNode pathNode = ( FromReferenceNode ) PathHelper.parsePath( path, factory );
    pathNode.recursiveResolve( FromReferenceNode.ROOT_LEVEL, // This is the root level node.
        false, // Generate an explicit from clause at the root.
        classAlias,
            null
View Full Code Here

TOP

Related Classes of antlr.ASTFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.