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*/;
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*/;
15 void mmloader___ToolContext___error(val_t self
, val_t param0
) {
16 struct trace_t trace
= {NULL
, LOCATE_mmloader
, 33, LOCATE_mmloader___ToolContext___error
};
25 trace
.prev
= tracehead
; tracehead
= &trace
;
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
;
44 void mmloader___ToolContext___warning(val_t self
, val_t param0
) {
45 struct trace_t trace
= {NULL
, LOCATE_mmloader
, 40, LOCATE_mmloader___ToolContext___warning
};
54 trace
.prev
= tracehead
; tracehead
= &trace
;
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*/
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
;
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*/;
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*/;
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*/;
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*/;
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*/;
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*/;
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*/;
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*/;
127 void mmloader___ToolContext___init(val_t self
, int* init_table
) {
128 struct trace_t trace
= {NULL
, LOCATE_mmloader
, 75, LOCATE_mmloader___ToolContext___init
};
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
;
159 void mmloader___ToolContext___process_options(val_t self
) {
160 struct trace_t trace
= {NULL
, LOCATE_mmloader
, 81, LOCATE_mmloader___ToolContext___process_options
};
163 static val_t once_value_variable1_4
; static int once_bool_variable1_4
;
165 static val_t once_value_variable1_5
; static int once_bool_variable1_5
;
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
;
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;
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*/;
197 if (once_bool_variable1_5
) variable1
= once_value_variable1_5
;
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;
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*/;
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*/;
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*/;
242 tracehead
= trace
.prev
;
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
};
259 trace
.prev
= tracehead
; tracehead
= &trace
;
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*/;
274 continue_7
: while(0);
275 ((abstract_collection___Iterator___next_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___next
))(variable2
) /*Iterator::next*/;
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*/;
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);
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*/;
329 continue_8
: while(0);
330 ((array___ArrayIterator___next_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___next
))(variable2
) /*ArrayIterator::next*/;
333 variable2
= NIT_NULL
/*null*/;
335 return_label6
: while(false);
336 tracehead
= trace
.prev
;
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
};
352 trace
.prev
= tracehead
; tracehead
= &trace
;
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*/;
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
;
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);
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*/;
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
;
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
};
425 trace
.prev
= tracehead
; tracehead
= &trace
;
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*/;
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);
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*/;
463 continue_12
: while(0);
464 ((array___ArrayIterator___next_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___next
))(variable3
) /*ArrayIterator::next*/;
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
;
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
};
490 trace
.prev
= tracehead
; tracehead
= &trace
;
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::[]*/;
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*/;
507 return_label13
: while(false);
508 tracehead
= trace
.prev
;
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
};
515 trace
.prev
= tracehead
; tracehead
= &trace
;
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
;
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);
528 tracehead
= trace
.prev
;
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
};
546 trace
.prev
= tracehead
; tracehead
= &trace
;
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*/;
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*/;
577 return_label15
: while(false);
578 tracehead
= trace
.prev
;
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
};
600 trace
.prev
= tracehead
; tracehead
= &trace
;
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);
631 variable2
= TAG_Bool(false);
633 return_label16
: while(false);
634 tracehead
= trace
.prev
;
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
};
657 trace
.prev
= tracehead
; tracehead
= &trace
;
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*/;
691 variable3
= variable4
/*m*/;
693 return_label17
: while(false);
694 tracehead
= trace
.prev
;
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
};
710 trace
.prev
= tracehead
; tracehead
= &trace
;
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=*/;
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=*/;
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);
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*/;
750 variable4
= variable5
/*m*/;
752 return_label18
: while(false);
753 tracehead
= trace
.prev
;
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);
762 tracehead
= trace
.prev
;
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);
771 tracehead
= trace
.prev
;
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*/;
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
;
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*/;
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
;
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
};
809 trace
.prev
= tracehead
; tracehead
= &trace
;
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*/;
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
;