DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦034ddd3fb⟧ Ada Source

    Length: 4096 (0x1000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Unused_Withs, seg_004639

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with With_Accounting;
with Ada_Program;
with Directory_Tools;
with Object_Sets;

procedure Unused_Withs (For_Unit : Ada_Program.Compilation_Unit;
                        Unused : in out Ada_Program.Element_List;
                        Used_Only_In_Use_Or_Rename : in out
                           Ada_Program.Element_List) is

    package Object renames Directory_Tools.Object;

    Family : Object_Sets.Set := Object_Sets.Empty_Set;

    Comp_Unit_Object : Object.Handle :=
       Ada_Program.Conversion.To_Directory_Object (For_Unit);

    Db : With_Accounting.Database (With_Accounting.Number_Of_Withs (For_Unit));

    Dup : Boolean;

    procedure Pre_Op (Program_Element :        Ada_Program.Element;
                      State           : in out With_Accounting.Database;
                      Control         : in out Ada_Program.Traversal_Control) is
    begin
        case Ada_Program.Id_Kind (Program_Element) is
            when Ada_Program.An_Identifier_Reference =>
                With_Accounting.Mark_As_Used (Program_Element, State);
            when others =>
                null;
        end case;

        Control := Ada_Program.Continue;
    end Pre_Op;

    procedure Post_Op (Program_Element : Ada_Program.Element;
                       State : in out With_Accounting.Database;
                       Control : in out Ada_Program.Traversal_Control) is
    begin
        Control := Ada_Program.Continue;
    end Post_Op;

    procedure Traverse is new Ada_Program.Depth_First_Traversal
                                 (With_Accounting.Database, Pre_Op, Post_Op);
begin
    With_Accounting.Initialize (For_Unit, Db);

    Family := Object_Sets.Family (Comp_Unit_Object);

    Object.Reset (Family);
    while not Object.Done (Family) loop
        Traverse (Ada_Program.Conversion.To_Compilation_Unit
                     (Object.Value (Family)), Db, False);
        Object.Next (Family);
    end loop;

    for I in 1 .. Db.Size loop
        if not With_Accounting.Used (I, Db) then
            if With_Accounting.Used_By_Use_Or_Rename (I, Db) then
                Ada_Program.Append (With_Accounting.With_Id (I, Db),
                                    Used_Only_In_Use_Or_Rename);
            else
                Ada_Program.Append (With_Accounting.With_Id (I, Db), Unused);
            end if;
        end if;
    end loop;
exception
    when With_Accounting.All_Used =>
        null;
end Unused_Withs;

E3 Meta Data

    nblk1=3
    nid=0
    hdr6=6
        [0x00] rec0=1c rec1=00 rec2=01 rec3=046
        [0x01] rec0=1c rec1=00 rec2=02 rec3=010
        [0x02] rec0=10 rec1=00 rec2=03 rec3=000
    tail 0x21500452a815c661ef388 0x42a00088462061e03