public final AntlrPilarParser.model_return model()
      throws RecognitionException {
    AntlrPilarParser.model_return retval = new AntlrPilarParser.model_return();
    retval.start = input.LT(1);
    int model_StartIndex = input.index();
    Object root_0 = null;

    Token EOF24 = null;
    AntlrPilarParser.annotationList_return annotationList21 = null;

    AntlrPilarParser.packageElement_return packageElement22 = null;

    AntlrPilarParser.packageDeclaration_return packageDeclaration23 = null;

    Object EOF24_tree = null;
    RewriteRuleTokenStream stream_EOF = new RewriteRuleTokenStream(adaptor,
        "token EOF");
    RewriteRuleSubtreeStream stream_packageElement = new RewriteRuleSubtreeStream(
        adaptor, "rule packageElement");
    RewriteRuleSubtreeStream stream_packageDeclaration = new RewriteRuleSubtreeStream(
        adaptor, "rule packageDeclaration");
    RewriteRuleSubtreeStream stream_annotationList = new RewriteRuleSubtreeStream(
        adaptor, "rule annotationList");
    try {
      if (state.backtracking > 0 && alreadyParsedRule(input, 11)) {
        return retval;
      }
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:206:2: ( annotationList ( packageElement )* ( packageDeclaration )* EOF -> ^( MODEL annotationList ^( LIST ( packageElement )* ) ^( LIST ( packageDeclaration )* ) ) )
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:206:4: annotationList ( packageElement )* ( packageDeclaration )* EOF
      {
        pushFollow(FOLLOW_annotationList_in_model1076);
        annotationList21 = annotationList();

        state._fsp--;
        if (state.failed) return retval;
        if (state.backtracking == 0)
          stream_annotationList.add(annotationList21.getTree());
        // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:207:4: ( packageElement )*
        loop1: do {
          int alt1 = 2;
          int LA1_0 = input.LA(1);

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

          switch (alt1) {
            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_model1081);
              packageElement22 = packageElement();

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

            }
              break;

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

        // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:208:4: ( packageDeclaration )*
        loop2: do {
          int alt2 = 2;
          int LA2_0 = input.LA(1);

          if ((LA2_0 == 174)) {
            alt2 = 1;
          }

          switch (alt2) {
            case 1:
            // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:0:0: packageDeclaration
            {
              pushFollow(FOLLOW_packageDeclaration_in_model1087);
              packageDeclaration23 = packageDeclaration();

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

            }
              break;

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

        EOF24 = (Token) match(input, EOF, FOLLOW_EOF_in_model1111);
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_EOF.add(EOF24);

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

              adaptor.addChild(root_1, stream_annotationList.nextTree());
              // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:209:67: ^( 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:209:74: ( packageElement )*
                while (stream_packageElement.hasNext()) {
                  adaptor.addChild(root_2, stream_packageElement.nextTree());

                }
                stream_packageElement.reset();

                adaptor.addChild(root_1, root_2);
              }
              // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:209:91: ^( LIST ( packageDeclaration )* )
              {
                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:209:98: ( packageDeclaration )*
                while (stream_packageDeclaration.hasNext()) {
                  adaptor
                      .addChild(root_2, stream_packageDeclaration.nextTree());

                }
                stream_packageDeclaration.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, 11, model_StartIndex);
      }
    }
    return retval;
  }