X-Git-Url: http://nitlanguage.org diff --git a/src/compiling/compiling.nit b/src/compiling/compiling.nit index a74118b..a063ca5 100644 --- a/src/compiling/compiling.nit +++ b/src/compiling/compiling.nit @@ -26,7 +26,7 @@ redef class MMSrcModule # Compile the program # Generate all sep files (_sep.[ch]), the main file (_table.c) and the build file (_build.sh) # Then execute the build.sh - meth compile_prog_to_c(tc: ToolContext) + fun compile_prog_to_c(tc: ToolContext) do for m in mhe.greaters_and_self do assert m isa MMSrcModule @@ -48,7 +48,7 @@ redef class MMSrcModule if (native_name + "_nit.h").file_exists then includes.add("-I {native_name.dirname}") end - native_name.append("_nit.c") + native_name += "_nit.c" if native_name.file_exists then files.add(native_name) end @@ -78,11 +78,9 @@ redef class MMSrcModule end # Compile the main file - private meth compile_main(tc: ToolContext, ga: GlobalAnalysis) + private fun compile_main(tc: ToolContext, ga: GlobalAnalysis) do - var v = new CompilerVisitor(self) - v.tc = tc - v.global_analysis = ga + var v = new GlobalCompilerVisitor(self, tc, ga) v.add_decl("#include ") compile_tables_to_c(v) compile_main_part(v) @@ -96,14 +94,12 @@ redef class MMSrcModule end # Compile the sep files (of the current module only) - private meth compile_separate_module(tc: ToolContext, ga: GlobalAnalysis) + private fun compile_separate_module(tc: ToolContext, ga: GlobalAnalysis) do - var v = new CompilerVisitor(self) - v.tc = tc - v.global_analysis = ga + var v = new GlobalCompilerVisitor(self, tc, ga) v.add_decl("#include ") var native_name = filename.strip_extension(".nit") - native_name.append("_nit.h") + native_name += ("_nit.h") if native_name.file_exists then v.add_decl("#include <{native_name.basename("")}>") declare_class_tables_to_c(v) compile_mod_to_c(v)