private var dummy: Bool = do_dummy
fun do_dummy: Bool
do
+ # Force easy warnings aftrm modelbuilder
+ phases.add_edge(simple_misc_analysis_phase, modelize_property_phase)
# Force easy warnings before intraproc-errors
phases.add_edge(scope_phase, simple_misc_analysis_phase)
return true
fun modelbuilder: ModelBuilder do return modelbuilder_real.as(not null)
private var modelbuilder_real: nullable ModelBuilder = null
+
+ var modelize_class_phase: Phase = new ModelizeClassPhase(self, null)
+ var modelize_property_phase: Phase = new ModelizePropertyPhase(self, [modelize_class_phase])
+end
+
+private class ModelizeClassPhase
+ super Phase
+
+ redef fun process_nmodule(nmodule)
+ do
+ toolcontext.modelbuilder.build_classes(nmodule)
+ end
+end
+
+private class ModelizePropertyPhase
+ super Phase
+ redef fun process_nmodule(nmodule)
+ do
+ for nclassdef in nmodule.n_classdefs do
+ toolcontext.modelbuilder.build_properties(nclassdef)
+ end
+ end
end
# A model builder knows how to load nit source files and build the associated model
var progname = arguments.first
# Here we load an process all modules passed on the command line
-var mmodules = modelbuilder.parse_and_build([progname])
+var mmodules = modelbuilder.parse([progname])
modelbuilder.run_phases
if toolcontext.opt_only_metamodel.value then exit(0)
var progname = arguments.first
# Here we load an process all modules passed on the command line
-var mmodules = modelbuilder.parse_and_build([progname])
+var mmodules = modelbuilder.parse([progname])
if mmodules.is_empty then return
modelbuilder.run_phases
var modelbuilder = new ModelBuilder(model, toolcontext)
# Here we load an process all modules passed on the command line
-var mmodules = modelbuilder.parse_and_build(arguments)
+var mmodules = modelbuilder.parse(arguments)
modelbuilder.run_phases
if mmodules.length == 0 then return
import local_var_init
redef class ToolContext
- var typing_phase: Phase = new TypingPhase(self, [flow_phase, local_var_init_phase])
+ var typing_phase: Phase = new TypingPhase(self, [flow_phase, modelize_property_phase, local_var_init_phase])
end
private class TypingPhase
-error_gen_f_inh_clash.nit:19,7--8: Error: Cannot provide a defaut constructor: conflict for G1 and G2
base_gen_f.nit:19,14: Type error: class E not found in module base_gen_f.