/* 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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- 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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- 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 variable[10];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[3] = variable[0];
- variable[3] = ((file___Object___stderr_t)CALL(variable[3],COLOR_file___Object___stderr))(variable[3]) /*Object::stderr*/;
- variable[4] = NEW_String_string___String___init(); /*new String*/
- variable[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[6] = variable[5];
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[6]) /*String::append*/;
- variable[7] = variable[1] /*s*/;
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[7]) /*String::append*/;
- variable[8] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
- variable[9] = variable[8];
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[9]) /*String::append*/;
- ((file___OFStream___write_t)CALL(variable[3],COLOR_stream___OStream___write))(variable[3], variable[4]) /*OFStream::write*/;
- variable[3] = variable[0];
- variable[4] = variable[0];
- variable[4] = ATTR_mmloader___ToolContext____error_count(variable[4]) /*ToolContext::_error_count*/;
- variable[4] = TAG_Int(UNTAG_Int(variable[4])+UNTAG_Int( TAG_Int(1)));
- ATTR_mmloader___ToolContext____error_count(variable[3]) /*ToolContext::_error_count*/ = variable[4];
- return_label0: while(false);
- tracehead = trace.prev;
- return;
-}
-void mmloader___ToolContext___warning(val_t self, val_t param0) {
- struct trace_t trace = {NULL, NULL, 40, LOCATE_mmloader___ToolContext___warning};
- val_t variable[10];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[3] = variable[0];
- variable[3] = ATTR_mmloader___ToolContext____opt_warn(variable[3]) /*ToolContext::_opt_warn*/;
- variable[3] = ((opts___Option___value_t)CALL(variable[3],COLOR_opts___Option___value))(variable[3]) /*Option::value*/;
- if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[3])))) { /*if*/
- goto return_label1;
- }
- variable[3] = variable[0];
- variable[3] = ((file___Object___stderr_t)CALL(variable[3],COLOR_file___Object___stderr))(variable[3]) /*Object::stderr*/;
- variable[4] = NEW_String_string___String___init(); /*new String*/
- variable[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[6] = variable[5];
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[6]) /*String::append*/;
- variable[7] = variable[1] /*s*/;
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[7]) /*String::append*/;
- variable[8] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
- variable[9] = variable[8];
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[9]) /*String::append*/;
- ((file___OFStream___write_t)CALL(variable[3],COLOR_stream___OStream___write))(variable[3], variable[4]) /*OFStream::write*/;
- variable[3] = variable[0];
- variable[4] = variable[0];
- variable[4] = ATTR_mmloader___ToolContext____warning_count(variable[4]) /*ToolContext::_warning_count*/;
- variable[4] = TAG_Int(UNTAG_Int(variable[4])+UNTAG_Int( TAG_Int(1)));
- ATTR_mmloader___ToolContext____warning_count(variable[3]) /*ToolContext::_warning_count*/ = variable[4];
- return_label1: while(false);
- tracehead = trace.prev;
- return;
-}
-val_t mmloader___ToolContext___paths(val_t self) {
- struct trace_t trace = {NULL, NULL, 48, LOCATE_mmloader___ToolContext___paths};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- 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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- 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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- 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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- 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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- tracehead = trace.prev;
- return ATTR_mmloader___ToolContext____opt_log( self) /*ToolContext::_opt_log*/;
+static const char LOCATE_mmloader___ToolContext___paths[] = "mmloader::ToolContext::paths";
+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 = 29;
+ fra.me.meth = LOCATE_mmloader___ToolContext___paths;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 1;
+ fra.me.nitni_local_ref_head = NULL;
+ fra.me.REG[0] = NIT_NULL;
+ fra.me.REG[0] = p0;
+ /* mmloader.nit:29 */
+ 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, 29);
+ }
+ 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___opt_only_metamodel(val_t self) {
- struct trace_t trace = {NULL, NULL, 66, LOCATE_mmloader___ToolContext___opt_only_metamodel};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- tracehead = trace.prev;
- return ATTR_mmloader___ToolContext____opt_only_metamodel( self) /*ToolContext::_opt_only_metamodel*/;
+static const char LOCATE_mmloader___ToolContext___opt_path[] = "mmloader::ToolContext::opt_path";
+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 = 35;
+ fra.me.meth = LOCATE_mmloader___ToolContext___opt_path;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 1;
+ fra.me.nitni_local_ref_head = NULL;
+ fra.me.REG[0] = NIT_NULL;
+ fra.me.REG[0] = p0;
+ /* mmloader.nit:35 */
+ 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, 35);
+ }
+ 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_only_parse(val_t self) {
- struct trace_t trace = {NULL, NULL, 69, LOCATE_mmloader___ToolContext___opt_only_parse};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- tracehead = trace.prev;
- return ATTR_mmloader___ToolContext____opt_only_parse( self) /*ToolContext::_opt_only_parse*/;
+static const char LOCATE_mmloader___ToolContext___opt_only_metamodel[] = "mmloader::ToolContext::opt_only_metamodel";
+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 = 38;
+ fra.me.meth = LOCATE_mmloader___ToolContext___opt_only_metamodel;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 1;
+ fra.me.nitni_local_ref_head = NULL;
+ fra.me.REG[0] = NIT_NULL;
+ fra.me.REG[0] = p0;
+ /* mmloader.nit:38 */
+ 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, 38);
+ }
+ 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_help(val_t self) {
- struct trace_t trace = {NULL, NULL, 72, LOCATE_mmloader___ToolContext___opt_help};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- tracehead = trace.prev;
- return ATTR_mmloader___ToolContext____opt_help( self) /*ToolContext::_opt_help*/;
+static const char LOCATE_mmloader___ToolContext___opt_only_parse[] = "mmloader::ToolContext::opt_only_parse";
+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 = 41;
+ fra.me.meth = LOCATE_mmloader___ToolContext___opt_only_parse;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 1;
+ fra.me.nitni_local_ref_head = NULL;
+ fra.me.REG[0] = NIT_NULL;
+ fra.me.REG[0] = p0;
+ /* mmloader.nit:41 */
+ 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, 41);
+ }
+ 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];
}
-void mmloader___ToolContext___init(val_t self, int* init_table) {
- struct trace_t trace = {NULL, NULL, 75, LOCATE_mmloader___ToolContext___init};
- val_t variable[10];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_ToolContext].i]) return;
- ((abstractmetamodel___MMContext___init_t)CALL(variable[0],COLOR_abstractmetamodel___MMContext___init))(variable[0], init_table /*YYY*/) /*MMContext::init*/;
- variable[2] = variable[0];
- variable[2] = ((mmloader___ToolContext___option_context_t)CALL(variable[2],COLOR_mmloader___ToolContext___option_context))(variable[2]) /*ToolContext::option_context*/;
- variable[3] = NEW_Array_array___Array___with_capacity(TAG_Int(6)); /*new Array[Option]*/
- variable[4] = variable[0];
- variable[4] = ((mmloader___ToolContext___opt_warn_t)CALL(variable[4],COLOR_mmloader___ToolContext___opt_warn))(variable[4]) /*ToolContext::opt_warn*/;
- ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[4]) /*AbstractArray::add*/;
- variable[5] = variable[0];
- variable[5] = ((mmloader___ToolContext___opt_path_t)CALL(variable[5],COLOR_mmloader___ToolContext___opt_path))(variable[5]) /*ToolContext::opt_path*/;
- ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[5]) /*AbstractArray::add*/;
- variable[6] = variable[0];
- variable[6] = ((mmloader___ToolContext___opt_log_t)CALL(variable[6],COLOR_mmloader___ToolContext___opt_log))(variable[6]) /*ToolContext::opt_log*/;
- ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[6]) /*AbstractArray::add*/;
- variable[7] = variable[0];
- variable[7] = ((mmloader___ToolContext___opt_only_parse_t)CALL(variable[7],COLOR_mmloader___ToolContext___opt_only_parse))(variable[7]) /*ToolContext::opt_only_parse*/;
- ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[7]) /*AbstractArray::add*/;
- variable[8] = variable[0];
- variable[8] = ((mmloader___ToolContext___opt_only_metamodel_t)CALL(variable[8],COLOR_mmloader___ToolContext___opt_only_metamodel))(variable[8]) /*ToolContext::opt_only_metamodel*/;
- ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[8]) /*AbstractArray::add*/;
- variable[9] = variable[0];
- variable[9] = ((mmloader___ToolContext___opt_help_t)CALL(variable[9],COLOR_mmloader___ToolContext___opt_help))(variable[9]) /*ToolContext::opt_help*/;
- ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[9]) /*AbstractArray::add*/;
- ((opts___OptionContext___add_option_t)CALL(variable[2],COLOR_opts___OptionContext___add_option))(variable[2], variable[3]) /*OptionContext::add_option*/;
- return_label2: while(false);
- init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_ToolContext].i] = 1;
- tracehead = trace.prev;
+static const char LOCATE_mmloader___ToolContext___init[] = "mmloader::ToolContext::(toolcontext::ToolContext::init)";
+void mmloader___ToolContext___init(val_t p0, int* init_table){
+ int itpos0 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_toolcontext___ToolContext].i;
+ struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
+ val_t REGB0;
+ 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 = 44;
+ fra.me.meth = LOCATE_mmloader___ToolContext___init;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 4;
+ fra.me.nitni_local_ref_head = NULL;
+ 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:44 */
+ fra.me.REG[1] = fra.me.REG[0];
+ /* mmloader.nit:46 */
+ CALL_SUPER_mmloader___ToolContext___init(fra.me.REG[0])(fra.me.REG[0], init_table);
+ /* mmloader.nit:47 */
+ fra.me.REG[0] = CALL_toolcontext___ToolContext___option_context(fra.me.REG[1])(fra.me.REG[1]);
+ REGB0 = TAG_Int(2);
+ fra.me.REG[2] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
+ fra.me.REG[3] = CALL_mmloader___ToolContext___opt_path(fra.me.REG[1])(fra.me.REG[1]);
+ CALL_standard___collection___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
+ fra.me.REG[1] = CALL_mmloader___ToolContext___opt_only_metamodel(fra.me.REG[1])(fra.me.REG[1]);
+ CALL_standard___collection___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[itpos0] = 1;
return;
}
-void mmloader___ToolContext___process_options(val_t self) {
- struct trace_t trace = {NULL, NULL, 81, LOCATE_mmloader___ToolContext___process_options};
- static val_t once_value_4; static int once_bool_4; /* Once value for variable[3]*/
- static val_t once_value_5; static int once_bool_5; /* Once value for variable[3]*/
- val_t variable[11];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[2] = variable[0];
- variable[2] = ((mmloader___ToolContext___option_context_t)CALL(variable[2],COLOR_mmloader___ToolContext___option_context))(variable[2]) /*ToolContext::option_context*/;
- variable[3] = variable[0];
- variable[3] = ((string___Object___args_t)CALL(variable[3],COLOR_string___Object___args))(variable[3]) /*Object::args*/;
- ((opts___OptionContext___parse_t)CALL(variable[2],COLOR_opts___OptionContext___parse))(variable[2], variable[3]) /*OptionContext::parse*/;
- variable[2] = variable[0];
- variable[3] = NEW_Array_array___Array___init(); /*new Array[String]*/
- ATTR_mmloader___ToolContext____paths(variable[2]) /*ToolContext::_paths*/ = variable[3];
- variable[2] = variable[0];
- variable[2] = ((mmloader___ToolContext___paths_t)CALL(variable[2],COLOR_mmloader___ToolContext___paths))(variable[2]) /*ToolContext::paths*/;
- variable[3] = variable[0];
- variable[3] = ((mmloader___ToolContext___opt_path_t)CALL(variable[3],COLOR_mmloader___ToolContext___opt_path))(variable[3]) /*ToolContext::opt_path*/;
- variable[3] = ((opts___Option___value_t)CALL(variable[3],COLOR_opts___Option___value))(variable[3]) /*Option::value*/;
- ((abstract_collection___IndexedCollection___append_t)CALL(variable[2],COLOR_abstract_collection___IndexedCollection___append))(variable[2], variable[3]) /*IndexedCollection::append*/;
- if (once_bool_4) variable[3] = once_value_4;
- else {
- variable[3] = NEW_String_string___String___with_native(BOX_NativeString("NIT_PATH"), TAG_Int(8)); /*new String*/
- variable[3] = ((symbol___String___to_symbol_t)CALL(variable[3],COLOR_symbol___String___to_symbol))(variable[3]) /*String::to_symbol*/;
- variable[3] = ((environ___Symbol___environ_t)CALL(variable[3],COLOR_environ___Symbol___environ))(variable[3]) /*Symbol::environ*/;
- once_value_4 = variable[3];
- once_bool_4 = true;
- }
- variable[2] = variable[3];
- variable[3] = ((array___AbstractArray___is_empty_t)CALL( variable[2] /*path_env*/,COLOR_abstract_collection___Collection___is_empty))( variable[2] /*path_env*/) /*AbstractArray::is_empty*/;
- if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[3])))) { /*if*/
- variable[3] = variable[0];
- variable[3] = ((mmloader___ToolContext___paths_t)CALL(variable[3],COLOR_mmloader___ToolContext___paths))(variable[3]) /*ToolContext::paths*/;
- variable[4] = ((string_search___String___split_with_t)CALL( variable[2] /*path_env*/,COLOR_string_search___String___split_with))( variable[2] /*path_env*/, TAG_Char(':')) /*String::split_with*/;
- ((abstract_collection___IndexedCollection___append_t)CALL(variable[3],COLOR_abstract_collection___IndexedCollection___append))(variable[3], variable[4]) /*IndexedCollection::append*/;
- }
- if (once_bool_5) variable[3] = once_value_5;
- else {
- variable[3] = NEW_String_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)); /*new String*/
- variable[3] = ((symbol___String___to_symbol_t)CALL(variable[3],COLOR_symbol___String___to_symbol))(variable[3]) /*String::to_symbol*/;
- variable[3] = ((environ___Symbol___environ_t)CALL(variable[3],COLOR_environ___Symbol___environ))(variable[3]) /*Symbol::environ*/;
- once_value_5 = variable[3];
- once_bool_5 = true;
- }
- variable[2] = variable[3] /*path_env=*/;
- variable[3] = ((array___AbstractArray___is_empty_t)CALL( variable[2] /*path_env*/,COLOR_abstract_collection___Collection___is_empty))( variable[2] /*path_env*/) /*AbstractArray::is_empty*/;
- if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[3])))) { /*if*/
- variable[4] = NEW_String_string___String___init(); /*new String*/
- variable[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[6] = variable[5];
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[6]) /*String::append*/;
- variable[7] = variable[2] /*path_env*/;
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[7]) /*String::append*/;
- variable[8] = NEW_String_string___String___with_native(BOX_NativeString("/lib"), TAG_Int(4)); /*new String*/
- variable[9] = variable[8];
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[9]) /*String::append*/;
- variable[3] = variable[4];
- variable[4] = ((file___String___file_exists_t)CALL( variable[3] /*libname*/,COLOR_file___String___file_exists))( variable[3] /*libname*/) /*String::file_exists*/;
- if (UNTAG_Bool(variable[4])) { /*if*/
- variable[4] = variable[0];
- variable[4] = ((mmloader___ToolContext___paths_t)CALL(variable[4],COLOR_mmloader___ToolContext___paths))(variable[4]) /*ToolContext::paths*/;
- ((array___AbstractArray___add_t)CALL(variable[4],COLOR_abstract_collection___SimpleCollection___add))(variable[4], variable[3] /*libname*/) /*AbstractArray::add*/;
+static const char LOCATE_mmloader___ToolContext___process_options[] = "mmloader::ToolContext::(toolcontext::ToolContext::process_options)";
+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 tmp;
+ static val_t once_value_1; /* Once value */
+ static val_t once_value_2; /* Once value */
+ static val_t once_value_3; /* Once value */
+ static val_t once_value_4; /* Once value */
+ static val_t once_value_5; /* Once value */
+ static val_t once_value_6; /* Once value */
+ fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
+ fra.me.file = LOCATE_mmloader;
+ fra.me.line = 50;
+ fra.me.meth = LOCATE_mmloader___ToolContext___process_options;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 4;
+ fra.me.nitni_local_ref_head = NULL;
+ 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:50 */
+ fra.me.REG[1] = fra.me.REG[0];
+ /* mmloader.nit:53 */
+ CALL_SUPER_mmloader___ToolContext___process_options(fra.me.REG[0])(fra.me.REG[0]);
+ /* mmloader.nit:56 */
+ fra.me.REG[0] = CALL_mmloader___ToolContext___paths(fra.me.REG[1])(fra.me.REG[1]);
+ fra.me.REG[2] = CALL_mmloader___ToolContext___opt_path(fra.me.REG[1])(fra.me.REG[1]);
+ fra.me.REG[2] = CALL_opts___Option___value(fra.me.REG[2])(fra.me.REG[2]);
+ CALL_standard___collection___abstract_collection___Sequence___append(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]);
+ /* mmloader.nit:58 */
+ if (!once_value_1) {
+ fra.me.REG[2] = BOX_NativeString("NIT_PATH");
+ REGB0 = TAG_Int(8);
+ fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB0);
+ once_value_1 = fra.me.REG[2];
+ register_static_object(&once_value_1);
+ } else fra.me.REG[2] = once_value_1;
+ fra.me.REG[2] = fra.me.REG[2];
+ fra.me.REG[2] = CALL_standard___environ___String___environ(fra.me.REG[2])(fra.me.REG[2]);
+ /* mmloader.nit:59 */
+ REGB0 = CALL_standard___collection___abstract_collection___Collection___is_empty(fra.me.REG[2])(fra.me.REG[2]);
+ REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
+ if (UNTAG_Bool(REGB0)) {
+ /* mmloader.nit:60 */
+ fra.me.REG[0] = CALL_mmloader___ToolContext___paths(fra.me.REG[1])(fra.me.REG[1]);
+ REGB0 = TAG_Char(':');
+ fra.me.REG[3] = CALL_standard___string_search___String___split_with(fra.me.REG[2])(fra.me.REG[2], REGB0);
+ CALL_standard___collection___abstract_collection___Sequence___append(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]);
+ }
+ /* mmloader.nit:63 */
+ if (!once_value_2) {
+ fra.me.REG[3] = BOX_NativeString("NIT_DIR");
+ REGB0 = TAG_Int(7);
+ fra.me.REG[3] = NEW_String_standard___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];
+ fra.me.REG[3] = CALL_standard___environ___String___environ(fra.me.REG[3])(fra.me.REG[3]);
+ fra.me.REG[2] = fra.me.REG[3];
+ /* mmloader.nit:64 */
+ REGB0 = CALL_standard___collection___abstract_collection___Collection___is_empty(fra.me.REG[2])(fra.me.REG[2]);
+ REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
+ if (UNTAG_Bool(REGB0)) {
+ /* mmloader.nit:65 */
+ REGB0 = TAG_Int(3);
+ fra.me.REG[3] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
+ if (!once_value_3) {
+ fra.me.REG[0] = BOX_NativeString("");
+ REGB0 = TAG_Int(0);
+ fra.me.REG[0] = NEW_String_standard___string___String___with_native(fra.me.REG[0], REGB0);
+ once_value_3 = fra.me.REG[0];
+ register_static_object(&once_value_3);
+ } else fra.me.REG[0] = once_value_3;
+ fra.me.REG[0] = fra.me.REG[0];
+ CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[0]);
+ CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
+ if (!once_value_4) {
+ fra.me.REG[2] = BOX_NativeString("/lib");
+ REGB0 = TAG_Int(4);
+ fra.me.REG[2] = NEW_String_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
+ fra.me.REG[3] = CALL_standard___string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]);
+ /* mmloader.nit:66 */
+ REGB0 = CALL_standard___file___String___file_exists(fra.me.REG[3])(fra.me.REG[3]);
+ if (UNTAG_Bool(REGB0)) {
+ fra.me.REG[2] = CALL_mmloader___ToolContext___paths(fra.me.REG[1])(fra.me.REG[1]);
+ CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
}
}
- variable[4] = NEW_String_string___String___init(); /*new String*/
- variable[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[6] = variable[5];
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[6]) /*String::append*/;
- variable[7] = variable[0];
- variable[7] = (G_sys);
- variable[7] = ((string___Sys___program_name_t)CALL(variable[7],COLOR_string___Sys___program_name))(variable[7]) /*Sys::program_name*/;
- variable[7] = ((file___String___dirname_t)CALL(variable[7],COLOR_file___String___dirname))(variable[7]) /*String::dirname*/;
- variable[8] = variable[7];
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[8]) /*String::append*/;
- variable[9] = NEW_String_string___String___with_native(BOX_NativeString("/../lib"), TAG_Int(7)); /*new String*/
- variable[10] = variable[9];
- ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[10]) /*String::append*/;
- variable[3] = variable[4];
- variable[4] = ((file___String___file_exists_t)CALL( variable[3] /*libname*/,COLOR_file___String___file_exists))( variable[3] /*libname*/) /*String::file_exists*/;
- if (UNTAG_Bool(variable[4])) { /*if*/
- variable[4] = variable[0];
- variable[4] = ((mmloader___ToolContext___paths_t)CALL(variable[4],COLOR_mmloader___ToolContext___paths))(variable[4]) /*ToolContext::paths*/;
- ((array___AbstractArray___add_t)CALL(variable[4],COLOR_abstract_collection___SimpleCollection___add))(variable[4], variable[3] /*libname*/) /*AbstractArray::add*/;
- }
- return_label3: while(false);
- tracehead = trace.prev;
+ /* mmloader.nit:69 */
+ REGB0 = TAG_Int(3);
+ fra.me.REG[3] = NEW_Array_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
+ fra.me.REG[2] = CALL_standard___kernel___Object___sys(fra.me.REG[1])(fra.me.REG[1]);
+ fra.me.REG[2] = CALL_standard___string___Sys___program_name(fra.me.REG[2])(fra.me.REG[2]);
+ fra.me.REG[2] = CALL_standard___file___String___dirname(fra.me.REG[2])(fra.me.REG[2]);
+ CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
+ if (!once_value_6) {
+ fra.me.REG[2] = BOX_NativeString("/../lib");
+ REGB0 = TAG_Int(7);
+ fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB0);
+ once_value_6 = fra.me.REG[2];
+ register_static_object(&once_value_6);
+ } else fra.me.REG[2] = once_value_6;
+ fra.me.REG[2] = fra.me.REG[2];
+ CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
+ fra.me.REG[3] = CALL_standard___string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]);
+ /* mmloader.nit:70 */
+ REGB0 = CALL_standard___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[1])(fra.me.REG[1]);
+ fra.me.REG[3] = CALL_standard___file___String___simplify_path(fra.me.REG[3])(fra.me.REG[3]);
+ CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]);
+ }
+ 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 variable[16];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[2] = param1;
- variable[4] = ((abstractmetamodel___MMDirectory___modules_t)CALL( variable[2] /*dir*/,COLOR_abstractmetamodel___MMDirectory___modules))( variable[2] /*dir*/) /*MMDirectory::modules*/;
- variable[4] = ((abstract_collection___Map___iterator_t)CALL(variable[4],COLOR_abstract_collection___Collection___iterator))(variable[4]) /*Map::iterator*/;
- while (true) { /*for*/
- variable[5] = ((abstract_collection___Iterator___is_ok_t)CALL(variable[4],COLOR_abstract_collection___Iterator___is_ok))(variable[4]) /*Iterator::is_ok*/;
- if (!UNTAG_Bool(variable[5])) break; /*for*/
- variable[5] = ((abstract_collection___Iterator___item_t)CALL(variable[4],COLOR_abstract_collection___Iterator___item))(variable[4]) /*Iterator::item*/;
- variable[6] = variable[5];
- variable[7] = ((abstractmetamodel___MMModule___name_t)CALL( variable[6] /*m*/,COLOR_abstractmetamodel___MMModule___name))( variable[6] /*m*/) /*MMModule::name*/;
- variable[7] = TAG_Bool((variable[7] == variable[1] /*module_name*/) || ((variable[7] != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL(variable[7],COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[7], variable[1] /*module_name*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL(variable[7],COLOR_kernel___Object_____eqeq))(variable[7], variable[1] /*module_name*/) /*Object::==*/)))));
- if (UNTAG_Bool(variable[7])) { /*if*/
- variable[3] = variable[6] /*m*/;
- goto return_label6;
+static const char LOCATE_mmloader___ToolContext___try_to_load[] = "mmloader::ToolContext::try_to_load";
+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 = 73;
+ fra.me.meth = LOCATE_mmloader___ToolContext___try_to_load;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 10;
+ fra.me.nitni_local_ref_head = NULL;
+ 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:79 */
+ fra.me.REG[3] = CALL_metamodel___abstractmetamodel___MMDirectory___modules(fra.me.REG[2])(fra.me.REG[2]);
+ fra.me.REG[3] = CALL_standard___collection___abstract_collection___MapRead___values(fra.me.REG[3])(fra.me.REG[3]);
+ CALL_standard___collection___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:85 */
+ 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, 85);
+ }
+ fra.me.REG[4] = ATTR_mmloader___ToolContext____loaders(fra.me.REG[0]);
+ /* ../lib/standard/collection/array.nit:269 */
+ REGB0 = TAG_Int(0);
+ /* ../lib/standard/collection/array.nit:270 */
+ REGB1 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[4])!=NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ } else {
+ nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 270);
+ }
+ REGB1 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[4]);
+ /* ../lib/standard/collection/array.nit:271 */
+ fra.me.REG[5] = ATTR_standard___collection___array___Array____items(fra.me.REG[4]);
+ /* ../lib/standard/collection/array.nit:272 */
+ while(1) {
+ /* ../lib/standard/collection/array.nit:24 */
+ REGB1 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[4])!=NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ } else {
+ nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
}
- continue_7: while(0);
- ((abstract_collection___Iterator___next_t)CALL(variable[4],COLOR_abstract_collection___Iterator___next))(variable[4]) /*Iterator::next*/;
- }
- break_7: while(0);
- variable[4] = variable[0];
- variable[4] = ATTR_mmloader___ToolContext____loaders(variable[4]) /*ToolContext::_loaders*/;
- variable[4] = ((array___AbstractArray___iterator_t)CALL(variable[4],COLOR_abstract_collection___Collection___iterator))(variable[4]) /*AbstractArray::iterator*/;
- while (true) { /*for*/
- variable[5] = ((array___ArrayIterator___is_ok_t)CALL(variable[4],COLOR_abstract_collection___Iterator___is_ok))(variable[4]) /*ArrayIterator::is_ok*/;
- if (!UNTAG_Bool(variable[5])) break; /*for*/
- variable[5] = ((array___ArrayIterator___item_t)CALL(variable[4],COLOR_abstract_collection___Iterator___item))(variable[4]) /*ArrayIterator::item*/;
- variable[6] = variable[5];
- variable[8] = ((mmloader___ModuleLoader___try_to_load_dir_t)CALL( variable[6] /*l*/,COLOR_mmloader___ModuleLoader___try_to_load_dir))( variable[6] /*l*/, variable[1] /*module_name*/, variable[2] /*dir*/) /*ModuleLoader::try_to_load_dir*/;
- variable[7] = variable[8];
- variable[8] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[7] /*dir2*/ == NIT_NULL /*null*/) || (( variable[7] /*dir2*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable[7] /*dir2*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[7] /*dir2*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable[7] /*dir2*/,COLOR_kernel___Object_____eqeq))( variable[7] /*dir2*/, NIT_NULL /*null*/) /*Object::==*/)))))));
- if (UNTAG_Bool(variable[8])) { /*if*/
- variable[9] = variable[0];
- variable[9] = ((mmloader___ToolContext___try_to_load_t)CALL(variable[9],COLOR_mmloader___ToolContext___try_to_load))(variable[9], variable[1] /*module_name*/, variable[7] /*dir2*/) /*ToolContext::try_to_load*/;
- variable[8] = variable[9];
- variable[9] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[8] /*m*/ == NIT_NULL /*null*/) || (( variable[8] /*m*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable[8] /*m*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[8] /*m*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable[8] /*m*/,COLOR_kernel___Object_____eqeq))( variable[8] /*m*/, NIT_NULL /*null*/) /*Object::==*/)))))));
- if (UNTAG_Bool(variable[9])) { /*if*/
- ((abstractmetamodel___MMDirectory___owner__eq_t)CALL( variable[7] /*dir2*/,COLOR_abstractmetamodel___MMDirectory___owner__eq))( variable[7] /*dir2*/, variable[8] /*m*/) /*MMDirectory::owner=*/;
- ((abstractmetamodel___MMDirectory___add_module_t)CALL( variable[2] /*dir*/,COLOR_abstractmetamodel___MMDirectory___add_module))( variable[2] /*dir*/, variable[8] /*m*/) /*MMDirectory::add_module*/;
- variable[3] = variable[8] /*m*/;
- goto return_label6;
- }
+ REGB1 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[4]);
+ REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
+ if (UNTAG_Bool(REGB2)) {
+ } else {
+ nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
}
- variable[8] = ((mmloader___ModuleLoader___can_handle_t)CALL( variable[6] /*l*/,COLOR_mmloader___ModuleLoader___can_handle))( variable[6] /*l*/, variable[1] /*module_name*/, variable[2] /*dir*/) /*ModuleLoader::can_handle*/;
- if (UNTAG_Bool(variable[8])) { /*if*/
- variable[9] = ((abstractmetamodel___MMDirectory___full_name_for_t)CALL( variable[2] /*dir*/,COLOR_abstractmetamodel___MMDirectory___full_name_for))( variable[2] /*dir*/, variable[1] /*module_name*/) /*MMDirectory::full_name_for*/;
- variable[8] = variable[9];
- variable[9] = variable[0];
- variable[9] = ATTR_mmloader___ToolContext____processing_modules(variable[9]) /*ToolContext::_processing_modules*/;
- variable[9] = ((hash___HashSet___has_t)CALL(variable[9],COLOR_abstract_collection___Collection___has))(variable[9], variable[8] /*full_name*/) /*HashSet::has*/;
- if (UNTAG_Bool(variable[9])) { /*if*/
- variable[9] = variable[0];
- variable[10] = NEW_String_string___String___init(); /*new String*/
- variable[11] = NEW_String_string___String___with_native(BOX_NativeString("Error: Dependency loop for module "), TAG_Int(34)); /*new String*/
- variable[12] = variable[11];
- ((string___String___append_t)CALL(variable[10],COLOR_abstract_collection___IndexedCollection___append))(variable[10], variable[12]) /*String::append*/;
- variable[13] = variable[8] /*full_name*/;
- variable[13] = ((string___String___to_s_t)CALL(variable[13],COLOR_string___Object___to_s))(variable[13]) /*String::to_s*/;
- ((string___String___append_t)CALL(variable[10],COLOR_abstract_collection___IndexedCollection___append))(variable[10], variable[13]) /*String::append*/;
- variable[14] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[15] = variable[14];
- ((string___String___append_t)CALL(variable[10],COLOR_abstract_collection___IndexedCollection___append))(variable[10], variable[15]) /*String::append*/;
- ((mmloader___ToolContext___error_t)CALL(variable[9],COLOR_mmloader___ToolContext___error))(variable[9], variable[10]) /*ToolContext::error*/;
- variable[9] = variable[0];
- 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);
+ /* ../lib/standard/kernel.nit:235 */
+ REGB1 = TAG_Bool(UNTAG_Int(REGB0)<UNTAG_Int(REGB1));
+ /* ../lib/standard/collection/array.nit:272 */
+ if (UNTAG_Bool(REGB1)) {
+ /* ../lib/standard/collection/array.nit:273 */
+ REGB1 = TAG_Bool(fra.me.REG[5]==NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 273);
+ }
+ /* ../lib/standard/collection/array.nit:718 */
+ fra.me.REG[6] = ((Nit_NativeArray)fra.me.REG[5])->val[UNTAG_Int(REGB0)];
+ /* mmloader.nit:86 */
+ 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:87 */
+ 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(0);
+ REGB1 = REGB2;
+ } else {
+ REGB2 = CALL_standard___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:88 */
+ 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:89 */
+ 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(0);
+ REGB1 = REGB2;
+ } else {
+ REGB2 = CALL_standard___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:90 */
+ REGB1 = TAG_Bool(fra.me.REG[7]==NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ nit_abort("Reciever is null", NULL, LOCATE_mmloader, 90);
+ }
+ CALL_metamodel___abstractmetamodel___MMDirectory___owner__eq(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[8]);
+ /* mmloader.nit:91 */
+ CALL_metamodel___abstractmetamodel___MMDirectory___add_module(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[8]);
+ /* mmloader.nit:92 */
+ fra.me.REG[3] = fra.me.REG[8];
+ goto label3;
+ }
+ }
+ /* mmloader.nit:96 */
+ 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:97 */
+ fra.me.REG[8] = CALL_metamodel___abstractmetamodel___MMDirectory___full_name_for(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
+ /* mmloader.nit:98 */
+ 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, 98);
+ }
+ fra.me.REG[7] = ATTR_mmloader___ToolContext____processing_modules(fra.me.REG[0]);
+ REGB1 = CALL_standard___collection___abstract_collection___Collection___has(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[8]);
+ if (UNTAG_Bool(REGB1)) {
+ /* mmloader.nit:100 */
+ REGB1 = TAG_Int(3);
+ fra.me.REG[7] = NEW_Array_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[9]);
+ fra.me.REG[9] = CALL_standard___string___Object___to_s(fra.me.REG[8])(fra.me.REG[8]);
+ CALL_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[9]);
+ fra.me.REG[7] = CALL_standard___string___Object___to_s(fra.me.REG[7])(fra.me.REG[7]);
+ CALL_toolcontext___ToolContext___fatal_error(fra.me.REG[0])(fra.me.REG[0], NIT_NULL, fra.me.REG[7]);
+ }
+ /* mmloader.nit:102 */
+ 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, 102);
+ }
+ fra.me.REG[7] = ATTR_mmloader___ToolContext____processing_modules(fra.me.REG[0]);
+ CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[8]);
+ /* mmloader.nit:103 */
+ 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:104 */
+ 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, 104);
+ }
+ fra.me.REG[7] = ATTR_mmloader___ToolContext____processing_modules(fra.me.REG[0]);
+ CALL_standard___collection___abstract_collection___RemovableCollection___remove(fra.me.REG[7])(fra.me.REG[7], fra.me.REG[8]);
+ /* mmloader.nit:106 */
+ CALL_metamodel___abstractmetamodel___MMDirectory___add_module(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[6]);
+ /* mmloader.nit:107 */
+ fra.me.REG[3] = fra.me.REG[6];
+ goto label3;
}
- variable[9] = variable[0];
- variable[9] = ATTR_mmloader___ToolContext____processing_modules(variable[9]) /*ToolContext::_processing_modules*/;
- ((hash___HashSet___add_t)CALL(variable[9],COLOR_abstract_collection___SimpleCollection___add))(variable[9], variable[8] /*full_name*/) /*HashSet::add*/;
- variable[10] = variable[0];
- variable[10] = ((mmloader___ModuleLoader___load_and_process_module_t)CALL( variable[6] /*l*/,COLOR_mmloader___ModuleLoader___load_and_process_module))( variable[6] /*l*/, variable[10], variable[1] /*module_name*/, variable[2] /*dir*/) /*ModuleLoader::load_and_process_module*/;
- variable[9] = variable[10];
- variable[10] = variable[0];
- variable[10] = ATTR_mmloader___ToolContext____processing_modules(variable[10]) /*ToolContext::_processing_modules*/;
- ((hash___HashSet___remove_t)CALL(variable[10],COLOR_abstract_collection___RemovableCollection___remove))(variable[10], variable[8] /*full_name*/) /*HashSet::remove*/;
- ((abstractmetamodel___MMDirectory___add_module_t)CALL( variable[2] /*dir*/,COLOR_abstractmetamodel___MMDirectory___add_module))( variable[2] /*dir*/, variable[9] /*m*/) /*MMDirectory::add_module*/;
- variable[3] = variable[9] /*m*/;
- goto return_label6;
+ /* ../lib/standard/collection/array.nit:274 */
+ REGB1 = TAG_Int(1);
+ /* ../lib/standard/kernel.nit:238 */
+ REGB1 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB1));
+ /* ../lib/standard/collection/array.nit:274 */
+ REGB0 = REGB1;
+ } else {
+ /* ../lib/standard/collection/array.nit:272 */
+ goto label6;
}
- continue_8: while(0);
- ((array___ArrayIterator___next_t)CALL(variable[4],COLOR_abstract_collection___Iterator___next))(variable[4]) /*ArrayIterator::next*/;
- }
- break_8: while(0);
- variable[3] = NIT_NULL /*null*/;
- goto return_label6;
- return_label6: while(false);
- tracehead = trace.prev;
- return variable[3];
+ }
+ label6: while(0);
+ /* mmloader.nit:110 */
+ fra.me.REG[3] = NIT_NULL;
+ goto label3;
+ label3: while(0);
+ stack_frame_head = fra.me.prev;
+ return fra.me.REG[3];
}
-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 variable[14];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[4] = ((file___String___dirname_t)CALL( variable[1] /*filename*/,COLOR_file___String___dirname))( variable[1] /*filename*/) /*String::dirname*/;
- variable[3] = variable[4];
- variable[5] = NEW_String_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/
- variable[5] = ((file___String___basename_t)CALL( variable[1] /*filename*/,COLOR_file___String___basename))( variable[1] /*filename*/, variable[5]) /*String::basename*/;
- variable[5] = ((symbol___String___to_symbol_t)CALL(variable[5],COLOR_symbol___String___to_symbol))(variable[5]) /*String::to_symbol*/;
- variable[4] = variable[5];
- variable[6] = variable[0];
- variable[6] = ((mmloader___ToolContext___directory_for_t)CALL(variable[6],COLOR_mmloader___ToolContext___directory_for))(variable[6], variable[3] /*path*/) /*ToolContext::directory_for*/;
- variable[5] = variable[6];
- variable[6] = ((symbol___Symbol___to_s_t)CALL( variable[4] /*module_name*/,COLOR_string___Object___to_s))( variable[4] /*module_name*/) /*Symbol::to_s*/;
- variable[6] = TAG_Bool((variable[6] == variable[1] /*filename*/) || ((variable[6] != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL(variable[6],COLOR_kernel___Object_____eqeq))(variable[6], variable[1] /*filename*/) /*String::==*/)));
- if (UNTAG_Bool(variable[6])) { /*if*/
- variable[7] = variable[0];
- variable[7] = ((mmloader___ToolContext___try_to_load_t)CALL(variable[7],COLOR_mmloader___ToolContext___try_to_load))(variable[7], variable[4] /*module_name*/, variable[5] /*dir*/) /*ToolContext::try_to_load*/;
- variable[6] = variable[7];
- variable[7] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[6] /*m*/ == NIT_NULL /*null*/) || (( variable[6] /*m*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable[6] /*m*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[6] /*m*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable[6] /*m*/,COLOR_kernel___Object_____eqeq))( variable[6] /*m*/, NIT_NULL /*null*/) /*Object::==*/)))))));
- if (UNTAG_Bool(variable[7])) { /*if*/
- variable[2] = variable[6] /*m*/;
- goto return_label9;
+ 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.nitni_local_ref_head = NULL;
+ 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:80 */
+ fra.me.REG[1] = CALL_metamodel___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_standard___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;
+ }
+static const char LOCATE_mmloader___ToolContext___get_module_from_filename[] = "mmloader::ToolContext::get_module_from_filename";
+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 = 117;
+ fra.me.meth = LOCATE_mmloader___ToolContext___get_module_from_filename;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 7;
+ fra.me.nitni_local_ref_head = NULL;
+ 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:122 */
+ fra.me.REG[2] = CALL_standard___file___String___dirname(fra.me.REG[1])(fra.me.REG[1]);
+ /* mmloader.nit:123 */
+ if (!once_value_1) {
+ fra.me.REG[3] = BOX_NativeString(".nit");
+ REGB0 = TAG_Int(4);
+ fra.me.REG[3] = NEW_String_standard___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_standard___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:125 */
+ fra.me.REG[2] = CALL_mmloader___ToolContext___directory_for(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]);
+ /* mmloader.nit:127 */
+ fra.me.REG[4] = CALL_standard___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_standard___kernel___Object_____eqeq(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[1]);
+ REGB0 = REGB1;
+ }
+ if (UNTAG_Bool(REGB0)) {
+ /* mmloader.nit:130 */
+ 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:131 */
+ 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(0);
+ REGB0 = REGB1;
+ } else {
+ REGB1 = CALL_standard___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;
}
- variable[7] = variable[0];
- variable[7] = ((mmloader___ToolContext___get_module_t)CALL(variable[7],COLOR_mmloader___ToolContext___get_module))(variable[7], variable[4] /*module_name*/, NIT_NULL /*null*/) /*ToolContext::get_module*/;
- variable[2] = variable[7];
- goto return_label9;
- }
- variable[6] = ((file___String___file_exists_t)CALL( variable[1] /*filename*/,COLOR_file___String___file_exists))( variable[1] /*filename*/) /*String::file_exists*/;
- if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[6])))) { /*if*/
- variable[6] = variable[0];
- variable[7] = NEW_String_string___String___init(); /*new String*/
- variable[8] = NEW_String_string___String___with_native(BOX_NativeString("Error: File "), TAG_Int(12)); /*new String*/
- variable[9] = variable[8];
- ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[9]) /*String::append*/;
- variable[10] = variable[1] /*filename*/;
- ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[10]) /*String::append*/;
- variable[11] = NEW_String_string___String___with_native(BOX_NativeString(" not found."), TAG_Int(11)); /*new String*/
- variable[12] = variable[11];
- ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[12]) /*String::append*/;
- ((mmloader___ToolContext___error_t)CALL(variable[6],COLOR_mmloader___ToolContext___error))(variable[6], variable[7]) /*ToolContext::error*/;
- variable[6] = variable[0];
- 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);
- }
- variable[7] = variable[0];
- variable[7] = ((mmloader___ToolContext___try_to_load_t)CALL(variable[7],COLOR_mmloader___ToolContext___try_to_load))(variable[7], variable[4] /*module_name*/, variable[5] /*dir*/) /*ToolContext::try_to_load*/;
- variable[6] = variable[7];
- variable[7] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[6] /*m*/ == NIT_NULL /*null*/) || (( variable[6] /*m*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable[6] /*m*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[6] /*m*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable[6] /*m*/,COLOR_kernel___Object_____eqeq))( variable[6] /*m*/, NIT_NULL /*null*/) /*Object::==*/)))))));
- if (UNTAG_Bool(variable[7])) { /*if*/
- variable[2] = variable[6] /*m*/;
- goto return_label9;
- }
- variable[7] = variable[0];
- variable[8] = NEW_String_string___String___init(); /*new String*/
- variable[9] = NEW_String_string___String___with_native(BOX_NativeString("Error: "), TAG_Int(7)); /*new String*/
- variable[10] = variable[9];
- ((string___String___append_t)CALL(variable[8],COLOR_abstract_collection___IndexedCollection___append))(variable[8], variable[10]) /*String::append*/;
- variable[11] = variable[1] /*filename*/;
- ((string___String___append_t)CALL(variable[8],COLOR_abstract_collection___IndexedCollection___append))(variable[8], variable[11]) /*String::append*/;
- variable[12] = NEW_String_string___String___with_native(BOX_NativeString(" is not a NIT source module."), TAG_Int(28)); /*new String*/
- variable[13] = variable[12];
- ((string___String___append_t)CALL(variable[8],COLOR_abstract_collection___IndexedCollection___append))(variable[8], variable[13]) /*String::append*/;
- ((mmloader___ToolContext___error_t)CALL(variable[7],COLOR_mmloader___ToolContext___error))(variable[7], variable[8]) /*ToolContext::error*/;
- variable[7] = variable[0];
- 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 variable[2];
+ /* mmloader.nit:134 */
+ 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:137 */
+ REGB0 = CALL_standard___file___String___file_exists(fra.me.REG[1])(fra.me.REG[1]);
+ REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
+ if (UNTAG_Bool(REGB0)) {
+ /* mmloader.nit:138 */
+ REGB0 = TAG_Int(3);
+ fra.me.REG[5] = NEW_Array_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
+ CALL_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
+ fra.me.REG[5] = CALL_standard___string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]);
+ CALL_toolcontext___ToolContext___fatal_error(fra.me.REG[0])(fra.me.REG[0], NIT_NULL, fra.me.REG[5]);
+ /* mmloader.nit:139 */
+ nit_abort("Aborted", NULL, LOCATE_mmloader, 139);
+ }
+ /* mmloader.nit:143 */
+ 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:144 */
+ 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(0);
+ REGB0 = REGB1;
+ } else {
+ REGB1 = CALL_standard___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:146 */
+ REGB0 = TAG_Int(3);
+ fra.me.REG[2] = NEW_Array_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
+ CALL_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
+ fra.me.REG[2] = CALL_standard___string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]);
+ CALL_toolcontext___ToolContext___fatal_error(fra.me.REG[0])(fra.me.REG[0], NIT_NULL, fra.me.REG[2]);
+ /* mmloader.nit:147 */
+ nit_abort("Aborted", NULL, LOCATE_mmloader, 147);
+ label2: while(0);
+ stack_frame_head = fra.me.prev;
+ return fra.me.REG[4];
}
-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 variable[12];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[2] = param1;
- /*variable[4] is variable m*/
- variable[5] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[2] /*from*/ == NIT_NULL /*null*/) || (( variable[2] /*from*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable[2] /*from*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[2] /*from*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable[2] /*from*/,COLOR_kernel___Object_____eqeq))( variable[2] /*from*/, NIT_NULL /*null*/) /*Object::==*/)))))));
- if (UNTAG_Bool(variable[5])) { /*if*/
- variable[6] = ((abstractmetamodel___MMModule___directory_t)CALL( variable[2] /*from*/,COLOR_abstractmetamodel___MMModule___directory))( variable[2] /*from*/) /*MMModule::directory*/;
- variable[5] = variable[6];
- while (true) { /*while*/
- variable[6] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[5] /*dir*/ == NIT_NULL /*null*/) || (( variable[5] /*dir*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable[5] /*dir*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[5] /*dir*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable[5] /*dir*/,COLOR_kernel___Object_____eqeq))( variable[5] /*dir*/, NIT_NULL /*null*/) /*Object::==*/)))))));
- if (!UNTAG_Bool(variable[6])) break; /* while*/
- variable[7] = variable[0];
- variable[7] = ((mmloader___ToolContext___try_to_load_t)CALL(variable[7],COLOR_mmloader___ToolContext___try_to_load))(variable[7], variable[1] /*module_name*/, variable[5] /*dir*/) /*ToolContext::try_to_load*/;
- variable[6] = variable[7];
- variable[7] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[6] /*m*/ == NIT_NULL /*null*/) || (( variable[6] /*m*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable[6] /*m*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[6] /*m*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable[6] /*m*/,COLOR_kernel___Object_____eqeq))( variable[6] /*m*/, NIT_NULL /*null*/) /*Object::==*/)))))));
- if (UNTAG_Bool(variable[7])) { /*if*/
- variable[3] = variable[6] /*m*/;
- goto return_label10;
+static const char LOCATE_mmloader___ToolContext___get_module[] = "mmloader::ToolContext::get_module";
+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 = 150;
+ fra.me.meth = LOCATE_mmloader___ToolContext___get_module;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 6;
+ fra.me.nitni_local_ref_head = NULL;
+ 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:154 */
+ 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(0);
+ REGB0 = REGB1;
+ } else {
+ REGB1 = CALL_standard___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:155 */
+ REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
+ if (UNTAG_Bool(REGB0)) {
+ nit_abort("Reciever is null", NULL, LOCATE_mmloader, 155);
+ }
+ fra.me.REG[2] = CALL_metamodel___abstractmetamodel___MMModule___directory(fra.me.REG[2])(fra.me.REG[2]);
+ /* mmloader.nit:156 */
+ 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(0);
+ REGB0 = REGB1;
+ } else {
+ REGB1 = CALL_standard___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:157 */
+ 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:158 */
+ 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(0);
+ REGB0 = REGB1;
+ } else {
+ REGB1 = CALL_standard___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:159 */
+ REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
+ if (UNTAG_Bool(REGB0)) {
+ nit_abort("Reciever is null", NULL, LOCATE_mmloader, 159);
+ }
+ fra.me.REG[4] = CALL_metamodel___abstractmetamodel___MMDirectory___parent(fra.me.REG[2])(fra.me.REG[2]);
+ fra.me.REG[2] = fra.me.REG[4];
+ } else {
+ /* mmloader.nit:156 */
+ goto label2;
}
- variable[7] = ((abstractmetamodel___MMDirectory___parent_t)CALL( variable[5] /*dir*/,COLOR_abstractmetamodel___MMDirectory___parent))( variable[5] /*dir*/) /*MMDirectory::parent*/;
- variable[5] = variable[7] /*dir=*/;
- continue_11: while(0);
}
- break_11: while(0);
- }
- variable[5] = variable[0];
- variable[5] = ((mmloader___ToolContext___paths_t)CALL(variable[5],COLOR_mmloader___ToolContext___paths))(variable[5]) /*ToolContext::paths*/;
- variable[5] = ((array___AbstractArray___iterator_t)CALL(variable[5],COLOR_abstract_collection___Collection___iterator))(variable[5]) /*AbstractArray::iterator*/;
- while (true) { /*for*/
- variable[6] = ((array___ArrayIterator___is_ok_t)CALL(variable[5],COLOR_abstract_collection___Iterator___is_ok))(variable[5]) /*ArrayIterator::is_ok*/;
- if (!UNTAG_Bool(variable[6])) break; /*for*/
- variable[6] = ((array___ArrayIterator___item_t)CALL(variable[5],COLOR_abstract_collection___Iterator___item))(variable[5]) /*ArrayIterator::item*/;
- variable[7] = variable[6];
- variable[9] = variable[0];
- variable[10] = variable[0];
- variable[10] = ((mmloader___ToolContext___directory_for_t)CALL(variable[10],COLOR_mmloader___ToolContext___directory_for))(variable[10], variable[7] /*p*/) /*ToolContext::directory_for*/;
- variable[9] = ((mmloader___ToolContext___try_to_load_t)CALL(variable[9],COLOR_mmloader___ToolContext___try_to_load))(variable[9], variable[1] /*module_name*/, variable[10]) /*ToolContext::try_to_load*/;
- variable[8] = variable[9];
- variable[9] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[8] /*m*/ == NIT_NULL /*null*/) || (( variable[8] /*m*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable[8] /*m*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[8] /*m*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable[8] /*m*/,COLOR_kernel___Object_____eqeq))( variable[8] /*m*/, NIT_NULL /*null*/) /*Object::==*/)))))));
- if (UNTAG_Bool(variable[9])) { /*if*/
- variable[3] = variable[8] /*m*/;
- goto return_label10;
+ label2: while(0);
+ }
+ /* mmloader.nit:163 */
+ fra.me.REG[2] = CALL_mmloader___ToolContext___paths(fra.me.REG[0])(fra.me.REG[0]);
+ /* ../lib/standard/collection/array.nit:269 */
+ REGB0 = TAG_Int(0);
+ /* ../lib/standard/collection/array.nit:270 */
+ REGB1 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ } else {
+ nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 270);
+ }
+ REGB1 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2]);
+ /* ../lib/standard/collection/array.nit:271 */
+ fra.me.REG[4] = ATTR_standard___collection___array___Array____items(fra.me.REG[2]);
+ /* ../lib/standard/collection/array.nit:272 */
+ while(1) {
+ /* ../lib/standard/collection/array.nit:24 */
+ REGB1 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ } else {
+ nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
+ }
+ REGB1 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2]);
+ REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
+ if (UNTAG_Bool(REGB2)) {
+ } else {
+ nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
+ }
+ /* ../lib/standard/kernel.nit:235 */
+ REGB1 = TAG_Bool(UNTAG_Int(REGB0)<UNTAG_Int(REGB1));
+ /* ../lib/standard/collection/array.nit:272 */
+ if (UNTAG_Bool(REGB1)) {
+ /* ../lib/standard/collection/array.nit:273 */
+ REGB1 = TAG_Bool(fra.me.REG[4]==NIT_NULL);
+ if (UNTAG_Bool(REGB1)) {
+ nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 273);
+ }
+ /* ../lib/standard/collection/array.nit:718 */
+ fra.me.REG[5] = ((Nit_NativeArray)fra.me.REG[4])->val[UNTAG_Int(REGB0)];
+ /* mmloader.nit:164 */
+ 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:165 */
+ 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(0);
+ REGB1 = REGB2;
+ } else {
+ REGB2 = CALL_standard___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;
+ }
+ /* ../lib/standard/collection/array.nit:274 */
+ REGB1 = TAG_Int(1);
+ /* ../lib/standard/kernel.nit:238 */
+ REGB1 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB1));
+ /* ../lib/standard/collection/array.nit:274 */
+ REGB0 = REGB1;
+ } else {
+ /* ../lib/standard/collection/array.nit:272 */
+ goto label3;
}
- continue_12: while(0);
- ((array___ArrayIterator___next_t)CALL(variable[5],COLOR_abstract_collection___Iterator___next))(variable[5]) /*ArrayIterator::next*/;
- }
- break_12: while(0);
- variable[5] = variable[0];
- variable[6] = NEW_String_string___String___init(); /*new String*/
- variable[7] = NEW_String_string___String___with_native(BOX_NativeString("Error: No ressource found for module "), TAG_Int(37)); /*new String*/
- variable[8] = variable[7];
- ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[8]) /*String::append*/;
- variable[9] = variable[1] /*module_name*/;
- variable[9] = ((string___String___to_s_t)CALL(variable[9],COLOR_string___Object___to_s))(variable[9]) /*String::to_s*/;
- ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[9]) /*String::append*/;
- variable[10] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
- variable[11] = variable[10];
- ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[11]) /*String::append*/;
- ((mmloader___ToolContext___error_t)CALL(variable[5],COLOR_mmloader___ToolContext___error))(variable[5], variable[6]) /*ToolContext::error*/;
- variable[5] = variable[0];
- 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 variable[3];
+ }
+ label3: while(0);
+ /* mmloader.nit:168 */
+ REGB0 = TAG_Int(3);
+ fra.me.REG[4] = NEW_Array_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[2]);
+ fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
+ CALL_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[1]);
+ fra.me.REG[4] = CALL_standard___string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]);
+ CALL_toolcontext___ToolContext___fatal_error(fra.me.REG[0])(fra.me.REG[0], NIT_NULL, fra.me.REG[4]);
+ /* mmloader.nit:169 */
+ nit_abort("Aborted", NULL, LOCATE_mmloader, 169);
+ label1: while(0);
+ stack_frame_head = fra.me.prev;
+ return fra.me.REG[3];
}
-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 variable[6];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[3] = variable[0];
- variable[3] = ATTR_mmloader___ToolContext____path_dirs(variable[3]) /*ToolContext::_path_dirs*/;
- variable[3] = ((abstract_collection___Map___has_key_t)CALL(variable[3],COLOR_abstract_collection___Map___has_key))(variable[3], variable[1] /*path*/) /*Map::has_key*/;
- if (UNTAG_Bool(variable[3])) { /*if*/
- variable[3] = variable[0];
- variable[3] = ATTR_mmloader___ToolContext____path_dirs(variable[3]) /*ToolContext::_path_dirs*/;
- variable[3] = ((abstract_collection___Map_____bra_t)CALL(variable[3],COLOR_abstract_collection___Map_____bra))(variable[3], variable[1] /*path*/) /*Map::[]*/;
- variable[2] = variable[3];
- goto return_label13;
- }
- variable[4] = ((symbol___String___to_symbol_t)CALL( variable[1] /*path*/,COLOR_symbol___String___to_symbol))( variable[1] /*path*/) /*String::to_symbol*/;
- variable[5] = NEW_MMDirectory_abstractmetamodel___MMDirectory___init(variable[4], variable[1] /*path*/, NIT_NULL /*null*/); /*new MMDirectory*/
- variable[4] = variable[5];
- variable[3] = variable[4];
- variable[4] = variable[0];
- variable[4] = ATTR_mmloader___ToolContext____path_dirs(variable[4]) /*ToolContext::_path_dirs*/;
- ((abstract_collection___Map_____braeq_t)CALL(variable[4],COLOR_abstract_collection___Map_____braeq))(variable[4], variable[1] /*path*/, variable[3] /*dir*/) /*Map::[]=*/;
- variable[2] = variable[3] /*dir*/;
- goto return_label13;
- return_label13: while(false);
- tracehead = trace.prev;
- return variable[2];
+static const char LOCATE_mmloader___ToolContext___directory_for[] = "mmloader::ToolContext::directory_for";
+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 = 172;
+ fra.me.meth = LOCATE_mmloader___ToolContext___directory_for;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 4;
+ fra.me.nitni_local_ref_head = NULL;
+ 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:175 */
+ 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, 175);
+ }
+ fra.me.REG[2] = ATTR_mmloader___ToolContext____path_dirs(fra.me.REG[0]);
+ REGB0 = CALL_standard___collection___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, 175);
+ }
+ fra.me.REG[2] = ATTR_mmloader___ToolContext____path_dirs(fra.me.REG[0]);
+ fra.me.REG[2] = CALL_standard___collection___abstract_collection___MapRead_____bra(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
+ goto label1;
+ }
+ /* mmloader.nit:176 */
+ fra.me.REG[3] = CALL_symbol___String___to_symbol(fra.me.REG[1])(fra.me.REG[1]);
+ fra.me.REG[3] = NEW_MMDirectory_metamodel___abstractmetamodel___MMDirectory___init(fra.me.REG[3], fra.me.REG[1], NIT_NULL);
+ /* mmloader.nit:177 */
+ 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, 177);
+ }
+ fra.me.REG[0] = ATTR_mmloader___ToolContext____path_dirs(fra.me.REG[0]);
+ CALL_standard___collection___abstract_collection___Map_____braeq(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[3]);
+ /* mmloader.nit:178 */
+ 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 self, val_t param0) {
- struct trace_t trace = {NULL, NULL, 223, LOCATE_mmloader___ToolContext___register_loader};
- val_t variable[4];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[3] = variable[0];
- variable[3] = ATTR_mmloader___ToolContext____loaders(variable[3]) /*ToolContext::_loaders*/;
- ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[1] /*ml*/) /*AbstractArray::add*/;
- return_label14: while(false);
- tracehead = trace.prev;
+static const char LOCATE_mmloader___ToolContext___register_loader[] = "mmloader::ToolContext::register_loader";
+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 = 184;
+ fra.me.meth = LOCATE_mmloader___ToolContext___register_loader;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 2;
+ fra.me.nitni_local_ref_head = NULL;
+ fra.me.REG[0] = NIT_NULL;
+ fra.me.REG[1] = NIT_NULL;
+ fra.me.REG[0] = p0;
+ fra.me.REG[1] = p1;
+ /* mmloader.nit:185 */
+ 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, 185);
+ }
+ fra.me.REG[0] = ATTR_mmloader___ToolContext____loaders(fra.me.REG[0]);
+ CALL_standard___collection___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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- fprintf(stderr, "Deferred method called");
- fprintf(stderr, " (%s:%d)\n", LOCATE_mmloader, 232);
- nit_exit(1);
- tracehead = trace.prev;
+static const char LOCATE_mmloader___ModuleLoader___file_type[] = "mmloader::ModuleLoader::file_type";
+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 = 193;
+ fra.me.meth = LOCATE_mmloader___ModuleLoader___file_type;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 0;
+ fra.me.nitni_local_ref_head = NULL;
+ /* mmloader.nit:193 */
+ nit_abort("Deferred method called", NULL, LOCATE_mmloader, 193);
+ 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 variable[15];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[2] = param1;
- variable[5] = NEW_String_string___String___init(); /*new String*/
- variable[6] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[7] = variable[6];
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[7]) /*String::append*/;
- variable[8] = ((abstractmetamodel___MMDirectory___path_t)CALL( variable[2] /*parent_dir*/,COLOR_abstractmetamodel___MMDirectory___path))( variable[2] /*parent_dir*/) /*MMDirectory::path*/;
- variable[9] = variable[8];
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[9]) /*String::append*/;
- variable[10] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
- variable[11] = variable[10];
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[11]) /*String::append*/;
- variable[12] = variable[1] /*dirname*/;
- variable[12] = ((string___String___to_s_t)CALL(variable[12],COLOR_string___Object___to_s))(variable[12]) /*String::to_s*/;
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[12]) /*String::append*/;
- variable[13] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
- variable[14] = variable[13];
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[14]) /*String::append*/;
- variable[4] = variable[5];
- variable[5] = ((file___String___file_exists_t)CALL( variable[4] /*fname*/,COLOR_file___String___file_exists))( variable[4] /*fname*/) /*String::file_exists*/;
- if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[5])))) { /*if*/
- variable[3] = NIT_NULL /*null*/;
- goto return_label15;
- }
- variable[6] = ((abstractmetamodel___MMDirectory___full_name_for_t)CALL( variable[2] /*parent_dir*/,COLOR_abstractmetamodel___MMDirectory___full_name_for))( variable[2] /*parent_dir*/, variable[1] /*dirname*/) /*MMDirectory::full_name_for*/;
- variable[7] = NEW_MMDirectory_abstractmetamodel___MMDirectory___init(variable[6], variable[4] /*fname*/, variable[2] /*parent_dir*/); /*new MMDirectory*/
- variable[6] = variable[7];
- variable[5] = variable[6];
- variable[3] = variable[5] /*dir*/;
- goto return_label15;
- return_label15: while(false);
- tracehead = trace.prev;
- return variable[3];
+static const char LOCATE_mmloader___ModuleLoader___try_to_load_dir[] = "mmloader::ModuleLoader::try_to_load_dir";
+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 = 196;
+ fra.me.meth = LOCATE_mmloader___ModuleLoader___try_to_load_dir;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 4;
+ fra.me.nitni_local_ref_head = NULL;
+ 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:199 */
+ REGB0 = TAG_Int(5);
+ fra.me.REG[0] = NEW_Array_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]);
+ fra.me.REG[3] = CALL_metamodel___abstractmetamodel___MMDirectory___path(fra.me.REG[2])(fra.me.REG[2]);
+ CALL_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]);
+ fra.me.REG[3] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
+ CALL_standard___collection___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(0);
+ fra.me.REG[3] = NEW_String_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3]);
+ fra.me.REG[0] = CALL_standard___string___Object___to_s(fra.me.REG[0])(fra.me.REG[0]);
+ /* mmloader.nit:200 */
+ REGB0 = CALL_standard___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:202 */
+ fra.me.REG[1] = CALL_metamodel___abstractmetamodel___MMDirectory___full_name_for(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
+ fra.me.REG[2] = NEW_MMDirectory_metamodel___abstractmetamodel___MMDirectory___init(fra.me.REG[1], fra.me.REG[0], fra.me.REG[2]);
+ /* mmloader.nit:203 */
+ fra.me.REG[3] = fra.me.REG[2];
+ goto label4;
+ label4: while(0);
+ stack_frame_head = fra.me.prev;
+ return fra.me.REG[3];
}
-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 variable[19];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[2] = param1;
- variable[5] = NEW_String_string___String___init(); /*new String*/
- variable[6] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[7] = variable[6];
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[7]) /*String::append*/;
- variable[8] = ((abstractmetamodel___MMDirectory___path_t)CALL( variable[2] /*dir*/,COLOR_abstractmetamodel___MMDirectory___path))( variable[2] /*dir*/) /*MMDirectory::path*/;
- variable[9] = variable[8];
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[9]) /*String::append*/;
- variable[10] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
- variable[11] = variable[10];
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[11]) /*String::append*/;
- variable[12] = variable[1] /*module_name*/;
- variable[12] = ((string___String___to_s_t)CALL(variable[12],COLOR_string___Object___to_s))(variable[12]) /*String::to_s*/;
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[12]) /*String::append*/;
- variable[13] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
- variable[14] = variable[13];
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[14]) /*String::append*/;
- variable[15] = variable[0];
- variable[15] = ((mmloader___ModuleLoader___file_type_t)CALL(variable[15],COLOR_mmloader___ModuleLoader___file_type))(variable[15]) /*ModuleLoader::file_type*/;
- variable[16] = variable[15];
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[16]) /*String::append*/;
- variable[17] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[18] = variable[17];
- ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[18]) /*String::append*/;
- variable[4] = variable[5];
- variable[5] = ((file___String___file_exists_t)CALL( variable[4] /*fname*/,COLOR_file___String___file_exists))( variable[4] /*fname*/) /*String::file_exists*/;
- if (UNTAG_Bool(variable[5])) { /*if*/
- variable[3] = TAG_Bool(true);
- goto return_label16;
- }
- variable[3] = TAG_Bool(false);
- goto return_label16;
- return_label16: while(false);
- tracehead = trace.prev;
- return variable[3];
+static const char LOCATE_mmloader___ModuleLoader___can_handle[] = "mmloader::ModuleLoader::can_handle";
+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 = 206;
+ fra.me.meth = LOCATE_mmloader___ModuleLoader___can_handle;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 5;
+ fra.me.nitni_local_ref_head = NULL;
+ 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:210 */
+ REGB0 = TAG_Int(7);
+ fra.me.REG[3] = NEW_Array_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]);
+ fra.me.REG[2] = CALL_metamodel___abstractmetamodel___MMDirectory___path(fra.me.REG[2])(fra.me.REG[2]);
+ CALL_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
+ fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
+ CALL_standard___collection___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_standard___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_standard___collection___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_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[0]);
+ fra.me.REG[3] = CALL_standard___string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]);
+ /* mmloader.nit:211 */
+ REGB0 = CALL_standard___file___String___file_exists(fra.me.REG[3])(fra.me.REG[3]);
+ if (UNTAG_Bool(REGB0)) {
+ REGB0 = TAG_Bool(1);
+ goto label5;
+ }
+ /* mmloader.nit:212 */
+ REGB1 = TAG_Bool(0);
+ REGB0 = REGB1;
+ goto label5;
+ label5: while(0);
+ stack_frame_head = fra.me.prev;
+ return REGB0;
}
-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 variable[20];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[2] = param1;
- variable[3] = param2;
- variable[6] = NEW_String_string___String___init(); /*new String*/
- variable[7] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[8] = variable[7];
- ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[8]) /*String::append*/;
- variable[9] = ((abstractmetamodel___MMDirectory___path_t)CALL( variable[3] /*dir*/,COLOR_abstractmetamodel___MMDirectory___path))( variable[3] /*dir*/) /*MMDirectory::path*/;
- variable[10] = variable[9];
- ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[10]) /*String::append*/;
- variable[11] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
- variable[12] = variable[11];
- ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[12]) /*String::append*/;
- variable[13] = variable[2] /*module_name*/;
- variable[13] = ((string___String___to_s_t)CALL(variable[13],COLOR_string___Object___to_s))(variable[13]) /*String::to_s*/;
- ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[13]) /*String::append*/;
- variable[14] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
- variable[15] = variable[14];
- ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[15]) /*String::append*/;
- variable[16] = variable[0];
- variable[16] = ((mmloader___ModuleLoader___file_type_t)CALL(variable[16],COLOR_mmloader___ModuleLoader___file_type))(variable[16]) /*ModuleLoader::file_type*/;
- variable[17] = variable[16];
- ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[17]) /*String::append*/;
- variable[18] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[19] = variable[18];
- ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[19]) /*String::append*/;
- variable[5] = variable[6];
- variable[7] = variable[0];
- variable[7] = ((mmloader___ModuleLoader___load_module_t)CALL(variable[7],COLOR_mmloader___ModuleLoader___load_module))(variable[7], variable[1] /*context*/, variable[2] /*module_name*/, variable[3] /*dir*/, variable[5] /*filename*/) /*ModuleLoader::load_module*/;
- variable[6] = variable[7];
- variable[7] = ((mmloader___ToolContext___opt_only_parse_t)CALL( variable[1] /*context*/,COLOR_mmloader___ToolContext___opt_only_parse))( variable[1] /*context*/) /*ToolContext::opt_only_parse*/;
- variable[7] = ((opts___Option___value_t)CALL(variable[7],COLOR_opts___Option___value))(variable[7]) /*Option::value*/;
- if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[7])))) { /*if*/
- variable[7] = variable[0];
- ((mmloader___ModuleLoader___process_metamodel_t)CALL(variable[7],COLOR_mmloader___ModuleLoader___process_metamodel))(variable[7], variable[1] /*context*/, variable[6] /*m*/) /*ModuleLoader::process_metamodel*/;
- }
- variable[4] = variable[6] /*m*/;
- goto return_label17;
- return_label17: while(false);
- tracehead = trace.prev;
- return variable[4];
+static const char LOCATE_mmloader___ModuleLoader___load_and_process_module[] = "mmloader::ModuleLoader::load_and_process_module";
+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 = 215;
+ fra.me.meth = LOCATE_mmloader___ModuleLoader___load_and_process_module;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 6;
+ fra.me.nitni_local_ref_head = NULL;
+ 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:219 */
+ REGB0 = TAG_Int(7);
+ fra.me.REG[4] = NEW_Array_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]);
+ fra.me.REG[5] = CALL_metamodel___abstractmetamodel___MMDirectory___path(fra.me.REG[3])(fra.me.REG[3]);
+ CALL_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]);
+ fra.me.REG[5] = CALL_standard___string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]);
+ CALL_standard___collection___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_standard___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_standard___collection___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_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]);
+ fra.me.REG[4] = CALL_standard___string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]);
+ fra.me.REG[4] = CALL_standard___file___String___simplify_path(fra.me.REG[4])(fra.me.REG[4]);
+ /* mmloader.nit:220 */
+ 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:221 */
+ 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:222 */
+ goto label5;
+ label5: while(0);
+ stack_frame_head = fra.me.prev;
+ return fra.me.REG[4];
}
-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 variable[13];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[2] = param1;
- variable[3] = param2;
- variable[4] = param3;
- /*variable[6] is variable file*/
- variable[7] = NEW_String_string___String___with_native(BOX_NativeString("-"), TAG_Int(1)); /*new String*/
- variable[7] = TAG_Bool(( variable[4] /*filename*/ == variable[7]) || (( variable[4] /*filename*/ != NIT_NULL) && UNTAG_Bool(((string___String_____eqeq_t)CALL( variable[4] /*filename*/,COLOR_kernel___Object_____eqeq))( variable[4] /*filename*/, variable[7]) /*String::==*/)));
- if (UNTAG_Bool(variable[7])) { /*if*/
- variable[7] = variable[0];
- variable[7] = ((file___Object___stdin_t)CALL(variable[7],COLOR_file___Object___stdin))(variable[7]) /*Object::stdin*/;
- variable[6] = variable[7] /*file=*/;
- } else { /*if*/
- variable[7] = ((string___String___to_s_t)CALL( variable[4] /*filename*/,COLOR_string___Object___to_s))( variable[4] /*filename*/) /*String::to_s*/;
- variable[8] = NEW_IFStream_file___IFStream___open(variable[7]); /*new IFStream*/
- variable[7] = variable[8];
- variable[6] = variable[7] /*file=*/;
- }
- variable[7] = ((stream___BufferedIStream___eof_t)CALL( variable[6] /*file*/,COLOR_stream___IStream___eof))( variable[6] /*file*/) /*BufferedIStream::eof*/;
- if (UNTAG_Bool(variable[7])) { /*if*/
- variable[7] = NEW_String_string___String___init(); /*new String*/
- variable[8] = NEW_String_string___String___with_native(BOX_NativeString("Error: Problem in opening file "), TAG_Int(31)); /*new String*/
- variable[9] = variable[8];
- ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[9]) /*String::append*/;
- variable[10] = variable[4] /*filename*/;
- ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[10]) /*String::append*/;
- variable[11] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
- variable[12] = variable[11];
- ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[12]) /*String::append*/;
- ((mmloader___ToolContext___error_t)CALL( variable[1] /*context*/,COLOR_mmloader___ToolContext___error))( variable[1] /*context*/, variable[7]) /*ToolContext::error*/;
- variable[7] = variable[0];
- 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);
- }
- variable[8] = variable[0];
- variable[8] = ((mmloader___ModuleLoader___parse_file_t)CALL(variable[8],COLOR_mmloader___ModuleLoader___parse_file))(variable[8], variable[1] /*context*/, variable[6] /*file*/, variable[4] /*filename*/, variable[2] /*module_name*/, variable[3] /*dir*/) /*ModuleLoader::parse_file*/;
- variable[7] = variable[8];
- ((mmloader___MMModule___filename__eq_t)CALL( variable[7] /*m*/,COLOR_mmloader___MMModule___filename__eq))( variable[7] /*m*/, variable[4] /*filename*/) /*MMModule::filename=*/;
- variable[8] = variable[0];
- variable[8] = ((file___Object___stdin_t)CALL(variable[8],COLOR_file___Object___stdin))(variable[8]) /*Object::stdin*/;
- variable[8] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[6] /*file*/ == variable[8]) || (( variable[6] /*file*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable[6] /*file*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[6] /*file*/,variable[8])):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable[6] /*file*/,COLOR_kernel___Object_____eqeq))( variable[6] /*file*/, variable[8]) /*Object::==*/)))))));
- if (UNTAG_Bool(variable[8])) { /*if*/
- ((file___IFStream___close_t)CALL( variable[6] /*file*/,COLOR_stream___IOS___close))( variable[6] /*file*/) /*IFStream::close*/;
- }
- variable[5] = variable[7] /*m*/;
- goto return_label18;
- return_label18: while(false);
- tracehead = trace.prev;
- return variable[5];
+static const char LOCATE_mmloader___ModuleLoader___load_module[] = "mmloader::ModuleLoader::load_module";
+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 = 225;
+ fra.me.meth = LOCATE_mmloader___ModuleLoader___load_module;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 8;
+ fra.me.nitni_local_ref_head = NULL;
+ 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:229 */
+ if (!once_value_1) {
+ fra.me.REG[5] = BOX_NativeString("-");
+ REGB0 = TAG_Int(1);
+ fra.me.REG[5] = NEW_String_standard___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_standard___kernel___Object_____eqeq(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]);
+ REGB0 = REGB1;
+ }
+ if (UNTAG_Bool(REGB0)) {
+ /* mmloader.nit:230 */
+ fra.me.REG[5] = CALL_standard___file___Object___stdin(fra.me.REG[0])(fra.me.REG[0]);
+ } else {
+ /* mmloader.nit:232 */
+ fra.me.REG[6] = CALL_standard___string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]);
+ fra.me.REG[6] = NEW_IFStream_standard___file___IFStream___open(fra.me.REG[6]);
+ fra.me.REG[5] = fra.me.REG[6];
+ }
+ /* mmloader.nit:235 */
+ REGB0 = CALL_standard___stream___IStream___eof(fra.me.REG[5])(fra.me.REG[5]);
+ if (UNTAG_Bool(REGB0)) {
+ /* mmloader.nit:236 */
+ REGB0 = TAG_Int(3);
+ fra.me.REG[6] = NEW_Array_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[7]);
+ CALL_standard___collection___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_standard___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_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[7]);
+ fra.me.REG[6] = CALL_standard___string___Object___to_s(fra.me.REG[6])(fra.me.REG[6]);
+ CALL_toolcontext___ToolContext___fatal_error(fra.me.REG[1])(fra.me.REG[1], NIT_NULL, fra.me.REG[6]);
+ }
+ /* mmloader.nit:238 */
+ 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:239 */
+ fra.me.REG[0] = CALL_standard___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_standard___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_standard___stream___IOS___close(fra.me.REG[5])(fra.me.REG[5]);
+ }
+ /* mmloader.nit:240 */
+ goto label4;
+ label4: while(0);
+ stack_frame_head = fra.me.prev;
+ return fra.me.REG[3];
}
-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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- fprintf(stderr, "Deferred method called");
- fprintf(stderr, " (%s:%d)\n", LOCATE_mmloader, 285);
- nit_exit(1);
- tracehead = trace.prev;
+static const char LOCATE_mmloader___ModuleLoader___parse_file[] = "mmloader::ModuleLoader::parse_file";
+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 = 243;
+ fra.me.meth = LOCATE_mmloader___ModuleLoader___parse_file;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 0;
+ fra.me.nitni_local_ref_head = NULL;
+ /* mmloader.nit:243 */
+ nit_abort("Deferred method called", NULL, LOCATE_mmloader, 243);
+ stack_frame_head = fra.me.prev;
return NIT_NULL;
}
-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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- fprintf(stderr, "Deferred method called");
- fprintf(stderr, " (%s:%d)\n", LOCATE_mmloader, 288);
- nit_exit(1);
- tracehead = trace.prev;
- return;
-}
-void mmloader___ModuleLoader___init(val_t self, int* init_table) {
- struct trace_t trace = {NULL, NULL, 0, LOCATE_mmloader___ModuleLoader___init};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- tracehead = trace.prev;
- return;
-}
-val_t mmloader___MMModule___filename(val_t self) {
- struct trace_t trace = {NULL, NULL, 293, LOCATE_mmloader___MMModule___filename};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- 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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- ATTR_mmloader___MMModule____filename( self) /*MMModule::_filename*/ = param0;
- tracehead = trace.prev;
- return;
-}
-val_t mmloader___MMModule___mtime(val_t self) {
- struct trace_t trace = {NULL, NULL, 296, LOCATE_mmloader___MMModule___mtime};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- 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};
- val_t *variable = NULL;
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- ATTR_mmloader___MMModule____mtime( self) /*MMModule::_mtime*/ = param0;
- tracehead = trace.prev;
- 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 variable[10];
- void **closurevariable = NULL;
- trace.prev = tracehead; tracehead = &trace;
- trace.file = LOCATE_mmloader;
- variable[0] = self;
- variable[1] = param0;
- variable[4] = variable[0];
- variable[4] = ((abstractmetamodel___MMModule___context_t)CALL(variable[4],COLOR_abstractmetamodel___MMModule___context))(variable[4]) /*MMModule::context*/;
- variable[3] = variable[4];
- variable[4] = TAG_Bool(( variable[3] /*c*/==NIT_NULL) || VAL_ISA( variable[3] /*c*/, COLOR_ToolContext, ID_ToolContext)) /*cast ToolContext*/;
- if (!UNTAG_Bool(variable[4])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___MMModule___import_supers_modules, LOCATE_mmloader, 303); nit_exit(1);}
- variable[5] = NEW_Array_array___Array___init(); /*new Array[MMModule]*/
- variable[4] = variable[5];
- variable[5] = ((abstract_collection___Collection___iterator_t)CALL( variable[1] /*names*/,COLOR_abstract_collection___Collection___iterator))( variable[1] /*names*/) /*Collection::iterator*/;
- while (true) { /*for*/
- variable[6] = ((abstract_collection___Iterator___is_ok_t)CALL(variable[5],COLOR_abstract_collection___Iterator___is_ok))(variable[5]) /*Iterator::is_ok*/;
- if (!UNTAG_Bool(variable[6])) break; /*for*/
- variable[6] = ((abstract_collection___Iterator___item_t)CALL(variable[5],COLOR_abstract_collection___Iterator___item))(variable[5]) /*Iterator::item*/;
- variable[7] = variable[6];
- variable[9] = variable[0];
- variable[9] = ((mmloader___ToolContext___get_module_t)CALL( variable[3] /*c*/,COLOR_mmloader___ToolContext___get_module))( variable[3] /*c*/, variable[7] /*n*/, variable[9]) /*ToolContext::get_module*/;
- variable[8] = variable[9];
- ((array___AbstractArray___add_t)CALL( variable[4] /*supers*/,COLOR_abstract_collection___SimpleCollection___add))( variable[4] /*supers*/, variable[8] /*m*/) /*AbstractArray::add*/;
- continue_20: while(0);
- ((abstract_collection___Iterator___next_t)CALL(variable[5],COLOR_abstract_collection___Iterator___next))(variable[5]) /*Iterator::next*/;
- }
- break_20: while(0);
- variable[5] = variable[0];
- ((abstractmetamodel___MMContext___add_module_t)CALL( variable[3] /*c*/,COLOR_abstractmetamodel___MMContext___add_module))( variable[3] /*c*/, variable[5], variable[4] /*supers*/) /*MMContext::add_module*/;
- return_label19: while(false);
- tracehead = trace.prev;
+static const char LOCATE_mmloader___ModuleLoader___process_metamodel[] = "mmloader::ModuleLoader::process_metamodel";
+void mmloader___ModuleLoader___process_metamodel(val_t p0, val_t p1, val_t p2){
+ 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 = 246;
+ fra.me.meth = LOCATE_mmloader___ModuleLoader___process_metamodel;
+ fra.me.has_broke = 0;
+ fra.me.REG_size = 2;
+ fra.me.nitni_local_ref_head = NULL;
+ fra.me.REG[0] = NIT_NULL;
+ fra.me.REG[1] = NIT_NULL;
+ fra.me.REG[0] = p0;
+ fra.me.REG[1] = p2;
+ REGB0 = TAG_Bool(VAL_ISA(fra.me.REG[1], VTCOLOR_mmloader___ModuleLoader___MODULE(fra.me.REG[0]), VTID_mmloader___ModuleLoader___MODULE(fra.me.REG[0]))) /*cast MODULE*/;
+ if (UNTAG_Bool(REGB0)) {
+ } else {
+ nit_abort("Cast failed", NULL, LOCATE_mmloader, 0);
+ }
+ /* mmloader.nit:246 */
+ nit_abort("Deferred method called", NULL, LOCATE_mmloader, 246);
+ stack_frame_head = fra.me.prev;
return;
}