ni_nitdoc: added fast copy past utility to signatures.
[nit.git] / src / frontend.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # Collect and orchestration of main frontend phases
16 module frontend
17
18 import phase
19 import simple_misc_analysis
20 import literal
21 import scope
22 import flow
23 import local_var_init
24 import typing
25 import auto_super_init
26 import div_by_zero
27 import cached
28
29 redef class ToolContext
30 # FIXME: there is conflict in linex in nitc, so use this trick to force invocation
31 private var dummy: Bool = do_dummy
32 fun do_dummy: Bool
33 do
34 # Force easy warnings aftrm modelbuilder
35 phases.add_edge(simple_misc_analysis_phase, modelize_property_phase)
36 # Force easy warnings before intraproc-errors
37 phases.add_edge(scope_phase, simple_misc_analysis_phase)
38 return true
39 end
40
41 fun run_global_phases(mainmodule: MModule)
42 do
43 for phase in phases_list do
44 phase.process_mainmodule(mainmodule)
45 end
46 end
47 end
48
49 redef class Phase
50 # Specific action to execute on the whole program
51 # Called by the `ToolContext::run_global_phases`
52 # @toimplement
53 fun process_mainmodule(mainmodule: MModule) do end
54 end
55