def _generate_struct(self, struct_type, extra_parameters=None, nameOverride=None):
extra_parameters = extra_parameters if extra_parameters is not None else []<EOL>self._emit_jsdoc_header(struct_type.doc)<EOL>self.emit(<EOL>'<STR_LIT>' % (<EOL>nameOverride if nameOverride else fmt_type_name(struct_type)<EOL>)<EOL>)<EOL>if struct_type.is_member_of_enumerated_subtypes_tree():<EOL><INDENT>if struct_type.has_enumerated_subtypes():<EOL><INDENT>tag_values = []<EOL>for tags, _ in struct_type.get_all_subtypes_with_tags():<EOL><INDENT>for tag in tags:<EOL><INDENT>tag_values.append('<STR_LIT>' % tag)<EOL><DEDENT><DEDENT>jsdoc_tag_union = fmt_jsdoc_union(tag_values)<EOL>txt = '<STR_LIT>' %jsdoc_tag_union<EOL>self.emit_wrapped_text(txt)<EOL><DEDENT>else:<EOL><INDENT>parent = struct_type.parent_type<EOL>while not parent.has_enumerated_subtypes():<EOL><INDENT>parent = parent.parent_type<EOL><DEDENT>for subtype in parent.get_enumerated_subtypes():<EOL><INDENT>if subtype.data_type == struct_type:<EOL><INDENT>txt = '<STR_LIT>''<STR_LIT>''<STR_LIT>''<STR_LIT>' %subtype.name<EOL>self.emit_wrapped_text(txt)<EOL>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT>for param_name, param_type, param_docstring in extra_parameters:<EOL><INDENT>param_docstring = '<STR_LIT>' % param_docstring if param_docstring else '<STR_LIT>'<EOL>self.emit_wrapped_text(<EOL>'<STR_LIT>' % (<EOL>param_type,<EOL>param_name,<EOL>param_docstring,<EOL>),<EOL>prefix='<STR_LIT>',<EOL>)<EOL><DEDENT>for field in struct_type.all_fields:<EOL><INDENT>field_doc = '<STR_LIT>' + field.doc if field.doc else '<STR_LIT>'<EOL>field_type, nullable, _ = unwrap(field.data_type)<EOL>field_js_type = fmt_type(field_type)<EOL>field_name = '<STR_LIT:[>' + field.name + '<STR_LIT:]>' if nullable else field.name<EOL>self.emit_wrapped_text(<EOL>'<STR_LIT>' % (<EOL>field_js_type,<EOL>field_name,<EOL>self.process_doc(field_doc, self._docf),<EOL>),<EOL>prefix='<STR_LIT>',<EOL>)<EOL><DEDENT>self.emit('<STR_LIT>')<EOL>
Emits a JSDoc @typedef for a struct.