-- Copyright (C) International Computer Science Institute, 1994.  COPYRIGHT  --
-- NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY and is subject --
-- to the terms of the SATHER LIBRARY GENERAL PUBLIC LICENSE contained in    --
-- the file "Doc/License" of the Sather distribution.  The license is also   --
-- available from ICSI, 1947 Center St., Suite 600, Berkeley CA 94704, USA.  --
--------> Please email comments to "sather-bugs@icsi.berkeley.edu". <----------

external class C_TIME is
   clock:INT;
end;

class TIME is
   clock:INT is
      return C_TIME::clock;
   end;
end;


class MAIN is
   attr f:FILE;
   attr a:FLIST{STR};
   
   input is
      f:=f.open_for_read("input");
      c:CHAR;
      s::=#STR;
      loop
	 while!(~f.eof);
	 c:=f.get_char;
	 if (c.is_space) then
	    if (s.size > 0) then a:=a.push(s); s:=""; end;
	 else
	    s:=s.plus(c);
	 end;
      end;
   end;

   show is
      s:STR;
      loop
	 s:=a.elt!; #OUT + s + "\n" ;
      end;
   end;

   main is
      i:INT;
      t:ARRAY{INT} := #(3);
	 i:=C_TIME::clock;
      input;
	 i:=C_TIME::clock-i;   t[0]:=i; 
      show;
	 i:=C_TIME::clock-i;   t[1]:= i;
	 #OUT + "input: " + t[0] + "\n";
	 #OUT + "input: " + t[1] + "\n";
   end;
end;
