cprogram.files.add("$CLIBDIR/gc_static_objects_list.c")
tc.info("Generating C code",1)
- for m in module.mhe.greaters_and_self do m.compile_separate_module(cprogram)
+ for m in main_module.mhe.greaters_and_self do m.compile_separate_module(cprogram)
tc.info("Generating main, tables and makefile ...",1)
compile_main(cprogram)
# Compile the main file
private fun compile_main(cprogram: CProgram)
do
- var v = new CompilerVisitor(module, cprogram)
+ var v = new CompilerVisitor(main_module, cprogram)
v.add_decl("#include <nit_common.h>")
compile_tables_to_c(v)
compile_main_part(v)
- var filename = "{cprogram.compdir}/{module.name}._tables.c"
+ var filename = "{cprogram.compdir}/{main_module.name}._tables.c"
cprogram.files.add(filename)
var f = new OFStream.open(filename)
- f.write("/* This C file is generated by NIT to compile program {module.name}. */\n")
- for m in module.mhe.greaters_and_self do
+ f.write("/* This C file is generated by NIT to compile program {main_module.name}. */\n")
+ for m in main_module.mhe.greaters_and_self do
f.write("#include \"{cprogram.module_header_name(m)}\"\n")
end
v.header_writer.write_to_stream(f)