Package antlr.collections.impl

Examples of antlr.collections.impl.ASTArray


    id = LT(1);
    id_AST = astFactory.create(id);
    match(IDENT);
    if ( inputState.guessing==0 ) {
      closableBlockParam_AST = (AST)currentAST.root;
      closableBlockParam_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(PARAMETER_DEF,"PARAMETER_DEF",first,LT(1))).add((AST)astFactory.make( (new ASTArray(1)).add(create(MODIFIERS,"MODIFIERS",first,LT(1))))).add((AST)astFactory.make( (new ASTArray(1)).add(create(TYPE,"TYPE",first,LT(1))))).add(id_AST));
      currentAST.root = closableBlockParam_AST;
      currentAST.child = closableBlockParam_AST!=null &&closableBlockParam_AST.getFirstChild()!=null ?
        closableBlockParam_AST.getFirstChild() : closableBlockParam_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here


    blockBody(EOF);
    bb_AST = (AST)returnAST;
    match(RCURLY);
    if ( inputState.guessing==0 ) {
      closableBlock_AST = (AST)currentAST.root;
      closableBlock_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(CLOSABLE_BLOCK,"{",first,LT(1))).add(cbp_AST).add(bb_AST));
      currentAST.root = closableBlock_AST;
      currentAST.child = closableBlock_AST!=null &&closableBlock_AST.getFirstChild()!=null ?
        closableBlock_AST.getFirstChild() : closableBlock_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

    bb_AST = (AST)returnAST;
    match(RCURLY);
    if ( inputState.guessing==0 ) {
      openOrClosableBlock_AST = (AST)currentAST.root;
     
      if (cp_AST == null)    openOrClosableBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(SLIST,"{",first,LT(1))).add(bb_AST));
      else                openOrClosableBlock_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(CLOSABLE_BLOCK,"{",first,LT(1))).add(cp_AST).add(bb_AST));
     
      currentAST.root = openOrClosableBlock_AST;
      currentAST.child = openOrClosableBlock_AST!=null &&openOrClosableBlock_AST.getFirstChild()!=null ?
        openOrClosableBlock_AST.getFirstChild() : openOrClosableBlock_AST;
      currentAST.advanceChildToEnd();
View Full Code Here

    expressionStatementNoCheck();
    esn_AST = (AST)returnAST;
    astFactory.addASTChild(currentAST, returnAST);
    if ( inputState.guessing==0 ) {
      expressionStatement_AST = (AST)currentAST.root;
      expressionStatement_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXPR,"EXPR",first,LT(1))).add(esn_AST));
      currentAST.root = expressionStatement_AST;
      currentAST.child = expressionStatement_AST!=null &&expressionStatement_AST.getFirstChild()!=null ?
        expressionStatement_AST.getFirstChild() : expressionStatement_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

    conditionalExpression(0);
    astFactory.addASTChild(currentAST, returnAST);
    }
    if ( inputState.guessing==0 ) {
      assignmentLessExpression_AST = (AST)currentAST.root;
      assignmentLessExpression_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXPR,"EXPR",first,LT(1))).add(assignmentLessExpression_AST));
      currentAST.root = assignmentLessExpression_AST;
      currentAST.child = assignmentLessExpression_AST!=null &&assignmentLessExpression_AST.getFirstChild()!=null ?
        assignmentLessExpression_AST.getFirstChild() : assignmentLessExpression_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

    if ( inputState.guessing==0 ) {
      forStatement_AST = (AST)currentAST.root;
     
      if (cl_AST != null) {
      if (s_AST != null)
      forStatement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(LITERAL_for,"for",first,LT(1))).add(cl_AST).add(s_AST));
      else
      forStatement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(LITERAL_for,"for",first,LT(1))).add(cl_AST).add(forCbs_AST));
      } else {
      if (s_AST != null)
      forStatement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(LITERAL_for,"for",first,LT(1))).add(fic_AST).add(s_AST));
      else
      forStatement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(LITERAL_for,"for",first,LT(1))).add(fic_AST).add(forCbs_AST));
      }
     
      currentAST.root = forStatement_AST;
      currentAST.child = forStatement_AST!=null &&forStatement_AST.getFirstChild()!=null ?
        forStatement_AST.getFirstChild() : forStatement_AST;
View Full Code Here

    }
   
    }
    if ( inputState.guessing==0 ) {
      strictContextExpression_AST = (AST)currentAST.root;
      strictContextExpression_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXPR,"EXPR",first,LT(1))).add(strictContextExpression_AST));
      currentAST.root = strictContextExpression_AST;
      currentAST.child = strictContextExpression_AST!=null &&strictContextExpression_AST.getFirstChild()!=null ?
        strictContextExpression_AST.getFirstChild() : strictContextExpression_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

    }
    caseSList();
    astFactory.addASTChild(currentAST, returnAST);
    if ( inputState.guessing==0 ) {
      casesGroup_AST = (AST)currentAST.root;
      casesGroup_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(CASE_GROUP,"CASE_GROUP",first,LT(1))).add(casesGroup_AST));
      currentAST.root = casesGroup_AST;
      currentAST.child = casesGroup_AST!=null &&casesGroup_AST.getFirstChild()!=null ?
        casesGroup_AST.getFirstChild() : casesGroup_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

      if (((LA(1)==LITERAL_catch||LA(1)==NLS) && (LA(2)==LPAREN||LA(2)==LITERAL_catch))&&(!(LA(1) == NLS && LA(2) == LPAREN))) {
        nls();
        handler();
        h_AST = (AST)returnAST;
        if ( inputState.guessing==0 ) {
          newHandler_AST = (AST)astFactory.make( (new ASTArray(3)).add(null).add(newHandler_AST).add(h_AST));
        }
      }
      else {
        break _loop359;
      }
     
    } while (true);
    }
    {
    if ((LA(1)==LITERAL_finally||LA(1)==NLS) && (_tokenSet_80.member(LA(2)))) {
      nls();
      finallyClause();
      fc_AST = (AST)returnAST;
    }
    else if ((_tokenSet_10.member(LA(1))) && (_tokenSet_11.member(LA(2)))) {
    }
    else {
      throw new NoViableAltException(LT(1), getFilename());
    }
   
    }
    if ( inputState.guessing==0 ) {
      tryBlock_AST = (AST)currentAST.root;
      tryBlock_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(LITERAL_try,"try",first,LT(1))).add(tryCs_AST).add(newHandler_AST).add(fc_AST));
      currentAST.root = tryBlock_AST;
      currentAST.child = tryBlock_AST!=null &&tryBlock_AST.getFirstChild()!=null ?
        tryBlock_AST.getFirstChild() : tryBlock_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

      }
      }
      }
      if ( inputState.guessing==0 ) {
        branchStatement_AST = (AST)currentAST.root;
        branchStatement_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(LITERAL_return,"return",first,LT(1))).add(returnE_AST));
        currentAST.root = branchStatement_AST;
        currentAST.child = branchStatement_AST!=null &&branchStatement_AST.getFirstChild()!=null ?
          branchStatement_AST.getFirstChild() : branchStatement_AST;
        currentAST.advanceChildToEnd();
      }
      branchStatement_AST = (AST)currentAST.root;
      break;
    }
    case LITERAL_break:
    {
      match(LITERAL_break);
      {
      switch ( LA(1)) {
      case IDENT:
      {
        breakI = LT(1);
        breakI_AST = astFactory.create(breakI);
        match(IDENT);
        break;
      }
      case EOF:
      case RBRACK:
      case COMMA:
      case RPAREN:
      case RCURLY:
      case SEMI:
      case LITERAL_default:
      case LITERAL_else:
      case LITERAL_case:
      case NLS:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      if ( inputState.guessing==0 ) {
        branchStatement_AST = (AST)currentAST.root;
        branchStatement_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(LITERAL_break,"break",first,LT(1))).add(breakI_AST));
        currentAST.root = branchStatement_AST;
        currentAST.child = branchStatement_AST!=null &&branchStatement_AST.getFirstChild()!=null ?
          branchStatement_AST.getFirstChild() : branchStatement_AST;
        currentAST.advanceChildToEnd();
      }
      branchStatement_AST = (AST)currentAST.root;
      break;
    }
    case LITERAL_continue:
    {
      match(LITERAL_continue);
      {
      switch ( LA(1)) {
      case IDENT:
      {
        contI = LT(1);
        contI_AST = astFactory.create(contI);
        match(IDENT);
        break;
      }
      case EOF:
      case RBRACK:
      case COMMA:
      case RPAREN:
      case RCURLY:
      case SEMI:
      case LITERAL_default:
      case LITERAL_else:
      case LITERAL_case:
      case NLS:
      {
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      if ( inputState.guessing==0 ) {
        branchStatement_AST = (AST)currentAST.root;
        branchStatement_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(LITERAL_continue,"continue",first,LT(1))).add(contI_AST));
        currentAST.root = branchStatement_AST;
        currentAST.child = branchStatement_AST!=null &&branchStatement_AST.getFirstChild()!=null ?
          branchStatement_AST.getFirstChild() : branchStatement_AST;
        currentAST.advanceChildToEnd();
      }
      branchStatement_AST = (AST)currentAST.root;
      break;
    }
    case LITERAL_throw:
    {
      match(LITERAL_throw);
      expression(0);
      throwE_AST = (AST)returnAST;
      if ( inputState.guessing==0 ) {
        branchStatement_AST = (AST)currentAST.root;
        branchStatement_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(LITERAL_throw,"throw",first,LT(1))).add(throwE_AST));
        currentAST.root = branchStatement_AST;
        currentAST.child = branchStatement_AST!=null &&branchStatement_AST.getFirstChild()!=null ?
          branchStatement_AST.getFirstChild() : branchStatement_AST;
        currentAST.advanceChildToEnd();
      }
      branchStatement_AST = (AST)currentAST.root;
      break;
    }
    case LITERAL_assert:
    {
      match(LITERAL_assert);
      assignmentLessExpression();
      assertAle_AST = (AST)returnAST;
      {
      if ((LA(1)==COMMA||LA(1)==COLON) && (_tokenSet_81.member(LA(2)))) {
        {
        switch ( LA(1)) {
        case COMMA:
        {
          match(COMMA);
          nls();
          break;
        }
        case COLON:
        {
          match(COLON);
          nls();
          break;
        }
        default:
        {
          throw new NoViableAltException(LT(1), getFilename());
        }
        }
        }
        expression(0);
        assertE_AST = (AST)returnAST;
      }
      else if ((_tokenSet_82.member(LA(1))) && (_tokenSet_11.member(LA(2)))) {
      }
      else {
        throw new NoViableAltException(LT(1), getFilename());
      }
     
      }
      if ( inputState.guessing==0 ) {
        branchStatement_AST = (AST)currentAST.root;
        branchStatement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(LITERAL_assert,"assert",first,LT(1))).add(assertAle_AST).add(assertE_AST));
        currentAST.root = branchStatement_AST;
        currentAST.child = branchStatement_AST!=null &&branchStatement_AST.getFirstChild()!=null ?
          branchStatement_AST.getFirstChild() : branchStatement_AST;
        currentAST.advanceChildToEnd();
      }
View Full Code Here

TOP

Related Classes of antlr.collections.impl.ASTArray

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.