70abdf1d31c5d1c05ee44eff507a6031e139df52
[nit.git] / c_src / mmloader._sep.c
1 /* This C file is generated by NIT to compile module mmloader. */
2 #include "mmloader._sep.h"
3 val_t mmloader___ToolContext___error_count(val_t self) {
4 struct trace_t trace = {NULL, NULL, 27, LOCATE_mmloader___ToolContext___error_count};
5 val_t *variable = NULL;
6 void **closurevariable = NULL;
7 trace.prev = tracehead; tracehead = &trace;
8 trace.file = LOCATE_mmloader;
9 tracehead = trace.prev;
10 return ATTR_mmloader___ToolContext____error_count( self) /*ToolContext::_error_count*/;
11 }
12 val_t mmloader___ToolContext___warning_count(val_t self) {
13 struct trace_t trace = {NULL, NULL, 30, LOCATE_mmloader___ToolContext___warning_count};
14 val_t *variable = NULL;
15 void **closurevariable = NULL;
16 trace.prev = tracehead; tracehead = &trace;
17 trace.file = LOCATE_mmloader;
18 tracehead = trace.prev;
19 return ATTR_mmloader___ToolContext____warning_count( self) /*ToolContext::_warning_count*/;
20 }
21 void mmloader___ToolContext___error(val_t self, val_t param0) {
22 struct trace_t trace = {NULL, NULL, 33, LOCATE_mmloader___ToolContext___error};
23 val_t variable[10];
24 void **closurevariable = NULL;
25 trace.prev = tracehead; tracehead = &trace;
26 trace.file = LOCATE_mmloader;
27 variable[0] = self;
28 variable[1] = param0;
29 variable[3] = variable[0];
30 variable[3] = ((file___Object___stderr_t)CALL(variable[3],COLOR_file___Object___stderr))(variable[3]) /*Object::stderr*/;
31 variable[4] = NEW_String_string___String___init(); /*new String*/
32 variable[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
33 variable[6] = variable[5];
34 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[6]) /*String::append*/;
35 variable[7] = variable[1] /*s*/;
36 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[7]) /*String::append*/;
37 variable[8] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
38 variable[9] = variable[8];
39 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[9]) /*String::append*/;
40 ((file___OFStream___write_t)CALL(variable[3],COLOR_stream___OStream___write))(variable[3], variable[4]) /*OFStream::write*/;
41 variable[3] = variable[0];
42 variable[4] = variable[0];
43 variable[4] = ATTR_mmloader___ToolContext____error_count(variable[4]) /*ToolContext::_error_count*/;
44 variable[4] = TAG_Int(UNTAG_Int(variable[4])+UNTAG_Int( TAG_Int(1)));
45 ATTR_mmloader___ToolContext____error_count(variable[3]) /*ToolContext::_error_count*/ = variable[4];
46 return_label0: while(false);
47 tracehead = trace.prev;
48 return;
49 }
50 void mmloader___ToolContext___warning(val_t self, val_t param0) {
51 struct trace_t trace = {NULL, NULL, 40, LOCATE_mmloader___ToolContext___warning};
52 val_t variable[10];
53 void **closurevariable = NULL;
54 trace.prev = tracehead; tracehead = &trace;
55 trace.file = LOCATE_mmloader;
56 variable[0] = self;
57 variable[1] = param0;
58 variable[3] = variable[0];
59 variable[3] = ATTR_mmloader___ToolContext____opt_warn(variable[3]) /*ToolContext::_opt_warn*/;
60 variable[3] = ((opts___Option___value_t)CALL(variable[3],COLOR_opts___Option___value))(variable[3]) /*Option::value*/;
61 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[3])))) { /*if*/
62 goto return_label1;
63 }
64 variable[3] = variable[0];
65 variable[3] = ((file___Object___stderr_t)CALL(variable[3],COLOR_file___Object___stderr))(variable[3]) /*Object::stderr*/;
66 variable[4] = NEW_String_string___String___init(); /*new String*/
67 variable[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
68 variable[6] = variable[5];
69 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[6]) /*String::append*/;
70 variable[7] = variable[1] /*s*/;
71 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[7]) /*String::append*/;
72 variable[8] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
73 variable[9] = variable[8];
74 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[9]) /*String::append*/;
75 ((file___OFStream___write_t)CALL(variable[3],COLOR_stream___OStream___write))(variable[3], variable[4]) /*OFStream::write*/;
76 variable[3] = variable[0];
77 variable[4] = variable[0];
78 variable[4] = ATTR_mmloader___ToolContext____warning_count(variable[4]) /*ToolContext::_warning_count*/;
79 variable[4] = TAG_Int(UNTAG_Int(variable[4])+UNTAG_Int( TAG_Int(1)));
80 ATTR_mmloader___ToolContext____warning_count(variable[3]) /*ToolContext::_warning_count*/ = variable[4];
81 return_label1: while(false);
82 tracehead = trace.prev;
83 return;
84 }
85 val_t mmloader___ToolContext___paths(val_t self) {
86 struct trace_t trace = {NULL, NULL, 48, LOCATE_mmloader___ToolContext___paths};
87 val_t *variable = NULL;
88 void **closurevariable = NULL;
89 trace.prev = tracehead; tracehead = &trace;
90 trace.file = LOCATE_mmloader;
91 tracehead = trace.prev;
92 return ATTR_mmloader___ToolContext____paths( self) /*ToolContext::_paths*/;
93 }
94 val_t mmloader___ToolContext___option_context(val_t self) {
95 struct trace_t trace = {NULL, NULL, 54, LOCATE_mmloader___ToolContext___option_context};
96 val_t *variable = NULL;
97 void **closurevariable = NULL;
98 trace.prev = tracehead; tracehead = &trace;
99 trace.file = LOCATE_mmloader;
100 tracehead = trace.prev;
101 return ATTR_mmloader___ToolContext____option_context( self) /*ToolContext::_option_context*/;
102 }
103 val_t mmloader___ToolContext___opt_warn(val_t self) {
104 struct trace_t trace = {NULL, NULL, 57, LOCATE_mmloader___ToolContext___opt_warn};
105 val_t *variable = NULL;
106 void **closurevariable = NULL;
107 trace.prev = tracehead; tracehead = &trace;
108 trace.file = LOCATE_mmloader;
109 tracehead = trace.prev;
110 return ATTR_mmloader___ToolContext____opt_warn( self) /*ToolContext::_opt_warn*/;
111 }
112 val_t mmloader___ToolContext___opt_path(val_t self) {
113 struct trace_t trace = {NULL, NULL, 60, LOCATE_mmloader___ToolContext___opt_path};
114 val_t *variable = NULL;
115 void **closurevariable = NULL;
116 trace.prev = tracehead; tracehead = &trace;
117 trace.file = LOCATE_mmloader;
118 tracehead = trace.prev;
119 return ATTR_mmloader___ToolContext____opt_path( self) /*ToolContext::_opt_path*/;
120 }
121 val_t mmloader___ToolContext___opt_log(val_t self) {
122 struct trace_t trace = {NULL, NULL, 63, LOCATE_mmloader___ToolContext___opt_log};
123 val_t *variable = NULL;
124 void **closurevariable = NULL;
125 trace.prev = tracehead; tracehead = &trace;
126 trace.file = LOCATE_mmloader;
127 tracehead = trace.prev;
128 return ATTR_mmloader___ToolContext____opt_log( self) /*ToolContext::_opt_log*/;
129 }
130 val_t mmloader___ToolContext___opt_only_metamodel(val_t self) {
131 struct trace_t trace = {NULL, NULL, 66, LOCATE_mmloader___ToolContext___opt_only_metamodel};
132 val_t *variable = NULL;
133 void **closurevariable = NULL;
134 trace.prev = tracehead; tracehead = &trace;
135 trace.file = LOCATE_mmloader;
136 tracehead = trace.prev;
137 return ATTR_mmloader___ToolContext____opt_only_metamodel( self) /*ToolContext::_opt_only_metamodel*/;
138 }
139 val_t mmloader___ToolContext___opt_only_parse(val_t self) {
140 struct trace_t trace = {NULL, NULL, 69, LOCATE_mmloader___ToolContext___opt_only_parse};
141 val_t *variable = NULL;
142 void **closurevariable = NULL;
143 trace.prev = tracehead; tracehead = &trace;
144 trace.file = LOCATE_mmloader;
145 tracehead = trace.prev;
146 return ATTR_mmloader___ToolContext____opt_only_parse( self) /*ToolContext::_opt_only_parse*/;
147 }
148 val_t mmloader___ToolContext___opt_help(val_t self) {
149 struct trace_t trace = {NULL, NULL, 72, LOCATE_mmloader___ToolContext___opt_help};
150 val_t *variable = NULL;
151 void **closurevariable = NULL;
152 trace.prev = tracehead; tracehead = &trace;
153 trace.file = LOCATE_mmloader;
154 tracehead = trace.prev;
155 return ATTR_mmloader___ToolContext____opt_help( self) /*ToolContext::_opt_help*/;
156 }
157 void mmloader___ToolContext___init(val_t self, int* init_table) {
158 struct trace_t trace = {NULL, NULL, 75, LOCATE_mmloader___ToolContext___init};
159 val_t variable[10];
160 void **closurevariable = NULL;
161 trace.prev = tracehead; tracehead = &trace;
162 trace.file = LOCATE_mmloader;
163 variable[0] = self;
164 if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_ToolContext].i]) return;
165 ((abstractmetamodel___MMContext___init_t)CALL(variable[0],COLOR_abstractmetamodel___MMContext___init))(variable[0], init_table /*YYY*/) /*MMContext::init*/;
166 variable[2] = variable[0];
167 variable[2] = ((mmloader___ToolContext___option_context_t)CALL(variable[2],COLOR_mmloader___ToolContext___option_context))(variable[2]) /*ToolContext::option_context*/;
168 variable[3] = NEW_Array_array___Array___with_capacity(TAG_Int(6)); /*new Array[Option]*/
169 variable[4] = variable[0];
170 variable[4] = ((mmloader___ToolContext___opt_warn_t)CALL(variable[4],COLOR_mmloader___ToolContext___opt_warn))(variable[4]) /*ToolContext::opt_warn*/;
171 ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[4]) /*AbstractArray::add*/;
172 variable[5] = variable[0];
173 variable[5] = ((mmloader___ToolContext___opt_path_t)CALL(variable[5],COLOR_mmloader___ToolContext___opt_path))(variable[5]) /*ToolContext::opt_path*/;
174 ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[5]) /*AbstractArray::add*/;
175 variable[6] = variable[0];
176 variable[6] = ((mmloader___ToolContext___opt_log_t)CALL(variable[6],COLOR_mmloader___ToolContext___opt_log))(variable[6]) /*ToolContext::opt_log*/;
177 ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[6]) /*AbstractArray::add*/;
178 variable[7] = variable[0];
179 variable[7] = ((mmloader___ToolContext___opt_only_parse_t)CALL(variable[7],COLOR_mmloader___ToolContext___opt_only_parse))(variable[7]) /*ToolContext::opt_only_parse*/;
180 ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[7]) /*AbstractArray::add*/;
181 variable[8] = variable[0];
182 variable[8] = ((mmloader___ToolContext___opt_only_metamodel_t)CALL(variable[8],COLOR_mmloader___ToolContext___opt_only_metamodel))(variable[8]) /*ToolContext::opt_only_metamodel*/;
183 ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[8]) /*AbstractArray::add*/;
184 variable[9] = variable[0];
185 variable[9] = ((mmloader___ToolContext___opt_help_t)CALL(variable[9],COLOR_mmloader___ToolContext___opt_help))(variable[9]) /*ToolContext::opt_help*/;
186 ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[9]) /*AbstractArray::add*/;
187 ((opts___OptionContext___add_option_t)CALL(variable[2],COLOR_opts___OptionContext___add_option))(variable[2], variable[3]) /*OptionContext::add_option*/;
188 return_label2: while(false);
189 init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_ToolContext].i] = 1;
190 tracehead = trace.prev;
191 return;
192 }
193 void mmloader___ToolContext___process_options(val_t self) {
194 struct trace_t trace = {NULL, NULL, 81, LOCATE_mmloader___ToolContext___process_options};
195 static val_t once_value_4; static int once_bool_4; /* Once value for variable[3]*/
196 static val_t once_value_5; static int once_bool_5; /* Once value for variable[3]*/
197 val_t variable[11];
198 void **closurevariable = NULL;
199 trace.prev = tracehead; tracehead = &trace;
200 trace.file = LOCATE_mmloader;
201 variable[0] = self;
202 variable[2] = variable[0];
203 variable[2] = ((mmloader___ToolContext___option_context_t)CALL(variable[2],COLOR_mmloader___ToolContext___option_context))(variable[2]) /*ToolContext::option_context*/;
204 variable[3] = variable[0];
205 variable[3] = ((string___Object___args_t)CALL(variable[3],COLOR_string___Object___args))(variable[3]) /*Object::args*/;
206 ((opts___OptionContext___parse_t)CALL(variable[2],COLOR_opts___OptionContext___parse))(variable[2], variable[3]) /*OptionContext::parse*/;
207 variable[2] = variable[0];
208 variable[3] = NEW_Array_array___Array___init(); /*new Array[String]*/
209 ATTR_mmloader___ToolContext____paths(variable[2]) /*ToolContext::_paths*/ = variable[3];
210 variable[2] = variable[0];
211 variable[2] = ((mmloader___ToolContext___paths_t)CALL(variable[2],COLOR_mmloader___ToolContext___paths))(variable[2]) /*ToolContext::paths*/;
212 variable[3] = variable[0];
213 variable[3] = ((mmloader___ToolContext___opt_path_t)CALL(variable[3],COLOR_mmloader___ToolContext___opt_path))(variable[3]) /*ToolContext::opt_path*/;
214 variable[3] = ((opts___Option___value_t)CALL(variable[3],COLOR_opts___Option___value))(variable[3]) /*Option::value*/;
215 ((abstract_collection___IndexedCollection___append_t)CALL(variable[2],COLOR_abstract_collection___IndexedCollection___append))(variable[2], variable[3]) /*IndexedCollection::append*/;
216 if (once_bool_4) variable[3] = once_value_4;
217 else {
218 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("NIT_PATH"), TAG_Int(8)); /*new String*/
219 variable[3] = ((symbol___String___to_symbol_t)CALL(variable[3],COLOR_symbol___String___to_symbol))(variable[3]) /*String::to_symbol*/;
220 variable[3] = ((environ___Symbol___environ_t)CALL(variable[3],COLOR_environ___Symbol___environ))(variable[3]) /*Symbol::environ*/;
221 once_value_4 = variable[3];
222 once_bool_4 = true;
223 }
224 variable[2] = variable[3];
225 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*/;
226 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[3])))) { /*if*/
227 variable[3] = variable[0];
228 variable[3] = ((mmloader___ToolContext___paths_t)CALL(variable[3],COLOR_mmloader___ToolContext___paths))(variable[3]) /*ToolContext::paths*/;
229 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*/;
230 ((abstract_collection___IndexedCollection___append_t)CALL(variable[3],COLOR_abstract_collection___IndexedCollection___append))(variable[3], variable[4]) /*IndexedCollection::append*/;
231 }
232 if (once_bool_5) variable[3] = once_value_5;
233 else {
234 variable[3] = NEW_String_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)); /*new String*/
235 variable[3] = ((symbol___String___to_symbol_t)CALL(variable[3],COLOR_symbol___String___to_symbol))(variable[3]) /*String::to_symbol*/;
236 variable[3] = ((environ___Symbol___environ_t)CALL(variable[3],COLOR_environ___Symbol___environ))(variable[3]) /*Symbol::environ*/;
237 once_value_5 = variable[3];
238 once_bool_5 = true;
239 }
240 variable[2] = variable[3] /*path_env=*/;
241 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*/;
242 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[3])))) { /*if*/
243 variable[4] = NEW_String_string___String___init(); /*new String*/
244 variable[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
245 variable[6] = variable[5];
246 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[6]) /*String::append*/;
247 variable[7] = variable[2] /*path_env*/;
248 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[7]) /*String::append*/;
249 variable[8] = NEW_String_string___String___with_native(BOX_NativeString("/lib"), TAG_Int(4)); /*new String*/
250 variable[9] = variable[8];
251 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[9]) /*String::append*/;
252 variable[3] = variable[4];
253 variable[4] = ((file___String___file_exists_t)CALL( variable[3] /*libname*/,COLOR_file___String___file_exists))( variable[3] /*libname*/) /*String::file_exists*/;
254 if (UNTAG_Bool(variable[4])) { /*if*/
255 variable[4] = variable[0];
256 variable[4] = ((mmloader___ToolContext___paths_t)CALL(variable[4],COLOR_mmloader___ToolContext___paths))(variable[4]) /*ToolContext::paths*/;
257 ((array___AbstractArray___add_t)CALL(variable[4],COLOR_abstract_collection___SimpleCollection___add))(variable[4], variable[3] /*libname*/) /*AbstractArray::add*/;
258 }
259 }
260 variable[4] = NEW_String_string___String___init(); /*new String*/
261 variable[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
262 variable[6] = variable[5];
263 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[6]) /*String::append*/;
264 variable[7] = variable[0];
265 variable[7] = (G_sys);
266 variable[7] = ((string___Sys___program_name_t)CALL(variable[7],COLOR_string___Sys___program_name))(variable[7]) /*Sys::program_name*/;
267 variable[7] = ((file___String___dirname_t)CALL(variable[7],COLOR_file___String___dirname))(variable[7]) /*String::dirname*/;
268 variable[8] = variable[7];
269 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[8]) /*String::append*/;
270 variable[9] = NEW_String_string___String___with_native(BOX_NativeString("/../lib"), TAG_Int(7)); /*new String*/
271 variable[10] = variable[9];
272 ((string___String___append_t)CALL(variable[4],COLOR_abstract_collection___IndexedCollection___append))(variable[4], variable[10]) /*String::append*/;
273 variable[3] = variable[4];
274 variable[4] = ((file___String___file_exists_t)CALL( variable[3] /*libname*/,COLOR_file___String___file_exists))( variable[3] /*libname*/) /*String::file_exists*/;
275 if (UNTAG_Bool(variable[4])) { /*if*/
276 variable[4] = variable[0];
277 variable[4] = ((mmloader___ToolContext___paths_t)CALL(variable[4],COLOR_mmloader___ToolContext___paths))(variable[4]) /*ToolContext::paths*/;
278 ((array___AbstractArray___add_t)CALL(variable[4],COLOR_abstract_collection___SimpleCollection___add))(variable[4], variable[3] /*libname*/) /*AbstractArray::add*/;
279 }
280 return_label3: while(false);
281 tracehead = trace.prev;
282 return;
283 }
284 val_t mmloader___ToolContext___try_to_load(val_t self, val_t param0, val_t param1) {
285 struct trace_t trace = {NULL, NULL, 106, LOCATE_mmloader___ToolContext___try_to_load};
286 val_t variable[16];
287 void **closurevariable = NULL;
288 trace.prev = tracehead; tracehead = &trace;
289 trace.file = LOCATE_mmloader;
290 variable[0] = self;
291 variable[1] = param0;
292 variable[2] = param1;
293 variable[4] = ((abstractmetamodel___MMDirectory___modules_t)CALL( variable[2] /*dir*/,COLOR_abstractmetamodel___MMDirectory___modules))( variable[2] /*dir*/) /*MMDirectory::modules*/;
294 variable[4] = ((abstract_collection___Map___iterator_t)CALL(variable[4],COLOR_abstract_collection___Collection___iterator))(variable[4]) /*Map::iterator*/;
295 while (true) { /*for*/
296 variable[5] = ((abstract_collection___Iterator___is_ok_t)CALL(variable[4],COLOR_abstract_collection___Iterator___is_ok))(variable[4]) /*Iterator::is_ok*/;
297 if (!UNTAG_Bool(variable[5])) break; /*for*/
298 variable[5] = ((abstract_collection___Iterator___item_t)CALL(variable[4],COLOR_abstract_collection___Iterator___item))(variable[4]) /*Iterator::item*/;
299 variable[6] = variable[5];
300 variable[7] = ((abstractmetamodel___MMModule___name_t)CALL( variable[6] /*m*/,COLOR_abstractmetamodel___MMModule___name))( variable[6] /*m*/) /*MMModule::name*/;
301 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::==*/)))));
302 if (UNTAG_Bool(variable[7])) { /*if*/
303 variable[3] = variable[6] /*m*/;
304 goto return_label6;
305 }
306 continue_7: while(0);
307 ((abstract_collection___Iterator___next_t)CALL(variable[4],COLOR_abstract_collection___Iterator___next))(variable[4]) /*Iterator::next*/;
308 }
309 break_7: while(0);
310 variable[4] = variable[0];
311 variable[4] = ATTR_mmloader___ToolContext____loaders(variable[4]) /*ToolContext::_loaders*/;
312 variable[4] = ((array___AbstractArray___iterator_t)CALL(variable[4],COLOR_abstract_collection___Collection___iterator))(variable[4]) /*AbstractArray::iterator*/;
313 while (true) { /*for*/
314 variable[5] = ((array___ArrayIterator___is_ok_t)CALL(variable[4],COLOR_abstract_collection___Iterator___is_ok))(variable[4]) /*ArrayIterator::is_ok*/;
315 if (!UNTAG_Bool(variable[5])) break; /*for*/
316 variable[5] = ((array___ArrayIterator___item_t)CALL(variable[4],COLOR_abstract_collection___Iterator___item))(variable[4]) /*ArrayIterator::item*/;
317 variable[6] = variable[5];
318 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*/;
319 variable[7] = variable[8];
320 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::==*/)))))));
321 if (UNTAG_Bool(variable[8])) { /*if*/
322 variable[9] = variable[0];
323 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*/;
324 variable[8] = variable[9];
325 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::==*/)))))));
326 if (UNTAG_Bool(variable[9])) { /*if*/
327 ((abstractmetamodel___MMDirectory___owner__eq_t)CALL( variable[7] /*dir2*/,COLOR_abstractmetamodel___MMDirectory___owner__eq))( variable[7] /*dir2*/, variable[8] /*m*/) /*MMDirectory::owner=*/;
328 ((abstractmetamodel___MMDirectory___add_module_t)CALL( variable[2] /*dir*/,COLOR_abstractmetamodel___MMDirectory___add_module))( variable[2] /*dir*/, variable[8] /*m*/) /*MMDirectory::add_module*/;
329 variable[3] = variable[8] /*m*/;
330 goto return_label6;
331 }
332 }
333 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*/;
334 if (UNTAG_Bool(variable[8])) { /*if*/
335 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*/;
336 variable[8] = variable[9];
337 variable[9] = variable[0];
338 variable[9] = ATTR_mmloader___ToolContext____processing_modules(variable[9]) /*ToolContext::_processing_modules*/;
339 variable[9] = ((hash___HashSet___has_t)CALL(variable[9],COLOR_abstract_collection___Collection___has))(variable[9], variable[8] /*full_name*/) /*HashSet::has*/;
340 if (UNTAG_Bool(variable[9])) { /*if*/
341 variable[9] = variable[0];
342 variable[10] = NEW_String_string___String___init(); /*new String*/
343 variable[11] = NEW_String_string___String___with_native(BOX_NativeString("Error: Dependency loop for module "), TAG_Int(34)); /*new String*/
344 variable[12] = variable[11];
345 ((string___String___append_t)CALL(variable[10],COLOR_abstract_collection___IndexedCollection___append))(variable[10], variable[12]) /*String::append*/;
346 variable[13] = variable[8] /*full_name*/;
347 variable[13] = ((string___String___to_s_t)CALL(variable[13],COLOR_string___Object___to_s))(variable[13]) /*String::to_s*/;
348 ((string___String___append_t)CALL(variable[10],COLOR_abstract_collection___IndexedCollection___append))(variable[10], variable[13]) /*String::append*/;
349 variable[14] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
350 variable[15] = variable[14];
351 ((string___String___append_t)CALL(variable[10],COLOR_abstract_collection___IndexedCollection___append))(variable[10], variable[15]) /*String::append*/;
352 ((mmloader___ToolContext___error_t)CALL(variable[9],COLOR_mmloader___ToolContext___error))(variable[9], variable[10]) /*ToolContext::error*/;
353 variable[9] = variable[0];
354 exit(UNTAG_Int( TAG_Int(1)));
355 fprintf(stderr, "Aborted"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___try_to_load, LOCATE_mmloader, 135); nit_exit(1);
356 }
357 variable[9] = variable[0];
358 variable[9] = ATTR_mmloader___ToolContext____processing_modules(variable[9]) /*ToolContext::_processing_modules*/;
359 ((hash___HashSet___add_t)CALL(variable[9],COLOR_abstract_collection___SimpleCollection___add))(variable[9], variable[8] /*full_name*/) /*HashSet::add*/;
360 variable[10] = variable[0];
361 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*/;
362 variable[9] = variable[10];
363 variable[10] = variable[0];
364 variable[10] = ATTR_mmloader___ToolContext____processing_modules(variable[10]) /*ToolContext::_processing_modules*/;
365 ((hash___HashSet___remove_t)CALL(variable[10],COLOR_abstract_collection___RemovableCollection___remove))(variable[10], variable[8] /*full_name*/) /*HashSet::remove*/;
366 ((abstractmetamodel___MMDirectory___add_module_t)CALL( variable[2] /*dir*/,COLOR_abstractmetamodel___MMDirectory___add_module))( variable[2] /*dir*/, variable[9] /*m*/) /*MMDirectory::add_module*/;
367 variable[3] = variable[9] /*m*/;
368 goto return_label6;
369 }
370 continue_8: while(0);
371 ((array___ArrayIterator___next_t)CALL(variable[4],COLOR_abstract_collection___Iterator___next))(variable[4]) /*ArrayIterator::next*/;
372 }
373 break_8: while(0);
374 variable[3] = NIT_NULL /*null*/;
375 goto return_label6;
376 return_label6: while(false);
377 tracehead = trace.prev;
378 return variable[3];
379 }
380 val_t mmloader___ToolContext___get_module_from_filename(val_t self, val_t param0) {
381 struct trace_t trace = {NULL, NULL, 152, LOCATE_mmloader___ToolContext___get_module_from_filename};
382 val_t variable[14];
383 void **closurevariable = NULL;
384 trace.prev = tracehead; tracehead = &trace;
385 trace.file = LOCATE_mmloader;
386 variable[0] = self;
387 variable[1] = param0;
388 variable[4] = ((file___String___dirname_t)CALL( variable[1] /*filename*/,COLOR_file___String___dirname))( variable[1] /*filename*/) /*String::dirname*/;
389 variable[3] = variable[4];
390 variable[5] = NEW_String_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/
391 variable[5] = ((file___String___basename_t)CALL( variable[1] /*filename*/,COLOR_file___String___basename))( variable[1] /*filename*/, variable[5]) /*String::basename*/;
392 variable[5] = ((symbol___String___to_symbol_t)CALL(variable[5],COLOR_symbol___String___to_symbol))(variable[5]) /*String::to_symbol*/;
393 variable[4] = variable[5];
394 variable[6] = variable[0];
395 variable[6] = ((mmloader___ToolContext___directory_for_t)CALL(variable[6],COLOR_mmloader___ToolContext___directory_for))(variable[6], variable[3] /*path*/) /*ToolContext::directory_for*/;
396 variable[5] = variable[6];
397 variable[6] = ((symbol___Symbol___to_s_t)CALL( variable[4] /*module_name*/,COLOR_string___Object___to_s))( variable[4] /*module_name*/) /*Symbol::to_s*/;
398 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::==*/)));
399 if (UNTAG_Bool(variable[6])) { /*if*/
400 variable[7] = variable[0];
401 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*/;
402 variable[6] = variable[7];
403 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::==*/)))))));
404 if (UNTAG_Bool(variable[7])) { /*if*/
405 variable[2] = variable[6] /*m*/;
406 goto return_label9;
407 }
408 variable[7] = variable[0];
409 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*/;
410 variable[2] = variable[7];
411 goto return_label9;
412 }
413 variable[6] = ((file___String___file_exists_t)CALL( variable[1] /*filename*/,COLOR_file___String___file_exists))( variable[1] /*filename*/) /*String::file_exists*/;
414 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[6])))) { /*if*/
415 variable[6] = variable[0];
416 variable[7] = NEW_String_string___String___init(); /*new String*/
417 variable[8] = NEW_String_string___String___with_native(BOX_NativeString("Error: File "), TAG_Int(12)); /*new String*/
418 variable[9] = variable[8];
419 ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[9]) /*String::append*/;
420 variable[10] = variable[1] /*filename*/;
421 ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[10]) /*String::append*/;
422 variable[11] = NEW_String_string___String___with_native(BOX_NativeString(" not found."), TAG_Int(11)); /*new String*/
423 variable[12] = variable[11];
424 ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[12]) /*String::append*/;
425 ((mmloader___ToolContext___error_t)CALL(variable[6],COLOR_mmloader___ToolContext___error))(variable[6], variable[7]) /*ToolContext::error*/;
426 variable[6] = variable[0];
427 exit(UNTAG_Int( TAG_Int(1)));
428 fprintf(stderr, "Aborted"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___get_module_from_filename, LOCATE_mmloader, 175); nit_exit(1);
429 }
430 variable[7] = variable[0];
431 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*/;
432 variable[6] = variable[7];
433 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::==*/)))))));
434 if (UNTAG_Bool(variable[7])) { /*if*/
435 variable[2] = variable[6] /*m*/;
436 goto return_label9;
437 }
438 variable[7] = variable[0];
439 variable[8] = NEW_String_string___String___init(); /*new String*/
440 variable[9] = NEW_String_string___String___with_native(BOX_NativeString("Error: "), TAG_Int(7)); /*new String*/
441 variable[10] = variable[9];
442 ((string___String___append_t)CALL(variable[8],COLOR_abstract_collection___IndexedCollection___append))(variable[8], variable[10]) /*String::append*/;
443 variable[11] = variable[1] /*filename*/;
444 ((string___String___append_t)CALL(variable[8],COLOR_abstract_collection___IndexedCollection___append))(variable[8], variable[11]) /*String::append*/;
445 variable[12] = NEW_String_string___String___with_native(BOX_NativeString(" is not a NIT source module."), TAG_Int(28)); /*new String*/
446 variable[13] = variable[12];
447 ((string___String___append_t)CALL(variable[8],COLOR_abstract_collection___IndexedCollection___append))(variable[8], variable[13]) /*String::append*/;
448 ((mmloader___ToolContext___error_t)CALL(variable[7],COLOR_mmloader___ToolContext___error))(variable[7], variable[8]) /*ToolContext::error*/;
449 variable[7] = variable[0];
450 exit(UNTAG_Int( TAG_Int(1)));
451 fprintf(stderr, "Aborted"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___get_module_from_filename, LOCATE_mmloader, 184); nit_exit(1);
452 return_label9: while(false);
453 tracehead = trace.prev;
454 return variable[2];
455 }
456 val_t mmloader___ToolContext___get_module(val_t self, val_t param0, val_t param1) {
457 struct trace_t trace = {NULL, NULL, 187, LOCATE_mmloader___ToolContext___get_module};
458 val_t variable[12];
459 void **closurevariable = NULL;
460 trace.prev = tracehead; tracehead = &trace;
461 trace.file = LOCATE_mmloader;
462 variable[0] = self;
463 variable[1] = param0;
464 variable[2] = param1;
465 /*variable[4] is variable m*/
466 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::==*/)))))));
467 if (UNTAG_Bool(variable[5])) { /*if*/
468 variable[6] = ((abstractmetamodel___MMModule___directory_t)CALL( variable[2] /*from*/,COLOR_abstractmetamodel___MMModule___directory))( variable[2] /*from*/) /*MMModule::directory*/;
469 variable[5] = variable[6];
470 while (true) { /*while*/
471 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::==*/)))))));
472 if (!UNTAG_Bool(variable[6])) break; /* while*/
473 variable[7] = variable[0];
474 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*/;
475 variable[6] = variable[7];
476 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::==*/)))))));
477 if (UNTAG_Bool(variable[7])) { /*if*/
478 variable[3] = variable[6] /*m*/;
479 goto return_label10;
480 }
481 variable[7] = ((abstractmetamodel___MMDirectory___parent_t)CALL( variable[5] /*dir*/,COLOR_abstractmetamodel___MMDirectory___parent))( variable[5] /*dir*/) /*MMDirectory::parent*/;
482 variable[5] = variable[7] /*dir=*/;
483 continue_11: while(0);
484 }
485 break_11: while(0);
486 }
487 variable[5] = variable[0];
488 variable[5] = ((mmloader___ToolContext___paths_t)CALL(variable[5],COLOR_mmloader___ToolContext___paths))(variable[5]) /*ToolContext::paths*/;
489 variable[5] = ((array___AbstractArray___iterator_t)CALL(variable[5],COLOR_abstract_collection___Collection___iterator))(variable[5]) /*AbstractArray::iterator*/;
490 while (true) { /*for*/
491 variable[6] = ((array___ArrayIterator___is_ok_t)CALL(variable[5],COLOR_abstract_collection___Iterator___is_ok))(variable[5]) /*ArrayIterator::is_ok*/;
492 if (!UNTAG_Bool(variable[6])) break; /*for*/
493 variable[6] = ((array___ArrayIterator___item_t)CALL(variable[5],COLOR_abstract_collection___Iterator___item))(variable[5]) /*ArrayIterator::item*/;
494 variable[7] = variable[6];
495 variable[9] = variable[0];
496 variable[10] = variable[0];
497 variable[10] = ((mmloader___ToolContext___directory_for_t)CALL(variable[10],COLOR_mmloader___ToolContext___directory_for))(variable[10], variable[7] /*p*/) /*ToolContext::directory_for*/;
498 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*/;
499 variable[8] = variable[9];
500 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::==*/)))))));
501 if (UNTAG_Bool(variable[9])) { /*if*/
502 variable[3] = variable[8] /*m*/;
503 goto return_label10;
504 }
505 continue_12: while(0);
506 ((array___ArrayIterator___next_t)CALL(variable[5],COLOR_abstract_collection___Iterator___next))(variable[5]) /*ArrayIterator::next*/;
507 }
508 break_12: while(0);
509 variable[5] = variable[0];
510 variable[6] = NEW_String_string___String___init(); /*new String*/
511 variable[7] = NEW_String_string___String___with_native(BOX_NativeString("Error: No ressource found for module "), TAG_Int(37)); /*new String*/
512 variable[8] = variable[7];
513 ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[8]) /*String::append*/;
514 variable[9] = variable[1] /*module_name*/;
515 variable[9] = ((string___String___to_s_t)CALL(variable[9],COLOR_string___Object___to_s))(variable[9]) /*String::to_s*/;
516 ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[9]) /*String::append*/;
517 variable[10] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
518 variable[11] = variable[10];
519 ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[11]) /*String::append*/;
520 ((mmloader___ToolContext___error_t)CALL(variable[5],COLOR_mmloader___ToolContext___error))(variable[5], variable[6]) /*ToolContext::error*/;
521 variable[5] = variable[0];
522 exit(UNTAG_Int( TAG_Int(1)));
523 fprintf(stderr, "Aborted"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___get_module, LOCATE_mmloader, 208); nit_exit(1);
524 return_label10: while(false);
525 tracehead = trace.prev;
526 return variable[3];
527 }
528 val_t mmloader___ToolContext___directory_for(val_t self, val_t param0) {
529 struct trace_t trace = {NULL, NULL, 211, LOCATE_mmloader___ToolContext___directory_for};
530 val_t variable[6];
531 void **closurevariable = NULL;
532 trace.prev = tracehead; tracehead = &trace;
533 trace.file = LOCATE_mmloader;
534 variable[0] = self;
535 variable[1] = param0;
536 variable[3] = variable[0];
537 variable[3] = ATTR_mmloader___ToolContext____path_dirs(variable[3]) /*ToolContext::_path_dirs*/;
538 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*/;
539 if (UNTAG_Bool(variable[3])) { /*if*/
540 variable[3] = variable[0];
541 variable[3] = ATTR_mmloader___ToolContext____path_dirs(variable[3]) /*ToolContext::_path_dirs*/;
542 variable[3] = ((abstract_collection___Map_____bra_t)CALL(variable[3],COLOR_abstract_collection___Map_____bra))(variable[3], variable[1] /*path*/) /*Map::[]*/;
543 variable[2] = variable[3];
544 goto return_label13;
545 }
546 variable[4] = ((symbol___String___to_symbol_t)CALL( variable[1] /*path*/,COLOR_symbol___String___to_symbol))( variable[1] /*path*/) /*String::to_symbol*/;
547 variable[5] = NEW_MMDirectory_abstractmetamodel___MMDirectory___init(variable[4], variable[1] /*path*/, NIT_NULL /*null*/); /*new MMDirectory*/
548 variable[4] = variable[5];
549 variable[3] = variable[4];
550 variable[4] = variable[0];
551 variable[4] = ATTR_mmloader___ToolContext____path_dirs(variable[4]) /*ToolContext::_path_dirs*/;
552 ((abstract_collection___Map_____braeq_t)CALL(variable[4],COLOR_abstract_collection___Map_____braeq))(variable[4], variable[1] /*path*/, variable[3] /*dir*/) /*Map::[]=*/;
553 variable[2] = variable[3] /*dir*/;
554 goto return_label13;
555 return_label13: while(false);
556 tracehead = trace.prev;
557 return variable[2];
558 }
559 void mmloader___ToolContext___register_loader(val_t self, val_t param0) {
560 struct trace_t trace = {NULL, NULL, 223, LOCATE_mmloader___ToolContext___register_loader};
561 val_t variable[4];
562 void **closurevariable = NULL;
563 trace.prev = tracehead; tracehead = &trace;
564 trace.file = LOCATE_mmloader;
565 variable[0] = self;
566 variable[1] = param0;
567 variable[3] = variable[0];
568 variable[3] = ATTR_mmloader___ToolContext____loaders(variable[3]) /*ToolContext::_loaders*/;
569 ((array___AbstractArray___add_t)CALL(variable[3],COLOR_abstract_collection___SimpleCollection___add))(variable[3], variable[1] /*ml*/) /*AbstractArray::add*/;
570 return_label14: while(false);
571 tracehead = trace.prev;
572 return;
573 }
574 val_t mmloader___ModuleLoader___file_type(val_t self) {
575 struct trace_t trace = {NULL, NULL, 232, LOCATE_mmloader___ModuleLoader___file_type};
576 val_t *variable = NULL;
577 void **closurevariable = NULL;
578 trace.prev = tracehead; tracehead = &trace;
579 trace.file = LOCATE_mmloader;
580 fprintf(stderr, "Deferred method called");
581 fprintf(stderr, " (%s:%d)\n", LOCATE_mmloader, 232);
582 nit_exit(1);
583 tracehead = trace.prev;
584 return NIT_NULL;
585 }
586 val_t mmloader___ModuleLoader___try_to_load_dir(val_t self, val_t param0, val_t param1) {
587 struct trace_t trace = {NULL, NULL, 235, LOCATE_mmloader___ModuleLoader___try_to_load_dir};
588 val_t variable[15];
589 void **closurevariable = NULL;
590 trace.prev = tracehead; tracehead = &trace;
591 trace.file = LOCATE_mmloader;
592 variable[0] = self;
593 variable[1] = param0;
594 variable[2] = param1;
595 variable[5] = NEW_String_string___String___init(); /*new String*/
596 variable[6] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
597 variable[7] = variable[6];
598 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[7]) /*String::append*/;
599 variable[8] = ((abstractmetamodel___MMDirectory___path_t)CALL( variable[2] /*parent_dir*/,COLOR_abstractmetamodel___MMDirectory___path))( variable[2] /*parent_dir*/) /*MMDirectory::path*/;
600 variable[9] = variable[8];
601 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[9]) /*String::append*/;
602 variable[10] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
603 variable[11] = variable[10];
604 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[11]) /*String::append*/;
605 variable[12] = variable[1] /*dirname*/;
606 variable[12] = ((string___String___to_s_t)CALL(variable[12],COLOR_string___Object___to_s))(variable[12]) /*String::to_s*/;
607 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[12]) /*String::append*/;
608 variable[13] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
609 variable[14] = variable[13];
610 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[14]) /*String::append*/;
611 variable[4] = variable[5];
612 variable[5] = ((file___String___file_exists_t)CALL( variable[4] /*fname*/,COLOR_file___String___file_exists))( variable[4] /*fname*/) /*String::file_exists*/;
613 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[5])))) { /*if*/
614 variable[3] = NIT_NULL /*null*/;
615 goto return_label15;
616 }
617 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*/;
618 variable[7] = NEW_MMDirectory_abstractmetamodel___MMDirectory___init(variable[6], variable[4] /*fname*/, variable[2] /*parent_dir*/); /*new MMDirectory*/
619 variable[6] = variable[7];
620 variable[5] = variable[6];
621 variable[3] = variable[5] /*dir*/;
622 goto return_label15;
623 return_label15: while(false);
624 tracehead = trace.prev;
625 return variable[3];
626 }
627 val_t mmloader___ModuleLoader___can_handle(val_t self, val_t param0, val_t param1) {
628 struct trace_t trace = {NULL, NULL, 245, LOCATE_mmloader___ModuleLoader___can_handle};
629 val_t variable[19];
630 void **closurevariable = NULL;
631 trace.prev = tracehead; tracehead = &trace;
632 trace.file = LOCATE_mmloader;
633 variable[0] = self;
634 variable[1] = param0;
635 variable[2] = param1;
636 variable[5] = NEW_String_string___String___init(); /*new String*/
637 variable[6] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
638 variable[7] = variable[6];
639 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[7]) /*String::append*/;
640 variable[8] = ((abstractmetamodel___MMDirectory___path_t)CALL( variable[2] /*dir*/,COLOR_abstractmetamodel___MMDirectory___path))( variable[2] /*dir*/) /*MMDirectory::path*/;
641 variable[9] = variable[8];
642 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[9]) /*String::append*/;
643 variable[10] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
644 variable[11] = variable[10];
645 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[11]) /*String::append*/;
646 variable[12] = variable[1] /*module_name*/;
647 variable[12] = ((string___String___to_s_t)CALL(variable[12],COLOR_string___Object___to_s))(variable[12]) /*String::to_s*/;
648 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[12]) /*String::append*/;
649 variable[13] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
650 variable[14] = variable[13];
651 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[14]) /*String::append*/;
652 variable[15] = variable[0];
653 variable[15] = ((mmloader___ModuleLoader___file_type_t)CALL(variable[15],COLOR_mmloader___ModuleLoader___file_type))(variable[15]) /*ModuleLoader::file_type*/;
654 variable[16] = variable[15];
655 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[16]) /*String::append*/;
656 variable[17] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
657 variable[18] = variable[17];
658 ((string___String___append_t)CALL(variable[5],COLOR_abstract_collection___IndexedCollection___append))(variable[5], variable[18]) /*String::append*/;
659 variable[4] = variable[5];
660 variable[5] = ((file___String___file_exists_t)CALL( variable[4] /*fname*/,COLOR_file___String___file_exists))( variable[4] /*fname*/) /*String::file_exists*/;
661 if (UNTAG_Bool(variable[5])) { /*if*/
662 variable[3] = TAG_Bool(true);
663 goto return_label16;
664 }
665 variable[3] = TAG_Bool(false);
666 goto return_label16;
667 return_label16: while(false);
668 tracehead = trace.prev;
669 return variable[3];
670 }
671 val_t mmloader___ModuleLoader___load_and_process_module(val_t self, val_t param0, val_t param1, val_t param2) {
672 struct trace_t trace = {NULL, NULL, 254, LOCATE_mmloader___ModuleLoader___load_and_process_module};
673 val_t variable[20];
674 void **closurevariable = NULL;
675 trace.prev = tracehead; tracehead = &trace;
676 trace.file = LOCATE_mmloader;
677 variable[0] = self;
678 variable[1] = param0;
679 variable[2] = param1;
680 variable[3] = param2;
681 variable[6] = NEW_String_string___String___init(); /*new String*/
682 variable[7] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
683 variable[8] = variable[7];
684 ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[8]) /*String::append*/;
685 variable[9] = ((abstractmetamodel___MMDirectory___path_t)CALL( variable[3] /*dir*/,COLOR_abstractmetamodel___MMDirectory___path))( variable[3] /*dir*/) /*MMDirectory::path*/;
686 variable[10] = variable[9];
687 ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[10]) /*String::append*/;
688 variable[11] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
689 variable[12] = variable[11];
690 ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[12]) /*String::append*/;
691 variable[13] = variable[2] /*module_name*/;
692 variable[13] = ((string___String___to_s_t)CALL(variable[13],COLOR_string___Object___to_s))(variable[13]) /*String::to_s*/;
693 ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[13]) /*String::append*/;
694 variable[14] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
695 variable[15] = variable[14];
696 ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[15]) /*String::append*/;
697 variable[16] = variable[0];
698 variable[16] = ((mmloader___ModuleLoader___file_type_t)CALL(variable[16],COLOR_mmloader___ModuleLoader___file_type))(variable[16]) /*ModuleLoader::file_type*/;
699 variable[17] = variable[16];
700 ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[17]) /*String::append*/;
701 variable[18] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
702 variable[19] = variable[18];
703 ((string___String___append_t)CALL(variable[6],COLOR_abstract_collection___IndexedCollection___append))(variable[6], variable[19]) /*String::append*/;
704 variable[5] = variable[6];
705 variable[7] = variable[0];
706 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*/;
707 variable[6] = variable[7];
708 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*/;
709 variable[7] = ((opts___Option___value_t)CALL(variable[7],COLOR_opts___Option___value))(variable[7]) /*Option::value*/;
710 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[7])))) { /*if*/
711 variable[7] = variable[0];
712 ((mmloader___ModuleLoader___process_metamodel_t)CALL(variable[7],COLOR_mmloader___ModuleLoader___process_metamodel))(variable[7], variable[1] /*context*/, variable[6] /*m*/) /*ModuleLoader::process_metamodel*/;
713 }
714 variable[4] = variable[6] /*m*/;
715 goto return_label17;
716 return_label17: while(false);
717 tracehead = trace.prev;
718 return variable[4];
719 }
720 val_t mmloader___ModuleLoader___load_module(val_t self, val_t param0, val_t param1, val_t param2, val_t param3) {
721 struct trace_t trace = {NULL, NULL, 264, LOCATE_mmloader___ModuleLoader___load_module};
722 val_t variable[13];
723 void **closurevariable = NULL;
724 trace.prev = tracehead; tracehead = &trace;
725 trace.file = LOCATE_mmloader;
726 variable[0] = self;
727 variable[1] = param0;
728 variable[2] = param1;
729 variable[3] = param2;
730 variable[4] = param3;
731 /*variable[6] is variable file*/
732 variable[7] = NEW_String_string___String___with_native(BOX_NativeString("-"), TAG_Int(1)); /*new String*/
733 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::==*/)));
734 if (UNTAG_Bool(variable[7])) { /*if*/
735 variable[7] = variable[0];
736 variable[7] = ((file___Object___stdin_t)CALL(variable[7],COLOR_file___Object___stdin))(variable[7]) /*Object::stdin*/;
737 variable[6] = variable[7] /*file=*/;
738 } else { /*if*/
739 variable[7] = ((string___String___to_s_t)CALL( variable[4] /*filename*/,COLOR_string___Object___to_s))( variable[4] /*filename*/) /*String::to_s*/;
740 variable[8] = NEW_IFStream_file___IFStream___open(variable[7]); /*new IFStream*/
741 variable[7] = variable[8];
742 variable[6] = variable[7] /*file=*/;
743 }
744 variable[7] = ((stream___BufferedIStream___eof_t)CALL( variable[6] /*file*/,COLOR_stream___IStream___eof))( variable[6] /*file*/) /*BufferedIStream::eof*/;
745 if (UNTAG_Bool(variable[7])) { /*if*/
746 variable[7] = NEW_String_string___String___init(); /*new String*/
747 variable[8] = NEW_String_string___String___with_native(BOX_NativeString("Error: Problem in opening file "), TAG_Int(31)); /*new String*/
748 variable[9] = variable[8];
749 ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[9]) /*String::append*/;
750 variable[10] = variable[4] /*filename*/;
751 ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[10]) /*String::append*/;
752 variable[11] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
753 variable[12] = variable[11];
754 ((string___String___append_t)CALL(variable[7],COLOR_abstract_collection___IndexedCollection___append))(variable[7], variable[12]) /*String::append*/;
755 ((mmloader___ToolContext___error_t)CALL( variable[1] /*context*/,COLOR_mmloader___ToolContext___error))( variable[1] /*context*/, variable[7]) /*ToolContext::error*/;
756 variable[7] = variable[0];
757 exit(UNTAG_Int( TAG_Int(1)));
758 fprintf(stderr, "Aborted"); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_mmloader___ModuleLoader___load_module, LOCATE_mmloader, 277); nit_exit(1);
759 }
760 variable[8] = variable[0];
761 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*/;
762 variable[7] = variable[8];
763 ((mmloader___MMModule___filename__eq_t)CALL( variable[7] /*m*/,COLOR_mmloader___MMModule___filename__eq))( variable[7] /*m*/, variable[4] /*filename*/) /*MMModule::filename=*/;
764 variable[8] = variable[0];
765 variable[8] = ((file___Object___stdin_t)CALL(variable[8],COLOR_file___Object___stdin))(variable[8]) /*Object::stdin*/;
766 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::==*/)))))));
767 if (UNTAG_Bool(variable[8])) { /*if*/
768 ((file___IFStream___close_t)CALL( variable[6] /*file*/,COLOR_stream___IOS___close))( variable[6] /*file*/) /*IFStream::close*/;
769 }
770 variable[5] = variable[7] /*m*/;
771 goto return_label18;
772 return_label18: while(false);
773 tracehead = trace.prev;
774 return variable[5];
775 }
776 val_t mmloader___ModuleLoader___parse_file(val_t self, val_t param0, val_t param1, val_t param2, val_t param3, val_t param4) {
777 struct trace_t trace = {NULL, NULL, 285, LOCATE_mmloader___ModuleLoader___parse_file};
778 val_t *variable = NULL;
779 void **closurevariable = NULL;
780 trace.prev = tracehead; tracehead = &trace;
781 trace.file = LOCATE_mmloader;
782 fprintf(stderr, "Deferred method called");
783 fprintf(stderr, " (%s:%d)\n", LOCATE_mmloader, 285);
784 nit_exit(1);
785 tracehead = trace.prev;
786 return NIT_NULL;
787 }
788 void mmloader___ModuleLoader___process_metamodel(val_t self, val_t param0, val_t param1) {
789 struct trace_t trace = {NULL, NULL, 288, LOCATE_mmloader___ModuleLoader___process_metamodel};
790 val_t *variable = NULL;
791 void **closurevariable = NULL;
792 trace.prev = tracehead; tracehead = &trace;
793 trace.file = LOCATE_mmloader;
794 fprintf(stderr, "Deferred method called");
795 fprintf(stderr, " (%s:%d)\n", LOCATE_mmloader, 288);
796 nit_exit(1);
797 tracehead = trace.prev;
798 return;
799 }
800 void mmloader___ModuleLoader___init(val_t self, int* init_table) {
801 struct trace_t trace = {NULL, NULL, 0, LOCATE_mmloader___ModuleLoader___init};
802 val_t *variable = NULL;
803 void **closurevariable = NULL;
804 trace.prev = tracehead; tracehead = &trace;
805 trace.file = LOCATE_mmloader;
806 tracehead = trace.prev;
807 return;
808 }
809 val_t mmloader___MMModule___filename(val_t self) {
810 struct trace_t trace = {NULL, NULL, 293, LOCATE_mmloader___MMModule___filename};
811 val_t *variable = NULL;
812 void **closurevariable = NULL;
813 trace.prev = tracehead; tracehead = &trace;
814 trace.file = LOCATE_mmloader;
815 tracehead = trace.prev;
816 return ATTR_mmloader___MMModule____filename( self) /*MMModule::_filename*/;
817 }
818 void mmloader___MMModule___filename__eq(val_t self, val_t param0) {
819 struct trace_t trace = {NULL, NULL, 293, LOCATE_mmloader___MMModule___filename__eq};
820 val_t *variable = NULL;
821 void **closurevariable = NULL;
822 trace.prev = tracehead; tracehead = &trace;
823 trace.file = LOCATE_mmloader;
824 ATTR_mmloader___MMModule____filename( self) /*MMModule::_filename*/ = param0;
825 tracehead = trace.prev;
826 return;
827 }
828 val_t mmloader___MMModule___mtime(val_t self) {
829 struct trace_t trace = {NULL, NULL, 296, LOCATE_mmloader___MMModule___mtime};
830 val_t *variable = NULL;
831 void **closurevariable = NULL;
832 trace.prev = tracehead; tracehead = &trace;
833 trace.file = LOCATE_mmloader;
834 tracehead = trace.prev;
835 return ATTR_mmloader___MMModule____mtime( self) /*MMModule::_mtime*/;
836 }
837 void mmloader___MMModule___mtime__eq(val_t self, val_t param0) {
838 struct trace_t trace = {NULL, NULL, 296, LOCATE_mmloader___MMModule___mtime__eq};
839 val_t *variable = NULL;
840 void **closurevariable = NULL;
841 trace.prev = tracehead; tracehead = &trace;
842 trace.file = LOCATE_mmloader;
843 ATTR_mmloader___MMModule____mtime( self) /*MMModule::_mtime*/ = param0;
844 tracehead = trace.prev;
845 return;
846 }
847 void mmloader___MMModule___import_supers_modules(val_t self, val_t param0) {
848 struct trace_t trace = {NULL, NULL, 299, LOCATE_mmloader___MMModule___import_supers_modules};
849 val_t variable[10];
850 void **closurevariable = NULL;
851 trace.prev = tracehead; tracehead = &trace;
852 trace.file = LOCATE_mmloader;
853 variable[0] = self;
854 variable[1] = param0;
855 variable[4] = variable[0];
856 variable[4] = ((abstractmetamodel___MMModule___context_t)CALL(variable[4],COLOR_abstractmetamodel___MMModule___context))(variable[4]) /*MMModule::context*/;
857 variable[3] = variable[4];
858 variable[4] = TAG_Bool(( variable[3] /*c*/==NIT_NULL) || VAL_ISA( variable[3] /*c*/, COLOR_ToolContext, ID_ToolContext)) /*cast ToolContext*/;
859 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);}
860 variable[5] = NEW_Array_array___Array___init(); /*new Array[MMModule]*/
861 variable[4] = variable[5];
862 variable[5] = ((abstract_collection___Collection___iterator_t)CALL( variable[1] /*names*/,COLOR_abstract_collection___Collection___iterator))( variable[1] /*names*/) /*Collection::iterator*/;
863 while (true) { /*for*/
864 variable[6] = ((abstract_collection___Iterator___is_ok_t)CALL(variable[5],COLOR_abstract_collection___Iterator___is_ok))(variable[5]) /*Iterator::is_ok*/;
865 if (!UNTAG_Bool(variable[6])) break; /*for*/
866 variable[6] = ((abstract_collection___Iterator___item_t)CALL(variable[5],COLOR_abstract_collection___Iterator___item))(variable[5]) /*Iterator::item*/;
867 variable[7] = variable[6];
868 variable[9] = variable[0];
869 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*/;
870 variable[8] = variable[9];
871 ((array___AbstractArray___add_t)CALL( variable[4] /*supers*/,COLOR_abstract_collection___SimpleCollection___add))( variable[4] /*supers*/, variable[8] /*m*/) /*AbstractArray::add*/;
872 continue_20: while(0);
873 ((abstract_collection___Iterator___next_t)CALL(variable[5],COLOR_abstract_collection___Iterator___next))(variable[5]) /*Iterator::next*/;
874 }
875 break_20: while(0);
876 variable[5] = variable[0];
877 ((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*/;
878 return_label19: while(false);
879 tracehead = trace.prev;
880 return;
881 }