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