public final AntlrPilarParser.attributeFragment_return attributeFragment()
      throws RecognitionException {
    AntlrPilarParser.attributeFragment_return retval = new AntlrPilarParser.attributeFragment_return();
    retval.start = input.LT(1);
    int attributeFragment_StartIndex = input.index();
    Object root_0 = null;

    Token t = null;
    Token char_literal108 = null;
    AntlrPilarParser.annotationList_return annotationList107 = null;

    AntlrPilarParser.name_return name109 = null;

    Object t_tree = null;
    Object char_literal108_tree = null;
    RewriteRuleTokenStream stream_173 = new RewriteRuleTokenStream(adaptor,
        "token 173");
    RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,
        "token ID");
    RewriteRuleSubtreeStream stream_annotationList = new RewriteRuleSubtreeStream(
        adaptor, "rule annotationList");
    RewriteRuleSubtreeStream stream_name = new RewriteRuleSubtreeStream(
        adaptor, "rule name");
    try {
      if (state.backtracking > 0 && alreadyParsedRule(input, 32)) {
        return retval;
      }
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:319:2: (t= ID annotationList ( '=' name )? -> ^( ATTRIBUTE_FRAGMENT[$t] ID annotationList ^( OPTION ( name )? ) ) )
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:319:4: t= ID annotationList ( '=' name )?
      {
        t = (Token) match(input, ID, FOLLOW_ID_in_attributeFragment2482);
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_ID.add(t);

        pushFollow(FOLLOW_annotationList_in_attributeFragment2484);
        annotationList107 = annotationList();

        state._fsp--;
        if (state.failed) return retval;
        if (state.backtracking == 0)
          stream_annotationList.add(annotationList107.getTree());
        // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:319:24: ( '=' name )?
        int alt28 = 2;
        int LA28_0 = input.LA(1);

        if ((LA28_0 == 173)) {
          alt28 = 1;
        }
        switch (alt28) {
          case 1:
          // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:319:26: '=' name
          {
            char_literal108 = (Token) match(
                input,
                173,
                FOLLOW_173_in_attributeFragment2488);
            if (state.failed) return retval;
            if (state.backtracking == 0) stream_173.add(char_literal108);

            pushFollow(FOLLOW_name_in_attributeFragment2490);
            name109 = name();

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

          }
            break;

        }

        // AST REWRITE
        // elements: name, annotationList, ID
        // 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();
          // 319:41: -> ^( ATTRIBUTE_FRAGMENT[$t] ID annotationList ^( OPTION ( name )? ) )
          {
            // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:319:44: ^( ATTRIBUTE_FRAGMENT[$t] ID annotationList ^( OPTION ( name )? ) )
            {
              Object root_1 = (Object) adaptor.nil();
              root_1 = (Object) adaptor.becomeRoot(
                  (Object) adaptor.create(ATTRIBUTE_FRAGMENT, t),
                  root_1);

              adaptor.addChild(root_1, stream_ID.nextNode());
              adaptor.addChild(root_1, stream_annotationList.nextTree());
              // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:319:87: ^( OPTION ( name )? )
              {
                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:319:96: ( name )?
                if (stream_name.hasNext()) {
                  adaptor.addChild(root_2, stream_name.nextTree());

                }
                stream_name.reset();

                adaptor.addChild(root_1, root_2);
              }

              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, 32, attributeFragment_StartIndex);
      }
    }
    return retval;
  }