def define_class(self, kind, attributes, doc='<STR_LIT>'):
ukind = kind.upper()<EOL>if ukind in self.metaclasses:<EOL><INDENT>raise MetaModelException('<STR_LIT>' % kind)<EOL><DEDENT>metaclass = MetaClass(kind, self)<EOL>for name, ty in attributes:<EOL><INDENT>metaclass.append_attribute(name, ty)<EOL><DEDENT>self.metaclasses[ukind] = metaclass<EOL>return metaclass<EOL>
Define a new class in the metamodel, and return its metaclass.