public final AntlrPilarParser.extParam_return extParam()
      throws RecognitionException {
    AntlrPilarParser.extParam_return retval = new AntlrPilarParser.extParam_return();
    retval.start = input.LT(1);
    int extParam_StartIndex = input.index();
    Object root_0 = null;

    Token ID205 = null;
    AntlrPilarParser.type_return type204 = null;

    AntlrPilarParser.annotationList_return annotationList206 = null;

    Object ID205_tree = null;
    RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,
        "token ID");
    RewriteRuleSubtreeStream stream_annotationList = new RewriteRuleSubtreeStream(
        adaptor, "rule annotationList");
    RewriteRuleSubtreeStream stream_type = new RewriteRuleSubtreeStream(
        adaptor, "rule type");
    try {
      if (state.backtracking > 0 && alreadyParsedRule(input, 52)) {
        return retval;
      }
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:435:2: ( ( type )? ( ID )? annotationList -> ^( EXT_PARAM ^( OPTION ( type )? ) ^( OPTION ( ID )? ) annotationList ) )
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:435:4: ( type )? ( ID )? annotationList
      {
        // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:435:4: ( type )?
        int alt61 = 2;
        alt61 = dfa61.predict(input);
        switch (alt61) {
          case 1:
          // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:0:0: type
          {
            pushFollow(FOLLOW_type_in_extParam3790);
            type204 = type();

            state._fsp--;
            if (state.failed) return retval;
            if (state.backtracking == 0) stream_type.add(type204.getTree());

          }
            break;

        }

        // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:435:10: ( ID )?
        int alt62 = 2;
        int LA62_0 = input.LA(1);

        if ((LA62_0 == ID)) {
          int LA62_1 = input.LA(2);

          if ((synpred74_AntlrPilar())) {
            alt62 = 1;
          }
        }
        switch (alt62) {
          case 1:
          // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:0:0: ID
          {
            ID205 = (Token) match(input, ID, FOLLOW_ID_in_extParam3793);
            if (state.failed) return retval;
            if (state.backtracking == 0) stream_ID.add(ID205);

          }
            break;

        }

        pushFollow(FOLLOW_annotationList_in_extParam3796);
        annotationList206 = annotationList();

        state._fsp--;
        if (state.failed) return retval;
        if (state.backtracking == 0)
          stream_annotationList.add(annotationList206.getTree());

        // AST REWRITE
        // elements: ID, annotationList, type
        // token labels: 
        // rule labels: retval
        // token list labels: 
        // rule list labels: 
        // wildcard labels: 
        if (state.backtracking == 0) {
          retval.tree = root_0;
          RewriteRuleSubtreeStream stream_retval = new RewriteRuleSubtreeStream(
              adaptor, "rule retval", retval != null ? retval.tree : null);

          root_0 = (Object) adaptor.nil();
          // 435:41: -> ^( EXT_PARAM ^( OPTION ( type )? ) ^( OPTION ( ID )? ) annotationList )
          {
            // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:435:44: ^( EXT_PARAM ^( OPTION ( type )? ) ^( OPTION ( ID )? ) annotationList )
            {
              Object root_1 = (Object) adaptor.nil();
              root_1 = (Object) adaptor.becomeRoot(
                  (Object) adaptor.create(EXT_PARAM, "EXT_PARAM"),
                  root_1);

              // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:435:56: ^( OPTION ( type )? )
              {
                Object root_2 = (Object) adaptor.nil();
                root_2 = (Object) adaptor.becomeRoot(
                    (Object) adaptor.create(OPTION, "OPTION"),
                    root_2);

                // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:435:65: ( type )?
                if (stream_type.hasNext()) {
                  adaptor.addChild(root_2, stream_type.nextTree());

                }
                stream_type.reset();

                adaptor.addChild(root_1, root_2);
              }
              // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:435:72: ^( OPTION ( ID )? )
              {
                Object root_2 = (Object) adaptor.nil();
                root_2 = (Object) adaptor.becomeRoot(
                    (Object) adaptor.create(OPTION, "OPTION"),
                    root_2);

                // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:435:81: ( ID )?
                if (stream_ID.hasNext()) {
                  adaptor.addChild(root_2, stream_ID.nextNode());

                }
                stream_ID.reset();

                adaptor.addChild(root_1, root_2);
              }
              adaptor.addChild(root_1, stream_annotationList.nextTree());

              adaptor.addChild(root_0, root_1);
            }

          }

          retval.tree = root_0;
        }
      }

      retval.stop = input.LT(-1);

      if (state.backtracking == 0) {

        retval.tree = (Object) adaptor.rulePostProcessing(root_0);
        adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
      }
    } catch (RecognitionException re) {
      reportError(re);
      recover(input, re);
      retval.tree = (Object) adaptor.errorNode(
          input,
          retval.start,
          input.LT(-1),
          re);

    } finally {
      if (state.backtracking > 0) {
        memoize(input, 52, extParam_StartIndex);
      }
    }
    return retval;
  }