MClassDef
objects
# Visit the AST and create the `MClassDef` objects
private fun build_a_mclassdef(nmodule: AModule, nclassdef: AClassdef)
do
var mmodule = nmodule.mmodule.as(not null)
var mclass = nclassdef.mclass
if mclass == null then return # Skip error
# In case of non-standard AClassdef, try to attach to an already existing mclassdef
var other_nclassdef = nmodule.mclass2nclassdef[mclass]
if other_nclassdef != nclassdef then
assert not nclassdef isa AStdClassdef
nclassdef.mclassdef = other_nclassdef.mclassdef
return
end
var bound_mtype = build_a_bound_mtype(nmodule, nclassdef)
if bound_mtype == null then return
var mclassdef = new MClassDef(mmodule, bound_mtype, nclassdef.location)
nclassdef.mclassdef = mclassdef
self.mclassdef2nclassdef[mclassdef] = nclassdef
if nclassdef isa AStdClassdef then
var ndoc = nclassdef.n_doc
if ndoc != null then
var mdoc = ndoc.to_mdoc
mclassdef.mdoc = mdoc
mdoc.original_mentity = mclassdef
else if mclassdef.is_intro and mclass.visibility >= public_visibility then
advice(nclassdef, "missing-doc", "Documentation warning: Undocumented public class `{mclass}`")
end
end
if mclassdef.is_intro then
self.toolcontext.info("{mclassdef} introduces new {mclass.kind} {mclass.full_name}", 3)
else
self.toolcontext.info("{mclassdef} refines {mclass.kind} {mclass.full_name}", 3)
end
end
src/modelize/modelize_class.nit:148,2--185,4