% The specification of the printer
% Version 1, 03.06.1998
module printer

   graph class: DirectedGraph
   
   % Uses functionality from the channel module
   uses channel;

   exports
      transformation unit create;
      transformation unit connect;
      transformation unit print

   realized by

      % Creates a new printer
      transformation unit create
         initial:
         body:
            apply once create_printer
         terminal:
      end;

      % Connect the printer with a channel
      transformation unit connect
         initial:
         body:
            apply once connect_printer
         terminal:
      end;

      % Print a document
      transformation unit print
         initial:
         body:
            % Check, if a document is available
            if (channel.data_available) then
               apply once channel.receive;
               apply once print_document
            end
         terminal:
      end
end.