-redef class MClass
-
- # This method create an abstract method representation with this MMethodDef an this AMethoddef
- private fun create_abstract_method(v: ContractsVisitor, mproperty: MMethod, mclassdef: MClassDef, msignature: nullable MSignature, n_signature: ASignature): AMethPropdef
- do
- # new methoddef definition
- var m_def = new MMethodDef(mclassdef, mproperty, v.current_location)
- # set the signature
- if msignature != null then m_def.msignature = msignature.clone
- # set the abstract flag
- m_def.is_abstract = true
- # Build the new node method
- var n_def = v.ast_builder.make_method(null,null,m_def,n_signature,null,null,null,null)
- # Define the location of the new method for corresponding of the actual method
- n_def.location = v.current_location
- # Association new npropdef to mpropdef
- v.toolcontext.modelbuilder.unsafe_add_mpropdef2npropdef(m_def,n_def)
- return n_def
- end
-
- # Create method with an empty block
- # the `mproperty` i.e the global property definition. The mclassdef to set where the method is declared and it's model `msignature` and ast `n_signature` signature
- private fun create_empty_method(v: ContractsVisitor, mproperty: MMethod, mclassdef: MClassDef, msignature: nullable MSignature, n_signature: ASignature): AMethPropdef
- do
- var n_def = create_abstract_method(v, mproperty, mclassdef, msignature, n_signature)
- n_def.mpropdef.is_abstract = false
- n_def.n_block = v.ast_builder.make_block
- return n_def
- end
-end
-
-redef class MMethodDef