separate (Compilation_Unit.Produce_Metrics)
task body Program_Unit_State_Machine is
    --==============================================================
    -- This task body gives the user the ability to either modify  =
    -- or find out the present state of the program unit abstract  =
    -- state machine. Accept statements are provided to change the =
    -- present values of each type of program unit information     =
    -- located in the body of this task. Accept statements are     =
    -- also provided to give back each present value. The type and =
    -- name of the program unit are stored in the body.            =
    --                                                             =
    -- written by GER with help from Brad and JM                   =
    --==============================================================

    Current_Program_Unit_Name : Program_Unit_Name;
    -- The current name of this program unit

    Current_Kind_Of_Program_Unit : Program_Unit_Kind := Undefined;
    -- The type of program unit

begin
    -- Program_Unit_State_Machine

    Calculate_And_Get:
        loop

            select
                -- Change the program unit name

                accept Store_Program_Unit_Name
                          (The_Program_Unit_Name : in Program_Unit_Name) do
                    Current_Program_Unit_Name := The_Program_Unit_Name;
                end Store_Program_Unit_Name;

            or
                -- Change the type of program unit

                accept Store_Kind_Of_Program_Unit
                          (The_Kind_Of_Program_Unit : in Program_Unit_Kind) do
                    Current_Kind_Of_Program_Unit := The_Kind_Of_Program_Unit;
                end Store_Kind_Of_Program_Unit;

            or
                -- Return the present Program unit name

                accept Get_Program_Unit_Name
                          (The_Program_Unit_Name : out Program_Unit_Name) do
                    The_Program_Unit_Name := Current_Program_Unit_Name;
                end Get_Program_Unit_Name;

            or
                -- Get_Kind_Of_Program_Unit

                accept Get_Kind_Of_Program_Unit
                          (The_Kind_Of_Program_Unit : out Program_Unit_Kind) do
                    The_Kind_Of_Program_Unit := Current_Kind_Of_Program_Unit;
                end Get_Kind_Of_Program_Unit;

            or
                -- Terminate this task

                terminate;

            end select;

        end loop Calculate_And_Get;

end Program_Unit_State_Machine;