def _generate_struct_cstor(self, struct):
with self.block_func(<EOL>func=self._cstor_name_from_fields(struct.all_fields),<EOL>args=fmt_func_args_from_fields(struct.all_fields),<EOL>return_type='<STR_LIT>'):<EOL><INDENT>for field in struct.all_fields:<EOL><INDENT>self._generate_validator(field)<EOL><DEDENT>self.emit()<EOL>super_fields = [<EOL>f for f in struct.all_fields if f not in struct.fields<EOL>]<EOL>if super_fields:<EOL><INDENT>super_args = fmt_func_args([(fmt_var(f.name), fmt_var(f.name))<EOL>for f in super_fields])<EOL>self.emit('<STR_LIT>'.format(<EOL>self._cstor_name_from_fields(super_fields), super_args))<EOL><DEDENT>else:<EOL><INDENT>if struct.parent_type:<EOL><INDENT>self.emit('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>self.emit('<STR_LIT>')<EOL><DEDENT><DEDENT>with self.block_init():<EOL><INDENT>for field in struct.fields:<EOL><INDENT>field_name = fmt_var(field.name)<EOL>if field.has_default:<EOL><INDENT>self.emit('<STR_LIT>'.format(<EOL>field_name, field_name, fmt_default_value(field)))<EOL><DEDENT>else:<EOL><INDENT>self.emit('<STR_LIT>'.format(field_name, field_name))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>self.emit()<EOL>
Emits struct standard constructor.