From: Alexandre Terrasa Date: Fri, 18 Dec 2015 05:20:41 +0000 (-0500) Subject: model_collect: add services for module importation X-Git-Url: http://nitlanguage.org model_collect: add services for module importation Signed-off-by: Alexandre Terrasa --- diff --git a/src/model/model_collect.nit b/src/model/model_collect.nit index 2590b0d..8585092 100644 --- a/src/model/model_collect.nit +++ b/src/model/model_collect.nit @@ -220,6 +220,15 @@ redef class MClass return res end + # Build a class hierarchy poset for `self` based on its ancestors and descendants. + fun hierarchy_poset(mainmodule: MModule, view: ModelView): POSet[MClass] do + var mclasses = new HashSet[MClass] + mclasses.add self + mclasses.add_all collect_ancestors(view) + mclasses.add_all collect_descendants(view) + return view.mclasses_poset(mainmodule, mclasses) + end + # Collect all mproperties introduced in 'self' with `visibility >= min_visibility`. fun collect_intro_mproperties(view: ModelView): Set[MProperty] do var set = new HashSet[MProperty]