Add a first comment line for files generated by nitc.
[nit.git] / c_src / stream._sep.c
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");
7 nit_exit(1);
8 tracehead = trace.prev;
9 return;
10 }
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");
15 nit_exit(1);
16 tracehead = trace.prev;
17 return NIT_NULL;
18 }
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)"};
21 val_t variable0;
22 val_t variable1;
23 val_t variable2;
24 val_t variable3;
25 trace.prev = tracehead; tracehead = &trace;
26 variable0 = param0;
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));
35 }
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*/;
45 }
46 continue_1: while(0);
47 }
48 break_1: while(0);
49 variable1 = variable1 /*s*/;
50 goto return_label0;
51 return_label0: while(false);
52 tracehead = trace.prev;
53 return variable1;
54 }
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)"};
57 val_t variable0;
58 val_t variable1;
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*/;
66 goto return_label2;
67 return_label2: while(false);
68 tracehead = trace.prev;
69 return variable0;
70 }
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)"};
73 val_t variable0;
74 val_t variable1;
75 val_t variable2;
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*/;
88 }
89 continue_4: while(0);
90 }
91 break_4: while(0);
92 variable0 = variable0 /*s*/;
93 goto return_label3;
94 return_label3: while(false);
95 tracehead = trace.prev;
96 return variable0;
97 }
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)"};
100 val_t variable0;
101 val_t variable1;
102 val_t variable2;
103 val_t variable3;
104 trace.prev = tracehead; tracehead = &trace;
105 variable0 = param0;
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*/
115 goto return_label5;
116 }
117 } else { /*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*/
123 goto return_label5;
124 }
125 }
126 continue_6: while(0);
127 }
128 break_6: while(0);
129 return_label5: while(false);
130 tracehead = trace.prev;
131 return;
132 }
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");
137 nit_exit(1);
138 tracehead = trace.prev;
139 return NIT_NULL;
140 }
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");
145 nit_exit(1);
146 tracehead = trace.prev;
147 return;
148 }
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");
153 nit_exit(1);
154 tracehead = trace.prev;
155 return NIT_NULL;
156 }
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)"};
159 val_t variable0;
160 val_t variable1;
161 val_t variable2;
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*/;
171 }
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)));
178 goto return_label7;
179 }
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;
187 goto return_label7;
188 return_label7: while(false);
189 tracehead = trace.prev;
190 return variable0;
191 }
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)"};
194 val_t variable0;
195 val_t variable1;
196 val_t variable2;
197 val_t variable3;
198 val_t variable4;
199 val_t variable5;
200 trace.prev = tracehead; tracehead = &trace;
201 variable0 = param0;
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*/;
218 goto return_label8;
219 }
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=*/;
225 }
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)));
231 }
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);
240 }
241 break_10: while(0);
242 continue_9: while(0);
243 }
244 break_9: while(0);
245 ATTR_stream___BufferedIStream____buffer_pos( self) /*BufferedIStream::_buffer_pos*/ = variable2 /*j*/;
246 variable1 = variable1 /*s*/;
247 goto return_label8;
248 return_label8: while(false);
249 tracehead = trace.prev;
250 return variable1;
251 }
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)"};
254 val_t variable0;
255 val_t variable1;
256 val_t variable2;
257 val_t variable3;
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);
277 }
278 break_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);
282 }
283 break_12: while(0);
284 variable0 = variable0 /*s*/;
285 goto return_label11;
286 return_label11: while(false);
287 tracehead = trace.prev;
288 return variable0;
289 }
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)"};
292 val_t variable0;
293 val_t variable1;
294 val_t variable2;
295 val_t variable3;
296 trace.prev = tracehead; tracehead = &trace;
297 variable0 = param0;
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')));
311 }
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);
316 }
317 break_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);
336 }
337 break_17: while(0);
338 }
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;
345 goto return_label14;
346 } else { /*if*/
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*/
350 goto return_label14;
351 } else { /*if*/
352 ((stream___BufferedIStream___fill_buffer_t)CALL( self,COLOR_stream___BufferedIStream___fill_buffer))( self) /*BufferedIStream::fill_buffer*/;
353 }
354 }
355 continue_15: while(0);
356 }
357 break_15: while(0);
358 return_label14: while(false);
359 tracehead = trace.prev;
360 return;
361 }
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)"};
364 val_t variable0;
365 val_t variable1;
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*/;
374 }
375 variable0 = variable1;
376 goto return_label18;
377 return_label18: while(false);
378 tracehead = trace.prev;
379 return variable0;
380 }
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");
385 nit_exit(1);
386 tracehead = trace.prev;
387 return;
388 }
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");
393 nit_exit(1);
394 tracehead = trace.prev;
395 return NIT_NULL;
396 }
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)"};
399 val_t variable0;
400 val_t variable1;
401 trace.prev = tracehead; tracehead = &trace;
402 variable0 = param0;
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;
407 return;
408 }
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)"};
411 val_t variable0;
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;
416 return;
417 }
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)));
423 }
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)));
429 }
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)));
435 }
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)));
441 }
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)"};
444 val_t variable0;
445 trace.prev = tracehead; tracehead = &trace;
446 variable0 = param0;
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;
451 return;
452 }
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*/;
458 }
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)"};
461 val_t variable0;
462 val_t variable1;
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);
471 }
472 variable0 = variable0 /*nb*/;
473 goto return_label22;
474 return_label22: while(false);
475 tracehead = trace.prev;
476 return variable0;
477 }
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)"};
480 val_t variable0;
481 trace.prev = tracehead; tracehead = &trace;
482 variable0 = param0;
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;
487 return;
488 }
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*/;
494 }
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)"};
497 val_t variable0;
498 val_t variable1;
499 val_t variable2;
500 val_t variable3;
501 val_t variable4;
502 trace.prev = tracehead; tracehead = &trace;
503 variable0 = param0;
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);
513 }
514 tracehead = trace.prev;
515 return;
516 }
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)"};
519 val_t variable0;
520 trace.prev = tracehead; tracehead = &trace;
521 variable0 = param0;
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;
527 return;
528 }
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)"};
531 val_t variable0;
532 trace.prev = tracehead; tracehead = &trace;
533 variable0 = param0;
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;
541 return;
542 }