code: JCTree enumeratorDeclaration(Name enumName) {
          Comment dc = token.comment(CommentStyle.JAVADOC);
          int flags = Flags.PUBLIC|Flags.STATIC|Flags.FINAL|Flags.ENUM;
          if (token.deprecatedFlag()) {
              flags |= Flags.DEPRECATED;
          }
          int pos = token.pos;
          List<JCAnnotation> annotations = annotationsOpt(Tag.ANNOTATION);
          JCModifiers mods = F.at(annotations.isEmpty() ? Position.NOPOS : pos).Modifiers(flags, annotations);
          List<JCExpression> typeArgs = typeArgumentsOpt();
          int identPos = token.pos;
          Name name = ident();
          int createPos = token.pos;
          List<JCExpression> args = (token.kind == LPAREN)
              ? arguments() : List.nil();
          JCClassDecl body = null;
          if (token.kind == LBRACE) {
              JCModifiers mods1 = F.at(Position.NOPOS).Modifiers(Flags.ENUM);
              List<JCTree> defs = classOrInterfaceBody(names.empty, false);
              body = toP(F.at(identPos).AnonymousClassDef(mods1, defs));
          }
          if (args.isEmpty() && body == null)
              createPos = identPos;
          JCIdent ident = F.at(identPos).Ident(enumName);
          JCNewClass create = F.at(createPos).NewClass(null, typeArgs, ident, args, body);
          if (createPos != identPos)
              storeEnd(create, S.prevToken().endPos);
          ident = F.at(identPos).Ident(enumName);
          JCTree result = toP(F.at(pos).VarDef(mods, name, ident, create));
          attach(result, dc);
          return result;
      }
docs: EnumeratorDeclaration = AnnotationsOpt [TypeArguments] IDENTIFIER [ Arguments ] [ "{" ClassBody "}" ]