def METHOD_NAME():
   dev_classes = False
   print("const struct pci_device_class pci_device_classes_list[] =")
   print("{")
   devclass = device_class_ctx()
   class_dumped = True
   subclass_dumped = True
   for line in textdata:
      if not line or line[0] == '#':
         continue
      if not dev_classes:
         if line[0] != 'C':
            continue # Device classes haven't started yet
         # This is the first device class in the file
         dev_classes = True
      # We're for sure parsing the "device classes" part of the file
      if line[0] == 'C':
         # New device class
         new_class_id = int(line[2:4], base=16)
         new_class_name = line[4:].strip()
         if not class_dumped or not subclass_dumped:
            # The previous class was not dumped and it had no subclass
            devclass.dump()
         devclass.set_class(new_class_id, new_class_name)
         # We just hit a new class. Of course, we haven't dumped it yet:
         # set class_dumped to False and reset subclass_dumped.
         # Note: resetting the *_dumped vars means setting them to True
         class_dumped = False
         subclass_dumped = True
      elif line[0].isspace() and not line[1].isspace():
         # New device sub-class
         new_subclass_id = int(line[1:3], base=16)
         new_subclass_name = line[4:].strip()
         if not subclass_dumped:
            # The previous sub-class was not dumped and it had no progif
            devclass.dump()
            class_dumped = True
         devclass.set_subclass(new_subclass_id, new_subclass_name)
         subclass_dumped = False
      else:
         # Device programming interface (sub-sub-class)
         new_progif_id = int(line[2:4], base=16)
         new_progif_name = line[5:].strip()
         devclass.set_progif(new_progif_id, new_progif_name)
         devclass.dump()
         class_dumped = True
         subclass_dumped = True
   if not class_dumped or not subclass_dumped:
      devclass.dump()
   print("};")
   print("")