code: protected JCTree resource() {
          int startPos = token.pos;
          if (token.kind == FINAL || token.kind == MONKEYS_AT) {
              JCModifiers mods = optFinal(Flags.FINAL);
              JCExpression t = parseType();
              return variableDeclaratorRest(token.pos, mods, t, ident(), true, null);
          }
          JCExpression t = term(EXPR | TYPE);
          if ((lastmode & TYPE) != 0 && LAX_IDENTIFIER.accepts(token.kind)) {
              JCModifiers mods = toP(F.at(startPos).Modifiers(Flags.FINAL));
              return variableDeclaratorRest(token.pos, mods, t, ident(), true, null);
          } else {
              checkVariableInTryWithResources(startPos);
              if (!t.hasTag(IDENT) && !t.hasTag(SELECT)) {
                  log.error(t.pos(), "try.with.resources.expr.needs.var");
              }
  
              return t;
          }
      }
docs: Resource = VariableModifiersOpt Type VariableDeclaratorId "=" Expression
  | Expression