code: JCStatement parseStatementAsBlock() {
          int pos = token.pos;
          List<JCStatement> stats = blockStatement();
          if (stats.isEmpty()) {
              JCErroneous e = F.at(pos).Erroneous();
              error(e, "illegal.start.of.stmt");
              return F.at(pos).Exec(e);
          } else {
              JCStatement first = stats.head;
              String error = null;
              switch (first.getTag()) {
              case CLASSDEF:
                  error = "class.not.allowed";
                  break;
              case VARDEF:
                  error = "variable.not.allowed";
                  break;
              }
              if (error != null) {
                  error(first, error);
                  List<JCBlock> blist = List.of(F.at(first.pos).Block(0, stats));
                  return toP(F.at(pos).Exec(F.at(first.pos).Erroneous(blist)));
              }
              return first;
          }
      }
docs: /*
  Parse a Statement (JLS 14.5). As an enhancement to improve error recovery,
  this method will also recognize variable and class declarations (which are
  not legal for a Statement) by delegating the parsing to BlockStatement (JLS 14.2).
  If any illegal declarations are found, they will be wrapped in an erroneous tree,
  and an error will be produced by this method.