1 #include "mmloader._sep.h"
2 val_t
mmloader___ToolContext___error_count(val_t self
) {
3 struct trace_t trace
= {NULL
, "mmloader::ToolContext::error_count (src/mmloader.nit:27,2--28:32)"};
4 trace
.prev
= tracehead
; tracehead
= &trace
;
5 tracehead
= trace
.prev
;
6 return ATTR_mmloader___ToolContext____error_count( self
) /*ToolContext::_error_count*/;
8 val_t
mmloader___ToolContext___warning_count(val_t self
) {
9 struct trace_t trace
= {NULL
, "mmloader::ToolContext::warning_count (src/mmloader.nit:30,2--31:34)"};
10 trace
.prev
= tracehead
; tracehead
= &trace
;
11 tracehead
= trace
.prev
;
12 return ATTR_mmloader___ToolContext____warning_count( self
) /*ToolContext::_warning_count*/;
14 void mmloader___ToolContext___error(val_t self
, val_t param0
) {
15 struct trace_t trace
= {NULL
, "mmloader::ToolContext::error (src/mmloader.nit:33,2--37:33)"};
24 trace
.prev
= tracehead
; tracehead
= &trace
;
26 variable1
= ((file___Object___stderr_t
)CALL( self
,COLOR_file___Object___stderr
))( self
) /*ToolContext::stderr*/;
27 variable2
= NEW_string___String___init(); /*new String*/
28 variable3
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
29 variable4
= variable3
;
30 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable4
) /*String::append*/;
31 variable5
= variable0
/*s*/;
32 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable5
) /*String::append*/;
33 variable6
= NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
34 variable7
= variable6
;
35 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable7
) /*String::append*/;
36 ((file___OFStream___write_t
)CALL(variable1
,COLOR_stream___OStream___write
))(variable1
, variable2
) /*OFStream::write*/;
37 variable1
= ATTR_mmloader___ToolContext____error_count( self
) /*ToolContext::_error_count*/;
38 variable1
= TAG_Int(UNTAG_Int(variable1
)+UNTAG_Int( TAG_Int(1)));
39 ATTR_mmloader___ToolContext____error_count( self
) /*ToolContext::_error_count*/ = variable1
;
40 tracehead
= trace
.prev
;
43 void mmloader___ToolContext___warning(val_t self
, val_t param0
) {
44 struct trace_t trace
= {NULL
, "mmloader::ToolContext::warning (src/mmloader.nit:40,2--45:37)"};
53 trace
.prev
= tracehead
; tracehead
= &trace
;
55 variable1
= ATTR_mmloader___ToolContext____opt_warn( self
) /*ToolContext::_opt_warn*/;
56 variable1
= ((opts___Option___value_t
)CALL(variable1
,COLOR_opts___Option___value
))(variable1
) /*OptionBool::value*/;
57 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1
)))) { /*if*/
60 variable1
= ((file___Object___stderr_t
)CALL( self
,COLOR_file___Object___stderr
))( self
) /*ToolContext::stderr*/;
61 variable2
= NEW_string___String___init(); /*new String*/
62 variable3
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
63 variable4
= variable3
;
64 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable4
) /*String::append*/;
65 variable5
= variable0
/*s*/;
66 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable5
) /*String::append*/;
67 variable6
= NEW_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)); /*new String*/
68 variable7
= variable6
;
69 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable7
) /*String::append*/;
70 ((file___OFStream___write_t
)CALL(variable1
,COLOR_stream___OStream___write
))(variable1
, variable2
) /*OFStream::write*/;
71 variable1
= ATTR_mmloader___ToolContext____warning_count( self
) /*ToolContext::_warning_count*/;
72 variable1
= TAG_Int(UNTAG_Int(variable1
)+UNTAG_Int( TAG_Int(1)));
73 ATTR_mmloader___ToolContext____warning_count( self
) /*ToolContext::_warning_count*/ = variable1
;
74 return_label1
: while(false);
75 tracehead
= trace
.prev
;
78 val_t
mmloader___ToolContext___paths(val_t self
) {
79 struct trace_t trace
= {NULL
, "mmloader::ToolContext::paths (src/mmloader.nit:48,2--49:35)"};
80 trace
.prev
= tracehead
; tracehead
= &trace
;
81 tracehead
= trace
.prev
;
82 return ATTR_mmloader___ToolContext____paths( self
) /*ToolContext::_paths*/;
84 val_t
mmloader___ToolContext___option_context(val_t self
) {
85 struct trace_t trace
= {NULL
, "mmloader::ToolContext::option_context (src/mmloader.nit:54,2--55:65)"};
86 trace
.prev
= tracehead
; tracehead
= &trace
;
87 tracehead
= trace
.prev
;
88 return ATTR_mmloader___ToolContext____option_context( self
) /*ToolContext::_option_context*/;
90 val_t
mmloader___ToolContext___opt_warn(val_t self
) {
91 struct trace_t trace
= {NULL
, "mmloader::ToolContext::opt_warn (src/mmloader.nit:57,2--58:85)"};
92 trace
.prev
= tracehead
; tracehead
= &trace
;
93 tracehead
= trace
.prev
;
94 return ATTR_mmloader___ToolContext____opt_warn( self
) /*ToolContext::_opt_warn*/;
96 val_t
mmloader___ToolContext___opt_path(val_t self
) {
97 struct trace_t trace
= {NULL
, "mmloader::ToolContext::opt_path (src/mmloader.nit:60,2--61:131)"};
98 trace
.prev
= tracehead
; tracehead
= &trace
;
99 tracehead
= trace
.prev
;
100 return ATTR_mmloader___ToolContext____opt_path( self
) /*ToolContext::_opt_path*/;
102 val_t
mmloader___ToolContext___opt_log(val_t self
) {
103 struct trace_t trace
= {NULL
, "mmloader::ToolContext::opt_log (src/mmloader.nit:63,2--64:90)"};
104 trace
.prev
= tracehead
; tracehead
= &trace
;
105 tracehead
= trace
.prev
;
106 return ATTR_mmloader___ToolContext____opt_log( self
) /*ToolContext::_opt_log*/;
108 val_t
mmloader___ToolContext___opt_only_metamodel(val_t self
) {
109 struct trace_t trace
= {NULL
, "mmloader::ToolContext::opt_only_metamodel (src/mmloader.nit:66,2--67:118)"};
110 trace
.prev
= tracehead
; tracehead
= &trace
;
111 tracehead
= trace
.prev
;
112 return ATTR_mmloader___ToolContext____opt_only_metamodel( self
) /*ToolContext::_opt_only_metamodel*/;
114 val_t
mmloader___ToolContext___opt_only_parse(val_t self
) {
115 struct trace_t trace
= {NULL
, "mmloader::ToolContext::opt_only_parse (src/mmloader.nit:69,2--70:115)"};
116 trace
.prev
= tracehead
; tracehead
= &trace
;
117 tracehead
= trace
.prev
;
118 return ATTR_mmloader___ToolContext____opt_only_parse( self
) /*ToolContext::_opt_only_parse*/;
120 val_t
mmloader___ToolContext___opt_help(val_t self
) {
121 struct trace_t trace
= {NULL
, "mmloader::ToolContext::opt_help (src/mmloader.nit:72,2--73:101)"};
122 trace
.prev
= tracehead
; tracehead
= &trace
;
123 tracehead
= trace
.prev
;
124 return ATTR_mmloader___ToolContext____opt_help( self
) /*ToolContext::_opt_help*/;
126 void mmloader___ToolContext___init(val_t self
, int* init_table
) {
127 struct trace_t trace
= {NULL
, "mmloader::ToolContext::init (src/mmloader.nit:75,2--78:102)"};
136 trace
.prev
= tracehead
; tracehead
= &trace
;
137 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_ToolContext
].i
]) return;
138 ((abstractmetamodel___MMContext___init_t
)CALL( self
,COLOR_abstractmetamodel___MMContext___init
))( self
, init_table
/*YYY*/) /*MMContext::init*/;
139 variable0
= ((mmloader___ToolContext___option_context_t
)CALL( self
,COLOR_mmloader___ToolContext___option_context
))( self
) /*ToolContext::option_context*/;
140 variable1
= NEW_array___Array___with_capacity(TAG_Int(6)); /*new Array[Option]*/
141 variable2
= ((mmloader___ToolContext___opt_warn_t
)CALL( self
,COLOR_mmloader___ToolContext___opt_warn
))( self
) /*ToolContext::opt_warn*/;
142 ((array___AbstractArray___add_t
)CALL(variable1
,COLOR_abstract_collection___SimpleCollection___add
))(variable1
, variable2
) /*Array::add*/;
143 variable3
= ((mmloader___ToolContext___opt_path_t
)CALL( self
,COLOR_mmloader___ToolContext___opt_path
))( self
) /*ToolContext::opt_path*/;
144 ((array___AbstractArray___add_t
)CALL(variable1
,COLOR_abstract_collection___SimpleCollection___add
))(variable1
, variable3
) /*Array::add*/;
145 variable4
= ((mmloader___ToolContext___opt_log_t
)CALL( self
,COLOR_mmloader___ToolContext___opt_log
))( self
) /*ToolContext::opt_log*/;
146 ((array___AbstractArray___add_t
)CALL(variable1
,COLOR_abstract_collection___SimpleCollection___add
))(variable1
, variable4
) /*Array::add*/;
147 variable5
= ((mmloader___ToolContext___opt_only_parse_t
)CALL( self
,COLOR_mmloader___ToolContext___opt_only_parse
))( self
) /*ToolContext::opt_only_parse*/;
148 ((array___AbstractArray___add_t
)CALL(variable1
,COLOR_abstract_collection___SimpleCollection___add
))(variable1
, variable5
) /*Array::add*/;
149 variable6
= ((mmloader___ToolContext___opt_only_metamodel_t
)CALL( self
,COLOR_mmloader___ToolContext___opt_only_metamodel
))( self
) /*ToolContext::opt_only_metamodel*/;
150 ((array___AbstractArray___add_t
)CALL(variable1
,COLOR_abstract_collection___SimpleCollection___add
))(variable1
, variable6
) /*Array::add*/;
151 variable7
= ((mmloader___ToolContext___opt_help_t
)CALL( self
,COLOR_mmloader___ToolContext___opt_help
))( self
) /*ToolContext::opt_help*/;
152 ((array___AbstractArray___add_t
)CALL(variable1
,COLOR_abstract_collection___SimpleCollection___add
))(variable1
, variable7
) /*Array::add*/;
153 ((opts___OptionContext___add_option_t
)CALL(variable0
,COLOR_opts___OptionContext___add_option
))(variable0
, variable1
) /*OptionContext::add_option*/;
154 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_ToolContext
].i
] = 1;
155 tracehead
= trace
.prev
;
158 void mmloader___ToolContext___process_options(val_t self
) {
159 struct trace_t trace
= {NULL
, "mmloader::ToolContext::process_options (src/mmloader.nit:81,2--103:47)"};
162 static val_t once_value_variable1_4
; static int once_bool_variable1_4
;
164 static val_t once_value_variable1_5
; static int once_bool_variable1_5
;
171 trace
.prev
= tracehead
; tracehead
= &trace
;
172 variable0
= ((mmloader___ToolContext___option_context_t
)CALL( self
,COLOR_mmloader___ToolContext___option_context
))( self
) /*ToolContext::option_context*/;
173 variable1
= ((string___Object___args_t
)CALL( self
,COLOR_string___Object___args
))( self
) /*ToolContext::args*/;
174 ((opts___OptionContext___parse_t
)CALL(variable0
,COLOR_opts___OptionContext___parse
))(variable0
, variable1
) /*OptionContext::parse*/;
175 variable0
= NEW_array___Array___init(); /*new Array[String]*/
176 ATTR_mmloader___ToolContext____paths( self
) /*ToolContext::_paths*/ = variable0
;
177 variable0
= ((mmloader___ToolContext___paths_t
)CALL( self
,COLOR_mmloader___ToolContext___paths
))( self
) /*ToolContext::paths*/;
178 variable1
= ((mmloader___ToolContext___opt_path_t
)CALL( self
,COLOR_mmloader___ToolContext___opt_path
))( self
) /*ToolContext::opt_path*/;
179 variable1
= ((opts___Option___value_t
)CALL(variable1
,COLOR_opts___Option___value
))(variable1
) /*OptionArray::value*/;
180 ((abstract_collection___IndexedCollection___append_t
)CALL(variable0
,COLOR_abstract_collection___IndexedCollection___append
))(variable0
, variable1
) /*Array::append*/;
181 if (once_bool_variable1_4
) variable1
= once_value_variable1_4
;
183 variable1
= NEW_string___String___with_native(BOX_NativeString("NIT_PATH"), TAG_Int(8)); /*new String*/
184 variable1
= ((symbol___String___to_symbol_t
)CALL(variable1
,COLOR_symbol___String___to_symbol
))(variable1
) /*String::to_symbol*/;
185 variable1
= ((environ___Symbol___environ_t
)CALL(variable1
,COLOR_environ___Symbol___environ
))(variable1
) /*Symbol::environ*/;
186 once_value_variable1_4
= variable1
;
187 once_bool_variable1_4
= true;
189 variable0
= variable1
;
190 variable1
= ((array___AbstractArray___is_empty_t
)CALL( variable0
/*path_env*/,COLOR_abstract_collection___Collection___is_empty
))( variable0
/*path_env*/) /*String::is_empty*/;
191 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1
)))) { /*if*/
192 variable1
= ((mmloader___ToolContext___paths_t
)CALL( self
,COLOR_mmloader___ToolContext___paths
))( self
) /*ToolContext::paths*/;
193 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*/;
194 ((abstract_collection___IndexedCollection___append_t
)CALL(variable1
,COLOR_abstract_collection___IndexedCollection___append
))(variable1
, variable2
) /*Array::append*/;
196 if (once_bool_variable1_5
) variable1
= once_value_variable1_5
;
198 variable1
= NEW_string___String___with_native(BOX_NativeString("NIT_DIR"), TAG_Int(7)); /*new String*/
199 variable1
= ((symbol___String___to_symbol_t
)CALL(variable1
,COLOR_symbol___String___to_symbol
))(variable1
) /*String::to_symbol*/;
200 variable1
= ((environ___Symbol___environ_t
)CALL(variable1
,COLOR_environ___Symbol___environ
))(variable1
) /*Symbol::environ*/;
201 once_value_variable1_5
= variable1
;
202 once_bool_variable1_5
= true;
204 variable0
= variable1
/*path_env=*/;
205 variable1
= ((array___AbstractArray___is_empty_t
)CALL( variable0
/*path_env*/,COLOR_abstract_collection___Collection___is_empty
))( variable0
/*path_env*/) /*String::is_empty*/;
206 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1
)))) { /*if*/
207 variable2
= NEW_string___String___init(); /*new String*/
208 variable3
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
209 variable4
= variable3
;
210 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable4
) /*String::append*/;
211 variable5
= variable0
/*path_env*/;
212 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable5
) /*String::append*/;
213 variable6
= NEW_string___String___with_native(BOX_NativeString("/lib"), TAG_Int(4)); /*new String*/
214 variable7
= variable6
;
215 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable7
) /*String::append*/;
216 variable1
= variable2
;
217 variable2
= ((file___String___file_exists_t
)CALL( variable1
/*libname*/,COLOR_file___String___file_exists
))( variable1
/*libname*/) /*String::file_exists*/;
218 if (UNTAG_Bool(variable2
)) { /*if*/
219 variable2
= ((mmloader___ToolContext___paths_t
)CALL( self
,COLOR_mmloader___ToolContext___paths
))( self
) /*ToolContext::paths*/;
220 ((array___AbstractArray___add_t
)CALL(variable2
,COLOR_abstract_collection___SimpleCollection___add
))(variable2
, variable1
/*libname*/) /*Array::add*/;
223 variable2
= NEW_string___String___init(); /*new String*/
224 variable3
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
225 variable4
= variable3
;
226 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable4
) /*String::append*/;
228 variable5
= ((string___Sys___program_name_t
)CALL(variable5
,COLOR_string___Sys___program_name
))(variable5
) /*Sys::program_name*/;
229 variable5
= ((file___String___dirname_t
)CALL(variable5
,COLOR_file___String___dirname
))(variable5
) /*String::dirname*/;
230 variable6
= variable5
;
231 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable6
) /*String::append*/;
232 variable7
= NEW_string___String___with_native(BOX_NativeString("/../lib"), TAG_Int(7)); /*new String*/
233 variable8
= variable7
;
234 ((string___String___append_t
)CALL(variable2
,COLOR_abstract_collection___IndexedCollection___append
))(variable2
, variable8
) /*String::append*/;
235 variable1
= variable2
;
236 variable2
= ((file___String___file_exists_t
)CALL( variable1
/*libname*/,COLOR_file___String___file_exists
))( variable1
/*libname*/) /*String::file_exists*/;
237 if (UNTAG_Bool(variable2
)) { /*if*/
238 variable2
= ((mmloader___ToolContext___paths_t
)CALL( self
,COLOR_mmloader___ToolContext___paths
))( self
) /*ToolContext::paths*/;
239 ((array___AbstractArray___add_t
)CALL(variable2
,COLOR_abstract_collection___SimpleCollection___add
))(variable2
, variable1
/*libname*/) /*Array::add*/;
241 tracehead
= trace
.prev
;
244 val_t
mmloader___ToolContext___try_to_load(val_t self
, val_t param0
, val_t param1
) {
245 struct trace_t trace
= {NULL
, "mmloader::ToolContext::try_to_load (src/mmloader.nit:106,2--145:13)"};
258 trace
.prev
= tracehead
; tracehead
= &trace
;
261 variable2
= ((abstractmetamodel___MMDirectory___modules_t
)CALL( variable1
/*dir*/,COLOR_abstractmetamodel___MMDirectory___modules
))( variable1
/*dir*/) /*MMDirectory::modules*/;
262 variable2
= ((abstract_collection___Map___iterator_t
)CALL(variable2
,COLOR_abstract_collection___Collection___iterator
))(variable2
) /*Map::iterator*/;
263 while (true) { /*for*/
264 variable3
= ((abstract_collection___Iterator___is_ok_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___is_ok
))(variable2
) /*MapIterator::is_ok*/;
265 if (!UNTAG_Bool(variable3
)) break; /*for*/
266 variable3
= ((abstract_collection___Iterator___item_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___item
))(variable2
) /*MapIterator::item*/;
267 variable4
= ((abstractmetamodel___MMModule___name_t
)CALL( variable3
/*m*/,COLOR_abstractmetamodel___MMModule___name
))( variable3
/*m*/) /*MMModule::name*/;
268 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*/) /*Symbol::==*/)))));
269 if (UNTAG_Bool(variable4
)) { /*if*/
270 variable2
= variable3
/*m*/;
273 continue_7
: while(0);
274 ((abstract_collection___Iterator___next_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___next
))(variable2
) /*MapIterator::next*/;
277 variable2
= ATTR_mmloader___ToolContext____loaders( self
) /*ToolContext::_loaders*/;
278 variable2
= ((array___AbstractArray___iterator_t
)CALL(variable2
,COLOR_abstract_collection___Collection___iterator
))(variable2
) /*Array::iterator*/;
279 while (true) { /*for*/
280 variable3
= ((array___ArrayIterator___is_ok_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___is_ok
))(variable2
) /*ArrayIterator::is_ok*/;
281 if (!UNTAG_Bool(variable3
)) break; /*for*/
282 variable3
= ((array___ArrayIterator___item_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___item
))(variable2
) /*ArrayIterator::item*/;
283 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*/;
284 variable4
= variable5
;
285 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*/) /*MMDirectory::==*/)))))));
286 if (UNTAG_Bool(variable5
)) { /*if*/
287 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*/;
288 variable5
= variable6
;
289 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*/) /*MMModule::==*/)))))));
290 if (UNTAG_Bool(variable6
)) { /*if*/
291 ((abstractmetamodel___MMDirectory___owner__eq_t
)CALL( variable4
/*dir2*/,COLOR_abstractmetamodel___MMDirectory___owner__eq
))( variable4
/*dir2*/, variable5
/*m*/) /*MMDirectory::owner=*/;
292 ((abstractmetamodel___MMDirectory___add_module_t
)CALL( variable1
/*dir*/,COLOR_abstractmetamodel___MMDirectory___add_module
))( variable1
/*dir*/, variable5
/*m*/) /*MMDirectory::add_module*/;
293 variable2
= variable5
/*m*/;
297 variable5
= ((mmloader___ModuleLoader___can_handle_t
)CALL( variable3
/*l*/,COLOR_mmloader___ModuleLoader___can_handle
))( variable3
/*l*/, variable0
/*module_name*/, variable1
/*dir*/) /*ModuleLoader::can_handle*/;
298 if (UNTAG_Bool(variable5
)) { /*if*/
299 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*/;
300 variable5
= variable6
;
301 variable6
= ATTR_mmloader___ToolContext____processing_modules( self
) /*ToolContext::_processing_modules*/;
302 variable6
= ((hash___HashSet___has_t
)CALL(variable6
,COLOR_abstract_collection___Collection___has
))(variable6
, variable5
/*full_name*/) /*HashSet::has*/;
303 if (UNTAG_Bool(variable6
)) { /*if*/
304 variable6
= NEW_string___String___init(); /*new String*/
305 variable7
= NEW_string___String___with_native(BOX_NativeString("Error: Dependency loop for module "), TAG_Int(34)); /*new String*/
306 variable8
= variable7
;
307 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable8
) /*String::append*/;
308 variable9
= variable5
/*full_name*/;
309 variable9
= ((string___String___to_s_t
)CALL(variable9
,COLOR_string___Object___to_s
))(variable9
) /*String::to_s*/;
310 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable9
) /*String::append*/;
311 variable10
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
312 variable11
= variable10
;
313 ((string___String___append_t
)CALL(variable6
,COLOR_abstract_collection___IndexedCollection___append
))(variable6
, variable11
) /*String::append*/;
314 ((mmloader___ToolContext___error_t
)CALL( self
,COLOR_mmloader___ToolContext___error
))( self
, variable6
) /*ToolContext::error*/;
315 exit(UNTAG_Int( TAG_Int(1)));
316 fprintf(stderr
, "Aborted: src/mmloader.nit:135,6--10\n"); nit_exit(1);
318 variable6
= ATTR_mmloader___ToolContext____processing_modules( self
) /*ToolContext::_processing_modules*/;
319 ((hash___HashSet___add_t
)CALL(variable6
,COLOR_abstract_collection___SimpleCollection___add
))(variable6
, variable5
/*full_name*/) /*HashSet::add*/;
320 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*/;
321 variable6
= variable7
;
322 variable7
= ATTR_mmloader___ToolContext____processing_modules( self
) /*ToolContext::_processing_modules*/;
323 ((hash___HashSet___remove_t
)CALL(variable7
,COLOR_abstract_collection___RemovableCollection___remove
))(variable7
, variable5
/*full_name*/) /*HashSet::remove*/;
324 ((abstractmetamodel___MMDirectory___add_module_t
)CALL( variable1
/*dir*/,COLOR_abstractmetamodel___MMDirectory___add_module
))( variable1
/*dir*/, variable6
/*m*/) /*MMDirectory::add_module*/;
325 variable2
= variable6
/*m*/;
328 continue_8
: while(0);
329 ((array___ArrayIterator___next_t
)CALL(variable2
,COLOR_abstract_collection___Iterator___next
))(variable2
) /*ArrayIterator::next*/;
332 variable2
= NIT_NULL
/*null*/;
334 return_label6
: while(false);
335 tracehead
= trace
.prev
;
338 val_t
mmloader___ToolContext___get_module_from_filename(val_t self
, val_t param0
) {
339 struct trace_t trace
= {NULL
, "mmloader::ToolContext::get_module_from_filename (src/mmloader.nit:152,2--184:7)"};
351 trace
.prev
= tracehead
; tracehead
= &trace
;
353 variable2
= ((file___String___dirname_t
)CALL( variable0
/*filename*/,COLOR_file___String___dirname
))( variable0
/*filename*/) /*String::dirname*/;
354 variable1
= variable2
;
355 variable3
= NEW_string___String___with_native(BOX_NativeString(".nit"), TAG_Int(4)); /*new String*/
356 variable3
= ((file___String___basename_t
)CALL( variable0
/*filename*/,COLOR_file___String___basename
))( variable0
/*filename*/, variable3
) /*String::basename*/;
357 variable3
= ((symbol___String___to_symbol_t
)CALL(variable3
,COLOR_symbol___String___to_symbol
))(variable3
) /*String::to_symbol*/;
358 variable2
= variable3
;
359 variable4
= ((mmloader___ToolContext___directory_for_t
)CALL( self
,COLOR_mmloader___ToolContext___directory_for
))( self
, variable1
/*path*/) /*ToolContext::directory_for*/;
360 variable3
= variable4
;
361 variable4
= ((symbol___Symbol___to_s_t
)CALL( variable2
/*module_name*/,COLOR_string___Object___to_s
))( variable2
/*module_name*/) /*Symbol::to_s*/;
362 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::==*/)));
363 if (UNTAG_Bool(variable4
)) { /*if*/
364 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*/;
365 variable4
= variable5
;
366 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*/) /*MMModule::==*/)))))));
367 if (UNTAG_Bool(variable5
)) { /*if*/
368 variable1
= variable4
/*m*/;
371 variable5
= ((mmloader___ToolContext___get_module_t
)CALL( self
,COLOR_mmloader___ToolContext___get_module
))( self
, variable2
/*module_name*/, NIT_NULL
/*null*/) /*ToolContext::get_module*/;
372 variable1
= variable5
;
375 variable4
= ((file___String___file_exists_t
)CALL( variable0
/*filename*/,COLOR_file___String___file_exists
))( variable0
/*filename*/) /*String::file_exists*/;
376 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable4
)))) { /*if*/
377 variable4
= NEW_string___String___init(); /*new String*/
378 variable5
= NEW_string___String___with_native(BOX_NativeString("Error: File "), TAG_Int(12)); /*new String*/
379 variable6
= variable5
;
380 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable6
) /*String::append*/;
381 variable7
= variable0
/*filename*/;
382 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable7
) /*String::append*/;
383 variable8
= NEW_string___String___with_native(BOX_NativeString(" not found."), TAG_Int(11)); /*new String*/
384 variable9
= variable8
;
385 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable9
) /*String::append*/;
386 ((mmloader___ToolContext___error_t
)CALL( self
,COLOR_mmloader___ToolContext___error
))( self
, variable4
) /*ToolContext::error*/;
387 exit(UNTAG_Int( TAG_Int(1)));
388 fprintf(stderr
, "Aborted: src/mmloader.nit:175,4--8\n"); nit_exit(1);
390 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*/;
391 variable4
= variable5
;
392 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*/) /*MMModule::==*/)))))));
393 if (UNTAG_Bool(variable5
)) { /*if*/
394 variable1
= variable4
/*m*/;
397 variable5
= NEW_string___String___init(); /*new String*/
398 variable6
= NEW_string___String___with_native(BOX_NativeString("Error: "), TAG_Int(7)); /*new String*/
399 variable7
= variable6
;
400 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable7
) /*String::append*/;
401 variable8
= variable0
/*filename*/;
402 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable8
) /*String::append*/;
403 variable9
= NEW_string___String___with_native(BOX_NativeString(" is not a NIT source module."), TAG_Int(28)); /*new String*/
404 variable10
= variable9
;
405 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable10
) /*String::append*/;
406 ((mmloader___ToolContext___error_t
)CALL( self
,COLOR_mmloader___ToolContext___error
))( self
, variable5
) /*ToolContext::error*/;
407 exit(UNTAG_Int( TAG_Int(1)));
408 fprintf(stderr
, "Aborted: src/mmloader.nit:184,3--7\n"); nit_exit(1);
409 return_label9
: while(false);
410 tracehead
= trace
.prev
;
413 val_t
mmloader___ToolContext___get_module(val_t self
, val_t param0
, val_t param1
) {
414 struct trace_t trace
= {NULL
, "mmloader::ToolContext::get_module (src/mmloader.nit:187,2--208:7)"};
424 trace
.prev
= tracehead
; tracehead
= &trace
;
427 variable2
= NIT_NULL
/*decl variable m*/;
428 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*/) /*MMModule::==*/)))))));
429 if (UNTAG_Bool(variable3
)) { /*if*/
430 variable4
= ((abstractmetamodel___MMModule___directory_t
)CALL( variable1
/*from*/,COLOR_abstractmetamodel___MMModule___directory
))( variable1
/*from*/) /*MMModule::directory*/;
431 variable3
= variable4
;
432 while (true) { /*while*/
433 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*/) /*MMDirectory::==*/)))))));
434 if (!UNTAG_Bool(variable4
)) break; /* while*/
435 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*/;
436 variable4
= variable5
;
437 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*/) /*MMModule::==*/)))))));
438 if (UNTAG_Bool(variable5
)) { /*if*/
439 variable2
= variable4
/*m*/;
442 variable5
= ((abstractmetamodel___MMDirectory___parent_t
)CALL( variable3
/*dir*/,COLOR_abstractmetamodel___MMDirectory___parent
))( variable3
/*dir*/) /*MMDirectory::parent*/;
443 variable3
= variable5
/*dir=*/;
444 continue_11
: while(0);
448 variable3
= ((mmloader___ToolContext___paths_t
)CALL( self
,COLOR_mmloader___ToolContext___paths
))( self
) /*ToolContext::paths*/;
449 variable3
= ((array___AbstractArray___iterator_t
)CALL(variable3
,COLOR_abstract_collection___Collection___iterator
))(variable3
) /*Array::iterator*/;
450 while (true) { /*for*/
451 variable4
= ((array___ArrayIterator___is_ok_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___is_ok
))(variable3
) /*ArrayIterator::is_ok*/;
452 if (!UNTAG_Bool(variable4
)) break; /*for*/
453 variable4
= ((array___ArrayIterator___item_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___item
))(variable3
) /*ArrayIterator::item*/;
454 variable6
= ((mmloader___ToolContext___directory_for_t
)CALL( self
,COLOR_mmloader___ToolContext___directory_for
))( self
, variable4
/*p*/) /*ToolContext::directory_for*/;
455 variable6
= ((mmloader___ToolContext___try_to_load_t
)CALL( self
,COLOR_mmloader___ToolContext___try_to_load
))( self
, variable0
/*module_name*/, variable6
) /*ToolContext::try_to_load*/;
456 variable5
= variable6
;
457 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*/) /*MMModule::==*/)))))));
458 if (UNTAG_Bool(variable6
)) { /*if*/
459 variable2
= variable5
/*m*/;
462 continue_12
: while(0);
463 ((array___ArrayIterator___next_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___next
))(variable3
) /*ArrayIterator::next*/;
466 variable3
= NEW_string___String___init(); /*new String*/
467 variable4
= NEW_string___String___with_native(BOX_NativeString("Error: No ressource found for module "), TAG_Int(37)); /*new String*/
468 variable5
= variable4
;
469 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable5
) /*String::append*/;
470 variable6
= variable0
/*module_name*/;
471 variable6
= ((string___String___to_s_t
)CALL(variable6
,COLOR_string___Object___to_s
))(variable6
) /*String::to_s*/;
472 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable6
) /*String::append*/;
473 variable7
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
474 variable8
= variable7
;
475 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable8
) /*String::append*/;
476 ((mmloader___ToolContext___error_t
)CALL( self
,COLOR_mmloader___ToolContext___error
))( self
, variable3
) /*ToolContext::error*/;
477 exit(UNTAG_Int( TAG_Int(1)));
478 fprintf(stderr
, "Aborted: src/mmloader.nit:208,3--7\n"); nit_exit(1);
479 return_label10
: while(false);
480 tracehead
= trace
.prev
;
483 val_t
mmloader___ToolContext___directory_for(val_t self
, val_t param0
) {
484 struct trace_t trace
= {NULL
, "mmloader::ToolContext::directory_for (src/mmloader.nit:211,2--217:12)"};
489 trace
.prev
= tracehead
; tracehead
= &trace
;
491 variable1
= ATTR_mmloader___ToolContext____path_dirs( self
) /*ToolContext::_path_dirs*/;
492 variable1
= ((abstract_collection___Map___has_key_t
)CALL(variable1
,COLOR_abstract_collection___Map___has_key
))(variable1
, variable0
/*path*/) /*Map::has_key*/;
493 if (UNTAG_Bool(variable1
)) { /*if*/
494 variable1
= ATTR_mmloader___ToolContext____path_dirs( self
) /*ToolContext::_path_dirs*/;
495 variable1
= ((abstract_collection___Map_____bra_t
)CALL(variable1
,COLOR_abstract_collection___Map_____bra
))(variable1
, variable0
/*path*/) /*Map::[]*/;
498 variable2
= ((symbol___String___to_symbol_t
)CALL( variable0
/*path*/,COLOR_symbol___String___to_symbol
))( variable0
/*path*/) /*String::to_symbol*/;
499 variable3
= NEW_abstractmetamodel___MMDirectory___init(variable2
, variable0
/*path*/, NIT_NULL
/*null*/); /*new MMDirectory*/
500 variable2
= variable3
;
501 variable1
= variable2
;
502 variable2
= ATTR_mmloader___ToolContext____path_dirs( self
) /*ToolContext::_path_dirs*/;
503 ((abstract_collection___Map_____braeq_t
)CALL(variable2
,COLOR_abstract_collection___Map_____braeq
))(variable2
, variable0
/*path*/, variable1
/*dir*/) /*Map::[]=*/;
504 variable1
= variable1
/*dir*/;
506 return_label13
: while(false);
507 tracehead
= trace
.prev
;
510 void mmloader___ToolContext___register_loader(val_t self
, val_t param0
) {
511 struct trace_t trace
= {NULL
, "mmloader::ToolContext::register_loader (src/mmloader.nit:223,2--224:58)"};
514 trace
.prev
= tracehead
; tracehead
= &trace
;
516 variable1
= ATTR_mmloader___ToolContext____loaders( self
) /*ToolContext::_loaders*/;
517 ((array___AbstractArray___add_t
)CALL(variable1
,COLOR_abstract_collection___SimpleCollection___add
))(variable1
, variable0
/*ml*/) /*Array::add*/;
518 tracehead
= trace
.prev
;
521 val_t
mmloader___ModuleLoader___file_type(val_t self
) {
522 struct trace_t trace
= {NULL
, "mmloader::ModuleLoader::file_type (src/mmloader.nit:232,2--233:23)"};
523 trace
.prev
= tracehead
; tracehead
= &trace
;
524 fprintf(stderr
, "Deferred method file_type called (src/mmloader.nit:232,2)\n");
526 tracehead
= trace
.prev
;
529 val_t
mmloader___ModuleLoader___try_to_load_dir(val_t self
, val_t param0
, val_t param1
) {
530 struct trace_t trace
= {NULL
, "mmloader::ModuleLoader::try_to_load_dir (src/mmloader.nit:235,2--242:12)"};
544 trace
.prev
= tracehead
; tracehead
= &trace
;
547 variable3
= NEW_string___String___init(); /*new String*/
548 variable4
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
549 variable5
= variable4
;
550 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable5
) /*String::append*/;
551 variable6
= ((abstractmetamodel___MMDirectory___path_t
)CALL( variable1
/*parent_dir*/,COLOR_abstractmetamodel___MMDirectory___path
))( variable1
/*parent_dir*/) /*MMDirectory::path*/;
552 variable7
= variable6
;
553 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable7
) /*String::append*/;
554 variable8
= NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
555 variable9
= variable8
;
556 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable9
) /*String::append*/;
557 variable10
= variable0
/*dirname*/;
558 variable10
= ((string___String___to_s_t
)CALL(variable10
,COLOR_string___Object___to_s
))(variable10
) /*String::to_s*/;
559 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable10
) /*String::append*/;
560 variable11
= NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
561 variable12
= variable11
;
562 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable12
) /*String::append*/;
563 variable2
= variable3
;
564 variable3
= ((file___String___file_exists_t
)CALL( variable2
/*fname*/,COLOR_file___String___file_exists
))( variable2
/*fname*/) /*String::file_exists*/;
565 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable3
)))) { /*if*/
566 variable2
= NIT_NULL
/*null*/;
569 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*/;
570 variable5
= NEW_abstractmetamodel___MMDirectory___init(variable4
, variable2
/*fname*/, variable1
/*parent_dir*/); /*new MMDirectory*/
571 variable4
= variable5
;
572 variable3
= variable4
;
573 variable2
= variable3
/*dir*/;
575 return_label15
: while(false);
576 tracehead
= trace
.prev
;
579 val_t
mmloader___ModuleLoader___can_handle(val_t self
, val_t param0
, val_t param1
) {
580 struct trace_t trace
= {NULL
, "mmloader::ModuleLoader::can_handle (src/mmloader.nit:245,2--251:14)"};
598 trace
.prev
= tracehead
; tracehead
= &trace
;
601 variable3
= NEW_string___String___init(); /*new String*/
602 variable4
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
603 variable5
= variable4
;
604 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable5
) /*String::append*/;
605 variable6
= ((abstractmetamodel___MMDirectory___path_t
)CALL( variable1
/*dir*/,COLOR_abstractmetamodel___MMDirectory___path
))( variable1
/*dir*/) /*MMDirectory::path*/;
606 variable7
= variable6
;
607 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable7
) /*String::append*/;
608 variable8
= NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
609 variable9
= variable8
;
610 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable9
) /*String::append*/;
611 variable10
= variable0
/*module_name*/;
612 variable10
= ((string___String___to_s_t
)CALL(variable10
,COLOR_string___Object___to_s
))(variable10
) /*String::to_s*/;
613 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable10
) /*String::append*/;
614 variable11
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
615 variable12
= variable11
;
616 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable12
) /*String::append*/;
617 variable13
= ((mmloader___ModuleLoader___file_type_t
)CALL( self
,COLOR_mmloader___ModuleLoader___file_type
))( self
) /*ModuleLoader::file_type*/;
618 variable14
= variable13
;
619 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable14
) /*String::append*/;
620 variable15
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
621 variable16
= variable15
;
622 ((string___String___append_t
)CALL(variable3
,COLOR_abstract_collection___IndexedCollection___append
))(variable3
, variable16
) /*String::append*/;
623 variable2
= variable3
;
624 variable3
= ((file___String___file_exists_t
)CALL( variable2
/*fname*/,COLOR_file___String___file_exists
))( variable2
/*fname*/) /*String::file_exists*/;
625 if (UNTAG_Bool(variable3
)) { /*if*/
626 variable2
= TAG_Bool(true);
629 variable2
= TAG_Bool(false);
631 return_label16
: while(false);
632 tracehead
= trace
.prev
;
635 val_t
mmloader___ModuleLoader___load_and_process_module(val_t self
, val_t param0
, val_t param1
, val_t param2
) {
636 struct trace_t trace
= {NULL
, "mmloader::ModuleLoader::load_and_process_module (src/mmloader.nit:254,2--261:10)"};
655 trace
.prev
= tracehead
; tracehead
= &trace
;
659 variable4
= NEW_string___String___init(); /*new String*/
660 variable5
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
661 variable6
= variable5
;
662 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable6
) /*String::append*/;
663 variable7
= ((abstractmetamodel___MMDirectory___path_t
)CALL( variable2
/*dir*/,COLOR_abstractmetamodel___MMDirectory___path
))( variable2
/*dir*/) /*MMDirectory::path*/;
664 variable8
= variable7
;
665 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable8
) /*String::append*/;
666 variable9
= NEW_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)); /*new String*/
667 variable10
= variable9
;
668 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable10
) /*String::append*/;
669 variable11
= variable1
/*module_name*/;
670 variable11
= ((string___String___to_s_t
)CALL(variable11
,COLOR_string___Object___to_s
))(variable11
) /*String::to_s*/;
671 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable11
) /*String::append*/;
672 variable12
= NEW_string___String___with_native(BOX_NativeString("."), TAG_Int(1)); /*new String*/
673 variable13
= variable12
;
674 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable13
) /*String::append*/;
675 variable14
= ((mmloader___ModuleLoader___file_type_t
)CALL( self
,COLOR_mmloader___ModuleLoader___file_type
))( self
) /*ModuleLoader::file_type*/;
676 variable15
= variable14
;
677 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable15
) /*String::append*/;
678 variable16
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
679 variable17
= variable16
;
680 ((string___String___append_t
)CALL(variable4
,COLOR_abstract_collection___IndexedCollection___append
))(variable4
, variable17
) /*String::append*/;
681 variable3
= variable4
;
682 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*/;
683 variable4
= variable5
;
684 variable5
= ((mmloader___ToolContext___opt_only_parse_t
)CALL( variable0
/*context*/,COLOR_mmloader___ToolContext___opt_only_parse
))( variable0
/*context*/) /*ToolContext::opt_only_parse*/;
685 variable5
= ((opts___Option___value_t
)CALL(variable5
,COLOR_opts___Option___value
))(variable5
) /*OptionBool::value*/;
686 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable5
)))) { /*if*/
687 ((mmloader___ModuleLoader___process_metamodel_t
)CALL( self
,COLOR_mmloader___ModuleLoader___process_metamodel
))( self
, variable0
/*context*/, variable4
/*m*/) /*ModuleLoader::process_metamodel*/;
689 variable3
= variable4
/*m*/;
691 return_label17
: while(false);
692 tracehead
= trace
.prev
;
695 val_t
mmloader___ModuleLoader___load_module(val_t self
, val_t param0
, val_t param1
, val_t param2
, val_t param3
) {
696 struct trace_t trace
= {NULL
, "mmloader::ModuleLoader::load_module (src/mmloader.nit:264,2--282:10)"};
708 trace
.prev
= tracehead
; tracehead
= &trace
;
713 variable4
= NIT_NULL
/*decl variable file*/;
714 variable5
= NEW_string___String___with_native(BOX_NativeString("-"), TAG_Int(1)); /*new String*/
715 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::==*/)));
716 if (UNTAG_Bool(variable5
)) { /*if*/
717 variable5
= ((file___Object___stdin_t
)CALL( self
,COLOR_file___Object___stdin
))( self
) /*ModuleLoader::stdin*/;
718 variable4
= variable5
/*file=*/;
720 variable5
= ((string___String___to_s_t
)CALL( variable3
/*filename*/,COLOR_string___Object___to_s
))( variable3
/*filename*/) /*String::to_s*/;
721 variable6
= NEW_file___IFStream___open(variable5
); /*new IFStream*/
722 variable5
= variable6
;
723 variable4
= variable5
/*file=*/;
725 variable5
= ((stream___BufferedIStream___eof_t
)CALL( variable4
/*file*/,COLOR_stream___IStream___eof
))( variable4
/*file*/) /*IFStream::eof*/;
726 if (UNTAG_Bool(variable5
)) { /*if*/
727 variable5
= NEW_string___String___init(); /*new String*/
728 variable6
= NEW_string___String___with_native(BOX_NativeString("Error: Problem in opening file "), TAG_Int(31)); /*new String*/
729 variable7
= variable6
;
730 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable7
) /*String::append*/;
731 variable8
= variable3
/*filename*/;
732 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable8
) /*String::append*/;
733 variable9
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
734 variable10
= variable9
;
735 ((string___String___append_t
)CALL(variable5
,COLOR_abstract_collection___IndexedCollection___append
))(variable5
, variable10
) /*String::append*/;
736 ((mmloader___ToolContext___error_t
)CALL( variable0
/*context*/,COLOR_mmloader___ToolContext___error
))( variable0
/*context*/, variable5
) /*ToolContext::error*/;
737 exit(UNTAG_Int( TAG_Int(1)));
738 fprintf(stderr
, "Aborted: src/mmloader.nit:277,4--8\n"); nit_exit(1);
740 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*/;
741 variable5
= variable6
;
742 ((mmloader___MMModule___filename__eq_t
)CALL( variable5
/*m*/,COLOR_mmloader___MMModule___filename__eq
))( variable5
/*m*/, variable3
/*filename*/) /*MMModule::filename=*/;
743 variable6
= ((file___Object___stdin_t
)CALL( self
,COLOR_file___Object___stdin
))( self
) /*ModuleLoader::stdin*/;
744 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
) /*IFStream::==*/)))))));
745 if (UNTAG_Bool(variable6
)) { /*if*/
746 ((file___IFStream___close_t
)CALL( variable4
/*file*/,COLOR_stream___IOS___close
))( variable4
/*file*/) /*IFStream::close*/;
748 variable4
= variable5
/*m*/;
750 return_label18
: while(false);
751 tracehead
= trace
.prev
;
754 val_t
mmloader___ModuleLoader___parse_file(val_t self
, val_t param0
, val_t param1
, val_t param2
, val_t param3
, val_t param4
) {
755 struct trace_t trace
= {NULL
, "mmloader::ModuleLoader::parse_file (src/mmloader.nit:285,2--286:129)"};
756 trace
.prev
= tracehead
; tracehead
= &trace
;
757 fprintf(stderr
, "Deferred method parse_file called (src/mmloader.nit:285,2)\n");
759 tracehead
= trace
.prev
;
762 void mmloader___ModuleLoader___process_metamodel(val_t self
, val_t param0
, val_t param1
) {
763 struct trace_t trace
= {NULL
, "mmloader::ModuleLoader::process_metamodel (src/mmloader.nit:288,2--289:70)"};
764 trace
.prev
= tracehead
; tracehead
= &trace
;
765 fprintf(stderr
, "Deferred method process_metamodel called (src/mmloader.nit:288,2)\n");
767 tracehead
= trace
.prev
;
770 val_t
mmloader___MMModule___filename(val_t self
) {
771 struct trace_t trace
= {NULL
, "mmloader::MMModule::filename (src/mmloader.nit:293,2--294:41)"};
772 trace
.prev
= tracehead
; tracehead
= &trace
;
773 tracehead
= trace
.prev
;
774 return ATTR_mmloader___MMModule____filename( self
) /*MMModule::_filename*/;
776 void mmloader___MMModule___filename__eq(val_t self
, val_t param0
) {
777 struct trace_t trace
= {NULL
, "mmloader::MMModule::filename= (src/mmloader.nit:293,2--294:41)"};
778 trace
.prev
= tracehead
; tracehead
= &trace
;
779 ATTR_mmloader___MMModule____filename( self
) /*MMModule::_filename*/ = param0
;
780 tracehead
= trace
.prev
;
783 val_t
mmloader___MMModule___mtime(val_t self
) {
784 struct trace_t trace
= {NULL
, "mmloader::MMModule::mtime (src/mmloader.nit:296,2--297:35)"};
785 trace
.prev
= tracehead
; tracehead
= &trace
;
786 tracehead
= trace
.prev
;
787 return ATTR_mmloader___MMModule____mtime( self
) /*MMModule::_mtime*/;
789 void mmloader___MMModule___mtime__eq(val_t self
, val_t param0
) {
790 struct trace_t trace
= {NULL
, "mmloader::MMModule::mtime= (src/mmloader.nit:296,2--297:35)"};
791 trace
.prev
= tracehead
; tracehead
= &trace
;
792 ATTR_mmloader___MMModule____mtime( self
) /*MMModule::_mtime*/ = param0
;
793 tracehead
= trace
.prev
;
796 void mmloader___MMModule___import_supers_modules(val_t self
, val_t param0
) {
797 struct trace_t trace
= {NULL
, "mmloader::MMModule::import_supers_modules (src/mmloader.nit:299,2--309:26)"};
805 trace
.prev
= tracehead
; tracehead
= &trace
;
807 variable2
= ((abstractmetamodel___MMModule___context_t
)CALL( self
,COLOR_abstractmetamodel___MMModule___context
))( self
) /*MMModule::context*/;
808 variable1
= variable2
;
809 variable2
= TAG_Bool(( variable1
/*c*/==NIT_NULL
) || VAL_ISA( variable1
/*c*/, COLOR_ToolContext
, ID_ToolContext
)) /*cast ToolContext*/;
810 if (!UNTAG_Bool(variable2
)) { fprintf(stderr
, "Assert failed: src/mmloader.nit:303,3--26\n"); nit_exit(1);}
811 variable3
= NEW_array___Array___init(); /*new Array[MMModule]*/
812 variable2
= variable3
;
813 variable3
= ((abstract_collection___Collection___iterator_t
)CALL( variable0
/*names*/,COLOR_abstract_collection___Collection___iterator
))( variable0
/*names*/) /*Collection::iterator*/;
814 while (true) { /*for*/
815 variable4
= ((abstract_collection___Iterator___is_ok_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___is_ok
))(variable3
) /*Iterator::is_ok*/;
816 if (!UNTAG_Bool(variable4
)) break; /*for*/
817 variable4
= ((abstract_collection___Iterator___item_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___item
))(variable3
) /*Iterator::item*/;
818 variable6
= ((mmloader___ToolContext___get_module_t
)CALL( variable1
/*c*/,COLOR_mmloader___ToolContext___get_module
))( variable1
/*c*/, variable4
/*n*/, self
) /*ToolContext::get_module*/;
819 variable5
= variable6
;
820 ((array___AbstractArray___add_t
)CALL( variable2
/*supers*/,COLOR_abstract_collection___SimpleCollection___add
))( variable2
/*supers*/, variable5
/*m*/) /*Array::add*/;
821 continue_20
: while(0);
822 ((abstract_collection___Iterator___next_t
)CALL(variable3
,COLOR_abstract_collection___Iterator___next
))(variable3
) /*Iterator::next*/;
825 ((abstractmetamodel___MMContext___add_module_t
)CALL( variable1
/*c*/,COLOR_abstractmetamodel___MMContext___add_module
))( variable1
/*c*/, self
, variable2
/*supers*/) /*ToolContext::add_module*/;
826 tracehead
= trace
.prev
;