Package antlr.collections

Examples of antlr.collections.AST.addChild()


      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


      if (callee != null && callee.getType() == METHOD_CALL) {
      appendedBlock_AST = callee;
      } else {
      AST lbrace = getASTFactory().create(LT(1));
      lbrace.setType(METHOD_CALL);
      if (callee != nulllbrace.addChild(callee);
      appendedBlock_AST = lbrace;
      }
     
      currentAST.root = appendedBlock_AST;
      currentAST.child = appendedBlock_AST!=null &&appendedBlock_AST.getFirstChild()!=null ?
View Full Code Here

                case COMMENT: {
                    atomic_statement();
                    a2_AST = (PtalonAST) returnAST;
                    if (inputState.guessing == 0) {

                        falseTree.addChild(a2_AST);

                    }
                    break;
                }
                case IF: {
View Full Code Here

                case IF: {
                    conditional_statement();
                    c2_AST = (PtalonAST) returnAST;
                    if (inputState.guessing == 0) {

                        falseTree.addChild(c2_AST);

                    }
                    break;
                }
                case FOR: {
View Full Code Here

                case FOR: {
                    iterative_statement();
                    i2_AST = (PtalonAST) returnAST;
                    if (inputState.guessing == 0) {

                        falseTree.addChild(i2_AST);

                    }
                    break;
                }
                default: {
View Full Code Here

    // ( [type 1] [type 2] ( [type 49] [type 3 #2] ) [type 3] )
    AST x = factory.create(1,"[type 1]","MyAST"); // will be root
    AST y = factory.create(2,"[type 2]","MyAST");
    AST z = factory.create(3,"[type 3]","MyAST");
    AST sub = factory.create(49,"[type 49]","ASTType49");
    sub.addChild(factory.create(3,"[type 3 #2]","MyAST"));
    AST t = factory.make(new AST[] {x,y,sub,z});
    AST dup_t = factory.dupList(t);
        // check structure
    boolean a = dup_t.equalsList(t);
        // check types
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

          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 {
      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

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.