def _generate_union_tag_state(self, union):
union_name = fmt_class_prefix(union)<EOL>tag_type = fmt_enum_name('<STR_LIT>', union)<EOL>description_str = ('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>self.emit_wrapped_text(<EOL>description_str.format(tag_type, union_name),<EOL>prefix=comment_prefix)<EOL>with self.block(<EOL>'<STR_LIT>'.format(tag_type), after='<STR_LIT:;>'):<EOL><INDENT>for field in union.all_fields:<EOL><INDENT>doc = self.process_doc(<EOL>field.doc, self._docf) if field.doc else undocumented<EOL>self.emit_wrapped_text(doc, prefix=comment_prefix)<EOL>self.emit('<STR_LIT>'.format(fmt_enum_name(field.name, union)))<EOL>self.emit()<EOL><DEDENT><DEDENT>self.emit()<EOL>
Emits union tag enum type, which stores union state.