class TEST1

creation
  go

feature


go is
  local
    file : STD_FILE_READ
    words : GBN_WORDS
    heap: GBN_HEAP [ STRING ]
  do
    if argument_count /= 1 then
      std_error.put_string(argument(0)+" expects one file argument%N")
    else
      !! file.connect_to (argument(1))
      !! heap.make
      from
        !! words.make
      until
        words.last_word = Void
      loop
        words.get_word (file)
        if words.last_word /= Void then
  	heap . add ( words.last_word, Void )
        end
      end
      from
      until
        heap . is_empty
      loop
        io . put_string ( heap.min + "%N" )
        heap . delete_min
      end
    end
  end

end -- class TEST1
