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 struct WBT_
**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*/;
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 struct WBT_
**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*/;
21 void mmloader___ToolContext___error(val_t self
, val_t param0
) {
22 struct trace_t trace
= {NULL
, NULL
, 33, LOCATE_mmloader___ToolContext___error
};
23 static val_t once_value_1
= NIT_NULL
; /* Once value for string variable[5]*/
24 static val_t once_value_2
= NIT_NULL
; /* Once value for string variable[5]*/
26 struct WBT_
**closurevariable
= NULL
;
27 trace
.prev
= tracehead
; tracehead
= &trace
;
28 trace
.file
= LOCATE_mmloader
;
29 /* Register variable[0]: Local variable */
31 /* Register variable[1]: Local variable */
33 /* Register variable[2]: Method return value and escape marker */
34 /* Register variable[3]: Result */
35 variable
[3] = CALL_file___Object___stderr(variable
[0])(variable
[0]) /*Object::stderr*/;
36 variable
[4] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
37 /* Register variable[5]: Once String constant */
38 if (once_value_1
!= NIT_NULL
) variable
[5] = once_value_1
;
40 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
41 once_value_1
= variable
[5];
43 /* Register variable[5]: Result */
44 /* Ensure var variable[5]: super-string element*/
45 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
46 variable
[5] = variable
[1] /*s*/ /* Ensure var: super-string element*/;
47 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
48 /* Register variable[5]: Once String constant */
49 if (once_value_2
!= NIT_NULL
) variable
[5] = once_value_2
;
51 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)) /*new String*/;
52 once_value_2
= variable
[5];
54 /* Register variable[5]: Result */
55 /* Ensure var variable[5]: super-string element*/
56 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
57 /* Register variable[4]: Result */
58 variable
[4] = CALL_string___Object___to_s(variable
[4])(variable
[4]) /*Object::to_s*/;
59 CALL_stream___OStream___write(variable
[3])(variable
[3], variable
[4]) /*OFStream::write*/;
60 /* Register variable[3]: Result */
61 variable
[3] = ATTR_mmloader___ToolContext____error_count(variable
[0]) /*ToolContext::_error_count*/;
62 /* Register variable[3]: Result */
63 variable
[3] = TAG_Int(UNTAG_Int(variable
[3])+UNTAG_Int( TAG_Int(1)));
64 ATTR_mmloader___ToolContext____error_count(variable
[0]) /*ToolContext::_error_count*/ = variable
[3];
65 return_label0
: while(false);
66 tracehead
= trace
.prev
;
69 void mmloader___ToolContext___warning(val_t self
, val_t param0
) {
70 struct trace_t trace
= {NULL
, NULL
, 40, LOCATE_mmloader___ToolContext___warning
};
71 static val_t once_value_4
= NIT_NULL
; /* Once value for string variable[5]*/
72 static val_t once_value_5
= NIT_NULL
; /* Once value for string variable[5]*/
74 struct WBT_
**closurevariable
= NULL
;
75 trace
.prev
= tracehead
; tracehead
= &trace
;
76 trace
.file
= LOCATE_mmloader
;
77 /* Register variable[0]: Local variable */
79 /* Register variable[1]: Local variable */
81 /* Register variable[2]: Method return value and escape marker */
82 /* Register variable[3]: Result */
83 variable
[3] = ATTR_mmloader___ToolContext____opt_warn(variable
[0]) /*ToolContext::_opt_warn*/;
84 /* Register variable[3]: Result */
85 variable
[3] = CALL_opts___Option___value(variable
[3])(variable
[3]) /*Option::value*/;
86 /* Register variable[3]: Result */
87 variable
[3] = TAG_Bool((variable
[3])==( TAG_Int(0)));
88 if (UNTAG_Bool(variable
[3])) { /*if*/
91 /* Register variable[3]: Result */
92 variable
[3] = CALL_file___Object___stderr(variable
[0])(variable
[0]) /*Object::stderr*/;
93 variable
[4] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
94 /* Register variable[5]: Once String constant */
95 if (once_value_4
!= NIT_NULL
) variable
[5] = once_value_4
;
97 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
98 once_value_4
= variable
[5];
100 /* Register variable[5]: Result */
101 /* Ensure var variable[5]: super-string element*/
102 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
103 variable
[5] = variable
[1] /*s*/ /* Ensure var: super-string element*/;
104 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
105 /* Register variable[5]: Once String constant */
106 if (once_value_5
!= NIT_NULL
) variable
[5] = once_value_5
;
108 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)) /*new String*/;
109 once_value_5
= variable
[5];
111 /* Register variable[5]: Result */
112 /* Ensure var variable[5]: super-string element*/
113 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
114 /* Register variable[4]: Result */
115 variable
[4] = CALL_string___Object___to_s(variable
[4])(variable
[4]) /*Object::to_s*/;
116 CALL_stream___OStream___write(variable
[3])(variable
[3], variable
[4]) /*OFStream::write*/;
117 /* Register variable[3]: Result */
118 variable
[3] = ATTR_mmloader___ToolContext____opt_warn(variable
[0]) /*ToolContext::_opt_warn*/;
119 /* Register variable[3]: Result */
120 variable
[3] = CALL_opts___Option___value(variable
[3])(variable
[3]) /*Option::value*/;
121 /* Register variable[3]: Result */
122 variable
[3] = TAG_Bool((variable
[3])==( TAG_Int(1)));
123 if (UNTAG_Bool(variable
[3])) { /*if*/
124 /* Register variable[3]: Result */
125 variable
[3] = ATTR_mmloader___ToolContext____warning_count(variable
[0]) /*ToolContext::_warning_count*/;
126 /* Register variable[3]: Result */
127 variable
[3] = TAG_Int(UNTAG_Int(variable
[3])+UNTAG_Int( TAG_Int(1)));
128 ATTR_mmloader___ToolContext____warning_count(variable
[0]) /*ToolContext::_warning_count*/ = variable
[3];
130 /* Register variable[3]: Result */
131 variable
[3] = ATTR_mmloader___ToolContext____error_count(variable
[0]) /*ToolContext::_error_count*/;
132 /* Register variable[3]: Result */
133 variable
[3] = TAG_Int(UNTAG_Int(variable
[3])+UNTAG_Int( TAG_Int(1)));
134 ATTR_mmloader___ToolContext____error_count(variable
[0]) /*ToolContext::_error_count*/ = variable
[3];
136 return_label3
: while(false);
137 tracehead
= trace
.prev
;
140 val_t
mmloader___ToolContext___paths(val_t self
) {
141 struct trace_t trace
= {NULL
, NULL
, 52, LOCATE_mmloader___ToolContext___paths
};
142 val_t
*variable
= NULL
;
143 struct WBT_
**closurevariable
= NULL
;
144 trace
.prev
= tracehead
; tracehead
= &trace
;
145 trace
.file
= LOCATE_mmloader
;
146 tracehead
= trace
.prev
;
147 return ATTR_mmloader___ToolContext____paths( self
) /*ToolContext::_paths*/;
149 val_t
mmloader___ToolContext___option_context(val_t self
) {
150 struct trace_t trace
= {NULL
, NULL
, 58, LOCATE_mmloader___ToolContext___option_context
};
151 val_t
*variable
= NULL
;
152 struct WBT_
**closurevariable
= NULL
;
153 trace
.prev
= tracehead
; tracehead
= &trace
;
154 trace
.file
= LOCATE_mmloader
;
155 tracehead
= trace
.prev
;
156 return ATTR_mmloader___ToolContext____option_context( self
) /*ToolContext::_option_context*/;
158 val_t
mmloader___ToolContext___opt_warn(val_t self
) {
159 struct trace_t trace
= {NULL
, NULL
, 61, LOCATE_mmloader___ToolContext___opt_warn
};
160 val_t
*variable
= NULL
;
161 struct WBT_
**closurevariable
= NULL
;
162 trace
.prev
= tracehead
; tracehead
= &trace
;
163 trace
.file
= LOCATE_mmloader
;
164 tracehead
= trace
.prev
;
165 return ATTR_mmloader___ToolContext____opt_warn( self
) /*ToolContext::_opt_warn*/;
167 val_t
mmloader___ToolContext___opt_path(val_t self
) {
168 struct trace_t trace
= {NULL
, NULL
, 64, LOCATE_mmloader___ToolContext___opt_path
};
169 val_t
*variable
= NULL
;
170 struct WBT_
**closurevariable
= NULL
;
171 trace
.prev
= tracehead
; tracehead
= &trace
;
172 trace
.file
= LOCATE_mmloader
;
173 tracehead
= trace
.prev
;
174 return ATTR_mmloader___ToolContext____opt_path( self
) /*ToolContext::_opt_path*/;
176 val_t
mmloader___ToolContext___opt_log(val_t self
) {
177 struct trace_t trace
= {NULL
, NULL
, 67, LOCATE_mmloader___ToolContext___opt_log
};
178 val_t
*variable
= NULL
;
179 struct WBT_
**closurevariable
= NULL
;
180 trace
.prev
= tracehead
; tracehead
= &trace
;
181 trace
.file
= LOCATE_mmloader
;
182 tracehead
= trace
.prev
;
183 return ATTR_mmloader___ToolContext____opt_log( self
) /*ToolContext::_opt_log*/;
185 val_t
mmloader___ToolContext___opt_only_metamodel(val_t self
) {
186 struct trace_t trace
= {NULL
, NULL
, 70, LOCATE_mmloader___ToolContext___opt_only_metamodel
};
187 val_t
*variable
= NULL
;
188 struct WBT_
**closurevariable
= NULL
;
189 trace
.prev
= tracehead
; tracehead
= &trace
;
190 trace
.file
= LOCATE_mmloader
;
191 tracehead
= trace
.prev
;
192 return ATTR_mmloader___ToolContext____opt_only_metamodel( self
) /*ToolContext::_opt_only_metamodel*/;
194 val_t
mmloader___ToolContext___opt_only_parse(val_t self
) {
195 struct trace_t trace
= {NULL
, NULL
, 73, LOCATE_mmloader___ToolContext___opt_only_parse
};
196 val_t
*variable
= NULL
;
197 struct WBT_
**closurevariable
= NULL
;
198 trace
.prev
= tracehead
; tracehead
= &trace
;
199 trace
.file
= LOCATE_mmloader
;
200 tracehead
= trace
.prev
;
201 return ATTR_mmloader___ToolContext____opt_only_parse( self
) /*ToolContext::_opt_only_parse*/;
203 val_t
mmloader___ToolContext___opt_help(val_t self
) {
204 struct trace_t trace
= {NULL
, NULL
, 76, LOCATE_mmloader___ToolContext___opt_help
};
205 val_t
*variable
= NULL
;
206 struct WBT_
**closurevariable
= NULL
;
207 trace
.prev
= tracehead
; tracehead
= &trace
;
208 trace
.file
= LOCATE_mmloader
;
209 tracehead
= trace
.prev
;
210 return ATTR_mmloader___ToolContext____opt_help( self
) /*ToolContext::_opt_help*/;
212 void mmloader___ToolContext___init(val_t self
, int* init_table
) {
213 struct trace_t trace
= {NULL
, NULL
, 79, LOCATE_mmloader___ToolContext___init
};
215 struct WBT_
**closurevariable
= NULL
;
216 trace
.prev
= tracehead
; tracehead
= &trace
;
217 trace
.file
= LOCATE_mmloader
;
218 /* Register variable[0]: Local variable */
220 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_ToolContext
].i
]) return;
221 /* Register variable[1]: Method return value and escape marker */
222 CALL_abstractmetamodel___MMContext___init(variable
[0])(variable
[0], init_table
/*YYY*/) /*MMContext::init*/;
223 /* Register variable[2]: Result */
224 variable
[2] = CALL_mmloader___ToolContext___option_context(variable
[0])(variable
[0]) /*ToolContext::option_context*/;
225 variable
[3] = NEW_Array_array___Array___with_capacity(TAG_Int(6)) /*new Array[Option]*/ /* Ensure var: Literal array*/;
226 /* Register variable[4]: Result */
227 variable
[4] = CALL_mmloader___ToolContext___opt_warn(variable
[0])(variable
[0]) /*ToolContext::opt_warn*/;
228 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[4]) /*AbstractArray::add*/;
229 /* Register variable[5]: Result */
230 variable
[5] = CALL_mmloader___ToolContext___opt_path(variable
[0])(variable
[0]) /*ToolContext::opt_path*/;
231 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[5]) /*AbstractArray::add*/;
232 /* Register variable[6]: Result */
233 variable
[6] = CALL_mmloader___ToolContext___opt_log(variable
[0])(variable
[0]) /*ToolContext::opt_log*/;
234 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[6]) /*AbstractArray::add*/;
235 /* Register variable[7]: Result */
236 variable
[7] = CALL_mmloader___ToolContext___opt_only_parse(variable
[0])(variable
[0]) /*ToolContext::opt_only_parse*/;
237 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[7]) /*AbstractArray::add*/;
238 /* Register variable[8]: Result */
239 variable
[8] = CALL_mmloader___ToolContext___opt_only_metamodel(variable
[0])(variable
[0]) /*ToolContext::opt_only_metamodel*/;
240 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[8]) /*AbstractArray::add*/;
241 /* Register variable[9]: Result */
242 variable
[9] = CALL_mmloader___ToolContext___opt_help(variable
[0])(variable
[0]) /*ToolContext::opt_help*/;
243 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[9]) /*AbstractArray::add*/;
244 /* Register variable[3]: Result */
245 CALL_opts___OptionContext___add_option(variable
[2])(variable
[2], variable
[3]) /*OptionContext::add_option*/;
246 return_label6
: while(false);
247 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_ToolContext
].i
] = 1;
248 tracehead
= trace
.prev
;
251 void mmloader___ToolContext___process_options(val_t self
) {
252 struct trace_t trace
= {NULL
, NULL
, 85, LOCATE_mmloader___ToolContext___process_options
};
253 static val_t once_value_8
; static int once_bool_8
; /* Once value for variable[3]*/
254 static val_t once_value_9
= NIT_NULL
; /* Once value for string variable[3]*/
255 static val_t once_value_10
; static int once_bool_10
; /* Once value for variable[3]*/
256 static val_t once_value_11
= NIT_NULL
; /* Once value for string variable[3]*/
257 static val_t once_value_12
= NIT_NULL
; /* Once value for string variable[5]*/
258 static val_t once_value_13
= NIT_NULL
; /* Once value for string variable[5]*/
259 static val_t once_value_14
= NIT_NULL
; /* Once value for string variable[5]*/
260 static val_t once_value_15
= NIT_NULL
; /* Once value for string variable[5]*/
262 struct WBT_
**closurevariable
= NULL
;
263 trace
.prev
= tracehead
; tracehead
= &trace
;
264 trace
.file
= LOCATE_mmloader
;
265 /* Register variable[0]: Local variable */
267 /* Register variable[1]: Method return value and escape marker */
268 /* Register variable[2]: Result */
269 variable
[2] = CALL_mmloader___ToolContext___option_context(variable
[0])(variable
[0]) /*ToolContext::option_context*/;
270 /* Register variable[3]: Result */
271 variable
[3] = CALL_string___Object___args(variable
[0])(variable
[0]) /*Object::args*/;
272 CALL_opts___OptionContext___parse(variable
[2])(variable
[2], variable
[3]) /*OptionContext::parse*/;
273 /* Register variable[2]: Result */
274 variable
[2] = NEW_Array_array___Array___init() /*new Array[String]*/;
275 ATTR_mmloader___ToolContext____paths(variable
[0]) /*ToolContext::_paths*/ = variable
[2];
276 /* Register variable[2]: Result */
277 variable
[2] = CALL_mmloader___ToolContext___paths(variable
[0])(variable
[0]) /*ToolContext::paths*/;
278 /* Register variable[3]: Result */
279 variable
[3] = CALL_mmloader___ToolContext___opt_path(variable
[0])(variable
[0]) /*ToolContext::opt_path*/;
280 /* Register variable[3]: Result */
281 variable
[3] = CALL_opts___Option___value(variable
[3])(variable
[3]) /*Option::value*/;
282 CALL_abstract_collection___IndexedCollection___append(variable
[2])(variable
[2], variable
[3]) /*IndexedCollection::append*/;
283 /* Register variable[2]: Local variable */
284 /* Register variable[3]: Once expression result */
285 if (once_bool_8
) variable
[3] = once_value_8
;
287 /* Register variable[3]: Once String constant */
288 if (once_value_9
!= NIT_NULL
) variable
[3] = once_value_9
;
290 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("NIT_PATH"), TAG_Int(8)) /*new String*/;
291 once_value_9
= variable
[3];
293 /* Register variable[3]: Result */
294 /* Register variable[3]: Result */
295 variable
[3] = CALL_symbol___String___to_symbol(variable
[3])(variable
[3]) /*String::to_symbol*/;
296 /* Register variable[3]: Result */
297 variable
[3] = CALL_environ___Symbol___environ(variable
[3])(variable
[3]) /*Symbol::environ*/;
298 once_value_8
= variable
[3];
301 /* Register variable[3]: Result */
302 variable
[2] = variable
[3];
303 /* Register variable[3]: Result */
304 variable
[3] = CALL_abstract_collection___Collection___is_empty( variable
[2] /*path_env*/)( variable
[2] /*path_env*/) /*AbstractArrayRead::is_empty*/;
305 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable
[3])))) { /*if*/
306 /* Register variable[3]: Result */
307 variable
[3] = CALL_mmloader___ToolContext___paths(variable
[0])(variable
[0]) /*ToolContext::paths*/;
308 /* Register variable[4]: Result */
309 variable
[4] = CALL_string_search___String___split_with( variable
[2] /*path_env*/)( variable
[2] /*path_env*/, TAG_Char(':')) /*String::split_with*/;
310 CALL_abstract_collection___IndexedCollection___append(variable
[3])(variable
[3], variable
[4]) /*IndexedCollection::append*/;
312 /* Register variable[3]: Once expression result */
313 if (once_bool_10
) variable
[3] = once_value_10
;
315 /* Register variable[3]: Once String constant */
316 if (once_value_11
!= NIT_NULL
) variable
[3] = once_value_11
;
318 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)) /*new String*/;
319 once_value_11
= variable
[3];
321 /* Register variable[3]: Result */
322 /* Register variable[3]: Result */
323 variable
[3] = CALL_symbol___String___to_symbol(variable
[3])(variable
[3]) /*String::to_symbol*/;
324 /* Register variable[3]: Result */
325 variable
[3] = CALL_environ___Symbol___environ(variable
[3])(variable
[3]) /*Symbol::environ*/;
326 once_value_10
= variable
[3];
329 /* Register variable[3]: Result */
330 variable
[2] = variable
[3] /*path_env=*/;
331 /* Register variable[3]: Result */
332 variable
[3] = CALL_abstract_collection___Collection___is_empty( variable
[2] /*path_env*/)( variable
[2] /*path_env*/) /*AbstractArrayRead::is_empty*/;
333 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable
[3])))) { /*if*/
334 /* Register variable[3]: Local variable */
335 variable
[4] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
336 /* Register variable[5]: Once String constant */
337 if (once_value_12
!= NIT_NULL
) variable
[5] = once_value_12
;
339 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
340 once_value_12
= variable
[5];
342 /* Register variable[5]: Result */
343 /* Ensure var variable[5]: super-string element*/
344 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
345 variable
[5] = variable
[2] /*path_env*/ /* Ensure var: super-string element*/;
346 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
347 /* Register variable[5]: Once String constant */
348 if (once_value_13
!= NIT_NULL
) variable
[5] = once_value_13
;
350 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString("/lib"), TAG_Int(4)) /*new String*/;
351 once_value_13
= variable
[5];
353 /* Register variable[5]: Result */
354 /* Ensure var variable[5]: super-string element*/
355 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
356 /* Register variable[4]: Result */
357 variable
[4] = CALL_string___Object___to_s(variable
[4])(variable
[4]) /*Object::to_s*/;
358 variable
[3] = variable
[4];
359 /* Register variable[4]: Result */
360 variable
[4] = CALL_file___String___file_exists( variable
[3] /*libname*/)( variable
[3] /*libname*/) /*String::file_exists*/;
361 if (UNTAG_Bool(variable
[4])) { /*if*/
362 /* Register variable[4]: Result */
363 variable
[4] = CALL_mmloader___ToolContext___paths(variable
[0])(variable
[0]) /*ToolContext::paths*/;
364 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[3] /*libname*/) /*AbstractArray::add*/;
367 /* Register variable[3]: Local variable */
368 variable
[4] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
369 /* Register variable[5]: Once String constant */
370 if (once_value_14
!= NIT_NULL
) variable
[5] = once_value_14
;
372 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
373 once_value_14
= variable
[5];
375 /* Register variable[5]: Result */
376 /* Ensure var variable[5]: super-string element*/
377 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
378 /* Register variable[5]: Result */
379 variable
[5] = (G_sys
);
380 /* Register variable[5]: Result */
381 variable
[5] = CALL_string___Sys___program_name(variable
[5])(variable
[5]) /*Sys::program_name*/;
382 /* Register variable[5]: Result */
383 variable
[5] = CALL_file___String___dirname(variable
[5])(variable
[5]) /*String::dirname*/;
384 /* Ensure var variable[5]: super-string element*/
385 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
386 /* Register variable[5]: Once String constant */
387 if (once_value_15
!= NIT_NULL
) variable
[5] = once_value_15
;
389 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString("/../lib"), TAG_Int(7)) /*new String*/;
390 once_value_15
= variable
[5];
392 /* Register variable[5]: Result */
393 /* Ensure var variable[5]: super-string element*/
394 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[5]) /*AbstractArray::add*/;
395 /* Register variable[4]: Result */
396 variable
[4] = CALL_string___Object___to_s(variable
[4])(variable
[4]) /*Object::to_s*/;
397 variable
[3] = variable
[4];
398 /* Register variable[4]: Result */
399 variable
[4] = CALL_file___String___file_exists( variable
[3] /*libname*/)( variable
[3] /*libname*/) /*String::file_exists*/;
400 if (UNTAG_Bool(variable
[4])) { /*if*/
401 /* Register variable[4]: Result */
402 variable
[4] = CALL_mmloader___ToolContext___paths(variable
[0])(variable
[0]) /*ToolContext::paths*/;
403 CALL_abstract_collection___SimpleCollection___add(variable
[4])(variable
[4], variable
[3] /*libname*/) /*AbstractArray::add*/;
405 return_label7
: while(false);
406 tracehead
= trace
.prev
;
409 val_t
mmloader___ToolContext___try_to_load(val_t self
, val_t param0
, val_t param1
) {
410 struct trace_t trace
= {NULL
, NULL
, 110, LOCATE_mmloader___ToolContext___try_to_load
};
411 static val_t once_value_19
= NIT_NULL
; /* Once value for string variable[10]*/
412 static val_t once_value_20
= NIT_NULL
; /* Once value for string variable[10]*/
414 struct WBT_
**closurevariable
= NULL
;
415 trace
.prev
= tracehead
; tracehead
= &trace
;
416 trace
.file
= LOCATE_mmloader
;
417 /* Register variable[0]: Local variable */
419 /* Register variable[1]: Local variable */
420 variable
[1] = param0
;
421 /* Register variable[2]: Local variable */
422 variable
[2] = param1
;
423 /* Register variable[3]: Method return value and escape marker */
424 /* Register variable[4]: Result */
425 variable
[4] = CALL_abstractmetamodel___MMDirectory___modules( variable
[2] /*dir*/)( variable
[2] /*dir*/) /*MMDirectory::modules*/;
426 /* Register variable[4]: For iterator */
427 variable
[4] = CALL_abstract_collection___Collection___iterator(variable
[4])(variable
[4]) /*MapRead::iterator*/;
428 while (true) { /*for*/
429 /* Register variable[5]: For 'is_ok' result */
430 variable
[5] = CALL_abstract_collection___Iterator___is_ok(variable
[4])(variable
[4]) /*Iterator::is_ok*/;
431 if (!UNTAG_Bool(variable
[5])) break; /*for*/
432 variable
[5] = CALL_abstract_collection___Iterator___item(variable
[4])(variable
[4]) /*Iterator::item*/ /* Ensure var: For item*/;
433 /* Register variable[6]: Local variable */
434 variable
[6] = variable
[5];
435 /* Register variable[7]: Result */
436 variable
[7] = CALL_abstractmetamodel___MMModule___name( variable
[6] /*m*/)( variable
[6] /*m*/) /*MMModule::name*/;
437 /* Register variable[7]: Result */
438 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::==*/)))));
439 if (UNTAG_Bool(variable
[7])) { /*if*/
440 variable
[3] = variable
[6] /*m*/;
443 continue_17
: while(0);
444 CALL_abstract_collection___Iterator___next(variable
[4])(variable
[4]) /*Iterator::next*/;
447 /* Register variable[4]: Result */
448 variable
[4] = ATTR_mmloader___ToolContext____loaders(variable
[0]) /*ToolContext::_loaders*/;
449 /* Register variable[4]: For iterator */
450 variable
[4] = CALL_abstract_collection___Collection___iterator(variable
[4])(variable
[4]) /*AbstractArrayRead::iterator*/;
451 while (true) { /*for*/
452 /* Register variable[5]: For 'is_ok' result */
453 variable
[5] = CALL_abstract_collection___Iterator___is_ok(variable
[4])(variable
[4]) /*ArrayIterator::is_ok*/;
454 if (!UNTAG_Bool(variable
[5])) break; /*for*/
455 variable
[5] = CALL_abstract_collection___Iterator___item(variable
[4])(variable
[4]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
456 /* Register variable[6]: Local variable */
457 variable
[6] = variable
[5];
458 /* Register variable[7]: Local variable */
459 /* Register variable[8]: Result */
460 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*/;
461 variable
[7] = variable
[8];
462 /* Register variable[8]: Result */
463 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::==*/)))))));
464 if (UNTAG_Bool(variable
[8])) { /*if*/
465 /* Register variable[8]: Local variable */
466 /* Register variable[9]: Result */
467 variable
[9] = CALL_mmloader___ToolContext___try_to_load(variable
[0])(variable
[0], variable
[1] /*module_name*/, variable
[7] /*dir2*/) /*ToolContext::try_to_load*/;
468 variable
[8] = variable
[9];
469 /* Register variable[9]: Result */
470 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::==*/)))))));
471 if (UNTAG_Bool(variable
[9])) { /*if*/
472 CALL_abstractmetamodel___MMDirectory___owner__eq( variable
[7] /*dir2*/)( variable
[7] /*dir2*/, variable
[8] /*m*/) /*MMDirectory::owner=*/;
473 CALL_abstractmetamodel___MMDirectory___add_module( variable
[2] /*dir*/)( variable
[2] /*dir*/, variable
[8] /*m*/) /*MMDirectory::add_module*/;
474 variable
[3] = variable
[8] /*m*/;
478 /* Register variable[8]: Result */
479 variable
[8] = CALL_mmloader___ModuleLoader___can_handle( variable
[6] /*l*/)( variable
[6] /*l*/, variable
[1] /*module_name*/, variable
[2] /*dir*/) /*ModuleLoader::can_handle*/;
480 if (UNTAG_Bool(variable
[8])) { /*if*/
481 /* Register variable[8]: Local variable */
482 /* Register variable[9]: Result */
483 variable
[9] = CALL_abstractmetamodel___MMDirectory___full_name_for( variable
[2] /*dir*/)( variable
[2] /*dir*/, variable
[1] /*module_name*/) /*MMDirectory::full_name_for*/;
484 variable
[8] = variable
[9];
485 /* Register variable[9]: Result */
486 variable
[9] = ATTR_mmloader___ToolContext____processing_modules(variable
[0]) /*ToolContext::_processing_modules*/;
487 /* Register variable[9]: Result */
488 variable
[9] = CALL_abstract_collection___Collection___has(variable
[9])(variable
[9], variable
[8] /*full_name*/) /*HashSet::has*/;
489 if (UNTAG_Bool(variable
[9])) { /*if*/
490 variable
[9] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
491 /* Register variable[10]: Once String constant */
492 if (once_value_19
!= NIT_NULL
) variable
[10] = once_value_19
;
494 variable
[10] = NEW_String_string___String___with_native(BOX_NativeString("Error: Dependency loop for module "), TAG_Int(34)) /*new String*/;
495 once_value_19
= variable
[10];
497 /* Register variable[10]: Result */
498 /* Ensure var variable[10]: super-string element*/
499 CALL_abstract_collection___SimpleCollection___add(variable
[9])(variable
[9], variable
[10]) /*AbstractArray::add*/;
500 variable
[10] = variable
[8] /*full_name*/ /* Ensure var: super-string element*/;
501 CALL_abstract_collection___SimpleCollection___add(variable
[9])(variable
[9], CALL_string___Object___to_s(variable
[10])(variable
[10]) /*Object::to_s*/) /*AbstractArray::add*/;
502 /* Register variable[10]: Once String constant */
503 if (once_value_20
!= NIT_NULL
) variable
[10] = once_value_20
;
505 variable
[10] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
506 once_value_20
= variable
[10];
508 /* Register variable[10]: Result */
509 /* Ensure var variable[10]: super-string element*/
510 CALL_abstract_collection___SimpleCollection___add(variable
[9])(variable
[9], variable
[10]) /*AbstractArray::add*/;
511 /* Register variable[9]: Result */
512 variable
[9] = CALL_string___Object___to_s(variable
[9])(variable
[9]) /*Object::to_s*/;
513 CALL_mmloader___ToolContext___error(variable
[0])(variable
[0], variable
[9]) /*ToolContext::error*/;
514 exit(UNTAG_Int( TAG_Int(1)));
515 fprintf(stderr
, "Aborted"); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___try_to_load
, LOCATE_mmloader
, 139); nit_exit(1);
517 /* Register variable[9]: Result */
518 variable
[9] = ATTR_mmloader___ToolContext____processing_modules(variable
[0]) /*ToolContext::_processing_modules*/;
519 CALL_abstract_collection___SimpleCollection___add(variable
[9])(variable
[9], variable
[8] /*full_name*/) /*HashSet::add*/;
520 /* Register variable[9]: Local variable */
521 /* Register variable[10]: Result */
522 variable
[10] = CALL_mmloader___ModuleLoader___load_and_process_module( variable
[6] /*l*/)( variable
[6] /*l*/, variable
[0], variable
[1] /*module_name*/, variable
[2] /*dir*/) /*ModuleLoader::load_and_process_module*/;
523 variable
[9] = variable
[10];
524 /* Register variable[10]: Result */
525 variable
[10] = ATTR_mmloader___ToolContext____processing_modules(variable
[0]) /*ToolContext::_processing_modules*/;
526 CALL_abstract_collection___RemovableCollection___remove(variable
[10])(variable
[10], variable
[8] /*full_name*/) /*HashSet::remove*/;
527 CALL_abstractmetamodel___MMDirectory___add_module( variable
[2] /*dir*/)( variable
[2] /*dir*/, variable
[9] /*m*/) /*MMDirectory::add_module*/;
528 variable
[3] = variable
[9] /*m*/;
531 continue_18
: while(0);
532 CALL_abstract_collection___Iterator___next(variable
[4])(variable
[4]) /*ArrayIterator::next*/;
535 variable
[3] = NIT_NULL
/*null*/;
537 return_label16
: while(false);
538 tracehead
= trace
.prev
;
541 val_t
mmloader___ToolContext___get_module_from_filename(val_t self
, val_t param0
) {
542 struct trace_t trace
= {NULL
, NULL
, 156, LOCATE_mmloader___ToolContext___get_module_from_filename
};
543 static val_t once_value_22
= NIT_NULL
; /* Once value for string variable[5]*/
544 static val_t once_value_23
= NIT_NULL
; /* Once value for string variable[7]*/
545 static val_t once_value_24
= NIT_NULL
; /* Once value for string variable[7]*/
546 static val_t once_value_25
= NIT_NULL
; /* Once value for string variable[8]*/
547 static val_t once_value_26
= NIT_NULL
; /* Once value for string variable[8]*/
549 struct WBT_
**closurevariable
= NULL
;
550 trace
.prev
= tracehead
; tracehead
= &trace
;
551 trace
.file
= LOCATE_mmloader
;
552 /* Register variable[0]: Local variable */
554 /* Register variable[1]: Local variable */
555 variable
[1] = param0
;
556 /* Register variable[2]: Method return value and escape marker */
557 /* Register variable[3]: Local variable */
558 /* Register variable[4]: Result */
559 variable
[4] = CALL_file___String___dirname( variable
[1] /*filename*/)( variable
[1] /*filename*/) /*String::dirname*/;
560 variable
[3] = variable
[4];
561 /* Register variable[4]: Local variable */
562 /* Register variable[5]: Once String constant */
563 if (once_value_22
!= NIT_NULL
) variable
[5] = once_value_22
;
565 variable
[5] = NEW_String_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)) /*new String*/;
566 once_value_22
= variable
[5];
568 /* Register variable[5]: Result */
569 /* Register variable[5]: Result */
570 variable
[5] = CALL_file___String___basename( variable
[1] /*filename*/)( variable
[1] /*filename*/, variable
[5]) /*String::basename*/;
571 /* Register variable[5]: Result */
572 variable
[5] = CALL_symbol___String___to_symbol(variable
[5])(variable
[5]) /*String::to_symbol*/;
573 variable
[4] = variable
[5];
574 /* Register variable[5]: Local variable */
575 /* Register variable[6]: Result */
576 variable
[6] = CALL_mmloader___ToolContext___directory_for(variable
[0])(variable
[0], variable
[3] /*path*/) /*ToolContext::directory_for*/;
577 variable
[5] = variable
[6];
578 /* Register variable[6]: Result */
579 variable
[6] = CALL_string___Object___to_s( variable
[4] /*module_name*/)( variable
[4] /*module_name*/) /*Symbol::to_s*/;
580 /* Register variable[6]: Result */
581 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::==*/)));
582 if (UNTAG_Bool(variable
[6])) { /*if*/
583 /* Register variable[6]: Local variable */
584 /* Register variable[7]: Result */
585 variable
[7] = CALL_mmloader___ToolContext___try_to_load(variable
[0])(variable
[0], variable
[4] /*module_name*/, variable
[5] /*dir*/) /*ToolContext::try_to_load*/;
586 variable
[6] = variable
[7];
587 /* Register variable[7]: Result */
588 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::==*/)))))));
589 if (UNTAG_Bool(variable
[7])) { /*if*/
590 variable
[2] = variable
[6] /*m*/;
593 /* Register variable[7]: Result */
594 variable
[7] = CALL_mmloader___ToolContext___get_module(variable
[0])(variable
[0], variable
[4] /*module_name*/, NIT_NULL
/*null*/) /*ToolContext::get_module*/;
595 variable
[2] = variable
[7];
598 /* Register variable[6]: Result */
599 variable
[6] = CALL_file___String___file_exists( variable
[1] /*filename*/)( variable
[1] /*filename*/) /*String::file_exists*/;
600 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable
[6])))) { /*if*/
601 variable
[6] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
602 /* Register variable[7]: Once String constant */
603 if (once_value_23
!= NIT_NULL
) variable
[7] = once_value_23
;
605 variable
[7] = NEW_String_string___String___with_native(BOX_NativeString("Error: File "), TAG_Int(12)) /*new String*/;
606 once_value_23
= variable
[7];
608 /* Register variable[7]: Result */
609 /* Ensure var variable[7]: super-string element*/
610 CALL_abstract_collection___SimpleCollection___add(variable
[6])(variable
[6], variable
[7]) /*AbstractArray::add*/;
611 variable
[7] = variable
[1] /*filename*/ /* Ensure var: super-string element*/;
612 CALL_abstract_collection___SimpleCollection___add(variable
[6])(variable
[6], variable
[7]) /*AbstractArray::add*/;
613 /* Register variable[7]: Once String constant */
614 if (once_value_24
!= NIT_NULL
) variable
[7] = once_value_24
;
616 variable
[7] = NEW_String_string___String___with_native(BOX_NativeString(" not found."), TAG_Int(11)) /*new String*/;
617 once_value_24
= variable
[7];
619 /* Register variable[7]: Result */
620 /* Ensure var variable[7]: super-string element*/
621 CALL_abstract_collection___SimpleCollection___add(variable
[6])(variable
[6], variable
[7]) /*AbstractArray::add*/;
622 /* Register variable[6]: Result */
623 variable
[6] = CALL_string___Object___to_s(variable
[6])(variable
[6]) /*Object::to_s*/;
624 CALL_mmloader___ToolContext___error(variable
[0])(variable
[0], variable
[6]) /*ToolContext::error*/;
625 exit(UNTAG_Int( TAG_Int(1)));
626 fprintf(stderr
, "Aborted"); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___get_module_from_filename
, LOCATE_mmloader
, 179); nit_exit(1);
628 /* Register variable[6]: Local variable */
629 /* Register variable[7]: Result */
630 variable
[7] = CALL_mmloader___ToolContext___try_to_load(variable
[0])(variable
[0], variable
[4] /*module_name*/, variable
[5] /*dir*/) /*ToolContext::try_to_load*/;
631 variable
[6] = variable
[7];
632 /* Register variable[7]: Result */
633 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::==*/)))))));
634 if (UNTAG_Bool(variable
[7])) { /*if*/
635 variable
[2] = variable
[6] /*m*/;
638 variable
[7] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
639 /* Register variable[8]: Once String constant */
640 if (once_value_25
!= NIT_NULL
) variable
[8] = once_value_25
;
642 variable
[8] = NEW_String_string___String___with_native(BOX_NativeString("Error: "), TAG_Int(7)) /*new String*/;
643 once_value_25
= variable
[8];
645 /* Register variable[8]: Result */
646 /* Ensure var variable[8]: super-string element*/
647 CALL_abstract_collection___SimpleCollection___add(variable
[7])(variable
[7], variable
[8]) /*AbstractArray::add*/;
648 variable
[8] = variable
[1] /*filename*/ /* Ensure var: super-string element*/;
649 CALL_abstract_collection___SimpleCollection___add(variable
[7])(variable
[7], variable
[8]) /*AbstractArray::add*/;
650 /* Register variable[8]: Once String constant */
651 if (once_value_26
!= NIT_NULL
) variable
[8] = once_value_26
;
653 variable
[8] = NEW_String_string___String___with_native(BOX_NativeString(" is not a NIT source module."), TAG_Int(28)) /*new String*/;
654 once_value_26
= variable
[8];
656 /* Register variable[8]: Result */
657 /* Ensure var variable[8]: super-string element*/
658 CALL_abstract_collection___SimpleCollection___add(variable
[7])(variable
[7], variable
[8]) /*AbstractArray::add*/;
659 /* Register variable[7]: Result */
660 variable
[7] = CALL_string___Object___to_s(variable
[7])(variable
[7]) /*Object::to_s*/;
661 CALL_mmloader___ToolContext___error(variable
[0])(variable
[0], variable
[7]) /*ToolContext::error*/;
662 exit(UNTAG_Int( TAG_Int(1)));
663 fprintf(stderr
, "Aborted"); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___get_module_from_filename
, LOCATE_mmloader
, 188); nit_exit(1);
664 return_label21
: while(false);
665 tracehead
= trace
.prev
;
668 val_t
mmloader___ToolContext___get_module(val_t self
, val_t param0
, val_t param1
) {
669 struct trace_t trace
= {NULL
, NULL
, 191, LOCATE_mmloader___ToolContext___get_module
};
670 static val_t once_value_30
= NIT_NULL
; /* Once value for string variable[6]*/
671 static val_t once_value_31
= NIT_NULL
; /* Once value for string variable[6]*/
673 struct WBT_
**closurevariable
= NULL
;
674 trace
.prev
= tracehead
; tracehead
= &trace
;
675 trace
.file
= LOCATE_mmloader
;
676 /* Register variable[0]: Local variable */
678 /* Register variable[1]: Local variable */
679 variable
[1] = param0
;
680 /* Register variable[2]: Local variable */
681 variable
[2] = param1
;
682 /* Register variable[3]: Method return value and escape marker */
683 /* Register variable[4]: Local variable */
684 /*variable[4] is variable m*/
685 /* Register variable[5]: Result */
686 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::==*/)))))));
687 if (UNTAG_Bool(variable
[5])) { /*if*/
688 /* Register variable[5]: Local variable */
689 /* Register variable[6]: Result */
690 variable
[6] = CALL_abstractmetamodel___MMModule___directory( variable
[2] /*from*/)( variable
[2] /*from*/) /*MMModule::directory*/;
691 variable
[5] = variable
[6];
692 while (true) { /*while*/
693 /* Register variable[6]: Result */
694 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::==*/)))))));
695 if (!UNTAG_Bool(variable
[6])) break; /* while*/
696 /* Register variable[6]: Local variable */
697 /* Register variable[7]: Result */
698 variable
[7] = CALL_mmloader___ToolContext___try_to_load(variable
[0])(variable
[0], variable
[1] /*module_name*/, variable
[5] /*dir*/) /*ToolContext::try_to_load*/;
699 variable
[6] = variable
[7];
700 /* Register variable[7]: Result */
701 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::==*/)))))));
702 if (UNTAG_Bool(variable
[7])) { /*if*/
703 variable
[3] = variable
[6] /*m*/;
706 /* Register variable[7]: Result */
707 variable
[7] = CALL_abstractmetamodel___MMDirectory___parent( variable
[5] /*dir*/)( variable
[5] /*dir*/) /*MMDirectory::parent*/;
708 variable
[5] = variable
[7] /*dir=*/;
709 continue_28
: while(0);
713 /* Register variable[5]: Result */
714 variable
[5] = CALL_mmloader___ToolContext___paths(variable
[0])(variable
[0]) /*ToolContext::paths*/;
715 /* Register variable[5]: For iterator */
716 variable
[5] = CALL_abstract_collection___Collection___iterator(variable
[5])(variable
[5]) /*AbstractArrayRead::iterator*/;
717 while (true) { /*for*/
718 /* Register variable[6]: For 'is_ok' result */
719 variable
[6] = CALL_abstract_collection___Iterator___is_ok(variable
[5])(variable
[5]) /*ArrayIterator::is_ok*/;
720 if (!UNTAG_Bool(variable
[6])) break; /*for*/
721 variable
[6] = CALL_abstract_collection___Iterator___item(variable
[5])(variable
[5]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
722 /* Register variable[7]: Local variable */
723 variable
[7] = variable
[6];
724 /* Register variable[8]: Local variable */
725 /* Register variable[9]: Result */
726 variable
[9] = CALL_mmloader___ToolContext___directory_for(variable
[0])(variable
[0], variable
[7] /*p*/) /*ToolContext::directory_for*/;
727 /* Register variable[9]: Result */
728 variable
[9] = CALL_mmloader___ToolContext___try_to_load(variable
[0])(variable
[0], variable
[1] /*module_name*/, variable
[9]) /*ToolContext::try_to_load*/;
729 variable
[8] = variable
[9];
730 /* Register variable[9]: Result */
731 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::==*/)))))));
732 if (UNTAG_Bool(variable
[9])) { /*if*/
733 variable
[3] = variable
[8] /*m*/;
736 continue_29
: while(0);
737 CALL_abstract_collection___Iterator___next(variable
[5])(variable
[5]) /*ArrayIterator::next*/;
740 variable
[5] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
741 /* Register variable[6]: Once String constant */
742 if (once_value_30
!= NIT_NULL
) variable
[6] = once_value_30
;
744 variable
[6] = NEW_String_string___String___with_native(BOX_NativeString("Error: No ressource found for module "), TAG_Int(37)) /*new String*/;
745 once_value_30
= variable
[6];
747 /* Register variable[6]: Result */
748 /* Ensure var variable[6]: super-string element*/
749 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
750 variable
[6] = variable
[1] /*module_name*/ /* Ensure var: super-string element*/;
751 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], CALL_string___Object___to_s(variable
[6])(variable
[6]) /*Object::to_s*/) /*AbstractArray::add*/;
752 /* Register variable[6]: Once String constant */
753 if (once_value_31
!= NIT_NULL
) variable
[6] = once_value_31
;
755 variable
[6] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)) /*new String*/;
756 once_value_31
= variable
[6];
758 /* Register variable[6]: Result */
759 /* Ensure var variable[6]: super-string element*/
760 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
761 /* Register variable[5]: Result */
762 variable
[5] = CALL_string___Object___to_s(variable
[5])(variable
[5]) /*Object::to_s*/;
763 CALL_mmloader___ToolContext___error(variable
[0])(variable
[0], variable
[5]) /*ToolContext::error*/;
764 exit(UNTAG_Int( TAG_Int(1)));
765 fprintf(stderr
, "Aborted"); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_mmloader___ToolContext___get_module
, LOCATE_mmloader
, 212); nit_exit(1);
766 return_label27
: while(false);
767 tracehead
= trace
.prev
;
770 val_t
mmloader___ToolContext___directory_for(val_t self
, val_t param0
) {
771 struct trace_t trace
= {NULL
, NULL
, 215, LOCATE_mmloader___ToolContext___directory_for
};
773 struct WBT_
**closurevariable
= NULL
;
774 trace
.prev
= tracehead
; tracehead
= &trace
;
775 trace
.file
= LOCATE_mmloader
;
776 /* Register variable[0]: Local variable */
778 /* Register variable[1]: Local variable */
779 variable
[1] = param0
;
780 /* Register variable[2]: Method return value and escape marker */
781 /* Register variable[3]: Result */
782 variable
[3] = ATTR_mmloader___ToolContext____path_dirs(variable
[0]) /*ToolContext::_path_dirs*/;
783 /* Register variable[3]: Result */
784 variable
[3] = CALL_abstract_collection___MapRead___has_key(variable
[3])(variable
[3], variable
[1] /*path*/) /*MapRead::has_key*/;
785 if (UNTAG_Bool(variable
[3])) { /*if*/
786 /* Register variable[3]: Result */
787 variable
[3] = ATTR_mmloader___ToolContext____path_dirs(variable
[0]) /*ToolContext::_path_dirs*/;
788 /* Register variable[3]: Result */
789 variable
[3] = CALL_abstract_collection___MapRead_____bra(variable
[3])(variable
[3], variable
[1] /*path*/) /*MapRead::[]*/;
790 variable
[2] = variable
[3];
793 /* Register variable[3]: Local variable */
794 /* Register variable[4]: Result */
795 variable
[4] = CALL_symbol___String___to_symbol( variable
[1] /*path*/)( variable
[1] /*path*/) /*String::to_symbol*/;
796 /* Register variable[4]: Result */
797 variable
[4] = NEW_MMDirectory_abstractmetamodel___MMDirectory___init(variable
[4], variable
[1] /*path*/, NIT_NULL
/*null*/) /*new MMDirectory*/;
798 variable
[3] = variable
[4];
799 /* Register variable[4]: Result */
800 variable
[4] = ATTR_mmloader___ToolContext____path_dirs(variable
[0]) /*ToolContext::_path_dirs*/;
801 CALL_abstract_collection___Map_____braeq(variable
[4])(variable
[4], variable
[1] /*path*/, variable
[3] /*dir*/) /*Map::[]=*/;
802 variable
[2] = variable
[3] /*dir*/;
804 return_label32
: while(false);
805 tracehead
= trace
.prev
;
808 void mmloader___ToolContext___register_loader(val_t self
, val_t param0
) {
809 struct trace_t trace
= {NULL
, NULL
, 227, LOCATE_mmloader___ToolContext___register_loader
};
811 struct WBT_
**closurevariable
= NULL
;
812 trace
.prev
= tracehead
; tracehead
= &trace
;
813 trace
.file
= LOCATE_mmloader
;
814 /* Register variable[0]: Local variable */
816 /* Register variable[1]: Local variable */
817 variable
[1] = param0
;
818 /* Register variable[2]: Method return value and escape marker */
819 /* Register variable[3]: Result */
820 variable
[3] = ATTR_mmloader___ToolContext____loaders(variable
[0]) /*ToolContext::_loaders*/;
821 CALL_abstract_collection___SimpleCollection___add(variable
[3])(variable
[3], variable
[1] /*ml*/) /*AbstractArray::add*/;
822 return_label33
: while(false);
823 tracehead
= trace
.prev
;
826 val_t
mmloader___ModuleLoader___file_type(val_t self
) {
827 struct trace_t trace
= {NULL
, NULL
, 236, LOCATE_mmloader___ModuleLoader___file_type
};
828 val_t
*variable
= NULL
;
829 struct WBT_
**closurevariable
= NULL
;
830 trace
.prev
= tracehead
; tracehead
= &trace
;
831 trace
.file
= LOCATE_mmloader
;
832 fprintf(stderr
, "Deferred method called");
833 fprintf(stderr
, " (%s:%d)\n", LOCATE_mmloader
, 236);
835 tracehead
= trace
.prev
;
838 val_t
mmloader___ModuleLoader___try_to_load_dir(val_t self
, val_t param0
, val_t param1
) {
839 struct trace_t trace
= {NULL
, NULL
, 239, LOCATE_mmloader___ModuleLoader___try_to_load_dir
};
840 static val_t once_value_35
= NIT_NULL
; /* Once value for string variable[6]*/
841 static val_t once_value_36
= NIT_NULL
; /* Once value for string variable[6]*/
842 static val_t once_value_37
= NIT_NULL
; /* Once value for string variable[6]*/
844 struct WBT_
**closurevariable
= NULL
;
845 trace
.prev
= tracehead
; tracehead
= &trace
;
846 trace
.file
= LOCATE_mmloader
;
847 /* Register variable[0]: Local variable */
849 /* Register variable[1]: Local variable */
850 variable
[1] = param0
;
851 /* Register variable[2]: Local variable */
852 variable
[2] = param1
;
853 /* Register variable[3]: Method return value and escape marker */
854 /* Register variable[4]: Local variable */
855 variable
[5] = NEW_Array_array___Array___with_capacity(TAG_Int(5)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
856 /* Register variable[6]: Once String constant */
857 if (once_value_35
!= NIT_NULL
) variable
[6] = once_value_35
;
859 variable
[6] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
860 once_value_35
= variable
[6];
862 /* Register variable[6]: Result */
863 /* Ensure var variable[6]: super-string element*/
864 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
865 /* Register variable[6]: Result */
866 variable
[6] = CALL_abstractmetamodel___MMDirectory___path( variable
[2] /*parent_dir*/)( variable
[2] /*parent_dir*/) /*MMDirectory::path*/;
867 /* Ensure var variable[6]: super-string element*/
868 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
869 /* Register variable[6]: Once String constant */
870 if (once_value_36
!= NIT_NULL
) variable
[6] = once_value_36
;
872 variable
[6] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)) /*new String*/;
873 once_value_36
= variable
[6];
875 /* Register variable[6]: Result */
876 /* Ensure var variable[6]: super-string element*/
877 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
878 variable
[6] = variable
[1] /*dirname*/ /* Ensure var: super-string element*/;
879 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], CALL_string___Object___to_s(variable
[6])(variable
[6]) /*Object::to_s*/) /*AbstractArray::add*/;
880 /* Register variable[6]: Once String constant */
881 if (once_value_37
!= NIT_NULL
) variable
[6] = once_value_37
;
883 variable
[6] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)) /*new String*/;
884 once_value_37
= variable
[6];
886 /* Register variable[6]: Result */
887 /* Ensure var variable[6]: super-string element*/
888 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
889 /* Register variable[5]: Result */
890 variable
[5] = CALL_string___Object___to_s(variable
[5])(variable
[5]) /*Object::to_s*/;
891 variable
[4] = variable
[5];
892 /* Register variable[5]: Result */
893 variable
[5] = CALL_file___String___file_exists( variable
[4] /*fname*/)( variable
[4] /*fname*/) /*String::file_exists*/;
894 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable
[5])))) { /*if*/
895 variable
[3] = NIT_NULL
/*null*/;
898 /* Register variable[5]: Local variable */
899 /* Register variable[6]: Result */
900 variable
[6] = CALL_abstractmetamodel___MMDirectory___full_name_for( variable
[2] /*parent_dir*/)( variable
[2] /*parent_dir*/, variable
[1] /*dirname*/) /*MMDirectory::full_name_for*/;
901 /* Register variable[6]: Result */
902 variable
[6] = NEW_MMDirectory_abstractmetamodel___MMDirectory___init(variable
[6], variable
[4] /*fname*/, variable
[2] /*parent_dir*/) /*new MMDirectory*/;
903 variable
[5] = variable
[6];
904 variable
[3] = variable
[5] /*dir*/;
906 return_label34
: while(false);
907 tracehead
= trace
.prev
;
910 val_t
mmloader___ModuleLoader___can_handle(val_t self
, val_t param0
, val_t param1
) {
911 struct trace_t trace
= {NULL
, NULL
, 249, LOCATE_mmloader___ModuleLoader___can_handle
};
912 static val_t once_value_39
= NIT_NULL
; /* Once value for string variable[6]*/
913 static val_t once_value_40
= NIT_NULL
; /* Once value for string variable[6]*/
914 static val_t once_value_41
= NIT_NULL
; /* Once value for string variable[6]*/
915 static val_t once_value_42
= NIT_NULL
; /* Once value for string variable[6]*/
917 struct WBT_
**closurevariable
= NULL
;
918 trace
.prev
= tracehead
; tracehead
= &trace
;
919 trace
.file
= LOCATE_mmloader
;
920 /* Register variable[0]: Local variable */
922 /* Register variable[1]: Local variable */
923 variable
[1] = param0
;
924 /* Register variable[2]: Local variable */
925 variable
[2] = param1
;
926 /* Register variable[3]: Method return value and escape marker */
927 /* Register variable[4]: Local variable */
928 variable
[5] = NEW_Array_array___Array___with_capacity(TAG_Int(7)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
929 /* Register variable[6]: Once String constant */
930 if (once_value_39
!= NIT_NULL
) variable
[6] = once_value_39
;
932 variable
[6] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
933 once_value_39
= variable
[6];
935 /* Register variable[6]: Result */
936 /* Ensure var variable[6]: super-string element*/
937 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
938 /* Register variable[6]: Result */
939 variable
[6] = CALL_abstractmetamodel___MMDirectory___path( variable
[2] /*dir*/)( variable
[2] /*dir*/) /*MMDirectory::path*/;
940 /* Ensure var variable[6]: super-string element*/
941 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
942 /* Register variable[6]: Once String constant */
943 if (once_value_40
!= NIT_NULL
) variable
[6] = once_value_40
;
945 variable
[6] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)) /*new String*/;
946 once_value_40
= variable
[6];
948 /* Register variable[6]: Result */
949 /* Ensure var variable[6]: super-string element*/
950 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
951 variable
[6] = variable
[1] /*module_name*/ /* Ensure var: super-string element*/;
952 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], CALL_string___Object___to_s(variable
[6])(variable
[6]) /*Object::to_s*/) /*AbstractArray::add*/;
953 /* Register variable[6]: Once String constant */
954 if (once_value_41
!= NIT_NULL
) variable
[6] = once_value_41
;
956 variable
[6] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)) /*new String*/;
957 once_value_41
= variable
[6];
959 /* Register variable[6]: Result */
960 /* Ensure var variable[6]: super-string element*/
961 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
962 /* Register variable[6]: Result */
963 variable
[6] = CALL_mmloader___ModuleLoader___file_type(variable
[0])(variable
[0]) /*ModuleLoader::file_type*/;
964 /* Ensure var variable[6]: super-string element*/
965 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
966 /* Register variable[6]: Once String constant */
967 if (once_value_42
!= NIT_NULL
) variable
[6] = once_value_42
;
969 variable
[6] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
970 once_value_42
= variable
[6];
972 /* Register variable[6]: Result */
973 /* Ensure var variable[6]: super-string element*/
974 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
975 /* Register variable[5]: Result */
976 variable
[5] = CALL_string___Object___to_s(variable
[5])(variable
[5]) /*Object::to_s*/;
977 variable
[4] = variable
[5];
978 /* Register variable[5]: Result */
979 variable
[5] = CALL_file___String___file_exists( variable
[4] /*fname*/)( variable
[4] /*fname*/) /*String::file_exists*/;
980 if (UNTAG_Bool(variable
[5])) { /*if*/
981 variable
[3] = TAG_Bool(true);
984 variable
[3] = TAG_Bool(false);
986 return_label38
: while(false);
987 tracehead
= trace
.prev
;
990 val_t
mmloader___ModuleLoader___load_and_process_module(val_t self
, val_t param0
, val_t param1
, val_t param2
) {
991 struct trace_t trace
= {NULL
, NULL
, 258, LOCATE_mmloader___ModuleLoader___load_and_process_module
};
992 static val_t once_value_44
= NIT_NULL
; /* Once value for string variable[7]*/
993 static val_t once_value_45
= NIT_NULL
; /* Once value for string variable[7]*/
994 static val_t once_value_46
= NIT_NULL
; /* Once value for string variable[7]*/
995 static val_t once_value_47
= NIT_NULL
; /* Once value for string variable[7]*/
997 struct WBT_
**closurevariable
= NULL
;
998 trace
.prev
= tracehead
; tracehead
= &trace
;
999 trace
.file
= LOCATE_mmloader
;
1000 /* Register variable[0]: Local variable */
1002 /* Register variable[1]: Local variable */
1003 variable
[1] = param0
;
1004 /* Register variable[2]: Local variable */
1005 variable
[2] = param1
;
1006 /* Register variable[3]: Local variable */
1007 variable
[3] = param2
;
1008 /* Register variable[4]: Method return value and escape marker */
1009 /* Register variable[5]: Local variable */
1010 variable
[6] = NEW_Array_array___Array___with_capacity(TAG_Int(7)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
1011 /* Register variable[7]: Once String constant */
1012 if (once_value_44
!= NIT_NULL
) variable
[7] = once_value_44
;
1014 variable
[7] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
1015 once_value_44
= variable
[7];
1017 /* Register variable[7]: Result */
1018 /* Ensure var variable[7]: super-string element*/
1019 CALL_abstract_collection___SimpleCollection___add(variable
[6])(variable
[6], variable
[7]) /*AbstractArray::add*/;
1020 /* Register variable[7]: Result */
1021 variable
[7] = CALL_abstractmetamodel___MMDirectory___path( variable
[3] /*dir*/)( variable
[3] /*dir*/) /*MMDirectory::path*/;
1022 /* Ensure var variable[7]: super-string element*/
1023 CALL_abstract_collection___SimpleCollection___add(variable
[6])(variable
[6], variable
[7]) /*AbstractArray::add*/;
1024 /* Register variable[7]: Once String constant */
1025 if (once_value_45
!= NIT_NULL
) variable
[7] = once_value_45
;
1027 variable
[7] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)) /*new String*/;
1028 once_value_45
= variable
[7];
1030 /* Register variable[7]: Result */
1031 /* Ensure var variable[7]: super-string element*/
1032 CALL_abstract_collection___SimpleCollection___add(variable
[6])(variable
[6], variable
[7]) /*AbstractArray::add*/;
1033 variable
[7] = variable
[2] /*module_name*/ /* Ensure var: super-string element*/;
1034 CALL_abstract_collection___SimpleCollection___add(variable
[6])(variable
[6], CALL_string___Object___to_s(variable
[7])(variable
[7]) /*Object::to_s*/) /*AbstractArray::add*/;
1035 /* Register variable[7]: Once String constant */
1036 if (once_value_46
!= NIT_NULL
) variable
[7] = once_value_46
;
1038 variable
[7] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)) /*new String*/;
1039 once_value_46
= variable
[7];
1041 /* Register variable[7]: Result */
1042 /* Ensure var variable[7]: super-string element*/
1043 CALL_abstract_collection___SimpleCollection___add(variable
[6])(variable
[6], variable
[7]) /*AbstractArray::add*/;
1044 /* Register variable[7]: Result */
1045 variable
[7] = CALL_mmloader___ModuleLoader___file_type(variable
[0])(variable
[0]) /*ModuleLoader::file_type*/;
1046 /* Ensure var variable[7]: super-string element*/
1047 CALL_abstract_collection___SimpleCollection___add(variable
[6])(variable
[6], variable
[7]) /*AbstractArray::add*/;
1048 /* Register variable[7]: Once String constant */
1049 if (once_value_47
!= NIT_NULL
) variable
[7] = once_value_47
;
1051 variable
[7] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
1052 once_value_47
= variable
[7];
1054 /* Register variable[7]: Result */
1055 /* Ensure var variable[7]: super-string element*/
1056 CALL_abstract_collection___SimpleCollection___add(variable
[6])(variable
[6], variable
[7]) /*AbstractArray::add*/;
1057 /* Register variable[6]: Result */
1058 variable
[6] = CALL_string___Object___to_s(variable
[6])(variable
[6]) /*Object::to_s*/;
1059 variable
[5] = variable
[6];
1060 /* Register variable[6]: Local variable */
1061 /* Register variable[7]: Result */
1062 variable
[7] = CALL_mmloader___ModuleLoader___load_module(variable
[0])(variable
[0], variable
[1] /*context*/, variable
[2] /*module_name*/, variable
[3] /*dir*/, variable
[5] /*filename*/) /*ModuleLoader::load_module*/;
1063 variable
[6] = variable
[7];
1064 /* Register variable[7]: Result */
1065 variable
[7] = CALL_mmloader___ToolContext___opt_only_parse( variable
[1] /*context*/)( variable
[1] /*context*/) /*ToolContext::opt_only_parse*/;
1066 /* Register variable[7]: Result */
1067 variable
[7] = CALL_opts___Option___value(variable
[7])(variable
[7]) /*Option::value*/;
1068 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable
[7])))) { /*if*/
1069 CALL_mmloader___ModuleLoader___process_metamodel(variable
[0])(variable
[0], variable
[1] /*context*/, variable
[6] /*m*/) /*ModuleLoader::process_metamodel*/;
1071 variable
[4] = variable
[6] /*m*/;
1072 goto return_label43
;
1073 return_label43
: while(false);
1074 tracehead
= trace
.prev
;
1077 val_t
mmloader___ModuleLoader___load_module(val_t self
, val_t param0
, val_t param1
, val_t param2
, val_t param3
) {
1078 struct trace_t trace
= {NULL
, NULL
, 268, LOCATE_mmloader___ModuleLoader___load_module
};
1079 static val_t once_value_49
= NIT_NULL
; /* Once value for string variable[7]*/
1080 static val_t once_value_50
= NIT_NULL
; /* Once value for string variable[8]*/
1081 static val_t once_value_51
= NIT_NULL
; /* Once value for string variable[8]*/
1083 struct WBT_
**closurevariable
= NULL
;
1084 trace
.prev
= tracehead
; tracehead
= &trace
;
1085 trace
.file
= LOCATE_mmloader
;
1086 /* Register variable[0]: Local variable */
1088 /* Register variable[1]: Local variable */
1089 variable
[1] = param0
;
1090 /* Register variable[2]: Local variable */
1091 variable
[2] = param1
;
1092 /* Register variable[3]: Local variable */
1093 variable
[3] = param2
;
1094 /* Register variable[4]: Local variable */
1095 variable
[4] = param3
;
1096 /* Register variable[5]: Method return value and escape marker */
1097 /* Register variable[6]: Local variable */
1098 /*variable[6] is variable file*/
1099 /* Register variable[7]: Once String constant */
1100 if (once_value_49
!= NIT_NULL
) variable
[7] = once_value_49
;
1102 variable
[7] = NEW_String_string___String___with_native(BOX_NativeString("-"), TAG_Int(1)) /*new String*/;
1103 once_value_49
= variable
[7];
1105 /* Register variable[7]: Result */
1106 /* Register variable[7]: Result */
1107 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::==*/)));
1108 if (UNTAG_Bool(variable
[7])) { /*if*/
1109 /* Register variable[7]: Result */
1110 variable
[7] = CALL_file___Object___stdin(variable
[0])(variable
[0]) /*Object::stdin*/;
1111 variable
[6] = variable
[7] /*file=*/;
1113 /* Register variable[7]: Result */
1114 variable
[7] = CALL_string___Object___to_s( variable
[4] /*filename*/)( variable
[4] /*filename*/) /*String::to_s*/;
1115 /* Register variable[7]: Result */
1116 variable
[7] = NEW_IFStream_file___IFStream___open(variable
[7]) /*new IFStream*/;
1117 variable
[6] = variable
[7] /*file=*/;
1119 /* Register variable[7]: Result */
1120 variable
[7] = CALL_stream___IStream___eof( variable
[6] /*file*/)( variable
[6] /*file*/) /*BufferedIStream::eof*/;
1121 if (UNTAG_Bool(variable
[7])) { /*if*/
1122 variable
[7] = NEW_Array_array___Array___with_capacity(TAG_Int(3)) /*new Array[String]*/ /* Ensure var: Array (for super-string)*/;
1123 /* Register variable[8]: Once String constant */
1124 if (once_value_50
!= NIT_NULL
) variable
[8] = once_value_50
;
1126 variable
[8] = NEW_String_string___String___with_native(BOX_NativeString("Error: Problem in opening file "), TAG_Int(31)) /*new String*/;
1127 once_value_50
= variable
[8];
1129 /* Register variable[8]: Result */
1130 /* Ensure var variable[8]: super-string element*/
1131 CALL_abstract_collection___SimpleCollection___add(variable
[7])(variable
[7], variable
[8]) /*AbstractArray::add*/;
1132 variable
[8] = variable
[4] /*filename*/ /* Ensure var: super-string element*/;
1133 CALL_abstract_collection___SimpleCollection___add(variable
[7])(variable
[7], variable
[8]) /*AbstractArray::add*/;
1134 /* Register variable[8]: Once String constant */
1135 if (once_value_51
!= NIT_NULL
) variable
[8] = once_value_51
;
1137 variable
[8] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)) /*new String*/;
1138 once_value_51
= variable
[8];
1140 /* Register variable[8]: Result */
1141 /* Ensure var variable[8]: super-string element*/
1142 CALL_abstract_collection___SimpleCollection___add(variable
[7])(variable
[7], variable
[8]) /*AbstractArray::add*/;
1143 /* Register variable[7]: Result */
1144 variable
[7] = CALL_string___Object___to_s(variable
[7])(variable
[7]) /*Object::to_s*/;
1145 CALL_mmloader___ToolContext___error( variable
[1] /*context*/)( variable
[1] /*context*/, variable
[7]) /*ToolContext::error*/;
1146 exit(UNTAG_Int( TAG_Int(1)));
1147 fprintf(stderr
, "Aborted"); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_mmloader___ModuleLoader___load_module
, LOCATE_mmloader
, 281); nit_exit(1);
1149 /* Register variable[7]: Local variable */
1150 /* Register variable[8]: Result */
1151 variable
[8] = CALL_mmloader___ModuleLoader___parse_file(variable
[0])(variable
[0], variable
[1] /*context*/, variable
[6] /*file*/, variable
[4] /*filename*/, variable
[2] /*module_name*/, variable
[3] /*dir*/) /*ModuleLoader::parse_file*/;
1152 variable
[7] = variable
[8];
1153 /* Register variable[8]: Result */
1154 variable
[8] = CALL_file___Object___stdin(variable
[0])(variable
[0]) /*Object::stdin*/;
1155 /* Register variable[8]: Result */
1156 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::==*/)))))));
1157 if (UNTAG_Bool(variable
[8])) { /*if*/
1158 CALL_stream___IOS___close( variable
[6] /*file*/)( variable
[6] /*file*/) /*IFStream::close*/;
1160 variable
[5] = variable
[7] /*m*/;
1161 goto return_label48
;
1162 return_label48
: while(false);
1163 tracehead
= trace
.prev
;
1166 val_t
mmloader___ModuleLoader___parse_file(val_t self
, val_t param0
, val_t param1
, val_t param2
, val_t param3
, val_t param4
) {
1167 struct trace_t trace
= {NULL
, NULL
, 288, LOCATE_mmloader___ModuleLoader___parse_file
};
1168 val_t
*variable
= NULL
;
1169 struct WBT_
**closurevariable
= NULL
;
1170 trace
.prev
= tracehead
; tracehead
= &trace
;
1171 trace
.file
= LOCATE_mmloader
;
1172 fprintf(stderr
, "Deferred method called");
1173 fprintf(stderr
, " (%s:%d)\n", LOCATE_mmloader
, 288);
1175 tracehead
= trace
.prev
;
1178 void mmloader___ModuleLoader___process_metamodel(val_t self
, val_t param0
, val_t param1
) {
1179 struct trace_t trace
= {NULL
, NULL
, 291, LOCATE_mmloader___ModuleLoader___process_metamodel
};
1180 val_t
*variable
= NULL
;
1181 struct WBT_
**closurevariable
= NULL
;
1182 trace
.prev
= tracehead
; tracehead
= &trace
;
1183 trace
.file
= LOCATE_mmloader
;
1184 fprintf(stderr
, "Deferred method called");
1185 fprintf(stderr
, " (%s:%d)\n", LOCATE_mmloader
, 291);
1187 tracehead
= trace
.prev
;
1190 void mmloader___ModuleLoader___init(val_t self
, int* init_table
) {
1191 struct trace_t trace
= {NULL
, NULL
, 0, LOCATE_mmloader___ModuleLoader___init
};
1192 val_t
*variable
= NULL
;
1193 struct WBT_
**closurevariable
= NULL
;
1194 trace
.prev
= tracehead
; tracehead
= &trace
;
1195 trace
.file
= LOCATE_mmloader
;
1196 tracehead
= trace
.prev
;
1199 void mmloader___MMModule___import_supers_modules(val_t self
, val_t param0
) {
1200 struct trace_t trace
= {NULL
, NULL
, 296, LOCATE_mmloader___MMModule___import_supers_modules
};
1202 struct WBT_
**closurevariable
= NULL
;
1203 trace
.prev
= tracehead
; tracehead
= &trace
;
1204 trace
.file
= LOCATE_mmloader
;
1205 /* Register variable[0]: Local variable */
1207 /* Register variable[1]: Local variable */
1208 variable
[1] = param0
;
1209 /* Register variable[2]: Method return value and escape marker */
1210 /* Register variable[3]: Local variable */
1211 /* Register variable[4]: Result */
1212 variable
[4] = CALL_abstractmetamodel___MMModule___context(variable
[0])(variable
[0]) /*MMModule::context*/;
1213 variable
[3] = variable
[4];
1214 /* Register variable[4]: Result */
1215 variable
[4] = TAG_Bool(( variable
[3] /*c*/==NIT_NULL
) || VAL_ISA( variable
[3] /*c*/, COLOR_ToolContext
, ID_ToolContext
)) /*cast ToolContext*/;
1216 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
, 300); nit_exit(1);}
1217 /* Register variable[4]: Local variable */
1218 /* Register variable[5]: Result */
1219 variable
[5] = NEW_Array_array___Array___init() /*new Array[MMModule]*/;
1220 variable
[4] = variable
[5];
1221 /* Register variable[5]: For iterator */
1222 variable
[5] = CALL_abstract_collection___Collection___iterator( variable
[1] /*names*/)( variable
[1] /*names*/) /*Collection::iterator*/;
1223 while (true) { /*for*/
1224 /* Register variable[6]: For 'is_ok' result */
1225 variable
[6] = CALL_abstract_collection___Iterator___is_ok(variable
[5])(variable
[5]) /*Iterator::is_ok*/;
1226 if (!UNTAG_Bool(variable
[6])) break; /*for*/
1227 variable
[6] = CALL_abstract_collection___Iterator___item(variable
[5])(variable
[5]) /*Iterator::item*/ /* Ensure var: For item*/;
1228 /* Register variable[7]: Local variable */
1229 variable
[7] = variable
[6];
1230 /* Register variable[8]: Local variable */
1231 /* Register variable[9]: Result */
1232 variable
[9] = CALL_mmloader___ToolContext___get_module( variable
[3] /*c*/)( variable
[3] /*c*/, variable
[7] /*n*/, variable
[0]) /*ToolContext::get_module*/;
1233 variable
[8] = variable
[9];
1234 CALL_abstract_collection___SimpleCollection___add( variable
[4] /*supers*/)( variable
[4] /*supers*/, variable
[8] /*m*/) /*AbstractArray::add*/;
1235 continue_53
: while(0);
1236 CALL_abstract_collection___Iterator___next(variable
[5])(variable
[5]) /*Iterator::next*/;
1239 CALL_abstractmetamodel___MMContext___add_module( variable
[3] /*c*/)( variable
[3] /*c*/, variable
[0], variable
[4] /*supers*/) /*MMContext::add_module*/;
1240 return_label52
: while(false);
1241 tracehead
= trace
.prev
;