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
, LOCATE_stream
, 20, LOCATE_stream___IOS___close
};
5 trace
.prev
= tracehead
; tracehead
= &trace
;
6 fprintf(stderr
, "Deferred method %s called");
7 fprintf(stderr
, " (%s:%d)\n", LOCATE_stream
, 20);
9 tracehead
= trace
.prev
;
12 val_t
stream___IStream___read_char(val_t self
) {
13 struct trace_t trace
= {NULL
, LOCATE_stream
, 27, LOCATE_stream___IStream___read_char
};
14 trace
.prev
= tracehead
; tracehead
= &trace
;
15 fprintf(stderr
, "Deferred method %s called");
16 fprintf(stderr
, " (%s:%d)\n", LOCATE_stream
, 27);
18 tracehead
= trace
.prev
;
21 val_t
stream___IStream___read(val_t self
, val_t param0
) {
22 struct trace_t trace
= {NULL
, LOCATE_stream
, 30, LOCATE_stream___IStream___read
};
27 trace
.prev
= tracehead
; tracehead
= &trace
;
29 variable2
= NEW_string___String___with_capacity( variable0
/*i*/); /*new String*/
30 variable1
= variable2
;
31 while (true) { /*while*/
32 variable2
= TAG_Bool(UNTAG_Int( variable0
/*i*/)>UNTAG_Int( TAG_Int(0)));
33 variable3
= variable2
;
34 if (UNTAG_Bool(variable3
)) { /* and */
35 variable3
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
36 variable3
= TAG_Bool(!UNTAG_Bool(variable3
));
38 variable2
= variable3
;
39 if (!UNTAG_Bool(variable2
)) break; /* while*/
40 variable3
= ((stream___IStream___read_char_t
)CALL( self
,COLOR_stream___IStream___read_char
))( self
) /*IStream::read_char*/;
41 variable2
= variable3
;
42 variable3
= TAG_Bool(UNTAG_Int( variable2
/*c*/)>=UNTAG_Int( TAG_Int(0)));
43 if (UNTAG_Bool(variable3
)) { /*if*/
44 variable3
= TAG_Char(UNTAG_Int( variable2
/*c*/));
45 ((string___String___add_t
)CALL( variable1
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable1
/*s*/, variable3
) /*String::add*/;
46 variable0
= TAG_Int(UNTAG_Int(variable0
)-UNTAG_Int( TAG_Int(1))) /*i*/;
51 variable1
= variable1
/*s*/;
53 return_label0
: while(false);
54 tracehead
= trace
.prev
;
57 val_t
stream___IStream___read_line(val_t self
) {
58 struct trace_t trace
= {NULL
, LOCATE_stream
, 44, LOCATE_stream___IStream___read_line
};
61 trace
.prev
= tracehead
; tracehead
= &trace
;
62 variable0
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
63 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);}
64 variable1
= NEW_string___String___init(); /*new String*/
65 variable0
= variable1
;
66 ((stream___IStream___append_line_to_t
)CALL( self
,COLOR_stream___IStream___append_line_to
))( self
, variable0
/*s*/) /*IStream::append_line_to*/;
67 variable0
= variable0
/*s*/;
69 return_label2
: while(false);
70 tracehead
= trace
.prev
;
73 val_t
stream___IStream___read_all(val_t self
) {
74 struct trace_t trace
= {NULL
, LOCATE_stream
, 53, LOCATE_stream___IStream___read_all
};
78 trace
.prev
= tracehead
; tracehead
= &trace
;
79 variable1
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
80 variable0
= variable1
;
81 while (true) { /*while*/
82 variable1
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
83 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1
)))) break; /* while*/
84 variable2
= ((stream___IStream___read_char_t
)CALL( self
,COLOR_stream___IStream___read_char
))( self
) /*IStream::read_char*/;
85 variable1
= variable2
;
86 variable2
= TAG_Bool(UNTAG_Int( variable1
/*c*/)>=UNTAG_Int( TAG_Int(0)));
87 if (UNTAG_Bool(variable2
)) { /*if*/
88 variable2
= TAG_Char(UNTAG_Int( variable1
/*c*/));
89 ((string___String___add_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable0
/*s*/, variable2
) /*String::add*/;
94 variable0
= variable0
/*s*/;
96 return_label3
: while(false);
97 tracehead
= trace
.prev
;
100 void stream___IStream___append_line_to(val_t self
, val_t param0
) {
101 struct trace_t trace
= {NULL
, LOCATE_stream
, 64, LOCATE_stream___IStream___append_line_to
};
106 trace
.prev
= tracehead
; tracehead
= &trace
;
108 while (true) { /*while*/
109 if (!UNTAG_Bool( TAG_Bool(true))) break; /* while*/
110 variable2
= ((stream___IStream___read_char_t
)CALL( self
,COLOR_stream___IStream___read_char
))( self
) /*IStream::read_char*/;
111 variable1
= variable2
;
112 variable2
= TAG_Int(-UNTAG_Int( TAG_Int(1)));
113 variable2
= TAG_Bool(( variable1
/*x*/)==(variable2
));
114 if (UNTAG_Bool(variable2
)) { /*if*/
115 variable2
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
116 if (UNTAG_Bool(variable2
)) { /*if*/
120 variable3
= TAG_Char(UNTAG_Int( variable1
/*x*/));
121 variable2
= variable3
;
122 ((array___AbstractArray___push_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___IndexedCollection___push
))( variable0
/*s*/, variable2
/*c*/) /*AbstractArray::push*/;
123 variable3
= TAG_Bool(( variable2
/*c*/)==( TAG_Char('\n')));
124 if (UNTAG_Bool(variable3
)) { /*if*/
128 continue_6
: while(0);
131 return_label5
: while(false);
132 tracehead
= trace
.prev
;
135 val_t
stream___IStream___eof(val_t self
) {
136 struct trace_t trace
= {NULL
, LOCATE_stream
, 79, LOCATE_stream___IStream___eof
};
137 trace
.prev
= tracehead
; tracehead
= &trace
;
138 fprintf(stderr
, "Deferred method %s called");
139 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___IStream___append_line_to
, LOCATE_stream
, 79);
141 tracehead
= trace
.prev
;
144 void stream___OStream___write(val_t self
, val_t param0
) {
145 struct trace_t trace
= {NULL
, LOCATE_stream
, 86, LOCATE_stream___OStream___write
};
146 trace
.prev
= tracehead
; tracehead
= &trace
;
147 fprintf(stderr
, "Deferred method %s called");
148 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___IStream___append_line_to
, LOCATE_stream
, 86);
150 tracehead
= trace
.prev
;
153 val_t
stream___OStream___is_writable(val_t self
) {
154 struct trace_t trace
= {NULL
, LOCATE_stream
, 89, LOCATE_stream___OStream___is_writable
};
155 trace
.prev
= tracehead
; tracehead
= &trace
;
156 fprintf(stderr
, "Deferred method %s called");
157 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___IStream___append_line_to
, LOCATE_stream
, 89);
159 tracehead
= trace
.prev
;
162 val_t
stream___BufferedIStream___read_char(val_t self
) {
163 struct trace_t trace
= {NULL
, LOCATE_stream
, 96, LOCATE_stream___BufferedIStream___read_char
};
167 trace
.prev
= tracehead
; tracehead
= &trace
;
168 variable0
= ((stream___BufferedIStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*BufferedIStream::eof*/;
169 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);}
170 variable0
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
171 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
172 variable1
= ((array___AbstractArray___length_t
)CALL(variable1
,COLOR_abstract_collection___Collection___length
))(variable1
) /*AbstractArray::length*/;
173 variable0
= TAG_Bool(UNTAG_Int(variable0
)>=UNTAG_Int(variable1
));
174 if (UNTAG_Bool(variable0
)) { /*if*/
175 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
177 variable0
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
178 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
179 variable1
= ((array___AbstractArray___length_t
)CALL(variable1
,COLOR_abstract_collection___Collection___length
))(variable1
) /*AbstractArray::length*/;
180 variable0
= TAG_Bool(UNTAG_Int(variable0
)>=UNTAG_Int(variable1
));
181 if (UNTAG_Bool(variable0
)) { /*if*/
182 variable0
= TAG_Int(-UNTAG_Int( TAG_Int(1)));
185 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
186 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
187 variable1
= ((string___String_____bra_t
)CALL(variable1
,COLOR_abstract_collection___Map_____bra
))(variable1
, variable2
) /*String::[]*/;
188 variable0
= variable1
;
189 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)));
190 variable1
= TAG_Int((unsigned char)UNTAG_Char( variable0
/*c*/));
191 variable0
= variable1
;
193 return_label7
: while(false);
194 tracehead
= trace
.prev
;
197 val_t
stream___BufferedIStream___read(val_t self
, val_t param0
) {
198 struct trace_t trace
= {NULL
, LOCATE_stream
, 110, LOCATE_stream___BufferedIStream___read
};
205 trace
.prev
= tracehead
; tracehead
= &trace
;
207 variable2
= NEW_string___String___with_capacity( variable0
/*i*/); /*new String*/
208 variable1
= variable2
;
209 variable3
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
210 variable2
= variable3
;
211 variable4
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
212 variable4
= ((array___AbstractArray___length_t
)CALL(variable4
,COLOR_abstract_collection___Collection___length
))(variable4
) /*AbstractArray::length*/;
213 variable3
= variable4
;
214 while (true) { /*while*/
215 variable4
= TAG_Bool(UNTAG_Int( variable0
/*i*/)>UNTAG_Int( TAG_Int(0)));
216 if (!UNTAG_Bool(variable4
)) break; /* while*/
217 variable4
= TAG_Bool(UNTAG_Int( variable2
/*j*/)>=UNTAG_Int( variable3
/*k*/));
218 if (UNTAG_Bool(variable4
)) { /*if*/
219 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
220 variable4
= ((stream___BufferedIStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*BufferedIStream::eof*/;
221 if (UNTAG_Bool(variable4
)) { /*if*/
222 variable1
= variable1
/*s*/;
225 variable4
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
226 variable2
= variable4
/*j=*/;
227 variable4
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
228 variable4
= ((array___AbstractArray___length_t
)CALL(variable4
,COLOR_abstract_collection___Collection___length
))(variable4
) /*AbstractArray::length*/;
229 variable3
= variable4
/*k=*/;
231 while (true) { /*while*/
232 variable4
= TAG_Bool(UNTAG_Int( variable2
/*j*/)<UNTAG_Int( variable3
/*k*/));
233 variable5
= variable4
;
234 if (UNTAG_Bool(variable5
)) { /* and */
235 variable5
= TAG_Bool(UNTAG_Int( variable0
/*i*/)>UNTAG_Int( TAG_Int(0)));
237 variable4
= variable5
;
238 if (!UNTAG_Bool(variable4
)) break; /* while*/
239 variable4
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
240 variable4
= ((string___String_____bra_t
)CALL(variable4
,COLOR_abstract_collection___Map_____bra
))(variable4
, variable2
/*j*/) /*String::[]*/;
241 ((string___String___add_t
)CALL( variable1
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable1
/*s*/, variable4
) /*String::add*/;
242 variable2
= TAG_Int(UNTAG_Int(variable2
)+UNTAG_Int( TAG_Int(1))) /*j*/;
243 variable0
= TAG_Int(UNTAG_Int(variable0
)-UNTAG_Int( TAG_Int(1))) /*i*/;
244 continue_10
: while(0);
247 continue_9
: while(0);
250 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable2
/*j*/;
251 variable1
= variable1
/*s*/;
253 return_label8
: while(false);
254 tracehead
= trace
.prev
;
257 val_t
stream___BufferedIStream___read_all(val_t self
) {
258 struct trace_t trace
= {NULL
, LOCATE_stream
, 132, LOCATE_stream___BufferedIStream___read_all
};
263 trace
.prev
= tracehead
; tracehead
= &trace
;
264 variable1
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
265 variable0
= variable1
;
266 while (true) { /*while*/
267 variable1
= ((stream___BufferedIStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*BufferedIStream::eof*/;
268 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1
)))) break; /* while*/
269 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
270 variable1
= variable2
;
271 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
272 variable3
= ((array___AbstractArray___length_t
)CALL(variable3
,COLOR_abstract_collection___Collection___length
))(variable3
) /*AbstractArray::length*/;
273 variable2
= variable3
;
274 while (true) { /*while*/
275 variable3
= TAG_Bool(UNTAG_Int( variable1
/*j*/)<UNTAG_Int( variable2
/*k*/));
276 if (!UNTAG_Bool(variable3
)) break; /* while*/
277 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
278 variable3
= ((string___String_____bra_t
)CALL(variable3
,COLOR_abstract_collection___Map_____bra
))(variable3
, variable1
/*j*/) /*String::[]*/;
279 ((string___String___add_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable0
/*s*/, variable3
) /*String::add*/;
280 variable1
= TAG_Int(UNTAG_Int(variable1
)+UNTAG_Int( TAG_Int(1))) /*j*/;
281 continue_13
: while(0);
284 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable1
/*j*/;
285 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
286 continue_12
: while(0);
289 variable0
= variable0
/*s*/;
291 return_label11
: while(false);
292 tracehead
= trace
.prev
;
295 void stream___BufferedIStream___append_line_to(val_t self
, val_t param0
) {
296 struct trace_t trace
= {NULL
, LOCATE_stream
, 148, LOCATE_stream___BufferedIStream___append_line_to
};
301 trace
.prev
= tracehead
; tracehead
= &trace
;
303 while (true) { /*while*/
304 if (!UNTAG_Bool( TAG_Bool(true))) break; /* while*/
305 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
306 variable1
= variable2
;
307 while (true) { /*while*/
308 variable2
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
309 variable2
= ((array___AbstractArray___length_t
)CALL(variable2
,COLOR_abstract_collection___Collection___length
))(variable2
) /*AbstractArray::length*/;
310 variable2
= TAG_Bool(UNTAG_Int( variable1
/*i*/)<UNTAG_Int(variable2
));
311 variable3
= variable2
;
312 if (UNTAG_Bool(variable3
)) { /* and */
313 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
314 variable3
= ((string___String_____bra_t
)CALL(variable3
,COLOR_abstract_collection___Map_____bra
))(variable3
, variable1
/*i*/) /*String::[]*/;
315 variable3
= TAG_Bool((variable3
)!=( TAG_Char('\n')));
317 variable2
= variable3
;
318 if (!UNTAG_Bool(variable2
)) break; /* while*/
319 variable1
= TAG_Int(UNTAG_Int(variable1
)+UNTAG_Int( TAG_Int(1))) /*i*/;
320 continue_16
: while(0);
323 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
324 variable2
= TAG_Bool(UNTAG_Int( variable1
/*i*/)>UNTAG_Int(variable2
));
325 if (UNTAG_Bool(variable2
)) { /*if*/
326 variable2
= ((array___AbstractArray___length_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___Collection___length
))( variable0
/*s*/) /*AbstractArray::length*/;
327 variable2
= TAG_Int(UNTAG_Int(variable2
)+UNTAG_Int( variable1
/*i*/));
328 variable3
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
329 variable2
= TAG_Int(UNTAG_Int(variable2
)-UNTAG_Int(variable3
));
330 ((string___String___enlarge_t
)CALL( variable0
/*s*/,COLOR_array___AbstractArray___enlarge
))( variable0
/*s*/, variable2
) /*String::enlarge*/;
331 variable3
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
332 variable2
= variable3
;
333 while (true) { /*while*/
334 variable3
= TAG_Bool(UNTAG_Int( variable2
/*j*/)<UNTAG_Int( variable1
/*i*/));
335 if (!UNTAG_Bool(variable3
)) break; /* while*/
336 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
337 variable3
= ((string___String_____bra_t
)CALL(variable3
,COLOR_abstract_collection___Map_____bra
))(variable3
, variable2
/*j*/) /*String::[]*/;
338 ((string___String___add_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable0
/*s*/, variable3
) /*String::add*/;
339 variable2
= TAG_Int(UNTAG_Int(variable2
)+UNTAG_Int( TAG_Int(1))) /*j*/;
340 continue_17
: while(0);
344 variable2
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
345 variable2
= ((array___AbstractArray___length_t
)CALL(variable2
,COLOR_abstract_collection___Collection___length
))(variable2
) /*AbstractArray::length*/;
346 variable2
= TAG_Bool(UNTAG_Int( variable1
/*i*/)<UNTAG_Int(variable2
));
347 if (UNTAG_Bool(variable2
)) { /*if*/
348 variable2
= TAG_Int(UNTAG_Int( variable1
/*i*/)+UNTAG_Int( TAG_Int(1)));
349 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable2
;
352 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable1
/*i*/;
353 variable2
= ((stream___BufferedIStream___end_reached_t
)CALL( self
,COLOR_stream___BufferedIStream___end_reached
))( self
) /*BufferedIStream::end_reached*/;
354 if (UNTAG_Bool(variable2
)) { /*if*/
357 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
360 continue_15
: while(0);
363 return_label14
: while(false);
364 tracehead
= trace
.prev
;
367 val_t
stream___BufferedIStream___eof(val_t self
) {
368 struct trace_t trace
= {NULL
, LOCATE_stream
, 184, LOCATE_stream___BufferedIStream___eof
};
371 trace
.prev
= tracehead
; tracehead
= &trace
;
372 variable0
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
373 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
374 variable1
= ((array___AbstractArray___length_t
)CALL(variable1
,COLOR_abstract_collection___Collection___length
))(variable1
) /*AbstractArray::length*/;
375 variable0
= TAG_Bool(UNTAG_Int(variable0
)>=UNTAG_Int(variable1
));
376 variable1
= variable0
;
377 if (UNTAG_Bool(variable1
)) { /* and */
378 variable1
= ((stream___BufferedIStream___end_reached_t
)CALL( self
,COLOR_stream___BufferedIStream___end_reached
))( self
) /*BufferedIStream::end_reached*/;
380 variable0
= variable1
;
382 return_label18
: while(false);
383 tracehead
= trace
.prev
;
386 void stream___BufferedIStream___fill_buffer(val_t self
) {
387 struct trace_t trace
= {NULL
, LOCATE_stream
, 192, LOCATE_stream___BufferedIStream___fill_buffer
};
388 trace
.prev
= tracehead
; tracehead
= &trace
;
389 fprintf(stderr
, "Deferred method %s called");
390 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___BufferedIStream___eof
, LOCATE_stream
, 192);
392 tracehead
= trace
.prev
;
395 val_t
stream___BufferedIStream___end_reached(val_t self
) {
396 struct trace_t trace
= {NULL
, LOCATE_stream
, 195, LOCATE_stream___BufferedIStream___end_reached
};
397 trace
.prev
= tracehead
; tracehead
= &trace
;
398 fprintf(stderr
, "Deferred method %s called");
399 fprintf(stderr
, " in %s (%s:%d)\n", LOCATE_stream___BufferedIStream___eof
, LOCATE_stream
, 195);
401 tracehead
= trace
.prev
;
404 void stream___BufferedIStream___prepare_buffer(val_t self
, val_t param0
) {
405 struct trace_t trace
= {NULL
, LOCATE_stream
, 198, LOCATE_stream___BufferedIStream___prepare_buffer
};
408 trace
.prev
= tracehead
; tracehead
= &trace
;
410 variable1
= NEW_string___String___with_capacity( variable0
/*capacity*/); /*new String*/
411 ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/ = variable1
;
412 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = TAG_Int(0);
413 tracehead
= trace
.prev
;
416 void stream___FDStream___close(val_t self
) {
417 struct trace_t trace
= {NULL
, LOCATE_stream
, 218, LOCATE_stream___FDStream___close
};
419 trace
.prev
= tracehead
; tracehead
= &trace
;
420 variable0
= ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/;
421 ((stream___FDStream___native_close_t
)CALL( self
,COLOR_stream___FDStream___native_close
))( self
, variable0
) /*FDStream::native_close*/;
422 tracehead
= trace
.prev
;
425 val_t
stream___FDStream___native_close(val_t self
, val_t param0
) {
426 struct trace_t trace
= {NULL
, LOCATE_stream
, 220, LOCATE_stream___FDStream___native_close
};
427 trace
.prev
= tracehead
; tracehead
= &trace
;
428 tracehead
= trace
.prev
;
429 return TAG_Int(stream_FDStream_FDStream_native_close_1( self
, UNTAG_Int( param0
)));
431 val_t
stream___FDStream___native_read_char(val_t self
, val_t param0
) {
432 struct trace_t trace
= {NULL
, LOCATE_stream
, 221, LOCATE_stream___FDStream___native_read_char
};
433 trace
.prev
= tracehead
; tracehead
= &trace
;
434 tracehead
= trace
.prev
;
435 return TAG_Int(stream_FDStream_FDStream_native_read_char_1( self
, UNTAG_Int( param0
)));
437 val_t
stream___FDStream___native_read(val_t self
, val_t param0
, val_t param1
, val_t param2
) {
438 struct trace_t trace
= {NULL
, LOCATE_stream
, 222, LOCATE_stream___FDStream___native_read
};
439 trace
.prev
= tracehead
; tracehead
= &trace
;
440 tracehead
= trace
.prev
;
441 return TAG_Int(stream_FDStream_FDStream_native_read_3( self
, UNTAG_Int( param0
), UNBOX_NativeString( param1
), UNTAG_Int( param2
)));
443 val_t
stream___FDStream___native_write(val_t self
, val_t param0
, val_t param1
, val_t param2
) {
444 struct trace_t trace
= {NULL
, LOCATE_stream
, 223, LOCATE_stream___FDStream___native_write
};
445 trace
.prev
= tracehead
; tracehead
= &trace
;
446 tracehead
= trace
.prev
;
447 return TAG_Int(stream_FDStream_FDStream_native_write_3( self
, UNTAG_Int( param0
), UNBOX_NativeString( param1
), UNTAG_Int( param2
)));
449 void stream___FDStream___init(val_t self
, val_t param0
, int* init_table
) {
450 struct trace_t trace
= {NULL
, LOCATE_stream
, 225, LOCATE_stream___FDStream___init
};
452 trace
.prev
= tracehead
; tracehead
= &trace
;
454 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDStream
].i
]) return;
455 ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/ = variable0
/*fd*/;
456 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDStream
].i
] = 1;
457 tracehead
= trace
.prev
;
460 val_t
stream___FDIStream___eof(val_t self
) {
461 struct trace_t trace
= {NULL
, LOCATE_stream
, 231, LOCATE_stream___FDIStream___eof
};
462 trace
.prev
= tracehead
; tracehead
= &trace
;
463 tracehead
= trace
.prev
;
464 return ATTR_stream___FDIStream____eof( self
) /*FDIStream::_eof*/;
466 val_t
stream___FDIStream___read_char(val_t self
) {
467 struct trace_t trace
= {NULL
, LOCATE_stream
, 233, LOCATE_stream___FDIStream___read_char
};
470 trace
.prev
= tracehead
; tracehead
= &trace
;
471 variable1
= ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/;
472 variable1
= ((stream___FDStream___native_read_char_t
)CALL( self
,COLOR_stream___FDStream___native_read_char
))( self
, variable1
) /*FDStream::native_read_char*/;
473 variable0
= variable1
;
474 variable1
= TAG_Int(-UNTAG_Int( TAG_Int(1)));
475 variable1
= TAG_Bool(( variable0
/*nb*/)==(variable1
));
476 if (UNTAG_Bool(variable1
)) { /*if*/
477 ATTR_stream___FDIStream____eof( self
) /*FDIStream::_eof*/ = TAG_Bool(true);
479 variable0
= variable0
/*nb*/;
481 return_label22
: while(false);
482 tracehead
= trace
.prev
;
485 void stream___FDIStream___init(val_t self
, val_t param0
, int* init_table
) {
486 struct trace_t trace
= {NULL
, LOCATE_stream
, 240, LOCATE_stream___FDIStream___init
};
488 trace
.prev
= tracehead
; tracehead
= &trace
;
490 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIStream
].i
]) return;
491 ((stream___FDStream___init_t
)CALL( self
,COLOR_stream___FDStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDStream::init*/;
492 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIStream
].i
] = 1;
493 tracehead
= trace
.prev
;
496 val_t
stream___FDOStream___is_writable(val_t self
) {
497 struct trace_t trace
= {NULL
, LOCATE_stream
, 246, LOCATE_stream___FDOStream___is_writable
};
498 trace
.prev
= tracehead
; tracehead
= &trace
;
499 tracehead
= trace
.prev
;
500 return ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/;
502 void stream___FDOStream___write(val_t self
, val_t param0
) {
503 struct trace_t trace
= {NULL
, LOCATE_stream
, 248, LOCATE_stream___FDOStream___write
};
509 trace
.prev
= tracehead
; tracehead
= &trace
;
511 variable2
= ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/;
512 variable3
= ((string___String___to_cstring_t
)CALL( variable0
/*s*/,COLOR_string___String___to_cstring
))( variable0
/*s*/) /*String::to_cstring*/;
513 variable4
= ((array___AbstractArray___length_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___Collection___length
))( variable0
/*s*/) /*AbstractArray::length*/;
514 variable2
= ((stream___FDStream___native_write_t
)CALL( self
,COLOR_stream___FDStream___native_write
))( self
, variable2
, variable3
, variable4
) /*FDStream::native_write*/;
515 variable1
= variable2
;
516 variable2
= ((array___AbstractArray___length_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___Collection___length
))( variable0
/*s*/) /*AbstractArray::length*/;
517 variable2
= TAG_Bool(UNTAG_Int( variable1
/*nb*/)<UNTAG_Int(variable2
));
518 if (UNTAG_Bool(variable2
)) { /*if*/
519 ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/ = TAG_Bool(false);
521 tracehead
= trace
.prev
;
524 void stream___FDOStream___init(val_t self
, val_t param0
, int* init_table
) {
525 struct trace_t trace
= {NULL
, LOCATE_stream
, 254, LOCATE_stream___FDOStream___init
};
527 trace
.prev
= tracehead
; tracehead
= &trace
;
529 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDOStream
].i
]) return;
530 ((stream___FDStream___init_t
)CALL( self
,COLOR_stream___FDStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDStream::init*/;
531 ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/ = TAG_Bool(true);
532 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDOStream
].i
] = 1;
533 tracehead
= trace
.prev
;
536 void stream___FDIOStream___init(val_t self
, val_t param0
, int* init_table
) {
537 struct trace_t trace
= {NULL
, LOCATE_stream
, 265, LOCATE_stream___FDIOStream___init
};
539 trace
.prev
= tracehead
; tracehead
= &trace
;
541 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIOStream
].i
]) return;
542 ((stream___FDIStream___init_t
)CALL( self
,COLOR_stream___FDIStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDIStream::init*/;
543 ((stream___FDOStream___init_t
)CALL( self
,COLOR_stream___FDOStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDOStream::init*/;
544 ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/ = variable0
/*fd*/;
545 ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/ = TAG_Bool(true);
546 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIOStream
].i
] = 1;
547 tracehead
= trace
.prev
;