Merge: doc: fixed some typos and other misc. corrections
[nit.git] / c_src / nitc__modelbuilder.sep.1.c
1 #include "nitc__modelbuilder.sep.0.h"
2 /* method modelbuilder$ToolContext$opt_ignore_visibility for (self: ToolContext): OptionBool */
3 val* nitc__modelbuilder___ToolContext___opt_ignore_visibility(val* self) {
4 val* var /* : OptionBool */;
5 val* var1 /* : OptionBool */;
6 var1 = self->attrs[COLOR_nitc__modelbuilder__ToolContext___opt_ignore_visibility].val; /* _opt_ignore_visibility on <self:ToolContext> */
7 if (unlikely(var1 == NULL)) {
8 if(catchStack.cursor >= 0){
9 longjmp(catchStack.envs[catchStack.cursor], 1);
10 }
11 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _opt_ignore_visibility");
12 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__modelbuilder, 27);
13 fatal_exit(1);
14 }
15 var = var1;
16 RET_LABEL:;
17 return var;
18 }
19 /* method modelbuilder$ToolContext$init for (self: ToolContext) */
20 void nitc__modelbuilder___ToolContext___core__kernel__Object__init(val* self) {
21 val* var /* : OptionContext */;
22 val* var2 /* : OptionContext */;
23 val* var3 /* : OptionBool */;
24 val* var5 /* : OptionBool */;
25 val* var6 /* : Array[Option] */;
26 val* var7 /* : NativeArray[Option] */;
27 {
28 ((void(*)(val* self))(self->class->vft[COLOR_nitc__modelbuilder___ToolContext___core__kernel__Object__init]))(self); /* init on <self:ToolContext>*/
29 }
30 {
31 { /* Inline toolcontext$ToolContext$option_context (self) on <self:ToolContext> */
32 var2 = self->attrs[COLOR_nitc__toolcontext__ToolContext___option_context].val; /* _option_context on <self:ToolContext> */
33 if (unlikely(var2 == NULL)) {
34 if(catchStack.cursor >= 0){
35 longjmp(catchStack.envs[catchStack.cursor], 1);
36 }
37 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _option_context");
38 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__toolcontext, 357);
39 fatal_exit(1);
40 }
41 var = var2;
42 RET_LABEL1:(void)0;
43 }
44 }
45 {
46 { /* Inline modelbuilder$ToolContext$opt_ignore_visibility (self) on <self:ToolContext> */
47 var5 = self->attrs[COLOR_nitc__modelbuilder__ToolContext___opt_ignore_visibility].val; /* _opt_ignore_visibility on <self:ToolContext> */
48 if (unlikely(var5 == NULL)) {
49 if(catchStack.cursor >= 0){
50 longjmp(catchStack.envs[catchStack.cursor], 1);
51 }
52 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _opt_ignore_visibility");
53 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__modelbuilder, 27);
54 fatal_exit(1);
55 }
56 var3 = var5;
57 RET_LABEL4:(void)0;
58 }
59 }
60 var6 = NEW_core__Array(&type_core__Array__opts__Option);
61 { /* var6 = array_instance Array[Option] */
62 var7 = NEW_core__NativeArray((int)1l, &type_core__NativeArray__opts__Option);
63 ((struct instance_core__NativeArray*)var7)->values[0] = (val*) var3;
64 {
65 ((void(*)(val* self, val* p0, long p1))(var6->class->vft[COLOR_core__array__Array__with_native]))(var6, var7, 1l); /* with_native on <var6:Array[Option]>*/
66 }
67 }
68 {
69 opts___opts__OptionContext___add_option(var, var6); /* Direct call opts$OptionContext$add_option on <var:OptionContext>*/
70 }
71 RET_LABEL:;
72 }
73 /* method modelbuilder$ToolContext$make_main_module for (self: ToolContext, Array[MModule]): MModule */
74 val* nitc__modelbuilder___ToolContext___make_main_module(val* self, val* p0) {
75 val* var /* : MModule */;
76 val* var_mmodules /* var mmodules: Array[MModule] */;
77 short int var1 /* : Bool */;
78 short int var2 /* : Bool */;
79 val* var3 /* : MModule */;
80 val* var4 /* : ModelBuilder */;
81 val* var5 /* : Model */;
82 val* var7 /* : Model */;
83 val* var8 /* : nullable Object */;
84 val* var9 /* : String */;
85 val* var11 /* : String */;
86 static val* varonce;
87 val* var12 /* : String */;
88 char* var13 /* : CString */;
89 val* var14 /* : String */;
90 val* var15 /* : nullable Int */;
91 val* var16 /* : nullable Int */;
92 val* var17 /* : nullable Bool */;
93 val* var18 /* : nullable Bool */;
94 val* var19 /* : Text */;
95 val* var20 /* : Location */;
96 val* var21 /* : nullable Object */;
97 val* var22 /* : Location */;
98 val* var24 /* : Location */;
99 val* var25 /* : nullable SourceFile */;
100 val* var27 /* : nullable SourceFile */;
101 val* var_mainmodule /* var mainmodule: nullable Object */;
102 val* var29 /* : nullable Object */;
103 val* var30 /* : MModule */;
104 val* var32 /* : MModule */;
105 val* var34 /* : ModelBuilder */;
106 short int var35 /* : Bool */;
107 val* var36 /* : POSetElement[MModule] */;
108 val* var38 /* : POSetElement[MModule] */;
109 val* var39 /* : Collection[nullable Object] */;
110 long var40 /* : Int */;
111 short int var41 /* : Bool */;
112 short int var43 /* : Bool */;
113 short int var_ /* var : Bool */;
114 val* var44 /* : POSetElement[MModule] */;
115 val* var46 /* : POSetElement[MModule] */;
116 val* var47 /* : Collection[nullable Object] */;
117 val* var48 /* : nullable Object */;
118 val* var49 /* : nullable Object */;
119 short int var50 /* : Bool */;
120 val* var_other /* var other: nullable Object */;
121 short int var52 /* : Bool */;
122 short int var54 /* : Bool */;
123 val* var55 /* : nullable Object */;
124 val* var56 /* : ModelBuilder */;
125 var_mmodules = p0;
126 {
127 var1 = core___core__AbstractArrayRead___core__abstract_collection__Collection__is_empty(var_mmodules);
128 }
129 var2 = !var1;
130 if (unlikely(!var2)) {
131 if(catchStack.cursor >= 0){
132 longjmp(catchStack.envs[catchStack.cursor], 1);
133 }
134 PRINT_ERROR("Runtime error: %s", "Assert failed");
135 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__modelbuilder, 39);
136 fatal_exit(1);
137 }
138 var3 = NEW_nitc__MModule(&type_nitc__MModule);
139 {
140 var4 = nitc__modelbuilder_base___ToolContext___modelbuilder(self);
141 }
142 {
143 { /* Inline modelbuilder_base$ModelBuilder$model (var4) on <var4:ModelBuilder> */
144 var7 = var4->attrs[COLOR_nitc__modelbuilder_base__ModelBuilder___model].val; /* _model on <var4:ModelBuilder> */
145 if (unlikely(var7 == NULL)) {
146 if(catchStack.cursor >= 0){
147 longjmp(catchStack.envs[catchStack.cursor], 1);
148 }
149 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _model");
150 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__modelbuilder_base, 44);
151 fatal_exit(1);
152 }
153 var5 = var7;
154 RET_LABEL6:(void)0;
155 }
156 }
157 {
158 var8 = core___core__SequenceRead___Collection__first(var_mmodules);
159 }
160 {
161 { /* Inline mmodule$MModule$name (var8) on <var8:nullable Object(MModule)> */
162 var11 = var8->attrs[COLOR_nitc__mmodule__MModule___name].val; /* _name on <var8:nullable Object(MModule)> */
163 if (unlikely(var11 == NULL)) {
164 if(catchStack.cursor >= 0){
165 longjmp(catchStack.envs[catchStack.cursor], 1);
166 }
167 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _name");
168 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__mmodule, 100);
169 fatal_exit(1);
170 }
171 var9 = var11;
172 RET_LABEL10:(void)0;
173 }
174 }
175 if (likely(varonce!=NULL)) {
176 var12 = varonce;
177 } else {
178 var13 = "-m";
179 var15 = (val*)(2l<<2|1);
180 var16 = (val*)(2l<<2|1);
181 var17 = (val*)((long)(0)<<2|3);
182 var18 = (val*)((long)(0)<<2|3);
183 var14 = core__flat___CString___to_s_unsafe(var13, var15, var16, var17, var18);
184 var12 = var14;
185 varonce = var12;
186 }
187 {
188 var19 = ((val*(*)(val* self, val* p0))(var9->class->vft[COLOR_core__abstract_text__Text___43d]))(var9, var12); /* + on <var9:String>*/
189 }
190 var20 = NEW_nitc__Location(&type_nitc__Location);
191 {
192 var21 = core___core__SequenceRead___Collection__first(var_mmodules);
193 }
194 {
195 { /* Inline mmodule$MModule$location (var21) on <var21:nullable Object(MModule)> */
196 var24 = var21->attrs[COLOR_nitc__mmodule__MModule___location].val; /* _location on <var21:nullable Object(MModule)> */
197 if (unlikely(var24 == NULL)) {
198 if(catchStack.cursor >= 0){
199 longjmp(catchStack.envs[catchStack.cursor], 1);
200 }
201 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _location");
202 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__mmodule, 103);
203 fatal_exit(1);
204 }
205 var22 = var24;
206 RET_LABEL23:(void)0;
207 }
208 }
209 {
210 { /* Inline location$Location$file (var22) on <var22:Location> */
211 var27 = var22->attrs[COLOR_nitc__location__Location___file].val; /* _file on <var22:Location> */
212 var25 = var27;
213 RET_LABEL26:(void)0;
214 }
215 }
216 {
217 ((void(*)(val* self, val* p0))(var20->class->vft[COLOR_nitc__location__Location__file_61d]))(var20, var25); /* file= on <var20:Location>*/
218 }
219 {
220 ((void(*)(val* self, long p0))(var20->class->vft[COLOR_nitc__location__Location__line_start_61d]))(var20, 0l); /* line_start= on <var20:Location>*/
221 }
222 {
223 ((void(*)(val* self, long p0))(var20->class->vft[COLOR_nitc__location__Location__line_end_61d]))(var20, 0l); /* line_end= on <var20:Location>*/
224 }
225 {
226 ((void(*)(val* self, long p0))(var20->class->vft[COLOR_nitc__location__Location__column_start_61d]))(var20, 0l); /* column_start= on <var20:Location>*/
227 }
228 {
229 ((void(*)(val* self, long p0))(var20->class->vft[COLOR_nitc__location__Location__column_end_61d]))(var20, 0l); /* column_end= on <var20:Location>*/
230 }
231 {
232 ((void(*)(val* self))(var20->class->vft[COLOR_core__kernel__Object__init]))(var20); /* init on <var20:Location>*/
233 }
234 {
235 ((void(*)(val* self, val* p0))(var3->class->vft[COLOR_nitc__mmodule__MModule__model_61d]))(var3, var5); /* model= on <var3:MModule>*/
236 }
237 {
238 ((void(*)(val* self, val* p0))(var3->class->vft[COLOR_nitc__mmodule__MModule__mgroup_61d]))(var3, ((val*)NULL)); /* mgroup= on <var3:MModule>*/
239 }
240 {
241 ((void(*)(val* self, val* p0))(var3->class->vft[COLOR_nitc__mmodule__MModule__name_61d]))(var3, var19); /* name= on <var3:MModule>*/
242 }
243 {
244 ((void(*)(val* self, val* p0))(var3->class->vft[COLOR_nitc__mmodule__MModule__location_61d]))(var3, var20); /* location= on <var3:MModule>*/
245 }
246 {
247 ((void(*)(val* self))(var3->class->vft[COLOR_core__kernel__Object__init]))(var3); /* init on <var3:MModule>*/
248 }
249 var_mainmodule = var3;
250 {
251 { /* Inline model_base$MEntity$is_fictive= (var_mainmodule,1) on <var_mainmodule:nullable Object(MModule)> */
252 var_mainmodule->attrs[COLOR_nitc__model_base__MEntity___is_fictive].s = 1; /* _is_fictive on <var_mainmodule:nullable Object(MModule)> */
253 RET_LABEL28:(void)0;
254 }
255 }
256 {
257 var29 = core___core__SequenceRead___Collection__first(var_mmodules);
258 }
259 {
260 { /* Inline mmodule$MModule$first_real_mmodule (var29) on <var29:nullable Object(MModule)> */
261 var32 = var29->attrs[COLOR_nitc__mmodule__MModule___first_real_mmodule].val; /* _first_real_mmodule on <var29:nullable Object(MModule)> */
262 if (unlikely(var32 == NULL)) {
263 if(catchStack.cursor >= 0){
264 longjmp(catchStack.envs[catchStack.cursor], 1);
265 }
266 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _first_real_mmodule");
267 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__mmodule, 260);
268 fatal_exit(1);
269 }
270 var30 = var32;
271 RET_LABEL31:(void)0;
272 }
273 }
274 {
275 { /* Inline mmodule$MModule$first_real_mmodule= (var_mainmodule,var30) on <var_mainmodule:nullable Object(MModule)> */
276 var_mainmodule->attrs[COLOR_nitc__mmodule__MModule___first_real_mmodule].val = var30; /* _first_real_mmodule on <var_mainmodule:nullable Object(MModule)> */
277 RET_LABEL33:(void)0;
278 }
279 }
280 {
281 nitc___nitc__MModule___set_imported_mmodules(var_mainmodule, var_mmodules); /* Direct call mmodule$MModule$set_imported_mmodules on <var_mainmodule:nullable Object(MModule)>*/
282 }
283 {
284 var34 = nitc__modelbuilder_base___ToolContext___modelbuilder(self);
285 }
286 {
287 nitc__loader___ModelBuilder___apply_conditional_importations(var34, var_mainmodule); /* Direct call loader$ModelBuilder$apply_conditional_importations on <var34:ModelBuilder>*/
288 }
289 {
290 { /* Inline mmodule$MModule$in_importation (var_mainmodule) on <var_mainmodule:nullable Object(MModule)> */
291 var38 = var_mainmodule->attrs[COLOR_nitc__mmodule__MModule___in_importation].val; /* _in_importation on <var_mainmodule:nullable Object(MModule)> */
292 if (unlikely(var38 == NULL)) {
293 if(catchStack.cursor >= 0){
294 longjmp(catchStack.envs[catchStack.cursor], 1);
295 }
296 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _in_importation");
297 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__mmodule, 108);
298 fatal_exit(1);
299 }
300 var36 = var38;
301 RET_LABEL37:(void)0;
302 }
303 }
304 {
305 var39 = poset___poset__POSetElement___direct_greaters(var36);
306 }
307 {
308 var40 = ((long(*)(val* self))((((long)var39&3)?class_info[((long)var39&3)]:var39->class)->vft[COLOR_core__abstract_collection__Collection__length]))(var39); /* length on <var39:Collection[nullable Object](Collection[MModule])>*/
309 }
310 {
311 { /* Inline kernel$Int$== (var40,1l) on <var40:Int> */
312 var43 = var40 == 1l;
313 var41 = var43;
314 goto RET_LABEL42;
315 RET_LABEL42:(void)0;
316 }
317 }
318 var_ = var41;
319 if (var41){
320 {
321 { /* Inline mmodule$MModule$in_importation (var_mainmodule) on <var_mainmodule:nullable Object(MModule)> */
322 var46 = var_mainmodule->attrs[COLOR_nitc__mmodule__MModule___in_importation].val; /* _in_importation on <var_mainmodule:nullable Object(MModule)> */
323 if (unlikely(var46 == NULL)) {
324 if(catchStack.cursor >= 0){
325 longjmp(catchStack.envs[catchStack.cursor], 1);
326 }
327 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _in_importation");
328 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__mmodule, 108);
329 fatal_exit(1);
330 }
331 var44 = var46;
332 RET_LABEL45:(void)0;
333 }
334 }
335 {
336 var47 = poset___poset__POSetElement___direct_greaters(var44);
337 }
338 {
339 var48 = ((val*(*)(val* self))((((long)var47&3)?class_info[((long)var47&3)]:var47->class)->vft[COLOR_core__abstract_collection__Collection__first]))(var47); /* first on <var47:Collection[nullable Object](Collection[MModule])>*/
340 }
341 {
342 var49 = core___core__SequenceRead___Collection__first(var_mmodules);
343 }
344 {
345 { /* Inline kernel$Object$== (var48,var49) on <var48:nullable Object(MModule)> */
346 var_other = var49;
347 {
348 { /* Inline kernel$Object$is_same_instance (var48,var_other) on <var48:nullable Object(MModule)> */
349 var54 = var48 == var_other;
350 var52 = var54;
351 goto RET_LABEL53;
352 RET_LABEL53:(void)0;
353 }
354 }
355 var50 = var52;
356 goto RET_LABEL51;
357 RET_LABEL51:(void)0;
358 }
359 }
360 var35 = var50;
361 } else {
362 var35 = var_;
363 }
364 if (var35){
365 {
366 var55 = core___core__SequenceRead___Collection__first(var_mmodules);
367 }
368 var_mainmodule = var55;
369 } else {
370 {
371 var56 = nitc__modelbuilder_base___ToolContext___modelbuilder(self);
372 }
373 {
374 nitc__modelbuilder___ModelBuilder___run_phases(var56); /* Direct call modelbuilder$ModelBuilder$run_phases on <var56:ModelBuilder>*/
375 }
376 }
377 var = var_mainmodule;
378 goto RET_LABEL;
379 RET_LABEL:;
380 return var;
381 }
382 /* method modelbuilder$ToolContext$run_global_phases for (self: ToolContext, Array[MModule]) */
383 void nitc__modelbuilder___ToolContext___run_global_phases(val* self, val* p0) {
384 val* var_mmodules /* var mmodules: Array[MModule] */;
385 short int var /* : Bool */;
386 short int var1 /* : Bool */;
387 val* var2 /* : MModule */;
388 val* var_mainmodule /* var mainmodule: MModule */;
389 val* var3 /* : Sequence[Phase] */;
390 val* var_ /* var : Sequence[Phase] */;
391 val* var4 /* : Iterator[nullable Object] */;
392 val* var_5 /* var : IndexedIterator[Phase] */;
393 short int var6 /* : Bool */;
394 val* var7 /* : nullable Object */;
395 val* var_phase /* var phase: Phase */;
396 short int var8 /* : Bool */;
397 short int var10 /* : Bool */;
398 short int var12 /* : Bool */;
399 var_mmodules = p0;
400 {
401 var = core___core__AbstractArrayRead___core__abstract_collection__Collection__is_empty(var_mmodules);
402 }
403 var1 = !var;
404 if (var1){
405 {
406 var2 = nitc__mixin___ToolContext___make_main_module(self, var_mmodules);
407 }
408 var_mainmodule = var2;
409 {
410 var3 = nitc__phase___ToolContext___phases_list(self);
411 }
412 var_ = var3;
413 {
414 var4 = ((val*(*)(val* self))((((long)var_&3)?class_info[((long)var_&3)]:var_->class)->vft[COLOR_core__abstract_collection__Collection__iterator]))(var_); /* iterator on <var_:Sequence[Phase]>*/
415 }
416 var_5 = var4;
417 for(;;) {
418 {
419 var6 = ((short int(*)(val* self))((((long)var_5&3)?class_info[((long)var_5&3)]:var_5->class)->vft[COLOR_core__abstract_collection__Iterator__is_ok]))(var_5); /* is_ok on <var_5:IndexedIterator[Phase]>*/
420 }
421 if (var6){
422 } else {
423 goto BREAK_label;
424 }
425 {
426 var7 = ((val*(*)(val* self))((((long)var_5&3)?class_info[((long)var_5&3)]:var_5->class)->vft[COLOR_core__abstract_collection__Iterator__item]))(var_5); /* item on <var_5:IndexedIterator[Phase]>*/
427 }
428 var_phase = var7;
429 {
430 { /* Inline phase$Phase$disabled (var_phase) on <var_phase:Phase> */
431 var10 = var_phase->attrs[COLOR_nitc__phase__Phase___disabled].s; /* _disabled on <var_phase:Phase> */
432 var8 = var10;
433 RET_LABEL9:(void)0;
434 }
435 }
436 if (var8){
437 goto BREAK_label11;
438 } else {
439 }
440 {
441 ((void(*)(val* self, val* p0, val* p1))(var_phase->class->vft[COLOR_nitc__modelbuilder__Phase__process_mainmodule]))(var_phase, var_mainmodule, var_mmodules); /* process_mainmodule on <var_phase:Phase>*/
442 }
443 BREAK_label11: (void)0;
444 {
445 ((void(*)(val* self))((((long)var_5&3)?class_info[((long)var_5&3)]:var_5->class)->vft[COLOR_core__abstract_collection__Iterator__next]))(var_5); /* next on <var_5:IndexedIterator[Phase]>*/
446 }
447 }
448 BREAK_label: (void)0;
449 {
450 ((void(*)(val* self))((((long)var_5&3)?class_info[((long)var_5&3)]:var_5->class)->vft[COLOR_core__abstract_collection__Iterator__finish]))(var_5); /* finish on <var_5:IndexedIterator[Phase]>*/
451 }
452 } else {
453 }
454 {
455 var12 = nitc___nitc__ToolContext___check_errors(self);
456 }
457 {
458 nitc___nitc__ToolContext___errors_info(self); /* Direct call toolcontext$ToolContext$errors_info on <self:ToolContext>*/
459 }
460 RET_LABEL:;
461 }
462 /* method modelbuilder$Phase$process_mainmodule for (self: Phase, MModule, SequenceRead[MModule]) */
463 void nitc__modelbuilder___Phase___process_mainmodule(val* self, val* p0, val* p1) {
464 val* var_mainmodule /* var mainmodule: MModule */;
465 val* var_given_mmodules /* var given_mmodules: SequenceRead[MModule] */;
466 var_mainmodule = p0;
467 var_given_mmodules = p1;
468 RET_LABEL:;
469 }
470 /* method modelbuilder$ModelBuilder$run_phases for (self: ModelBuilder) */
471 void nitc__modelbuilder___ModelBuilder___run_phases(val* self) {
472 val* var /* : Array[MModule] */;
473 val* var2 /* : Array[MModule] */;
474 val* var3 /* : Array[nullable Object] */;
475 val* var_mmodules /* var mmodules: Array[MModule] */;
476 val* var4 /* : Model */;
477 val* var6 /* : Model */;
478 val* var7 /* : POSet[MModule] */;
479 val* var9 /* : POSet[MModule] */;
480 val* var10 /* : Array[AModule] */;
481 val* var_nmodules /* var nmodules: Array[AModule] */;
482 val* var_ /* var : Array[MModule] */;
483 val* var11 /* : IndexedIterator[nullable Object] */;
484 val* var_12 /* var : IndexedIterator[MModule] */;
485 short int var13 /* : Bool */;
486 val* var14 /* : nullable Object */;
487 val* var_mm /* var mm: MModule */;
488 short int var15 /* : Bool */;
489 short int var17 /* : Bool */;
490 val* var19 /* : nullable AModule */;
491 val* var20 /* : ToolContext */;
492 val* var22 /* : ToolContext */;
493 val* var23 /* : ToolContext */;
494 val* var25 /* : ToolContext */;
495 val* var26 /* : OptionBool */;
496 val* var28 /* : OptionBool */;
497 val* var29 /* : nullable Object */;
498 val* var31 /* : nullable Object */;
499 short int var32 /* : Bool */;
500 val* var33 /* : ToolContext */;
501 val* var35 /* : ToolContext */;
502 static val* varonce;
503 val* var36 /* : String */;
504 char* var37 /* : CString */;
505 val* var38 /* : String */;
506 val* var39 /* : nullable Int */;
507 val* var40 /* : nullable Int */;
508 val* var41 /* : nullable Bool */;
509 val* var42 /* : nullable Bool */;
510 val* var43 /* : ToolContext */;
511 val* var45 /* : ToolContext */;
512 {
513 { /* Inline loader$ModelBuilder$parsed_modules (self) on <self:ModelBuilder> */
514 var2 = self->attrs[COLOR_nitc__loader__ModelBuilder___parsed_modules].val; /* _parsed_modules on <self:ModelBuilder> */
515 if (unlikely(var2 == NULL)) {
516 if(catchStack.cursor >= 0){
517 longjmp(catchStack.envs[catchStack.cursor], 1);
518 }
519 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _parsed_modules");
520 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__loader, 325);
521 fatal_exit(1);
522 }
523 var = var2;
524 RET_LABEL1:(void)0;
525 }
526 }
527 {
528 var3 = core__array___Collection___to_a(var);
529 }
530 var_mmodules = var3;
531 {
532 { /* Inline modelbuilder_base$ModelBuilder$model (self) on <self:ModelBuilder> */
533 var6 = self->attrs[COLOR_nitc__modelbuilder_base__ModelBuilder___model].val; /* _model on <self:ModelBuilder> */
534 if (unlikely(var6 == NULL)) {
535 if(catchStack.cursor >= 0){
536 longjmp(catchStack.envs[catchStack.cursor], 1);
537 }
538 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _model");
539 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__modelbuilder_base, 44);
540 fatal_exit(1);
541 }
542 var4 = var6;
543 RET_LABEL5:(void)0;
544 }
545 }
546 {
547 { /* Inline mmodule$Model$mmodule_importation_hierarchy (var4) on <var4:Model> */
548 var9 = var4->attrs[COLOR_nitc__mmodule__Model___mmodule_importation_hierarchy].val; /* _mmodule_importation_hierarchy on <var4:Model> */
549 if (unlikely(var9 == NULL)) {
550 if(catchStack.cursor >= 0){
551 longjmp(catchStack.envs[catchStack.cursor], 1);
552 }
553 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _mmodule_importation_hierarchy");
554 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__mmodule, 33);
555 fatal_exit(1);
556 }
557 var7 = var9;
558 RET_LABEL8:(void)0;
559 }
560 }
561 {
562 core___core__Comparator___sort(var7, var_mmodules); /* Direct call sorter$Comparator$sort on <var7:POSet[MModule]>*/
563 }
564 var10 = NEW_core__Array(&type_core__Array__nitc__AModule);
565 {
566 core___core__Array___core__kernel__Object__init(var10); /* Direct call array$Array$init on <var10:Array[AModule]>*/
567 }
568 var_nmodules = var10;
569 var_ = var_mmodules;
570 {
571 var11 = core___core__AbstractArrayRead___core__abstract_collection__Collection__iterator(var_);
572 }
573 var_12 = var11;
574 for(;;) {
575 {
576 var13 = ((short int(*)(val* self))((((long)var_12&3)?class_info[((long)var_12&3)]:var_12->class)->vft[COLOR_core__abstract_collection__Iterator__is_ok]))(var_12); /* is_ok on <var_12:IndexedIterator[MModule]>*/
577 }
578 if (var13){
579 } else {
580 goto BREAK_label;
581 }
582 {
583 var14 = ((val*(*)(val* self))((((long)var_12&3)?class_info[((long)var_12&3)]:var_12->class)->vft[COLOR_core__abstract_collection__Iterator__item]))(var_12); /* item on <var_12:IndexedIterator[MModule]>*/
584 }
585 var_mm = var14;
586 {
587 { /* Inline model_base$MEntity$is_fictive (var_mm) on <var_mm:MModule> */
588 var17 = var_mm->attrs[COLOR_nitc__model_base__MEntity___is_fictive].s; /* _is_fictive on <var_mm:MModule> */
589 var15 = var17;
590 RET_LABEL16:(void)0;
591 }
592 }
593 if (var15){
594 goto BREAK_label18;
595 } else {
596 }
597 {
598 var19 = nitc__loader___ModelBuilder___mmodule2node(self, var_mm);
599 }
600 if (unlikely(var19 == NULL)) {
601 if(catchStack.cursor >= 0){
602 longjmp(catchStack.envs[catchStack.cursor], 1);
603 }
604 PRINT_ERROR("Runtime error: %s", "Cast failed");
605 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__modelbuilder, 100);
606 fatal_exit(1);
607 }
608 {
609 core___core__Array___core__abstract_collection__SimpleCollection__add(var_nmodules, var19); /* Direct call array$Array$add on <var_nmodules:Array[AModule]>*/
610 }
611 BREAK_label18: (void)0;
612 {
613 ((void(*)(val* self))((((long)var_12&3)?class_info[((long)var_12&3)]:var_12->class)->vft[COLOR_core__abstract_collection__Iterator__next]))(var_12); /* next on <var_12:IndexedIterator[MModule]>*/
614 }
615 }
616 BREAK_label: (void)0;
617 {
618 ((void(*)(val* self))((((long)var_12&3)?class_info[((long)var_12&3)]:var_12->class)->vft[COLOR_core__abstract_collection__Iterator__finish]))(var_12); /* finish on <var_12:IndexedIterator[MModule]>*/
619 }
620 {
621 { /* Inline modelbuilder_base$ModelBuilder$toolcontext (self) on <self:ModelBuilder> */
622 var22 = self->attrs[COLOR_nitc__modelbuilder_base__ModelBuilder___toolcontext].val; /* _toolcontext on <self:ModelBuilder> */
623 if (unlikely(var22 == NULL)) {
624 if(catchStack.cursor >= 0){
625 longjmp(catchStack.envs[catchStack.cursor], 1);
626 }
627 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _toolcontext");
628 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__modelbuilder_base, 47);
629 fatal_exit(1);
630 }
631 var20 = var22;
632 RET_LABEL21:(void)0;
633 }
634 }
635 {
636 nitc__phase___ToolContext___run_phases(var20, var_nmodules); /* Direct call phase$ToolContext$run_phases on <var20:ToolContext>*/
637 }
638 {
639 { /* Inline modelbuilder_base$ModelBuilder$toolcontext (self) on <self:ModelBuilder> */
640 var25 = self->attrs[COLOR_nitc__modelbuilder_base__ModelBuilder___toolcontext].val; /* _toolcontext on <self:ModelBuilder> */
641 if (unlikely(var25 == NULL)) {
642 if(catchStack.cursor >= 0){
643 longjmp(catchStack.envs[catchStack.cursor], 1);
644 }
645 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _toolcontext");
646 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__modelbuilder_base, 47);
647 fatal_exit(1);
648 }
649 var23 = var25;
650 RET_LABEL24:(void)0;
651 }
652 }
653 {
654 { /* Inline loader$ToolContext$opt_only_metamodel (var23) on <var23:ToolContext> */
655 var28 = var23->attrs[COLOR_nitc__loader__ToolContext___opt_only_metamodel].val; /* _opt_only_metamodel on <var23:ToolContext> */
656 if (unlikely(var28 == NULL)) {
657 if(catchStack.cursor >= 0){
658 longjmp(catchStack.envs[catchStack.cursor], 1);
659 }
660 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _opt_only_metamodel");
661 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__loader, 47);
662 fatal_exit(1);
663 }
664 var26 = var28;
665 RET_LABEL27:(void)0;
666 }
667 }
668 {
669 { /* Inline opts$Option$value (var26) on <var26:OptionBool> */
670 var31 = var26->attrs[COLOR_opts__Option___value].val; /* _value on <var26:OptionBool> */
671 var29 = var31;
672 RET_LABEL30:(void)0;
673 }
674 }
675 var32 = (short int)((long)(var29)>>2);
676 if (var32){
677 {
678 { /* Inline modelbuilder_base$ModelBuilder$toolcontext (self) on <self:ModelBuilder> */
679 var35 = self->attrs[COLOR_nitc__modelbuilder_base__ModelBuilder___toolcontext].val; /* _toolcontext on <self:ModelBuilder> */
680 if (unlikely(var35 == NULL)) {
681 if(catchStack.cursor >= 0){
682 longjmp(catchStack.envs[catchStack.cursor], 1);
683 }
684 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _toolcontext");
685 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__modelbuilder_base, 47);
686 fatal_exit(1);
687 }
688 var33 = var35;
689 RET_LABEL34:(void)0;
690 }
691 }
692 if (likely(varonce!=NULL)) {
693 var36 = varonce;
694 } else {
695 var37 = "*** ONLY METAMODEL";
696 var39 = (val*)(18l<<2|1);
697 var40 = (val*)(18l<<2|1);
698 var41 = (val*)((long)(0)<<2|3);
699 var42 = (val*)((long)(0)<<2|3);
700 var38 = core__flat___CString___to_s_unsafe(var37, var39, var40, var41, var42);
701 var36 = var38;
702 varonce = var36;
703 }
704 {
705 nitc___nitc__ToolContext___info(var33, var36, 1l); /* Direct call toolcontext$ToolContext$info on <var33:ToolContext>*/
706 }
707 {
708 { /* Inline modelbuilder_base$ModelBuilder$toolcontext (self) on <self:ModelBuilder> */
709 var45 = self->attrs[COLOR_nitc__modelbuilder_base__ModelBuilder___toolcontext].val; /* _toolcontext on <self:ModelBuilder> */
710 if (unlikely(var45 == NULL)) {
711 if(catchStack.cursor >= 0){
712 longjmp(catchStack.envs[catchStack.cursor], 1);
713 }
714 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _toolcontext");
715 PRINT_ERROR(" (%s:%d)\n", FILE_nitc__modelbuilder_base, 47);
716 fatal_exit(1);
717 }
718 var43 = var45;
719 RET_LABEL44:(void)0;
720 }
721 }
722 {
723 nitc___nitc__ToolContext___quit(var43); /* Direct call toolcontext$ToolContext$quit on <var43:ToolContext>*/
724 }
725 } else {
726 }
727 RET_LABEL:;
728 }