public final AntlrPilarParser.packageDeclaration_return packageDeclaration()
      throws RecognitionException {
    AntlrPilarParser.packageDeclaration_return retval = new AntlrPilarParser.packageDeclaration_return();
    retval.start = input.LT(1);
    int packageDeclaration_StartIndex = input.index();
    Object root_0 = null;

    Token t = null;
    Token char_literal48 = null;
    AntlrPilarParser.name_return name46 = null;

    AntlrPilarParser.annotationList_return annotationList47 = null;

    AntlrPilarParser.packageElement_return packageElement49 = null;

    Object t_tree = null;
    Object char_literal48_tree = null;
    RewriteRuleTokenStream stream_174 = new RewriteRuleTokenStream(adaptor,
        "token 174");
    RewriteRuleTokenStream stream_175 = new RewriteRuleTokenStream(adaptor,
        "token 175");
    RewriteRuleSubtreeStream stream_packageElement = new RewriteRuleSubtreeStream(
        adaptor, "rule packageElement");
    RewriteRuleSubtreeStream stream_name = new RewriteRuleSubtreeStream(
        adaptor, "rule name");
    RewriteRuleSubtreeStream stream_annotationList = new RewriteRuleSubtreeStream(
        adaptor, "rule annotationList");
    try {
      if (state.backtracking > 0 && alreadyParsedRule(input, 18)) {
        return retval;
      }
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:244:2: (t= 'package' name annotationList ';' ( packageElement )* -> ^( PACKAGE[$t] name annotationList ^( LIST ( packageElement )* ) ) )
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:244:4: t= 'package' name annotationList ';' ( packageElement )*
      {
        t = (Token) match(input, 174, FOLLOW_174_in_packageDeclaration1731);
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_174.add(t);

        pushFollow(FOLLOW_name_in_packageDeclaration1733);
        name46 = name();

        state._fsp--;
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_name.add(name46.getTree());
        pushFollow(FOLLOW_annotationList_in_packageDeclaration1735);
        annotationList47 = annotationList();

        state._fsp--;
        if (state.failed) return retval;
        if (state.backtracking == 0)
          stream_annotationList.add(annotationList47.getTree());
        char_literal48 = (Token) match(
            input,
            175,
            FOLLOW_175_in_packageDeclaration1737);
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_175.add(char_literal48);

        // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:245:4: ( packageElement )*
        loop15: do {
          int alt15 = 2;
          int LA15_0 = input.LA(1);

          if ((LA15_0 == 176 || (LA15_0 >= 179 && LA15_0 <= 181)
              || (LA15_0 >= 183 && LA15_0 <= 184) || (LA15_0 >= 186 && LA15_0 <= 188))) {
            alt15 = 1;
          }

          switch (alt15) {
            case 1:
            // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:0:0: packageElement
            {
              pushFollow(FOLLOW_packageElement_in_packageDeclaration1742);
              packageElement49 = packageElement();

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

            }
              break;

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

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

              adaptor.addChild(root_1, stream_name.nextTree());
              adaptor.addChild(root_1, stream_annotationList.nextTree());
              // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:245:78: ^( LIST ( packageElement )* )
              {
                Object root_2 = (Object) adaptor.nil();
                root_2 = (Object) adaptor.becomeRoot(
                    (Object) adaptor.create(LIST, "LIST"),
                    root_2);

                // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:245:85: ( packageElement )*
                while (stream_packageElement.hasNext()) {
                  adaptor.addChild(root_2, stream_packageElement.nextTree());

                }
                stream_packageElement.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, 18, packageDeclaration_StartIndex);
      }
    }
    return retval;
  }