code: protected JCClassDecl classDeclaration(JCModifiers mods, Comment dc) {
          int pos = token.pos;
          accept(CLASS);
          Name name = ident();
  
          List<JCTypeParameter> typarams = typeParametersOpt();
  
          JCExpression extending = null;
          if (token.kind == EXTENDS) {
              nextToken();
              extending = parseType();
          }
          List<JCExpression> implementing = List.nil();
          if (token.kind == IMPLEMENTS) {
              nextToken();
              implementing = typeList();
          }
          List<JCTree> defs = classOrInterfaceBody(name, false);
          JCClassDecl result = toP(F.at(pos).ClassDef(
              mods, name, typarams, extending, implementing, defs));
          attach(result, dc);
          return result;
      }
docs: ClassDeclaration = CLASS Ident TypeParametersOpt [EXTENDS Type]
  [IMPLEMENTS TypeList] ClassBody
  @param mods    The modifiers starting the class declaration
  @param dc       The documentation comment for the class, or null.