Package antlr

Examples of antlr.ASTPair


          }
         
  public final void interfaceField() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST interfaceField_AST = null;
    AST d_AST = null;
    AST dg_AST = null;
    AST mods_AST = null;
    AST td_AST = null;
   
    boolean synPredMatched202 = false;
    if (((_tokenSet_15.member(LA(1))) && (_tokenSet_16.member(LA(2))))) {
      int _m202 = mark();
      synPredMatched202 = true;
      inputState.guessing++;
      try {
        {
        declarationStart();
        }
      }
      catch (RecognitionException pe) {
        synPredMatched202 = false;
      }
      rewind(_m202);
inputState.guessing--;
    }
    if ( synPredMatched202 ) {
      declaration();
      d_AST = (AST)returnAST;
      if ( inputState.guessing==0 ) {
        interfaceField_AST = (AST)currentAST.root;
        interfaceField_AST = d_AST;
        currentAST.root = interfaceField_AST;
        currentAST.child = interfaceField_AST!=null &&interfaceField_AST.getFirstChild()!=null ?
          interfaceField_AST.getFirstChild() : interfaceField_AST;
        currentAST.advanceChildToEnd();
      }
    }
    else {
      boolean synPredMatched204 = false;
      if (((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2))))) {
        int _m204 = mark();
        synPredMatched204 = true;
        inputState.guessing++;
        try {
          {
          genericMethodStart();
          }
        }
        catch (RecognitionException pe) {
          synPredMatched204 = false;
        }
        rewind(_m204);
inputState.guessing--;
      }
      if ( synPredMatched204 ) {
        genericMethod();
        dg_AST = (AST)returnAST;
        if ( inputState.guessing==0 ) {
          interfaceField_AST = (AST)currentAST.root;
          interfaceField_AST = dg_AST;
          currentAST.root = interfaceField_AST;
          currentAST.child = interfaceField_AST!=null &&interfaceField_AST.getFirstChild()!=null ?
            interfaceField_AST.getFirstChild() : interfaceField_AST;
          currentAST.advanceChildToEnd();
        }
      }
      else {
        boolean synPredMatched206 = false;
        if (((_tokenSet_21.member(LA(1))) && (_tokenSet_22.member(LA(2))))) {
          int _m206 = mark();
          synPredMatched206 = true;
          inputState.guessing++;
          try {
            {
            typeDeclarationStart();
            }
          }
          catch (RecognitionException pe) {
            synPredMatched206 = false;
          }
          rewind(_m206);
inputState.guessing--;
        }
        if ( synPredMatched206 ) {
          modifiersOpt();
          mods_AST = (AST)returnAST;
          {
          typeDefinitionInternal(mods_AST);
          td_AST = (AST)returnAST;
          if ( inputState.guessing==0 ) {
            interfaceField_AST = (AST)currentAST.root;
            interfaceField_AST = td_AST;
            currentAST.root = interfaceField_AST;
            currentAST.child = interfaceField_AST!=null &&interfaceField_AST.getFirstChild()!=null ?
              interfaceField_AST.getFirstChild() : interfaceField_AST;
            currentAST.advanceChildToEnd();
          }
          }
        }
        else {
          throw new NoViableAltException(LT(1), getFilename());
View Full Code Here


      }
     
  public final void annotationField() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST annotationField_AST = null;
    AST mods_AST = null;
    AST td_AST = null;
    AST t_AST = null;
    Token  i = null;
    AST i_AST = null;
    AST amvi_AST = null;
    AST v_AST = null;
    Token first = LT(1);
   
    modifiersOpt();
    mods_AST = (AST)returnAST;
    {
    switch ( LA(1)) {
    case LITERAL_class:
    case LITERAL_interface:
    case LITERAL_enum:
    case AT:
    {
      typeDefinitionInternal(mods_AST);
      td_AST = (AST)returnAST;
      if ( inputState.guessing==0 ) {
        annotationField_AST = (AST)currentAST.root;
        annotationField_AST = td_AST;
        currentAST.root = annotationField_AST;
        currentAST.child = annotationField_AST!=null &&annotationField_AST.getFirstChild()!=null ?
          annotationField_AST.getFirstChild() : annotationField_AST;
        currentAST.advanceChildToEnd();
      }
      break;
    }
    case IDENT:
    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:
    {
      typeSpec(false);
      t_AST = (AST)returnAST;
      {
      boolean synPredMatched160 = false;
      if (((LA(1)==IDENT) && (LA(2)==LPAREN))) {
        int _m160 = mark();
        synPredMatched160 = true;
        inputState.guessing++;
        try {
          {
          match(IDENT);
          match(LPAREN);
          }
        }
        catch (RecognitionException pe) {
          synPredMatched160 = false;
        }
        rewind(_m160);
inputState.guessing--;
      }
      if ( synPredMatched160 ) {
        i = LT(1);
        i_AST = astFactory.create(i);
        match(IDENT);
        match(LPAREN);
        match(RPAREN);
        {
        switch ( LA(1)) {
        case LITERAL_default:
        {
          match(LITERAL_default);
          nls();
          annotationMemberValueInitializer();
          amvi_AST = (AST)returnAST;
          break;
        }
        case RCURLY:
        case SEMI:
        case NLS:
        {
          break;
        }
        default:
        {
          throw new NoViableAltException(LT(1), getFilename());
        }
        }
        }
        if ( inputState.guessing==0 ) {
          annotationField_AST = (AST)currentAST.root;
          annotationField_AST =
          (AST)astFactory.make( (new ASTArray(5)).add(create(ANNOTATION_FIELD_DEF,"ANNOTATION_FIELD_DEF",first,LT(1))).add(mods_AST).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t_AST))).add(i_AST).add(amvi_AST));
          currentAST.root = annotationField_AST;
          currentAST.child = annotationField_AST!=null &&annotationField_AST.getFirstChild()!=null ?
            annotationField_AST.getFirstChild() : annotationField_AST;
          currentAST.advanceChildToEnd();
        }
      }
      else if ((LA(1)==IDENT||LA(1)==STRING_LITERAL) && (_tokenSet_57.member(LA(2)))) {
        variableDefinitions(mods_AST,t_AST);
        v_AST = (AST)returnAST;
        if ( inputState.guessing==0 ) {
          annotationField_AST = (AST)currentAST.root;
          annotationField_AST = v_AST;
          currentAST.root = annotationField_AST;
          currentAST.child = annotationField_AST!=null &&annotationField_AST.getFirstChild()!=null ?
            annotationField_AST.getFirstChild() : annotationField_AST;
          currentAST.advanceChildToEnd();
        }
      }
      else {
        throw new NoViableAltException(LT(1), getFilename());
      }
View Full Code Here

 
/** Guard for enumConstants.  */
  public final void enumConstantsStart() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST enumConstantsStart_AST = null;
   
    annotationsOpt();
    astFactory.addASTChild(currentAST, returnAST);
    AST tmp161_AST = null;
View Full Code Here

 
/** Comma-separated list of one or more enum constant definitions.  */
  public final void enumConstants() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST enumConstants_AST = null;
   
    enumConstant();
    astFactory.addASTChild(currentAST, returnAST);
    {
View Full Code Here

    }
   
  public final void enumConstant() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST enumConstant_AST = null;
    AST an_AST = null;
    Token  i = null;
    AST i_AST = null;
    AST a_AST = null;
    AST b_AST = null;
    Token first = LT(1);
   
    annotationsOpt();
    an_AST = (AST)returnAST;
    i = LT(1);
    i_AST = astFactory.create(i);
    match(IDENT);
    {
    switch ( LA(1)) {
    case LPAREN:
    {
      match(LPAREN);
      argList();
      a_AST = (AST)returnAST;
      match(RPAREN);
      break;
    }
    case COMMA:
    case LCURLY:
    case RCURLY:
    case SEMI:
    case NLS:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    switch ( LA(1)) {
    case LCURLY:
    {
      enumConstantBlock();
      b_AST = (AST)returnAST;
      break;
    }
    case COMMA:
    case RCURLY:
    case SEMI:
    case NLS:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
      enumConstant_AST = (AST)currentAST.root;
      enumConstant_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(ENUM_CONSTANT_DEF,"ENUM_CONSTANT_DEF",first,LT(1))).add(an_AST).add(i_AST).add(a_AST).add(b_AST));
      currentAST.root = enumConstant_AST;
      currentAST.child = enumConstant_AST!=null &&enumConstant_AST.getFirstChild()!=null ?
        enumConstant_AST.getFirstChild() : enumConstant_AST;
      currentAST.advanceChildToEnd();
    }
    returnAST = enumConstant_AST;
  }
View Full Code Here

  }
 
  public final void argList() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST argList_AST = null;
   
    Token first = LT(1);
    Token lastComma = null;
    int hls=0, hls2=0;
    boolean hasClosureList=false;
    boolean trailingComma=false;
    boolean sce=false;
   
   
    {
    switch ( LA(1)) {
    case FINAL:
    case ABSTRACT:
    case UNUSED_GOTO:
    case UNUSED_CONST:
    case UNUSED_DO:
    case STRICTFP:
    case LITERAL_package:
    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_extends:
    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 STAR:
    case LITERAL_as:
    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_default:
    case LITERAL_throws:
    case LITERAL_implements:
    case LITERAL_this:
    case LITERAL_if:
    case LITERAL_else:
    case LITERAL_while:
    case LITERAL_switch:
    case LITERAL_for:
    case LITERAL_in:
    case LITERAL_return:
    case LITERAL_break:
    case LITERAL_continue:
    case LITERAL_throw:
    case LITERAL_assert:
    case PLUS:
    case MINUS:
    case LITERAL_case:
    case LITERAL_try:
    case LITERAL_finally:
    case LITERAL_catch:
    case LITERAL_false:
    case LITERAL_instanceof:
    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:
    {
      hls=argument();
      astFactory.addASTChild(currentAST, returnAST);
      {
      switch ( LA(1)) {
      case SEMI:
      {
        {
        {
        int _cnt531=0;
        _loop531:
        do {
          if ((LA(1)==SEMI)) {
            match(SEMI);
            if ( inputState.guessing==0 ) {
              hasClosureList=true;
            }
            {
            switch ( LA(1)) {
            case FINAL:
            case ABSTRACT:
            case STRICTFP:
            case LITERAL_static:
            case LITERAL_def:
            case LBRACK:
            case IDENT:
            case STRING_LITERAL:
            case LPAREN:
            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_return:
            case LITERAL_break:
            case LITERAL_continue:
            case LITERAL_throw:
            case LITERAL_assert:
            case PLUS:
            case MINUS:
            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:
            {
              sce=strictContextExpression(true);
              astFactory.addASTChild(currentAST, returnAST);
              break;
            }
            case RBRACK:
            case RPAREN:
            case SEMI:
            {
              if ( inputState.guessing==0 ) {
                astFactory.addASTChild(currentAST,astFactory.create(EMPTY_STAT, "EMPTY_STAT"));
              }
              break;
            }
            default:
            {
              throw new NoViableAltException(LT(1), getFilename());
            }
            }
            }
          }
          else {
            if ( _cnt531>=1 ) { break _loop531; } else {throw new NoViableAltException(LT(1), getFilename());}
          }
         
          _cnt531++;
        } while (true);
        }
        if ( inputState.guessing==0 ) {
          argList_AST = (AST)currentAST.root;
          argList_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(CLOSURE_LIST,"CLOSURE_LIST",first,LT(1))).add(argList_AST));
          currentAST.root = argList_AST;
          currentAST.child = argList_AST!=null &&argList_AST.getFirstChild()!=null ?
            argList_AST.getFirstChild() : argList_AST;
          currentAST.advanceChildToEnd();
        }
        }
        break;
      }
      case RBRACK:
      case COMMA:
      case RPAREN:
      {
        {
        {
        _loop537:
        do {
          if ((LA(1)==COMMA)) {
            if ( inputState.guessing==0 ) {
              lastComma = LT(1);
            }
            match(COMMA);
            {
            switch ( LA(1)) {
            case FINAL:
            case ABSTRACT:
            case UNUSED_GOTO:
            case UNUSED_CONST:
            case UNUSED_DO:
            case STRICTFP:
            case LITERAL_package:
            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_extends:
            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 STAR:
            case LITERAL_as:
            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_default:
            case LITERAL_throws:
            case LITERAL_implements:
            case LITERAL_this:
            case LITERAL_if:
            case LITERAL_else:
            case LITERAL_while:
            case LITERAL_switch:
            case LITERAL_for:
            case LITERAL_in:
            case LITERAL_return:
            case LITERAL_break:
            case LITERAL_continue:
            case LITERAL_throw:
            case LITERAL_assert:
            case PLUS:
            case MINUS:
            case LITERAL_case:
            case LITERAL_try:
            case LITERAL_finally:
            case LITERAL_catch:
            case LITERAL_false:
            case LITERAL_instanceof:
            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:
            {
              {
              hls2=argument();
              astFactory.addASTChild(currentAST, returnAST);
              if ( inputState.guessing==0 ) {
                hls |= hls2;
              }
              }
              break;
            }
            case RBRACK:
            case COMMA:
            case RPAREN:
            {
              {
              if ( inputState.guessing==0 ) {
                if (trailingComma) throw new NoViableAltException(lastComma, getFilename());
                trailingComma=true;
               
              }
              }
              break;
            }
            default:
            {
              throw new NoViableAltException(LT(1), getFilename());
            }
            }
            }
          }
          else {
            break _loop537;
          }
         
        } while (true);
        }
        if ( inputState.guessing==0 ) {
          argList_AST = (AST)currentAST.root;
          argList_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(ELIST,"ELIST",first,LT(1))).add(argList_AST));
          currentAST.root = argList_AST;
          currentAST.child = argList_AST!=null &&argList_AST.getFirstChild()!=null ?
            argList_AST.getFirstChild() : argList_AST;
          currentAST.advanceChildToEnd();
        }
        }
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      break;
    }
    case RBRACK:
    case RPAREN:
    {
      {
      if ( inputState.guessing==0 ) {
        argList_AST = (AST)currentAST.root;
        argList_AST = create(ELIST,"ELIST",first,LT(1));
        currentAST.root = argList_AST;
        currentAST.child = argList_AST!=null &&argList_AST.getFirstChild()!=null ?
          argList_AST.getFirstChild() : argList_AST;
        currentAST.advanceChildToEnd();
      }
      }
      break;
    }
    default:
View Full Code Here

  }
 
  public final void enumConstantBlock() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST enumConstantBlock_AST = null;
    Token first = LT(1);
   
    match(LCURLY);
    {
    switch ( LA(1)) {
    case FINAL:
    case ABSTRACT:
    case STRICTFP:
    case LITERAL_static:
    case LITERAL_def:
    case IDENT:
    case LT:
    case LITERAL_class:
    case LITERAL_interface:
    case LITERAL_enum:
    case AT:
    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:
    {
      enumConstantField();
      astFactory.addASTChild(currentAST, returnAST);
      break;
    }
    case RCURLY:
    case SEMI:
    case NLS:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    {
    _loop169:
    do {
      if ((LA(1)==SEMI||LA(1)==NLS)) {
        sep();
        {
        switch ( LA(1)) {
        case FINAL:
        case ABSTRACT:
        case STRICTFP:
        case LITERAL_static:
        case LITERAL_def:
        case IDENT:
        case LT:
        case LITERAL_class:
        case LITERAL_interface:
        case LITERAL_enum:
        case AT:
        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:
        {
          enumConstantField();
          astFactory.addASTChild(currentAST, returnAST);
          break;
        }
        case RCURLY:
        case SEMI:
        case NLS:
        {
          break;
        }
        default:
        {
          throw new NoViableAltException(LT(1), getFilename());
        }
        }
        }
      }
      else {
        break _loop169;
      }
     
    } while (true);
    }
    match(RCURLY);
    if ( inputState.guessing==0 ) {
      enumConstantBlock_AST = (AST)currentAST.root;
      enumConstantBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(enumConstantBlock_AST));
      currentAST.root = enumConstantBlock_AST;
      currentAST.child = enumConstantBlock_AST!=null &&enumConstantBlock_AST.getFirstChild()!=null ?
        enumConstantBlock_AST.getFirstChild() : enumConstantBlock_AST;
      currentAST.advanceChildToEnd();
    }
    enumConstantBlock_AST = (AST)currentAST.root;
    returnAST = enumConstantBlock_AST;
  }
View Full Code Here

  }
 
  public final void enumConstantField() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST enumConstantField_AST = null;
    AST mods_AST = null;
    AST td_AST = null;
    AST tp_AST = null;
    AST t_AST = null;
    AST param_AST = null;
    AST tc_AST = null;
    AST s2_AST = null;
    AST v_AST = null;
    AST s4_AST = null;
    Token first = LT(1);
   
    switch ( LA(1)) {
    case FINAL:
    case ABSTRACT:
    case STRICTFP:
    case LITERAL_static:
    case LITERAL_def:
    case IDENT:
    case LT:
    case LITERAL_class:
    case LITERAL_interface:
    case LITERAL_enum:
    case AT:
    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:
    {
      modifiersOpt();
      mods_AST = (AST)returnAST;
      {
      switch ( LA(1)) {
      case LITERAL_class:
      case LITERAL_interface:
      case LITERAL_enum:
      case AT:
      {
        typeDefinitionInternal(mods_AST);
        td_AST = (AST)returnAST;
        if ( inputState.guessing==0 ) {
          enumConstantField_AST = (AST)currentAST.root;
          enumConstantField_AST = td_AST;
          currentAST.root = enumConstantField_AST;
          currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
            enumConstantField_AST.getFirstChild() : enumConstantField_AST;
          currentAST.advanceChildToEnd();
        }
        break;
      }
      case IDENT:
      case LT:
      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:
      {
        {
        switch ( LA(1)) {
        case LT:
        {
          typeParameters();
          tp_AST = (AST)returnAST;
          break;
        }
        case IDENT:
        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:
        {
          break;
        }
        default:
        {
          throw new NoViableAltException(LT(1), getFilename());
        }
        }
        }
        typeSpec(false);
        t_AST = (AST)returnAST;
        {
        boolean synPredMatched175 = false;
        if (((LA(1)==IDENT) && (LA(2)==LPAREN))) {
          int _m175 = mark();
          synPredMatched175 = true;
          inputState.guessing++;
          try {
            {
            match(IDENT);
            match(LPAREN);
            }
          }
          catch (RecognitionException pe) {
            synPredMatched175 = false;
          }
          rewind(_m175);
inputState.guessing--;
        }
        if ( synPredMatched175 ) {
          AST tmp174_AST = null;
          tmp174_AST = astFactory.create(LT(1));
          match(IDENT);
          match(LPAREN);
          parameterDeclarationList();
          param_AST = (AST)returnAST;
          match(RPAREN);
          {
          boolean synPredMatched178 = false;
          if (((LA(1)==LITERAL_throws||LA(1)==NLS) && (_tokenSet_28.member(LA(2))))) {
            int _m178 = mark();
            synPredMatched178 = true;
            inputState.guessing++;
            try {
              {
              nls();
              match(LITERAL_throws);
              }
            }
            catch (RecognitionException pe) {
              synPredMatched178 = false;
            }
            rewind(_m178);
inputState.guessing--;
          }
          if ( synPredMatched178 ) {
            throwsClause();
            tc_AST = (AST)returnAST;
          }
          else if ((_tokenSet_63.member(LA(1))) && (_tokenSet_64.member(LA(2)))) {
          }
          else {
            throw new NoViableAltException(LT(1), getFilename());
          }
         
          }
          {
          switch ( LA(1)) {
          case LCURLY:
          {
            compoundStatement();
            s2_AST = (AST)returnAST;
            break;
          }
          case RCURLY:
          case SEMI:
          case NLS:
          {
            break;
          }
          default:
          {
            throw new NoViableAltException(LT(1), getFilename());
          }
          }
          }
          if ( inputState.guessing==0 ) {
            enumConstantField_AST = (AST)currentAST.root;
            enumConstantField_AST = (AST)astFactory.make( (new ASTArray(8)).add(create(METHOD_DEF,"METHOD_DEF",first,LT(1))).add(mods_AST).add(tp_AST).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t_AST))).add(tmp174_AST).add(param_AST).add(tc_AST).add(s2_AST));
            currentAST.root = enumConstantField_AST;
            currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
              enumConstantField_AST.getFirstChild() : enumConstantField_AST;
            currentAST.advanceChildToEnd();
          }
        }
        else if ((LA(1)==IDENT||LA(1)==STRING_LITERAL) && (_tokenSet_57.member(LA(2)))) {
          variableDefinitions(mods_AST,t_AST);
          v_AST = (AST)returnAST;
          if ( inputState.guessing==0 ) {
            enumConstantField_AST = (AST)currentAST.root;
            enumConstantField_AST = v_AST;
            currentAST.root = enumConstantField_AST;
            currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
              enumConstantField_AST.getFirstChild() : enumConstantField_AST;
            currentAST.advanceChildToEnd();
          }
        }
        else {
          throw new NoViableAltException(LT(1), getFilename());
        }
       
        }
        break;
      }
      default:
      {
        throw new NoViableAltException(LT(1), getFilename());
      }
      }
      }
      break;
    }
    case LCURLY:
    {
      compoundStatement();
      s4_AST = (AST)returnAST;
      if ( inputState.guessing==0 ) {
        enumConstantField_AST = (AST)currentAST.root;
        enumConstantField_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(INSTANCE_INIT,"INSTANCE_INIT",first,LT(1))).add(s4_AST));
        currentAST.root = enumConstantField_AST;
        currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
          enumConstantField_AST.getFirstChild() : enumConstantField_AST;
        currentAST.advanceChildToEnd();
      }
      break;
    }
    default:
    {
View Full Code Here

*  are impossible to tell apart without backtracking.
*/
  public final void parameterDeclarationList() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST parameterDeclarationList_AST = null;
    Token first = LT(1);
   
    {
    switch ( LA(1)) {
    case FINAL:
    case LITERAL_def:
    case IDENT:
    case AT:
    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 TRIPLE_DOT:
    {
      parameterDeclaration();
      astFactory.addASTChild(currentAST, returnAST);
      {
      _loop256:
      do {
        if ((LA(1)==COMMA)) {
          match(COMMA);
          nls();
          parameterDeclaration();
          astFactory.addASTChild(currentAST, returnAST);
        }
        else {
          break _loop256;
        }
       
      } while (true);
      }
      break;
    }
    case RPAREN:
    case CLOSABLE_BLOCK_OP:
    case NLS:
    {
      break;
    }
    default:
    {
      throw new NoViableAltException(LT(1), getFilename());
    }
    }
    }
    if ( inputState.guessing==0 ) {
      parameterDeclarationList_AST = (AST)currentAST.root;
      parameterDeclarationList_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(PARAMETERS,"PARAMETERS",first,LT(1))).add(parameterDeclarationList_AST));
      currentAST.root = parameterDeclarationList_AST;
      currentAST.child = parameterDeclarationList_AST!=null &&parameterDeclarationList_AST.getFirstChild()!=null ?
        parameterDeclarationList_AST.getFirstChild() : parameterDeclarationList_AST;
      currentAST.advanceChildToEnd();
    }
    parameterDeclarationList_AST = (AST)currentAST.root;
    returnAST = parameterDeclarationList_AST;
  }
View Full Code Here

  }
 
  public final void throwsClause() throws RecognitionException, TokenStreamException {
   
    returnAST = null;
    ASTPair currentAST = new ASTPair();
    AST throwsClause_AST = null;
   
    nls();
    AST tmp178_AST = null;
    tmp178_AST = astFactory.create(LT(1));
View Full Code Here

TOP

Related Classes of antlr.ASTPair

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.