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