// $Id$ $use Arithm Box Class Compare Convert Error Table; //X/$use Lexer(Stream FakeStreamIndex); $use Lexer.Lexer; $use Stream.Stream; $use Stream.StreamErr; $table Buffers; /* * For the moment the format is: * s.channel --> stream */ OpenFile s.channel e.file s.mode, \{ # = ; # = ; , )>; }; /* * FIXME: * Should open &StdIn, &StdOut, and &StdErr like this: * )>; */ //FIXME: probably shouldn't close &StdIn, &StdOut, and &StdErr? CloseChannel s.channel, { # = ; , ; }; IsEof s.channel, { : stream = ; ; }; ReadCharCh s.channel, { : stream = : s.char, s.char; = $fail; }; ReadChar = ; ReadLineCh s.channel, { : stream = : \{ e.line '\r\n' = e.line; e.line '\n' = e.line; e.line '\r' = e.line; v.line = v.line; }; = $fail; }; ReadLine = ; $func? Read_Main s.fname s.channel = term; ReadCh s.channel = ; Read = ; Read_Main s.fname s.channel, { : stream = { ; /*empty*/; } :: e.result, { : (t.name t.pos (e.message)) e = , $fail;; }, e.result : term = term; = $fail; };