package body Halstead_List is

    type Pointer_To_Item is access Item;
    type Node is
        record
            Location_Of_Item : Pointer_To_Item := null;
            Frequency : Natural := 0;
            Next : List := null;
        end record;
    --
    -- Location_Of_Item points to the actual item;
    -- Frequency is the number of occurrences of the item
    -- in a compilation unit;
    -- Next points to the next node
    --

    Free_List : List := null;
    --
    -- points to the first node in the free list
    --

    procedure Get (New_Node : out List) is separate;
    --
    -- gets a new node either from the free-list or system;
    -- we ASSUME that there will be no OVERFLOW!!!
    --

    procedure Create (Empty_List : in out List) is separate;
    --==============================================================
    -- Create an empty list. Previous contents of Empty_List will ==
    -- be put back into the available list.                       ==
    --==============================================================

    procedure Put (This_Item : in Item; Into : in out List) is separate;
    --==============================================================
    -- Put an item into a list. If the given item is a new item,  ==
    -- it will be put into the list. If the given item already    ==
    -- exists, the frequency of the item will be incremented by   ==
    -- one. Items will be stored in ASCENDING order.              ==
    --==============================================================

    function Length_Of (This_List : in List) return Natural is separate;
    --==============================================================
    -- Returns the number of items in The_List.                   ==
    -- ZERO will be returned if The_List is empty.                ==
    --==============================================================

    function Frequency_Of (This_Item : in Item; In_This : in List)
                          return Natural is separate;
    --==============================================================
    -- Returns frequency of an item in a given list. If the item  ==
    -- does not EXIST, ZERO will be returned.                     ==
    --==============================================================


    procedure Iterate (Across_The_List : in List) is separate;
    --==============================================================
    -- Iterate allows a user to visit every item in the list      ==
    -- without changing the state of the list.                    ==
    --==============================================================

end Halstead_List;