-# Sort mmodules by their name
-class MModuleNameSorter
- super AbstractSorter[MModule]
- redef fun compare(a, b) do return a.name <=> b.name
- init do end
-end
-
-# Sort mclasses by their name
-class MClassNameSorter
- super AbstractSorter[MClass]
- redef fun compare(a, b) do return a.name <=> b.name
- init do end
-end
-
-# Sort mclassdefs by their name
-class MClassDefNameSorter
- super AbstractSorter[MClassDef]
- redef fun compare(a, b) do return a.mclass.name <=> b.mclass.name
- init do end
-end
-
-# Sort mproperties by their name
-class MPropertyNameSorter
- super AbstractSorter[MProperty]
- redef fun compare(a, b) do return a.name <=> b.name
- init do end
-end
+# Sort MConcerns based on the module importation hierarchy ranking
+# see also: `MConcern::concern_rank` and `MConcern::booster_rank`
+#
+# Comparison is made with the formula:
+#
+# ~~~nitish
+# a.concern_rank + a.booster_rank <=> b.concern_rank + b.booster_ran
+# ~~~
+#
+# If both `a` and `b` have the same ranking,
+# ordering is based on lexicographic comparison of `a.name` and `b.name`
+class MConcernRankSorter
+ super Comparator
+ redef type COMPARED: MConcern