-- =========================================================================== -- Copyright 1996 by WPL Laboratories, Inc. All Rights Reserved -- -- WPL Laboratories, Inc. -- Whitehall Offices, Suite 6 -- 410 Lancaster Avenue -- Haverford, PA 19041 -- -- -- For Support call 610-658-2362 -- -- $Revision: 1.1 $ $Date: 1995/01/15 19:48:46 $ -- -- =========================================================================== with Ada.Text_IO; package body Generic_Lists_Pkg is procedure Add_to_End (List : in out List_Ptr_Type; Element : in Element_Type'Class) is List_Ptr_Tmp : List_Ptr_Type; begin if List = null then Ada.Text_IO.Put_Line (Element'External_Tag); List := new List_Type'(This => new Element_Type'Class'(Element), Next => null); else List_Ptr_Tmp := List; while List_Ptr_Tmp.Next /= null loop List_Ptr_Tmp := List_Ptr_Tmp.Next; end loop; List_Ptr_Tmp.Next := new List_Type'(This => new Element_Type'Class'(Element), Next => null); end if; end add_to_End; procedure Next (List : in out List_Ptr_Type; Element : out Element_Ptr_Type) is -- removes access to previous list elements -- raises End_of_List if there are no more begin if List = null then raise End_of_List; else Element := List.This; List := List.Next; end if; end next; end Generic_Lists_Pkg;