code: def generate_data_type(self, data_type):
          
          if isinstance(data_type, Struct):
              # Output a struct definition.
              self.emit('')
              self.emit('struct %s' % data_type.name)
              with self.indent():
                  if data_type.doc is not None:
                      self.emit(self.format_string(data_type.doc))
                  for field in data_type.fields:
                      type_repr = self.format_data_type(field.data_type)
                      if not field.has_default:
                          self.emit('%s %s' % (field.name, type_repr))
                      else:
                          self.emit('%s %s = %s' %
                              (field.name, type_repr, self.format_value(field.default)))
                      if field.doc is not None:
                          with self.indent():
                              self.emit(self.format_value(field.doc))
          elif isinstance(data_type, Union):
              # Output a union definition.
              self.emit('')
              self.emit('union %s' % data_type.name)
              with self.indent():
                  if data_type.doc is not None:
                      self.emit(self.format_string(data_type.doc))
                  for field in data_type.fields:
                      name = field.name
                      # Add a star for a catch-all field.
                      # (There are two ways to recognize these.)
                      if field.catch_all or field is data_type.catch_all_field:
                          name += '*'
                      if isinstance(field.data_type, Void):
                          self.emit('%s' % (name))
                      else:
                          type_repr = self.format_data_type(field.data_type)
                          self.emit('%s %s' % (name, type_repr))
                      if field.doc is not None:
                          with self.indent():
                              self.emit(self.format_value(field.doc))
          else:
              # Don't know what this is.
              self.emit('')
              self.emit('# ??? %s' % repr(data_type))
docs: Output a data type definition (a struct or union).