public final AntlrPilarParser.typeFile_return typeFile()
      throws RecognitionException {
    AntlrPilarParser.typeFile_return retval = new AntlrPilarParser.typeFile_return();
    retval.start = input.LT(1);
    int typeFile_StartIndex = input.index();
    Object root_0 = null;

    Token EOF20 = null;
    AntlrPilarParser.type_return type19 = null;

    Object EOF20_tree = null;
    RewriteRuleTokenStream stream_EOF = new RewriteRuleTokenStream(adaptor,
        "token EOF");
    RewriteRuleSubtreeStream stream_type = new RewriteRuleSubtreeStream(
        adaptor, "rule type");
    try {
      if (state.backtracking > 0 && alreadyParsedRule(input, 10)) {
        return retval;
      }
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:202:2: ( type EOF -> type )
      // /Users/robby/Repositories/sireum-parser/sireum-parser/src/main/java/org/sireum/pilar/parser/AntlrPilar.g:202:4: type EOF
      {
        pushFollow(FOLLOW_type_in_typeFile1031);
        type19 = type();

        state._fsp--;
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_type.add(type19.getTree());
        EOF20 = (Token) match(input, EOF, FOLLOW_EOF_in_typeFile1033);
        if (state.failed) return retval;
        if (state.backtracking == 0) stream_EOF.add(EOF20);

        // AST REWRITE
        // elements: 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();
          // 202:41: -> type
          {
            adaptor.addChild(root_0, stream_type.nextTree());

          }

          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, 10, typeFile_StartIndex);
      }
    }
    return retval;
  }