From d16de9ce7fa5de98bd7c3e64ac4552f03aaf2343 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Mon, 27 Jan 2014 16:13:49 -0500 Subject: [PATCH] tools: move run_global_phases/process_mainmodule into modelbuilder frontend was to specific Signed-off-by: Jean Privat --- src/frontend.nit | 15 --------------- src/modelbuilder.nit | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/frontend.nit b/src/frontend.nit index 04254a7..2cdde25 100644 --- a/src/frontend.nit +++ b/src/frontend.nit @@ -37,19 +37,4 @@ redef class ToolContext phases.add_edge(scope_phase, simple_misc_analysis_phase) return true end - - fun run_global_phases(mainmodule: MModule) - do - for phase in phases_list do - phase.process_mainmodule(mainmodule) - end - end end - -redef class Phase - # Specific action to execute on the whole program - # Called by the `ToolContext::run_global_phases` - # @toimplement - fun process_mainmodule(mainmodule: MModule) do end -end - diff --git a/src/modelbuilder.nit b/src/modelbuilder.nit index bb7d46c..fda8b67 100644 --- a/src/modelbuilder.nit +++ b/src/modelbuilder.nit @@ -52,8 +52,22 @@ redef class ToolContext fun modelbuilder: ModelBuilder do return modelbuilder_real.as(not null) private var modelbuilder_real: nullable ModelBuilder = null + fun run_global_phases(mainmodule: MModule) + do + for phase in phases_list do + phase.process_mainmodule(mainmodule) + end + end end +redef class Phase + # Specific action to execute on the whole program + # Called by the `ToolContext::run_global_phases` + # @toimplement + fun process_mainmodule(mainmodule: MModule) do end +end + + # A model builder knows how to load nit source files and build the associated model class ModelBuilder # The model where new modules, classes and properties are added -- 1.7.9.5