import model
private import metrics_base
+import frontend
+
+redef class ToolContext
+ var tables_metrics_phase: Phase = new TablesMetricsPhase(self, null)
+end
+
+private class TablesMetricsPhase
+ super Phase
+ redef fun process_mainmodule(mainmodule, given_mmodules)
+ do
+ if not toolcontext.opt_tables.value and not toolcontext.opt_all.value then return
+ compute_tables_metrics(mainmodule)
+ end
+end
# Print class tables metrics for the classes of the program main
fun compute_tables_metrics(main: MModule)
if p.mpropdefs.length == 1 then
npas += 1
else
- var sels = p.lookup_definitions(main, c.mclassdefs.first.bound_mtype)
+ var sels = p.lookup_definitions(main, c.intro.bound_mtype)
if sels.length > 1 then
print "conflict for {p.full_name} in class {c.full_name}: {sels.join(", ")}"
else if sels.is_empty then