package Split is


    -- This package provides tools for splitting large units into smaller.
    -- The Unit_To_Split must be in the source state and unlocked because
    -- the unit is updated in place.


    subtype Stmt_Decl_Count is Integer;
    subtype Ada_Unit_Name is String;


    procedure Separate_Subunits (Unit_To_Split : Ada_Unit_Name;
                                 Unit_Sizes_To_Separate : Stmt_Decl_Count := 20;
                                 Subunits_To_Separate : String := "";
                                 Separate_Subprograms : Boolean := True;
                                 Separate_Tasks : Boolean := True;
                                 Separate_Packages : Boolean := True);

    -- This tools makes subunits out of subprogram, task, or package
    -- bodies.  Each of these items will be made a separate subunit.

    -- Unit_To_Split must be a library unit or subunit body.
    -- it can not have any installed subunits.
    -- Subunits_To_Separate can be the name of a text file
    -- (preceded by a \ if it does not begin with a special symbol)
    -- which has a unit name on each line or
    -- it can be a list of unit names separated by spaces.
    -- If it is "" then all units which can be are separated.
    -- In the all units case, units which have greater than the
    -- stmt_decl_count specified are separated.
    -- The split unit and its subunits will be left in the source state.


    procedure Make_Subunit (Unit_To_Split : Ada_Unit_Name;
                            Unit_Sizes_To_Include : Stmt_Decl_Count := 0;
                            Subunits_To_Separate : String := "";
                            Subunit_Name : String := "");

    -- This tool creates a subpackage that is a subunit and selectively
    -- moves non-visible subprograms into it.

    -- Unit_To_Split must be a library unit or subunit body.
    -- It can not have any installed subunits.
    -- Subunit_Name specifies the name of the subunit to be created.
    -- if it is not specified then the name will be gotten by
    -- concatenating _UTIL to the name of the unit being split.
    -- if the subunit already exists it will be added to.
    -- Subunits_To_Separate can be the name of a text file
    -- (preceded by a \ if it does not begin with a special symbol)
    -- which has a unit name on each line or
    -- it can be a list of unit names separated by spaces.
    -- If it is "" then all units which can be are separated.
    -- In the all units case, units which have greater than the
    -- stmt_decl_count specified are separated.
    -- The split unit and its subunits will be left in the source state.
    -- Only subprogram units are moved into the subunit.
end Split;