-- -*- mode: eiffel -*-
-- $Id: reversefile.se,v 1.3 2001/07/07 00:46:25 doug Exp $
-- http://www.bagley.org/~doug/shootout/
-- from Daniel F Moisset

class REVERSEFILE

creation make

feature

    make is
        local
            i: ITERATOR[STRING]
            ll_string: LINKED_LIST[STRING];
        do
            !!ll_string.make;
            from
                io.read_line
            until io.end_of_input loop
                ll_string.add_first(clone(io.last_string));
                io.read_line;
            end;
            i := ll_string.get_new_iterator
            from 
           i.start
        until i.is_off loop
                io.put_string (i.item);
                io.put_character('%N');
                i.next;
            end;
        end;

end -- class REVERSEFILE