c_src: update
[nit.git] / c_src / toolcontext._sep.c
1 /* This C file is generated by NIT to compile module toolcontext. */
2 #include "toolcontext._sep.h"
3 val_t toolcontext___Message___location(val_t p0){
4 struct {struct stack_frame_t me;} fra;
5 val_t tmp;
6 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
7 fra.me.file = LOCATE_toolcontext;
8 fra.me.line = 29;
9 fra.me.meth = LOCATE_toolcontext___Message___location;
10 fra.me.has_broke = 0;
11 fra.me.REG_size = 1;
12 fra.me.nitni_local_ref_head = NULL;
13 fra.me.REG[0] = NIT_NULL;
14 fra.me.REG[0] = p0;
15 /* toolcontext.nit:29 */
16 fra.me.REG[0] = ATTR_toolcontext___Message____location(fra.me.REG[0]);
17 stack_frame_head = fra.me.prev;
18 return fra.me.REG[0];
19 }
20 val_t toolcontext___Message___text(val_t p0){
21 struct {struct stack_frame_t me;} fra;
22 val_t REGB0;
23 val_t tmp;
24 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
25 fra.me.file = LOCATE_toolcontext;
26 fra.me.line = 30;
27 fra.me.meth = LOCATE_toolcontext___Message___text;
28 fra.me.has_broke = 0;
29 fra.me.REG_size = 1;
30 fra.me.nitni_local_ref_head = NULL;
31 fra.me.REG[0] = NIT_NULL;
32 fra.me.REG[0] = p0;
33 /* toolcontext.nit:30 */
34 REGB0 = TAG_Bool(ATTR_toolcontext___Message____text(fra.me.REG[0])!=NIT_NULL);
35 if (UNTAG_Bool(REGB0)) {
36 } else {
37 nit_abort("Uninitialized attribute %s", "_text", LOCATE_toolcontext, 30);
38 }
39 fra.me.REG[0] = ATTR_toolcontext___Message____text(fra.me.REG[0]);
40 stack_frame_head = fra.me.prev;
41 return fra.me.REG[0];
42 }
43 val_t toolcontext___Message_____l(val_t p0, val_t p1){
44 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
45 val_t REGB0;
46 val_t REGB1;
47 val_t REGB2;
48 val_t tmp;
49 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
50 fra.me.file = LOCATE_toolcontext;
51 fra.me.line = 32;
52 fra.me.meth = LOCATE_toolcontext___Message_____l;
53 fra.me.has_broke = 0;
54 fra.me.REG_size = 4;
55 fra.me.nitni_local_ref_head = NULL;
56 fra.me.REG[0] = NIT_NULL;
57 fra.me.REG[1] = NIT_NULL;
58 fra.me.REG[2] = NIT_NULL;
59 fra.me.REG[3] = NIT_NULL;
60 fra.me.REG[0] = p0;
61 fra.me.REG[1] = p1;
62 REGB0 = TAG_Bool(VAL_ISA(fra.me.REG[1], VTCOLOR_standard___kernel___Comparable___OTHER(fra.me.REG[0]), VTID_standard___kernel___Comparable___OTHER(fra.me.REG[0]))) /*cast OTHER*/;
63 if (UNTAG_Bool(REGB0)) {
64 } else {
65 nit_abort("Cast failed", NULL, LOCATE_toolcontext, 0);
66 }
67 /* toolcontext.nit:32 */
68 fra.me.REG[2] = fra.me.REG[0];
69 /* toolcontext.nit:33 */
70 fra.me.REG[3] = CALL_toolcontext___Message___location(fra.me.REG[2])(fra.me.REG[2]);
71 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
72 if (UNTAG_Bool(REGB0)) {
73 } else {
74 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
75 if (UNTAG_Bool(REGB1)) {
76 REGB1 = TAG_Bool(false);
77 REGB0 = REGB1;
78 } else {
79 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[3])(fra.me.REG[3], NIT_NULL);
80 REGB0 = REGB1;
81 }
82 }
83 if (UNTAG_Bool(REGB0)) {
84 REGB0 = TAG_Bool(true);
85 goto label1;
86 }
87 /* toolcontext.nit:34 */
88 fra.me.REG[3] = CALL_toolcontext___Message___location(fra.me.REG[1])(fra.me.REG[1]);
89 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
90 if (UNTAG_Bool(REGB1)) {
91 } else {
92 REGB2 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
93 if (UNTAG_Bool(REGB2)) {
94 REGB2 = TAG_Bool(false);
95 REGB1 = REGB2;
96 } else {
97 REGB2 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[3])(fra.me.REG[3], NIT_NULL);
98 REGB1 = REGB2;
99 }
100 }
101 if (UNTAG_Bool(REGB1)) {
102 REGB1 = TAG_Bool(false);
103 REGB0 = REGB1;
104 goto label1;
105 }
106 /* toolcontext.nit:36 */
107 fra.me.REG[2] = CALL_toolcontext___Message___location(fra.me.REG[2])(fra.me.REG[2]);
108 REGB1 = TAG_Bool(fra.me.REG[2]!=NIT_NULL);
109 if (UNTAG_Bool(REGB1)) {
110 } else {
111 nit_abort("Cast failed", NULL, LOCATE_toolcontext, 36);
112 }
113 fra.me.REG[1] = CALL_toolcontext___Message___location(fra.me.REG[1])(fra.me.REG[1]);
114 REGB1 = TAG_Bool(fra.me.REG[1]!=NIT_NULL);
115 if (UNTAG_Bool(REGB1)) {
116 } else {
117 nit_abort("Cast failed", NULL, LOCATE_toolcontext, 36);
118 }
119 REGB1 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
120 if (UNTAG_Bool(REGB1)) {
121 nit_abort("Reciever is null", NULL, LOCATE_toolcontext, 36);
122 }
123 REGB1 = CALL_standard___kernel___Comparable_____l(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
124 REGB0 = REGB1;
125 goto label1;
126 label1: while(0);
127 stack_frame_head = fra.me.prev;
128 return REGB0;
129 }
130 val_t toolcontext___Message___to_s(val_t p0){
131 struct {struct stack_frame_t me; val_t MORE_REG[4];} fra;
132 val_t REGB0;
133 val_t REGB1;
134 val_t tmp;
135 static val_t once_value_2; /* Once value */
136 static val_t once_value_3; /* Once value */
137 static val_t once_value_4; /* Once value */
138 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
139 fra.me.file = LOCATE_toolcontext;
140 fra.me.line = 39;
141 fra.me.meth = LOCATE_toolcontext___Message___to_s;
142 fra.me.has_broke = 0;
143 fra.me.REG_size = 5;
144 fra.me.nitni_local_ref_head = NULL;
145 fra.me.REG[0] = NIT_NULL;
146 fra.me.REG[1] = NIT_NULL;
147 fra.me.REG[2] = NIT_NULL;
148 fra.me.REG[3] = NIT_NULL;
149 fra.me.REG[4] = NIT_NULL;
150 fra.me.REG[0] = p0;
151 /* toolcontext.nit:41 */
152 fra.me.REG[1] = CALL_toolcontext___Message___location(fra.me.REG[0])(fra.me.REG[0]);
153 /* toolcontext.nit:42 */
154 REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
155 if (UNTAG_Bool(REGB0)) {
156 } else {
157 REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
158 if (UNTAG_Bool(REGB1)) {
159 REGB1 = TAG_Bool(false);
160 REGB0 = REGB1;
161 } else {
162 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL);
163 REGB0 = REGB1;
164 }
165 }
166 if (UNTAG_Bool(REGB0)) {
167 /* toolcontext.nit:43 */
168 fra.me.REG[2] = CALL_toolcontext___Message___text(fra.me.REG[0])(fra.me.REG[0]);
169 goto label1;
170 } else {
171 /* toolcontext.nit:45 */
172 REGB0 = TAG_Int(5);
173 fra.me.REG[3] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
174 if (!once_value_2) {
175 fra.me.REG[4] = BOX_NativeString("");
176 REGB0 = TAG_Int(0);
177 fra.me.REG[4] = NEW_String_standard___string___String___with_native(fra.me.REG[4], REGB0);
178 once_value_2 = fra.me.REG[4];
179 register_static_object(&once_value_2);
180 } else fra.me.REG[4] = once_value_2;
181 fra.me.REG[4] = fra.me.REG[4];
182 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]);
183 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
184 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]);
185 if (!once_value_3) {
186 fra.me.REG[1] = BOX_NativeString(": ");
187 REGB0 = TAG_Int(2);
188 fra.me.REG[1] = NEW_String_standard___string___String___with_native(fra.me.REG[1], REGB0);
189 once_value_3 = fra.me.REG[1];
190 register_static_object(&once_value_3);
191 } else fra.me.REG[1] = once_value_3;
192 fra.me.REG[1] = fra.me.REG[1];
193 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]);
194 fra.me.REG[0] = CALL_toolcontext___Message___text(fra.me.REG[0])(fra.me.REG[0]);
195 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[0]);
196 if (!once_value_4) {
197 fra.me.REG[0] = BOX_NativeString("");
198 REGB0 = TAG_Int(0);
199 fra.me.REG[0] = NEW_String_standard___string___String___with_native(fra.me.REG[0], REGB0);
200 once_value_4 = fra.me.REG[0];
201 register_static_object(&once_value_4);
202 } else fra.me.REG[0] = once_value_4;
203 fra.me.REG[0] = fra.me.REG[0];
204 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[0]);
205 fra.me.REG[3] = CALL_standard___string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]);
206 fra.me.REG[2] = fra.me.REG[3];
207 goto label1;
208 }
209 label1: while(0);
210 stack_frame_head = fra.me.prev;
211 return fra.me.REG[2];
212 }
213 val_t toolcontext___Message___to_color_string(val_t p0){
214 struct {struct stack_frame_t me; val_t MORE_REG[6];} fra;
215 val_t REGB0;
216 val_t REGB1;
217 val_t tmp;
218 static val_t once_value_1; /* Once value */
219 static val_t once_value_2; /* Once value */
220 static val_t once_value_3; /* Once value */
221 static val_t once_value_4; /* Once value */
222 static val_t once_value_5; /* Once value */
223 static val_t once_value_6; /* Once value */
224 static val_t once_value_7; /* Once value */
225 static val_t once_value_8; /* Once value */
226 static val_t once_value_9; /* Once value */
227 static val_t once_value_10; /* Once value */
228 static val_t once_value_12; /* Once value */
229 static val_t once_value_13; /* Once value */
230 static val_t once_value_14; /* Once value */
231 static val_t once_value_15; /* Once value */
232 static val_t once_value_16; /* Once value */
233 static val_t once_value_17; /* Once value */
234 static val_t once_value_18; /* Once value */
235 static val_t once_value_19; /* Once value */
236 static val_t once_value_20; /* Once value */
237 static val_t once_value_21; /* Once value */
238 static val_t once_value_22; /* Once value */
239 static val_t once_value_23; /* Once value */
240 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
241 fra.me.file = LOCATE_toolcontext;
242 fra.me.line = 49;
243 fra.me.meth = LOCATE_toolcontext___Message___to_color_string;
244 fra.me.has_broke = 0;
245 fra.me.REG_size = 7;
246 fra.me.nitni_local_ref_head = NULL;
247 fra.me.REG[0] = NIT_NULL;
248 fra.me.REG[1] = NIT_NULL;
249 fra.me.REG[2] = NIT_NULL;
250 fra.me.REG[3] = NIT_NULL;
251 fra.me.REG[4] = NIT_NULL;
252 fra.me.REG[5] = NIT_NULL;
253 fra.me.REG[6] = NIT_NULL;
254 fra.me.REG[0] = p0;
255 /* toolcontext.nit:51 */
256 REGB0 = TAG_Int(27);
257 /* ../lib/standard/kernel.nit:297 */
258 REGB0 = TAG_Char(UNTAG_Int(REGB0));
259 /* toolcontext.nit:52 */
260 REGB1 = TAG_Int(3);
261 fra.me.REG[1] = NEW_Array_standard___collection___array___Array___with_capacity(REGB1);
262 if (!once_value_1) {
263 fra.me.REG[2] = BOX_NativeString("");
264 REGB1 = TAG_Int(0);
265 fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB1);
266 once_value_1 = fra.me.REG[2];
267 register_static_object(&once_value_1);
268 } else fra.me.REG[2] = once_value_1;
269 fra.me.REG[2] = fra.me.REG[2];
270 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
271 fra.me.REG[2] = CALL_standard___string___Object___to_s(REGB0)(REGB0);
272 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
273 if (!once_value_2) {
274 fra.me.REG[2] = BOX_NativeString("[0;31m");
275 REGB1 = TAG_Int(6);
276 fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB1);
277 once_value_2 = fra.me.REG[2];
278 register_static_object(&once_value_2);
279 } else fra.me.REG[2] = once_value_2;
280 fra.me.REG[2] = fra.me.REG[2];
281 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
282 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
283 /* toolcontext.nit:53 */
284 REGB1 = TAG_Int(3);
285 fra.me.REG[1] = NEW_Array_standard___collection___array___Array___with_capacity(REGB1);
286 if (!once_value_3) {
287 fra.me.REG[2] = BOX_NativeString("");
288 REGB1 = TAG_Int(0);
289 fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB1);
290 once_value_3 = fra.me.REG[2];
291 register_static_object(&once_value_3);
292 } else fra.me.REG[2] = once_value_3;
293 fra.me.REG[2] = fra.me.REG[2];
294 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
295 fra.me.REG[2] = CALL_standard___string___Object___to_s(REGB0)(REGB0);
296 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
297 if (!once_value_4) {
298 fra.me.REG[2] = BOX_NativeString("[1;31m");
299 REGB1 = TAG_Int(6);
300 fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB1);
301 once_value_4 = fra.me.REG[2];
302 register_static_object(&once_value_4);
303 } else fra.me.REG[2] = once_value_4;
304 fra.me.REG[2] = fra.me.REG[2];
305 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
306 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
307 /* toolcontext.nit:54 */
308 REGB1 = TAG_Int(3);
309 fra.me.REG[1] = NEW_Array_standard___collection___array___Array___with_capacity(REGB1);
310 if (!once_value_5) {
311 fra.me.REG[2] = BOX_NativeString("");
312 REGB1 = TAG_Int(0);
313 fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB1);
314 once_value_5 = fra.me.REG[2];
315 register_static_object(&once_value_5);
316 } else fra.me.REG[2] = once_value_5;
317 fra.me.REG[2] = fra.me.REG[2];
318 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
319 fra.me.REG[2] = CALL_standard___string___Object___to_s(REGB0)(REGB0);
320 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
321 if (!once_value_6) {
322 fra.me.REG[2] = BOX_NativeString("[0;32m");
323 REGB1 = TAG_Int(6);
324 fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB1);
325 once_value_6 = fra.me.REG[2];
326 register_static_object(&once_value_6);
327 } else fra.me.REG[2] = once_value_6;
328 fra.me.REG[2] = fra.me.REG[2];
329 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
330 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
331 /* toolcontext.nit:55 */
332 REGB1 = TAG_Int(3);
333 fra.me.REG[1] = NEW_Array_standard___collection___array___Array___with_capacity(REGB1);
334 if (!once_value_7) {
335 fra.me.REG[2] = BOX_NativeString("");
336 REGB1 = TAG_Int(0);
337 fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB1);
338 once_value_7 = fra.me.REG[2];
339 register_static_object(&once_value_7);
340 } else fra.me.REG[2] = once_value_7;
341 fra.me.REG[2] = fra.me.REG[2];
342 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
343 fra.me.REG[2] = CALL_standard___string___Object___to_s(REGB0)(REGB0);
344 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
345 if (!once_value_8) {
346 fra.me.REG[2] = BOX_NativeString("[0;33m");
347 REGB1 = TAG_Int(6);
348 fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB1);
349 once_value_8 = fra.me.REG[2];
350 register_static_object(&once_value_8);
351 } else fra.me.REG[2] = once_value_8;
352 fra.me.REG[2] = fra.me.REG[2];
353 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
354 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
355 /* toolcontext.nit:56 */
356 REGB1 = TAG_Int(3);
357 fra.me.REG[2] = NEW_Array_standard___collection___array___Array___with_capacity(REGB1);
358 if (!once_value_9) {
359 fra.me.REG[3] = BOX_NativeString("");
360 REGB1 = TAG_Int(0);
361 fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB1);
362 once_value_9 = fra.me.REG[3];
363 register_static_object(&once_value_9);
364 } else fra.me.REG[3] = once_value_9;
365 fra.me.REG[3] = fra.me.REG[3];
366 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
367 fra.me.REG[3] = CALL_standard___string___Object___to_s(REGB0)(REGB0);
368 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
369 if (!once_value_10) {
370 fra.me.REG[3] = BOX_NativeString("[0m");
371 REGB0 = TAG_Int(3);
372 fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB0);
373 once_value_10 = fra.me.REG[3];
374 register_static_object(&once_value_10);
375 } else fra.me.REG[3] = once_value_10;
376 fra.me.REG[3] = fra.me.REG[3];
377 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
378 fra.me.REG[2] = CALL_standard___string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]);
379 /* toolcontext.nit:58 */
380 fra.me.REG[3] = CALL_toolcontext___Message___location(fra.me.REG[0])(fra.me.REG[0]);
381 /* toolcontext.nit:59 */
382 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
383 if (UNTAG_Bool(REGB0)) {
384 } else {
385 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
386 if (UNTAG_Bool(REGB1)) {
387 REGB1 = TAG_Bool(false);
388 REGB0 = REGB1;
389 } else {
390 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[3])(fra.me.REG[3], NIT_NULL);
391 REGB0 = REGB1;
392 }
393 }
394 if (UNTAG_Bool(REGB0)) {
395 /* toolcontext.nit:60 */
396 fra.me.REG[4] = CALL_toolcontext___Message___text(fra.me.REG[0])(fra.me.REG[0]);
397 goto label11;
398 } else {
399 /* toolcontext.nit:61 */
400 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
401 if (UNTAG_Bool(REGB0)) {
402 nit_abort("Reciever is null", NULL, LOCATE_toolcontext, 61);
403 }
404 fra.me.REG[5] = CALL_location___Location___file(fra.me.REG[3])(fra.me.REG[3]);
405 REGB0 = TAG_Bool(fra.me.REG[5]==NIT_NULL);
406 if (UNTAG_Bool(REGB0)) {
407 } else {
408 REGB1 = TAG_Bool(fra.me.REG[5]==NIT_NULL);
409 if (UNTAG_Bool(REGB1)) {
410 REGB1 = TAG_Bool(false);
411 REGB0 = REGB1;
412 } else {
413 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[5])(fra.me.REG[5], NIT_NULL);
414 REGB0 = REGB1;
415 }
416 }
417 if (UNTAG_Bool(REGB0)) {
418 /* toolcontext.nit:62 */
419 REGB0 = TAG_Int(9);
420 fra.me.REG[5] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
421 if (!once_value_12) {
422 fra.me.REG[6] = BOX_NativeString("");
423 REGB0 = TAG_Int(0);
424 fra.me.REG[6] = NEW_String_standard___string___String___with_native(fra.me.REG[6], REGB0);
425 once_value_12 = fra.me.REG[6];
426 register_static_object(&once_value_12);
427 } else fra.me.REG[6] = once_value_12;
428 fra.me.REG[6] = fra.me.REG[6];
429 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
430 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[1]);
431 if (!once_value_13) {
432 fra.me.REG[6] = BOX_NativeString("");
433 REGB0 = TAG_Int(0);
434 fra.me.REG[6] = NEW_String_standard___string___String___with_native(fra.me.REG[6], REGB0);
435 once_value_13 = fra.me.REG[6];
436 register_static_object(&once_value_13);
437 } else fra.me.REG[6] = once_value_13;
438 fra.me.REG[6] = fra.me.REG[6];
439 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
440 fra.me.REG[6] = CALL_standard___string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]);
441 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
442 if (!once_value_14) {
443 fra.me.REG[6] = BOX_NativeString("");
444 REGB0 = TAG_Int(0);
445 fra.me.REG[6] = NEW_String_standard___string___String___with_native(fra.me.REG[6], REGB0);
446 once_value_14 = fra.me.REG[6];
447 register_static_object(&once_value_14);
448 } else fra.me.REG[6] = once_value_14;
449 fra.me.REG[6] = fra.me.REG[6];
450 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
451 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]);
452 if (!once_value_15) {
453 fra.me.REG[6] = BOX_NativeString(": ");
454 REGB0 = TAG_Int(2);
455 fra.me.REG[6] = NEW_String_standard___string___String___with_native(fra.me.REG[6], REGB0);
456 once_value_15 = fra.me.REG[6];
457 register_static_object(&once_value_15);
458 } else fra.me.REG[6] = once_value_15;
459 fra.me.REG[6] = fra.me.REG[6];
460 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
461 fra.me.REG[6] = CALL_toolcontext___Message___text(fra.me.REG[0])(fra.me.REG[0]);
462 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
463 if (!once_value_16) {
464 fra.me.REG[6] = BOX_NativeString("");
465 REGB0 = TAG_Int(0);
466 fra.me.REG[6] = NEW_String_standard___string___String___with_native(fra.me.REG[6], REGB0);
467 once_value_16 = fra.me.REG[6];
468 register_static_object(&once_value_16);
469 } else fra.me.REG[6] = once_value_16;
470 fra.me.REG[6] = fra.me.REG[6];
471 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
472 fra.me.REG[5] = CALL_standard___string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]);
473 fra.me.REG[4] = fra.me.REG[5];
474 goto label11;
475 } else {
476 /* toolcontext.nit:64 */
477 REGB0 = TAG_Int(11);
478 fra.me.REG[5] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
479 if (!once_value_17) {
480 fra.me.REG[6] = BOX_NativeString("");
481 REGB0 = TAG_Int(0);
482 fra.me.REG[6] = NEW_String_standard___string___String___with_native(fra.me.REG[6], REGB0);
483 once_value_17 = fra.me.REG[6];
484 register_static_object(&once_value_17);
485 } else fra.me.REG[6] = once_value_17;
486 fra.me.REG[6] = fra.me.REG[6];
487 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
488 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[1]);
489 if (!once_value_18) {
490 fra.me.REG[1] = BOX_NativeString("");
491 REGB0 = TAG_Int(0);
492 fra.me.REG[1] = NEW_String_standard___string___String___with_native(fra.me.REG[1], REGB0);
493 once_value_18 = fra.me.REG[1];
494 register_static_object(&once_value_18);
495 } else fra.me.REG[1] = once_value_18;
496 fra.me.REG[1] = fra.me.REG[1];
497 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[1]);
498 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]);
499 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[1]);
500 if (!once_value_19) {
501 fra.me.REG[1] = BOX_NativeString("");
502 REGB0 = TAG_Int(0);
503 fra.me.REG[1] = NEW_String_standard___string___String___with_native(fra.me.REG[1], REGB0);
504 once_value_19 = fra.me.REG[1];
505 register_static_object(&once_value_19);
506 } else fra.me.REG[1] = once_value_19;
507 fra.me.REG[1] = fra.me.REG[1];
508 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[1]);
509 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]);
510 if (!once_value_20) {
511 fra.me.REG[2] = BOX_NativeString(": ");
512 REGB0 = TAG_Int(2);
513 fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB0);
514 once_value_20 = fra.me.REG[2];
515 register_static_object(&once_value_20);
516 } else fra.me.REG[2] = once_value_20;
517 fra.me.REG[2] = fra.me.REG[2];
518 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[2]);
519 fra.me.REG[0] = CALL_toolcontext___Message___text(fra.me.REG[0])(fra.me.REG[0]);
520 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[0]);
521 if (!once_value_21) {
522 fra.me.REG[0] = BOX_NativeString("\n");
523 REGB0 = TAG_Int(1);
524 fra.me.REG[0] = NEW_String_standard___string___String___with_native(fra.me.REG[0], REGB0);
525 once_value_21 = fra.me.REG[0];
526 register_static_object(&once_value_21);
527 } else fra.me.REG[0] = once_value_21;
528 fra.me.REG[0] = fra.me.REG[0];
529 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[0]);
530 if (!once_value_22) {
531 fra.me.REG[0] = BOX_NativeString("1;31");
532 REGB0 = TAG_Int(4);
533 fra.me.REG[0] = NEW_String_standard___string___String___with_native(fra.me.REG[0], REGB0);
534 once_value_22 = fra.me.REG[0];
535 register_static_object(&once_value_22);
536 } else fra.me.REG[0] = once_value_22;
537 fra.me.REG[0] = fra.me.REG[0];
538 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
539 if (UNTAG_Bool(REGB0)) {
540 nit_abort("Reciever is null", NULL, LOCATE_toolcontext, 64);
541 }
542 fra.me.REG[0] = CALL_location___Location___colored_line(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[0]);
543 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[0]);
544 if (!once_value_23) {
545 fra.me.REG[0] = BOX_NativeString("");
546 REGB0 = TAG_Int(0);
547 fra.me.REG[0] = NEW_String_standard___string___String___with_native(fra.me.REG[0], REGB0);
548 once_value_23 = fra.me.REG[0];
549 register_static_object(&once_value_23);
550 } else fra.me.REG[0] = once_value_23;
551 fra.me.REG[0] = fra.me.REG[0];
552 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[0]);
553 fra.me.REG[5] = CALL_standard___string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]);
554 fra.me.REG[4] = fra.me.REG[5];
555 goto label11;
556 }
557 }
558 label11: while(0);
559 stack_frame_head = fra.me.prev;
560 return fra.me.REG[4];
561 }
562 void toolcontext___Message___init(val_t p0, val_t p1, val_t p2, int* init_table){
563 int itpos0 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_toolcontext___Message].i;
564 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
565 val_t tmp;
566 if (init_table[itpos0]) return;
567 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
568 fra.me.file = LOCATE_toolcontext;
569 fra.me.line = 0;
570 fra.me.meth = LOCATE_toolcontext___Message___init;
571 fra.me.has_broke = 0;
572 fra.me.REG_size = 3;
573 fra.me.nitni_local_ref_head = NULL;
574 fra.me.REG[0] = NIT_NULL;
575 fra.me.REG[1] = NIT_NULL;
576 fra.me.REG[2] = NIT_NULL;
577 fra.me.REG[0] = p0;
578 fra.me.REG[1] = p1;
579 fra.me.REG[2] = p2;
580 ATTR_toolcontext___Message____location(fra.me.REG[0]) = fra.me.REG[1];
581 ATTR_toolcontext___Message____text(fra.me.REG[0]) = fra.me.REG[2];
582 stack_frame_head = fra.me.prev;
583 init_table[itpos0] = 1;
584 return;
585 }
586 val_t toolcontext___ToolContext___error_count(val_t p0){
587 struct {struct stack_frame_t me;} fra;
588 val_t REGB0;
589 val_t tmp;
590 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
591 fra.me.file = LOCATE_toolcontext;
592 fra.me.line = 71;
593 fra.me.meth = LOCATE_toolcontext___ToolContext___error_count;
594 fra.me.has_broke = 0;
595 fra.me.REG_size = 1;
596 fra.me.nitni_local_ref_head = NULL;
597 fra.me.REG[0] = NIT_NULL;
598 fra.me.REG[0] = p0;
599 /* toolcontext.nit:71 */
600 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____error_count(fra.me.REG[0])!=NIT_NULL);
601 if (UNTAG_Bool(REGB0)) {
602 } else {
603 nit_abort("Uninitialized attribute %s", "_error_count", LOCATE_toolcontext, 71);
604 }
605 REGB0 = ATTR_toolcontext___ToolContext____error_count(fra.me.REG[0]);
606 stack_frame_head = fra.me.prev;
607 return REGB0;
608 }
609 val_t toolcontext___ToolContext___warning_count(val_t p0){
610 struct {struct stack_frame_t me;} fra;
611 val_t REGB0;
612 val_t tmp;
613 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
614 fra.me.file = LOCATE_toolcontext;
615 fra.me.line = 74;
616 fra.me.meth = LOCATE_toolcontext___ToolContext___warning_count;
617 fra.me.has_broke = 0;
618 fra.me.REG_size = 1;
619 fra.me.nitni_local_ref_head = NULL;
620 fra.me.REG[0] = NIT_NULL;
621 fra.me.REG[0] = p0;
622 /* toolcontext.nit:74 */
623 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____warning_count(fra.me.REG[0])!=NIT_NULL);
624 if (UNTAG_Bool(REGB0)) {
625 } else {
626 nit_abort("Uninitialized attribute %s", "_warning_count", LOCATE_toolcontext, 74);
627 }
628 REGB0 = ATTR_toolcontext___ToolContext____warning_count(fra.me.REG[0]);
629 stack_frame_head = fra.me.prev;
630 return REGB0;
631 }
632 val_t toolcontext___ToolContext___log_directory(val_t p0){
633 struct {struct stack_frame_t me;} fra;
634 val_t REGB0;
635 val_t tmp;
636 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
637 fra.me.file = LOCATE_toolcontext;
638 fra.me.line = 77;
639 fra.me.meth = LOCATE_toolcontext___ToolContext___log_directory;
640 fra.me.has_broke = 0;
641 fra.me.REG_size = 1;
642 fra.me.nitni_local_ref_head = NULL;
643 fra.me.REG[0] = NIT_NULL;
644 fra.me.REG[0] = p0;
645 /* toolcontext.nit:77 */
646 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____log_directory(fra.me.REG[0])!=NIT_NULL);
647 if (UNTAG_Bool(REGB0)) {
648 } else {
649 nit_abort("Uninitialized attribute %s", "_log_directory", LOCATE_toolcontext, 77);
650 }
651 fra.me.REG[0] = ATTR_toolcontext___ToolContext____log_directory(fra.me.REG[0]);
652 stack_frame_head = fra.me.prev;
653 return fra.me.REG[0];
654 }
655 void toolcontext___ToolContext___check_errors(val_t p0){
656 struct {struct stack_frame_t me; val_t MORE_REG[6];} fra;
657 val_t REGB0;
658 val_t REGB1;
659 val_t REGB2;
660 val_t tmp;
661 static val_t once_value_1; /* Once value */
662 static val_t once_value_2; /* Once value */
663 static val_t once_value_3; /* Once value */
664 static val_t once_value_4; /* Once value */
665 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
666 fra.me.file = LOCATE_toolcontext;
667 fra.me.line = 84;
668 fra.me.meth = LOCATE_toolcontext___ToolContext___check_errors;
669 fra.me.has_broke = 0;
670 fra.me.REG_size = 7;
671 fra.me.nitni_local_ref_head = NULL;
672 fra.me.REG[0] = NIT_NULL;
673 fra.me.REG[1] = NIT_NULL;
674 fra.me.REG[2] = NIT_NULL;
675 fra.me.REG[3] = NIT_NULL;
676 fra.me.REG[4] = NIT_NULL;
677 fra.me.REG[5] = NIT_NULL;
678 fra.me.REG[6] = NIT_NULL;
679 fra.me.REG[0] = p0;
680 /* toolcontext.nit:86 */
681 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____messages(fra.me.REG[0])!=NIT_NULL);
682 if (UNTAG_Bool(REGB0)) {
683 } else {
684 nit_abort("Uninitialized attribute %s", "_messages", LOCATE_toolcontext, 86);
685 }
686 fra.me.REG[1] = ATTR_toolcontext___ToolContext____messages(fra.me.REG[0]);
687 /* ../lib/standard/collection/array.nit:24 */
688 REGB0 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1])!=NIT_NULL);
689 if (UNTAG_Bool(REGB0)) {
690 } else {
691 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
692 }
693 REGB0 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1]);
694 /* toolcontext.nit:86 */
695 REGB1 = TAG_Int(0);
696 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
697 if (UNTAG_Bool(REGB2)) {
698 } else {
699 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
700 }
701 /* ../lib/standard/kernel.nit:234 */
702 REGB1 = TAG_Bool(UNTAG_Int(REGB0)>UNTAG_Int(REGB1));
703 /* toolcontext.nit:86 */
704 if (UNTAG_Bool(REGB1)) {
705 /* toolcontext.nit:87 */
706 REGB1 = TAG_Bool(ATTR_toolcontext___ToolContext____message_sorter(fra.me.REG[0])!=NIT_NULL);
707 if (UNTAG_Bool(REGB1)) {
708 } else {
709 nit_abort("Uninitialized attribute %s", "_message_sorter", LOCATE_toolcontext, 87);
710 }
711 fra.me.REG[1] = ATTR_toolcontext___ToolContext____message_sorter(fra.me.REG[0]);
712 REGB1 = TAG_Bool(ATTR_toolcontext___ToolContext____messages(fra.me.REG[0])!=NIT_NULL);
713 if (UNTAG_Bool(REGB1)) {
714 } else {
715 nit_abort("Uninitialized attribute %s", "_messages", LOCATE_toolcontext, 87);
716 }
717 fra.me.REG[2] = ATTR_toolcontext___ToolContext____messages(fra.me.REG[0]);
718 CALL_standard___collection___sorter___AbstractSorter___sort(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
719 /* toolcontext.nit:89 */
720 REGB1 = TAG_Bool(ATTR_toolcontext___ToolContext____messages(fra.me.REG[0])!=NIT_NULL);
721 if (UNTAG_Bool(REGB1)) {
722 } else {
723 nit_abort("Uninitialized attribute %s", "_messages", LOCATE_toolcontext, 89);
724 }
725 fra.me.REG[2] = ATTR_toolcontext___ToolContext____messages(fra.me.REG[0]);
726 /* ../lib/standard/collection/array.nit:269 */
727 REGB1 = TAG_Int(0);
728 /* ../lib/standard/collection/array.nit:270 */
729 REGB0 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
730 if (UNTAG_Bool(REGB0)) {
731 } else {
732 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 270);
733 }
734 REGB0 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2]);
735 /* ../lib/standard/collection/array.nit:271 */
736 fra.me.REG[1] = ATTR_standard___collection___array___Array____items(fra.me.REG[2]);
737 /* ../lib/standard/collection/array.nit:272 */
738 while(1) {
739 /* ../lib/standard/collection/array.nit:24 */
740 REGB0 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
741 if (UNTAG_Bool(REGB0)) {
742 } else {
743 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
744 }
745 REGB0 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2]);
746 REGB2 = TAG_Bool(VAL_ISA(REGB0, VTCOLOR_standard___kernel___Comparable___OTHER(REGB1), VTID_standard___kernel___Comparable___OTHER(REGB1))) /*cast OTHER*/;
747 if (UNTAG_Bool(REGB2)) {
748 } else {
749 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
750 }
751 /* ../lib/standard/kernel.nit:232 */
752 REGB0 = TAG_Bool(UNTAG_Int(REGB1)<UNTAG_Int(REGB0));
753 /* ../lib/standard/collection/array.nit:272 */
754 if (UNTAG_Bool(REGB0)) {
755 /* ../lib/standard/collection/array.nit:273 */
756 REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
757 if (UNTAG_Bool(REGB0)) {
758 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 273);
759 }
760 /* ../lib/standard/collection/array.nit:718 */
761 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[1])->val[UNTAG_Int(REGB1)];
762 /* toolcontext.nit:90 */
763 fra.me.REG[4] = CALL_toolcontext___ToolContext___opt_no_color(fra.me.REG[0])(fra.me.REG[0]);
764 fra.me.REG[4] = CALL_opts___Option___value(fra.me.REG[4])(fra.me.REG[4]);
765 if (UNTAG_Bool(fra.me.REG[4])) {
766 /* toolcontext.nit:91 */
767 fra.me.REG[4] = CALL_standard___file___Object___stderr(fra.me.REG[0])(fra.me.REG[0]);
768 REGB0 = TAG_Int(3);
769 fra.me.REG[5] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
770 if (!once_value_1) {
771 fra.me.REG[6] = BOX_NativeString("");
772 REGB0 = TAG_Int(0);
773 fra.me.REG[6] = NEW_String_standard___string___String___with_native(fra.me.REG[6], REGB0);
774 once_value_1 = fra.me.REG[6];
775 register_static_object(&once_value_1);
776 } else fra.me.REG[6] = once_value_1;
777 fra.me.REG[6] = fra.me.REG[6];
778 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
779 fra.me.REG[6] = CALL_standard___string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]);
780 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
781 if (!once_value_2) {
782 fra.me.REG[6] = BOX_NativeString("\n");
783 REGB0 = TAG_Int(1);
784 fra.me.REG[6] = NEW_String_standard___string___String___with_native(fra.me.REG[6], REGB0);
785 once_value_2 = fra.me.REG[6];
786 register_static_object(&once_value_2);
787 } else fra.me.REG[6] = once_value_2;
788 fra.me.REG[6] = fra.me.REG[6];
789 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
790 fra.me.REG[5] = CALL_standard___string___Object___to_s(fra.me.REG[5])(fra.me.REG[5]);
791 CALL_standard___stream___OStream___write(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[5]);
792 } else {
793 /* toolcontext.nit:93 */
794 fra.me.REG[5] = CALL_standard___file___Object___stderr(fra.me.REG[0])(fra.me.REG[0]);
795 REGB0 = TAG_Int(3);
796 fra.me.REG[4] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
797 if (!once_value_3) {
798 fra.me.REG[6] = BOX_NativeString("");
799 REGB0 = TAG_Int(0);
800 fra.me.REG[6] = NEW_String_standard___string___String___with_native(fra.me.REG[6], REGB0);
801 once_value_3 = fra.me.REG[6];
802 register_static_object(&once_value_3);
803 } else fra.me.REG[6] = once_value_3;
804 fra.me.REG[6] = fra.me.REG[6];
805 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[6]);
806 fra.me.REG[3] = CALL_toolcontext___Message___to_color_string(fra.me.REG[3])(fra.me.REG[3]);
807 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[3]);
808 if (!once_value_4) {
809 fra.me.REG[3] = BOX_NativeString("\n");
810 REGB0 = TAG_Int(1);
811 fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB0);
812 once_value_4 = fra.me.REG[3];
813 register_static_object(&once_value_4);
814 } else fra.me.REG[3] = once_value_4;
815 fra.me.REG[3] = fra.me.REG[3];
816 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[3]);
817 fra.me.REG[4] = CALL_standard___string___Object___to_s(fra.me.REG[4])(fra.me.REG[4]);
818 CALL_standard___stream___OStream___write(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[4]);
819 }
820 /* ../lib/standard/collection/array.nit:274 */
821 REGB0 = TAG_Int(1);
822 /* ../lib/standard/kernel.nit:235 */
823 REGB0 = TAG_Int(UNTAG_Int(REGB1)+UNTAG_Int(REGB0));
824 /* ../lib/standard/collection/array.nit:274 */
825 REGB1 = REGB0;
826 } else {
827 /* ../lib/standard/collection/array.nit:272 */
828 goto label5;
829 }
830 }
831 label5: while(0);
832 /* toolcontext.nit:97 */
833 REGB1 = TAG_Bool(ATTR_toolcontext___ToolContext____messages(fra.me.REG[0])!=NIT_NULL);
834 if (UNTAG_Bool(REGB1)) {
835 } else {
836 nit_abort("Uninitialized attribute %s", "_messages", LOCATE_toolcontext, 97);
837 }
838 fra.me.REG[1] = ATTR_toolcontext___ToolContext____messages(fra.me.REG[0]);
839 CALL_standard___collection___abstract_collection___RemovableCollection___clear(fra.me.REG[1])(fra.me.REG[1]);
840 }
841 /* toolcontext.nit:100 */
842 REGB1 = CALL_toolcontext___ToolContext___error_count(fra.me.REG[0])(fra.me.REG[0]);
843 REGB0 = TAG_Int(0);
844 REGB2 = TAG_Bool(VAL_ISA(REGB0, VTCOLOR_standard___kernel___Comparable___OTHER(REGB1), VTID_standard___kernel___Comparable___OTHER(REGB1))) /*cast OTHER*/;
845 if (UNTAG_Bool(REGB2)) {
846 } else {
847 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
848 }
849 /* ../lib/standard/kernel.nit:234 */
850 REGB0 = TAG_Bool(UNTAG_Int(REGB1)>UNTAG_Int(REGB0));
851 /* toolcontext.nit:100 */
852 if (UNTAG_Bool(REGB0)) {
853 REGB0 = TAG_Int(1);
854 CALL_standard___kernel___Object___exit(fra.me.REG[0])(fra.me.REG[0], REGB0);
855 }
856 stack_frame_head = fra.me.prev;
857 return;
858 }
859 void toolcontext___ToolContext___error(val_t p0, val_t p1, val_t p2){
860 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
861 val_t REGB0;
862 val_t REGB1;
863 val_t tmp;
864 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
865 fra.me.file = LOCATE_toolcontext;
866 fra.me.line = 103;
867 fra.me.meth = LOCATE_toolcontext___ToolContext___error;
868 fra.me.has_broke = 0;
869 fra.me.REG_size = 4;
870 fra.me.nitni_local_ref_head = NULL;
871 fra.me.REG[0] = NIT_NULL;
872 fra.me.REG[1] = NIT_NULL;
873 fra.me.REG[2] = NIT_NULL;
874 fra.me.REG[3] = NIT_NULL;
875 fra.me.REG[0] = p0;
876 fra.me.REG[1] = p1;
877 fra.me.REG[2] = p2;
878 /* toolcontext.nit:106 */
879 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____messages(fra.me.REG[0])!=NIT_NULL);
880 if (UNTAG_Bool(REGB0)) {
881 } else {
882 nit_abort("Uninitialized attribute %s", "_messages", LOCATE_toolcontext, 106);
883 }
884 fra.me.REG[3] = ATTR_toolcontext___ToolContext____messages(fra.me.REG[0]);
885 fra.me.REG[2] = NEW_Message_toolcontext___Message___init(fra.me.REG[1], fra.me.REG[2]);
886 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
887 /* toolcontext.nit:107 */
888 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____error_count(fra.me.REG[0])!=NIT_NULL);
889 if (UNTAG_Bool(REGB0)) {
890 } else {
891 nit_abort("Uninitialized attribute %s", "_error_count", LOCATE_toolcontext, 107);
892 }
893 REGB0 = ATTR_toolcontext___ToolContext____error_count(fra.me.REG[0]);
894 REGB1 = TAG_Int(1);
895 /* ../lib/standard/kernel.nit:235 */
896 REGB1 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB1));
897 /* toolcontext.nit:107 */
898 ATTR_toolcontext___ToolContext____error_count(fra.me.REG[0]) = REGB1;
899 /* toolcontext.nit:108 */
900 fra.me.REG[2] = CALL_toolcontext___ToolContext___opt_stop_on_first_error(fra.me.REG[0])(fra.me.REG[0]);
901 fra.me.REG[2] = CALL_opts___Option___value(fra.me.REG[2])(fra.me.REG[2]);
902 if (UNTAG_Bool(fra.me.REG[2])) {
903 CALL_toolcontext___ToolContext___check_errors(fra.me.REG[0])(fra.me.REG[0]);
904 }
905 stack_frame_head = fra.me.prev;
906 return;
907 }
908 void toolcontext___ToolContext___fatal_error(val_t p0, val_t p1, val_t p2){
909 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
910 val_t tmp;
911 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
912 fra.me.file = LOCATE_toolcontext;
913 fra.me.line = 111;
914 fra.me.meth = LOCATE_toolcontext___ToolContext___fatal_error;
915 fra.me.has_broke = 0;
916 fra.me.REG_size = 3;
917 fra.me.nitni_local_ref_head = NULL;
918 fra.me.REG[0] = NIT_NULL;
919 fra.me.REG[1] = NIT_NULL;
920 fra.me.REG[2] = NIT_NULL;
921 fra.me.REG[0] = p0;
922 fra.me.REG[1] = p1;
923 fra.me.REG[2] = p2;
924 /* toolcontext.nit:114 */
925 CALL_toolcontext___ToolContext___error(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], fra.me.REG[2]);
926 /* toolcontext.nit:115 */
927 CALL_toolcontext___ToolContext___check_errors(fra.me.REG[0])(fra.me.REG[0]);
928 stack_frame_head = fra.me.prev;
929 return;
930 }
931 void toolcontext___ToolContext___warning(val_t p0, val_t p1, val_t p2){
932 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
933 val_t REGB0;
934 val_t REGB1;
935 val_t REGB2;
936 val_t tmp;
937 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
938 fra.me.file = LOCATE_toolcontext;
939 fra.me.line = 118;
940 fra.me.meth = LOCATE_toolcontext___ToolContext___warning;
941 fra.me.has_broke = 0;
942 fra.me.REG_size = 4;
943 fra.me.nitni_local_ref_head = NULL;
944 fra.me.REG[0] = NIT_NULL;
945 fra.me.REG[1] = NIT_NULL;
946 fra.me.REG[2] = NIT_NULL;
947 fra.me.REG[3] = NIT_NULL;
948 fra.me.REG[0] = p0;
949 fra.me.REG[1] = p1;
950 fra.me.REG[2] = p2;
951 /* toolcontext.nit:121 */
952 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_warn(fra.me.REG[0])!=NIT_NULL);
953 if (UNTAG_Bool(REGB0)) {
954 } else {
955 nit_abort("Uninitialized attribute %s", "_opt_warn", LOCATE_toolcontext, 121);
956 }
957 fra.me.REG[3] = ATTR_toolcontext___ToolContext____opt_warn(fra.me.REG[0]);
958 fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]);
959 REGB0 = TAG_Int(0);
960 REGB1 = TAG_Bool(IS_EQUAL_ON(REGB0,fra.me.REG[3]));
961 if (UNTAG_Bool(REGB1)) {
962 } else {
963 REGB2 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
964 if (UNTAG_Bool(REGB2)) {
965 REGB2 = TAG_Bool(false);
966 REGB1 = REGB2;
967 } else {
968 /* ../lib/standard/kernel.nit:227 */
969 REGB0 = TAG_Bool((fra.me.REG[3])==(REGB0));
970 /* toolcontext.nit:121 */
971 REGB1 = REGB0;
972 }
973 }
974 if (UNTAG_Bool(REGB1)) {
975 goto label1;
976 }
977 /* toolcontext.nit:122 */
978 REGB1 = TAG_Bool(ATTR_toolcontext___ToolContext____messages(fra.me.REG[0])!=NIT_NULL);
979 if (UNTAG_Bool(REGB1)) {
980 } else {
981 nit_abort("Uninitialized attribute %s", "_messages", LOCATE_toolcontext, 122);
982 }
983 fra.me.REG[3] = ATTR_toolcontext___ToolContext____messages(fra.me.REG[0]);
984 fra.me.REG[2] = NEW_Message_toolcontext___Message___init(fra.me.REG[1], fra.me.REG[2]);
985 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[2]);
986 /* toolcontext.nit:123 */
987 REGB1 = TAG_Bool(ATTR_toolcontext___ToolContext____warning_count(fra.me.REG[0])!=NIT_NULL);
988 if (UNTAG_Bool(REGB1)) {
989 } else {
990 nit_abort("Uninitialized attribute %s", "_warning_count", LOCATE_toolcontext, 123);
991 }
992 REGB1 = ATTR_toolcontext___ToolContext____warning_count(fra.me.REG[0]);
993 REGB0 = TAG_Int(1);
994 /* ../lib/standard/kernel.nit:235 */
995 REGB0 = TAG_Int(UNTAG_Int(REGB1)+UNTAG_Int(REGB0));
996 /* toolcontext.nit:123 */
997 ATTR_toolcontext___ToolContext____warning_count(fra.me.REG[0]) = REGB0;
998 /* toolcontext.nit:124 */
999 fra.me.REG[2] = CALL_toolcontext___ToolContext___opt_stop_on_first_error(fra.me.REG[0])(fra.me.REG[0]);
1000 fra.me.REG[2] = CALL_opts___Option___value(fra.me.REG[2])(fra.me.REG[2]);
1001 if (UNTAG_Bool(fra.me.REG[2])) {
1002 CALL_toolcontext___ToolContext___check_errors(fra.me.REG[0])(fra.me.REG[0]);
1003 }
1004 label1: while(0);
1005 stack_frame_head = fra.me.prev;
1006 return;
1007 }
1008 void toolcontext___ToolContext___info(val_t p0, val_t p1, val_t p2){
1009 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
1010 val_t REGB0;
1011 val_t REGB1;
1012 val_t REGB2;
1013 val_t tmp;
1014 static val_t once_value_1; /* Once value */
1015 static val_t once_value_2; /* Once value */
1016 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1017 fra.me.file = LOCATE_toolcontext;
1018 fra.me.line = 127;
1019 fra.me.meth = LOCATE_toolcontext___ToolContext___info;
1020 fra.me.has_broke = 0;
1021 fra.me.REG_size = 4;
1022 fra.me.nitni_local_ref_head = NULL;
1023 fra.me.REG[0] = NIT_NULL;
1024 fra.me.REG[1] = NIT_NULL;
1025 fra.me.REG[2] = NIT_NULL;
1026 fra.me.REG[3] = NIT_NULL;
1027 fra.me.REG[0] = p0;
1028 fra.me.REG[1] = p1;
1029 REGB0 = p2;
1030 /* toolcontext.nit:130 */
1031 REGB1 = CALL_toolcontext___ToolContext___verbose_level(fra.me.REG[0])(fra.me.REG[0]);
1032 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
1033 if (UNTAG_Bool(REGB2)) {
1034 } else {
1035 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
1036 }
1037 /* ../lib/standard/kernel.nit:231 */
1038 REGB1 = TAG_Bool(UNTAG_Int(REGB0)<=UNTAG_Int(REGB1));
1039 /* toolcontext.nit:130 */
1040 if (UNTAG_Bool(REGB1)) {
1041 /* toolcontext.nit:131 */
1042 REGB1 = TAG_Int(3);
1043 fra.me.REG[2] = NEW_Array_standard___collection___array___Array___with_capacity(REGB1);
1044 if (!once_value_1) {
1045 fra.me.REG[3] = BOX_NativeString("");
1046 REGB1 = TAG_Int(0);
1047 fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB1);
1048 once_value_1 = fra.me.REG[3];
1049 register_static_object(&once_value_1);
1050 } else fra.me.REG[3] = once_value_1;
1051 fra.me.REG[3] = fra.me.REG[3];
1052 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
1053 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
1054 if (!once_value_2) {
1055 fra.me.REG[1] = BOX_NativeString("");
1056 REGB1 = TAG_Int(0);
1057 fra.me.REG[1] = NEW_String_standard___string___String___with_native(fra.me.REG[1], REGB1);
1058 once_value_2 = fra.me.REG[1];
1059 register_static_object(&once_value_2);
1060 } else fra.me.REG[1] = once_value_2;
1061 fra.me.REG[1] = fra.me.REG[1];
1062 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
1063 fra.me.REG[2] = CALL_standard___string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]);
1064 CALL_standard___file___Object___print(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]);
1065 }
1066 stack_frame_head = fra.me.prev;
1067 return;
1068 }
1069 val_t toolcontext___ToolContext___option_context(val_t p0){
1070 struct {struct stack_frame_t me;} fra;
1071 val_t REGB0;
1072 val_t tmp;
1073 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1074 fra.me.file = LOCATE_toolcontext;
1075 fra.me.line = 135;
1076 fra.me.meth = LOCATE_toolcontext___ToolContext___option_context;
1077 fra.me.has_broke = 0;
1078 fra.me.REG_size = 1;
1079 fra.me.nitni_local_ref_head = NULL;
1080 fra.me.REG[0] = NIT_NULL;
1081 fra.me.REG[0] = p0;
1082 /* toolcontext.nit:135 */
1083 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____option_context(fra.me.REG[0])!=NIT_NULL);
1084 if (UNTAG_Bool(REGB0)) {
1085 } else {
1086 nit_abort("Uninitialized attribute %s", "_option_context", LOCATE_toolcontext, 135);
1087 }
1088 fra.me.REG[0] = ATTR_toolcontext___ToolContext____option_context(fra.me.REG[0]);
1089 stack_frame_head = fra.me.prev;
1090 return fra.me.REG[0];
1091 }
1092 val_t toolcontext___ToolContext___opt_warn(val_t p0){
1093 struct {struct stack_frame_t me;} fra;
1094 val_t REGB0;
1095 val_t tmp;
1096 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1097 fra.me.file = LOCATE_toolcontext;
1098 fra.me.line = 138;
1099 fra.me.meth = LOCATE_toolcontext___ToolContext___opt_warn;
1100 fra.me.has_broke = 0;
1101 fra.me.REG_size = 1;
1102 fra.me.nitni_local_ref_head = NULL;
1103 fra.me.REG[0] = NIT_NULL;
1104 fra.me.REG[0] = p0;
1105 /* toolcontext.nit:138 */
1106 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_warn(fra.me.REG[0])!=NIT_NULL);
1107 if (UNTAG_Bool(REGB0)) {
1108 } else {
1109 nit_abort("Uninitialized attribute %s", "_opt_warn", LOCATE_toolcontext, 138);
1110 }
1111 fra.me.REG[0] = ATTR_toolcontext___ToolContext____opt_warn(fra.me.REG[0]);
1112 stack_frame_head = fra.me.prev;
1113 return fra.me.REG[0];
1114 }
1115 val_t toolcontext___ToolContext___opt_quiet(val_t p0){
1116 struct {struct stack_frame_t me;} fra;
1117 val_t REGB0;
1118 val_t tmp;
1119 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1120 fra.me.file = LOCATE_toolcontext;
1121 fra.me.line = 141;
1122 fra.me.meth = LOCATE_toolcontext___ToolContext___opt_quiet;
1123 fra.me.has_broke = 0;
1124 fra.me.REG_size = 1;
1125 fra.me.nitni_local_ref_head = NULL;
1126 fra.me.REG[0] = NIT_NULL;
1127 fra.me.REG[0] = p0;
1128 /* toolcontext.nit:141 */
1129 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_quiet(fra.me.REG[0])!=NIT_NULL);
1130 if (UNTAG_Bool(REGB0)) {
1131 } else {
1132 nit_abort("Uninitialized attribute %s", "_opt_quiet", LOCATE_toolcontext, 141);
1133 }
1134 fra.me.REG[0] = ATTR_toolcontext___ToolContext____opt_quiet(fra.me.REG[0]);
1135 stack_frame_head = fra.me.prev;
1136 return fra.me.REG[0];
1137 }
1138 val_t toolcontext___ToolContext___opt_log(val_t p0){
1139 struct {struct stack_frame_t me;} fra;
1140 val_t REGB0;
1141 val_t tmp;
1142 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1143 fra.me.file = LOCATE_toolcontext;
1144 fra.me.line = 144;
1145 fra.me.meth = LOCATE_toolcontext___ToolContext___opt_log;
1146 fra.me.has_broke = 0;
1147 fra.me.REG_size = 1;
1148 fra.me.nitni_local_ref_head = NULL;
1149 fra.me.REG[0] = NIT_NULL;
1150 fra.me.REG[0] = p0;
1151 /* toolcontext.nit:144 */
1152 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_log(fra.me.REG[0])!=NIT_NULL);
1153 if (UNTAG_Bool(REGB0)) {
1154 } else {
1155 nit_abort("Uninitialized attribute %s", "_opt_log", LOCATE_toolcontext, 144);
1156 }
1157 fra.me.REG[0] = ATTR_toolcontext___ToolContext____opt_log(fra.me.REG[0]);
1158 stack_frame_head = fra.me.prev;
1159 return fra.me.REG[0];
1160 }
1161 val_t toolcontext___ToolContext___opt_log_dir(val_t p0){
1162 struct {struct stack_frame_t me;} fra;
1163 val_t REGB0;
1164 val_t tmp;
1165 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1166 fra.me.file = LOCATE_toolcontext;
1167 fra.me.line = 147;
1168 fra.me.meth = LOCATE_toolcontext___ToolContext___opt_log_dir;
1169 fra.me.has_broke = 0;
1170 fra.me.REG_size = 1;
1171 fra.me.nitni_local_ref_head = NULL;
1172 fra.me.REG[0] = NIT_NULL;
1173 fra.me.REG[0] = p0;
1174 /* toolcontext.nit:147 */
1175 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_log_dir(fra.me.REG[0])!=NIT_NULL);
1176 if (UNTAG_Bool(REGB0)) {
1177 } else {
1178 nit_abort("Uninitialized attribute %s", "_opt_log_dir", LOCATE_toolcontext, 147);
1179 }
1180 fra.me.REG[0] = ATTR_toolcontext___ToolContext____opt_log_dir(fra.me.REG[0]);
1181 stack_frame_head = fra.me.prev;
1182 return fra.me.REG[0];
1183 }
1184 val_t toolcontext___ToolContext___opt_help(val_t p0){
1185 struct {struct stack_frame_t me;} fra;
1186 val_t REGB0;
1187 val_t tmp;
1188 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1189 fra.me.file = LOCATE_toolcontext;
1190 fra.me.line = 150;
1191 fra.me.meth = LOCATE_toolcontext___ToolContext___opt_help;
1192 fra.me.has_broke = 0;
1193 fra.me.REG_size = 1;
1194 fra.me.nitni_local_ref_head = NULL;
1195 fra.me.REG[0] = NIT_NULL;
1196 fra.me.REG[0] = p0;
1197 /* toolcontext.nit:150 */
1198 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_help(fra.me.REG[0])!=NIT_NULL);
1199 if (UNTAG_Bool(REGB0)) {
1200 } else {
1201 nit_abort("Uninitialized attribute %s", "_opt_help", LOCATE_toolcontext, 150);
1202 }
1203 fra.me.REG[0] = ATTR_toolcontext___ToolContext____opt_help(fra.me.REG[0]);
1204 stack_frame_head = fra.me.prev;
1205 return fra.me.REG[0];
1206 }
1207 val_t toolcontext___ToolContext___opt_version(val_t p0){
1208 struct {struct stack_frame_t me;} fra;
1209 val_t REGB0;
1210 val_t tmp;
1211 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1212 fra.me.file = LOCATE_toolcontext;
1213 fra.me.line = 153;
1214 fra.me.meth = LOCATE_toolcontext___ToolContext___opt_version;
1215 fra.me.has_broke = 0;
1216 fra.me.REG_size = 1;
1217 fra.me.nitni_local_ref_head = NULL;
1218 fra.me.REG[0] = NIT_NULL;
1219 fra.me.REG[0] = p0;
1220 /* toolcontext.nit:153 */
1221 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_version(fra.me.REG[0])!=NIT_NULL);
1222 if (UNTAG_Bool(REGB0)) {
1223 } else {
1224 nit_abort("Uninitialized attribute %s", "_opt_version", LOCATE_toolcontext, 153);
1225 }
1226 fra.me.REG[0] = ATTR_toolcontext___ToolContext____opt_version(fra.me.REG[0]);
1227 stack_frame_head = fra.me.prev;
1228 return fra.me.REG[0];
1229 }
1230 val_t toolcontext___ToolContext___opt_verbose(val_t p0){
1231 struct {struct stack_frame_t me;} fra;
1232 val_t REGB0;
1233 val_t tmp;
1234 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1235 fra.me.file = LOCATE_toolcontext;
1236 fra.me.line = 156;
1237 fra.me.meth = LOCATE_toolcontext___ToolContext___opt_verbose;
1238 fra.me.has_broke = 0;
1239 fra.me.REG_size = 1;
1240 fra.me.nitni_local_ref_head = NULL;
1241 fra.me.REG[0] = NIT_NULL;
1242 fra.me.REG[0] = p0;
1243 /* toolcontext.nit:156 */
1244 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_verbose(fra.me.REG[0])!=NIT_NULL);
1245 if (UNTAG_Bool(REGB0)) {
1246 } else {
1247 nit_abort("Uninitialized attribute %s", "_opt_verbose", LOCATE_toolcontext, 156);
1248 }
1249 fra.me.REG[0] = ATTR_toolcontext___ToolContext____opt_verbose(fra.me.REG[0]);
1250 stack_frame_head = fra.me.prev;
1251 return fra.me.REG[0];
1252 }
1253 val_t toolcontext___ToolContext___opt_stop_on_first_error(val_t p0){
1254 struct {struct stack_frame_t me;} fra;
1255 val_t REGB0;
1256 val_t tmp;
1257 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1258 fra.me.file = LOCATE_toolcontext;
1259 fra.me.line = 159;
1260 fra.me.meth = LOCATE_toolcontext___ToolContext___opt_stop_on_first_error;
1261 fra.me.has_broke = 0;
1262 fra.me.REG_size = 1;
1263 fra.me.nitni_local_ref_head = NULL;
1264 fra.me.REG[0] = NIT_NULL;
1265 fra.me.REG[0] = p0;
1266 /* toolcontext.nit:159 */
1267 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_stop_on_first_error(fra.me.REG[0])!=NIT_NULL);
1268 if (UNTAG_Bool(REGB0)) {
1269 } else {
1270 nit_abort("Uninitialized attribute %s", "_opt_stop_on_first_error", LOCATE_toolcontext, 159);
1271 }
1272 fra.me.REG[0] = ATTR_toolcontext___ToolContext____opt_stop_on_first_error(fra.me.REG[0]);
1273 stack_frame_head = fra.me.prev;
1274 return fra.me.REG[0];
1275 }
1276 val_t toolcontext___ToolContext___opt_no_color(val_t p0){
1277 struct {struct stack_frame_t me;} fra;
1278 val_t REGB0;
1279 val_t tmp;
1280 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1281 fra.me.file = LOCATE_toolcontext;
1282 fra.me.line = 162;
1283 fra.me.meth = LOCATE_toolcontext___ToolContext___opt_no_color;
1284 fra.me.has_broke = 0;
1285 fra.me.REG_size = 1;
1286 fra.me.nitni_local_ref_head = NULL;
1287 fra.me.REG[0] = NIT_NULL;
1288 fra.me.REG[0] = p0;
1289 /* toolcontext.nit:162 */
1290 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_no_color(fra.me.REG[0])!=NIT_NULL);
1291 if (UNTAG_Bool(REGB0)) {
1292 } else {
1293 nit_abort("Uninitialized attribute %s", "_opt_no_color", LOCATE_toolcontext, 162);
1294 }
1295 fra.me.REG[0] = ATTR_toolcontext___ToolContext____opt_no_color(fra.me.REG[0]);
1296 stack_frame_head = fra.me.prev;
1297 return fra.me.REG[0];
1298 }
1299 val_t toolcontext___ToolContext___verbose_level(val_t p0){
1300 struct {struct stack_frame_t me;} fra;
1301 val_t REGB0;
1302 val_t tmp;
1303 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1304 fra.me.file = LOCATE_toolcontext;
1305 fra.me.line = 165;
1306 fra.me.meth = LOCATE_toolcontext___ToolContext___verbose_level;
1307 fra.me.has_broke = 0;
1308 fra.me.REG_size = 1;
1309 fra.me.nitni_local_ref_head = NULL;
1310 fra.me.REG[0] = NIT_NULL;
1311 fra.me.REG[0] = p0;
1312 /* toolcontext.nit:165 */
1313 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____verbose_level(fra.me.REG[0])!=NIT_NULL);
1314 if (UNTAG_Bool(REGB0)) {
1315 } else {
1316 nit_abort("Uninitialized attribute %s", "_verbose_level", LOCATE_toolcontext, 165);
1317 }
1318 REGB0 = ATTR_toolcontext___ToolContext____verbose_level(fra.me.REG[0]);
1319 stack_frame_head = fra.me.prev;
1320 return REGB0;
1321 }
1322 void toolcontext___ToolContext___init(val_t p0, int* init_table){
1323 int itpos1 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_toolcontext___ToolContext].i;
1324 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
1325 val_t REGB0;
1326 val_t tmp;
1327 if (init_table[itpos1]) return;
1328 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1329 fra.me.file = LOCATE_toolcontext;
1330 fra.me.line = 168;
1331 fra.me.meth = LOCATE_toolcontext___ToolContext___init;
1332 fra.me.has_broke = 0;
1333 fra.me.REG_size = 4;
1334 fra.me.nitni_local_ref_head = NULL;
1335 fra.me.REG[0] = NIT_NULL;
1336 fra.me.REG[1] = NIT_NULL;
1337 fra.me.REG[2] = NIT_NULL;
1338 fra.me.REG[3] = NIT_NULL;
1339 fra.me.REG[0] = p0;
1340 /* toolcontext.nit:170 */
1341 fra.me.REG[1] = CALL_toolcontext___ToolContext___option_context(fra.me.REG[0])(fra.me.REG[0]);
1342 REGB0 = TAG_Int(8);
1343 fra.me.REG[2] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
1344 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_warn(fra.me.REG[0])(fra.me.REG[0]);
1345 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
1346 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_quiet(fra.me.REG[0])(fra.me.REG[0]);
1347 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
1348 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_stop_on_first_error(fra.me.REG[0])(fra.me.REG[0]);
1349 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
1350 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_no_color(fra.me.REG[0])(fra.me.REG[0]);
1351 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
1352 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_log(fra.me.REG[0])(fra.me.REG[0]);
1353 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
1354 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_log_dir(fra.me.REG[0])(fra.me.REG[0]);
1355 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
1356 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_help(fra.me.REG[0])(fra.me.REG[0]);
1357 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
1358 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_version(fra.me.REG[0])(fra.me.REG[0]);
1359 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
1360 fra.me.REG[0] = CALL_toolcontext___ToolContext___opt_verbose(fra.me.REG[0])(fra.me.REG[0]);
1361 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[0]);
1362 CALL_opts___OptionContext___add_option(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
1363 stack_frame_head = fra.me.prev;
1364 init_table[itpos1] = 1;
1365 return;
1366 }
1367 void toolcontext___ToolContext___process_options(val_t p0){
1368 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
1369 val_t REGB0;
1370 val_t REGB1;
1371 val_t tmp;
1372 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1373 fra.me.file = LOCATE_toolcontext;
1374 fra.me.line = 173;
1375 fra.me.meth = LOCATE_toolcontext___ToolContext___process_options;
1376 fra.me.has_broke = 0;
1377 fra.me.REG_size = 4;
1378 fra.me.nitni_local_ref_head = NULL;
1379 fra.me.REG[0] = NIT_NULL;
1380 fra.me.REG[1] = NIT_NULL;
1381 fra.me.REG[2] = NIT_NULL;
1382 fra.me.REG[3] = NIT_NULL;
1383 fra.me.REG[0] = p0;
1384 /* toolcontext.nit:173 */
1385 fra.me.REG[1] = fra.me.REG[0];
1386 /* toolcontext.nit:176 */
1387 fra.me.REG[2] = CALL_toolcontext___ToolContext___opt_warn(fra.me.REG[1])(fra.me.REG[1]);
1388 REGB0 = TAG_Int(1);
1389 CALL_opts___Option___value__eq(fra.me.REG[2])(fra.me.REG[2], REGB0);
1390 /* toolcontext.nit:179 */
1391 fra.me.REG[2] = CALL_toolcontext___ToolContext___option_context(fra.me.REG[1])(fra.me.REG[1]);
1392 fra.me.REG[3] = CALL_standard___string___Object___args(fra.me.REG[1])(fra.me.REG[1]);
1393 CALL_opts___OptionContext___parse(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
1394 /* toolcontext.nit:182 */
1395 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_verbose(fra.me.REG[1])(fra.me.REG[1]);
1396 fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]);
1397 ATTR_toolcontext___ToolContext____verbose_level(fra.me.REG[1]) = fra.me.REG[3];
1398 /* toolcontext.nit:184 */
1399 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_quiet(fra.me.REG[1])(fra.me.REG[1]);
1400 fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]);
1401 if (UNTAG_Bool(fra.me.REG[3])) {
1402 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_warn(fra.me.REG[1])(fra.me.REG[1]);
1403 REGB0 = TAG_Int(0);
1404 CALL_opts___Option___value__eq(fra.me.REG[3])(fra.me.REG[3], REGB0);
1405 }
1406 /* toolcontext.nit:186 */
1407 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_log_dir(fra.me.REG[1])(fra.me.REG[1]);
1408 fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]);
1409 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
1410 if (UNTAG_Bool(REGB0)) {
1411 } else {
1412 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
1413 if (UNTAG_Bool(REGB1)) {
1414 REGB1 = TAG_Bool(false);
1415 REGB0 = REGB1;
1416 } else {
1417 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[3])(fra.me.REG[3], NIT_NULL);
1418 REGB0 = REGB1;
1419 }
1420 }
1421 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
1422 if (UNTAG_Bool(REGB0)) {
1423 fra.me.REG[3] = CALL_toolcontext___ToolContext___opt_log_dir(fra.me.REG[1])(fra.me.REG[1]);
1424 fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]);
1425 REGB0 = TAG_Bool((fra.me.REG[3]!=NIT_NULL) && VAL_ISA(fra.me.REG[3], COLOR_standard___string___String, ID_standard___string___String)) /*cast String*/;
1426 if (UNTAG_Bool(REGB0)) {
1427 } else {
1428 nit_abort("Cast failed", NULL, LOCATE_toolcontext, 186);
1429 }
1430 ATTR_toolcontext___ToolContext____log_directory(fra.me.REG[1]) = fra.me.REG[3];
1431 }
1432 /* toolcontext.nit:187 */
1433 REGB0 = TAG_Bool(ATTR_toolcontext___ToolContext____opt_log(fra.me.REG[1])!=NIT_NULL);
1434 if (UNTAG_Bool(REGB0)) {
1435 } else {
1436 nit_abort("Uninitialized attribute %s", "_opt_log", LOCATE_toolcontext, 187);
1437 }
1438 fra.me.REG[3] = ATTR_toolcontext___ToolContext____opt_log(fra.me.REG[1]);
1439 fra.me.REG[3] = CALL_opts___Option___value(fra.me.REG[3])(fra.me.REG[3]);
1440 if (UNTAG_Bool(fra.me.REG[3])) {
1441 /* toolcontext.nit:189 */
1442 fra.me.REG[1] = CALL_toolcontext___ToolContext___log_directory(fra.me.REG[1])(fra.me.REG[1]);
1443 CALL_standard___file___String___mkdir(fra.me.REG[1])(fra.me.REG[1]);
1444 }
1445 stack_frame_head = fra.me.prev;
1446 return;
1447 }