public final AntlrPilarParser.enumDeclaration_return enumDeclaration()
      throws RecognitionException {
    AntlrPilarParser.enumDeclaration_return retval = new AntlrPilarParser.enumDeclaration_return();
    retval.start = input.LT(1);
    int enumDeclaration_StartIndex = input.index();
    Object root_0 = null;

    Token t = null;
    Token ID68 = null;
    Token char_literal70 = null;
    Token char_literal72 = null;
    Token char_literal74 = null;
    AntlrPilarParser.annotationList_return annotationList69 = null;

    AntlrPilarParser.enumElement_return enumElement71 = null;

    AntlrPilarParser.enumElement_return enumElement73 = null;

    Object t_tree = null;
    Object ID68_tree = null;
    Object char_literal70_tree = null;
    Object char_literal72_tree = null;
    Object char_literal74_tree = null;
    RewriteRuleTokenStream stream_172 = new RewriteRuleTokenStream(adaptor,
        "token 172");
    RewriteRuleTokenStream stream_ID = new RewriteRuleTokenStream(adaptor,
        "token ID");
    RewriteRuleTokenStream stream_179 = new RewriteRuleTokenStream(adaptor,
        "token 179");
    RewriteRuleTokenStream stream_178 = new RewriteRuleTokenStream(adaptor,
        "token 178");
    RewriteRuleTokenStream stream_177 = new RewriteRuleTokenStream(adaptor,
        "token 177");
    RewriteRuleSubtreeStream stream_annotationList = new RewriteRuleSubtreeStream(
        adaptor, "rule annotationList");
    RewriteRuleSubtreeStream stream_enumElement = new RewriteRuleSubtreeStream(
        adaptor, "rule enumElement");
    try {
      if (state.backtracking > 0 && alreadyParsedRule(input, 22)) {
        return retval;
      }
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:271:2: (t= 'enum' ID annotationList '{' enumElement ( ',' enumElement )* '}' -> ^( ENUM[$t] ID annotationList ^( LIST ( enumElement )+ ) ) )
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:271:4: t= 'enum' ID annotationList '{' enumElement ( ',' enumElement )* '}'
      {
        t = (Token) match(input, 179, FOLLOW_179_in_enumDeclaration1959);
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_179.add(t);

        ID68 = (Token) match(input, ID, FOLLOW_ID_in_enumDeclaration1961);
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_ID.add(ID68);

        pushFollow(FOLLOW_annotationList_in_enumDeclaration1963);
        annotationList69 = annotationList();

        state._fsp--;
        if (state.failed) return retval;
        if (state.backtracking == 0)
          stream_annotationList.add(annotationList69.getTree());
        char_literal70 = (Token) match(
            input,
            177,
            FOLLOW_177_in_enumDeclaration1968);
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_177.add(char_literal70);

        pushFollow(FOLLOW_enumElement_in_enumDeclaration1970);
        enumElement71 = enumElement();

        state._fsp--;
        if (state.failed) return retval;
        if (state.backtracking == 0)
          stream_enumElement.add(enumElement71.getTree());
        // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:273:4: ( ',' enumElement )*
        loop18: do {
          int alt18 = 2;
          int LA18_0 = input.LA(1);

          if ((LA18_0 == 172)) {
            alt18 = 1;
          }

          switch (alt18) {
            case 1:
            // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:273:6: ',' enumElement
            {
              char_literal72 = (Token) match(
                  input,
                  172,
                  FOLLOW_172_in_enumDeclaration1977);
              if (state.failed) return retval;
              if (state.backtracking == 0) stream_172.add(char_literal72);

              pushFollow(FOLLOW_enumElement_in_enumDeclaration1979);
              enumElement73 = enumElement();

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

            }
              break;

            default:
              break loop18;
          }
        } while (true);

        char_literal74 = (Token) match(
            input,
            178,
            FOLLOW_178_in_enumDeclaration1984);
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_178.add(char_literal74);

        // AST REWRITE
        // elements: annotationList, ID, enumElement
        // 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();
          // 273:41: -> ^( ENUM[$t] ID annotationList ^( LIST ( enumElement )+ ) )
          {
            // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:273:44: ^( ENUM[$t] ID annotationList ^( LIST ( enumElement )+ ) )
            {
              Object root_1 = (Object) adaptor.nil();
              root_1 = (Object) adaptor.becomeRoot(
                  (Object) adaptor.create(ENUM, 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:273:73: ^( LIST ( enumElement )+ )
              {
                Object root_2 = (Object) adaptor.nil();
                root_2 = (Object) adaptor.becomeRoot(
                    (Object) adaptor.create(LIST, "LIST"),
                    root_2);

                if (!(stream_enumElement.hasNext())) {
                  throw new RewriteEarlyExitException();
                }
                while (stream_enumElement.hasNext()) {
                  adaptor.addChild(root_2, stream_enumElement.nextTree());

                }
                stream_enumElement.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, 22, enumDeclaration_StartIndex);
      }
    }
    return retval;
  }