+ if mclass == self then continue
+ if filter == null or filter.accept_mentity(mclass) then res.add mclass
+ end
+ return res
+ end
+
+ # Collect all descendants of `self`
+ redef fun collect_descendants(mainmodule, filter) do
+ var res = new HashSet[MENTITY]
+ if not mainmodule.flatten_mclass_hierarchy.has(self) then return res
+ for mclass in in_hierarchy(mainmodule).smallers do
+ if mclass == self then continue
+ if filter == null or filter.accept_mentity(mclass) then res.add mclass