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
, "stream::IOS::close (bin/../lib/standard//stream.nit:20,2--21:11)"};
5 trace
.prev
= tracehead
; tracehead
= &trace
;
6 fprintf(stderr
, "Deferred method close called (bin/../lib/standard//stream.nit:20,2)\n");
8 tracehead
= trace
.prev
;
11 val_t
stream___IStream___read_char(val_t self
) {
12 struct trace_t trace
= {NULL
, "stream::IStream::read_char (bin/../lib/standard//stream.nit:27,2--28:20)"};
13 trace
.prev
= tracehead
; tracehead
= &trace
;
14 fprintf(stderr
, "Deferred method read_char called (bin/../lib/standard//stream.nit:27,2)\n");
16 tracehead
= trace
.prev
;
19 val_t
stream___IStream___read(val_t self
, val_t param0
) {
20 struct trace_t trace
= {NULL
, "stream::IStream::read (bin/../lib/standard//stream.nit:30,2--41:10)"};
25 trace
.prev
= tracehead
; tracehead
= &trace
;
27 variable2
= NEW_string___String___with_capacity( variable0
/*i*/); /*new String*/
28 variable1
= variable2
;
29 while (true) { /*while*/
30 variable2
= TAG_Bool(UNTAG_Int( variable0
/*i*/)>UNTAG_Int( TAG_Int(0)));
31 variable3
= variable2
;
32 if (UNTAG_Bool(variable3
)) { /* and */
33 variable3
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
34 variable3
= TAG_Bool(!UNTAG_Bool(variable3
));
36 variable2
= variable3
;
37 if (!UNTAG_Bool(variable2
)) break; /* while*/
38 variable3
= ((stream___IStream___read_char_t
)CALL( self
,COLOR_stream___IStream___read_char
))( self
) /*IStream::read_char*/;
39 variable2
= variable3
;
40 variable3
= TAG_Bool(UNTAG_Int( variable2
/*c*/)>=UNTAG_Int( TAG_Int(0)));
41 if (UNTAG_Bool(variable3
)) { /*if*/
42 variable3
= TAG_Char(UNTAG_Int( variable2
/*c*/));
43 ((string___String___add_t
)CALL( variable1
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable1
/*s*/, variable3
) /*String::add*/;
44 variable0
= TAG_Int(UNTAG_Int(variable0
)-UNTAG_Int( TAG_Int(1))) /*i*/;
49 variable1
= variable1
/*s*/;
51 return_label0
: while(false);
52 tracehead
= trace
.prev
;
55 val_t
stream___IStream___read_line(val_t self
) {
56 struct trace_t trace
= {NULL
, "stream::IStream::read_line (bin/../lib/standard//stream.nit:44,2--50:10)"};
59 trace
.prev
= tracehead
; tracehead
= &trace
;
60 variable0
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
61 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable0
)))) { fprintf(stderr
, "Assert failed: bin/../lib/standard//stream.nit:47,3--16\n"); nit_exit(1);}
62 variable1
= NEW_string___String___init(); /*new String*/
63 variable0
= variable1
;
64 ((stream___IStream___append_line_to_t
)CALL( self
,COLOR_stream___IStream___append_line_to
))( self
, variable0
/*s*/) /*IStream::append_line_to*/;
65 variable0
= variable0
/*s*/;
67 return_label2
: while(false);
68 tracehead
= trace
.prev
;
71 val_t
stream___IStream___read_all(val_t self
) {
72 struct trace_t trace
= {NULL
, "stream::IStream::read_all (bin/../lib/standard//stream.nit:53,2--61:10)"};
76 trace
.prev
= tracehead
; tracehead
= &trace
;
77 variable1
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
78 variable0
= variable1
;
79 while (true) { /*while*/
80 variable1
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
81 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1
)))) break; /* while*/
82 variable2
= ((stream___IStream___read_char_t
)CALL( self
,COLOR_stream___IStream___read_char
))( self
) /*IStream::read_char*/;
83 variable1
= variable2
;
84 variable2
= TAG_Bool(UNTAG_Int( variable1
/*c*/)>=UNTAG_Int( TAG_Int(0)));
85 if (UNTAG_Bool(variable2
)) { /*if*/
86 variable2
= TAG_Char(UNTAG_Int( variable1
/*c*/));
87 ((string___String___add_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable0
/*s*/, variable2
) /*String::add*/;
92 variable0
= variable0
/*s*/;
94 return_label3
: while(false);
95 tracehead
= trace
.prev
;
98 void stream___IStream___append_line_to(val_t self
, val_t param0
) {
99 struct trace_t trace
= {NULL
, "stream::IStream::append_line_to (bin/../lib/standard//stream.nit:64,2--74:28)"};
104 trace
.prev
= tracehead
; tracehead
= &trace
;
106 while (true) { /*while*/
107 if (!UNTAG_Bool( TAG_Bool(true))) break; /* while*/
108 variable2
= ((stream___IStream___read_char_t
)CALL( self
,COLOR_stream___IStream___read_char
))( self
) /*IStream::read_char*/;
109 variable1
= variable2
;
110 variable2
= TAG_Int(-UNTAG_Int( TAG_Int(1)));
111 variable2
= TAG_Bool(( variable1
/*x*/)==(variable2
));
112 if (UNTAG_Bool(variable2
)) { /*if*/
113 variable2
= ((stream___IStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*IStream::eof*/;
114 if (UNTAG_Bool(variable2
)) { /*if*/
118 variable3
= TAG_Char(UNTAG_Int( variable1
/*x*/));
119 variable2
= variable3
;
120 ((array___AbstractArray___push_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___IndexedCollection___push
))( variable0
/*s*/, variable2
/*c*/) /*String::push*/;
121 variable3
= TAG_Bool(( variable2
/*c*/)==( TAG_Char('\n')));
122 if (UNTAG_Bool(variable3
)) { /*if*/
126 continue_6
: while(0);
129 return_label5
: while(false);
130 tracehead
= trace
.prev
;
133 val_t
stream___IStream___eof(val_t self
) {
134 struct trace_t trace
= {NULL
, "stream::IStream::eof (bin/../lib/standard//stream.nit:79,2--80:15)"};
135 trace
.prev
= tracehead
; tracehead
= &trace
;
136 fprintf(stderr
, "Deferred method eof called (bin/../lib/standard//stream.nit:79,2)\n");
138 tracehead
= trace
.prev
;
141 void stream___OStream___write(val_t self
, val_t param0
) {
142 struct trace_t trace
= {NULL
, "stream::OStream::write (bin/../lib/standard//stream.nit:86,2--87:21)"};
143 trace
.prev
= tracehead
; tracehead
= &trace
;
144 fprintf(stderr
, "Deferred method write called (bin/../lib/standard//stream.nit:86,2)\n");
146 tracehead
= trace
.prev
;
149 val_t
stream___OStream___is_writable(val_t self
) {
150 struct trace_t trace
= {NULL
, "stream::OStream::is_writable (bin/../lib/standard//stream.nit:89,2--90:23)"};
151 trace
.prev
= tracehead
; tracehead
= &trace
;
152 fprintf(stderr
, "Deferred method is_writable called (bin/../lib/standard//stream.nit:89,2)\n");
154 tracehead
= trace
.prev
;
157 val_t
stream___BufferedIStream___read_char(val_t self
) {
158 struct trace_t trace
= {NULL
, "stream::BufferedIStream::read_char (bin/../lib/standard//stream.nit:96,2--107:16)"};
162 trace
.prev
= tracehead
; tracehead
= &trace
;
163 variable0
= ((stream___BufferedIStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*BufferedIStream::eof*/;
164 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable0
)))) { fprintf(stderr
, "Assert failed: bin/../lib/standard//stream.nit:98,3--16\n"); nit_exit(1);}
165 variable0
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
166 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
167 variable1
= ((array___AbstractArray___length_t
)CALL(variable1
,COLOR_abstract_collection___Collection___length
))(variable1
) /*String::length*/;
168 variable0
= TAG_Bool(UNTAG_Int(variable0
)>=UNTAG_Int(variable1
));
169 if (UNTAG_Bool(variable0
)) { /*if*/
170 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
172 variable0
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
173 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
174 variable1
= ((array___AbstractArray___length_t
)CALL(variable1
,COLOR_abstract_collection___Collection___length
))(variable1
) /*String::length*/;
175 variable0
= TAG_Bool(UNTAG_Int(variable0
)>=UNTAG_Int(variable1
));
176 if (UNTAG_Bool(variable0
)) { /*if*/
177 variable0
= TAG_Int(-UNTAG_Int( TAG_Int(1)));
180 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
181 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
182 variable1
= ((string___String_____bra_t
)CALL(variable1
,COLOR_abstract_collection___Map_____bra
))(variable1
, variable2
) /*String::[]*/;
183 variable0
= variable1
;
184 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)));
185 variable1
= TAG_Int((unsigned char)UNTAG_Char( variable0
/*c*/));
186 variable0
= variable1
;
188 return_label7
: while(false);
189 tracehead
= trace
.prev
;
192 val_t
stream___BufferedIStream___read(val_t self
, val_t param0
) {
193 struct trace_t trace
= {NULL
, "stream::BufferedIStream::read (bin/../lib/standard//stream.nit:110,2--129:10)"};
200 trace
.prev
= tracehead
; tracehead
= &trace
;
202 variable2
= NEW_string___String___with_capacity( variable0
/*i*/); /*new String*/
203 variable1
= variable2
;
204 variable3
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
205 variable2
= variable3
;
206 variable4
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
207 variable4
= ((array___AbstractArray___length_t
)CALL(variable4
,COLOR_abstract_collection___Collection___length
))(variable4
) /*String::length*/;
208 variable3
= variable4
;
209 while (true) { /*while*/
210 variable4
= TAG_Bool(UNTAG_Int( variable0
/*i*/)>UNTAG_Int( TAG_Int(0)));
211 if (!UNTAG_Bool(variable4
)) break; /* while*/
212 variable4
= TAG_Bool(UNTAG_Int( variable2
/*j*/)>=UNTAG_Int( variable3
/*k*/));
213 if (UNTAG_Bool(variable4
)) { /*if*/
214 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
215 variable4
= ((stream___BufferedIStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*BufferedIStream::eof*/;
216 if (UNTAG_Bool(variable4
)) { /*if*/
217 variable1
= variable1
/*s*/;
220 variable4
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
221 variable2
= variable4
/*j=*/;
222 variable4
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
223 variable4
= ((array___AbstractArray___length_t
)CALL(variable4
,COLOR_abstract_collection___Collection___length
))(variable4
) /*String::length*/;
224 variable3
= variable4
/*k=*/;
226 while (true) { /*while*/
227 variable4
= TAG_Bool(UNTAG_Int( variable2
/*j*/)<UNTAG_Int( variable3
/*k*/));
228 variable5
= variable4
;
229 if (UNTAG_Bool(variable5
)) { /* and */
230 variable5
= TAG_Bool(UNTAG_Int( variable0
/*i*/)>UNTAG_Int( TAG_Int(0)));
232 variable4
= variable5
;
233 if (!UNTAG_Bool(variable4
)) break; /* while*/
234 variable4
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
235 variable4
= ((string___String_____bra_t
)CALL(variable4
,COLOR_abstract_collection___Map_____bra
))(variable4
, variable2
/*j*/) /*String::[]*/;
236 ((string___String___add_t
)CALL( variable1
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable1
/*s*/, variable4
) /*String::add*/;
237 variable2
= TAG_Int(UNTAG_Int(variable2
)+UNTAG_Int( TAG_Int(1))) /*j*/;
238 variable0
= TAG_Int(UNTAG_Int(variable0
)-UNTAG_Int( TAG_Int(1))) /*i*/;
239 continue_10
: while(0);
242 continue_9
: while(0);
245 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable2
/*j*/;
246 variable1
= variable1
/*s*/;
248 return_label8
: while(false);
249 tracehead
= trace
.prev
;
252 val_t
stream___BufferedIStream___read_all(val_t self
) {
253 struct trace_t trace
= {NULL
, "stream::BufferedIStream::read_all (bin/../lib/standard//stream.nit:132,2--145:10)"};
258 trace
.prev
= tracehead
; tracehead
= &trace
;
259 variable1
= NEW_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
260 variable0
= variable1
;
261 while (true) { /*while*/
262 variable1
= ((stream___BufferedIStream___eof_t
)CALL( self
,COLOR_stream___IStream___eof
))( self
) /*BufferedIStream::eof*/;
263 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable1
)))) break; /* while*/
264 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
265 variable1
= variable2
;
266 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
267 variable3
= ((array___AbstractArray___length_t
)CALL(variable3
,COLOR_abstract_collection___Collection___length
))(variable3
) /*String::length*/;
268 variable2
= variable3
;
269 while (true) { /*while*/
270 variable3
= TAG_Bool(UNTAG_Int( variable1
/*j*/)<UNTAG_Int( variable2
/*k*/));
271 if (!UNTAG_Bool(variable3
)) break; /* while*/
272 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
273 variable3
= ((string___String_____bra_t
)CALL(variable3
,COLOR_abstract_collection___Map_____bra
))(variable3
, variable1
/*j*/) /*String::[]*/;
274 ((string___String___add_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable0
/*s*/, variable3
) /*String::add*/;
275 variable1
= TAG_Int(UNTAG_Int(variable1
)+UNTAG_Int( TAG_Int(1))) /*j*/;
276 continue_13
: while(0);
279 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable1
/*j*/;
280 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
281 continue_12
: while(0);
284 variable0
= variable0
/*s*/;
286 return_label11
: while(false);
287 tracehead
= trace
.prev
;
290 void stream___BufferedIStream___append_line_to(val_t self
, val_t param0
) {
291 struct trace_t trace
= {NULL
, "stream::BufferedIStream::append_line_to (bin/../lib/standard//stream.nit:148,2--178:16)"};
296 trace
.prev
= tracehead
; tracehead
= &trace
;
298 while (true) { /*while*/
299 if (!UNTAG_Bool( TAG_Bool(true))) break; /* while*/
300 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
301 variable1
= variable2
;
302 while (true) { /*while*/
303 variable2
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
304 variable2
= ((array___AbstractArray___length_t
)CALL(variable2
,COLOR_abstract_collection___Collection___length
))(variable2
) /*String::length*/;
305 variable2
= TAG_Bool(UNTAG_Int( variable1
/*i*/)<UNTAG_Int(variable2
));
306 variable3
= variable2
;
307 if (UNTAG_Bool(variable3
)) { /* and */
308 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
309 variable3
= ((string___String_____bra_t
)CALL(variable3
,COLOR_abstract_collection___Map_____bra
))(variable3
, variable1
/*i*/) /*String::[]*/;
310 variable3
= TAG_Bool((variable3
)!=( TAG_Char('\n')));
312 variable2
= variable3
;
313 if (!UNTAG_Bool(variable2
)) break; /* while*/
314 variable1
= TAG_Int(UNTAG_Int(variable1
)+UNTAG_Int( TAG_Int(1))) /*i*/;
315 continue_16
: while(0);
318 variable2
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
319 variable2
= TAG_Bool(UNTAG_Int( variable1
/*i*/)>UNTAG_Int(variable2
));
320 if (UNTAG_Bool(variable2
)) { /*if*/
321 variable2
= ((array___AbstractArray___length_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___Collection___length
))( variable0
/*s*/) /*String::length*/;
322 variable2
= TAG_Int(UNTAG_Int(variable2
)+UNTAG_Int( variable1
/*i*/));
323 variable3
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
324 variable2
= TAG_Int(UNTAG_Int(variable2
)-UNTAG_Int(variable3
));
325 ((string___String___enlarge_t
)CALL( variable0
/*s*/,COLOR_array___AbstractArray___enlarge
))( variable0
/*s*/, variable2
) /*String::enlarge*/;
326 variable3
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
327 variable2
= variable3
;
328 while (true) { /*while*/
329 variable3
= TAG_Bool(UNTAG_Int( variable2
/*j*/)<UNTAG_Int( variable1
/*i*/));
330 if (!UNTAG_Bool(variable3
)) break; /* while*/
331 variable3
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
332 variable3
= ((string___String_____bra_t
)CALL(variable3
,COLOR_abstract_collection___Map_____bra
))(variable3
, variable2
/*j*/) /*String::[]*/;
333 ((string___String___add_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___SimpleCollection___add
))( variable0
/*s*/, variable3
) /*String::add*/;
334 variable2
= TAG_Int(UNTAG_Int(variable2
)+UNTAG_Int( TAG_Int(1))) /*j*/;
335 continue_17
: while(0);
339 variable2
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
340 variable2
= ((array___AbstractArray___length_t
)CALL(variable2
,COLOR_abstract_collection___Collection___length
))(variable2
) /*String::length*/;
341 variable2
= TAG_Bool(UNTAG_Int( variable1
/*i*/)<UNTAG_Int(variable2
));
342 if (UNTAG_Bool(variable2
)) { /*if*/
343 variable2
= TAG_Int(UNTAG_Int( variable1
/*i*/)+UNTAG_Int( TAG_Int(1)));
344 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable2
;
347 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = variable1
/*i*/;
348 variable2
= ((stream___BufferedIStream___end_reached_t
)CALL( self
,COLOR_stream___BufferedIStream___end_reached
))( self
) /*BufferedIStream::end_reached*/;
349 if (UNTAG_Bool(variable2
)) { /*if*/
352 ((stream___BufferedIStream___fill_buffer_t
)CALL( self
,COLOR_stream___BufferedIStream___fill_buffer
))( self
) /*BufferedIStream::fill_buffer*/;
355 continue_15
: while(0);
358 return_label14
: while(false);
359 tracehead
= trace
.prev
;
362 val_t
stream___BufferedIStream___eof(val_t self
) {
363 struct trace_t trace
= {NULL
, "stream::BufferedIStream::eof (bin/../lib/standard//stream.nit:184,2--71)"};
366 trace
.prev
= tracehead
; tracehead
= &trace
;
367 variable0
= ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/;
368 variable1
= ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/;
369 variable1
= ((array___AbstractArray___length_t
)CALL(variable1
,COLOR_abstract_collection___Collection___length
))(variable1
) /*String::length*/;
370 variable0
= TAG_Bool(UNTAG_Int(variable0
)>=UNTAG_Int(variable1
));
371 variable1
= variable0
;
372 if (UNTAG_Bool(variable1
)) { /* and */
373 variable1
= ((stream___BufferedIStream___end_reached_t
)CALL( self
,COLOR_stream___BufferedIStream___end_reached
))( self
) /*BufferedIStream::end_reached*/;
375 variable0
= variable1
;
377 return_label18
: while(false);
378 tracehead
= trace
.prev
;
381 void stream___BufferedIStream___fill_buffer(val_t self
) {
382 struct trace_t trace
= {NULL
, "stream::BufferedIStream::fill_buffer (bin/../lib/standard//stream.nit:192,2--193:27)"};
383 trace
.prev
= tracehead
; tracehead
= &trace
;
384 fprintf(stderr
, "Deferred method fill_buffer called (bin/../lib/standard//stream.nit:192,2)\n");
386 tracehead
= trace
.prev
;
389 val_t
stream___BufferedIStream___end_reached(val_t self
) {
390 struct trace_t trace
= {NULL
, "stream::BufferedIStream::end_reached (bin/../lib/standard//stream.nit:195,2--196:33)"};
391 trace
.prev
= tracehead
; tracehead
= &trace
;
392 fprintf(stderr
, "Deferred method end_reached called (bin/../lib/standard//stream.nit:195,2)\n");
394 tracehead
= trace
.prev
;
397 void stream___BufferedIStream___prepare_buffer(val_t self
, val_t param0
) {
398 struct trace_t trace
= {NULL
, "stream::BufferedIStream::prepare_buffer (bin/../lib/standard//stream.nit:198,2--202:17)"};
401 trace
.prev
= tracehead
; tracehead
= &trace
;
403 variable1
= NEW_string___String___with_capacity( variable0
/*capacity*/); /*new String*/
404 ATTR_stream___BufferedIStream____buffer( self
) /*BufferedIStream::_buffer*/ = variable1
;
405 ATTR_stream___BufferedIStream____buffer_pos( self
) /*BufferedIStream::_buffer_pos*/ = TAG_Int(0);
406 tracehead
= trace
.prev
;
409 void stream___FDStream___close(val_t self
) {
410 struct trace_t trace
= {NULL
, "stream::FDStream::close (bin/../lib/standard//stream.nit:218,2--37)"};
412 trace
.prev
= tracehead
; tracehead
= &trace
;
413 variable0
= ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/;
414 ((stream___FDStream___native_close_t
)CALL( self
,COLOR_stream___FDStream___native_close
))( self
, variable0
) /*FDStream::native_close*/;
415 tracehead
= trace
.prev
;
418 val_t
stream___FDStream___native_close(val_t self
, val_t param0
) {
419 struct trace_t trace
= {NULL
, "stream::FDStream::native_close (bin/../lib/standard//stream.nit:220,2--91)"};
420 trace
.prev
= tracehead
; tracehead
= &trace
;
421 tracehead
= trace
.prev
;
422 return TAG_Int(stream_FDStream_FDStream_native_close_1( self
, UNTAG_Int( param0
)));
424 val_t
stream___FDStream___native_read_char(val_t self
, val_t param0
) {
425 struct trace_t trace
= {NULL
, "stream::FDStream::native_read_char (bin/../lib/standard//stream.nit:221,2--99)"};
426 trace
.prev
= tracehead
; tracehead
= &trace
;
427 tracehead
= trace
.prev
;
428 return TAG_Int(stream_FDStream_FDStream_native_read_char_1( self
, UNTAG_Int( param0
)));
430 val_t
stream___FDStream___native_read(val_t self
, val_t param0
, val_t param1
, val_t param2
) {
431 struct trace_t trace
= {NULL
, "stream::FDStream::native_read (bin/../lib/standard//stream.nit:222,2--118)"};
432 trace
.prev
= tracehead
; tracehead
= &trace
;
433 tracehead
= trace
.prev
;
434 return TAG_Int(stream_FDStream_FDStream_native_read_3( self
, UNTAG_Int( param0
), UNBOX_NativeString( param1
), UNTAG_Int( param2
)));
436 val_t
stream___FDStream___native_write(val_t self
, val_t param0
, val_t param1
, val_t param2
) {
437 struct trace_t trace
= {NULL
, "stream::FDStream::native_write (bin/../lib/standard//stream.nit:223,2--120)"};
438 trace
.prev
= tracehead
; tracehead
= &trace
;
439 tracehead
= trace
.prev
;
440 return TAG_Int(stream_FDStream_FDStream_native_write_3( self
, UNTAG_Int( param0
), UNBOX_NativeString( param1
), UNTAG_Int( param2
)));
442 void stream___FDStream___init(val_t self
, val_t param0
, int* init_table
) {
443 struct trace_t trace
= {NULL
, "stream::FDStream::init (bin/../lib/standard//stream.nit:225,2--26)"};
445 trace
.prev
= tracehead
; tracehead
= &trace
;
447 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDStream
].i
]) return;
448 ATTR_stream___FDStream____fd( self
) /*FDStream::_fd*/ = variable0
/*fd*/;
449 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDStream
].i
] = 1;
450 tracehead
= trace
.prev
;
453 val_t
stream___FDIStream___eof(val_t self
) {
454 struct trace_t trace
= {NULL
, "stream::FDIStream::eof (bin/../lib/standard//stream.nit:231,2--31)"};
455 trace
.prev
= tracehead
; tracehead
= &trace
;
456 tracehead
= trace
.prev
;
457 return ATTR_stream___FDIStream____eof( self
) /*FDIStream::_eof*/;
459 val_t
stream___FDIStream___read_char(val_t self
) {
460 struct trace_t trace
= {NULL
, "stream::FDIStream::read_char (bin/../lib/standard//stream.nit:233,2--237:11)"};
463 trace
.prev
= tracehead
; tracehead
= &trace
;
464 variable1
= ATTR_stream___FDStream____fd( self
) /*FDIStream::_fd*/;
465 variable1
= ((stream___FDStream___native_read_char_t
)CALL( self
,COLOR_stream___FDStream___native_read_char
))( self
, variable1
) /*FDIStream::native_read_char*/;
466 variable0
= variable1
;
467 variable1
= TAG_Int(-UNTAG_Int( TAG_Int(1)));
468 variable1
= TAG_Bool(( variable0
/*nb*/)==(variable1
));
469 if (UNTAG_Bool(variable1
)) { /*if*/
470 ATTR_stream___FDIStream____eof( self
) /*FDIStream::_eof*/ = TAG_Bool(true);
472 variable0
= variable0
/*nb*/;
474 return_label22
: while(false);
475 tracehead
= trace
.prev
;
478 void stream___FDIStream___init(val_t self
, val_t param0
, int* init_table
) {
479 struct trace_t trace
= {NULL
, "stream::FDIStream::init (bin/../lib/standard//stream.nit:240,2--29)"};
481 trace
.prev
= tracehead
; tracehead
= &trace
;
483 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIStream
].i
]) return;
484 ((stream___FDStream___init_t
)CALL( self
,COLOR_stream___FDStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDStream::init*/;
485 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIStream
].i
] = 1;
486 tracehead
= trace
.prev
;
489 val_t
stream___FDOStream___is_writable(val_t self
) {
490 struct trace_t trace
= {NULL
, "stream::FDOStream::is_writable (bin/../lib/standard//stream.nit:246,2--39)"};
491 trace
.prev
= tracehead
; tracehead
= &trace
;
492 tracehead
= trace
.prev
;
493 return ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/;
495 void stream___FDOStream___write(val_t self
, val_t param0
) {
496 struct trace_t trace
= {NULL
, "stream::FDOStream::write (bin/../lib/standard//stream.nit:248,2--251:44)"};
502 trace
.prev
= tracehead
; tracehead
= &trace
;
504 variable2
= ATTR_stream___FDStream____fd( self
) /*FDOStream::_fd*/;
505 variable3
= ((string___String___to_cstring_t
)CALL( variable0
/*s*/,COLOR_string___String___to_cstring
))( variable0
/*s*/) /*String::to_cstring*/;
506 variable4
= ((array___AbstractArray___length_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___Collection___length
))( variable0
/*s*/) /*String::length*/;
507 variable2
= ((stream___FDStream___native_write_t
)CALL( self
,COLOR_stream___FDStream___native_write
))( self
, variable2
, variable3
, variable4
) /*FDOStream::native_write*/;
508 variable1
= variable2
;
509 variable2
= ((array___AbstractArray___length_t
)CALL( variable0
/*s*/,COLOR_abstract_collection___Collection___length
))( variable0
/*s*/) /*String::length*/;
510 variable2
= TAG_Bool(UNTAG_Int( variable1
/*nb*/)<UNTAG_Int(variable2
));
511 if (UNTAG_Bool(variable2
)) { /*if*/
512 ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/ = TAG_Bool(false);
514 tracehead
= trace
.prev
;
517 void stream___FDOStream___init(val_t self
, val_t param0
, int* init_table
) {
518 struct trace_t trace
= {NULL
, "stream::FDOStream::init (bin/../lib/standard//stream.nit:254,2--257:21)"};
520 trace
.prev
= tracehead
; tracehead
= &trace
;
522 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDOStream
].i
]) return;
523 ((stream___FDStream___init_t
)CALL( self
,COLOR_stream___FDStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDStream::init*/;
524 ATTR_stream___FDOStream____is_writable( self
) /*FDOStream::_is_writable*/ = TAG_Bool(true);
525 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDOStream
].i
] = 1;
526 tracehead
= trace
.prev
;
529 void stream___FDIOStream___init(val_t self
, val_t param0
, int* init_table
) {
530 struct trace_t trace
= {NULL
, "stream::FDIOStream::init (bin/../lib/standard//stream.nit:265,2--268:21)"};
532 trace
.prev
= tracehead
; tracehead
= &trace
;
534 if (init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIOStream
].i
]) return;
535 ((stream___FDIStream___init_t
)CALL( self
,COLOR_stream___FDIStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDIStream::init*/;
536 ((stream___FDOStream___init_t
)CALL( self
,COLOR_stream___FDOStream___init
))( self
, param0
, init_table
/*YYY*/) /*FDOStream::init*/;
537 ATTR_stream___FDStream____fd( self
) /*FDIOStream::_fd*/ = variable0
/*fd*/;
538 ATTR_stream___FDOStream____is_writable( self
) /*FDIOStream::_is_writable*/ = TAG_Bool(true);
539 init_table
[VAL2OBJ( self
)->vft
[INIT_TABLE_POS_FDIOStream
].i
] = 1;
540 tracehead
= trace
.prev
;