return res
end
+ # Get the list of all virtual types available in 'self'.
+ fun virtual_types: Set[MVirtualTypeProp] do
+ var res = new HashSet[MVirtualTypeProp]
+ for mclassdef in mclassdefs do
+ for mpropdef in mclassdef.mpropdefs do
+ if mpropdef isa MVirtualTypeDef then
+ res.add(mpropdef.mproperty)
+ end
+ end
+ end
+ for ancestor in ancestors do
+ for mclassdef in ancestor.mclassdefs do
+ for mpropdef in mclassdef.mpropdefs do
+ if mpropdef isa MVirtualTypeDef then
+ res.add(mpropdef.mproperty)
+ end
+ end
+ end
+ end
+ return res
+ end
+
+ # Get the list of all parameter types in 'self'.
+ fun parameter_types: Map[String, MType] do
+ var res = new HashMap[String, MType]
+ for i in [0..intro.parameter_names.length[ do
+ res[intro.parameter_names[i]] = intro.bound_mtype.arguments[i]
+ end
+ return res
+ end
+
fun is_class: Bool do
return self.kind == concrete_kind or self.kind == abstract_kind
end
pager.add_rule
pager.addn(nclass.comment.green)
pager.add_rule
- #TODO VT
+ if not mclass.parameter_types.is_empty then
+ pager.add("# formal types\n".bold)
+ for ft, bound in mclass.parameter_types do
+ pager.add("\t{ft.to_s.green}: {bound}")
+ pager.add("")
+ end
+ end
+ if not mclass.virtual_types.is_empty then
+ pager.add("# virtual types\n".bold)
+ for vt in mclass.virtual_types do
+ if vt.visibility.to_s == "public" then pager.add("\t{vt.to_s.green}: {vt.intro.bound.to_s}")
+ if vt.visibility.to_s == "private" then pager.add("\t{vt.to_s.red}: {vt.intro.bound.to_s}")
+ if vt.visibility.to_s == "protected" then pager.add("\t{vt.to_s.yellow}: {vt.intro.bound.to_s}")
+ if vt.intro_mclassdef != mclass.intro then
+ pager.add("\t\tintroduced in {vt.intro_mclassdef.namespace}::{vt}".gray)
+ end
+ pager.add("")
+ end
+ end
pager.add_rule
var cats = new HashMap[String, Collection[MMethod]]