/** EnumDeclaration = ENUM Ident [IMPLEMENTS TypeList] EnumBody * @param mods The modifiers starting the enum declaration * @param dc The documentation comment for the enum, or null. */ JCClassDecl enumDeclaration(JCModifiers mods, String dc) { int pos = S.pos(); accept(ENUM); Name name = ident(); List<JCExpression> implementing = List.nil(); if (S.token() == IMPLEMENTS) { S.nextToken(); implementing = typeList(); } List<JCTree> defs = enumBody(name); JCModifiers newMods = F.at(mods.pos).Modifiers(mods.flags|Flags.ENUM, mods.annotations); JCClassDecl result = toP(F.at(pos). ClassDef(newMods, name, List.<JCTypeParameter>nil(), null, implementing, defs)); attach(result, dc); return result; }
/** EnumDeclaration = ENUM Ident [IMPLEMENTS TypeList] EnumBody * @param mods The modifiers starting the enum declaration * @param dc The documentation comment for the enum, or null. */ JCClassDecl enumDeclaration(JCModifiers mods, String dc) { int pos = S.pos(); accept(ENUM); Name name = ident(); List<JCExpression> implementing = List.nil(); if (S.token() == IMPLEMENTS) { S.nextToken(); implementing = typeList(); } List<JCTree> defs = enumBody(name); JCModifiers newMods = F.at(mods.pos).Modifiers(mods.flags|Flags.ENUM, mods.annotations); JCClassDecl result = toP(F.at(pos). ClassDef(newMods, name, List.<JCTypeParameter>nil(), null, implementing, defs)); attach(result, dc); return result; }