X-Git-Url: http://nitlanguage.org diff --git a/c_src/compiling._sep.c b/c_src/compiling._sep.c index 0b54c5d..cd93126 100644 --- a/c_src/compiling._sep.c +++ b/c_src/compiling._sep.c @@ -1,568 +1,1009 @@ /* This C file is generated by NIT to compile module compiling. */ #include "compiling._sep.h" -void compiling___MMSrcModule___compile_prog_to_c(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 26, LOCATE_compiling___MMSrcModule___compile_prog_to_c}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - val_t variable7; - val_t variable8; - val_t variable9; - val_t variable10; - val_t variable11; - val_t variable12; - val_t variable13; - val_t variable14; - val_t variable15; - val_t variable16; - val_t variable17; - val_t variable18; - val_t variable19; - val_t variable20; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_compiling; - variable0 = param0; - variable1 = ((abstractmetamodel___MMModule___mhe_t)CALL( self,COLOR_abstractmetamodel___MMModule___mhe))( self) /*MMModule::mhe*/; - variable1 = ((partial_order___PartialOrderElement___greaters_and_self_t)CALL(variable1,COLOR_partial_order___PartialOrderElement___greaters_and_self))(variable1) /*PartialOrderElement::greaters_and_self*/; - variable1 = ((abstract_collection___Collection___iterator_t)CALL(variable1,COLOR_abstract_collection___Collection___iterator))(variable1) /*Collection::iterator*/; - while (true) { /*for*/ - variable2 = ((abstract_collection___Iterator___is_ok_t)CALL(variable1,COLOR_abstract_collection___Iterator___is_ok))(variable1) /*Iterator::is_ok*/; - if (!UNTAG_Bool(variable2)) break; /*for*/ - variable2 = ((abstract_collection___Iterator___item_t)CALL(variable1,COLOR_abstract_collection___Iterator___item))(variable1) /*Iterator::item*/; - variable3 = TAG_Bool(( variable2 /*m*/==NIT_NULL) || VAL_ISA( variable2 /*m*/, COLOR_MMSrcModule, ID_MMSrcModule)) /*cast MMSrcModule*/; - if (!UNTAG_Bool(variable3)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_compiling___MMSrcModule___compile_prog_to_c, LOCATE_compiling, 32); nit_exit(1);} - ((compiling_global___MMSrcModule___local_analysis_t)CALL( variable2 /*m*/,COLOR_compiling_global___MMSrcModule___local_analysis))( variable2 /*m*/, variable0 /*tc*/) /*MMSrcModule::local_analysis*/; - continue_1: while(0); - ((abstract_collection___Iterator___next_t)CALL(variable1,COLOR_abstract_collection___Iterator___next))(variable1) /*Iterator::next*/; +val_t compiling___Program___output_format(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t REGB0; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 27; + fra.me.meth = LOCATE_compiling___Program___output_format; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./compiling//compiling.nit:27 */ + REGB0 = TAG_Bool(ATTR_compiling___Program____output_format(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_output_format", LOCATE_compiling, 27); } - break_1: while(0); - variable2 = ((compiling_global___MMSrcModule___global_analysis_t)CALL( self,COLOR_compiling_global___MMSrcModule___global_analysis))( self, variable0 /*tc*/) /*MMSrcModule::global_analysis*/; - variable1 = variable2; - variable2 = ((compiling_base___ToolContext___compdir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___compdir))( variable0 /*tc*/) /*ToolContext::compdir*/; - ((file___String___mkdir_t)CALL(variable2,COLOR_file___String___mkdir))(variable2) /*String::mkdir*/; - variable3 = NEW_array___Array___init(); /*new Array[E]*/ - variable2 = variable3; - variable4 = NEW_array___ArraySet___init(); /*new ArraySet[E]*/ - variable3 = variable4; - variable4 = NEW_string___String___with_native(BOX_NativeString("$CLIBDIR/nit_main.c"), TAG_Int(19)); /*new String*/ - ((array___AbstractArray___add_t)CALL( variable2 /*files*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*files*/, variable4) /*AbstractArray::add*/; - variable4 = ((abstractmetamodel___MMModule___mhe_t)CALL( self,COLOR_abstractmetamodel___MMModule___mhe))( self) /*MMModule::mhe*/; - variable4 = ((partial_order___PartialOrderElement___greaters_and_self_t)CALL(variable4,COLOR_partial_order___PartialOrderElement___greaters_and_self))(variable4) /*PartialOrderElement::greaters_and_self*/; - variable4 = ((abstract_collection___Collection___iterator_t)CALL(variable4,COLOR_abstract_collection___Collection___iterator))(variable4) /*Collection::iterator*/; - while (true) { /*for*/ - variable5 = ((abstract_collection___Iterator___is_ok_t)CALL(variable4,COLOR_abstract_collection___Iterator___is_ok))(variable4) /*Iterator::is_ok*/; - if (!UNTAG_Bool(variable5)) break; /*for*/ - variable5 = ((abstract_collection___Iterator___item_t)CALL(variable4,COLOR_abstract_collection___Iterator___item))(variable4) /*Iterator::item*/; - variable6 = TAG_Bool(( variable5 /*m*/==NIT_NULL) || VAL_ISA( variable5 /*m*/, COLOR_MMSrcModule, ID_MMSrcModule)) /*cast MMSrcModule*/; - if (!UNTAG_Bool(variable6)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_compiling___MMSrcModule___compile_prog_to_c, LOCATE_compiling, 44); nit_exit(1);} - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((compiling_base___ToolContext___compdir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___compdir))( variable0 /*tc*/) /*ToolContext::compdir*/; - variable10 = variable9; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - variable13 = ((abstractmetamodel___MMModule___name_t)CALL( variable5 /*m*/,COLOR_abstractmetamodel___MMModule___name))( variable5 /*m*/) /*MMModule::name*/; - variable14 = variable13; - variable14 = ((string___String___to_s_t)CALL(variable14,COLOR_string___Object___to_s))(variable14) /*String::to_s*/; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable14) /*String::append*/; - variable15 = NEW_string___String___with_native(BOX_NativeString("._sep.c"), TAG_Int(7)); /*new String*/ - variable16 = variable15; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable16) /*String::append*/; - ((array___AbstractArray___add_t)CALL( variable2 /*files*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*files*/, variable6) /*AbstractArray::add*/; - ((compiling___MMSrcModule___compile_separate_module_t)CALL( variable5 /*m*/,COLOR_compiling___MMSrcModule___compile_separate_module))( variable5 /*m*/, variable0 /*tc*/, variable1 /*ga*/) /*MMSrcModule::compile_separate_module*/; - variable7 = ((mmloader___MMModule___filename_t)CALL( variable5 /*m*/,COLOR_mmloader___MMModule___filename))( variable5 /*m*/) /*MMModule::filename*/; - variable8 = NEW_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/ - variable7 = ((file___String___strip_extension_t)CALL(variable7,COLOR_file___String___strip_extension))(variable7, variable8) /*String::strip_extension*/; - variable6 = variable7; - variable7 = NEW_string___String___with_native(BOX_NativeString("_nit.h"), TAG_Int(6)); /*new String*/ - variable7 = ((string___String_____plus_t)CALL( variable6 /*native_name*/,COLOR_string___String_____plus))( variable6 /*native_name*/, variable7) /*String::+*/; - variable7 = ((file___String___file_exists_t)CALL(variable7,COLOR_file___String___file_exists))(variable7) /*String::file_exists*/; - if (UNTAG_Bool(variable7)) { /*if*/ - variable7 = NEW_string___String___init(); /*new String*/ - variable8 = NEW_string___String___with_native(BOX_NativeString("-I "), TAG_Int(3)); /*new String*/ - variable9 = variable8; - ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable9) /*String::append*/; - variable10 = ((file___String___dirname_t)CALL( variable6 /*native_name*/,COLOR_file___String___dirname))( variable6 /*native_name*/) /*String::dirname*/; - variable11 = variable10; - ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable11) /*String::append*/; - variable12 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable13 = variable12; - ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable13) /*String::append*/; - ((array___ArraySet___add_t)CALL( variable3 /*includes*/,COLOR_abstract_collection___SimpleCollection___add))( variable3 /*includes*/, variable7) /*ArraySet::add*/; + fra.me.REG[0] = ATTR_compiling___Program____output_format(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +void compiling___Program___output_format__eq(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[1];} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 27; + fra.me.meth = LOCATE_compiling___Program___output_format__eq; + fra.me.has_broke = 0; + fra.me.REG_size = 2; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[0] = p0; + fra.me.REG[1] = p1; + /* ./compiling//compiling.nit:27 */ + ATTR_compiling___Program____output_format(fra.me.REG[0]) = fra.me.REG[1]; + stack_frame_head = fra.me.prev; + return; +} +void compiling___Program___compile_prog(val_t p0){ + struct {struct stack_frame_t me; val_t MORE_REG[2];} fra; + val_t REGB0; + val_t REGB1; + val_t tmp; + static val_t once_value_1; /* Once value */ + static val_t once_value_3; /* Once value */ + static val_t once_value_4; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 30; + fra.me.meth = LOCATE_compiling___Program___compile_prog; + fra.me.has_broke = 0; + fra.me.REG_size = 3; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./compiling//compiling.nit:33 */ + fra.me.REG[1] = CALL_compiling___Program___output_format(fra.me.REG[0])(fra.me.REG[0]); + if (!once_value_1) { + fra.me.REG[2] = BOX_NativeString("none"); + REGB0 = TAG_Int(4); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_1 = fra.me.REG[2]; + register_static_object(&once_value_1); + } else fra.me.REG[2] = once_value_1; + fra.me.REG[2] = fra.me.REG[2]; + REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[1],fra.me.REG[2])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + REGB0 = REGB1; + } + if (UNTAG_Bool(REGB0)) { + } else { + CALL_program___Program___with_each_iroutines(fra.me.REG[0])(fra.me.REG[0], (&(fra.me)), ((fun_t)OC_compiling___Program___compile_prog_2)); + /* ./compiling//compiling.nit:39 */ + fra.me.REG[2] = CALL_compiling___Program___output_format(fra.me.REG[0])(fra.me.REG[0]); + if (!once_value_3) { + fra.me.REG[1] = BOX_NativeString("C"); + REGB0 = TAG_Int(1); + fra.me.REG[1] = NEW_String_string___String___with_native(fra.me.REG[1], REGB0); + once_value_3 = fra.me.REG[1]; + register_static_object(&once_value_3); + } else fra.me.REG[1] = once_value_3; + fra.me.REG[1] = fra.me.REG[1]; + REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[2],fra.me.REG[1])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + REGB0 = REGB1; } - variable7 = NEW_string___String___with_native(BOX_NativeString("_nit.c"), TAG_Int(6)); /*new String*/ - ((string___String___append_t)CALL( variable6 /*native_name*/,COLOR_abstract_collection___IndexedCollection___append))( variable6 /*native_name*/, variable7) /*String::append*/; - variable7 = ((file___String___file_exists_t)CALL( variable6 /*native_name*/,COLOR_file___String___file_exists))( variable6 /*native_name*/) /*String::file_exists*/; - if (UNTAG_Bool(variable7)) { /*if*/ - ((array___AbstractArray___add_t)CALL( variable2 /*files*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*files*/, variable6 /*native_name*/) /*AbstractArray::add*/; + if (UNTAG_Bool(REGB0)) { + /* ./compiling//compiling.nit:40 */ + CALL_compiling___Program___compile_prog_to_c(fra.me.REG[0])(fra.me.REG[0]); + } else { + /* ./compiling//compiling.nit:41 */ + fra.me.REG[1] = CALL_compiling___Program___output_format(fra.me.REG[0])(fra.me.REG[0]); + if (!once_value_4) { + fra.me.REG[2] = BOX_NativeString("icode"); + REGB0 = TAG_Int(5); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_4 = fra.me.REG[2]; + register_static_object(&once_value_4); + } else fra.me.REG[2] = once_value_4; + fra.me.REG[2] = fra.me.REG[2]; + REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[1],fra.me.REG[2])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + REGB0 = REGB1; + } + if (UNTAG_Bool(REGB0)) { + /* ./compiling//compiling.nit:42 */ + CALL_icode_generator___Program___generate_icode_files(fra.me.REG[0])(fra.me.REG[0]); + } } - continue_2: while(0); - ((abstract_collection___Iterator___next_t)CALL(variable4,COLOR_abstract_collection___Iterator___next))(variable4) /*Iterator::next*/; } - break_2: while(0); - variable4 = NEW_string___String___init(); /*new String*/ - variable5 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable6 = variable5; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable6) /*String::append*/; - variable7 = ((compiling_base___ToolContext___compdir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___compdir))( variable0 /*tc*/) /*ToolContext::compdir*/; - variable8 = variable7; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable8) /*String::append*/; - variable9 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable10 = variable9; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable10) /*String::append*/; - variable11 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable12 = variable11; - variable12 = ((string___String___to_s_t)CALL(variable12,COLOR_string___Object___to_s))(variable12) /*String::to_s*/; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable12) /*String::append*/; - variable13 = NEW_string___String___with_native(BOX_NativeString("._tables.c"), TAG_Int(10)); /*new String*/ - variable14 = variable13; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable14) /*String::append*/; - ((array___AbstractArray___add_t)CALL( variable2 /*files*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*files*/, variable4) /*AbstractArray::add*/; - ((compiling___MMSrcModule___compile_main_t)CALL( self,COLOR_compiling___MMSrcModule___compile_main))( self, variable0 /*tc*/, variable1 /*ga*/) /*MMSrcModule::compile_main*/; - variable5 = NEW_string___String___init(); /*new String*/ - variable6 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable7 = variable6; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/; - variable8 = ((compiling_base___ToolContext___compdir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___compdir))( variable0 /*tc*/) /*ToolContext::compdir*/; - variable9 = variable8; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable9) /*String::append*/; - variable10 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable11 = variable10; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable11) /*String::append*/; - variable12 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable13 = variable12; - variable13 = ((string___String___to_s_t)CALL(variable13,COLOR_string___Object___to_s))(variable13) /*String::to_s*/; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable13) /*String::append*/; - variable14 = NEW_string___String___with_native(BOX_NativeString("._build.sh"), TAG_Int(10)); /*new String*/ - variable15 = variable14; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable15) /*String::append*/; - variable4 = variable5; - variable6 = NEW_file___OFStream___open( variable4 /*fn*/); /*new OFStream*/ - variable5 = variable6; - variable6 = NEW_string___String___with_native(BOX_NativeString("#!/bin/sh\n"), TAG_Int(10)); /*new String*/ - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString("# This shell script is generated by NIT to compile the program "), TAG_Int(63)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable10 = variable9; - variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString(".\n"), TAG_Int(2)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString("CLIBDIR=\""), TAG_Int(9)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((compiling_base___ToolContext___clibdir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___clibdir))( variable0 /*tc*/) /*ToolContext::clibdir*/; - variable10 = variable9; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString("\"\n"), TAG_Int(2)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((compiling_base___ToolContext___bindir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___bindir))( variable0 /*tc*/) /*ToolContext::bindir*/; - variable10 = variable9; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString("/gccx -d "), TAG_Int(9)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - variable13 = ((compiling_base___ToolContext___compdir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___compdir))( variable0 /*tc*/) /*ToolContext::compdir*/; - variable14 = variable13; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable14) /*String::append*/; - variable15 = NEW_string___String___with_native(BOX_NativeString(" -I $CLIBDIR "), TAG_Int(13)); /*new String*/ - variable16 = variable15; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable16) /*String::append*/; - variable17 = NEW_string___String___with_native(BOX_NativeString(" "), TAG_Int(1)); /*new String*/ - variable17 = ((string___Collection___join_t)CALL( variable3 /*includes*/,COLOR_string___Collection___join))( variable3 /*includes*/, variable17) /*Collection::join*/; - variable18 = variable17; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable18) /*String::append*/; - variable19 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable20 = variable19; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable20) /*String::append*/; - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - variable6 = ((compiling_base___ToolContext___output_file_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___output_file))( variable0 /*tc*/) /*ToolContext::output_file*/; - variable6 = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable6 == NIT_NULL /*null*/) || ((variable6 != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL(variable6,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable6, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL(variable6,COLOR_kernel___Object_____eqeq))(variable6, NIT_NULL /*null*/) /*Object::==*/))))))); - if (UNTAG_Bool(variable6)) { /*if*/ - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((compiling_base___ToolContext___output_file_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___output_file))( variable0 /*tc*/) /*ToolContext::output_file*/; - variable10 = variable9; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - } else { /*if*/ - variable6 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/; - variable6 = ((array___AbstractArray___is_empty_t)CALL(variable6,COLOR_abstract_collection___Collection___is_empty))(variable6) /*AbstractArray::is_empty*/; - if (UNTAG_Bool(variable6)) { /*if*/ - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable10 = variable9; - variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - } else { /*if*/ - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString(" -o "), TAG_Int(4)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable10 = variable9; - variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString("_"), TAG_Int(1)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - variable13 = ((compiling_base___ToolContext___ext_prefix_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___ext_prefix))( variable0 /*tc*/) /*ToolContext::ext_prefix*/; - variable14 = variable13; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable14) /*String::append*/; - variable15 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable16 = variable15; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable16) /*String::append*/; - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; + stack_frame_head = fra.me.prev; + return; +} + void OC_compiling___Program___compile_prog_2(struct stack_frame_t *closctx, val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[1];} fra; + val_t tmp; + /* ./compiling//compiling.nit:37 */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 37; + fra.me.meth = LOCATE_compiling___Program___compile_prog; + fra.me.has_broke = 0; + fra.me.REG_size = 2; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[0] = p0; + fra.me.REG[1] = p1; + CALL_analysis___IRoutine___optimize(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]); + stack_frame_head = fra.me.prev; + return; } +void compiling___Program___compile_prog_to_c(val_t p0){ + struct {struct stack_frame_t me; val_t MORE_REG[3];} fra; + val_t REGB0; + val_t tmp; + static val_t once_value_1; /* Once value */ + static val_t once_value_2; /* Once value */ + static val_t once_value_3; /* Once value */ + static val_t once_value_4; /* Once value */ + static val_t once_value_6; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 47; + fra.me.meth = LOCATE_compiling___Program___compile_prog_to_c; + fra.me.has_broke = 0; + fra.me.REG_size = 4; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.REG[3] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./compiling//compiling.nit:52 */ + fra.me.REG[1] = NEW_CProgram_compiling_base___CProgram___init(fra.me.REG[0]); + /* ./compiling//compiling.nit:54 */ + fra.me.REG[2] = CALL_compiling_base___CProgram___compdir(fra.me.REG[1])(fra.me.REG[1]); + CALL_file___String___mkdir(fra.me.REG[2])(fra.me.REG[2]); + /* ./compiling//compiling.nit:56 */ + fra.me.REG[2] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + if (!once_value_1) { + fra.me.REG[3] = BOX_NativeString("$CLIBDIR/nit_main.c"); + REGB0 = TAG_Int(19); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_1 = fra.me.REG[3]; + register_static_object(&once_value_1); + } else fra.me.REG[3] = once_value_1; + fra.me.REG[3] = fra.me.REG[3]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + /* ./compiling//compiling.nit:57 */ + fra.me.REG[3] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + if (!once_value_2) { + fra.me.REG[2] = BOX_NativeString("$CLIBDIR/gc.c"); + REGB0 = TAG_Int(13); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_2 = fra.me.REG[2]; + register_static_object(&once_value_2); + } else fra.me.REG[2] = once_value_2; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]); + /* ./compiling//compiling.nit:58 */ + fra.me.REG[2] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + if (!once_value_3) { + fra.me.REG[3] = BOX_NativeString("$CLIBDIR/gc_static_objects_list.c"); + REGB0 = TAG_Int(33); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_3 = fra.me.REG[3]; + register_static_object(&once_value_3); + } else fra.me.REG[3] = once_value_3; + fra.me.REG[3] = fra.me.REG[3]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + /* ./compiling//compiling.nit:60 */ + fra.me.REG[3] = CALL_program___Program___tc(fra.me.REG[0])(fra.me.REG[0]); + if (!once_value_4) { + fra.me.REG[2] = BOX_NativeString("Generating C code"); + REGB0 = TAG_Int(17); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_4 = fra.me.REG[2]; + register_static_object(&once_value_4); + } else fra.me.REG[2] = once_value_4; + fra.me.REG[2] = fra.me.REG[2]; + REGB0 = TAG_Int(1); + CALL_mmloader___ToolContext___info(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2], REGB0); + /* ./compiling//compiling.nit:61 */ + fra.me.REG[2] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___mhe(fra.me.REG[2])(fra.me.REG[2]); + REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + nit_abort("Reciever is null", NULL, LOCATE_compiling, 61); } - variable6 = ((compiling_base___ToolContext___boost_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___boost))( variable0 /*tc*/) /*ToolContext::boost*/; - if (UNTAG_Bool(variable6)) { /*if*/ - variable6 = NEW_string___String___with_native(BOX_NativeString(" -O"), TAG_Int(3)); /*new String*/ - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - } - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString(" \"$@\" \\\n "), TAG_Int(10)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = NEW_string___String___with_native(BOX_NativeString("\\\n "), TAG_Int(4)); /*new String*/ - variable9 = ((string___Collection___join_t)CALL( variable2 /*files*/,COLOR_string___Collection___join))( variable2 /*files*/, variable9) /*Collection::join*/; - variable10 = variable9; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - ((file___OFStream___close_t)CALL( variable5 /*f*/,COLOR_stream___IOS___close))( variable5 /*f*/) /*OFStream::close*/; - variable6 = ((compiling_base___ToolContext___no_cc_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___no_cc))( variable0 /*tc*/) /*ToolContext::no_cc*/; - if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable6)))) { /*if*/ - variable6 = (G_sys); - variable7 = NEW_string___String___init(); /*new String*/ - variable8 = NEW_string___String___with_native(BOX_NativeString("sh "), TAG_Int(3)); /*new String*/ - variable9 = variable8; - ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable9) /*String::append*/; - variable10 = variable4 /*fn*/; - ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable12) /*String::append*/; - ((exec___Sys___system_t)CALL(variable6,COLOR_exec___Sys___system))(variable6, variable7) /*Sys::system*/; + fra.me.REG[2] = CALL_partial_order___PartialOrderElement___greaters_and_self(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___Collection___iterate(fra.me.REG[2])(fra.me.REG[2], (&(fra.me)), ((fun_t)OC_compiling___Program___compile_prog_to_c_5)); + /* ./compiling//compiling.nit:63 */ + fra.me.REG[2] = CALL_program___Program___tc(fra.me.REG[0])(fra.me.REG[0]); + if (!once_value_6) { + fra.me.REG[3] = BOX_NativeString("Generating main, tables and makefile ..."); + REGB0 = TAG_Int(40); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_6 = fra.me.REG[3]; + register_static_object(&once_value_6); + } else fra.me.REG[3] = once_value_6; + fra.me.REG[3] = fra.me.REG[3]; + REGB0 = TAG_Int(1); + CALL_mmloader___ToolContext___info(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3], REGB0); + /* ./compiling//compiling.nit:64 */ + CALL_compiling___Program___compile_main(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]); + /* ./compiling//compiling.nit:66 */ + CALL_compiling_base___CProgram___generate_build_file(fra.me.REG[1])(fra.me.REG[1]); + /* ./compiling//compiling.nit:68 */ + fra.me.REG[0] = CALL_program___Program___tc(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = CALL_compiling_base___ToolContext___no_cc(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + CALL_compiling_base___CProgram___run_c_compiler(fra.me.REG[1])(fra.me.REG[1]); } - tracehead = trace.prev; + stack_frame_head = fra.me.prev; return; } -void compiling___MMSrcModule___compile_main(val_t self, val_t param0, val_t param1) { - struct trace_t trace = {NULL, NULL, 80, LOCATE_compiling___MMSrcModule___compile_main}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - val_t variable7; - val_t variable8; - val_t variable9; - val_t variable10; - val_t variable11; - val_t variable12; - val_t variable13; - val_t variable14; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_compiling; - variable0 = param0; - variable1 = param1; - variable3 = NEW_compiling_base___CompilerVisitor___init( self); /*new CompilerVisitor*/ - variable2 = variable3; - ((compiling_base___CompilerVisitor___tc__eq_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___tc__eq))( variable2 /*v*/, variable0 /*tc*/) /*CompilerVisitor::tc=*/; - ((compiling_global___CompilerVisitor___global_analysis__eq_t)CALL( variable2 /*v*/,COLOR_compiling_global___CompilerVisitor___global_analysis__eq))( variable2 /*v*/, variable1 /*ga*/) /*CompilerVisitor::global_analysis=*/; - variable3 = NEW_string___String___with_native(BOX_NativeString("#include "), TAG_Int(23)); /*new String*/ - ((compiling_base___CompilerVisitor___add_decl_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___add_decl))( variable2 /*v*/, variable3) /*CompilerVisitor::add_decl*/; - ((compiling_global___MMSrcModule___compile_tables_to_c_t)CALL( self,COLOR_compiling_global___MMSrcModule___compile_tables_to_c))( self, variable2 /*v*/) /*MMSrcModule::compile_tables_to_c*/; - ((compiling_global___MMSrcModule___compile_main_part_t)CALL( self,COLOR_compiling_global___MMSrcModule___compile_main_part))( self, variable2 /*v*/) /*MMSrcModule::compile_main_part*/; - variable4 = NEW_string___String___init(); /*new String*/ - variable5 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable6 = variable5; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable6) /*String::append*/; - variable7 = ((compiling_base___ToolContext___compdir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___compdir))( variable0 /*tc*/) /*ToolContext::compdir*/; - variable8 = variable7; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable8) /*String::append*/; - variable9 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable10 = variable9; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable10) /*String::append*/; - variable11 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable12 = variable11; - variable12 = ((string___String___to_s_t)CALL(variable12,COLOR_string___Object___to_s))(variable12) /*String::to_s*/; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable12) /*String::append*/; - variable13 = NEW_string___String___with_native(BOX_NativeString("._tables.c"), TAG_Int(10)); /*new String*/ - variable14 = variable13; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable14) /*String::append*/; - variable5 = NEW_file___OFStream___open(variable4); /*new OFStream*/ - variable4 = variable5; - variable3 = variable4; - variable4 = NEW_string___String___init(); /*new String*/ - variable5 = NEW_string___String___with_native(BOX_NativeString("/* This C file is generated by NIT to compile program "), TAG_Int(54)); /*new String*/ - variable6 = variable5; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable6) /*String::append*/; - variable7 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable8 = variable7; - variable8 = ((string___String___to_s_t)CALL(variable8,COLOR_string___Object___to_s))(variable8) /*String::to_s*/; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable8) /*String::append*/; - variable9 = NEW_string___String___with_native(BOX_NativeString(". */\n"), TAG_Int(5)); /*new String*/ - variable10 = variable9; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable10) /*String::append*/; - ((file___OFStream___write_t)CALL( variable3 /*f*/,COLOR_stream___OStream___write))( variable3 /*f*/, variable4) /*OFStream::write*/; - variable4 = ((abstractmetamodel___MMModule___mhe_t)CALL( self,COLOR_abstractmetamodel___MMModule___mhe))( self) /*MMModule::mhe*/; - variable4 = ((partial_order___PartialOrderElement___greaters_and_self_t)CALL(variable4,COLOR_partial_order___PartialOrderElement___greaters_and_self))(variable4) /*PartialOrderElement::greaters_and_self*/; - variable4 = ((abstract_collection___Collection___iterator_t)CALL(variable4,COLOR_abstract_collection___Collection___iterator))(variable4) /*Collection::iterator*/; - while (true) { /*for*/ - variable5 = ((abstract_collection___Iterator___is_ok_t)CALL(variable4,COLOR_abstract_collection___Iterator___is_ok))(variable4) /*Iterator::is_ok*/; - if (!UNTAG_Bool(variable5)) break; /*for*/ - variable5 = ((abstract_collection___Iterator___item_t)CALL(variable4,COLOR_abstract_collection___Iterator___item))(variable4) /*Iterator::item*/; - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((abstractmetamodel___MMModule___name_t)CALL( variable5 /*m*/,COLOR_abstractmetamodel___MMModule___name))( variable5 /*m*/) /*MMModule::name*/; - variable10 = variable9; - variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString("._sep.h\"\n"), TAG_Int(9)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - ((file___OFStream___write_t)CALL( variable3 /*f*/,COLOR_stream___OStream___write))( variable3 /*f*/, variable6) /*OFStream::write*/; - continue_4: while(0); - ((abstract_collection___Iterator___next_t)CALL(variable4,COLOR_abstract_collection___Iterator___next))(variable4) /*Iterator::next*/; + void OC_compiling___Program___compile_prog_to_c_5(struct stack_frame_t *closctx, val_t p0, struct stack_frame_t *closctx_param, fun_t clos_fun0){ + struct {struct stack_frame_t me;} fra; + fun_t CREG[1]; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 0; + fra.me.meth = LOCATE_compiling___Program___compile_prog_to_c; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.closure_ctx = closctx_param; + fra.me.closure_funs = CREG; + fra.me.REG[0] = p0; + CREG[0] = clos_fun0; + CALL_compiling___MMModule___compile_separate_module(fra.me.REG[0])(fra.me.REG[0], closctx->REG[1]); + stack_frame_head = fra.me.prev; + return; } - break_4: while(0); - variable4 = ((compiling_base___CompilerVisitor___to_s_t)CALL( variable2 /*v*/,COLOR_string___Object___to_s))( variable2 /*v*/) /*CompilerVisitor::to_s*/; - ((file___OFStream___write_t)CALL( variable3 /*f*/,COLOR_stream___OStream___write))( variable3 /*f*/, variable4) /*OFStream::write*/; - ((file___OFStream___close_t)CALL( variable3 /*f*/,COLOR_stream___IOS___close))( variable3 /*f*/) /*OFStream::close*/; - tracehead = trace.prev; +void compiling___Program___compile_main(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[5];} fra; + val_t REGB0; + val_t tmp; + static val_t once_value_1; /* Once value */ + static val_t once_value_2; /* Once value */ + static val_t once_value_3; /* Once value */ + static val_t once_value_4; /* Once value */ + static val_t once_value_5; /* Once value */ + static val_t once_value_6; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 71; + fra.me.meth = LOCATE_compiling___Program___compile_main; + fra.me.has_broke = 0; + fra.me.REG_size = 6; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.REG[3] = NIT_NULL; + fra.me.REG[4] = NIT_NULL; + fra.me.REG[5] = NIT_NULL; + fra.me.REG[0] = p0; + fra.me.REG[1] = p1; + /* ./compiling//compiling.nit:74 */ + fra.me.REG[2] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = NEW_CompilerVisitor_compiling_base___CompilerVisitor___init(fra.me.REG[2], fra.me.REG[1]); + /* ./compiling//compiling.nit:75 */ + if (!once_value_1) { + fra.me.REG[3] = BOX_NativeString("#include "); + REGB0 = TAG_Int(23); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_1 = fra.me.REG[3]; + register_static_object(&once_value_1); + } else fra.me.REG[3] = once_value_1; + fra.me.REG[3] = fra.me.REG[3]; + CALL_compiling_base___CompilerVisitor___add_decl(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + /* ./compiling//compiling.nit:76 */ + CALL_compiling_global___Program___compile_tables_to_c(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]); + /* ./compiling//compiling.nit:77 */ + CALL_compiling_global___Program___compile_main_part(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]); + /* ./compiling//compiling.nit:78 */ + REGB0 = TAG_Int(5); + fra.me.REG[3] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_2) { + fra.me.REG[4] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_2 = fra.me.REG[4]; + register_static_object(&once_value_2); + } else fra.me.REG[4] = once_value_2; + fra.me.REG[4] = fra.me.REG[4]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + fra.me.REG[4] = CALL_compiling_base___CProgram___compdir(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + if (!once_value_3) { + fra.me.REG[4] = BOX_NativeString("/"); + REGB0 = TAG_Int(1); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_3 = fra.me.REG[4]; + register_static_object(&once_value_3); + } else fra.me.REG[4] = once_value_3; + fra.me.REG[4] = fra.me.REG[4]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + fra.me.REG[4] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[4] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[4])(fra.me.REG[4]); + fra.me.REG[4] = CALL_string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + if (!once_value_4) { + fra.me.REG[4] = BOX_NativeString("._tables.c"); + REGB0 = TAG_Int(10); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_4 = fra.me.REG[4]; + register_static_object(&once_value_4); + } else fra.me.REG[4] = once_value_4; + fra.me.REG[4] = fra.me.REG[4]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + fra.me.REG[3] = CALL_string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]); + /* ./compiling//compiling.nit:79 */ + fra.me.REG[4] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[3]); + /* ./compiling//compiling.nit:80 */ + fra.me.REG[3] = NEW_OFStream_file___OFStream___open(fra.me.REG[3]); + /* ./compiling//compiling.nit:81 */ + REGB0 = TAG_Int(3); + fra.me.REG[4] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_5) { + fra.me.REG[5] = BOX_NativeString("/* This C file is generated by NIT to compile program "); + REGB0 = TAG_Int(54); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_5 = fra.me.REG[5]; + register_static_object(&once_value_5); + } else fra.me.REG[5] = once_value_5; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + fra.me.REG[5] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[5] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[5])(fra.me.REG[5]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + if (!once_value_6) { + fra.me.REG[5] = BOX_NativeString(". */\n"); + REGB0 = TAG_Int(5); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_6 = fra.me.REG[5]; + register_static_object(&once_value_6); + } else fra.me.REG[5] = once_value_6; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + fra.me.REG[4] = CALL_string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]); + CALL_stream___OStream___write(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + /* ./compiling//compiling.nit:82 */ + fra.me.REG[0] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[0] = CALL_abstractmetamodel___MMModule___mhe(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Bool(fra.me.REG[0]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + nit_abort("Reciever is null", NULL, LOCATE_compiling, 82); + } + fra.me.REG[0] = CALL_partial_order___PartialOrderElement___greaters_and_self(fra.me.REG[0])(fra.me.REG[0]); + CALL_abstract_collection___Collection___iterate(fra.me.REG[0])(fra.me.REG[0], (&(fra.me)), ((fun_t)OC_compiling___Program___compile_main_7)); + /* ./compiling//compiling.nit:85 */ + fra.me.REG[1] = CALL_compiling_base___CompilerVisitor___header_writer(fra.me.REG[2])(fra.me.REG[2]); + CALL_compiling_writer___Writer___write_to_stream(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]); + /* ./compiling//compiling.nit:86 */ + fra.me.REG[2] = CALL_compiling_base___CompilerVisitor___writer(fra.me.REG[2])(fra.me.REG[2]); + CALL_compiling_writer___Writer___write_to_stream(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + /* ./compiling//compiling.nit:87 */ + CALL_stream___IOS___close(fra.me.REG[3])(fra.me.REG[3]); + stack_frame_head = fra.me.prev; return; } -void compiling___MMSrcModule___compile_separate_module(val_t self, val_t param0, val_t param1) { - struct trace_t trace = {NULL, NULL, 98, LOCATE_compiling___MMSrcModule___compile_separate_module}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - val_t variable7; - val_t variable8; - val_t variable9; - val_t variable10; - val_t variable11; - val_t variable12; - val_t variable13; - val_t variable14; - val_t variable15; - val_t variable16; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_compiling; - variable0 = param0; - variable1 = param1; - variable3 = NEW_compiling_base___CompilerVisitor___init( self); /*new CompilerVisitor*/ - variable2 = variable3; - ((compiling_base___CompilerVisitor___tc__eq_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___tc__eq))( variable2 /*v*/, variable0 /*tc*/) /*CompilerVisitor::tc=*/; - ((compiling_global___CompilerVisitor___global_analysis__eq_t)CALL( variable2 /*v*/,COLOR_compiling_global___CompilerVisitor___global_analysis__eq))( variable2 /*v*/, variable1 /*ga*/) /*CompilerVisitor::global_analysis=*/; - variable3 = NEW_string___String___with_native(BOX_NativeString("#include "), TAG_Int(23)); /*new String*/ - ((compiling_base___CompilerVisitor___add_decl_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___add_decl))( variable2 /*v*/, variable3) /*CompilerVisitor::add_decl*/; - variable4 = ((mmloader___MMModule___filename_t)CALL( self,COLOR_mmloader___MMModule___filename))( self) /*MMModule::filename*/; - variable5 = NEW_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/ - variable4 = ((file___String___strip_extension_t)CALL(variable4,COLOR_file___String___strip_extension))(variable4, variable5) /*String::strip_extension*/; - variable3 = variable4; - variable4 = NEW_string___String___with_native(BOX_NativeString("_nit.h"), TAG_Int(6)); /*new String*/ - ((string___String___append_t)CALL( variable3 /*native_name*/,COLOR_abstract_collection___IndexedCollection___append))( variable3 /*native_name*/, variable4) /*String::append*/; - variable4 = ((file___String___file_exists_t)CALL( variable3 /*native_name*/,COLOR_file___String___file_exists))( variable3 /*native_name*/) /*String::file_exists*/; - if (UNTAG_Bool(variable4)) { /*if*/ - variable4 = NEW_string___String___init(); /*new String*/ - variable5 = NEW_string___String___with_native(BOX_NativeString("#include <"), TAG_Int(10)); /*new String*/ - variable6 = variable5; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable6) /*String::append*/; - variable7 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable7 = ((file___String___basename_t)CALL( variable3 /*native_name*/,COLOR_file___String___basename))( variable3 /*native_name*/, variable7) /*String::basename*/; - variable8 = variable7; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable8) /*String::append*/; - variable9 = NEW_string___String___with_native(BOX_NativeString(">"), TAG_Int(1)); /*new String*/ - variable10 = variable9; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable10) /*String::append*/; - ((compiling_base___CompilerVisitor___add_decl_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___add_decl))( variable2 /*v*/, variable4) /*CompilerVisitor::add_decl*/; + void OC_compiling___Program___compile_main_7(struct stack_frame_t *closctx, val_t p0, struct stack_frame_t *closctx_param, fun_t clos_fun0){ + struct {struct stack_frame_t me; val_t MORE_REG[2];} fra; + val_t REGB0; + fun_t CREG[1]; + val_t tmp; + static val_t once_value_8; /* Once value */ + static val_t once_value_9; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 0; + fra.me.meth = LOCATE_compiling___Program___compile_main; + fra.me.has_broke = 0; + fra.me.REG_size = 3; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.closure_ctx = closctx_param; + fra.me.closure_funs = CREG; + fra.me.REG[0] = p0; + CREG[0] = clos_fun0; + /* ./compiling//compiling.nit:83 */ + REGB0 = TAG_Int(3); + fra.me.REG[1] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_8) { + fra.me.REG[2] = BOX_NativeString("#include \""); + REGB0 = TAG_Int(10); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_8 = fra.me.REG[2]; + register_static_object(&once_value_8); + } else fra.me.REG[2] = once_value_8; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + fra.me.REG[0] = CALL_compiling_base___CProgram___module_header_name(closctx->REG[1])(closctx->REG[1], fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + if (!once_value_9) { + fra.me.REG[0] = BOX_NativeString("\"\n"); + REGB0 = TAG_Int(2); + fra.me.REG[0] = NEW_String_string___String___with_native(fra.me.REG[0], REGB0); + once_value_9 = fra.me.REG[0]; + register_static_object(&once_value_9); + } else fra.me.REG[0] = once_value_9; + fra.me.REG[0] = fra.me.REG[0]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + fra.me.REG[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + CALL_stream___OStream___write(closctx->REG[3])(closctx->REG[3], fra.me.REG[1]); + stack_frame_head = fra.me.prev; + return; + } +void compiling___MMModule___compile_separate_module(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[9];} fra; + val_t REGB0; + val_t REGB1; + val_t tmp; + static val_t once_value_1; /* Once value */ + static val_t once_value_2; /* Once value */ + static val_t once_value_3; /* Once value */ + static val_t once_value_4; /* Once value */ + static val_t once_value_5; /* Once value */ + static val_t once_value_6; /* Once value */ + static val_t once_value_7; /* Once value */ + static val_t once_value_8; /* Once value */ + static val_t once_value_9; /* Once value */ + static val_t once_value_10; /* Once value */ + static val_t once_value_11; /* Once value */ + static val_t once_value_12; /* Once value */ + static val_t once_value_13; /* Once value */ + static val_t once_value_14; /* Once value */ + static val_t once_value_15; /* Once value */ + static val_t once_value_16; /* Once value */ + static val_t once_value_17; /* Once value */ + static val_t once_value_18; /* Once value */ + static val_t once_value_19; /* Once value */ + static val_t once_value_20; /* Once value */ + static val_t once_value_21; /* Once value */ + static val_t once_value_22; /* Once value */ + static val_t once_value_23; /* Once value */ + static val_t once_value_24; /* Once value */ + static val_t once_value_26; /* Once value */ + static val_t once_value_27; /* Once value */ + static val_t once_value_28; /* Once value */ + static val_t once_value_29; /* Once value */ + static val_t once_value_30; /* Once value */ + static val_t once_value_31; /* Once value */ + static val_t once_value_32; /* Once value */ + static val_t once_value_33; /* Once value */ + static val_t once_value_34; /* Once value */ + static val_t once_value_35; /* Once value */ + static val_t once_value_36; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_compiling; + fra.me.line = 92; + fra.me.meth = LOCATE_compiling___MMModule___compile_separate_module; + fra.me.has_broke = 0; + fra.me.REG_size = 10; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.REG[3] = NIT_NULL; + fra.me.REG[4] = NIT_NULL; + fra.me.REG[5] = NIT_NULL; + fra.me.REG[6] = NIT_NULL; + fra.me.REG[7] = NIT_NULL; + fra.me.REG[8] = NIT_NULL; + fra.me.REG[9] = NIT_NULL; + fra.me.REG[0] = p0; + fra.me.REG[1] = p1; + /* ./compiling//compiling.nit:95 */ + fra.me.REG[2] = CALL_compiling_base___CProgram___program(fra.me.REG[1])(fra.me.REG[1]); + fra.me.REG[2] = CALL_program___Program___tc(fra.me.REG[2])(fra.me.REG[2]); + /* ./compiling//compiling.nit:96 */ + REGB0 = TAG_Int(3); + fra.me.REG[3] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_1) { + fra.me.REG[4] = BOX_NativeString("Generating C code for module: "); + REGB0 = TAG_Int(30); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_1 = fra.me.REG[4]; + register_static_object(&once_value_1); + } else fra.me.REG[4] = once_value_1; + fra.me.REG[4] = fra.me.REG[4]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + fra.me.REG[4] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[4] = CALL_string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + if (!once_value_2) { + fra.me.REG[4] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_2 = fra.me.REG[4]; + register_static_object(&once_value_2); + } else fra.me.REG[4] = once_value_2; + fra.me.REG[4] = fra.me.REG[4]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + fra.me.REG[3] = CALL_string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]); + REGB0 = TAG_Int(2); + CALL_mmloader___ToolContext___info(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3], REGB0); + /* ./compiling//compiling.nit:97 */ + fra.me.REG[3] = NEW_CompilerVisitor_compiling_base___CompilerVisitor___init(fra.me.REG[0], fra.me.REG[1]); + /* ./compiling//compiling.nit:98 */ + if (!once_value_3) { + fra.me.REG[2] = BOX_NativeString("#include "); + REGB0 = TAG_Int(23); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_3 = fra.me.REG[2]; + register_static_object(&once_value_3); + } else fra.me.REG[2] = once_value_3; + fra.me.REG[2] = fra.me.REG[2]; + CALL_compiling_base___CompilerVisitor___add_decl(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]); + /* ./compiling//compiling.nit:100 */ + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___location(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_location___Location___file(fra.me.REG[2])(fra.me.REG[2]); + if (!once_value_4) { + fra.me.REG[4] = BOX_NativeString(".nit"); + REGB0 = TAG_Int(4); + fra.me.REG[4] = NEW_String_string___String___with_native(fra.me.REG[4], REGB0); + once_value_4 = fra.me.REG[4]; + register_static_object(&once_value_4); + } else fra.me.REG[4] = once_value_4; + fra.me.REG[4] = fra.me.REG[4]; + fra.me.REG[4] = CALL_file___String___strip_extension(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[4]); + /* ./compiling//compiling.nit:101 */ + if (!once_value_5) { + fra.me.REG[2] = BOX_NativeString("_nit.h"); + REGB0 = TAG_Int(6); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_5 = fra.me.REG[2]; + register_static_object(&once_value_5); + } else fra.me.REG[2] = once_value_5; + fra.me.REG[2] = fra.me.REG[2]; + fra.me.REG[2] = CALL_string___String_____plus(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[2]); + /* ./compiling//compiling.nit:102 */ + REGB0 = CALL_file___String___file_exists(fra.me.REG[2])(fra.me.REG[2]); + if (UNTAG_Bool(REGB0)) { + /* ./compiling//compiling.nit:103 */ + REGB0 = TAG_Int(3); + fra.me.REG[5] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_6) { + fra.me.REG[6] = BOX_NativeString("#include <"); + REGB0 = TAG_Int(10); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_6 = fra.me.REG[6]; + register_static_object(&once_value_6); + } else fra.me.REG[6] = once_value_6; + fra.me.REG[6] = fra.me.REG[6]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]); + if (!once_value_7) { + fra.me.REG[6] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_7 = fra.me.REG[6]; + register_static_object(&once_value_7); + } else fra.me.REG[6] = once_value_7; + fra.me.REG[6] = fra.me.REG[6]; + fra.me.REG[6] = CALL_file___String___basename(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[6]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]); + if (!once_value_8) { + fra.me.REG[6] = BOX_NativeString(">"); + REGB0 = TAG_Int(1); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_8 = fra.me.REG[6]; + register_static_object(&once_value_8); + } else fra.me.REG[6] = once_value_8; + fra.me.REG[6] = fra.me.REG[6]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_compiling_base___CompilerVisitor___add_decl(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[5]); + /* ./compiling//compiling.nit:104 */ + fra.me.REG[5] = CALL_compiling_base___CProgram___include_dirs(fra.me.REG[1])(fra.me.REG[1]); + REGB0 = TAG_Int(3); + fra.me.REG[6] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_9) { + fra.me.REG[2] = BOX_NativeString("-I "); + REGB0 = TAG_Int(3); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_9 = fra.me.REG[2]; + register_static_object(&once_value_9); + } else fra.me.REG[2] = once_value_9; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[2]); + fra.me.REG[2] = CALL_file___String___dirname(fra.me.REG[4])(fra.me.REG[4]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[2]); + if (!once_value_10) { + fra.me.REG[2] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_10 = fra.me.REG[2]; + register_static_object(&once_value_10); + } else fra.me.REG[2] = once_value_10; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[2]); + fra.me.REG[6] = CALL_string___Object___to_s(fra.me.REG[6])(fra.me.REG[6]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]); + } + /* ./compiling//compiling.nit:106 */ + if (!once_value_11) { + fra.me.REG[6] = BOX_NativeString("_nit.c"); + REGB0 = TAG_Int(6); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_11 = fra.me.REG[6]; + register_static_object(&once_value_11); + } else fra.me.REG[6] = once_value_11; + fra.me.REG[6] = fra.me.REG[6]; + fra.me.REG[6] = CALL_string___String_____plus(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[6]); + /* ./compiling//compiling.nit:107 */ + REGB0 = CALL_file___String___file_exists(fra.me.REG[6])(fra.me.REG[6]); + if (UNTAG_Bool(REGB0)) { + fra.me.REG[4] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[6]); + } + /* ./compiling//compiling.nit:109 */ + CALL_compiling_global___MMModule___declare_class_tables_to_c(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]); + /* ./compiling//compiling.nit:110 */ + CALL_compiling_global___MMModule___compile_mod_to_c(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]); + /* ./compiling//compiling.nit:112 */ + fra.me.REG[6] = CALL_compiling_base___CProgram___module_header_name(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + /* ./compiling//compiling.nit:113 */ + REGB0 = TAG_Int(5); + fra.me.REG[4] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_12) { + fra.me.REG[5] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_12 = fra.me.REG[5]; + register_static_object(&once_value_12); + } else fra.me.REG[5] = once_value_12; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + fra.me.REG[5] = CALL_compiling_base___CProgram___compdir(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + if (!once_value_13) { + fra.me.REG[5] = BOX_NativeString("/"); + REGB0 = TAG_Int(1); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_13 = fra.me.REG[5]; + register_static_object(&once_value_13); + } else fra.me.REG[5] = once_value_13; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[6]); + if (!once_value_14) { + fra.me.REG[5] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_14 = fra.me.REG[5]; + register_static_object(&once_value_14); + } else fra.me.REG[5] = once_value_14; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + fra.me.REG[4] = CALL_string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]); + fra.me.REG[4] = NEW_OFStream_file___OFStream___open(fra.me.REG[4]); + /* ./compiling//compiling.nit:114 */ + REGB0 = TAG_Int(3); + fra.me.REG[5] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_15) { + fra.me.REG[2] = BOX_NativeString("/* This C header file is generated by NIT to compile modules and programs that requires "); + REGB0 = TAG_Int(88); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_15 = fra.me.REG[2]; + register_static_object(&once_value_15); + } else fra.me.REG[2] = once_value_15; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + if (!once_value_16) { + fra.me.REG[2] = BOX_NativeString(". */\n"); + REGB0 = TAG_Int(5); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_16 = fra.me.REG[2]; + register_static_object(&once_value_16); + } else fra.me.REG[2] = once_value_16; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + /* ./compiling//compiling.nit:115 */ + REGB0 = TAG_Int(5); + fra.me.REG[5] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_17) { + fra.me.REG[2] = BOX_NativeString("#ifndef "); + REGB0 = TAG_Int(8); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_17 = fra.me.REG[2]; + register_static_object(&once_value_17); + } else fra.me.REG[2] = once_value_17; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + if (!once_value_18) { + fra.me.REG[2] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_18 = fra.me.REG[2]; + register_static_object(&once_value_18); + } else fra.me.REG[2] = once_value_18; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[2] = CALL_compiling_base___CProgram___get_file_ending(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + if (!once_value_19) { + fra.me.REG[2] = BOX_NativeString("\n"); + REGB0 = TAG_Int(1); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_19 = fra.me.REG[2]; + register_static_object(&once_value_19); + } else fra.me.REG[2] = once_value_19; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + /* ./compiling//compiling.nit:116 */ + REGB0 = TAG_Int(5); + fra.me.REG[5] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_20) { + fra.me.REG[2] = BOX_NativeString("#define "); + REGB0 = TAG_Int(8); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_20 = fra.me.REG[2]; + register_static_object(&once_value_20); + } else fra.me.REG[2] = once_value_20; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + if (!once_value_21) { + fra.me.REG[2] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_21 = fra.me.REG[2]; + register_static_object(&once_value_21); + } else fra.me.REG[2] = once_value_21; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[2] = CALL_compiling_base___CProgram___get_file_ending(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + if (!once_value_22) { + fra.me.REG[2] = BOX_NativeString("\n"); + REGB0 = TAG_Int(1); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_22 = fra.me.REG[2]; + register_static_object(&once_value_22); + } else fra.me.REG[2] = once_value_22; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + /* ./compiling//compiling.nit:117 */ + fra.me.REG[5] = CALL_abstractmetamodel___MMModule___mhe(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Bool(fra.me.REG[5]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + nit_abort("Reciever is null", NULL, LOCATE_compiling, 117); } - ((compiling_global___MMSrcModule___declare_class_tables_to_c_t)CALL( self,COLOR_compiling_global___MMSrcModule___declare_class_tables_to_c))( self, variable2 /*v*/) /*MMSrcModule::declare_class_tables_to_c*/; - ((compiling_global___MMSrcModule___compile_mod_to_c_t)CALL( self,COLOR_compiling_global___MMSrcModule___compile_mod_to_c))( self, variable2 /*v*/) /*MMSrcModule::compile_mod_to_c*/; - variable5 = NEW_string___String___init(); /*new String*/ - variable6 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable7 = variable6; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/; - variable8 = ((compiling_base___ToolContext___compdir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___compdir))( variable0 /*tc*/) /*ToolContext::compdir*/; - variable9 = variable8; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable9) /*String::append*/; - variable10 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable11 = variable10; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable11) /*String::append*/; - variable12 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable13 = variable12; - variable13 = ((string___String___to_s_t)CALL(variable13,COLOR_string___Object___to_s))(variable13) /*String::to_s*/; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable13) /*String::append*/; - variable14 = NEW_string___String___with_native(BOX_NativeString("._sep.h"), TAG_Int(7)); /*new String*/ - variable15 = variable14; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable15) /*String::append*/; - variable6 = NEW_file___OFStream___open(variable5); /*new OFStream*/ - variable5 = variable6; - variable4 = variable5; - variable5 = NEW_string___String___init(); /*new String*/ - variable6 = NEW_string___String___with_native(BOX_NativeString("/* This C header file is generated by NIT to compile modules and programs that requires "), TAG_Int(88)); /*new String*/ - variable7 = variable6; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/; - variable8 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable9 = variable8; - variable9 = ((string___String___to_s_t)CALL(variable9,COLOR_string___Object___to_s))(variable9) /*String::to_s*/; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable9) /*String::append*/; - variable10 = NEW_string___String___with_native(BOX_NativeString(". */\n"), TAG_Int(5)); /*new String*/ - variable11 = variable10; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable11) /*String::append*/; - ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable5) /*OFStream::write*/; - variable5 = NEW_string___String___init(); /*new String*/ - variable6 = NEW_string___String___with_native(BOX_NativeString("#ifndef "), TAG_Int(8)); /*new String*/ - variable7 = variable6; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/; - variable8 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable9 = variable8; - variable9 = ((string___String___to_s_t)CALL(variable9,COLOR_string___Object___to_s))(variable9) /*String::to_s*/; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable9) /*String::append*/; - variable10 = NEW_string___String___with_native(BOX_NativeString("_sep\n"), TAG_Int(5)); /*new String*/ - variable11 = variable10; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable11) /*String::append*/; - ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable5) /*OFStream::write*/; - variable5 = NEW_string___String___init(); /*new String*/ - variable6 = NEW_string___String___with_native(BOX_NativeString("#define "), TAG_Int(8)); /*new String*/ - variable7 = variable6; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/; - variable8 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable9 = variable8; - variable9 = ((string___String___to_s_t)CALL(variable9,COLOR_string___Object___to_s))(variable9) /*String::to_s*/; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable9) /*String::append*/; - variable10 = NEW_string___String___with_native(BOX_NativeString("_sep\n"), TAG_Int(5)); /*new String*/ - variable11 = variable10; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable11) /*String::append*/; - ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable5) /*OFStream::write*/; - variable5 = ((abstractmetamodel___MMModule___mhe_t)CALL( self,COLOR_abstractmetamodel___MMModule___mhe))( self) /*MMModule::mhe*/; - variable5 = ((partial_order___PartialOrderElement___direct_greaters_t)CALL(variable5,COLOR_partial_order___PartialOrderElement___direct_greaters))(variable5) /*PartialOrderElement::direct_greaters*/; - variable5 = ((array___AbstractArray___iterator_t)CALL(variable5,COLOR_abstract_collection___Collection___iterator))(variable5) /*AbstractArray::iterator*/; - while (true) { /*for*/ - variable6 = ((array___ArrayIterator___is_ok_t)CALL(variable5,COLOR_abstract_collection___Iterator___is_ok))(variable5) /*ArrayIterator::is_ok*/; - if (!UNTAG_Bool(variable6)) break; /*for*/ - variable6 = ((array___ArrayIterator___item_t)CALL(variable5,COLOR_abstract_collection___Iterator___item))(variable5) /*ArrayIterator::item*/; - variable7 = NEW_string___String___init(); /*new String*/ - variable8 = NEW_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/ - variable9 = variable8; - ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable9) /*String::append*/; - variable10 = ((abstractmetamodel___MMModule___name_t)CALL( variable6 /*m*/,COLOR_abstractmetamodel___MMModule___name))( variable6 /*m*/) /*MMModule::name*/; - variable11 = variable10; - variable11 = ((string___String___to_s_t)CALL(variable11,COLOR_string___Object___to_s))(variable11) /*String::to_s*/; - ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable11) /*String::append*/; - variable12 = NEW_string___String___with_native(BOX_NativeString("._sep.h\"\n"), TAG_Int(9)); /*new String*/ - variable13 = variable12; - ((string___String___append_t)CALL(variable7,COLOR_abstract_collection___IndexedCollection___append))(variable7, variable13) /*String::append*/; - ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable7) /*OFStream::write*/; - continue_6: while(0); - ((array___ArrayIterator___next_t)CALL(variable5,COLOR_abstract_collection___Iterator___next))(variable5) /*ArrayIterator::next*/; + fra.me.REG[5] = CALL_partial_order___PartialOrderElement___direct_greaters(fra.me.REG[5])(fra.me.REG[5]); + /* ./../lib/standard//collection//array.nit:234 */ + REGB0 = TAG_Int(0); + /* ./../lib/standard//collection//array.nit:235 */ + REGB1 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[5])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 235); + } + REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[5]); + /* ./../lib/standard//collection//array.nit:236 */ + fra.me.REG[2] = ATTR_array___Array____items(fra.me.REG[5]); + /* ./../lib/standard//collection//array.nit:237 */ + while(1) { + /* ./../lib/standard//collection//array.nit:23 */ + REGB1 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[5])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 23); + } + REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[5]); + /* ./../lib/standard//kernel.nit:212 */ + REGB1 = TAG_Bool(UNTAG_Int(REGB0)val[UNTAG_Int(REGB0)]; + /* ./compiling//compiling.nit:117 */ + REGB1 = TAG_Int(3); + fra.me.REG[8] = NEW_Array_array___Array___with_capacity(REGB1); + if (!once_value_23) { + fra.me.REG[9] = BOX_NativeString("#include \""); + REGB1 = TAG_Int(10); + fra.me.REG[9] = NEW_String_string___String___with_native(fra.me.REG[9], REGB1); + once_value_23 = fra.me.REG[9]; + register_static_object(&once_value_23); + } else fra.me.REG[9] = once_value_23; + fra.me.REG[9] = fra.me.REG[9]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[8])(fra.me.REG[8], fra.me.REG[9]); + fra.me.REG[7] = CALL_compiling_base___CProgram___module_header_name(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[7]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[8])(fra.me.REG[8], fra.me.REG[7]); + if (!once_value_24) { + fra.me.REG[7] = BOX_NativeString("\"\n"); + REGB1 = TAG_Int(2); + fra.me.REG[7] = NEW_String_string___String___with_native(fra.me.REG[7], REGB1); + once_value_24 = fra.me.REG[7]; + register_static_object(&once_value_24); + } else fra.me.REG[7] = once_value_24; + fra.me.REG[7] = fra.me.REG[7]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[8])(fra.me.REG[8], fra.me.REG[7]); + fra.me.REG[8] = CALL_string___Object___to_s(fra.me.REG[8])(fra.me.REG[8]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[8]); + /* ./../lib/standard//collection//array.nit:239 */ + REGB1 = TAG_Int(1); + /* ./../lib/standard//kernel.nit:215 */ + REGB1 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB1)); + /* ./../lib/standard//collection//array.nit:239 */ + REGB0 = REGB1; + } else { + /* ./../lib/standard//collection//array.nit:237 */ + goto label25; + } } - break_6: while(0); - variable5 = ((compiling_base___CompilerVisitor___ctx_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___ctx))( variable2 /*v*/) /*CompilerVisitor::ctx*/; - variable5 = ((compiling_base___CContext___decls_t)CALL(variable5,COLOR_compiling_base___CContext___decls))(variable5) /*CContext::decls*/; - variable6 = NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/ - variable5 = ((string___Collection___join_t)CALL(variable5,COLOR_string___Collection___join))(variable5, variable6) /*Collection::join*/; - ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable5) /*OFStream::write*/; - variable5 = NEW_string___String___with_native(BOX_NativeString("\n#endif\n"), TAG_Int(8)); /*new String*/ - ((file___OFStream___write_t)CALL( variable4 /*f*/,COLOR_stream___OStream___write))( variable4 /*f*/, variable5) /*OFStream::write*/; - ((file___OFStream___close_t)CALL( variable4 /*f*/,COLOR_stream___IOS___close))( variable4 /*f*/) /*OFStream::close*/; - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((compiling_base___ToolContext___compdir_t)CALL( variable0 /*tc*/,COLOR_compiling_base___ToolContext___compdir))( variable0 /*tc*/) /*ToolContext::compdir*/; - variable10 = variable9; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - variable13 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable14 = variable13; - variable14 = ((string___String___to_s_t)CALL(variable14,COLOR_string___Object___to_s))(variable14) /*String::to_s*/; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable14) /*String::append*/; - variable15 = NEW_string___String___with_native(BOX_NativeString("._sep.c"), TAG_Int(7)); /*new String*/ - variable16 = variable15; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable16) /*String::append*/; - variable7 = NEW_file___OFStream___open(variable6); /*new OFStream*/ - variable6 = variable7; - variable5 = variable6; - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString("/* This C file is generated by NIT to compile module "), TAG_Int(53)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable10 = variable9; - variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString(". */\n"), TAG_Int(5)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString("#include \""), TAG_Int(10)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = ((abstractmetamodel___MMModule___name_t)CALL( self,COLOR_abstractmetamodel___MMModule___name))( self) /*MMModule::name*/; - variable10 = variable9; - variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString("._sep.h\"\n"), TAG_Int(9)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable12) /*String::append*/; - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - variable6 = ((compiling_base___CompilerVisitor___ctx_t)CALL( variable2 /*v*/,COLOR_compiling_base___CompilerVisitor___ctx))( variable2 /*v*/) /*CompilerVisitor::ctx*/; - variable6 = ((compiling_base___CContext___instrs_t)CALL(variable6,COLOR_compiling_base___CContext___instrs))(variable6) /*CContext::instrs*/; - variable7 = NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/ - variable6 = ((string___Collection___join_t)CALL(variable6,COLOR_string___Collection___join))(variable6, variable7) /*Collection::join*/; - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - variable6 = NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/ - ((file___OFStream___write_t)CALL( variable5 /*f*/,COLOR_stream___OStream___write))( variable5 /*f*/, variable6) /*OFStream::write*/; - ((file___OFStream___close_t)CALL( variable5 /*f*/,COLOR_stream___IOS___close))( variable5 /*f*/) /*OFStream::close*/; - tracehead = trace.prev; + label25: while(0); + /* ./compiling//compiling.nit:118 */ + fra.me.REG[2] = CALL_compiling_base___CompilerVisitor___header_writer(fra.me.REG[3])(fra.me.REG[3]); + CALL_compiling_writer___Writer___write_to_stream(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[4]); + /* ./compiling//compiling.nit:119 */ + if (!once_value_26) { + fra.me.REG[2] = BOX_NativeString("#endif\n"); + REGB0 = TAG_Int(7); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_26 = fra.me.REG[2]; + register_static_object(&once_value_26); + } else fra.me.REG[2] = once_value_26; + fra.me.REG[2] = fra.me.REG[2]; + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[2]); + /* ./compiling//compiling.nit:120 */ + CALL_stream___IOS___close(fra.me.REG[4])(fra.me.REG[4]); + /* ./compiling//compiling.nit:122 */ + REGB0 = TAG_Int(7); + fra.me.REG[2] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_27) { + fra.me.REG[5] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_27 = fra.me.REG[5]; + register_static_object(&once_value_27); + } else fra.me.REG[5] = once_value_27; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + fra.me.REG[5] = CALL_compiling_base___CProgram___compdir(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + if (!once_value_28) { + fra.me.REG[5] = BOX_NativeString("/"); + REGB0 = TAG_Int(1); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_28 = fra.me.REG[5]; + register_static_object(&once_value_28); + } else fra.me.REG[5] = once_value_28; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + fra.me.REG[5] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[5] = CALL_string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + if (!once_value_29) { + fra.me.REG[5] = BOX_NativeString("."); + REGB0 = TAG_Int(1); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_29 = fra.me.REG[5]; + register_static_object(&once_value_29); + } else fra.me.REG[5] = once_value_29; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + fra.me.REG[5] = CALL_compiling_base___CProgram___get_file_ending(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + if (!once_value_30) { + fra.me.REG[5] = BOX_NativeString(".c"); + REGB0 = TAG_Int(2); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_30 = fra.me.REG[5]; + register_static_object(&once_value_30); + } else fra.me.REG[5] = once_value_30; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[5]); + fra.me.REG[2] = CALL_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + /* ./compiling//compiling.nit:123 */ + fra.me.REG[1] = CALL_compiling_base___CProgram___files(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + /* ./compiling//compiling.nit:124 */ + REGB0 = TAG_Int(3); + fra.me.REG[1] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_31) { + fra.me.REG[5] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[5] = NEW_String_string___String___with_native(fra.me.REG[5], REGB0); + once_value_31 = fra.me.REG[5]; + register_static_object(&once_value_31); + } else fra.me.REG[5] = once_value_31; + fra.me.REG[5] = fra.me.REG[5]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[5]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + if (!once_value_32) { + fra.me.REG[2] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_32 = fra.me.REG[2]; + register_static_object(&once_value_32); + } else fra.me.REG[2] = once_value_32; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + fra.me.REG[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + fra.me.REG[1] = NEW_OFStream_file___OFStream___open(fra.me.REG[1]); + fra.me.REG[4] = fra.me.REG[1]; + /* ./compiling//compiling.nit:125 */ + REGB0 = TAG_Int(3); + fra.me.REG[1] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_33) { + fra.me.REG[2] = BOX_NativeString("/* This C file is generated by NIT to compile module "); + REGB0 = TAG_Int(53); + fra.me.REG[2] = NEW_String_string___String___with_native(fra.me.REG[2], REGB0); + once_value_33 = fra.me.REG[2]; + register_static_object(&once_value_33); + } else fra.me.REG[2] = once_value_33; + fra.me.REG[2] = fra.me.REG[2]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + fra.me.REG[0] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[0] = CALL_string___Object___to_s(fra.me.REG[0])(fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + if (!once_value_34) { + fra.me.REG[0] = BOX_NativeString(". */\n"); + REGB0 = TAG_Int(5); + fra.me.REG[0] = NEW_String_string___String___with_native(fra.me.REG[0], REGB0); + once_value_34 = fra.me.REG[0]; + register_static_object(&once_value_34); + } else fra.me.REG[0] = once_value_34; + fra.me.REG[0] = fra.me.REG[0]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + fra.me.REG[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[1]); + /* ./compiling//compiling.nit:126 */ + REGB0 = TAG_Int(3); + fra.me.REG[1] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_35) { + fra.me.REG[0] = BOX_NativeString("#include \""); + REGB0 = TAG_Int(10); + fra.me.REG[0] = NEW_String_string___String___with_native(fra.me.REG[0], REGB0); + once_value_35 = fra.me.REG[0]; + register_static_object(&once_value_35); + } else fra.me.REG[0] = once_value_35; + fra.me.REG[0] = fra.me.REG[0]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[6]); + if (!once_value_36) { + fra.me.REG[6] = BOX_NativeString("\"\n"); + REGB0 = TAG_Int(2); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_36 = fra.me.REG[6]; + register_static_object(&once_value_36); + } else fra.me.REG[6] = once_value_36; + fra.me.REG[6] = fra.me.REG[6]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[6]); + fra.me.REG[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + CALL_stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[1]); + /* ./compiling//compiling.nit:127 */ + fra.me.REG[3] = CALL_compiling_base___CompilerVisitor___top_writer(fra.me.REG[3])(fra.me.REG[3]); + CALL_compiling_writer___Writer___write_to_stream(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]); + /* ./compiling//compiling.nit:128 */ + CALL_stream___IOS___close(fra.me.REG[4])(fra.me.REG[4]); + stack_frame_head = fra.me.prev; return; }