From 867badd37ef3206317b28d8b9e00763a7d4bd77f Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Fri, 18 Dec 2015 00:20:41 -0500 Subject: [PATCH] model_collect: add services for module importation Signed-off-by: Alexandre Terrasa --- src/model/model_collect.nit | 9 +++++++++ 1 file changed, 9 insertions(+) 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] -- 1.7.9.5