Package antlr.collections.impl

Examples of antlr.collections.impl.ASTArray


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


    match(LITERAL_package);
    identifier();
    id_AST = (AST)returnAST;
    if ( inputState.guessing==0 ) {
      packageDefinition_AST = (AST)currentAST.root;
      packageDefinition_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(PACKAGE_DEF,"package",first,LT(1))).add(an_AST).add(id_AST));
      currentAST.root = packageDefinition_AST;
      currentAST.child = packageDefinition_AST!=null &&packageDefinition_AST.getFirstChild()!=null ?
        packageDefinition_AST.getFirstChild() : packageDefinition_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

      }
     
      }
      if ( inputState.guessing==0 ) {
        statement_AST = (AST)currentAST.root;
        statement_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(LITERAL_if,"if",first,LT(1))).add(ale_AST).add(ifCbs_AST).add(elseCbs_AST));
        currentAST.root = statement_AST;
        currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ?
          statement_AST.getFirstChild() : statement_AST;
        currentAST.advanceChildToEnd();
      }
      statement_AST = (AST)currentAST.root;
      break;
    }
    case LITERAL_for:
    {
      forStatement();
      astFactory.addASTChild(currentAST, returnAST);
      statement_AST = (AST)currentAST.root;
      break;
    }
    case LITERAL_while:
    {
      match(LITERAL_while);
      match(LPAREN);
      sce=strictContextExpression(false);
      while_sce_AST = (AST)returnAST;
      match(RPAREN);
      nlsWarn();
      {
      switch ( LA(1)) {
      case SEMI:
      {
        s = LT(1);
        s_AST = astFactory.create(s);
        match(SEMI);
        break;
      }
      case FINAL:
      case ABSTRACT:
      case STRICTFP:
      case LITERAL_import:
      case LITERAL_static:
      case LITERAL_def:
      case LBRACK:
      case IDENT:
      case STRING_LITERAL:
      case LPAREN:
      case LITERAL_class:
      case LITERAL_interface:
      case LITERAL_enum:
      case AT:
      case LITERAL_super:
      case LITERAL_void:
      case LITERAL_boolean:
      case LITERAL_byte:
      case LITERAL_char:
      case LITERAL_short:
      case LITERAL_int:
      case LITERAL_float:
      case LITERAL_long:
      case LITERAL_double:
      case LITERAL_private:
      case LITERAL_public:
      case LITERAL_protected:
      case LITERAL_transient:
      case LITERAL_native:
      case LITERAL_threadsafe:
      case LITERAL_synchronized:
      case LITERAL_volatile:
      case LCURLY:
      case LITERAL_this:
      case LITERAL_if:
      case LITERAL_while:
      case LITERAL_switch:
      case LITERAL_for:
      case LITERAL_return:
      case LITERAL_break:
      case LITERAL_continue:
      case LITERAL_throw:
      case LITERAL_assert:
      case PLUS:
      case MINUS:
      case LITERAL_try:
      case LITERAL_false:
      case LITERAL_new:
      case LITERAL_null:
      case LITERAL_true:
      case INC:
      case DEC:
      case BNOT:
      case LNOT:
      case STRING_CTOR_START:
      case NUM_INT:
      case NUM_FLOAT:
      case NUM_LONG:
      case NUM_DOUBLE:
      case NUM_BIG_INT:
      case NUM_BIG_DECIMAL:
      {
        compatibleBodyStatement();
        while_cbs_AST = (AST)returnAST;
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      if ( inputState.guessing==0 ) {
        statement_AST = (AST)currentAST.root;
       
        if (s_AST != null)
        statement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(LITERAL_while,"Literal_while",first,LT(1))).add(while_sce_AST).add(s_AST));
        else
        statement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(LITERAL_while,"Literal_while",first,LT(1))).add(while_sce_AST).add(while_cbs_AST));
       
        currentAST.root = statement_AST;
        currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ?
          statement_AST.getFirstChild() : statement_AST;
        currentAST.advanceChildToEnd();
      }
      statement_AST = (AST)currentAST.root;
      break;
    }
    case LITERAL_switch:
    {
      match(LITERAL_switch);
      match(LPAREN);
      sce=strictContextExpression(false);
      switchSce_AST = (AST)returnAST;
      match(RPAREN);
      nlsWarn();
      match(LCURLY);
      nls();
      {
      _loop300:
      do {
        if ((LA(1)==LITERAL_default||LA(1)==LITERAL_case)) {
          casesGroup();
          cg_AST = (AST)returnAST;
          if ( inputState.guessing==0 ) {
            casesGroup_AST = (AST)astFactory.make( (new ASTArray(3)).add(null).add(casesGroup_AST).add(cg_AST));
          }
        }
        else {
          break _loop300;
        }
       
      } while (true);
      }
      match(RCURLY);
      if ( inputState.guessing==0 ) {
        statement_AST = (AST)currentAST.root;
        statement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(LITERAL_switch,"switch",first,LT(1))).add(switchSce_AST).add(casesGroup_AST));
        currentAST.root = statement_AST;
        currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ?
          statement_AST.getFirstChild() : statement_AST;
        currentAST.advanceChildToEnd();
      }
      statement_AST = (AST)currentAST.root;
      break;
    }
    case LITERAL_try:
    {
      tryBlock();
      astFactory.addASTChild(currentAST, returnAST);
      statement_AST = (AST)currentAST.root;
      break;
    }
    case LITERAL_return:
    case LITERAL_break:
    case LITERAL_continue:
    case LITERAL_throw:
    case LITERAL_assert:
    {
      branchStatement();
      astFactory.addASTChild(currentAST, returnAST);
      statement_AST = (AST)currentAST.root;
      break;
    }
    default:
      boolean synPredMatched281 = false;
      if (((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2))))) {
        int _m281 = mark();
        synPredMatched281 = true;
        inputState.guessing++;
        try {
          {
          genericMethodStart();
          }
        }
        catch (RecognitionException pe) {
          synPredMatched281 = false;
        }
        rewind(_m281);
inputState.guessing--;
      }
      if ( synPredMatched281 ) {
        genericMethod();
        astFactory.addASTChild(currentAST, returnAST);
        statement_AST = (AST)currentAST.root;
      }
      else {
        boolean synPredMatched283 = false;
        if (((_tokenSet_12.member(LA(1))) && (_tokenSet_14.member(LA(2))))) {
          int _m283 = mark();
          synPredMatched283 = true;
          inputState.guessing++;
          try {
            {
            multipleAssignmentDeclarationStart();
            }
          }
          catch (RecognitionException pe) {
            synPredMatched283 = false;
          }
          rewind(_m283);
inputState.guessing--;
        }
        if ( synPredMatched283 ) {
          multipleAssignmentDeclaration();
          astFactory.addASTChild(currentAST, returnAST);
          statement_AST = (AST)currentAST.root;
        }
        else {
          boolean synPredMatched285 = false;
          if (((_tokenSet_15.member(LA(1))) && (_tokenSet_16.member(LA(2))))) {
            int _m285 = mark();
            synPredMatched285 = true;
            inputState.guessing++;
            try {
              {
              declarationStart();
              }
            }
            catch (RecognitionException pe) {
              synPredMatched285 = false;
            }
            rewind(_m285);
inputState.guessing--;
          }
          if ( synPredMatched285 ) {
            declaration();
            astFactory.addASTChild(currentAST, returnAST);
            statement_AST = (AST)currentAST.root;
          }
          else {
            boolean synPredMatched287 = false;
            if (((LA(1)==IDENT) && (LA(2)==COLON))) {
              int _m287 = mark();
              synPredMatched287 = true;
              inputState.guessing++;
              try {
                {
                match(IDENT);
                match(COLON);
                }
              }
              catch (RecognitionException pe) {
                synPredMatched287 = false;
              }
              rewind(_m287);
inputState.guessing--;
            }
            if ( synPredMatched287 ) {
              statementLabelPrefix();
              pfx_AST = (AST)returnAST;
              if ( inputState.guessing==0 ) {
                statement_AST = (AST)currentAST.root;
                statement_AST = pfx_AST;
                currentAST.root = statement_AST;
                currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ?
                  statement_AST.getFirstChild() : statement_AST;
                currentAST.advanceChildToEnd();
              }
              {
              boolean synPredMatched290 = false;
              if (((LA(1)==LCURLY) && (_tokenSet_17.member(LA(2))))) {
                int _m290 = mark();
                synPredMatched290 = true;
                inputState.guessing++;
                try {
                  {
                  match(LCURLY);
                  }
                }
                catch (RecognitionException pe) {
                  synPredMatched290 = false;
                }
                rewind(_m290);
inputState.guessing--;
              }
              if ( synPredMatched290 ) {
                openOrClosableBlock();
                astFactory.addASTChild(currentAST, returnAST);
              }
              else if ((_tokenSet_18.member(LA(1))) && (_tokenSet_1.member(LA(2)))) {
                statement(COLON);
                astFactory.addASTChild(currentAST, returnAST);
              }
              else {
                throw new NoViableAltException(LT(1), getFilename());
              }
             
              }
              statement_AST = (AST)currentAST.root;
            }
            else if ((_tokenSet_19.member(LA(1))) && (_tokenSet_1.member(LA(2)))) {
              expressionStatement(prevToken);
              es_AST = (AST)returnAST;
              astFactory.addASTChild(currentAST, returnAST);
              statement_AST = (AST)currentAST.root;
            }
            else {
              boolean synPredMatched298 = false;
              if (((LA(1)==LITERAL_import||LA(1)==AT) && (_tokenSet_20.member(LA(2))))) {
                int _m298 = mark();
                synPredMatched298 = true;
                inputState.guessing++;
                try {
                  {
                  annotationsOpt();
                  match(LITERAL_import);
                  }
                }
                catch (RecognitionException pe) {
                  synPredMatched298 = false;
                }
                rewind(_m298);
inputState.guessing--;
              }
              if ( synPredMatched298 ) {
                importStatement();
                astFactory.addASTChild(currentAST, returnAST);
                statement_AST = (AST)currentAST.root;
              }
              else if ((_tokenSet_21.member(LA(1))) && (_tokenSet_22.member(LA(2)))) {
                modifiersOpt();
                m_AST = (AST)returnAST;
                typeDefinitionInternal(m_AST);
                astFactory.addASTChild(currentAST, returnAST);
                statement_AST = (AST)currentAST.root;
              }
              else if ((LA(1)==LITERAL_synchronized) && (LA(2)==LPAREN)) {
                match(LITERAL_synchronized);
                match(LPAREN);
                sce=strictContextExpression(false);
                synch_sce_AST = (AST)returnAST;
                match(RPAREN);
                nlsWarn();
                compoundStatement();
                synch_cs_AST = (AST)returnAST;
                if ( inputState.guessing==0 ) {
                  statement_AST = (AST)currentAST.root;
                  statement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(LITERAL_synchronized,"synchronized",first,LT(1))).add(synch_sce_AST).add(synch_cs_AST));
                  currentAST.root = statement_AST;
                  currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ?
                    statement_AST.getFirstChild() : statement_AST;
                  currentAST.advanceChildToEnd();
                }
View Full Code Here

        nls();
        i2 = LT(1);
        i2_AST = astFactory.create(i2);
        match(IDENT);
        if ( inputState.guessing==0 ) {
          i1_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(DOT,".",first,LT(1))).add(i1_AST).add(i2_AST));
        }
      }
      else {
        break _loop72;
      }
View Full Code Here

    identifierStar();
    is_AST = (AST)returnAST;
    if ( inputState.guessing==0 ) {
      importStatement_AST = (AST)currentAST.root;
      if (isStatic)
      importStatement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(STATIC_IMPORT,"static_import",first,LT(1))).add(an_AST).add(is_AST));
      else
      importStatement_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(IMPORT,"import",first,LT(1))).add(an_AST).add(is_AST));
      currentAST.root = importStatement_AST;
      currentAST.child = importStatement_AST!=null &&importStatement_AST.getFirstChild()!=null ?
        importStatement_AST.getFirstChild() : importStatement_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

        nls();
        i2 = LT(1);
        i2_AST = astFactory.create(i2);
        match(IDENT);
        if ( inputState.guessing==0 ) {
          i1_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(DOT,".",first,LT(1))).add(i1_AST).add(i2_AST));
        }
      }
      else {
        break _loop75;
      }
     
    } while (true);
    }
    {
    switch ( LA(1)) {
    case DOT:
    {
      d2 = LT(1);
      d2_AST = astFactory.create(d2);
      match(DOT);
      nls();
      s = LT(1);
      s_AST = astFactory.create(s);
      match(STAR);
      if ( inputState.guessing==0 ) {
        i1_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(DOT,".",first,LT(1))).add(i1_AST).add(s_AST));
      }
      break;
    }
    case LITERAL_as:
    {
      match(LITERAL_as);
      nls();
      alias = LT(1);
      alias_AST = astFactory.create(alias);
      match(IDENT);
      if ( inputState.guessing==0 ) {
        i1_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(LITERAL_as,"as",first,LT(1))).add(i1_AST).add(alias_AST));
      }
      break;
    }
    case EOF:
    case RCURLY:
View Full Code Here

    ic_AST = (AST)returnAST;
    classBlock();
    cb_AST = (AST)returnAST;
    if ( inputState.guessing==0 ) {
      classDefinition_AST = (AST)currentAST.root;
      classDefinition_AST = (AST)astFactory.make( (new ASTArray(7)).add(create(CLASS_DEF,"CLASS_DEF",first,LT(1))).add(modifiers).add(tmp29_AST).add(tp_AST).add(sc_AST).add(ic_AST).add(cb_AST));
      currentAST.root = classDefinition_AST;
      currentAST.child = classDefinition_AST!=null &&classDefinition_AST.getFirstChild()!=null ?
        classDefinition_AST.getFirstChild() : classDefinition_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

    ie_AST = (AST)returnAST;
    interfaceBlock();
    ib_AST = (AST)returnAST;
    if ( inputState.guessing==0 ) {
      interfaceDefinition_AST = (AST)currentAST.root;
      interfaceDefinition_AST = (AST)astFactory.make( (new ASTArray(6)).add(create(INTERFACE_DEF,"INTERFACE_DEF",first,LT(1))).add(modifiers).add(tmp31_AST).add(tp_AST).add(ie_AST).add(ib_AST));
      currentAST.root = interfaceDefinition_AST;
      currentAST.child = interfaceDefinition_AST!=null &&interfaceDefinition_AST.getFirstChild()!=null ?
        interfaceDefinition_AST.getFirstChild() : interfaceDefinition_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

    nls();
    enumBlock();
    eb_AST = (AST)returnAST;
    if ( inputState.guessing==0 ) {
      enumDefinition_AST = (AST)currentAST.root;
      enumDefinition_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(ENUM_DEF,"ENUM_DEF",first,LT(1))).add(modifiers).add(tmp33_AST).add(ic_AST).add(eb_AST));
      currentAST.root = enumDefinition_AST;
      currentAST.child = enumDefinition_AST!=null &&enumDefinition_AST.getFirstChild()!=null ?
        enumDefinition_AST.getFirstChild() : enumDefinition_AST;
      currentAST.advanceChildToEnd();
    }
View Full Code Here

    match(IDENT);
    annotationBlock();
    ab_AST = (AST)returnAST;
    if ( inputState.guessing==0 ) {
      annotationDefinition_AST = (AST)currentAST.root;
      annotationDefinition_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(ANNOTATION_DEF,"ANNOTATION_DEF",first,LT(1))).add(modifiers).add(tmp36_AST).add(ab_AST));
      currentAST.root = annotationDefinition_AST;
      currentAST.child = annotationDefinition_AST!=null &&annotationDefinition_AST.getFirstChild()!=null ?
        annotationDefinition_AST.getFirstChild() : annotationDefinition_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.