X-Git-Url: http://nitlanguage.org diff --git a/c_src/mmloader._sep.c b/c_src/mmloader._sep.c index 97b6e25..128275d 100644 --- a/c_src/mmloader._sep.c +++ b/c_src/mmloader._sep.c @@ -1,863 +1,2277 @@ /* This C file is generated by NIT to compile module mmloader. */ #include "mmloader._sep.h" -val_t mmloader___ToolContext___error_count(val_t self) { - struct trace_t trace = {NULL, NULL, 27, LOCATE_mmloader___ToolContext___error_count}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___ToolContext____error_count( self) /*ToolContext::_error_count*/; -} -val_t mmloader___ToolContext___warning_count(val_t self) { - struct trace_t trace = {NULL, NULL, 30, LOCATE_mmloader___ToolContext___warning_count}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___ToolContext____warning_count( self) /*ToolContext::_warning_count*/; -} -void mmloader___ToolContext___error(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 33, LOCATE_mmloader___ToolContext___error}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - val_t variable7; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable1 = ((file___Object___stderr_t)CALL( self,COLOR_file___Object___stderr))( self) /*Object::stderr*/; - variable2 = NEW_string___String___init(); /*new String*/ - variable3 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable4 = variable3; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable4) /*String::append*/; - variable5 = variable0 /*s*/; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable5) /*String::append*/; - variable6 = NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/ - variable7 = variable6; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable7) /*String::append*/; - ((file___OFStream___write_t)CALL(variable1,COLOR_stream___OStream___write))(variable1, variable2) /*OFStream::write*/; - variable1 = ATTR_mmloader___ToolContext____error_count( self) /*ToolContext::_error_count*/; - variable1 = TAG_Int(UNTAG_Int(variable1)+UNTAG_Int( TAG_Int(1))); - ATTR_mmloader___ToolContext____error_count( self) /*ToolContext::_error_count*/ = variable1; - tracehead = trace.prev; +val_t mmloader___Message___location(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 30; + fra.me.meth = LOCATE_mmloader___Message___location; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:30 */ + fra.me.REG[0] = ATTR_mmloader___Message____location(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___Message___text(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_mmloader; + fra.me.line = 31; + fra.me.meth = LOCATE_mmloader___Message___text; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:31 */ + REGB0 = TAG_Bool(ATTR_mmloader___Message____text(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_text", LOCATE_mmloader, 31); + } + fra.me.REG[0] = ATTR_mmloader___Message____text(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___Message_____l(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[2];} fra; + val_t REGB0; + val_t REGB1; + val_t REGB2; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 33; + fra.me.meth = LOCATE_mmloader___Message_____l; + 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; + fra.me.REG[1] = p1; + /* ./mmloader.nit:34 */ + fra.me.REG[2] = CALL_mmloader___Message___location(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + REGB1 = TAG_Bool(false); + REGB0 = REGB1; + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[2])(fra.me.REG[2], NIT_NULL); + REGB0 = REGB1; + } + } + if (UNTAG_Bool(REGB0)) { + REGB0 = TAG_Bool(true); + goto label1; + } + /* ./mmloader.nit:35 */ + fra.me.REG[2] = CALL_mmloader___Message___location(fra.me.REG[1])(fra.me.REG[1]); + REGB1 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + REGB2 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB2)) { + REGB2 = TAG_Bool(false); + REGB1 = REGB2; + } else { + REGB2 = CALL_kernel___Object_____eqeq(fra.me.REG[2])(fra.me.REG[2], NIT_NULL); + REGB1 = REGB2; + } + } + if (UNTAG_Bool(REGB1)) { + REGB1 = TAG_Bool(false); + REGB0 = REGB1; + goto label1; + } + /* ./mmloader.nit:37 */ + fra.me.REG[0] = CALL_mmloader___Message___location(fra.me.REG[0])(fra.me.REG[0]); + REGB1 = TAG_Bool(fra.me.REG[0]!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Cast failed", NULL, LOCATE_mmloader, 37); + } + fra.me.REG[1] = CALL_mmloader___Message___location(fra.me.REG[1])(fra.me.REG[1]); + REGB1 = TAG_Bool(fra.me.REG[1]!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Cast failed", NULL, LOCATE_mmloader, 37); + } + REGB1 = TAG_Bool(fra.me.REG[0]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + nit_abort("Reciever is null", NULL, LOCATE_mmloader, 37); + } + REGB1 = CALL_kernel___Comparable_____l(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]); + REGB0 = REGB1; + goto label1; + label1: while(0); + stack_frame_head = fra.me.prev; + return REGB0; +} +val_t mmloader___Message___to_s(val_t p0){ + struct {struct stack_frame_t me; val_t MORE_REG[4];} fra; + val_t REGB0; + val_t REGB1; + val_t tmp; + static val_t once_value_2; /* 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_mmloader; + fra.me.line = 40; + fra.me.meth = LOCATE_mmloader___Message___to_s; + fra.me.has_broke = 0; + fra.me.REG_size = 5; + 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[0] = p0; + /* ./mmloader.nit:41 */ + fra.me.REG[1] = CALL_mmloader___Message___location(fra.me.REG[0])(fra.me.REG[0]); + /* ./mmloader.nit:42 */ + REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + REGB1 = TAG_Bool(false); + REGB0 = REGB1; + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL); + REGB0 = REGB1; + } + } + if (UNTAG_Bool(REGB0)) { + /* ./mmloader.nit:43 */ + fra.me.REG[2] = CALL_mmloader___Message___text(fra.me.REG[0])(fra.me.REG[0]); + goto label1; + } else { + /* ./mmloader.nit:45 */ + 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[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]); + if (!once_value_3) { + fra.me.REG[1] = BOX_NativeString(": "); + REGB0 = TAG_Int(2); + 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]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]); + fra.me.REG[0] = CALL_mmloader___Message___text(fra.me.REG[0])(fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[0]); + if (!once_value_4) { + fra.me.REG[0] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[0] = NEW_String_string___String___with_native(fra.me.REG[0], REGB0); + once_value_4 = fra.me.REG[0]; + register_static_object(&once_value_4); + } else fra.me.REG[0] = once_value_4; + fra.me.REG[0] = fra.me.REG[0]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[0]); + fra.me.REG[3] = CALL_string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]); + fra.me.REG[2] = fra.me.REG[3]; + goto label1; + } + label1: while(0); + stack_frame_head = fra.me.prev; + return fra.me.REG[2]; +} +void mmloader___Message___init(val_t p0, val_t p1, val_t p2, int* init_table){ + int itpos0 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_Message].i; + struct {struct stack_frame_t me; val_t MORE_REG[2];} fra; + val_t tmp; + if (init_table[itpos0]) return; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 0; + fra.me.meth = LOCATE_mmloader___Message___init; + 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; + fra.me.REG[1] = p1; + fra.me.REG[2] = p2; + ATTR_mmloader___Message____location(fra.me.REG[0]) = fra.me.REG[1]; + ATTR_mmloader___Message____text(fra.me.REG[0]) = fra.me.REG[2]; + stack_frame_head = fra.me.prev; + init_table[itpos0] = 1; return; } -void mmloader___ToolContext___warning(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 40, LOCATE_mmloader___ToolContext___warning}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - val_t variable7; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable1 = ATTR_mmloader___ToolContext____opt_warn( self) /*ToolContext::_opt_warn*/; - variable1 = ((opts___Option___value_t)CALL(variable1,COLOR_opts___Option___value))(variable1) /*Option::value*/; - if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1)))) { /*if*/ - goto return_label1; - } - variable1 = ((file___Object___stderr_t)CALL( self,COLOR_file___Object___stderr))( self) /*Object::stderr*/; - variable2 = NEW_string___String___init(); /*new String*/ - variable3 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable4 = variable3; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable4) /*String::append*/; - variable5 = variable0 /*s*/; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable5) /*String::append*/; - variable6 = NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/ - variable7 = variable6; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable7) /*String::append*/; - ((file___OFStream___write_t)CALL(variable1,COLOR_stream___OStream___write))(variable1, variable2) /*OFStream::write*/; - variable1 = ATTR_mmloader___ToolContext____warning_count( self) /*ToolContext::_warning_count*/; - variable1 = TAG_Int(UNTAG_Int(variable1)+UNTAG_Int( TAG_Int(1))); - ATTR_mmloader___ToolContext____warning_count( self) /*ToolContext::_warning_count*/ = variable1; - return_label1: while(false); - tracehead = trace.prev; +val_t mmloader___ToolContext___error_count(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_mmloader; + fra.me.line = 53; + fra.me.meth = LOCATE_mmloader___ToolContext___error_count; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:53 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____error_count(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_error_count", LOCATE_mmloader, 53); + } + REGB0 = ATTR_mmloader___ToolContext____error_count(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return REGB0; +} +val_t mmloader___ToolContext___warning_count(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_mmloader; + fra.me.line = 56; + fra.me.meth = LOCATE_mmloader___ToolContext___warning_count; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:56 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____warning_count(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_warning_count", LOCATE_mmloader, 56); + } + REGB0 = ATTR_mmloader___ToolContext____warning_count(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return REGB0; +} +val_t mmloader___ToolContext___log_directory(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_mmloader; + fra.me.line = 59; + fra.me.meth = LOCATE_mmloader___ToolContext___log_directory; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:59 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____log_directory(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_log_directory", LOCATE_mmloader, 59); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____log_directory(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +void mmloader___ToolContext___check_errors(val_t p0){ + struct {struct stack_frame_t me; val_t MORE_REG[6];} 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 */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 66; + fra.me.meth = LOCATE_mmloader___ToolContext___check_errors; + fra.me.has_broke = 0; + fra.me.REG_size = 7; + 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[0] = p0; + /* ./mmloader.nit:68 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____messages(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_messages", LOCATE_mmloader, 68); + } + fra.me.REG[1] = ATTR_mmloader___ToolContext____messages(fra.me.REG[0]); + /* ./../lib/standard//collection//array.nit:23 */ + REGB0 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[1])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 23); + } + REGB0 = ATTR_array___AbstractArrayRead____length(fra.me.REG[1]); + /* ./mmloader.nit:68 */ + REGB1 = TAG_Int(0); + /* ./../lib/standard//kernel.nit:214 */ + REGB1 = TAG_Bool(UNTAG_Int(REGB0)>UNTAG_Int(REGB1)); + /* ./mmloader.nit:68 */ + if (UNTAG_Bool(REGB1)) { + /* ./mmloader.nit:69 */ + REGB1 = TAG_Bool(ATTR_mmloader___ToolContext____message_sorter(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_message_sorter", LOCATE_mmloader, 69); + } + fra.me.REG[1] = ATTR_mmloader___ToolContext____message_sorter(fra.me.REG[0]); + REGB1 = TAG_Bool(ATTR_mmloader___ToolContext____messages(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_messages", LOCATE_mmloader, 69); + } + fra.me.REG[2] = ATTR_mmloader___ToolContext____messages(fra.me.REG[0]); + CALL_sorter___AbstractSorter___sort(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + /* ./mmloader.nit:71 */ + REGB1 = TAG_Bool(ATTR_mmloader___ToolContext____messages(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_messages", LOCATE_mmloader, 71); + } + fra.me.REG[2] = ATTR_mmloader___ToolContext____messages(fra.me.REG[0]); + /* ./../lib/standard//collection//array.nit:234 */ + REGB1 = TAG_Int(0); + /* ./../lib/standard//collection//array.nit:235 */ + REGB0 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 235); + } + REGB0 = ATTR_array___AbstractArrayRead____length(fra.me.REG[2]); + /* ./../lib/standard//collection//array.nit:236 */ + fra.me.REG[1] = ATTR_array___Array____items(fra.me.REG[2]); + /* ./../lib/standard//collection//array.nit:237 */ + while(1) { + /* ./../lib/standard//collection//array.nit:23 */ + REGB0 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 23); + } + REGB0 = ATTR_array___AbstractArrayRead____length(fra.me.REG[2]); + /* ./../lib/standard//kernel.nit:212 */ + REGB0 = TAG_Bool(UNTAG_Int(REGB1)val[UNTAG_Int(REGB1)]; + /* ./mmloader.nit:72 */ + fra.me.REG[4] = CALL_file___Object___stderr(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Int(3); + fra.me.REG[5] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_1) { + 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_1 = fra.me.REG[6]; + register_static_object(&once_value_1); + } else fra.me.REG[6] = once_value_1; + 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[3] = CALL_string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[3]); + if (!once_value_2) { + fra.me.REG[3] = BOX_NativeString("\n"); + REGB0 = TAG_Int(1); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_2 = fra.me.REG[3]; + register_static_object(&once_value_2); + } else fra.me.REG[3] = once_value_2; + fra.me.REG[3] = fra.me.REG[3]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[3]); + 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]); + /* ./../lib/standard//collection//array.nit:239 */ + REGB0 = TAG_Int(1); + /* ./../lib/standard//kernel.nit:215 */ + REGB0 = TAG_Int(UNTAG_Int(REGB1)+UNTAG_Int(REGB0)); + /* ./../lib/standard//collection//array.nit:239 */ + REGB1 = REGB0; + } else { + /* ./../lib/standard//collection//array.nit:237 */ + goto label3; + } + } + label3: while(0); + /* ./mmloader.nit:75 */ + REGB1 = TAG_Bool(ATTR_mmloader___ToolContext____messages(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_messages", LOCATE_mmloader, 75); + } + fra.me.REG[1] = ATTR_mmloader___ToolContext____messages(fra.me.REG[0]); + CALL_abstract_collection___RemovableCollection___clear(fra.me.REG[1])(fra.me.REG[1]); + } + /* ./mmloader.nit:78 */ + REGB1 = CALL_mmloader___ToolContext___error_count(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Int(0); + /* ./../lib/standard//kernel.nit:214 */ + REGB0 = TAG_Bool(UNTAG_Int(REGB1)>UNTAG_Int(REGB0)); + /* ./mmloader.nit:78 */ + if (UNTAG_Bool(REGB0)) { + REGB0 = TAG_Int(1); + CALL_kernel___Object___exit(fra.me.REG[0])(fra.me.REG[0], REGB0); + } + stack_frame_head = fra.me.prev; return; } -val_t mmloader___ToolContext___paths(val_t self) { - struct trace_t trace = {NULL, NULL, 48, LOCATE_mmloader___ToolContext___paths}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___ToolContext____paths( self) /*ToolContext::_paths*/; -} -val_t mmloader___ToolContext___option_context(val_t self) { - struct trace_t trace = {NULL, NULL, 54, LOCATE_mmloader___ToolContext___option_context}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___ToolContext____option_context( self) /*ToolContext::_option_context*/; -} -val_t mmloader___ToolContext___opt_warn(val_t self) { - struct trace_t trace = {NULL, NULL, 57, LOCATE_mmloader___ToolContext___opt_warn}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___ToolContext____opt_warn( self) /*ToolContext::_opt_warn*/; -} -val_t mmloader___ToolContext___opt_path(val_t self) { - struct trace_t trace = {NULL, NULL, 60, LOCATE_mmloader___ToolContext___opt_path}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___ToolContext____opt_path( self) /*ToolContext::_opt_path*/; -} -val_t mmloader___ToolContext___opt_log(val_t self) { - struct trace_t trace = {NULL, NULL, 63, LOCATE_mmloader___ToolContext___opt_log}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___ToolContext____opt_log( self) /*ToolContext::_opt_log*/; -} -val_t mmloader___ToolContext___opt_only_metamodel(val_t self) { - struct trace_t trace = {NULL, NULL, 66, LOCATE_mmloader___ToolContext___opt_only_metamodel}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___ToolContext____opt_only_metamodel( self) /*ToolContext::_opt_only_metamodel*/; -} -val_t mmloader___ToolContext___opt_only_parse(val_t self) { - struct trace_t trace = {NULL, NULL, 69, LOCATE_mmloader___ToolContext___opt_only_parse}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___ToolContext____opt_only_parse( self) /*ToolContext::_opt_only_parse*/; -} -val_t mmloader___ToolContext___opt_help(val_t self) { - struct trace_t trace = {NULL, NULL, 72, LOCATE_mmloader___ToolContext___opt_help}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___ToolContext____opt_help( self) /*ToolContext::_opt_help*/; -} -void mmloader___ToolContext___init(val_t self, int* init_table) { - struct trace_t trace = {NULL, NULL, 75, LOCATE_mmloader___ToolContext___init}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - val_t variable7; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_ToolContext].i]) return; - ((abstractmetamodel___MMContext___init_t)CALL( self,COLOR_abstractmetamodel___MMContext___init))( self, init_table /*YYY*/) /*MMContext::init*/; - variable0 = ((mmloader___ToolContext___option_context_t)CALL( self,COLOR_mmloader___ToolContext___option_context))( self) /*ToolContext::option_context*/; - variable1 = NEW_array___Array___with_capacity(TAG_Int(6)); /*new Array[E]*/ - variable2 = ((mmloader___ToolContext___opt_warn_t)CALL( self,COLOR_mmloader___ToolContext___opt_warn))( self) /*ToolContext::opt_warn*/; - ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable2) /*AbstractArray::add*/; - variable3 = ((mmloader___ToolContext___opt_path_t)CALL( self,COLOR_mmloader___ToolContext___opt_path))( self) /*ToolContext::opt_path*/; - ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable3) /*AbstractArray::add*/; - variable4 = ((mmloader___ToolContext___opt_log_t)CALL( self,COLOR_mmloader___ToolContext___opt_log))( self) /*ToolContext::opt_log*/; - ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable4) /*AbstractArray::add*/; - variable5 = ((mmloader___ToolContext___opt_only_parse_t)CALL( self,COLOR_mmloader___ToolContext___opt_only_parse))( self) /*ToolContext::opt_only_parse*/; - ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable5) /*AbstractArray::add*/; - variable6 = ((mmloader___ToolContext___opt_only_metamodel_t)CALL( self,COLOR_mmloader___ToolContext___opt_only_metamodel))( self) /*ToolContext::opt_only_metamodel*/; - ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable6) /*AbstractArray::add*/; - variable7 = ((mmloader___ToolContext___opt_help_t)CALL( self,COLOR_mmloader___ToolContext___opt_help))( self) /*ToolContext::opt_help*/; - ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable7) /*AbstractArray::add*/; - ((opts___OptionContext___add_option_t)CALL(variable0,COLOR_opts___OptionContext___add_option))(variable0, variable1) /*OptionContext::add_option*/; - init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_ToolContext].i] = 1; - tracehead = trace.prev; +void mmloader___ToolContext___error(val_t p0, val_t p1, val_t p2){ + struct {struct stack_frame_t me; val_t MORE_REG[3];} fra; + val_t REGB0; + val_t REGB1; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 81; + fra.me.meth = LOCATE_mmloader___ToolContext___error; + 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; + fra.me.REG[1] = p1; + fra.me.REG[2] = p2; + /* ./mmloader.nit:84 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____messages(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_messages", LOCATE_mmloader, 84); + } + fra.me.REG[3] = ATTR_mmloader___ToolContext____messages(fra.me.REG[0]); + fra.me.REG[2] = NEW_Message_mmloader___Message___init(fra.me.REG[1], fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]); + /* ./mmloader.nit:85 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____error_count(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_error_count", LOCATE_mmloader, 85); + } + REGB0 = ATTR_mmloader___ToolContext____error_count(fra.me.REG[0]); + REGB1 = TAG_Int(1); + /* ./../lib/standard//kernel.nit:215 */ + REGB1 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB1)); + /* ./mmloader.nit:85 */ + ATTR_mmloader___ToolContext____error_count(fra.me.REG[0]) = REGB1; + stack_frame_head = fra.me.prev; + return; +} +void mmloader___ToolContext___fatal_error(val_t p0, val_t p1, val_t p2){ + struct {struct stack_frame_t me; val_t MORE_REG[2];} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 88; + fra.me.meth = LOCATE_mmloader___ToolContext___fatal_error; + 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; + fra.me.REG[1] = p1; + fra.me.REG[2] = p2; + /* ./mmloader.nit:91 */ + CALL_mmloader___ToolContext___error(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[2]); + /* ./mmloader.nit:92 */ + CALL_mmloader___ToolContext___check_errors(fra.me.REG[0])(fra.me.REG[0]); + stack_frame_head = fra.me.prev; return; } -void mmloader___ToolContext___process_options(val_t self) { - struct trace_t trace = {NULL, NULL, 81, LOCATE_mmloader___ToolContext___process_options}; - val_t variable0; - val_t variable1; - static val_t once_value_variable1_4; static int once_bool_variable1_4; - val_t variable2; - static val_t once_value_variable1_5; static int once_bool_variable1_5; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - val_t variable7; - val_t variable8; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = ((mmloader___ToolContext___option_context_t)CALL( self,COLOR_mmloader___ToolContext___option_context))( self) /*ToolContext::option_context*/; - variable1 = ((string___Object___args_t)CALL( self,COLOR_string___Object___args))( self) /*Object::args*/; - ((opts___OptionContext___parse_t)CALL(variable0,COLOR_opts___OptionContext___parse))(variable0, variable1) /*OptionContext::parse*/; - variable0 = NEW_array___Array___init(); /*new Array[E]*/ - ATTR_mmloader___ToolContext____paths( self) /*ToolContext::_paths*/ = variable0; - variable0 = ((mmloader___ToolContext___paths_t)CALL( self,COLOR_mmloader___ToolContext___paths))( self) /*ToolContext::paths*/; - variable1 = ((mmloader___ToolContext___opt_path_t)CALL( self,COLOR_mmloader___ToolContext___opt_path))( self) /*ToolContext::opt_path*/; - variable1 = ((opts___Option___value_t)CALL(variable1,COLOR_opts___Option___value))(variable1) /*Option::value*/; - ((abstract_collection___IndexedCollection___append_t)CALL(variable0,COLOR_abstract_collection___IndexedCollection___append))(variable0, variable1) /*IndexedCollection::append*/; - if (once_bool_variable1_4) variable1 = once_value_variable1_4; - else { - variable1 = NEW_string___String___with_native(BOX_NativeString("NIT_PATH"), TAG_Int(8)); /*new String*/ - variable1 = ((symbol___String___to_symbol_t)CALL(variable1,COLOR_symbol___String___to_symbol))(variable1) /*String::to_symbol*/; - variable1 = ((environ___Symbol___environ_t)CALL(variable1,COLOR_environ___Symbol___environ))(variable1) /*Symbol::environ*/; - once_value_variable1_4 = variable1; - once_bool_variable1_4 = true; - } - variable0 = variable1; - variable1 = ((array___AbstractArray___is_empty_t)CALL( variable0 /*path_env*/,COLOR_abstract_collection___Collection___is_empty))( variable0 /*path_env*/) /*AbstractArray::is_empty*/; - if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1)))) { /*if*/ - variable1 = ((mmloader___ToolContext___paths_t)CALL( self,COLOR_mmloader___ToolContext___paths))( self) /*ToolContext::paths*/; - variable2 = ((string_search___String___split_with_t)CALL( variable0 /*path_env*/,COLOR_string_search___String___split_with))( variable0 /*path_env*/, TAG_Char(':')) /*String::split_with*/; - ((abstract_collection___IndexedCollection___append_t)CALL(variable1,COLOR_abstract_collection___IndexedCollection___append))(variable1, variable2) /*IndexedCollection::append*/; - } - if (once_bool_variable1_5) variable1 = once_value_variable1_5; - else { - variable1 = NEW_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)); /*new String*/ - variable1 = ((symbol___String___to_symbol_t)CALL(variable1,COLOR_symbol___String___to_symbol))(variable1) /*String::to_symbol*/; - variable1 = ((environ___Symbol___environ_t)CALL(variable1,COLOR_environ___Symbol___environ))(variable1) /*Symbol::environ*/; - once_value_variable1_5 = variable1; - once_bool_variable1_5 = true; - } - variable0 = variable1 /*path_env=*/; - variable1 = ((array___AbstractArray___is_empty_t)CALL( variable0 /*path_env*/,COLOR_abstract_collection___Collection___is_empty))( variable0 /*path_env*/) /*AbstractArray::is_empty*/; - if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1)))) { /*if*/ - variable2 = NEW_string___String___init(); /*new String*/ - variable3 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable4 = variable3; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable4) /*String::append*/; - variable5 = variable0 /*path_env*/; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable5) /*String::append*/; - variable6 = NEW_string___String___with_native(BOX_NativeString("/lib"), TAG_Int(4)); /*new String*/ - variable7 = variable6; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable7) /*String::append*/; - variable1 = variable2; - variable2 = ((file___String___file_exists_t)CALL( variable1 /*libname*/,COLOR_file___String___file_exists))( variable1 /*libname*/) /*String::file_exists*/; - if (UNTAG_Bool(variable2)) { /*if*/ - variable2 = ((mmloader___ToolContext___paths_t)CALL( self,COLOR_mmloader___ToolContext___paths))( self) /*ToolContext::paths*/; - ((array___AbstractArray___add_t)CALL(variable2,COLOR_abstract_collection___SimpleCollection___add))(variable2, variable1 /*libname*/) /*AbstractArray::add*/; +void mmloader___ToolContext___warning(val_t p0, val_t p1, val_t p2){ + struct {struct stack_frame_t me; val_t MORE_REG[3];} fra; + val_t REGB0; + val_t REGB1; + val_t REGB2; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 95; + fra.me.meth = LOCATE_mmloader___ToolContext___warning; + 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; + fra.me.REG[1] = p1; + fra.me.REG[2] = p2; + /* ./mmloader.nit:98 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_warn(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_warn", LOCATE_mmloader, 98); + } + fra.me.REG[3] = ATTR_mmloader___ToolContext____opt_warn(fra.me.REG[0]); + fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]); + REGB0 = TAG_Int(0); + REGB1 = TAG_Bool(IS_EQUAL_ON(REGB0,fra.me.REG[3])); + if (UNTAG_Bool(REGB1)) { + } else { + REGB2 = TAG_Bool(fra.me.REG[3]==NIT_NULL); + if (UNTAG_Bool(REGB2)) { + REGB2 = TAG_Bool(false); + REGB1 = REGB2; + } else { + /* ./../lib/standard//kernel.nit:207 */ + REGB0 = TAG_Bool((fra.me.REG[3])==(REGB0)); + /* ./mmloader.nit:98 */ + REGB1 = REGB0; + } + } + if (UNTAG_Bool(REGB1)) { + goto label1; + } + /* ./mmloader.nit:99 */ + REGB1 = TAG_Bool(ATTR_mmloader___ToolContext____messages(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_messages", LOCATE_mmloader, 99); + } + fra.me.REG[3] = ATTR_mmloader___ToolContext____messages(fra.me.REG[0]); + fra.me.REG[2] = NEW_Message_mmloader___Message___init(fra.me.REG[1], fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]); + /* ./mmloader.nit:100 */ + REGB1 = TAG_Bool(ATTR_mmloader___ToolContext____opt_warn(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_warn", LOCATE_mmloader, 100); + } + fra.me.REG[2] = ATTR_mmloader___ToolContext____opt_warn(fra.me.REG[0]); + fra.me.REG[2] = CALL_opts___Option___value(fra.me.REG[2])(fra.me.REG[2]); + REGB1 = TAG_Int(1); + REGB0 = TAG_Bool(IS_EQUAL_ON(REGB1,fra.me.REG[2])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB2 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB2)) { + REGB2 = TAG_Bool(false); + REGB0 = REGB2; + } else { + /* ./../lib/standard//kernel.nit:207 */ + REGB1 = TAG_Bool((fra.me.REG[2])==(REGB1)); + /* ./mmloader.nit:100 */ + REGB0 = REGB1; } } - variable2 = NEW_string___String___init(); /*new String*/ - variable3 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable4 = variable3; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable4) /*String::append*/; - variable5 = (G_sys); - variable5 = ((string___Sys___program_name_t)CALL(variable5,COLOR_string___Sys___program_name))(variable5) /*Sys::program_name*/; - variable5 = ((file___String___dirname_t)CALL(variable5,COLOR_file___String___dirname))(variable5) /*String::dirname*/; - variable6 = variable5; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable6) /*String::append*/; - variable7 = NEW_string___String___with_native(BOX_NativeString("/../lib"), TAG_Int(7)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable2,COLOR_abstract_collection___IndexedCollection___append))(variable2, variable8) /*String::append*/; - variable1 = variable2; - variable2 = ((file___String___file_exists_t)CALL( variable1 /*libname*/,COLOR_file___String___file_exists))( variable1 /*libname*/) /*String::file_exists*/; - if (UNTAG_Bool(variable2)) { /*if*/ - variable2 = ((mmloader___ToolContext___paths_t)CALL( self,COLOR_mmloader___ToolContext___paths))( self) /*ToolContext::paths*/; - ((array___AbstractArray___add_t)CALL(variable2,COLOR_abstract_collection___SimpleCollection___add))(variable2, variable1 /*libname*/) /*AbstractArray::add*/; - } - tracehead = trace.prev; + if (UNTAG_Bool(REGB0)) { + /* ./mmloader.nit:101 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____warning_count(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_warning_count", LOCATE_mmloader, 101); + } + REGB0 = ATTR_mmloader___ToolContext____warning_count(fra.me.REG[0]); + REGB1 = TAG_Int(1); + /* ./../lib/standard//kernel.nit:215 */ + REGB1 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB1)); + /* ./mmloader.nit:101 */ + ATTR_mmloader___ToolContext____warning_count(fra.me.REG[0]) = REGB1; + } else { + /* ./mmloader.nit:103 */ + REGB1 = TAG_Bool(ATTR_mmloader___ToolContext____error_count(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_error_count", LOCATE_mmloader, 103); + } + REGB1 = ATTR_mmloader___ToolContext____error_count(fra.me.REG[0]); + REGB0 = TAG_Int(1); + /* ./../lib/standard//kernel.nit:215 */ + REGB0 = TAG_Int(UNTAG_Int(REGB1)+UNTAG_Int(REGB0)); + /* ./mmloader.nit:103 */ + ATTR_mmloader___ToolContext____error_count(fra.me.REG[0]) = REGB0; + } + label1: while(0); + stack_frame_head = fra.me.prev; return; } -val_t mmloader___ToolContext___try_to_load(val_t self, val_t param0, val_t param1) { - struct trace_t trace = {NULL, NULL, 106, LOCATE_mmloader___ToolContext___try_to_load}; - 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; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable1 = param1; - variable2 = ((abstractmetamodel___MMDirectory___modules_t)CALL( variable1 /*dir*/,COLOR_abstractmetamodel___MMDirectory___modules))( variable1 /*dir*/) /*MMDirectory::modules*/; - variable2 = ((abstract_collection___Map___iterator_t)CALL(variable2,COLOR_abstract_collection___Collection___iterator))(variable2) /*Map::iterator*/; - while (true) { /*for*/ - variable3 = ((abstract_collection___Iterator___is_ok_t)CALL(variable2,COLOR_abstract_collection___Iterator___is_ok))(variable2) /*Iterator::is_ok*/; - if (!UNTAG_Bool(variable3)) break; /*for*/ - variable3 = ((abstract_collection___Iterator___item_t)CALL(variable2,COLOR_abstract_collection___Iterator___item))(variable2) /*Iterator::item*/; - variable4 = ((abstractmetamodel___MMModule___name_t)CALL( variable3 /*m*/,COLOR_abstractmetamodel___MMModule___name))( variable3 /*m*/) /*MMModule::name*/; - variable4 = TAG_Bool((variable4 == variable0 /*module_name*/) || ((variable4 != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL(variable4,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable4, variable0 /*module_name*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL(variable4,COLOR_kernel___Object_____eqeq))(variable4, variable0 /*module_name*/) /*Object::==*/))))); - if (UNTAG_Bool(variable4)) { /*if*/ - variable2 = variable3 /*m*/; - goto return_label6; +void mmloader___ToolContext___info(val_t p0, val_t p1, val_t p2){ + struct {struct stack_frame_t me; val_t MORE_REG[3];} 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 */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 107; + fra.me.meth = LOCATE_mmloader___ToolContext___info; + 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; + fra.me.REG[1] = p1; + REGB0 = p2; + /* ./mmloader.nit:110 */ + REGB1 = CALL_mmloader___ToolContext___verbose_level(fra.me.REG[0])(fra.me.REG[0]); + /* ./../lib/standard//kernel.nit:211 */ + REGB1 = TAG_Bool(UNTAG_Int(REGB0)<=UNTAG_Int(REGB1)); + /* ./mmloader.nit:110 */ + if (UNTAG_Bool(REGB1)) { + /* ./mmloader.nit:111 */ + REGB1 = TAG_Int(3); + fra.me.REG[2] = NEW_Array_array___Array___with_capacity(REGB1); + if (!once_value_1) { + fra.me.REG[3] = BOX_NativeString(""); + REGB1 = TAG_Int(0); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB1); + 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]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + if (!once_value_2) { + fra.me.REG[1] = BOX_NativeString(""); + REGB1 = TAG_Int(0); + fra.me.REG[1] = NEW_String_string___String___with_native(fra.me.REG[1], REGB1); + once_value_2 = fra.me.REG[1]; + register_static_object(&once_value_2); + } else fra.me.REG[1] = once_value_2; + fra.me.REG[1] = fra.me.REG[1]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + fra.me.REG[2] = CALL_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + CALL_file___Object___print(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]); + } + stack_frame_head = fra.me.prev; + return; +} +val_t mmloader___ToolContext___paths(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_mmloader; + fra.me.line = 115; + fra.me.meth = LOCATE_mmloader___ToolContext___paths; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:115 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____paths(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_paths", LOCATE_mmloader, 115); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____paths(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___option_context(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_mmloader; + fra.me.line = 121; + fra.me.meth = LOCATE_mmloader___ToolContext___option_context; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:121 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____option_context(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_option_context", LOCATE_mmloader, 121); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____option_context(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___opt_warn(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_mmloader; + fra.me.line = 124; + fra.me.meth = LOCATE_mmloader___ToolContext___opt_warn; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:124 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_warn(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_warn", LOCATE_mmloader, 124); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____opt_warn(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___opt_path(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_mmloader; + fra.me.line = 127; + fra.me.meth = LOCATE_mmloader___ToolContext___opt_path; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:127 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_path(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_path", LOCATE_mmloader, 127); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____opt_path(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___opt_log(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_mmloader; + fra.me.line = 130; + fra.me.meth = LOCATE_mmloader___ToolContext___opt_log; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:130 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_log(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_log", LOCATE_mmloader, 130); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____opt_log(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___opt_log_dir(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_mmloader; + fra.me.line = 133; + fra.me.meth = LOCATE_mmloader___ToolContext___opt_log_dir; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:133 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_log_dir(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_log_dir", LOCATE_mmloader, 133); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____opt_log_dir(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___opt_only_metamodel(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_mmloader; + fra.me.line = 136; + fra.me.meth = LOCATE_mmloader___ToolContext___opt_only_metamodel; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:136 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_only_metamodel(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_only_metamodel", LOCATE_mmloader, 136); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____opt_only_metamodel(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___opt_only_parse(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_mmloader; + fra.me.line = 139; + fra.me.meth = LOCATE_mmloader___ToolContext___opt_only_parse; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:139 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_only_parse(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_only_parse", LOCATE_mmloader, 139); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____opt_only_parse(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___opt_help(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_mmloader; + fra.me.line = 142; + fra.me.meth = LOCATE_mmloader___ToolContext___opt_help; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:142 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_help(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_help", LOCATE_mmloader, 142); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____opt_help(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___opt_version(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_mmloader; + fra.me.line = 145; + fra.me.meth = LOCATE_mmloader___ToolContext___opt_version; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:145 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_version(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_version", LOCATE_mmloader, 145); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____opt_version(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___opt_verbose(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_mmloader; + fra.me.line = 148; + fra.me.meth = LOCATE_mmloader___ToolContext___opt_verbose; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:148 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_verbose(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_verbose", LOCATE_mmloader, 148); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____opt_verbose(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t mmloader___ToolContext___verbose_level(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_mmloader; + fra.me.line = 151; + fra.me.meth = LOCATE_mmloader___ToolContext___verbose_level; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./mmloader.nit:151 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____verbose_level(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_verbose_level", LOCATE_mmloader, 151); + } + REGB0 = ATTR_mmloader___ToolContext____verbose_level(fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return REGB0; +} +void mmloader___ToolContext___init(val_t p0, int* init_table){ + int itpos1 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_ToolContext].i; + struct {struct stack_frame_t me; val_t MORE_REG[3];} fra; + val_t REGB0; + val_t tmp; + if (init_table[itpos1]) return; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 154; + fra.me.meth = LOCATE_mmloader___ToolContext___init; + 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; + /* ./mmloader.nit:154 */ + fra.me.REG[1] = fra.me.REG[0]; + /* ./mmloader.nit:156 */ + CALL_abstractmetamodel___MMContext___init(fra.me.REG[0])(fra.me.REG[0], init_table); + /* ./mmloader.nit:157 */ + fra.me.REG[0] = CALL_mmloader___ToolContext___option_context(fra.me.REG[1])(fra.me.REG[1]); + REGB0 = TAG_Int(8); + fra.me.REG[2] = NEW_Array_array___Array___with_capacity(REGB0); + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_warn(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_path(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_log(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_log_dir(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_only_parse(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_only_metamodel(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_help(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_version(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + fra.me.REG[1] = CALL_mmloader___ToolContext___opt_verbose(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + CALL_opts___OptionContext___add_option(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]); + stack_frame_head = fra.me.prev; + init_table[itpos1] = 1; + return; +} +void mmloader___ToolContext___process_options(val_t p0){ + struct {struct stack_frame_t me; val_t MORE_REG[3];} 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 */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 160; + fra.me.meth = LOCATE_mmloader___ToolContext___process_options; + 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; + /* ./mmloader.nit:164 */ + fra.me.REG[1] = CALL_mmloader___ToolContext___option_context(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_string___Object___args(fra.me.REG[0])(fra.me.REG[0]); + CALL_opts___OptionContext___parse(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]); + /* ./mmloader.nit:167 */ + fra.me.REG[2] = CALL_mmloader___ToolContext___opt_verbose(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[2] = CALL_opts___Option___value(fra.me.REG[2])(fra.me.REG[2]); + ATTR_mmloader___ToolContext____verbose_level(fra.me.REG[0]) = fra.me.REG[2]; + /* ./mmloader.nit:170 */ + fra.me.REG[2] = CALL_mmloader___ToolContext___paths(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[1] = CALL_mmloader___ToolContext___opt_path(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[1] = CALL_opts___Option___value(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___Sequence___append(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + /* ./mmloader.nit:172 */ + if (!once_value_1) { + if (!once_value_2) { + fra.me.REG[1] = BOX_NativeString("NIT_PATH"); + REGB0 = TAG_Int(8); + fra.me.REG[1] = NEW_String_string___String___with_native(fra.me.REG[1], REGB0); + once_value_2 = fra.me.REG[1]; + register_static_object(&once_value_2); + } else fra.me.REG[1] = once_value_2; + fra.me.REG[1] = fra.me.REG[1]; + fra.me.REG[1] = CALL_symbol___String___to_symbol(fra.me.REG[1])(fra.me.REG[1]); + fra.me.REG[1] = CALL_environ___Symbol___environ(fra.me.REG[1])(fra.me.REG[1]); + once_value_1 = fra.me.REG[1]; + register_static_object(&once_value_1); + } else fra.me.REG[1] = once_value_1; + fra.me.REG[1] = fra.me.REG[1]; + /* ./mmloader.nit:173 */ + REGB0 = CALL_abstract_collection___Collection___is_empty(fra.me.REG[1])(fra.me.REG[1]); + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + /* ./mmloader.nit:174 */ + fra.me.REG[2] = CALL_mmloader___ToolContext___paths(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Char(':'); + fra.me.REG[3] = CALL_string_search___String___split_with(fra.me.REG[1])(fra.me.REG[1], REGB0); + CALL_abstract_collection___Sequence___append(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]); + } + /* ./mmloader.nit:177 */ + if (!once_value_3) { + if (!once_value_4) { + fra.me.REG[3] = BOX_NativeString("NIT_DIR"); + REGB0 = TAG_Int(7); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_4 = fra.me.REG[3]; + register_static_object(&once_value_4); + } else fra.me.REG[3] = once_value_4; + fra.me.REG[3] = fra.me.REG[3]; + fra.me.REG[3] = CALL_symbol___String___to_symbol(fra.me.REG[3])(fra.me.REG[3]); + fra.me.REG[3] = CALL_environ___Symbol___environ(fra.me.REG[3])(fra.me.REG[3]); + 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]; + fra.me.REG[1] = fra.me.REG[3]; + /* ./mmloader.nit:178 */ + REGB0 = CALL_abstract_collection___Collection___is_empty(fra.me.REG[1])(fra.me.REG[1]); + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + /* ./mmloader.nit:179 */ + REGB0 = TAG_Int(3); + fra.me.REG[3] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_5) { + 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_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]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]); + if (!once_value_6) { + fra.me.REG[1] = BOX_NativeString("/lib"); + REGB0 = TAG_Int(4); + fra.me.REG[1] = NEW_String_string___String___with_native(fra.me.REG[1], REGB0); + once_value_6 = fra.me.REG[1]; + register_static_object(&once_value_6); + } else fra.me.REG[1] = once_value_6; + fra.me.REG[1] = fra.me.REG[1]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]); + fra.me.REG[3] = CALL_string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]); + /* ./mmloader.nit:180 */ + REGB0 = CALL_file___String___file_exists(fra.me.REG[3])(fra.me.REG[3]); + if (UNTAG_Bool(REGB0)) { + fra.me.REG[1] = CALL_mmloader___ToolContext___paths(fra.me.REG[0])(fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]); + } + } + /* ./mmloader.nit:183 */ + REGB0 = TAG_Int(3); + fra.me.REG[3] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_7) { + fra.me.REG[1] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[1] = NEW_String_string___String___with_native(fra.me.REG[1], REGB0); + once_value_7 = fra.me.REG[1]; + register_static_object(&once_value_7); + } else fra.me.REG[1] = once_value_7; + fra.me.REG[1] = fra.me.REG[1]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]); + fra.me.REG[1] = CALL_kernel___Object___sys(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[1] = CALL_string___Sys___program_name(fra.me.REG[1])(fra.me.REG[1]); + fra.me.REG[1] = CALL_file___String___dirname(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]); + if (!once_value_8) { + fra.me.REG[1] = BOX_NativeString("/../lib"); + REGB0 = TAG_Int(7); + fra.me.REG[1] = NEW_String_string___String___with_native(fra.me.REG[1], REGB0); + once_value_8 = fra.me.REG[1]; + register_static_object(&once_value_8); + } else fra.me.REG[1] = once_value_8; + fra.me.REG[1] = fra.me.REG[1]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]); + fra.me.REG[3] = CALL_string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]); + /* ./mmloader.nit:184 */ + REGB0 = CALL_file___String___file_exists(fra.me.REG[3])(fra.me.REG[3]); + if (UNTAG_Bool(REGB0)) { + fra.me.REG[1] = CALL_mmloader___ToolContext___paths(fra.me.REG[0])(fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]); + } + /* ./mmloader.nit:186 */ + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_log_dir(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]); + REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + REGB1 = TAG_Bool(false); + REGB0 = REGB1; + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[3])(fra.me.REG[3], NIT_NULL); + REGB0 = REGB1; + } + } + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_log_dir(fra.me.REG[0])(fra.me.REG[0]); + fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]); + REGB0 = TAG_Bool((fra.me.REG[3]!=NIT_NULL) && VAL_ISA(fra.me.REG[3], COLOR_String, ID_String)) /*cast String*/; + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Cast failed", NULL, LOCATE_mmloader, 186); } - continue_7: while(0); - ((abstract_collection___Iterator___next_t)CALL(variable2,COLOR_abstract_collection___Iterator___next))(variable2) /*Iterator::next*/; - } - break_7: while(0); - variable2 = ATTR_mmloader___ToolContext____loaders( self) /*ToolContext::_loaders*/; - variable2 = ((array___AbstractArray___iterator_t)CALL(variable2,COLOR_abstract_collection___Collection___iterator))(variable2) /*AbstractArray::iterator*/; - while (true) { /*for*/ - variable3 = ((array___ArrayIterator___is_ok_t)CALL(variable2,COLOR_abstract_collection___Iterator___is_ok))(variable2) /*ArrayIterator::is_ok*/; - if (!UNTAG_Bool(variable3)) break; /*for*/ - variable3 = ((array___ArrayIterator___item_t)CALL(variable2,COLOR_abstract_collection___Iterator___item))(variable2) /*ArrayIterator::item*/; - variable5 = ((mmloader___ModuleLoader___try_to_load_dir_t)CALL( variable3 /*l*/,COLOR_mmloader___ModuleLoader___try_to_load_dir))( variable3 /*l*/, variable0 /*module_name*/, variable1 /*dir*/) /*ModuleLoader::try_to_load_dir*/; - variable4 = variable5; - variable5 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable4 /*dir2*/ == NIT_NULL /*null*/) || (( variable4 /*dir2*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable4 /*dir2*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable4 /*dir2*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable4 /*dir2*/,COLOR_kernel___Object_____eqeq))( variable4 /*dir2*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (UNTAG_Bool(variable5)) { /*if*/ - variable6 = ((mmloader___ToolContext___try_to_load_t)CALL( self,COLOR_mmloader___ToolContext___try_to_load))( self, variable0 /*module_name*/, variable4 /*dir2*/) /*ToolContext::try_to_load*/; - variable5 = variable6; - variable6 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable5 /*m*/ == NIT_NULL /*null*/) || (( variable5 /*m*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable5 /*m*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable5 /*m*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable5 /*m*/,COLOR_kernel___Object_____eqeq))( variable5 /*m*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (UNTAG_Bool(variable6)) { /*if*/ - ((abstractmetamodel___MMDirectory___owner__eq_t)CALL( variable4 /*dir2*/,COLOR_abstractmetamodel___MMDirectory___owner__eq))( variable4 /*dir2*/, variable5 /*m*/) /*MMDirectory::owner=*/; - ((abstractmetamodel___MMDirectory___add_module_t)CALL( variable1 /*dir*/,COLOR_abstractmetamodel___MMDirectory___add_module))( variable1 /*dir*/, variable5 /*m*/) /*MMDirectory::add_module*/; - variable2 = variable5 /*m*/; - goto return_label6; + ATTR_mmloader___ToolContext____log_directory(fra.me.REG[0]) = fra.me.REG[3]; + } + /* ./mmloader.nit:187 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____opt_log(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_opt_log", LOCATE_mmloader, 187); + } + fra.me.REG[3] = ATTR_mmloader___ToolContext____opt_log(fra.me.REG[0]); + fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]); + if (UNTAG_Bool(fra.me.REG[3])) { + /* ./mmloader.nit:189 */ + fra.me.REG[0] = CALL_mmloader___ToolContext___log_directory(fra.me.REG[0])(fra.me.REG[0]); + CALL_file___String___mkdir(fra.me.REG[0])(fra.me.REG[0]); + } + stack_frame_head = fra.me.prev; + return; +} +val_t mmloader___ToolContext___try_to_load(val_t p0, val_t p1, val_t p2){ + struct {struct stack_frame_t me; val_t MORE_REG[9];} fra; + val_t REGB0; + val_t REGB1; + val_t REGB2; + val_t tmp; + static val_t once_value_4; /* Once value */ + static val_t once_value_5; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 193; + fra.me.meth = LOCATE_mmloader___ToolContext___try_to_load; + 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; + fra.me.REG[2] = p2; + /* ./mmloader.nit:199 */ + fra.me.REG[3] = CALL_abstractmetamodel___MMDirectory___modules(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___Collection___iterate(fra.me.REG[3])(fra.me.REG[3], (&(fra.me)), ((fun_t)OC_mmloader___ToolContext___try_to_load_1)); + switch ((&(fra.me))->has_broke) { + case 0: break; + case 1: (&(fra.me))->has_broke = 0; goto label3; + } + /* ./mmloader.nit:205 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____loaders(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_loaders", LOCATE_mmloader, 205); + } + fra.me.REG[4] = ATTR_mmloader___ToolContext____loaders(fra.me.REG[0]); + /* ./../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[4])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 235); + } + REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[4]); + /* ./../lib/standard//collection//array.nit:236 */ + fra.me.REG[5] = ATTR_array___Array____items(fra.me.REG[4]); + /* ./../lib/standard//collection//array.nit:237 */ + while(1) { + /* ./../lib/standard//collection//array.nit:23 */ + REGB1 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[4])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 23); + } + REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[4]); + /* ./../lib/standard//kernel.nit:212 */ + REGB1 = TAG_Bool(UNTAG_Int(REGB0)val[UNTAG_Int(REGB0)]; + /* ./mmloader.nit:206 */ + fra.me.REG[7] = CALL_mmloader___ModuleLoader___try_to_load_dir(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[1], fra.me.REG[2]); + /* ./mmloader.nit:207 */ + REGB1 = TAG_Bool(fra.me.REG[7]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + REGB2 = TAG_Bool(fra.me.REG[7]==NIT_NULL); + if (UNTAG_Bool(REGB2)) { + REGB2 = TAG_Bool(false); + REGB1 = REGB2; + } else { + REGB2 = CALL_kernel___Object_____eqeq(fra.me.REG[7])(fra.me.REG[7], NIT_NULL); + REGB1 = REGB2; + } + } + REGB1 = TAG_Bool(!UNTAG_Bool(REGB1)); + if (UNTAG_Bool(REGB1)) { + /* ./mmloader.nit:208 */ + fra.me.REG[8] = CALL_mmloader___ToolContext___try_to_load(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[7]); + /* ./mmloader.nit:209 */ + REGB1 = TAG_Bool(fra.me.REG[8]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + REGB2 = TAG_Bool(fra.me.REG[8]==NIT_NULL); + if (UNTAG_Bool(REGB2)) { + REGB2 = TAG_Bool(false); + REGB1 = REGB2; + } else { + REGB2 = CALL_kernel___Object_____eqeq(fra.me.REG[8])(fra.me.REG[8], NIT_NULL); + REGB1 = REGB2; + } + } + REGB1 = TAG_Bool(!UNTAG_Bool(REGB1)); + if (UNTAG_Bool(REGB1)) { + /* ./mmloader.nit:210 */ + REGB1 = TAG_Bool(fra.me.REG[7]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + nit_abort("Reciever is null", NULL, LOCATE_mmloader, 210); + } + CALL_abstractmetamodel___MMDirectory___owner__eq(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[8]); + /* ./mmloader.nit:211 */ + CALL_abstractmetamodel___MMDirectory___add_module(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[8]); + /* ./mmloader.nit:212 */ + fra.me.REG[3] = fra.me.REG[8]; + goto label3; + } } + /* ./mmloader.nit:216 */ + REGB1 = CALL_mmloader___ModuleLoader___can_handle(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[1], fra.me.REG[2]); + if (UNTAG_Bool(REGB1)) { + /* ./mmloader.nit:217 */ + fra.me.REG[8] = CALL_abstractmetamodel___MMDirectory___full_name_for(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + /* ./mmloader.nit:218 */ + REGB1 = TAG_Bool(ATTR_mmloader___ToolContext____processing_modules(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_processing_modules", LOCATE_mmloader, 218); + } + fra.me.REG[7] = ATTR_mmloader___ToolContext____processing_modules(fra.me.REG[0]); + REGB1 = CALL_abstract_collection___Collection___has(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[8]); + if (UNTAG_Bool(REGB1)) { + /* ./mmloader.nit:220 */ + REGB1 = TAG_Int(3); + fra.me.REG[7] = NEW_Array_array___Array___with_capacity(REGB1); + if (!once_value_4) { + fra.me.REG[9] = BOX_NativeString("Error: Dependency loop for module "); + REGB1 = TAG_Int(34); + fra.me.REG[9] = NEW_String_string___String___with_native(fra.me.REG[9], REGB1); + once_value_4 = fra.me.REG[9]; + register_static_object(&once_value_4); + } else fra.me.REG[9] = once_value_4; + fra.me.REG[9] = fra.me.REG[9]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[9]); + fra.me.REG[9] = CALL_string___Object___to_s(fra.me.REG[8])(fra.me.REG[8]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[9]); + if (!once_value_5) { + fra.me.REG[9] = BOX_NativeString(""); + REGB1 = TAG_Int(0); + fra.me.REG[9] = NEW_String_string___String___with_native(fra.me.REG[9], REGB1); + once_value_5 = fra.me.REG[9]; + register_static_object(&once_value_5); + } else fra.me.REG[9] = once_value_5; + fra.me.REG[9] = fra.me.REG[9]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[9]); + fra.me.REG[7] = CALL_string___Object___to_s(fra.me.REG[7])(fra.me.REG[7]); + CALL_mmloader___ToolContext___fatal_error(fra.me.REG[0])(fra.me.REG[0], NIT_NULL, fra.me.REG[7]); + } + /* ./mmloader.nit:222 */ + REGB1 = TAG_Bool(ATTR_mmloader___ToolContext____processing_modules(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_processing_modules", LOCATE_mmloader, 222); + } + fra.me.REG[7] = ATTR_mmloader___ToolContext____processing_modules(fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[8]); + /* ./mmloader.nit:223 */ + fra.me.REG[6] = CALL_mmloader___ModuleLoader___load_and_process_module(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[0], fra.me.REG[1], fra.me.REG[2]); + /* ./mmloader.nit:224 */ + REGB1 = TAG_Bool(ATTR_mmloader___ToolContext____processing_modules(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_processing_modules", LOCATE_mmloader, 224); + } + fra.me.REG[7] = ATTR_mmloader___ToolContext____processing_modules(fra.me.REG[0]); + CALL_abstract_collection___RemovableCollection___remove(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[8]); + /* ./mmloader.nit:226 */ + CALL_abstractmetamodel___MMDirectory___add_module(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[6]); + /* ./mmloader.nit:227 */ + fra.me.REG[3] = fra.me.REG[6]; + goto label3; + } + /* ./../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 label6; + } + } + label6: while(0); + /* ./mmloader.nit:230 */ + fra.me.REG[3] = NIT_NULL; + goto label3; + label3: while(0); + stack_frame_head = fra.me.prev; + return fra.me.REG[3]; +} + void OC_mmloader___ToolContext___try_to_load_1(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[1];} fra; + val_t REGB0; + val_t REGB1; + fun_t CREG[1]; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 0; + fra.me.meth = LOCATE_mmloader___ToolContext___try_to_load; + fra.me.has_broke = 0; + fra.me.REG_size = 2; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.closure_ctx = closctx_param; + fra.me.closure_funs = CREG; + fra.me.REG[0] = p0; + CREG[0] = clos_fun0; + /* ./mmloader.nit:200 */ + fra.me.REG[1] = CALL_abstractmetamodel___MMModule___name(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[1],closctx->REG[1])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], closctx->REG[1]); + REGB0 = REGB1; + } + if (UNTAG_Bool(REGB0)) { + closctx->REG[3] = fra.me.REG[0]; + closctx->has_broke = 1; + goto label2; + } + label2: while(0); + stack_frame_head = fra.me.prev; + return; + } +val_t mmloader___ToolContext___get_module_from_filename(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[6];} 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 */ + 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_mmloader; + fra.me.line = 237; + fra.me.meth = LOCATE_mmloader___ToolContext___get_module_from_filename; + fra.me.has_broke = 0; + fra.me.REG_size = 7; + 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[0] = p0; + fra.me.REG[1] = p1; + /* ./mmloader.nit:242 */ + fra.me.REG[2] = CALL_file___String___dirname(fra.me.REG[1])(fra.me.REG[1]); + /* ./mmloader.nit:243 */ + if (!once_value_1) { + fra.me.REG[3] = BOX_NativeString(".nit"); + REGB0 = TAG_Int(4); + 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]; + fra.me.REG[3] = CALL_file___String___basename(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]); + fra.me.REG[3] = CALL_symbol___String___to_symbol(fra.me.REG[3])(fra.me.REG[3]); + /* ./mmloader.nit:245 */ + fra.me.REG[2] = CALL_mmloader___ToolContext___directory_for(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]); + /* ./mmloader.nit:247 */ + fra.me.REG[4] = CALL_string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]); + REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[4],fra.me.REG[1])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[1]); + REGB0 = REGB1; + } + if (UNTAG_Bool(REGB0)) { + /* ./mmloader.nit:250 */ + fra.me.REG[4] = CALL_mmloader___ToolContext___try_to_load(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3], fra.me.REG[2]); + /* ./mmloader.nit:251 */ + REGB0 = TAG_Bool(fra.me.REG[4]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = TAG_Bool(fra.me.REG[4]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + REGB1 = TAG_Bool(false); + REGB0 = REGB1; + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[4])(fra.me.REG[4], NIT_NULL); + REGB0 = REGB1; + } + } + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + goto label2; + } + /* ./mmloader.nit:254 */ + fra.me.REG[5] = CALL_mmloader___ToolContext___get_module(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3], NIT_NULL); + fra.me.REG[4] = fra.me.REG[5]; + goto label2; + } + /* ./mmloader.nit:257 */ + REGB0 = CALL_file___String___file_exists(fra.me.REG[1])(fra.me.REG[1]); + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + /* ./mmloader.nit:258 */ + REGB0 = TAG_Int(3); + fra.me.REG[5] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_3) { + fra.me.REG[6] = BOX_NativeString("Error: File "); + REGB0 = TAG_Int(12); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_3 = fra.me.REG[6]; + register_static_object(&once_value_3); + } else fra.me.REG[6] = once_value_3; + 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]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[1]); + if (!once_value_4) { + fra.me.REG[6] = BOX_NativeString(" not found."); + REGB0 = TAG_Int(11); + fra.me.REG[6] = NEW_String_string___String___with_native(fra.me.REG[6], REGB0); + once_value_4 = fra.me.REG[6]; + register_static_object(&once_value_4); + } else fra.me.REG[6] = once_value_4; + 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_mmloader___ToolContext___fatal_error(fra.me.REG[0])(fra.me.REG[0], NIT_NULL, fra.me.REG[5]); + /* ./mmloader.nit:259 */ + nit_abort("Aborted", NULL, LOCATE_mmloader, 259); + } + /* ./mmloader.nit:263 */ + fra.me.REG[2] = CALL_mmloader___ToolContext___try_to_load(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3], fra.me.REG[2]); + /* ./mmloader.nit:264 */ + REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + REGB1 = TAG_Bool(false); + REGB0 = REGB1; + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[2])(fra.me.REG[2], NIT_NULL); + REGB0 = REGB1; + } + } + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + fra.me.REG[4] = fra.me.REG[2]; + goto label2; + } + /* ./mmloader.nit:266 */ + REGB0 = TAG_Int(3); + fra.me.REG[2] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_5) { + fra.me.REG[3] = BOX_NativeString("Error: "); + REGB0 = TAG_Int(7); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_5 = fra.me.REG[3]; + register_static_object(&once_value_5); + } else fra.me.REG[3] = once_value_5; + 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]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + if (!once_value_6) { + fra.me.REG[1] = BOX_NativeString(" is not a NIT source module."); + REGB0 = TAG_Int(28); + fra.me.REG[1] = NEW_String_string___String___with_native(fra.me.REG[1], REGB0); + once_value_6 = fra.me.REG[1]; + register_static_object(&once_value_6); + } else fra.me.REG[1] = once_value_6; + fra.me.REG[1] = fra.me.REG[1]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + fra.me.REG[2] = CALL_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + CALL_mmloader___ToolContext___fatal_error(fra.me.REG[0])(fra.me.REG[0], NIT_NULL, fra.me.REG[2]); + /* ./mmloader.nit:267 */ + nit_abort("Aborted", NULL, LOCATE_mmloader, 267); + label2: while(0); + stack_frame_head = fra.me.prev; + return fra.me.REG[4]; +} +val_t mmloader___ToolContext___get_module(val_t p0, val_t p1, val_t p2){ + struct {struct stack_frame_t me; val_t MORE_REG[5];} fra; + val_t REGB0; + val_t REGB1; + val_t REGB2; + val_t tmp; + static val_t once_value_4; /* Once value */ + static val_t once_value_5; /* Once value */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 270; + fra.me.meth = LOCATE_mmloader___ToolContext___get_module; + 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; + fra.me.REG[2] = p2; + /* ./mmloader.nit:274 */ + REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + REGB1 = TAG_Bool(false); + REGB0 = REGB1; + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[2])(fra.me.REG[2], NIT_NULL); + REGB0 = REGB1; } - variable5 = ((mmloader___ModuleLoader___can_handle_t)CALL( variable3 /*l*/,COLOR_mmloader___ModuleLoader___can_handle))( variable3 /*l*/, variable0 /*module_name*/, variable1 /*dir*/) /*ModuleLoader::can_handle*/; - if (UNTAG_Bool(variable5)) { /*if*/ - variable6 = ((abstractmetamodel___MMDirectory___full_name_for_t)CALL( variable1 /*dir*/,COLOR_abstractmetamodel___MMDirectory___full_name_for))( variable1 /*dir*/, variable0 /*module_name*/) /*MMDirectory::full_name_for*/; - variable5 = variable6; - variable6 = ATTR_mmloader___ToolContext____processing_modules( self) /*ToolContext::_processing_modules*/; - variable6 = ((hash___HashSet___has_t)CALL(variable6,COLOR_abstract_collection___Collection___has))(variable6, variable5 /*full_name*/) /*HashSet::has*/; - if (UNTAG_Bool(variable6)) { /*if*/ - variable6 = NEW_string___String___init(); /*new String*/ - variable7 = NEW_string___String___with_native(BOX_NativeString("Error: Dependency loop for module "), TAG_Int(34)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable8) /*String::append*/; - variable9 = variable5 /*full_name*/; - variable9 = ((string___String___to_s_t)CALL(variable9,COLOR_string___Object___to_s))(variable9) /*String::to_s*/; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable9) /*String::append*/; - variable10 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable11 = variable10; - ((string___String___append_t)CALL(variable6,COLOR_abstract_collection___IndexedCollection___append))(variable6, variable11) /*String::append*/; - ((mmloader___ToolContext___error_t)CALL( self,COLOR_mmloader___ToolContext___error))( self, variable6) /*ToolContext::error*/; - exit(UNTAG_Int( TAG_Int(1))); - fprintf(stderr, "Aborted"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___try_to_load, LOCATE_mmloader, 135); nit_exit(1); + } + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + /* ./mmloader.nit:275 */ + REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + nit_abort("Reciever is null", NULL, LOCATE_mmloader, 275); + } + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___directory(fra.me.REG[2])(fra.me.REG[2]); + /* ./mmloader.nit:276 */ + while(1) { + REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + REGB1 = TAG_Bool(false); + REGB0 = REGB1; + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[2])(fra.me.REG[2], NIT_NULL); + REGB0 = REGB1; + } + } + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + /* ./mmloader.nit:277 */ + fra.me.REG[3] = CALL_mmloader___ToolContext___try_to_load(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[2]); + /* ./mmloader.nit:278 */ + REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + REGB1 = TAG_Bool(false); + REGB0 = REGB1; + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[3])(fra.me.REG[3], NIT_NULL); + REGB0 = REGB1; + } + } + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + goto label1; + } + /* ./mmloader.nit:279 */ + REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL); + if (UNTAG_Bool(REGB0)) { + nit_abort("Reciever is null", NULL, LOCATE_mmloader, 279); + } + fra.me.REG[4] = CALL_abstractmetamodel___MMDirectory___parent(fra.me.REG[2])(fra.me.REG[2]); + fra.me.REG[2] = fra.me.REG[4]; + } else { + /* ./mmloader.nit:276 */ + goto label2; } - variable6 = ATTR_mmloader___ToolContext____processing_modules( self) /*ToolContext::_processing_modules*/; - ((hash___HashSet___add_t)CALL(variable6,COLOR_abstract_collection___SimpleCollection___add))(variable6, variable5 /*full_name*/) /*HashSet::add*/; - variable7 = ((mmloader___ModuleLoader___load_and_process_module_t)CALL( variable3 /*l*/,COLOR_mmloader___ModuleLoader___load_and_process_module))( variable3 /*l*/, self, variable0 /*module_name*/, variable1 /*dir*/) /*ModuleLoader::load_and_process_module*/; - variable6 = variable7; - variable7 = ATTR_mmloader___ToolContext____processing_modules( self) /*ToolContext::_processing_modules*/; - ((hash___HashSet___remove_t)CALL(variable7,COLOR_abstract_collection___RemovableCollection___remove))(variable7, variable5 /*full_name*/) /*HashSet::remove*/; - ((abstractmetamodel___MMDirectory___add_module_t)CALL( variable1 /*dir*/,COLOR_abstractmetamodel___MMDirectory___add_module))( variable1 /*dir*/, variable6 /*m*/) /*MMDirectory::add_module*/; - variable2 = variable6 /*m*/; - goto return_label6; } - continue_8: while(0); - ((array___ArrayIterator___next_t)CALL(variable2,COLOR_abstract_collection___Iterator___next))(variable2) /*ArrayIterator::next*/; - } - break_8: while(0); - variable2 = NIT_NULL /*null*/; - goto return_label6; - return_label6: while(false); - tracehead = trace.prev; - return variable2; -} -val_t mmloader___ToolContext___get_module_from_filename(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 152, LOCATE_mmloader___ToolContext___get_module_from_filename}; - 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; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable2 = ((file___String___dirname_t)CALL( variable0 /*filename*/,COLOR_file___String___dirname))( variable0 /*filename*/) /*String::dirname*/; - variable1 = variable2; - variable3 = NEW_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/ - variable3 = ((file___String___basename_t)CALL( variable0 /*filename*/,COLOR_file___String___basename))( variable0 /*filename*/, variable3) /*String::basename*/; - variable3 = ((symbol___String___to_symbol_t)CALL(variable3,COLOR_symbol___String___to_symbol))(variable3) /*String::to_symbol*/; - variable2 = variable3; - variable4 = ((mmloader___ToolContext___directory_for_t)CALL( self,COLOR_mmloader___ToolContext___directory_for))( self, variable1 /*path*/) /*ToolContext::directory_for*/; - variable3 = variable4; - variable4 = ((symbol___Symbol___to_s_t)CALL( variable2 /*module_name*/,COLOR_string___Object___to_s))( variable2 /*module_name*/) /*Symbol::to_s*/; - variable4 = TAG_Bool((variable4 == variable0 /*filename*/) || ((variable4 != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable4,COLOR_kernel___Object_____eqeq))(variable4, variable0 /*filename*/) /*String::==*/))); - if (UNTAG_Bool(variable4)) { /*if*/ - variable5 = ((mmloader___ToolContext___try_to_load_t)CALL( self,COLOR_mmloader___ToolContext___try_to_load))( self, variable2 /*module_name*/, variable3 /*dir*/) /*ToolContext::try_to_load*/; - variable4 = variable5; - variable5 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable4 /*m*/ == NIT_NULL /*null*/) || (( variable4 /*m*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable4 /*m*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable4 /*m*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable4 /*m*/,COLOR_kernel___Object_____eqeq))( variable4 /*m*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (UNTAG_Bool(variable5)) { /*if*/ - variable1 = variable4 /*m*/; - goto return_label9; + label2: while(0); + } + /* ./mmloader.nit:283 */ + fra.me.REG[2] = CALL_mmloader___ToolContext___paths(fra.me.REG[0])(fra.me.REG[0]); + /* ./../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[2])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 235); + } + REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[2]); + /* ./../lib/standard//collection//array.nit:236 */ + fra.me.REG[4] = ATTR_array___Array____items(fra.me.REG[2]); + /* ./../lib/standard//collection//array.nit:237 */ + while(1) { + /* ./../lib/standard//collection//array.nit:23 */ + REGB1 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 23); } - variable5 = ((mmloader___ToolContext___get_module_t)CALL( self,COLOR_mmloader___ToolContext___get_module))( self, variable2 /*module_name*/, NIT_NULL /*null*/) /*ToolContext::get_module*/; - variable1 = variable5; - goto return_label9; - } - variable4 = ((file___String___file_exists_t)CALL( variable0 /*filename*/,COLOR_file___String___file_exists))( variable0 /*filename*/) /*String::file_exists*/; - if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable4)))) { /*if*/ - variable4 = NEW_string___String___init(); /*new String*/ - variable5 = NEW_string___String___with_native(BOX_NativeString("Error: File "), TAG_Int(12)); /*new String*/ - variable6 = variable5; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable6) /*String::append*/; - variable7 = variable0 /*filename*/; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable7) /*String::append*/; - variable8 = NEW_string___String___with_native(BOX_NativeString(" not found."), TAG_Int(11)); /*new String*/ - variable9 = variable8; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable9) /*String::append*/; - ((mmloader___ToolContext___error_t)CALL( self,COLOR_mmloader___ToolContext___error))( self, variable4) /*ToolContext::error*/; - exit(UNTAG_Int( TAG_Int(1))); - fprintf(stderr, "Aborted"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___get_module_from_filename, LOCATE_mmloader, 175); nit_exit(1); - } - variable5 = ((mmloader___ToolContext___try_to_load_t)CALL( self,COLOR_mmloader___ToolContext___try_to_load))( self, variable2 /*module_name*/, variable3 /*dir*/) /*ToolContext::try_to_load*/; - variable4 = variable5; - variable5 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable4 /*m*/ == NIT_NULL /*null*/) || (( variable4 /*m*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable4 /*m*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable4 /*m*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable4 /*m*/,COLOR_kernel___Object_____eqeq))( variable4 /*m*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (UNTAG_Bool(variable5)) { /*if*/ - variable1 = variable4 /*m*/; - goto return_label9; - } - variable5 = NEW_string___String___init(); /*new String*/ - variable6 = NEW_string___String___with_native(BOX_NativeString("Error: "), TAG_Int(7)); /*new String*/ - variable7 = variable6; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/; - variable8 = variable0 /*filename*/; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable8) /*String::append*/; - variable9 = NEW_string___String___with_native(BOX_NativeString(" is not a NIT source module."), TAG_Int(28)); /*new String*/ - variable10 = variable9; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable10) /*String::append*/; - ((mmloader___ToolContext___error_t)CALL( self,COLOR_mmloader___ToolContext___error))( self, variable5) /*ToolContext::error*/; - exit(UNTAG_Int( TAG_Int(1))); - fprintf(stderr, "Aborted"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___get_module_from_filename, LOCATE_mmloader, 184); nit_exit(1); - return_label9: while(false); - tracehead = trace.prev; - return variable1; -} -val_t mmloader___ToolContext___get_module(val_t self, val_t param0, val_t param1) { - struct trace_t trace = {NULL, NULL, 187, LOCATE_mmloader___ToolContext___get_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; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable1 = param1; - variable2 = NIT_NULL /*decl variable m*/; - variable3 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable1 /*from*/ == NIT_NULL /*null*/) || (( variable1 /*from*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable1 /*from*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable1 /*from*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable1 /*from*/,COLOR_kernel___Object_____eqeq))( variable1 /*from*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (UNTAG_Bool(variable3)) { /*if*/ - variable4 = ((abstractmetamodel___MMModule___directory_t)CALL( variable1 /*from*/,COLOR_abstractmetamodel___MMModule___directory))( variable1 /*from*/) /*MMModule::directory*/; - variable3 = variable4; - while (true) { /*while*/ - variable4 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable3 /*dir*/ == NIT_NULL /*null*/) || (( variable3 /*dir*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable3 /*dir*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable3 /*dir*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable3 /*dir*/,COLOR_kernel___Object_____eqeq))( variable3 /*dir*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (!UNTAG_Bool(variable4)) break; /* while*/ - variable5 = ((mmloader___ToolContext___try_to_load_t)CALL( self,COLOR_mmloader___ToolContext___try_to_load))( self, variable0 /*module_name*/, variable3 /*dir*/) /*ToolContext::try_to_load*/; - variable4 = variable5; - variable5 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable4 /*m*/ == NIT_NULL /*null*/) || (( variable4 /*m*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable4 /*m*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable4 /*m*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable4 /*m*/,COLOR_kernel___Object_____eqeq))( variable4 /*m*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (UNTAG_Bool(variable5)) { /*if*/ - variable2 = variable4 /*m*/; - goto return_label10; + REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[2]); + /* ./../lib/standard//kernel.nit:212 */ + REGB1 = TAG_Bool(UNTAG_Int(REGB0)val[UNTAG_Int(REGB0)]; + /* ./mmloader.nit:284 */ + fra.me.REG[5] = CALL_mmloader___ToolContext___directory_for(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[5]); + fra.me.REG[5] = CALL_mmloader___ToolContext___try_to_load(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[5]); + /* ./mmloader.nit:285 */ + REGB1 = TAG_Bool(fra.me.REG[5]==NIT_NULL); + if (UNTAG_Bool(REGB1)) { + } else { + REGB2 = TAG_Bool(fra.me.REG[5]==NIT_NULL); + if (UNTAG_Bool(REGB2)) { + REGB2 = TAG_Bool(false); + REGB1 = REGB2; + } else { + REGB2 = CALL_kernel___Object_____eqeq(fra.me.REG[5])(fra.me.REG[5], NIT_NULL); + REGB1 = REGB2; + } + } + REGB1 = TAG_Bool(!UNTAG_Bool(REGB1)); + if (UNTAG_Bool(REGB1)) { + fra.me.REG[3] = fra.me.REG[5]; + goto label1; } - variable5 = ((abstractmetamodel___MMDirectory___parent_t)CALL( variable3 /*dir*/,COLOR_abstractmetamodel___MMDirectory___parent))( variable3 /*dir*/) /*MMDirectory::parent*/; - variable3 = variable5 /*dir=*/; - continue_11: while(0); + /* ./../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 label3; } - break_11: while(0); - } - variable3 = ((mmloader___ToolContext___paths_t)CALL( self,COLOR_mmloader___ToolContext___paths))( self) /*ToolContext::paths*/; - variable3 = ((array___AbstractArray___iterator_t)CALL(variable3,COLOR_abstract_collection___Collection___iterator))(variable3) /*AbstractArray::iterator*/; - while (true) { /*for*/ - variable4 = ((array___ArrayIterator___is_ok_t)CALL(variable3,COLOR_abstract_collection___Iterator___is_ok))(variable3) /*ArrayIterator::is_ok*/; - if (!UNTAG_Bool(variable4)) break; /*for*/ - variable4 = ((array___ArrayIterator___item_t)CALL(variable3,COLOR_abstract_collection___Iterator___item))(variable3) /*ArrayIterator::item*/; - variable6 = ((mmloader___ToolContext___directory_for_t)CALL( self,COLOR_mmloader___ToolContext___directory_for))( self, variable4 /*p*/) /*ToolContext::directory_for*/; - variable6 = ((mmloader___ToolContext___try_to_load_t)CALL( self,COLOR_mmloader___ToolContext___try_to_load))( self, variable0 /*module_name*/, variable6) /*ToolContext::try_to_load*/; - variable5 = variable6; - variable6 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable5 /*m*/ == NIT_NULL /*null*/) || (( variable5 /*m*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable5 /*m*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable5 /*m*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable5 /*m*/,COLOR_kernel___Object_____eqeq))( variable5 /*m*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (UNTAG_Bool(variable6)) { /*if*/ - variable2 = variable5 /*m*/; - goto return_label10; + } + label3: while(0); + /* ./mmloader.nit:288 */ + REGB0 = TAG_Int(3); + fra.me.REG[4] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_4) { + fra.me.REG[2] = BOX_NativeString("Error: No ressource found for module "); + REGB0 = TAG_Int(37); + 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]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[2]); + fra.me.REG[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[1]); + if (!once_value_5) { + fra.me.REG[1] = BOX_NativeString("."); + REGB0 = TAG_Int(1); + fra.me.REG[1] = NEW_String_string___String___with_native(fra.me.REG[1], REGB0); + once_value_5 = fra.me.REG[1]; + register_static_object(&once_value_5); + } else fra.me.REG[1] = once_value_5; + fra.me.REG[1] = fra.me.REG[1]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[1]); + fra.me.REG[4] = CALL_string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]); + CALL_mmloader___ToolContext___fatal_error(fra.me.REG[0])(fra.me.REG[0], NIT_NULL, fra.me.REG[4]); + /* ./mmloader.nit:289 */ + nit_abort("Aborted", NULL, LOCATE_mmloader, 289); + label1: while(0); + stack_frame_head = fra.me.prev; + return fra.me.REG[3]; +} +val_t mmloader___ToolContext___directory_for(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[3];} fra; + val_t REGB0; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 292; + fra.me.meth = LOCATE_mmloader___ToolContext___directory_for; + 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; + fra.me.REG[1] = p1; + /* ./mmloader.nit:295 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____path_dirs(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_path_dirs", LOCATE_mmloader, 295); + } + fra.me.REG[2] = ATTR_mmloader___ToolContext____path_dirs(fra.me.REG[0]); + REGB0 = CALL_abstract_collection___MapRead___has_key(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + if (UNTAG_Bool(REGB0)) { + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____path_dirs(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_path_dirs", LOCATE_mmloader, 295); } - continue_12: while(0); - ((array___ArrayIterator___next_t)CALL(variable3,COLOR_abstract_collection___Iterator___next))(variable3) /*ArrayIterator::next*/; - } - break_12: while(0); - variable3 = NEW_string___String___init(); /*new String*/ - variable4 = NEW_string___String___with_native(BOX_NativeString("Error: No ressource found for module "), TAG_Int(37)); /*new String*/ - variable5 = variable4; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable5) /*String::append*/; - variable6 = variable0 /*module_name*/; - variable6 = ((string___String___to_s_t)CALL(variable6,COLOR_string___Object___to_s))(variable6) /*String::to_s*/; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable6) /*String::append*/; - variable7 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/ - variable8 = variable7; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable8) /*String::append*/; - ((mmloader___ToolContext___error_t)CALL( self,COLOR_mmloader___ToolContext___error))( self, variable3) /*ToolContext::error*/; - exit(UNTAG_Int( TAG_Int(1))); - fprintf(stderr, "Aborted"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___get_module, LOCATE_mmloader, 208); nit_exit(1); - return_label10: while(false); - tracehead = trace.prev; - return variable2; -} -val_t mmloader___ToolContext___directory_for(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 211, LOCATE_mmloader___ToolContext___directory_for}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable1 = ATTR_mmloader___ToolContext____path_dirs( self) /*ToolContext::_path_dirs*/; - variable1 = ((abstract_collection___Map___has_key_t)CALL(variable1,COLOR_abstract_collection___Map___has_key))(variable1, variable0 /*path*/) /*Map::has_key*/; - if (UNTAG_Bool(variable1)) { /*if*/ - variable1 = ATTR_mmloader___ToolContext____path_dirs( self) /*ToolContext::_path_dirs*/; - variable1 = ((abstract_collection___Map_____bra_t)CALL(variable1,COLOR_abstract_collection___Map_____bra))(variable1, variable0 /*path*/) /*Map::[]*/; - goto return_label13; - } - variable2 = ((symbol___String___to_symbol_t)CALL( variable0 /*path*/,COLOR_symbol___String___to_symbol))( variable0 /*path*/) /*String::to_symbol*/; - variable3 = NEW_abstractmetamodel___MMDirectory___init(variable2, variable0 /*path*/, NIT_NULL /*null*/); /*new MMDirectory*/ - variable2 = variable3; - variable1 = variable2; - variable2 = ATTR_mmloader___ToolContext____path_dirs( self) /*ToolContext::_path_dirs*/; - ((abstract_collection___Map_____braeq_t)CALL(variable2,COLOR_abstract_collection___Map_____braeq))(variable2, variable0 /*path*/, variable1 /*dir*/) /*Map::[]=*/; - variable1 = variable1 /*dir*/; - goto return_label13; - return_label13: while(false); - tracehead = trace.prev; - return variable1; -} -void mmloader___ToolContext___register_loader(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 223, LOCATE_mmloader___ToolContext___register_loader}; - val_t variable0; - val_t variable1; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable1 = ATTR_mmloader___ToolContext____loaders( self) /*ToolContext::_loaders*/; - ((array___AbstractArray___add_t)CALL(variable1,COLOR_abstract_collection___SimpleCollection___add))(variable1, variable0 /*ml*/) /*AbstractArray::add*/; - tracehead = trace.prev; + fra.me.REG[2] = ATTR_mmloader___ToolContext____path_dirs(fra.me.REG[0]); + fra.me.REG[2] = CALL_abstract_collection___MapRead_____bra(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + goto label1; + } + /* ./mmloader.nit:296 */ + fra.me.REG[3] = CALL_symbol___String___to_symbol(fra.me.REG[1])(fra.me.REG[1]); + fra.me.REG[3] = NEW_MMDirectory_abstractmetamodel___MMDirectory___init(fra.me.REG[3], fra.me.REG[1], NIT_NULL); + /* ./mmloader.nit:297 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____path_dirs(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_path_dirs", LOCATE_mmloader, 297); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____path_dirs(fra.me.REG[0]); + CALL_abstract_collection___Map_____braeq(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[3]); + /* ./mmloader.nit:298 */ + fra.me.REG[2] = fra.me.REG[3]; + goto label1; + label1: while(0); + stack_frame_head = fra.me.prev; + return fra.me.REG[2]; +} +void mmloader___ToolContext___register_loader(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[1];} fra; + val_t REGB0; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 304; + fra.me.meth = LOCATE_mmloader___ToolContext___register_loader; + 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; + /* ./mmloader.nit:305 */ + REGB0 = TAG_Bool(ATTR_mmloader___ToolContext____loaders(fra.me.REG[0])!=NIT_NULL); + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Uninitialized attribute %s", "_loaders", LOCATE_mmloader, 305); + } + fra.me.REG[0] = ATTR_mmloader___ToolContext____loaders(fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]); + stack_frame_head = fra.me.prev; return; } -val_t mmloader___ModuleLoader___file_type(val_t self) { - struct trace_t trace = {NULL, NULL, 232, LOCATE_mmloader___ModuleLoader___file_type}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - fprintf(stderr, "Deferred method %s called"); - fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___register_loader, LOCATE_mmloader, 232); - nit_exit(1); - tracehead = trace.prev; +val_t mmloader___ModuleLoader___file_type(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 313; + fra.me.meth = LOCATE_mmloader___ModuleLoader___file_type; + fra.me.has_broke = 0; + fra.me.REG_size = 0; + /* ./mmloader.nit:313 */ + nit_abort("Deferred method called", NULL, LOCATE_mmloader, 313); + stack_frame_head = fra.me.prev; return NIT_NULL; } -val_t mmloader___ModuleLoader___try_to_load_dir(val_t self, val_t param0, val_t param1) { - struct trace_t trace = {NULL, NULL, 235, LOCATE_mmloader___ModuleLoader___try_to_load_dir}; - 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; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable1 = param1; - variable3 = NEW_string___String___init(); /*new String*/ - variable4 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable5 = variable4; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable5) /*String::append*/; - variable6 = ((abstractmetamodel___MMDirectory___path_t)CALL( variable1 /*parent_dir*/,COLOR_abstractmetamodel___MMDirectory___path))( variable1 /*parent_dir*/) /*MMDirectory::path*/; - variable7 = variable6; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable7) /*String::append*/; - variable8 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable9 = variable8; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable9) /*String::append*/; - variable10 = variable0 /*dirname*/; - variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable12) /*String::append*/; - variable2 = variable3; - variable3 = ((file___String___file_exists_t)CALL( variable2 /*fname*/,COLOR_file___String___file_exists))( variable2 /*fname*/) /*String::file_exists*/; - if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable3)))) { /*if*/ - variable2 = NIT_NULL /*null*/; - goto return_label15; - } - variable4 = ((abstractmetamodel___MMDirectory___full_name_for_t)CALL( variable1 /*parent_dir*/,COLOR_abstractmetamodel___MMDirectory___full_name_for))( variable1 /*parent_dir*/, variable0 /*dirname*/) /*MMDirectory::full_name_for*/; - variable5 = NEW_abstractmetamodel___MMDirectory___init(variable4, variable2 /*fname*/, variable1 /*parent_dir*/); /*new MMDirectory*/ - variable4 = variable5; - variable3 = variable4; - variable2 = variable3 /*dir*/; - goto return_label15; - return_label15: while(false); - tracehead = trace.prev; - return variable2; -} -val_t mmloader___ModuleLoader___can_handle(val_t self, val_t param0, val_t param1) { - struct trace_t trace = {NULL, NULL, 245, LOCATE_mmloader___ModuleLoader___can_handle}; - 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_mmloader; - variable0 = param0; - variable1 = param1; - variable3 = NEW_string___String___init(); /*new String*/ - variable4 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable5 = variable4; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable5) /*String::append*/; - variable6 = ((abstractmetamodel___MMDirectory___path_t)CALL( variable1 /*dir*/,COLOR_abstractmetamodel___MMDirectory___path))( variable1 /*dir*/) /*MMDirectory::path*/; - variable7 = variable6; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable7) /*String::append*/; - variable8 = NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/ - variable9 = variable8; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable9) /*String::append*/; - variable10 = variable0 /*module_name*/; - variable10 = ((string___String___to_s_t)CALL(variable10,COLOR_string___Object___to_s))(variable10) /*String::to_s*/; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable10) /*String::append*/; - variable11 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/ - variable12 = variable11; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable12) /*String::append*/; - variable13 = ((mmloader___ModuleLoader___file_type_t)CALL( self,COLOR_mmloader___ModuleLoader___file_type))( self) /*ModuleLoader::file_type*/; - variable14 = variable13; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable14) /*String::append*/; - variable15 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable16 = variable15; - ((string___String___append_t)CALL(variable3,COLOR_abstract_collection___IndexedCollection___append))(variable3, variable16) /*String::append*/; - variable2 = variable3; - variable3 = ((file___String___file_exists_t)CALL( variable2 /*fname*/,COLOR_file___String___file_exists))( variable2 /*fname*/) /*String::file_exists*/; - if (UNTAG_Bool(variable3)) { /*if*/ - variable2 = TAG_Bool(true); - goto return_label16; - } - variable2 = TAG_Bool(false); - goto return_label16; - return_label16: while(false); - tracehead = trace.prev; - return variable2; -} -val_t mmloader___ModuleLoader___load_and_process_module(val_t self, val_t param0, val_t param1, val_t param2) { - struct trace_t trace = {NULL, NULL, 254, LOCATE_mmloader___ModuleLoader___load_and_process_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; - val_t variable17; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable1 = param1; - variable2 = param2; - 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 = ((abstractmetamodel___MMDirectory___path_t)CALL( variable2 /*dir*/,COLOR_abstractmetamodel___MMDirectory___path))( variable2 /*dir*/) /*MMDirectory::path*/; - 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 = variable1 /*module_name*/; - variable11 = ((string___String___to_s_t)CALL(variable11,COLOR_string___Object___to_s))(variable11) /*String::to_s*/; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable11) /*String::append*/; - variable12 = NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/ - variable13 = variable12; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable13) /*String::append*/; - variable14 = ((mmloader___ModuleLoader___file_type_t)CALL( self,COLOR_mmloader___ModuleLoader___file_type))( self) /*ModuleLoader::file_type*/; - variable15 = variable14; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable15) /*String::append*/; - variable16 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable17 = variable16; - ((string___String___append_t)CALL(variable4,COLOR_abstract_collection___IndexedCollection___append))(variable4, variable17) /*String::append*/; - variable3 = variable4; - variable5 = ((mmloader___ModuleLoader___load_module_t)CALL( self,COLOR_mmloader___ModuleLoader___load_module))( self, variable0 /*context*/, variable1 /*module_name*/, variable2 /*dir*/, variable3 /*filename*/) /*ModuleLoader::load_module*/; - variable4 = variable5; - variable5 = ((mmloader___ToolContext___opt_only_parse_t)CALL( variable0 /*context*/,COLOR_mmloader___ToolContext___opt_only_parse))( variable0 /*context*/) /*ToolContext::opt_only_parse*/; - variable5 = ((opts___Option___value_t)CALL(variable5,COLOR_opts___Option___value))(variable5) /*Option::value*/; - if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable5)))) { /*if*/ - ((mmloader___ModuleLoader___process_metamodel_t)CALL( self,COLOR_mmloader___ModuleLoader___process_metamodel))( self, variable0 /*context*/, variable4 /*m*/) /*ModuleLoader::process_metamodel*/; - } - variable3 = variable4 /*m*/; - goto return_label17; - return_label17: while(false); - tracehead = trace.prev; - return variable3; -} -val_t mmloader___ModuleLoader___load_module(val_t self, val_t param0, val_t param1, val_t param2, val_t param3) { - struct trace_t trace = {NULL, NULL, 264, LOCATE_mmloader___ModuleLoader___load_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; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable1 = param1; - variable2 = param2; - variable3 = param3; - variable4 = NIT_NULL /*decl variable file*/; - variable5 = NEW_string___String___with_native(BOX_NativeString("-"), TAG_Int(1)); /*new String*/ - variable5 = TAG_Bool(( variable3 /*filename*/ == variable5) || (( variable3 /*filename*/ != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL( variable3 /*filename*/,COLOR_kernel___Object_____eqeq))( variable3 /*filename*/, variable5) /*String::==*/))); - if (UNTAG_Bool(variable5)) { /*if*/ - variable5 = ((file___Object___stdin_t)CALL( self,COLOR_file___Object___stdin))( self) /*Object::stdin*/; - variable4 = variable5 /*file=*/; - } else { /*if*/ - variable5 = ((string___String___to_s_t)CALL( variable3 /*filename*/,COLOR_string___Object___to_s))( variable3 /*filename*/) /*String::to_s*/; - variable6 = NEW_file___IFStream___open(variable5); /*new IFStream*/ - variable5 = variable6; - variable4 = variable5 /*file=*/; - } - variable5 = ((stream___BufferedIStream___eof_t)CALL( variable4 /*file*/,COLOR_stream___IStream___eof))( variable4 /*file*/) /*BufferedIStream::eof*/; - if (UNTAG_Bool(variable5)) { /*if*/ - variable5 = NEW_string___String___init(); /*new String*/ - variable6 = NEW_string___String___with_native(BOX_NativeString("Error: Problem in opening file "), TAG_Int(31)); /*new String*/ - variable7 = variable6; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable7) /*String::append*/; - variable8 = variable3 /*filename*/; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable8) /*String::append*/; - variable9 = NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/ - variable10 = variable9; - ((string___String___append_t)CALL(variable5,COLOR_abstract_collection___IndexedCollection___append))(variable5, variable10) /*String::append*/; - ((mmloader___ToolContext___error_t)CALL( variable0 /*context*/,COLOR_mmloader___ToolContext___error))( variable0 /*context*/, variable5) /*ToolContext::error*/; - exit(UNTAG_Int( TAG_Int(1))); - fprintf(stderr, "Aborted"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ModuleLoader___load_module, LOCATE_mmloader, 277); nit_exit(1); - } - variable6 = ((mmloader___ModuleLoader___parse_file_t)CALL( self,COLOR_mmloader___ModuleLoader___parse_file))( self, variable0 /*context*/, variable4 /*file*/, variable3 /*filename*/, variable1 /*module_name*/, variable2 /*dir*/) /*ModuleLoader::parse_file*/; - variable5 = variable6; - ((mmloader___MMModule___filename__eq_t)CALL( variable5 /*m*/,COLOR_mmloader___MMModule___filename__eq))( variable5 /*m*/, variable3 /*filename*/) /*MMModule::filename=*/; - variable6 = ((file___Object___stdin_t)CALL( self,COLOR_file___Object___stdin))( self) /*Object::stdin*/; - variable6 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable4 /*file*/ == variable6) || (( variable4 /*file*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable4 /*file*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable4 /*file*/,variable6)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable4 /*file*/,COLOR_kernel___Object_____eqeq))( variable4 /*file*/, variable6) /*Object::==*/))))))); - if (UNTAG_Bool(variable6)) { /*if*/ - ((file___IFStream___close_t)CALL( variable4 /*file*/,COLOR_stream___IOS___close))( variable4 /*file*/) /*IFStream::close*/; - } - variable4 = variable5 /*m*/; - goto return_label18; - return_label18: while(false); - tracehead = trace.prev; - return variable4; -} -val_t mmloader___ModuleLoader___parse_file(val_t self, val_t param0, val_t param1, val_t param2, val_t param3, val_t param4) { - struct trace_t trace = {NULL, NULL, 285, LOCATE_mmloader___ModuleLoader___parse_file}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - fprintf(stderr, "Deferred method %s called"); - fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ModuleLoader___load_module, LOCATE_mmloader, 285); - nit_exit(1); - tracehead = trace.prev; - return NIT_NULL; +val_t mmloader___ModuleLoader___try_to_load_dir(val_t p0, val_t p1, val_t p2){ + 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 */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 316; + fra.me.meth = LOCATE_mmloader___ModuleLoader___try_to_load_dir; + 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; + fra.me.REG[1] = p1; + fra.me.REG[2] = p2; + /* ./mmloader.nit:319 */ + REGB0 = TAG_Int(5); + fra.me.REG[0] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_1) { + fra.me.REG[3] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + 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[0])(fra.me.REG[0], fra.me.REG[3]); + fra.me.REG[3] = CALL_abstractmetamodel___MMDirectory___path(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]); + if (!once_value_2) { + fra.me.REG[3] = BOX_NativeString("/"); + REGB0 = TAG_Int(1); + fra.me.REG[3] = NEW_String_string___String___with_native(fra.me.REG[3], REGB0); + once_value_2 = fra.me.REG[3]; + register_static_object(&once_value_2); + } else fra.me.REG[3] = once_value_2; + fra.me.REG[3] = fra.me.REG[3]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]); + fra.me.REG[3] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]); + if (!once_value_3) { + fra.me.REG[3] = BOX_NativeString("/"); + REGB0 = TAG_Int(1); + 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[0])(fra.me.REG[0], fra.me.REG[3]); + fra.me.REG[0] = CALL_string___Object___to_s(fra.me.REG[0])(fra.me.REG[0]); + /* ./mmloader.nit:320 */ + REGB0 = CALL_file___String___file_exists(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + fra.me.REG[3] = NIT_NULL; + goto label4; + } + /* ./mmloader.nit:322 */ + fra.me.REG[1] = CALL_abstractmetamodel___MMDirectory___full_name_for(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]); + fra.me.REG[2] = NEW_MMDirectory_abstractmetamodel___MMDirectory___init(fra.me.REG[1], fra.me.REG[0], fra.me.REG[2]); + /* ./mmloader.nit:323 */ + fra.me.REG[3] = fra.me.REG[2]; + goto label4; + label4: while(0); + stack_frame_head = fra.me.prev; + return fra.me.REG[3]; } -void mmloader___ModuleLoader___process_metamodel(val_t self, val_t param0, val_t param1) { - struct trace_t trace = {NULL, NULL, 288, LOCATE_mmloader___ModuleLoader___process_metamodel}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - fprintf(stderr, "Deferred method %s called"); - fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ModuleLoader___load_module, LOCATE_mmloader, 288); - nit_exit(1); - tracehead = trace.prev; - return; +val_t mmloader___ModuleLoader___can_handle(val_t p0, val_t p1, val_t p2){ + struct {struct stack_frame_t me; val_t MORE_REG[4];} 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 */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 326; + fra.me.meth = LOCATE_mmloader___ModuleLoader___can_handle; + fra.me.has_broke = 0; + fra.me.REG_size = 5; + 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[0] = p0; + fra.me.REG[1] = p1; + fra.me.REG[2] = p2; + /* ./mmloader.nit:330 */ + REGB0 = TAG_Int(7); + fra.me.REG[3] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_1) { + 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_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[2] = CALL_abstractmetamodel___MMDirectory___path(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]); + if (!once_value_2) { + fra.me.REG[2] = BOX_NativeString("/"); + REGB0 = TAG_Int(1); + 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]); + fra.me.REG[1] = CALL_string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]); + if (!once_value_3) { + fra.me.REG[1] = BOX_NativeString("."); + 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]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]); + fra.me.REG[0] = CALL_mmloader___ModuleLoader___file_type(fra.me.REG[0])(fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[0]); + if (!once_value_4) { + fra.me.REG[0] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[0] = NEW_String_string___String___with_native(fra.me.REG[0], REGB0); + once_value_4 = fra.me.REG[0]; + register_static_object(&once_value_4); + } else fra.me.REG[0] = once_value_4; + fra.me.REG[0] = fra.me.REG[0]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[0]); + fra.me.REG[3] = CALL_string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]); + /* ./mmloader.nit:331 */ + REGB0 = CALL_file___String___file_exists(fra.me.REG[3])(fra.me.REG[3]); + if (UNTAG_Bool(REGB0)) { + REGB0 = TAG_Bool(true); + goto label5; + } + /* ./mmloader.nit:332 */ + REGB1 = TAG_Bool(false); + REGB0 = REGB1; + goto label5; + label5: while(0); + stack_frame_head = fra.me.prev; + return REGB0; } -val_t mmloader___MMModule___filename(val_t self) { - struct trace_t trace = {NULL, NULL, 293, LOCATE_mmloader___MMModule___filename}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___MMModule____filename( self) /*MMModule::_filename*/; -} -void mmloader___MMModule___filename__eq(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 293, LOCATE_mmloader___MMModule___filename__eq}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - ATTR_mmloader___MMModule____filename( self) /*MMModule::_filename*/ = param0; - tracehead = trace.prev; +val_t mmloader___ModuleLoader___load_and_process_module(val_t p0, val_t p1, val_t p2, val_t p3){ + 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 */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 335; + fra.me.meth = LOCATE_mmloader___ModuleLoader___load_and_process_module; + 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; + fra.me.REG[2] = p2; + fra.me.REG[3] = p3; + /* ./mmloader.nit:339 */ + REGB0 = TAG_Int(7); + fra.me.REG[4] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_1) { + 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_1 = fra.me.REG[5]; + register_static_object(&once_value_1); + } else fra.me.REG[5] = once_value_1; + 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_abstractmetamodel___MMDirectory___path(fra.me.REG[3])(fra.me.REG[3]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + if (!once_value_2) { + 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_2 = fra.me.REG[5]; + register_static_object(&once_value_2); + } else fra.me.REG[5] = once_value_2; + 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_string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + if (!once_value_3) { + 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_3 = fra.me.REG[5]; + register_static_object(&once_value_3); + } else fra.me.REG[5] = once_value_3; + 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_mmloader___ModuleLoader___file_type(fra.me.REG[0])(fra.me.REG[0]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + if (!once_value_4) { + 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_4 = fra.me.REG[5]; + register_static_object(&once_value_4); + } else fra.me.REG[5] = once_value_4; + 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]); + /* ./mmloader.nit:340 */ + fra.me.REG[4] = CALL_mmloader___ModuleLoader___load_module(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[2], fra.me.REG[3], fra.me.REG[4]); + /* ./mmloader.nit:341 */ + fra.me.REG[3] = CALL_mmloader___ToolContext___opt_only_parse(fra.me.REG[1])(fra.me.REG[1]); + fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]); + REGB0 = TAG_Bool(!UNTAG_Bool(fra.me.REG[3])); + if (UNTAG_Bool(REGB0)) { + CALL_mmloader___ModuleLoader___process_metamodel(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[4]); + } + /* ./mmloader.nit:342 */ + goto label5; + label5: while(0); + stack_frame_head = fra.me.prev; + return fra.me.REG[4]; +} +val_t mmloader___ModuleLoader___load_module(val_t p0, val_t p1, val_t p2, val_t p3, val_t p4){ + struct {struct stack_frame_t me; val_t MORE_REG[7];} 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 */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 345; + fra.me.meth = LOCATE_mmloader___ModuleLoader___load_module; + fra.me.has_broke = 0; + fra.me.REG_size = 8; + 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[0] = p0; + fra.me.REG[1] = p1; + fra.me.REG[2] = p2; + fra.me.REG[3] = p3; + fra.me.REG[4] = p4; + /* ./mmloader.nit:349 */ + if (!once_value_1) { + 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_1 = fra.me.REG[5]; + register_static_object(&once_value_1); + } else fra.me.REG[5] = once_value_1; + fra.me.REG[5] = fra.me.REG[5]; + REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[4],fra.me.REG[5])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]); + REGB0 = REGB1; + } + if (UNTAG_Bool(REGB0)) { + /* ./mmloader.nit:350 */ + fra.me.REG[5] = CALL_file___Object___stdin(fra.me.REG[0])(fra.me.REG[0]); + } else { + /* ./mmloader.nit:352 */ + fra.me.REG[6] = CALL_string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]); + fra.me.REG[6] = NEW_IFStream_file___IFStream___open(fra.me.REG[6]); + fra.me.REG[5] = fra.me.REG[6]; + } + /* ./mmloader.nit:355 */ + REGB0 = CALL_stream___IStream___eof(fra.me.REG[5])(fra.me.REG[5]); + if (UNTAG_Bool(REGB0)) { + /* ./mmloader.nit:356 */ + REGB0 = TAG_Int(3); + fra.me.REG[6] = NEW_Array_array___Array___with_capacity(REGB0); + if (!once_value_2) { + fra.me.REG[7] = BOX_NativeString("Error: Problem in opening file "); + REGB0 = TAG_Int(31); + fra.me.REG[7] = NEW_String_string___String___with_native(fra.me.REG[7], REGB0); + once_value_2 = fra.me.REG[7]; + register_static_object(&once_value_2); + } else fra.me.REG[7] = once_value_2; + fra.me.REG[7] = fra.me.REG[7]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[7]); + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[4]); + if (!once_value_3) { + fra.me.REG[7] = BOX_NativeString(""); + REGB0 = TAG_Int(0); + fra.me.REG[7] = NEW_String_string___String___with_native(fra.me.REG[7], REGB0); + once_value_3 = fra.me.REG[7]; + register_static_object(&once_value_3); + } else fra.me.REG[7] = once_value_3; + fra.me.REG[7] = fra.me.REG[7]; + CALL_abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[7]); + fra.me.REG[6] = CALL_string___Object___to_s(fra.me.REG[6])(fra.me.REG[6]); + CALL_mmloader___ToolContext___fatal_error(fra.me.REG[1])(fra.me.REG[1], NIT_NULL, fra.me.REG[6]); + } + /* ./mmloader.nit:358 */ + fra.me.REG[3] = CALL_mmloader___ModuleLoader___parse_file(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[5], fra.me.REG[4], fra.me.REG[2], fra.me.REG[3]); + /* ./mmloader.nit:359 */ + fra.me.REG[0] = CALL_file___Object___stdin(fra.me.REG[0])(fra.me.REG[0]); + REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[5],fra.me.REG[0])); + if (UNTAG_Bool(REGB0)) { + } else { + REGB1 = CALL_kernel___Object_____eqeq(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[0]); + REGB0 = REGB1; + } + REGB0 = TAG_Bool(!UNTAG_Bool(REGB0)); + if (UNTAG_Bool(REGB0)) { + CALL_stream___IOS___close(fra.me.REG[5])(fra.me.REG[5]); + } + /* ./mmloader.nit:360 */ + goto label4; + label4: while(0); + stack_frame_head = fra.me.prev; + return fra.me.REG[3]; +} +val_t mmloader___ModuleLoader___parse_file(val_t p0, val_t p1, val_t p2, val_t p3, val_t p4, val_t p5){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 363; + fra.me.meth = LOCATE_mmloader___ModuleLoader___parse_file; + fra.me.has_broke = 0; + fra.me.REG_size = 0; + /* ./mmloader.nit:363 */ + nit_abort("Deferred method called", NULL, LOCATE_mmloader, 363); + stack_frame_head = fra.me.prev; + return NIT_NULL; +} +void mmloader___ModuleLoader___process_metamodel(val_t p0, val_t p1, val_t p2){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 366; + fra.me.meth = LOCATE_mmloader___ModuleLoader___process_metamodel; + fra.me.has_broke = 0; + fra.me.REG_size = 0; + /* ./mmloader.nit:366 */ + nit_abort("Deferred method called", NULL, LOCATE_mmloader, 366); + stack_frame_head = fra.me.prev; return; } -val_t mmloader___MMModule___mtime(val_t self) { - struct trace_t trace = {NULL, NULL, 296, LOCATE_mmloader___MMModule___mtime}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - tracehead = trace.prev; - return ATTR_mmloader___MMModule____mtime( self) /*MMModule::_mtime*/; -} -void mmloader___MMModule___mtime__eq(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 296, LOCATE_mmloader___MMModule___mtime__eq}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - ATTR_mmloader___MMModule____mtime( self) /*MMModule::_mtime*/ = param0; - tracehead = trace.prev; +void mmloader___ModuleLoader___init(val_t p0, int* init_table){ + int itpos2 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_ModuleLoader].i; + struct {struct stack_frame_t me;} fra; + val_t tmp; + if (init_table[itpos2]) return; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 0; + fra.me.meth = LOCATE_mmloader___ModuleLoader___init; + fra.me.has_broke = 0; + fra.me.REG_size = 0; + stack_frame_head = fra.me.prev; + init_table[itpos2] = 1; return; } -void mmloader___MMModule___import_supers_modules(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 299, LOCATE_mmloader___MMModule___import_supers_modules}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_mmloader; - variable0 = param0; - variable2 = ((abstractmetamodel___MMModule___context_t)CALL( self,COLOR_abstractmetamodel___MMModule___context))( self) /*MMModule::context*/; - variable1 = variable2; - variable2 = TAG_Bool(( variable1 /*c*/==NIT_NULL) || VAL_ISA( variable1 /*c*/, COLOR_ToolContext, ID_ToolContext)) /*cast ToolContext*/; - if (!UNTAG_Bool(variable2)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___MMModule___import_supers_modules, LOCATE_mmloader, 303); nit_exit(1);} - variable3 = NEW_array___Array___init(); /*new Array[E]*/ - variable2 = variable3; - variable3 = ((abstract_collection___Collection___iterator_t)CALL( variable0 /*names*/,COLOR_abstract_collection___Collection___iterator))( variable0 /*names*/) /*Collection::iterator*/; - while (true) { /*for*/ - variable4 = ((abstract_collection___Iterator___is_ok_t)CALL(variable3,COLOR_abstract_collection___Iterator___is_ok))(variable3) /*Iterator::is_ok*/; - if (!UNTAG_Bool(variable4)) break; /*for*/ - variable4 = ((abstract_collection___Iterator___item_t)CALL(variable3,COLOR_abstract_collection___Iterator___item))(variable3) /*Iterator::item*/; - variable6 = ((mmloader___ToolContext___get_module_t)CALL( variable1 /*c*/,COLOR_mmloader___ToolContext___get_module))( variable1 /*c*/, variable4 /*n*/, self) /*ToolContext::get_module*/; - variable5 = variable6; - ((array___AbstractArray___add_t)CALL( variable2 /*supers*/,COLOR_abstract_collection___SimpleCollection___add))( variable2 /*supers*/, variable5 /*m*/) /*AbstractArray::add*/; - continue_20: while(0); - ((abstract_collection___Iterator___next_t)CALL(variable3,COLOR_abstract_collection___Iterator___next))(variable3) /*Iterator::next*/; - } - break_20: while(0); - ((abstractmetamodel___MMContext___add_module_t)CALL( variable1 /*c*/,COLOR_abstractmetamodel___MMContext___add_module))( variable1 /*c*/, self, variable2 /*supers*/) /*MMContext::add_module*/; - tracehead = trace.prev; +void mmloader___MMModule___import_supers_modules(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[3];} fra; + val_t REGB0; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 371; + fra.me.meth = LOCATE_mmloader___MMModule___import_supers_modules; + 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; + fra.me.REG[1] = p1; + /* ./mmloader.nit:374 */ + fra.me.REG[2] = CALL_abstractmetamodel___MMModule___context(fra.me.REG[0])(fra.me.REG[0]); + /* ./mmloader.nit:375 */ + REGB0 = TAG_Bool(VAL_ISA(fra.me.REG[2], COLOR_ToolContext, ID_ToolContext)) /*cast ToolContext*/; + if (UNTAG_Bool(REGB0)) { + } else { + nit_abort("Assert failed", NULL, LOCATE_mmloader, 375); + } + /* ./mmloader.nit:376 */ + fra.me.REG[3] = NEW_Array_array___Array___init(); + CALL_abstract_collection___Collection___iterate(fra.me.REG[1])(fra.me.REG[1], (&(fra.me)), ((fun_t)OC_mmloader___MMModule___import_supers_modules_1)); + /* ./mmloader.nit:381 */ + CALL_abstractmetamodel___MMContext___add_module(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[0], fra.me.REG[3]); + stack_frame_head = fra.me.prev; return; } + void OC_mmloader___MMModule___import_supers_modules_1(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; + /* ./mmloader.nit:377 */ + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_mmloader; + fra.me.line = 0; + fra.me.meth = LOCATE_mmloader___MMModule___import_supers_modules; + 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; + /* ./mmloader.nit:378 */ + fra.me.REG[0] = CALL_mmloader___ToolContext___get_module(closctx->REG[2])(closctx->REG[2], fra.me.REG[0], closctx->REG[0]); + /* ./mmloader.nit:379 */ + CALL_abstract_collection___SimpleCollection___add(closctx->REG[3])(closctx->REG[3], fra.me.REG[0]); + stack_frame_head = fra.me.prev; + return; + }