Package antlr.collections

Examples of antlr.collections.AST.addChild()


    }
    else {
      final AST root = getASTFactory().create( OrderByTemplateTokenTypes.IDENT_LIST, "{ident list}" );
      for ( int i = 0; i < replacements.length; i++ ) {
        final String identText = Template.TEMPLATE + '.' + replacements[i];
        root.addChild( getASTFactory().create( OrderByTemplateTokenTypes.IDENT, identText ) );
      }
      return root;
    }
  }
View Full Code Here


    if ( IDENT_LIST == sortKey.getFirstChild().getType() ) {
      AST identList = sortKey.getFirstChild();
      AST ident = identList.getFirstChild();
      AST holder = new CommonAST();
      do {
        holder.addChild(
            createSortSpecification(
                ident,
                sortSpecification.getCollation(),
                sortSpecification.getOrdering()
            )
View Full Code Here

    IdentNode syntheticAlias = ( IdentNode ) getASTFactory().create( IDENT, "{synthetic-alias}" );
    syntheticAlias.setFromElement( fromElement );
    syntheticAlias.setResolved();

    dot.setFirstChild( syntheticAlias );
    dot.addChild( property );

    return dot;
  }

  @Override
View Full Code Here

          AST methodIdentNode = getASTFactory().create( HqlSqlTokenTypes.IDENT, "cast" );
          versionMethodNode.addChild( methodIdentNode );
          versionMethodNode.initializeMethodNode(methodIdentNode, true );
          AST castExprListNode = getASTFactory().create( HqlSqlTokenTypes.EXPR_LIST, "exprList" );
          methodIdentNode.setNextSibling( castExprListNode );
          castExprListNode.addChild( versionValueNode );
          versionValueNode.setNextSibling(
              getASTFactory().create(
                  HqlSqlTokenTypes.IDENT,
                  sessionFactoryHelper.getFactory().getDialect().getTypeName( sqlTypes[0] ) )
          );
View Full Code Here

      else {
        // Not possible to simply re-use the versionPropertyNode here as it causes
        // OOM errors due to circularity :(
        versionIncrementNode = getASTFactory().create( HqlSqlTokenTypes.PLUS, "+" );
        versionIncrementNode.setFirstChild( generateVersionPropertyNode( persister ) );
        versionIncrementNode.addChild( getASTFactory().create( HqlSqlTokenTypes.IDENT, "1" ) );
      }

      eq.addChild( versionIncrementNode );

      evaluateAssignment( eq, persister, 0 );
View Full Code Here

      else {
        // Not possible to simply re-use the versionPropertyNode here as it causes
        // OOM errors due to circularity :(
        versionIncrementNode = getASTFactory().create( HqlSqlTokenTypes.PLUS, "+" );
        versionIncrementNode.setFirstChild( generateVersionPropertyNode( persister ) );
        versionIncrementNode.addChild( getASTFactory().create( HqlSqlTokenTypes.IDENT, "1" ) );
      }

      eq.addChild( versionIncrementNode );

      evaluateAssignment( eq, persister, 0 );
View Full Code Here

    IdentNode syntheticAlias = ( IdentNode ) getASTFactory().create( IDENT, "{synthetic-alias}" );
    syntheticAlias.setFromElement( fromElement );
    syntheticAlias.setResolved();

    dot.setFirstChild( syntheticAlias );
    dot.addChild( property );

    return dot;
  }

  @Override
View Full Code Here

          AST methodIdentNode = getASTFactory().create( HqlSqlTokenTypes.IDENT, "cast" );
          versionMethodNode.addChild( methodIdentNode );
          versionMethodNode.initializeMethodNode(methodIdentNode, true );
          AST castExprListNode = getASTFactory().create( HqlSqlTokenTypes.EXPR_LIST, "exprList" );
          methodIdentNode.setNextSibling( castExprListNode );
          castExprListNode.addChild( versionValueNode );
          versionValueNode.setNextSibling(
              getASTFactory().create(
                  HqlSqlTokenTypes.IDENT,
                  sessionFactoryHelper.getFactory().getDialect().getTypeName( sqlTypes[0] ) )
          );
View Full Code Here

      else {
        // Not possible to simply re-use the versionPropertyNode here as it causes
        // OOM errors due to circularity :(
        versionIncrementNode = getASTFactory().create( HqlSqlTokenTypes.PLUS, "+" );
        versionIncrementNode.setFirstChild( generateVersionPropertyNode( persister ) );
        versionIncrementNode.addChild( getASTFactory().create( HqlSqlTokenTypes.IDENT, "1" ) );
      }

      eq.addChild( versionIncrementNode );

      evaluateAssignment( eq, persister, 0 );
View Full Code Here

    IdentNode syntheticAlias = ( IdentNode ) getASTFactory().create( IDENT, "{synthetic-alias}" );
    syntheticAlias.setFromElement( fromElement );
    syntheticAlias.setResolved();

    dot.setFirstChild( syntheticAlias );
    dot.addChild( property );

    return dot;
  }

  protected void processQuery(AST select, AST query) throws SemanticException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.