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