1 /* This C file is generated by NIT to compile module stream. */
2 #include "stream._sep.h"
3 void stream___IOS___close(val_t self
) {
4 struct trace_t trace
= {NULL
, NULL
, 20, LOCATE_stream___IOS___close
};
5 trace
.prev
= tracehead
; tracehead
= &trace
;
6 trace
.file
= LOCATE_stream
;
7 fprintf(stderr
, "Deferred method %s called");
8 fprintf(stderr
, " (%s:%d)\n", LOCATE_stream
, 20);
10 tracehead
= trace
.prev
;
13 void stream___IOS___init(val_t self
, int* init_table
) {
14 struct trace_t trace
= {NULL
, NULL
, 0, LOCATE_stream___IOS___init
};
15 trace
.prev
= tracehead
; tracehead
= &trace
;
16 trace
.file
= LOCATE_stream
;
17 tracehead
= trace
.prev
;
20 val_t
stream___IStream___read_char(val_t self
) {
21 struct trace_t trace
= {NULL
, NULL
, 27, LOCATE_stream___IStream___read_char
};
22 trace
.prev
= tracehead
; tracehead
= &trace
;
23 trace
.file
= LOCATE_stream
;
24 fprintf(stderr
, "Deferred method %s called");
25 fprintf(stderr
, " (%s:%d)\n", LOCATE_stream
, 27);
27 tracehead
= trace
.prev
;
30 val_t
stream___IStream___read(val_t self
, val_t param0
) {
31 struct trace_t trace
= {NULL
, NULL
, 30, LOCATE_stream___IStream___read
};
36 trace
.prev
= tracehead
; tracehead
= &trace
;
37 trace
.file
= LOCATE_stream
;
39 variable2
= NEW_String_string___String___with_capacity( variable0
/*i*/); /*new String*/
40 variable1
= variable2
;
41 while (true) { /*while*/
42 variable2
= TAG_Bool(UNTAG_Int( variable0
/*i*/)>UNTAG_Int( TAG_Int(0)));
43 variable3
= variable2
;
44 if (UNTAG_Bool(variable3
)) { /* and */
45 variable3
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
46 variable3
= TAG_Bool(!UNTAG_Bool(variable3
));
48 variable2
= variable3
;
49 if (!UNTAG_Bool(variable2
)) break; /* while*/
50 variable3
= ((stream___IStream___read_char_t
)CALL( self
,COLOR_stream___IStream___read_char
))( self
) /*IStream::read_char*/;
51 variable2
= variable3
;
52 variable3
= TAG_Bool(UNTAG_Int( variable2
/*c*/)>=UNTAG_Int( TAG_Int(0)));
53 if (UNTAG_Bool(variable3
)) { /*if*/
54 variable3
= TAG_Char(UNTAG_Int( variable2
/*c*/));
55 ((string___String___add_t
)CALL( variable1
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable1
/*s*/, variable3
) /*String::add*/;
56 variable0
= TAG_Int(UNTAG_Int(variable0
)-UNTAG_Int( TAG_Int(1))) /*i*/;
61 variable1
= variable1
/*s*/;
63 return_label0
: while(false);
64 tracehead
= trace
.prev
;
67 val_t
stream___IStream___read_line(val_t self
) {
68 struct trace_t trace
= {NULL
, NULL
, 44, LOCATE_stream___IStream___read_line
};
71 trace
.prev
= tracehead
; tracehead
= &trace
;
72 trace
.file
= LOCATE_stream
;
73 variable0
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
74 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable0
)))) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___IStream___read_line
, LOCATE_stream
, 47); nit_exit(1);}
75 variable1
= NEW_String_string___String___init(); /*new String*/
76 variable0
= variable1
;
77 ((stream___IStream___append_line_to_t
)CALL( self
,COLOR_stream___IStream___append_line_to
))( self
, variable0
/*s*/) /*IStream::append_line_to*/;
78 variable0
= variable0
/*s*/;
80 return_label2
: while(false);
81 tracehead
= trace
.prev
;
84 val_t
stream___IStream___read_all(val_t self
) {
85 struct trace_t trace
= {NULL
, NULL
, 53, LOCATE_stream___IStream___read_all
};
89 trace
.prev
= tracehead
; tracehead
= &trace
;
90 trace
.file
= LOCATE_stream
;
91 variable1
= NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
92 variable0
= variable1
;
93 while (true) { /*while*/
94 variable1
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
95 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1
)))) break; /* while*/
96 variable2
= ((stream___IStream___read_char_t
)CALL( self
,COLOR_stream___IStream___read_char
))( self
) /*IStream::read_char*/;
97 variable1
= variable2
;
98 variable2
= TAG_Bool(UNTAG_Int( variable1
/*c*/)>=UNTAG_Int( TAG_Int(0)));
99 if (UNTAG_Bool(variable2
)) { /*if*/
100 variable2
= TAG_Char(UNTAG_Int( variable1
/*c*/));
101 ((string___String___add_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable0
/*s*/, variable2
) /*String::add*/;
103 continue_4
: while(0);
106 variable0
= variable0
/*s*/;
108 return_label3
: while(false);
109 tracehead
= trace
.prev
;
112 void stream___IStream___append_line_to(val_t self
, val_t param0
) {
113 struct trace_t trace
= {NULL
, NULL
, 64, LOCATE_stream___IStream___append_line_to
};
118 trace
.prev
= tracehead
; tracehead
= &trace
;
119 trace
.file
= LOCATE_stream
;
121 while (true) { /*while*/
122 if (!UNTAG_Bool( TAG_Bool(true))) break; /* while*/
123 variable2
= ((stream___IStream___read_char_t
)CALL( self
,COLOR_stream___IStream___read_char
))( self
) /*IStream::read_char*/;
124 variable1
= variable2
;
125 variable2
= TAG_Int(-UNTAG_Int( TAG_Int(1)));
126 variable2
= TAG_Bool(( variable1
/*x*/)==(variable2
));
127 if (UNTAG_Bool(variable2
)) { /*if*/
128 variable2
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
129 if (UNTAG_Bool(variable2
)) { /*if*/
133 variable3
= TAG_Char(UNTAG_Int( variable1
/*x*/));
134 variable2
= variable3
;
135 ((array___AbstractArray___push_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___IndexedCollection___push
))( variable0
/*s*/, variable2
/*c*/) /*AbstractArray::push*/;
136 variable3
= TAG_Bool(( variable2
/*c*/)==( TAG_Char('\n')));
137 if (UNTAG_Bool(variable3
)) { /*if*/
141 continue_6
: while(0);
144 return_label5
: while(false);
145 tracehead
= trace
.prev
;
148 val_t
stream___IStream___eof(val_t self
) {
149 struct trace_t trace
= {NULL
, NULL
, 79, LOCATE_stream___IStream___eof
};
150 trace
.prev
= tracehead
; tracehead
= &trace
;
151 trace
.file
= LOCATE_stream
;
152 fprintf(stderr
, "Deferred method %s called");
153 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___IStream___append_line_to
, LOCATE_stream
, 79);
155 tracehead
= trace
.prev
;
158 void stream___OStream___write(val_t self
, val_t param0
) {
159 struct trace_t trace
= {NULL
, NULL
, 86, LOCATE_stream___OStream___write
};
160 trace
.prev
= tracehead
; tracehead
= &trace
;
161 trace
.file
= LOCATE_stream
;
162 fprintf(stderr
, "Deferred method %s called");
163 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___IStream___append_line_to
, LOCATE_stream
, 86);
165 tracehead
= trace
.prev
;
168 val_t
stream___OStream___is_writable(val_t self
) {
169 struct trace_t trace
= {NULL
, NULL
, 89, LOCATE_stream___OStream___is_writable
};
170 trace
.prev
= tracehead
; tracehead
= &trace
;
171 trace
.file
= LOCATE_stream
;
172 fprintf(stderr
, "Deferred method %s called");
173 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___IStream___append_line_to
, LOCATE_stream
, 89);
175 tracehead
= trace
.prev
;
178 val_t
stream___BufferedIStream___read_char(val_t self
) {
179 struct trace_t trace
= {NULL
, NULL
, 96, LOCATE_stream___BufferedIStream___read_char
};
183 trace
.prev
= tracehead
; tracehead
= &trace
;
184 trace
.file
= LOCATE_stream
;
185 variable0
= ((stream___BufferedIStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*BufferedIStream::eof*/;
186 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable0
)))) { fprintf(stderr
, "Assert%s failed", ""); fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___BufferedIStream___read_char
, LOCATE_stream
, 98); nit_exit(1);}
187 variable0
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
188 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
189 variable1
= ((array___AbstractArray___length_t
)CALL(variable1
,COLOR_abstract_collection___Collection___length
))(variable1
) /*AbstractArray::length*/;
190 variable0
= TAG_Bool(UNTAG_Int(variable0
)>=UNTAG_Int(variable1
));
191 if (UNTAG_Bool(variable0
)) { /*if*/
192 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
194 variable0
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
195 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
196 variable1
= ((array___AbstractArray___length_t
)CALL(variable1
,COLOR_abstract_collection___Collection___length
))(variable1
) /*AbstractArray::length*/;
197 variable0
= TAG_Bool(UNTAG_Int(variable0
)>=UNTAG_Int(variable1
));
198 if (UNTAG_Bool(variable0
)) { /*if*/
199 variable0
= TAG_Int(-UNTAG_Int( TAG_Int(1)));
202 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
203 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
204 variable1
= ((string___String_____bra_t
)CALL(variable1
,COLOR_abstract_collection___Map_____bra
))(variable1
, variable2
) /*String::[]*/;
205 variable0
= variable1
;
206 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = TAG_Int(UNTAG_Int(ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/)+UNTAG_Int( TAG_Int(1)));
207 variable1
= TAG_Int((unsigned char)UNTAG_Char( variable0
/*c*/));
208 variable0
= variable1
;
210 return_label7
: while(false);
211 tracehead
= trace
.prev
;
214 val_t
stream___BufferedIStream___read(val_t self
, val_t param0
) {
215 struct trace_t trace
= {NULL
, NULL
, 110, LOCATE_stream___BufferedIStream___read
};
222 trace
.prev
= tracehead
; tracehead
= &trace
;
223 trace
.file
= LOCATE_stream
;
225 variable2
= NEW_String_string___String___with_capacity( variable0
/*i*/); /*new String*/
226 variable1
= variable2
;
227 variable3
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
228 variable2
= variable3
;
229 variable4
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
230 variable4
= ((array___AbstractArray___length_t
)CALL(variable4
,COLOR_abstract_collection___Collection___length
))(variable4
) /*AbstractArray::length*/;
231 variable3
= variable4
;
232 while (true) { /*while*/
233 variable4
= TAG_Bool(UNTAG_Int( variable0
/*i*/)>UNTAG_Int( TAG_Int(0)));
234 if (!UNTAG_Bool(variable4
)) break; /* while*/
235 variable4
= TAG_Bool(UNTAG_Int( variable2
/*j*/)>=UNTAG_Int( variable3
/*k*/));
236 if (UNTAG_Bool(variable4
)) { /*if*/
237 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
238 variable4
= ((stream___BufferedIStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*BufferedIStream::eof*/;
239 if (UNTAG_Bool(variable4
)) { /*if*/
240 variable1
= variable1
/*s*/;
243 variable4
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
244 variable2
= variable4
/*j=*/;
245 variable4
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
246 variable4
= ((array___AbstractArray___length_t
)CALL(variable4
,COLOR_abstract_collection___Collection___length
))(variable4
) /*AbstractArray::length*/;
247 variable3
= variable4
/*k=*/;
249 while (true) { /*while*/
250 variable4
= TAG_Bool(UNTAG_Int( variable2
/*j*/)<UNTAG_Int( variable3
/*k*/));
251 variable5
= variable4
;
252 if (UNTAG_Bool(variable5
)) { /* and */
253 variable5
= TAG_Bool(UNTAG_Int( variable0
/*i*/)>UNTAG_Int( TAG_Int(0)));
255 variable4
= variable5
;
256 if (!UNTAG_Bool(variable4
)) break; /* while*/
257 variable4
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
258 variable4
= ((string___String_____bra_t
)CALL(variable4
,COLOR_abstract_collection___Map_____bra
))(variable4
, variable2
/*j*/) /*String::[]*/;
259 ((string___String___add_t
)CALL( variable1
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable1
/*s*/, variable4
) /*String::add*/;
260 variable2
= TAG_Int(UNTAG_Int(variable2
)+UNTAG_Int( TAG_Int(1))) /*j*/;
261 variable0
= TAG_Int(UNTAG_Int(variable0
)-UNTAG_Int( TAG_Int(1))) /*i*/;
262 continue_10
: while(0);
265 continue_9
: while(0);
268 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable2
/*j*/;
269 variable1
= variable1
/*s*/;
271 return_label8
: while(false);
272 tracehead
= trace
.prev
;
275 val_t
stream___BufferedIStream___read_all(val_t self
) {
276 struct trace_t trace
= {NULL
, NULL
, 132, LOCATE_stream___BufferedIStream___read_all
};
281 trace
.prev
= tracehead
; tracehead
= &trace
;
282 trace
.file
= LOCATE_stream
;
283 variable1
= NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
284 variable0
= variable1
;
285 while (true) { /*while*/
286 variable1
= ((stream___BufferedIStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*BufferedIStream::eof*/;
287 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1
)))) break; /* while*/
288 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
289 variable1
= variable2
;
290 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
291 variable3
= ((array___AbstractArray___length_t
)CALL(variable3
,COLOR_abstract_collection___Collection___length
))(variable3
) /*AbstractArray::length*/;
292 variable2
= variable3
;
293 while (true) { /*while*/
294 variable3
= TAG_Bool(UNTAG_Int( variable1
/*j*/)<UNTAG_Int( variable2
/*k*/));
295 if (!UNTAG_Bool(variable3
)) break; /* while*/
296 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
297 variable3
= ((string___String_____bra_t
)CALL(variable3
,COLOR_abstract_collection___Map_____bra
))(variable3
, variable1
/*j*/) /*String::[]*/;
298 ((string___String___add_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable0
/*s*/, variable3
) /*String::add*/;
299 variable1
= TAG_Int(UNTAG_Int(variable1
)+UNTAG_Int( TAG_Int(1))) /*j*/;
300 continue_13
: while(0);
303 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable1
/*j*/;
304 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
305 continue_12
: while(0);
308 variable0
= variable0
/*s*/;
310 return_label11
: while(false);
311 tracehead
= trace
.prev
;
314 void stream___BufferedIStream___append_line_to(val_t self
, val_t param0
) {
315 struct trace_t trace
= {NULL
, NULL
, 148, LOCATE_stream___BufferedIStream___append_line_to
};
320 trace
.prev
= tracehead
; tracehead
= &trace
;
321 trace
.file
= LOCATE_stream
;
323 while (true) { /*while*/
324 if (!UNTAG_Bool( TAG_Bool(true))) break; /* while*/
325 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
326 variable1
= variable2
;
327 while (true) { /*while*/
328 variable2
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
329 variable2
= ((array___AbstractArray___length_t
)CALL(variable2
,COLOR_abstract_collection___Collection___length
))(variable2
) /*AbstractArray::length*/;
330 variable2
= TAG_Bool(UNTAG_Int( variable1
/*i*/)<UNTAG_Int(variable2
));
331 variable3
= variable2
;
332 if (UNTAG_Bool(variable3
)) { /* and */
333 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
334 variable3
= ((string___String_____bra_t
)CALL(variable3
,COLOR_abstract_collection___Map_____bra
))(variable3
, variable1
/*i*/) /*String::[]*/;
335 variable3
= TAG_Bool((variable3
)!=( TAG_Char('\n')));
337 variable2
= variable3
;
338 if (!UNTAG_Bool(variable2
)) break; /* while*/
339 variable1
= TAG_Int(UNTAG_Int(variable1
)+UNTAG_Int( TAG_Int(1))) /*i*/;
340 continue_16
: while(0);
343 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
344 variable2
= TAG_Bool(UNTAG_Int( variable1
/*i*/)>UNTAG_Int(variable2
));
345 if (UNTAG_Bool(variable2
)) { /*if*/
346 variable2
= ((array___AbstractArray___length_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___Collection___length
))( variable0
/*s*/) /*AbstractArray::length*/;
347 variable2
= TAG_Int(UNTAG_Int(variable2
)+UNTAG_Int( variable1
/*i*/));
348 variable3
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
349 variable2
= TAG_Int(UNTAG_Int(variable2
)-UNTAG_Int(variable3
));
350 ((string___String___enlarge_t
)CALL( variable0
/*s*/,COLOR_array___AbstractArray___enlarge
))( variable0
/*s*/, variable2
) /*String::enlarge*/;
351 variable3
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
352 variable2
= variable3
;
353 while (true) { /*while*/
354 variable3
= TAG_Bool(UNTAG_Int( variable2
/*j*/)<UNTAG_Int( variable1
/*i*/));
355 if (!UNTAG_Bool(variable3
)) break; /* while*/
356 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
357 variable3
= ((string___String_____bra_t
)CALL(variable3
,COLOR_abstract_collection___Map_____bra
))(variable3
, variable2
/*j*/) /*String::[]*/;
358 ((string___String___add_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable0
/*s*/, variable3
) /*String::add*/;
359 variable2
= TAG_Int(UNTAG_Int(variable2
)+UNTAG_Int( TAG_Int(1))) /*j*/;
360 continue_17
: while(0);
364 variable2
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
365 variable2
= ((array___AbstractArray___length_t
)CALL(variable2
,COLOR_abstract_collection___Collection___length
))(variable2
) /*AbstractArray::length*/;
366 variable2
= TAG_Bool(UNTAG_Int( variable1
/*i*/)<UNTAG_Int(variable2
));
367 if (UNTAG_Bool(variable2
)) { /*if*/
368 variable2
= TAG_Int(UNTAG_Int( variable1
/*i*/)+UNTAG_Int( TAG_Int(1)));
369 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable2
;
372 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable1
/*i*/;
373 variable2
= ((stream___BufferedIStream___end_reached_t
)CALL( self
,COLOR_stream___BufferedIStream___end_reached
))( self
) /*BufferedIStream::end_reached*/;
374 if (UNTAG_Bool(variable2
)) { /*if*/
377 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
380 continue_15
: while(0);
383 return_label14
: while(false);
384 tracehead
= trace
.prev
;
387 val_t
stream___BufferedIStream___eof(val_t self
) {
388 struct trace_t trace
= {NULL
, NULL
, 184, LOCATE_stream___BufferedIStream___eof
};
391 trace
.prev
= tracehead
; tracehead
= &trace
;
392 trace
.file
= LOCATE_stream
;
393 variable0
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
394 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
395 variable1
= ((array___AbstractArray___length_t
)CALL(variable1
,COLOR_abstract_collection___Collection___length
))(variable1
) /*AbstractArray::length*/;
396 variable0
= TAG_Bool(UNTAG_Int(variable0
)>=UNTAG_Int(variable1
));
397 variable1
= variable0
;
398 if (UNTAG_Bool(variable1
)) { /* and */
399 variable1
= ((stream___BufferedIStream___end_reached_t
)CALL( self
,COLOR_stream___BufferedIStream___end_reached
))( self
) /*BufferedIStream::end_reached*/;
401 variable0
= variable1
;
403 return_label18
: while(false);
404 tracehead
= trace
.prev
;
407 void stream___BufferedIStream___fill_buffer(val_t self
) {
408 struct trace_t trace
= {NULL
, NULL
, 192, LOCATE_stream___BufferedIStream___fill_buffer
};
409 trace
.prev
= tracehead
; tracehead
= &trace
;
410 trace
.file
= LOCATE_stream
;
411 fprintf(stderr
, "Deferred method %s called");
412 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___BufferedIStream___eof
, LOCATE_stream
, 192);
414 tracehead
= trace
.prev
;
417 val_t
stream___BufferedIStream___end_reached(val_t self
) {
418 struct trace_t trace
= {NULL
, NULL
, 195, LOCATE_stream___BufferedIStream___end_reached
};
419 trace
.prev
= tracehead
; tracehead
= &trace
;
420 trace
.file
= LOCATE_stream
;
421 fprintf(stderr
, "Deferred method %s called");
422 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___BufferedIStream___eof
, LOCATE_stream
, 195);
424 tracehead
= trace
.prev
;
427 void stream___BufferedIStream___prepare_buffer(val_t self
, val_t param0
) {
428 struct trace_t trace
= {NULL
, NULL
, 198, LOCATE_stream___BufferedIStream___prepare_buffer
};
431 trace
.prev
= tracehead
; tracehead
= &trace
;
432 trace
.file
= LOCATE_stream
;
434 variable1
= NEW_String_string___String___with_capacity( variable0
/*capacity*/); /*new String*/
435 ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/ = variable1
;
436 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = TAG_Int(0);
437 tracehead
= trace
.prev
;
440 void stream___FDStream___close(val_t self
) {
441 struct trace_t trace
= {NULL
, NULL
, 218, LOCATE_stream___FDStream___close
};
443 trace
.prev
= tracehead
; tracehead
= &trace
;
444 trace
.file
= LOCATE_stream
;
445 variable0
= ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/;
446 ((stream___FDStream___native_close_t
)CALL( self
,COLOR_stream___FDStream___native_close
))( self
, variable0
) /*FDStream::native_close*/;
447 tracehead
= trace
.prev
;
450 val_t
stream___FDStream___native_close(val_t self
, val_t param0
) {
451 struct trace_t trace
= {NULL
, NULL
, 220, LOCATE_stream___FDStream___native_close
};
452 trace
.prev
= tracehead
; tracehead
= &trace
;
453 trace
.file
= LOCATE_stream
;
454 tracehead
= trace
.prev
;
455 return TAG_Int(stream_FDStream_FDStream_native_close_1( self
, UNTAG_Int( param0
)));
457 val_t
stream___FDStream___native_read_char(val_t self
, val_t param0
) {
458 struct trace_t trace
= {NULL
, NULL
, 221, LOCATE_stream___FDStream___native_read_char
};
459 trace
.prev
= tracehead
; tracehead
= &trace
;
460 trace
.file
= LOCATE_stream
;
461 tracehead
= trace
.prev
;
462 return TAG_Int(stream_FDStream_FDStream_native_read_char_1( self
, UNTAG_Int( param0
)));
464 val_t
stream___FDStream___native_read(val_t self
, val_t param0
, val_t param1
, val_t param2
) {
465 struct trace_t trace
= {NULL
, NULL
, 222, LOCATE_stream___FDStream___native_read
};
466 trace
.prev
= tracehead
; tracehead
= &trace
;
467 trace
.file
= LOCATE_stream
;
468 tracehead
= trace
.prev
;
469 return TAG_Int(stream_FDStream_FDStream_native_read_3( self
, UNTAG_Int( param0
), UNBOX_NativeString( param1
), UNTAG_Int( param2
)));
471 val_t
stream___FDStream___native_write(val_t self
, val_t param0
, val_t param1
, val_t param2
) {
472 struct trace_t trace
= {NULL
, NULL
, 223, LOCATE_stream___FDStream___native_write
};
473 trace
.prev
= tracehead
; tracehead
= &trace
;
474 trace
.file
= LOCATE_stream
;
475 tracehead
= trace
.prev
;
476 return TAG_Int(stream_FDStream_FDStream_native_write_3( self
, UNTAG_Int( param0
), UNBOX_NativeString( param1
), UNTAG_Int( param2
)));
478 void stream___FDStream___init(val_t self
, val_t param0
, int* init_table
) {
479 struct trace_t trace
= {NULL
, NULL
, 225, LOCATE_stream___FDStream___init
};
481 trace
.prev
= tracehead
; tracehead
= &trace
;
482 trace
.file
= LOCATE_stream
;
484 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDStream
].i
]) return;
485 ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/ = variable0
/*fd*/;
486 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDStream
].i
] = 1;
487 tracehead
= trace
.prev
;
490 val_t
stream___FDIStream___eof(val_t self
) {
491 struct trace_t trace
= {NULL
, NULL
, 231, LOCATE_stream___FDIStream___eof
};
492 trace
.prev
= tracehead
; tracehead
= &trace
;
493 trace
.file
= LOCATE_stream
;
494 tracehead
= trace
.prev
;
495 return ATTR_stream___FDIStream____eof( self
) /*FDIStream::_eof*/;
497 val_t
stream___FDIStream___read_char(val_t self
) {
498 struct trace_t trace
= {NULL
, NULL
, 233, LOCATE_stream___FDIStream___read_char
};
501 trace
.prev
= tracehead
; tracehead
= &trace
;
502 trace
.file
= LOCATE_stream
;
503 variable1
= ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/;
504 variable1
= ((stream___FDStream___native_read_char_t
)CALL( self
,COLOR_stream___FDStream___native_read_char
))( self
, variable1
) /*FDStream::native_read_char*/;
505 variable0
= variable1
;
506 variable1
= TAG_Int(-UNTAG_Int( TAG_Int(1)));
507 variable1
= TAG_Bool(( variable0
/*nb*/)==(variable1
));
508 if (UNTAG_Bool(variable1
)) { /*if*/
509 ATTR_stream___FDIStream____eof( self
) /*FDIStream::_eof*/ = TAG_Bool(true);
511 variable0
= variable0
/*nb*/;
513 return_label22
: while(false);
514 tracehead
= trace
.prev
;
517 void stream___FDIStream___init(val_t self
, val_t param0
, int* init_table
) {
518 struct trace_t trace
= {NULL
, NULL
, 240, LOCATE_stream___FDIStream___init
};
520 trace
.prev
= tracehead
; tracehead
= &trace
;
521 trace
.file
= LOCATE_stream
;
523 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIStream
].i
]) return;
524 ((stream___FDStream___init_t
)CALL( self
,COLOR_stream___FDStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDStream::init*/;
525 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIStream
].i
] = 1;
526 tracehead
= trace
.prev
;
529 val_t
stream___FDOStream___is_writable(val_t self
) {
530 struct trace_t trace
= {NULL
, NULL
, 246, LOCATE_stream___FDOStream___is_writable
};
531 trace
.prev
= tracehead
; tracehead
= &trace
;
532 trace
.file
= LOCATE_stream
;
533 tracehead
= trace
.prev
;
534 return ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/;
536 void stream___FDOStream___write(val_t self
, val_t param0
) {
537 struct trace_t trace
= {NULL
, NULL
, 248, LOCATE_stream___FDOStream___write
};
543 trace
.prev
= tracehead
; tracehead
= &trace
;
544 trace
.file
= LOCATE_stream
;
546 variable2
= ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/;
547 variable3
= ((string___String___to_cstring_t
)CALL( variable0
/*s*/,COLOR_string___String___to_cstring
))( variable0
/*s*/) /*String::to_cstring*/;
548 variable4
= ((array___AbstractArray___length_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___Collection___length
))( variable0
/*s*/) /*AbstractArray::length*/;
549 variable2
= ((stream___FDStream___native_write_t
)CALL( self
,COLOR_stream___FDStream___native_write
))( self
, variable2
, variable3
, variable4
) /*FDStream::native_write*/;
550 variable1
= variable2
;
551 variable2
= ((array___AbstractArray___length_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___Collection___length
))( variable0
/*s*/) /*AbstractArray::length*/;
552 variable2
= TAG_Bool(UNTAG_Int( variable1
/*nb*/)<UNTAG_Int(variable2
));
553 if (UNTAG_Bool(variable2
)) { /*if*/
554 ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/ = TAG_Bool(false);
556 tracehead
= trace
.prev
;
559 void stream___FDOStream___init(val_t self
, val_t param0
, int* init_table
) {
560 struct trace_t trace
= {NULL
, NULL
, 254, LOCATE_stream___FDOStream___init
};
562 trace
.prev
= tracehead
; tracehead
= &trace
;
563 trace
.file
= LOCATE_stream
;
565 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDOStream
].i
]) return;
566 ((stream___FDStream___init_t
)CALL( self
,COLOR_stream___FDStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDStream::init*/;
567 ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/ = TAG_Bool(true);
568 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDOStream
].i
] = 1;
569 tracehead
= trace
.prev
;
572 void stream___FDIOStream___init(val_t self
, val_t param0
, int* init_table
) {
573 struct trace_t trace
= {NULL
, NULL
, 264, LOCATE_stream___FDIOStream___init
};
575 trace
.prev
= tracehead
; tracehead
= &trace
;
576 trace
.file
= LOCATE_stream
;
578 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIOStream
].i
]) return;
579 ((stream___FDIStream___init_t
)CALL( self
,COLOR_stream___FDIStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDIStream::init*/;
580 ((stream___FDOStream___init_t
)CALL( self
,COLOR_stream___FDOStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDOStream::init*/;
581 ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/ = variable0
/*fd*/;
582 ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/ = TAG_Bool(true);
583 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIOStream
].i
] = 1;
584 tracehead
= trace
.prev
;