1 /* This C file is generated by NIT to compile module file. */
3 void file___Object___printn(val_t self
, val_t param0
) {
4 struct trace_t trace
= {NULL
, NULL
, 25, LOCATE_file___Object___printn
};
6 struct WBT_
**closurevariable
= NULL
;
7 trace
.prev
= tracehead
; tracehead
= &trace
;
8 trace
.file
= LOCATE_file
;
9 /* Register variable[0]: Local variable */
11 /* Register variable[1]: Local variable */
12 /* check if p<Array[Object] with p:Object */
13 if (( param0
!=NIT_NULL
) && !VAL_ISA( param0
, COLOR_Array
, ID_Array
)) { fprintf(stderr
, "Cast failled"); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_file___Object___printn
, LOCATE_file
, 26); nit_exit(1); } /*cast Array[Object]*/;
15 /* Register variable[2]: Method return value and escape marker */
16 /* Register variable[3]: Result */
17 variable
[3] = CALL_file___Object___stdout(variable
[0])(variable
[0]) /*Object::stdout*/;
18 /* Register variable[4]: Result */
19 variable
[4] = CALL_string___Object___to_s( variable
[1] /*objects*/)( variable
[1] /*objects*/) /*Array::to_s*/;
20 CALL_stream___OStream___write(variable
[3])(variable
[3], variable
[4]) /*OFStream::write*/;
21 return_label0
: while(false);
22 tracehead
= trace
.prev
;
25 void file___Object___print(val_t self
, val_t param0
) {
26 struct trace_t trace
= {NULL
, NULL
, 31, LOCATE_file___Object___print
};
27 static val_t once_value_2
= NIT_NULL
; /* Once value for string variable[4]*/
29 struct WBT_
**closurevariable
= NULL
;
30 trace
.prev
= tracehead
; tracehead
= &trace
;
31 trace
.file
= LOCATE_file
;
32 /* Register variable[0]: Local variable */
34 /* Register variable[1]: Local variable */
36 /* Register variable[2]: Method return value and escape marker */
37 /* Register variable[3]: Result */
38 variable
[3] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable
[1] /*object*/ == NIT_NULL
/*null*/) || (( variable
[1] /*object*/ != NIT_NULL
) && ((CALL_kernel___Object_____eqeq( variable
[1] /*object*/)==kernel___Object_____eqeq
)?
(IS_EQUAL_NN( variable
[1] /*object*/, NIT_NULL
/*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable
[1] /*object*/)( variable
[1] /*object*/, NIT_NULL
/*null*/) /*Object::==*/)))))));
39 if (UNTAG_Bool(variable
[3])) { /*if*/
40 /* Register variable[3]: Result */
41 variable
[3] = CALL_file___Object___stdout(variable
[0])(variable
[0]) /*Object::stdout*/;
42 /* Register variable[4]: Result */
43 variable
[4] = CALL_string___Object___to_s( variable
[1] /*object*/)( variable
[1] /*object*/) /*Object::to_s*/;
44 CALL_stream___OStream___write(variable
[3])(variable
[3], variable
[4]) /*OFStream::write*/;
46 /* Register variable[3]: Result */
47 variable
[3] = CALL_file___Object___stdout(variable
[0])(variable
[0]) /*Object::stdout*/;
48 /* Register variable[4]: Once String constant */
49 if (once_value_2
!= NIT_NULL
) variable
[4] = once_value_2
;
51 variable
[4] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)) /*new String*/;
52 once_value_2
= variable
[4];
54 /* Register variable[4]: Result */
55 CALL_stream___OStream___write(variable
[3])(variable
[3], variable
[4]) /*OFStream::write*/;
56 return_label1
: while(false);
57 tracehead
= trace
.prev
;
60 val_t
file___Object___getc(val_t self
) {
61 struct trace_t trace
= {NULL
, NULL
, 40, LOCATE_file___Object___getc
};
63 struct WBT_
**closurevariable
= NULL
;
64 trace
.prev
= tracehead
; tracehead
= &trace
;
65 trace
.file
= LOCATE_file
;
66 /* Register variable[0]: Local variable */
68 /* Register variable[1]: Method return value and escape marker */
69 /* Register variable[2]: Result */
70 variable
[2] = CALL_file___Object___stdin(variable
[0])(variable
[0]) /*Object::stdin*/;
71 /* Register variable[2]: Result */
72 variable
[2] = CALL_stream___IStream___read_char(variable
[2])(variable
[2]) /*BufferedIStream::read_char*/;
73 /* Register variable[2]: Result */
74 variable
[2] = TAG_Char(UNTAG_Int(variable
[2]));
75 variable
[1] = variable
[2];
77 return_label3
: while(false);
78 tracehead
= trace
.prev
;
81 val_t
file___Object___gets(val_t self
) {
82 struct trace_t trace
= {NULL
, NULL
, 46, LOCATE_file___Object___gets
};
84 struct WBT_
**closurevariable
= NULL
;
85 trace
.prev
= tracehead
; tracehead
= &trace
;
86 trace
.file
= LOCATE_file
;
87 /* Register variable[0]: Local variable */
89 /* Register variable[1]: Method return value and escape marker */
90 /* Register variable[2]: Result */
91 variable
[2] = CALL_file___Object___stdin(variable
[0])(variable
[0]) /*Object::stdin*/;
92 /* Register variable[2]: Result */
93 variable
[2] = CALL_stream___IStream___read_line(variable
[2])(variable
[2]) /*IStream::read_line*/;
94 variable
[1] = variable
[2];
96 return_label4
: while(false);
97 tracehead
= trace
.prev
;
100 val_t
file___Object___stdin(val_t self
) {
101 struct trace_t trace
= {NULL
, NULL
, 294, LOCATE_file___Object___stdin
};
102 static val_t once_value_6
; static int once_bool_6
; /* Once value for variable[2]*/
104 struct WBT_
**closurevariable
= NULL
;
105 trace
.prev
= tracehead
; tracehead
= &trace
;
106 trace
.file
= LOCATE_file
;
107 /* Register variable[0]: Local variable */
109 /* Register variable[1]: Method return value and escape marker */
110 /* Register variable[2]: Once expression result */
111 if (once_bool_6
) variable
[2] = once_value_6
;
113 /* Register variable[2]: Result */
114 variable
[2] = NEW_Stdin_file___Stdin___init() /*new Stdin*/;
115 once_value_6
= variable
[2];
118 /* Register variable[2]: Result */
119 variable
[1] = variable
[2];
121 return_label5
: while(false);
122 tracehead
= trace
.prev
;
125 val_t
file___Object___stdout(val_t self
) {
126 struct trace_t trace
= {NULL
, NULL
, 297, LOCATE_file___Object___stdout
};
127 static val_t once_value_8
; static int once_bool_8
; /* Once value for variable[2]*/
129 struct WBT_
**closurevariable
= NULL
;
130 trace
.prev
= tracehead
; tracehead
= &trace
;
131 trace
.file
= LOCATE_file
;
132 /* Register variable[0]: Local variable */
134 /* Register variable[1]: Method return value and escape marker */
135 /* Register variable[2]: Once expression result */
136 if (once_bool_8
) variable
[2] = once_value_8
;
138 /* Register variable[2]: Result */
139 variable
[2] = NEW_Stdout_file___Stdout___init() /*new Stdout*/;
140 once_value_8
= variable
[2];
143 /* Register variable[2]: Result */
144 variable
[1] = variable
[2];
146 return_label7
: while(false);
147 tracehead
= trace
.prev
;
150 val_t
file___Object___stderr(val_t self
) {
151 struct trace_t trace
= {NULL
, NULL
, 300, LOCATE_file___Object___stderr
};
152 static val_t once_value_10
; static int once_bool_10
; /* Once value for variable[2]*/
154 struct WBT_
**closurevariable
= NULL
;
155 trace
.prev
= tracehead
; tracehead
= &trace
;
156 trace
.file
= LOCATE_file
;
157 /* Register variable[0]: Local variable */
159 /* Register variable[1]: Method return value and escape marker */
160 /* Register variable[2]: Once expression result */
161 if (once_bool_10
) variable
[2] = once_value_10
;
163 /* Register variable[2]: Result */
164 variable
[2] = NEW_Stderr_file___Stderr___init() /*new Stderr*/;
165 once_value_10
= variable
[2];
168 /* Register variable[2]: Result */
169 variable
[1] = variable
[2];
171 return_label9
: while(false);
172 tracehead
= trace
.prev
;
175 val_t
file___FStream___path(val_t self
) {
176 struct trace_t trace
= {NULL
, NULL
, 58, LOCATE_file___FStream___path
};
177 val_t
*variable
= NULL
;
178 struct WBT_
**closurevariable
= NULL
;
179 trace
.prev
= tracehead
; tracehead
= &trace
;
180 trace
.file
= LOCATE_file
;
181 tracehead
= trace
.prev
;
182 return ATTR_file___FStream____path( self
) /*FStream::_path*/;
184 val_t
file___FStream___file_stat(val_t self
) {
185 struct trace_t trace
= {NULL
, NULL
, 64, LOCATE_file___FStream___file_stat
};
187 struct WBT_
**closurevariable
= NULL
;
188 trace
.prev
= tracehead
; tracehead
= &trace
;
189 trace
.file
= LOCATE_file
;
190 /* Register variable[0]: Local variable */
192 /* Register variable[1]: Method return value and escape marker */
193 /* Register variable[2]: Result */
194 variable
[2] = ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/;
195 /* Register variable[2]: Result */
196 variable
[2] = CALL_file___NativeFile___file_stat(variable
[2])(variable
[2]) /*NativeFile::file_stat*/;
197 variable
[1] = variable
[2];
199 return_label11
: while(false);
200 tracehead
= trace
.prev
;
203 void file___IFStream___close(val_t self
) {
204 struct trace_t trace
= {NULL
, NULL
, 83, LOCATE_file___IFStream___close
};
206 struct WBT_
**closurevariable
= NULL
;
207 trace
.prev
= tracehead
; tracehead
= &trace
;
208 trace
.file
= LOCATE_file
;
209 /* Register variable[0]: Local variable */
211 /* Register variable[1]: Method return value and escape marker */
212 /* Register variable[2]: Local variable */
213 /* Register variable[3]: Result */
214 variable
[3] = ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/;
215 /* Register variable[3]: Result */
216 variable
[3] = CALL_file___NativeFile___io_close(variable
[3])(variable
[3]) /*NativeFile::io_close*/;
217 variable
[2] = variable
[3];
218 ATTR_file___IFStream____end_reached(variable
[0]) /*IFStream::_end_reached*/ = TAG_Bool(true);
219 return_label12
: while(false);
220 tracehead
= trace
.prev
;
223 void file___IFStream___fill_buffer(val_t self
) {
224 struct trace_t trace
= {NULL
, NULL
, 89, LOCATE_file___IFStream___fill_buffer
};
226 struct WBT_
**closurevariable
= NULL
;
227 trace
.prev
= tracehead
; tracehead
= &trace
;
228 trace
.file
= LOCATE_file
;
229 /* Register variable[0]: Local variable */
231 /* Register variable[1]: Method return value and escape marker */
232 /* Register variable[2]: Local variable */
233 /* Register variable[3]: Result */
234 variable
[3] = ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/;
235 /* Register variable[4]: Result */
236 variable
[4] = ATTR_stream___BufferedIStream____buffer(variable
[0]) /*BufferedIStream::_buffer*/;
237 /* Register variable[4]: Result */
238 variable
[4] = ATTR_string___AbstractString____items(variable
[4]) /*AbstractString::_items*/;
239 /* Register variable[5]: Result */
240 variable
[5] = ATTR_stream___BufferedIStream____buffer(variable
[0]) /*BufferedIStream::_buffer*/;
241 /* Register variable[5]: Result */
242 variable
[5] = ATTR_string___Buffer____capacity(variable
[5]) /*Buffer::_capacity*/;
243 /* Register variable[3]: Result */
244 variable
[3] = CALL_file___NativeFile___io_read(variable
[3])(variable
[3], variable
[4], variable
[5]) /*NativeFile::io_read*/;
245 variable
[2] = variable
[3];
246 /* Register variable[3]: Result */
247 variable
[3] = TAG_Bool(UNTAG_Int( variable
[2] /*nb*/)<=UNTAG_Int( TAG_Int(0)));
248 if (UNTAG_Bool(variable
[3])) { /*if*/
249 ATTR_file___IFStream____end_reached(variable
[0]) /*IFStream::_end_reached*/ = TAG_Bool(true);
250 variable
[2] = TAG_Int(0) /*nb=*/;
252 /* Register variable[3]: Result */
253 variable
[3] = ATTR_stream___BufferedIStream____buffer(variable
[0]) /*BufferedIStream::_buffer*/;
254 ATTR_array___AbstractArrayRead____length(variable
[3]) /*AbstractArrayRead::_length*/ = variable
[2] /*nb*/;
255 ATTR_stream___BufferedIStream____buffer_pos(variable
[0]) /*BufferedIStream::_buffer_pos*/ = TAG_Int(0);
256 return_label13
: while(false);
257 tracehead
= trace
.prev
;
260 val_t
file___IFStream___end_reached(val_t self
) {
261 struct trace_t trace
= {NULL
, NULL
, 101, LOCATE_file___IFStream___end_reached
};
262 val_t
*variable
= NULL
;
263 struct WBT_
**closurevariable
= NULL
;
264 trace
.prev
= tracehead
; tracehead
= &trace
;
265 trace
.file
= LOCATE_file
;
266 tracehead
= trace
.prev
;
267 return ATTR_file___IFStream____end_reached( self
) /*IFStream::_end_reached*/;
269 void file___IFStream___reopen(val_t self
) {
270 struct trace_t trace
= {NULL
, NULL
, 74, LOCATE_file___IFStream___reopen
};
272 struct WBT_
**closurevariable
= NULL
;
273 trace
.prev
= tracehead
; tracehead
= &trace
;
274 trace
.file
= LOCATE_file
;
275 /* Register variable[0]: Local variable */
277 /* Register variable[1]: Method return value and escape marker */
278 /* Register variable[2]: Result */
279 variable
[2] = CALL_stream___IStream___eof(variable
[0])(variable
[0]) /*BufferedIStream::eof*/;
280 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable
[2])))) { /*if*/
281 CALL_stream___IOS___close(variable
[0])(variable
[0]) /*IFStream::close*/;
283 /* Register variable[2]: Result */
284 variable
[2] = ATTR_file___FStream____path(variable
[0]) /*FStream::_path*/;
285 /* Register variable[2]: Result */
286 variable
[2] = CALL_string___String___to_cstring(variable
[2])(variable
[2]) /*String::to_cstring*/;
287 /* Register variable[2]: Result */
288 variable
[2] = CALL_file___NativeFileCapable___io_open_read(variable
[0])(variable
[0], variable
[2]) /*NativeFileCapable::io_open_read*/;
289 ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/ = variable
[2];
290 ATTR_file___IFStream____end_reached(variable
[0]) /*IFStream::_end_reached*/ = TAG_Bool(false);
291 ATTR_stream___BufferedIStream____buffer_pos(variable
[0]) /*BufferedIStream::_buffer_pos*/ = TAG_Int(0);
292 /* Register variable[2]: Result */
293 variable
[2] = ATTR_stream___BufferedIStream____buffer(variable
[0]) /*BufferedIStream::_buffer*/;
294 CALL_abstract_collection___RemovableCollection___clear(variable
[2])(variable
[2]) /*AbstractArray::clear*/;
295 return_label14
: while(false);
296 tracehead
= trace
.prev
;
299 void file___IFStream___open(val_t self
, val_t param0
, int* init_table
) {
300 struct trace_t trace
= {NULL
, NULL
, 104, LOCATE_file___IFStream___open
};
302 struct WBT_
**closurevariable
= NULL
;
303 trace
.prev
= tracehead
; tracehead
= &trace
;
304 trace
.file
= LOCATE_file
;
305 /* Register variable[0]: Local variable */
307 /* Register variable[1]: Local variable */
308 variable
[1] = param0
;
309 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_IFStream
].i
]) return;
310 /* Register variable[2]: Method return value and escape marker */
311 ATTR_file___FStream____path(variable
[0]) /*FStream::_path*/ = variable
[1] /*path*/;
312 CALL_stream___BufferedIStream___prepare_buffer(variable
[0])(variable
[0], TAG_Int(10)) /*BufferedIStream::prepare_buffer*/;
313 /* Register variable[3]: Result */
314 variable
[3] = ATTR_file___FStream____path(variable
[0]) /*FStream::_path*/;
315 /* Register variable[3]: Result */
316 variable
[3] = CALL_string___String___to_cstring(variable
[3])(variable
[3]) /*String::to_cstring*/;
317 /* Register variable[3]: Result */
318 variable
[3] = CALL_file___NativeFileCapable___io_open_read(variable
[0])(variable
[0], variable
[3]) /*NativeFileCapable::io_open_read*/;
319 ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/ = variable
[3];
320 /* Register variable[3]: Result */
321 variable
[3] = ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/;
322 /* Register variable[3]: Result */
323 variable
[3] = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable
[3] == NIT_NULL
/*null*/) || ((variable
[3] != NIT_NULL
) && ((CALL_kernel___Object_____eqeq(variable
[3])==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable
[3], NIT_NULL
/*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable
[3])(variable
[3], NIT_NULL
/*null*/) /*Object::==*/)))))));
324 if (!UNTAG_Bool(variable
[3])) { fprintf(stderr
, "Assert%s failed", " 'cant_open_file' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_file___IFStream___open
, LOCATE_file
, 110); nit_exit(1);}
325 return_label15
: while(false);
326 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_IFStream
].i
] = 1;
327 tracehead
= trace
.prev
;
330 void file___IFStream___init(val_t self
, int* init_table
) {
331 struct trace_t trace
= {NULL
, NULL
, 113, LOCATE_file___IFStream___init
};
333 struct WBT_
**closurevariable
= NULL
;
334 trace
.prev
= tracehead
; tracehead
= &trace
;
335 trace
.file
= LOCATE_file
;
336 /* Register variable[0]: Local variable */
338 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_IFStream
].i
]) return;
339 /* Register variable[1]: Method return value and escape marker */
340 return_label16
: while(false);
341 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_IFStream
].i
] = 1;
342 tracehead
= trace
.prev
;
345 void file___IFStream___without_file(val_t self
, int* init_table
) {
346 struct trace_t trace
= {NULL
, NULL
, 114, LOCATE_file___IFStream___without_file
};
348 struct WBT_
**closurevariable
= NULL
;
349 trace
.prev
= tracehead
; tracehead
= &trace
;
350 trace
.file
= LOCATE_file
;
351 /* Register variable[0]: Local variable */
353 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_IFStream
].i
]) return;
354 /* Register variable[1]: Method return value and escape marker */
355 return_label17
: while(false);
356 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_IFStream
].i
] = 1;
357 tracehead
= trace
.prev
;
360 void file___OFStream___close(val_t self
) {
361 struct trace_t trace
= {NULL
, NULL
, 131, LOCATE_file___OFStream___close
};
363 struct WBT_
**closurevariable
= NULL
;
364 trace
.prev
= tracehead
; tracehead
= &trace
;
365 trace
.file
= LOCATE_file
;
366 /* Register variable[0]: Local variable */
368 /* Register variable[1]: Method return value and escape marker */
369 /* Register variable[2]: Local variable */
370 /* Register variable[3]: Result */
371 variable
[3] = ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/;
372 /* Register variable[3]: Result */
373 variable
[3] = CALL_file___NativeFile___io_close(variable
[3])(variable
[3]) /*NativeFile::io_close*/;
374 variable
[2] = variable
[3];
375 ATTR_file___OFStream____writable(variable
[0]) /*OFStream::_writable*/ = TAG_Bool(false);
376 return_label18
: while(false);
377 tracehead
= trace
.prev
;
380 void file___OFStream___write(val_t self
, val_t param0
) {
381 struct trace_t trace
= {NULL
, NULL
, 122, LOCATE_file___OFStream___write
};
383 struct WBT_
**closurevariable
= NULL
;
384 trace
.prev
= tracehead
; tracehead
= &trace
;
385 trace
.file
= LOCATE_file
;
386 /* Register variable[0]: Local variable */
388 /* Register variable[1]: Local variable */
389 variable
[1] = param0
;
390 /* Register variable[2]: Method return value and escape marker */
391 /* Register variable[3]: Result */
392 variable
[3] = ATTR_file___OFStream____writable(variable
[0]) /*OFStream::_writable*/;
393 if (!UNTAG_Bool(variable
[3])) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_file___OFStream___write
, LOCATE_file
, 125); nit_exit(1);}
394 /* Register variable[3]: Result */
395 variable
[3] = CALL_string___String___to_cstring( variable
[1] /*s*/)( variable
[1] /*s*/) /*String::to_cstring*/;
396 /* Register variable[4]: Result */
397 variable
[4] = CALL_abstract_collection___Collection___length( variable
[1] /*s*/)( variable
[1] /*s*/) /*AbstractArrayRead::length*/;
398 CALL_file___OFStream___write_native(variable
[0])(variable
[0], variable
[3], variable
[4]) /*OFStream::write_native*/;
399 return_label19
: while(false);
400 tracehead
= trace
.prev
;
403 val_t
file___OFStream___is_writable(val_t self
) {
404 struct trace_t trace
= {NULL
, NULL
, 129, LOCATE_file___OFStream___is_writable
};
406 struct WBT_
**closurevariable
= NULL
;
407 trace
.prev
= tracehead
; tracehead
= &trace
;
408 trace
.file
= LOCATE_file
;
409 /* Register variable[0]: Local variable */
411 /* Register variable[1]: Method return value and escape marker */
412 /* Register variable[2]: Result */
413 variable
[2] = ATTR_file___OFStream____writable(variable
[0]) /*OFStream::_writable*/;
414 variable
[1] = variable
[2];
416 return_label20
: while(false);
417 tracehead
= trace
.prev
;
420 void file___OFStream___write_native(val_t self
, val_t param0
, val_t param1
) {
421 struct trace_t trace
= {NULL
, NULL
, 140, LOCATE_file___OFStream___write_native
};
422 static val_t once_value_22
= NIT_NULL
; /* Once value for string variable[6]*/
423 static val_t once_value_23
= NIT_NULL
; /* Once value for string variable[7]*/
424 static val_t once_value_24
= NIT_NULL
; /* Once value for string variable[8]*/
426 struct WBT_
**closurevariable
= NULL
;
427 trace
.prev
= tracehead
; tracehead
= &trace
;
428 trace
.file
= LOCATE_file
;
429 /* Register variable[0]: Local variable */
431 /* Register variable[1]: Local variable */
432 variable
[1] = param0
;
433 /* Register variable[2]: Local variable */
434 variable
[2] = param1
;
435 /* Register variable[3]: Method return value and escape marker */
436 /* Register variable[4]: Result */
437 variable
[4] = ATTR_file___OFStream____writable(variable
[0]) /*OFStream::_writable*/;
438 if (!UNTAG_Bool(variable
[4])) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_file___OFStream___write_native
, LOCATE_file
, 143); nit_exit(1);}
439 /* Register variable[4]: Local variable */
440 /* Register variable[5]: Result */
441 variable
[5] = ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/;
442 /* Register variable[5]: Result */
443 variable
[5] = CALL_file___NativeFile___io_write(variable
[5])(variable
[5], variable
[1] /*native*/, variable
[2] /*len*/) /*NativeFile::io_write*/;
444 variable
[4] = variable
[5];
445 /* Register variable[5]: Result */
446 variable
[5] = TAG_Bool(( variable
[4] /*err*/)!=( variable
[2] /*len*/));
447 if (UNTAG_Bool(variable
[5])) { /*if*/
448 variable
[5] = NEW_Array_array___Array___with_capacity(TAG_Int(5)) /*new Array[Object]*/ /* Ensure var: Literal array*/;
449 /* Register variable[6]: Once String constant */
450 if (once_value_22
!= NIT_NULL
) variable
[6] = once_value_22
;
452 variable
[6] = NEW_String_string___String___with_native(BOX_NativeString("Problem in writing : "), TAG_Int(21)) /*new String*/;
453 once_value_22
= variable
[6];
455 /* Register variable[6]: Result */
456 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[6]) /*AbstractArray::add*/;
457 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[4] /*err*/) /*AbstractArray::add*/;
458 /* Register variable[7]: Once String constant */
459 if (once_value_23
!= NIT_NULL
) variable
[7] = once_value_23
;
461 variable
[7] = NEW_String_string___String___with_native(BOX_NativeString(" "), TAG_Int(1)) /*new String*/;
462 once_value_23
= variable
[7];
464 /* Register variable[7]: Result */
465 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[7]) /*AbstractArray::add*/;
466 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[2] /*len*/) /*AbstractArray::add*/;
467 /* Register variable[8]: Once String constant */
468 if (once_value_24
!= NIT_NULL
) variable
[8] = once_value_24
;
470 variable
[8] = NEW_String_string___String___with_native(BOX_NativeString("\n"), TAG_Int(1)) /*new String*/;
471 once_value_24
= variable
[8];
473 /* Register variable[8]: Result */
474 CALL_abstract_collection___SimpleCollection___add(variable
[5])(variable
[5], variable
[8]) /*AbstractArray::add*/;
475 /* Register variable[5]: Result */
476 CALL_file___Object___printn(variable
[0])(variable
[0], variable
[5]) /*Object::printn*/;
478 return_label21
: while(false);
479 tracehead
= trace
.prev
;
482 void file___OFStream___open(val_t self
, val_t param0
, int* init_table
) {
483 struct trace_t trace
= {NULL
, NULL
, 151, LOCATE_file___OFStream___open
};
485 struct WBT_
**closurevariable
= NULL
;
486 trace
.prev
= tracehead
; tracehead
= &trace
;
487 trace
.file
= LOCATE_file
;
488 /* Register variable[0]: Local variable */
490 /* Register variable[1]: Local variable */
491 variable
[1] = param0
;
492 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_OFStream
].i
]) return;
493 /* Register variable[2]: Method return value and escape marker */
494 /* Register variable[3]: Result */
495 variable
[3] = CALL_string___String___to_cstring( variable
[1] /*path*/)( variable
[1] /*path*/) /*String::to_cstring*/;
496 /* Register variable[3]: Result */
497 variable
[3] = CALL_file___NativeFileCapable___io_open_write(variable
[0])(variable
[0], variable
[3]) /*NativeFileCapable::io_open_write*/;
498 ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/ = variable
[3];
499 /* Register variable[3]: Result */
500 variable
[3] = ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/;
501 /* Register variable[3]: Result */
502 variable
[3] = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable
[3] == NIT_NULL
/*null*/) || ((variable
[3] != NIT_NULL
) && ((CALL_kernel___Object_____eqeq(variable
[3])==kernel___Object_____eqeq
)?
(IS_EQUAL_NN(variable
[3], NIT_NULL
/*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable
[3])(variable
[3], NIT_NULL
/*null*/) /*Object::==*/)))))));
503 if (!UNTAG_Bool(variable
[3])) { fprintf(stderr
, "Assert%s failed", " 'cant_open_file' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_file___OFStream___open
, LOCATE_file
, 155); nit_exit(1);}
504 ATTR_file___FStream____path(variable
[0]) /*FStream::_path*/ = variable
[1] /*path*/;
505 ATTR_file___OFStream____writable(variable
[0]) /*OFStream::_writable*/ = TAG_Bool(true);
506 return_label25
: while(false);
507 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_OFStream
].i
] = 1;
508 tracehead
= trace
.prev
;
511 void file___OFStream___init(val_t self
, int* init_table
) {
512 struct trace_t trace
= {NULL
, NULL
, 160, LOCATE_file___OFStream___init
};
514 struct WBT_
**closurevariable
= NULL
;
515 trace
.prev
= tracehead
; tracehead
= &trace
;
516 trace
.file
= LOCATE_file
;
517 /* Register variable[0]: Local variable */
519 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_OFStream
].i
]) return;
520 /* Register variable[1]: Method return value and escape marker */
521 return_label26
: while(false);
522 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_OFStream
].i
] = 1;
523 tracehead
= trace
.prev
;
526 void file___OFStream___without_file(val_t self
, int* init_table
) {
527 struct trace_t trace
= {NULL
, NULL
, 161, LOCATE_file___OFStream___without_file
};
529 struct WBT_
**closurevariable
= NULL
;
530 trace
.prev
= tracehead
; tracehead
= &trace
;
531 trace
.file
= LOCATE_file
;
532 /* Register variable[0]: Local variable */
534 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_OFStream
].i
]) return;
535 /* Register variable[1]: Method return value and escape marker */
536 return_label27
: while(false);
537 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_OFStream
].i
] = 1;
538 tracehead
= trace
.prev
;
541 void file___Stdin___init(val_t self
, int* init_table
) {
542 struct trace_t trace
= {NULL
, NULL
, 168, LOCATE_file___Stdin___init
};
543 static val_t once_value_29
= NIT_NULL
; /* Once value for string variable[2]*/
545 struct WBT_
**closurevariable
= NULL
;
546 trace
.prev
= tracehead
; tracehead
= &trace
;
547 trace
.file
= LOCATE_file
;
548 /* Register variable[0]: Local variable */
550 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_Stdin
].i
]) return;
551 /* Register variable[1]: Method return value and escape marker */
552 CALL_file___IFStream___init(variable
[0])(variable
[0], init_table
/*YYY*/) /*IFStream::init*/;
553 /* Register variable[2]: Result */
554 variable
[2] = CALL_file___NativeFileCapable___native_stdin(variable
[0])(variable
[0]) /*NativeFileCapable::native_stdin*/;
555 ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/ = variable
[2];
556 /* Register variable[2]: Once String constant */
557 if (once_value_29
!= NIT_NULL
) variable
[2] = once_value_29
;
559 variable
[2] = NEW_String_string___String___with_native(BOX_NativeString("/dev/stdin"), TAG_Int(10)) /*new String*/;
560 once_value_29
= variable
[2];
562 /* Register variable[2]: Result */
563 ATTR_file___FStream____path(variable
[0]) /*FStream::_path*/ = variable
[2];
564 CALL_stream___BufferedIStream___prepare_buffer(variable
[0])(variable
[0], TAG_Int(1)) /*BufferedIStream::prepare_buffer*/;
565 return_label28
: while(false);
566 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_Stdin
].i
] = 1;
567 tracehead
= trace
.prev
;
570 void file___Stdout___init(val_t self
, int* init_table
) {
571 struct trace_t trace
= {NULL
, NULL
, 177, LOCATE_file___Stdout___init
};
572 static val_t once_value_31
= NIT_NULL
; /* Once value for string variable[2]*/
574 struct WBT_
**closurevariable
= NULL
;
575 trace
.prev
= tracehead
; tracehead
= &trace
;
576 trace
.file
= LOCATE_file
;
577 /* Register variable[0]: Local variable */
579 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_Stdout
].i
]) return;
580 /* Register variable[1]: Method return value and escape marker */
581 CALL_file___OFStream___init(variable
[0])(variable
[0], init_table
/*YYY*/) /*OFStream::init*/;
582 /* Register variable[2]: Result */
583 variable
[2] = CALL_file___NativeFileCapable___native_stdout(variable
[0])(variable
[0]) /*NativeFileCapable::native_stdout*/;
584 ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/ = variable
[2];
585 /* Register variable[2]: Once String constant */
586 if (once_value_31
!= NIT_NULL
) variable
[2] = once_value_31
;
588 variable
[2] = NEW_String_string___String___with_native(BOX_NativeString("/dev/stdout"), TAG_Int(11)) /*new String*/;
589 once_value_31
= variable
[2];
591 /* Register variable[2]: Result */
592 ATTR_file___FStream____path(variable
[0]) /*FStream::_path*/ = variable
[2];
593 ATTR_file___OFStream____writable(variable
[0]) /*OFStream::_writable*/ = TAG_Bool(true);
594 return_label30
: while(false);
595 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_Stdout
].i
] = 1;
596 tracehead
= trace
.prev
;
599 void file___Stderr___init(val_t self
, int* init_table
) {
600 struct trace_t trace
= {NULL
, NULL
, 186, LOCATE_file___Stderr___init
};
601 static val_t once_value_33
= NIT_NULL
; /* Once value for string variable[2]*/
603 struct WBT_
**closurevariable
= NULL
;
604 trace
.prev
= tracehead
; tracehead
= &trace
;
605 trace
.file
= LOCATE_file
;
606 /* Register variable[0]: Local variable */
608 if (init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_Stderr
].i
]) return;
609 /* Register variable[1]: Method return value and escape marker */
610 CALL_file___OFStream___init(variable
[0])(variable
[0], init_table
/*YYY*/) /*OFStream::init*/;
611 /* Register variable[2]: Result */
612 variable
[2] = CALL_file___NativeFileCapable___native_stderr(variable
[0])(variable
[0]) /*NativeFileCapable::native_stderr*/;
613 ATTR_file___FStream____file(variable
[0]) /*FStream::_file*/ = variable
[2];
614 /* Register variable[2]: Once String constant */
615 if (once_value_33
!= NIT_NULL
) variable
[2] = once_value_33
;
617 variable
[2] = NEW_String_string___String___with_native(BOX_NativeString("/dev/stderr"), TAG_Int(11)) /*new String*/;
618 once_value_33
= variable
[2];
620 /* Register variable[2]: Result */
621 ATTR_file___FStream____path(variable
[0]) /*FStream::_path*/ = variable
[2];
622 ATTR_file___OFStream____writable(variable
[0]) /*OFStream::_writable*/ = TAG_Bool(true);
623 return_label32
: while(false);
624 init_table
[VAL2OBJ(variable
[0])->vft
[INIT_TABLE_POS_Stderr
].i
] = 1;
625 tracehead
= trace
.prev
;
628 val_t
file___String___file_exists(val_t self
) {
629 struct trace_t trace
= {NULL
, NULL
, 196, LOCATE_file___String___file_exists
};
631 struct WBT_
**closurevariable
= NULL
;
632 trace
.prev
= tracehead
; tracehead
= &trace
;
633 trace
.file
= LOCATE_file
;
634 /* Register variable[0]: Local variable */
636 /* Register variable[1]: Method return value and escape marker */
637 /* Register variable[2]: Result */
638 variable
[2] = CALL_string___String___to_cstring(variable
[0])(variable
[0]) /*String::to_cstring*/;
639 /* Register variable[2]: Result */
640 variable
[2] = CALL_file___NativeString___file_exists(variable
[2])(variable
[2]) /*NativeString::file_exists*/;
641 variable
[1] = variable
[2];
643 return_label34
: while(false);
644 tracehead
= trace
.prev
;
647 val_t
file___String___file_stat(val_t self
) {
648 struct trace_t trace
= {NULL
, NULL
, 199, LOCATE_file___String___file_stat
};
650 struct WBT_
**closurevariable
= NULL
;
651 trace
.prev
= tracehead
; tracehead
= &trace
;
652 trace
.file
= LOCATE_file
;
653 /* Register variable[0]: Local variable */
655 /* Register variable[1]: Method return value and escape marker */
656 /* Register variable[2]: Result */
657 variable
[2] = CALL_string___String___to_cstring(variable
[0])(variable
[0]) /*String::to_cstring*/;
658 /* Register variable[2]: Result */
659 variable
[2] = CALL_file___NativeString___file_stat(variable
[2])(variable
[2]) /*NativeString::file_stat*/;
660 variable
[1] = variable
[2];
662 return_label35
: while(false);
663 tracehead
= trace
.prev
;
666 val_t
file___String___file_delete(val_t self
) {
667 struct trace_t trace
= {NULL
, NULL
, 201, LOCATE_file___String___file_delete
};
669 struct WBT_
**closurevariable
= NULL
;
670 trace
.prev
= tracehead
; tracehead
= &trace
;
671 trace
.file
= LOCATE_file
;
672 /* Register variable[0]: Local variable */
674 /* Register variable[1]: Method return value and escape marker */
675 /* Register variable[2]: Result */
676 variable
[2] = CALL_string___String___to_cstring(variable
[0])(variable
[0]) /*String::to_cstring*/;
677 /* Register variable[2]: Result */
678 variable
[2] = CALL_file___NativeString___file_delete(variable
[2])(variable
[2]) /*NativeString::file_delete*/;
679 variable
[1] = variable
[2];
681 return_label36
: while(false);
682 tracehead
= trace
.prev
;
685 val_t
file___String___strip_extension(val_t self
, val_t param0
) {
686 struct trace_t trace
= {NULL
, NULL
, 203, LOCATE_file___String___strip_extension
};
688 struct WBT_
**closurevariable
= NULL
;
689 trace
.prev
= tracehead
; tracehead
= &trace
;
690 trace
.file
= LOCATE_file
;
691 /* Register variable[0]: Local variable */
693 /* Register variable[1]: Local variable */
694 variable
[1] = param0
;
695 /* Register variable[2]: Method return value and escape marker */
696 /* Register variable[3]: Result */
697 variable
[3] = CALL_string___AbstractString___has_suffix(variable
[0])(variable
[0], variable
[1] /*ext*/) /*AbstractString::has_suffix*/;
698 if (UNTAG_Bool(variable
[3])) { /*if*/
699 /* Register variable[3]: Result */
700 variable
[3] = CALL_abstract_collection___Collection___length(variable
[0])(variable
[0]) /*AbstractArrayRead::length*/;
701 /* Register variable[4]: Result */
702 variable
[4] = CALL_abstract_collection___Collection___length( variable
[1] /*ext*/)( variable
[1] /*ext*/) /*AbstractArrayRead::length*/;
703 /* Register variable[3]: Result */
704 variable
[3] = TAG_Int(UNTAG_Int(variable
[3])-UNTAG_Int(variable
[4]));
705 /* Register variable[3]: Result */
706 variable
[3] = CALL_string___AbstractString___substring(variable
[0])(variable
[0], TAG_Int(0), variable
[3]) /*AbstractString::substring*/;
707 variable
[2] = variable
[3];
710 variable
[2] = variable
[0];
712 return_label37
: while(false);
713 tracehead
= trace
.prev
;
716 val_t
file___String___basename(val_t self
, val_t param0
) {
717 struct trace_t trace
= {NULL
, NULL
, 211, LOCATE_file___String___basename
};
719 struct WBT_
**closurevariable
= NULL
;
720 trace
.prev
= tracehead
; tracehead
= &trace
;
721 trace
.file
= LOCATE_file
;
722 /* Register variable[0]: Local variable */
724 /* Register variable[1]: Local variable */
725 variable
[1] = param0
;
726 /* Register variable[2]: Method return value and escape marker */
727 /* Register variable[3]: Local variable */
728 /* Register variable[4]: Result */
729 variable
[4] = ATTR_array___AbstractArrayRead____length(variable
[0]) /*AbstractArrayRead::_length*/;
730 /* Register variable[4]: Result */
731 variable
[4] = TAG_Int(UNTAG_Int(variable
[4])-UNTAG_Int( TAG_Int(1)));
732 /* Register variable[4]: Result */
733 variable
[4] = CALL_array___AbstractArrayRead___last_index_of_from(variable
[0])(variable
[0], TAG_Char('/'), variable
[4]) /*AbstractArrayRead::last_index_of_from*/;
734 variable
[3] = variable
[4];
735 /* Register variable[4]: Local variable */
736 variable
[4] = variable
[0];
737 /* Register variable[5]: Result */
738 variable
[5] = TAG_Bool(UNTAG_Int( variable
[3] /*pos*/)>=UNTAG_Int( TAG_Int(0)));
739 if (UNTAG_Bool(variable
[5])) { /*if*/
740 /* Register variable[5]: Result */
741 variable
[5] = TAG_Int(UNTAG_Int( variable
[3] /*pos*/)+UNTAG_Int( TAG_Int(1)));
742 /* Register variable[5]: Result */
743 variable
[5] = CALL_string___AbstractString___substring_from(variable
[0])(variable
[0], variable
[5]) /*AbstractString::substring_from*/;
744 variable
[4] = variable
[5] /*n=*/;
746 /* Register variable[5]: Result */
747 variable
[5] = CALL_file___String___strip_extension( variable
[4] /*n*/)( variable
[4] /*n*/, variable
[1] /*ext*/) /*String::strip_extension*/;
748 variable
[2] = variable
[5];
750 return_label38
: while(false);
751 tracehead
= trace
.prev
;
754 val_t
file___String___dirname(val_t self
) {
755 struct trace_t trace
= {NULL
, NULL
, 221, LOCATE_file___String___dirname
};
756 static val_t once_value_40
= NIT_NULL
; /* Once value for string variable[3]*/
758 struct WBT_
**closurevariable
= NULL
;
759 trace
.prev
= tracehead
; tracehead
= &trace
;
760 trace
.file
= LOCATE_file
;
761 /* Register variable[0]: Local variable */
763 /* Register variable[1]: Method return value and escape marker */
764 /* Register variable[2]: Local variable */
765 /* Register variable[3]: Result */
766 variable
[3] = ATTR_array___AbstractArrayRead____length(variable
[0]) /*AbstractArrayRead::_length*/;
767 /* Register variable[3]: Result */
768 variable
[3] = TAG_Int(UNTAG_Int(variable
[3])-UNTAG_Int( TAG_Int(1)));
769 /* Register variable[3]: Result */
770 variable
[3] = CALL_array___AbstractArrayRead___last_index_of_from(variable
[0])(variable
[0], TAG_Char('/'), variable
[3]) /*AbstractArrayRead::last_index_of_from*/;
771 variable
[2] = variable
[3];
772 /* Register variable[3]: Result */
773 variable
[3] = TAG_Bool(UNTAG_Int( variable
[2] /*pos*/)>=UNTAG_Int( TAG_Int(0)));
774 if (UNTAG_Bool(variable
[3])) { /*if*/
775 /* Register variable[3]: Result */
776 variable
[3] = CALL_string___AbstractString___substring(variable
[0])(variable
[0], TAG_Int(0), variable
[2] /*pos*/) /*AbstractString::substring*/;
777 variable
[1] = variable
[3];
780 /* Register variable[3]: Once String constant */
781 if (once_value_40
!= NIT_NULL
) variable
[3] = once_value_40
;
783 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)) /*new String*/;
784 once_value_40
= variable
[3];
786 /* Register variable[3]: Result */
787 variable
[1] = variable
[3];
790 return_label39
: while(false);
791 tracehead
= trace
.prev
;
794 val_t
file___String___file_path(val_t self
) {
795 struct trace_t trace
= {NULL
, NULL
, 231, LOCATE_file___String___file_path
};
796 static val_t once_value_42
= NIT_NULL
; /* Once value for string variable[4]*/
798 struct WBT_
**closurevariable
= NULL
;
799 trace
.prev
= tracehead
; tracehead
= &trace
;
800 trace
.file
= LOCATE_file
;
801 /* Register variable[0]: Local variable */
803 /* Register variable[1]: Method return value and escape marker */
804 /* Register variable[2]: Local variable */
805 /* Register variable[3]: Result */
806 variable
[3] = ATTR_array___AbstractArrayRead____length(variable
[0]) /*AbstractArrayRead::_length*/;
807 variable
[2] = variable
[3];
808 /* Register variable[3]: Local variable */
809 /* Register variable[4]: Result */
810 variable
[4] = TAG_Int(UNTAG_Int( variable
[2] /*l*/)-UNTAG_Int( TAG_Int(1)));
811 /* Register variable[4]: Result */
812 variable
[4] = CALL_array___AbstractArrayRead___last_index_of_from(variable
[0])(variable
[0], TAG_Char('/'), variable
[4]) /*AbstractArrayRead::last_index_of_from*/;
813 variable
[3] = variable
[4];
814 /* Register variable[4]: Result */
815 variable
[4] = TAG_Bool(UNTAG_Int( variable
[3] /*pos*/)>=UNTAG_Int( TAG_Int(0)));
816 if (UNTAG_Bool(variable
[4])) { /*if*/
817 /* Register variable[4]: Result */
818 variable
[4] = CALL_string___AbstractString___substring(variable
[0])(variable
[0], TAG_Int(0), variable
[3] /*pos*/) /*AbstractString::substring*/;
819 variable
[1] = variable
[4];
822 /* Register variable[4]: Once String constant */
823 if (once_value_42
!= NIT_NULL
) variable
[4] = once_value_42
;
825 variable
[4] = NEW_String_string___String___with_native(BOX_NativeString("."), TAG_Int(1)) /*new String*/;
826 once_value_42
= variable
[4];
828 /* Register variable[4]: Result */
829 variable
[1] = variable
[4];
831 return_label41
: while(false);
832 tracehead
= trace
.prev
;
835 void file___String___mkdir(val_t self
) {
836 struct trace_t trace
= {NULL
, NULL
, 241, LOCATE_file___String___mkdir
};
837 static val_t once_value_44
= NIT_NULL
; /* Once value for string variable[3]*/
839 struct WBT_
**closurevariable
= NULL
;
840 trace
.prev
= tracehead
; tracehead
= &trace
;
841 trace
.file
= LOCATE_file
;
842 /* Register variable[0]: Local variable */
844 /* Register variable[1]: Method return value and escape marker */
845 /* Register variable[2]: Local variable */
846 /* Register variable[3]: Once String constant */
847 if (once_value_44
!= NIT_NULL
) variable
[3] = once_value_44
;
849 variable
[3] = NEW_String_string___String___with_native(BOX_NativeString("/"), TAG_Int(1)) /*new String*/;
850 once_value_44
= variable
[3];
852 /* Register variable[3]: Result */
853 /* Register variable[3]: Result */
854 variable
[3] = CALL_string_search___String___split_with(variable
[0])(variable
[0], variable
[3]) /*String::split_with*/;
855 variable
[2] = variable
[3];
856 /* Register variable[3]: Local variable */
857 /* Register variable[4]: Result */
858 variable
[4] = NEW_Buffer_string___Buffer___init() /*new Buffer*/;
859 variable
[3] = variable
[4];
860 /* Register variable[4]: Result */
861 variable
[4] = CALL_abstract_collection___Collection___is_empty( variable
[2] /*dirs*/)( variable
[2] /*dirs*/) /*AbstractArrayRead::is_empty*/;
862 if (UNTAG_Bool(variable
[4])) { /*if*/
865 /* Register variable[4]: Local variable */
866 variable
[4] = variable
[2] /*dirs*/;
867 /* Register variable[5]: Local variable */
868 variable
[5] = TAG_Int(0);
869 /* Register variable[6]: Method return value and escape marker */
870 /* Register variable[7]: Result */
871 variable
[7] = TAG_Bool(UNTAG_Int( variable
[5] /*index*/)>=UNTAG_Int( TAG_Int(0)));
872 /* Ensure var variable[7]: Left 'and' operand*/
873 if (UNTAG_Bool(variable
[7])) { /* and */
874 /* Register variable[7]: Result */
875 variable
[7] = ATTR_array___AbstractArrayRead____length(variable
[4]) /*AbstractArrayRead::_length*/;
876 /* Register variable[7]: Result */
877 variable
[7] = TAG_Bool(UNTAG_Int( variable
[5] /*index*/)<UNTAG_Int(variable
[7]));
879 /* Register variable[7]: Result */
880 if (!UNTAG_Bool(variable
[7])) { fprintf(stderr
, "Assert%s failed", " 'index' "); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_array___Array_____bra
, LOCATE_file
, 234); nit_exit(1);}
881 /* Register variable[7]: Result */
882 variable
[7] = ATTR_array___Array____items(variable
[4]) /*Array::_items*/;
883 /* Register variable[7]: Result */
884 variable
[7] = UNBOX_NativeArray(variable
[7])[UNTAG_Int( variable
[5] /*index*/)];
885 variable
[6] = variable
[7];
887 return_label45
: while(false);
888 /* Register variable[4]: Result */
889 variable
[4] = variable
[6];
890 /* Register variable[4]: Result */
891 variable
[4] = CALL_abstract_collection___Collection___is_empty(variable
[4])(variable
[4]) /*AbstractArrayRead::is_empty*/;
892 if (UNTAG_Bool(variable
[4])) { /*if*/
893 CALL_abstract_collection___SimpleCollection___add( variable
[3] /*path*/)( variable
[3] /*path*/, TAG_Char('/')) /*Buffer::add*/;
895 /* Register variable[4]: For iterator */
896 variable
[4] = CALL_abstract_collection___Collection___iterator( variable
[2] /*dirs*/)( variable
[2] /*dirs*/) /*AbstractArrayRead::iterator*/;
897 while (true) { /*for*/
898 /* Register variable[5]: For 'is_ok' result */
899 variable
[5] = CALL_abstract_collection___Iterator___is_ok(variable
[4])(variable
[4]) /*ArrayIterator::is_ok*/;
900 if (!UNTAG_Bool(variable
[5])) break; /*for*/
901 variable
[5] = CALL_abstract_collection___Iterator___item(variable
[4])(variable
[4]) /*ArrayIterator::item*/ /* Ensure var: For item*/;
902 /* Register variable[6]: Local variable */
903 variable
[6] = variable
[5];
904 /* Register variable[7]: Result */
905 variable
[7] = CALL_abstract_collection___Collection___is_empty( variable
[6] /*d*/)( variable
[6] /*d*/) /*AbstractArrayRead::is_empty*/;
906 if (UNTAG_Bool(variable
[7])) { /*if*/
909 CALL_abstract_collection___IndexedCollection___append( variable
[3] /*path*/)( variable
[3] /*path*/, variable
[6] /*d*/) /*Buffer::append*/;
910 CALL_abstract_collection___SimpleCollection___add( variable
[3] /*path*/)( variable
[3] /*path*/, TAG_Char('/')) /*Buffer::add*/;
911 /* Register variable[7]: Result */
912 variable
[7] = CALL_string___Object___to_s( variable
[3] /*path*/)( variable
[3] /*path*/) /*Buffer::to_s*/;
913 /* Register variable[7]: Result */
914 variable
[7] = CALL_string___String___to_cstring(variable
[7])(variable
[7]) /*String::to_cstring*/;
915 CALL_file___NativeString___file_mkdir(variable
[7])(variable
[7]) /*NativeString::file_mkdir*/;
916 continue_46
: while(0);
917 CALL_abstract_collection___Iterator___next(variable
[4])(variable
[4]) /*ArrayIterator::next*/;
920 return_label43
: while(false);
921 tracehead
= trace
.prev
;
924 val_t
file___NativeString___file_exists(val_t self
) {
925 struct trace_t trace
= {NULL
, NULL
, 261, LOCATE_file___NativeString___file_exists
};
926 val_t
*variable
= NULL
;
927 struct WBT_
**closurevariable
= NULL
;
928 trace
.prev
= tracehead
; tracehead
= &trace
;
929 trace
.file
= LOCATE_file
;
930 tracehead
= trace
.prev
;
931 return TAG_Bool(string_NativeString_NativeString_file_exists_0(UNBOX_NativeString( self
)));
933 val_t
file___NativeString___file_stat(val_t self
) {
934 struct trace_t trace
= {NULL
, NULL
, 262, LOCATE_file___NativeString___file_stat
};
935 val_t
*variable
= NULL
;
936 struct WBT_
**closurevariable
= NULL
;
937 trace
.prev
= tracehead
; tracehead
= &trace
;
938 trace
.file
= LOCATE_file
;
939 tracehead
= trace
.prev
;
940 return BOX_FileStat(string_NativeString_NativeString_file_stat_0(UNBOX_NativeString( self
)));
942 val_t
file___NativeString___file_mkdir(val_t self
) {
943 struct trace_t trace
= {NULL
, NULL
, 263, LOCATE_file___NativeString___file_mkdir
};
944 val_t
*variable
= NULL
;
945 struct WBT_
**closurevariable
= NULL
;
946 trace
.prev
= tracehead
; tracehead
= &trace
;
947 trace
.file
= LOCATE_file
;
948 tracehead
= trace
.prev
;
949 return TAG_Bool(string_NativeString_NativeString_file_mkdir_0(UNBOX_NativeString( self
)));
951 val_t
file___NativeString___file_delete(val_t self
) {
952 struct trace_t trace
= {NULL
, NULL
, 264, LOCATE_file___NativeString___file_delete
};
953 val_t
*variable
= NULL
;
954 struct WBT_
**closurevariable
= NULL
;
955 trace
.prev
= tracehead
; tracehead
= &trace
;
956 trace
.file
= LOCATE_file
;
957 tracehead
= trace
.prev
;
958 return TAG_Bool(string_NativeString_NativeString_file_delete_0(UNBOX_NativeString( self
)));
960 val_t
file___FileStat___mode(val_t self
) {
961 struct trace_t trace
= {NULL
, NULL
, 269, LOCATE_file___FileStat___mode
};
962 val_t
*variable
= NULL
;
963 struct WBT_
**closurevariable
= NULL
;
964 trace
.prev
= tracehead
; tracehead
= &trace
;
965 trace
.file
= LOCATE_file
;
966 tracehead
= trace
.prev
;
967 return TAG_Int(file_FileStat_FileStat_mode_0(UNBOX_FileStat( self
)));
969 val_t
file___FileStat___atime(val_t self
) {
970 struct trace_t trace
= {NULL
, NULL
, 271, LOCATE_file___FileStat___atime
};
971 val_t
*variable
= NULL
;
972 struct WBT_
**closurevariable
= NULL
;
973 trace
.prev
= tracehead
; tracehead
= &trace
;
974 trace
.file
= LOCATE_file
;
975 tracehead
= trace
.prev
;
976 return TAG_Int(file_FileStat_FileStat_atime_0(UNBOX_FileStat( self
)));
978 val_t
file___FileStat___ctime(val_t self
) {
979 struct trace_t trace
= {NULL
, NULL
, 272, LOCATE_file___FileStat___ctime
};
980 val_t
*variable
= NULL
;
981 struct WBT_
**closurevariable
= NULL
;
982 trace
.prev
= tracehead
; tracehead
= &trace
;
983 trace
.file
= LOCATE_file
;
984 tracehead
= trace
.prev
;
985 return TAG_Int(file_FileStat_FileStat_ctime_0(UNBOX_FileStat( self
)));
987 val_t
file___FileStat___mtime(val_t self
) {
988 struct trace_t trace
= {NULL
, NULL
, 273, LOCATE_file___FileStat___mtime
};
989 val_t
*variable
= NULL
;
990 struct WBT_
**closurevariable
= NULL
;
991 trace
.prev
= tracehead
; tracehead
= &trace
;
992 trace
.file
= LOCATE_file
;
993 tracehead
= trace
.prev
;
994 return TAG_Int(file_FileStat_FileStat_mtime_0(UNBOX_FileStat( self
)));
996 val_t
file___FileStat___size(val_t self
) {
997 struct trace_t trace
= {NULL
, NULL
, 274, LOCATE_file___FileStat___size
};
998 val_t
*variable
= NULL
;
999 struct WBT_
**closurevariable
= NULL
;
1000 trace
.prev
= tracehead
; tracehead
= &trace
;
1001 trace
.file
= LOCATE_file
;
1002 tracehead
= trace
.prev
;
1003 return TAG_Int(file_FileStat_FileStat_size_0(UNBOX_FileStat( self
)));
1005 val_t
file___NativeFile___io_read(val_t self
, val_t param0
, val_t param1
) {
1006 struct trace_t trace
= {NULL
, NULL
, 280, LOCATE_file___NativeFile___io_read
};
1007 val_t
*variable
= NULL
;
1008 struct WBT_
**closurevariable
= NULL
;
1009 trace
.prev
= tracehead
; tracehead
= &trace
;
1010 trace
.file
= LOCATE_file
;
1011 tracehead
= trace
.prev
;
1012 return TAG_Int(file_NativeFile_NativeFile_io_read_2(UNBOX_NativeFile( self
), UNBOX_NativeString( param0
), UNTAG_Int( param1
)));
1014 val_t
file___NativeFile___io_write(val_t self
, val_t param0
, val_t param1
) {
1015 struct trace_t trace
= {NULL
, NULL
, 281, LOCATE_file___NativeFile___io_write
};
1016 val_t
*variable
= NULL
;
1017 struct WBT_
**closurevariable
= NULL
;
1018 trace
.prev
= tracehead
; tracehead
= &trace
;
1019 trace
.file
= LOCATE_file
;
1020 tracehead
= trace
.prev
;
1021 return TAG_Int(file_NativeFile_NativeFile_io_write_2(UNBOX_NativeFile( self
), UNBOX_NativeString( param0
), UNTAG_Int( param1
)));
1023 val_t
file___NativeFile___io_close(val_t self
) {
1024 struct trace_t trace
= {NULL
, NULL
, 282, LOCATE_file___NativeFile___io_close
};
1025 val_t
*variable
= NULL
;
1026 struct WBT_
**closurevariable
= NULL
;
1027 trace
.prev
= tracehead
; tracehead
= &trace
;
1028 trace
.file
= LOCATE_file
;
1029 tracehead
= trace
.prev
;
1030 return TAG_Int(file_NativeFile_NativeFile_io_close_0(UNBOX_NativeFile( self
)));
1032 val_t
file___NativeFile___file_stat(val_t self
) {
1033 struct trace_t trace
= {NULL
, NULL
, 283, LOCATE_file___NativeFile___file_stat
};
1034 val_t
*variable
= NULL
;
1035 struct WBT_
**closurevariable
= NULL
;
1036 trace
.prev
= tracehead
; tracehead
= &trace
;
1037 trace
.file
= LOCATE_file
;
1038 tracehead
= trace
.prev
;
1039 return BOX_FileStat(file_NativeFile_NativeFile_file_stat_0(UNBOX_NativeFile( self
)));
1041 val_t
file___NativeFileCapable___io_open_read(val_t self
, val_t param0
) {
1042 struct trace_t trace
= {NULL
, NULL
, 287, LOCATE_file___NativeFileCapable___io_open_read
};
1043 val_t
*variable
= NULL
;
1044 struct WBT_
**closurevariable
= NULL
;
1045 trace
.prev
= tracehead
; tracehead
= &trace
;
1046 trace
.file
= LOCATE_file
;
1047 tracehead
= trace
.prev
;
1048 return BOX_NativeFile(file_NativeFileCapable_NativeFileCapable_io_open_read_1( self
, UNBOX_NativeString( param0
)));
1050 val_t
file___NativeFileCapable___io_open_write(val_t self
, val_t param0
) {
1051 struct trace_t trace
= {NULL
, NULL
, 288, LOCATE_file___NativeFileCapable___io_open_write
};
1052 val_t
*variable
= NULL
;
1053 struct WBT_
**closurevariable
= NULL
;
1054 trace
.prev
= tracehead
; tracehead
= &trace
;
1055 trace
.file
= LOCATE_file
;
1056 tracehead
= trace
.prev
;
1057 return BOX_NativeFile(file_NativeFileCapable_NativeFileCapable_io_open_write_1( self
, UNBOX_NativeString( param0
)));
1059 val_t
file___NativeFileCapable___native_stdin(val_t self
) {
1060 struct trace_t trace
= {NULL
, NULL
, 289, LOCATE_file___NativeFileCapable___native_stdin
};
1061 val_t
*variable
= NULL
;
1062 struct WBT_
**closurevariable
= NULL
;
1063 trace
.prev
= tracehead
; tracehead
= &trace
;
1064 trace
.file
= LOCATE_file
;
1065 tracehead
= trace
.prev
;
1066 return BOX_NativeFile(file_NativeFileCapable_NativeFileCapable_native_stdin_0( self
));
1068 val_t
file___NativeFileCapable___native_stdout(val_t self
) {
1069 struct trace_t trace
= {NULL
, NULL
, 290, LOCATE_file___NativeFileCapable___native_stdout
};
1070 val_t
*variable
= NULL
;
1071 struct WBT_
**closurevariable
= NULL
;
1072 trace
.prev
= tracehead
; tracehead
= &trace
;
1073 trace
.file
= LOCATE_file
;
1074 tracehead
= trace
.prev
;
1075 return BOX_NativeFile(file_NativeFileCapable_NativeFileCapable_native_stdout_0( self
));
1077 val_t
file___NativeFileCapable___native_stderr(val_t self
) {
1078 struct trace_t trace
= {NULL
, NULL
, 291, LOCATE_file___NativeFileCapable___native_stderr
};
1079 val_t
*variable
= NULL
;
1080 struct WBT_
**closurevariable
= NULL
;
1081 trace
.prev
= tracehead
; tracehead
= &trace
;
1082 trace
.file
= LOCATE_file
;
1083 tracehead
= trace
.prev
;
1084 return BOX_NativeFile(file_NativeFileCapable_NativeFileCapable_native_stderr_0( self
));