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

⟦a873df175⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Type_Analysis, seg_004426

Derivation

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

E3 Source Code



--| @SUMMARY This package collects and sorts information about type declarations
--|          that are added to its database.
--|
with List_Generic;
with Bounded_String;
with Map_Generic;
with Ada_Program;
with Lrm_Utilities;
with Abstract_Document;
package Type_Analysis is

    type Db is private;

    procedure Initialize (The_Db : in out Db);

    -- adds the type declaration and recursively walks any other types
    -- referenced in the declarations.  Record components, array index and
    -- component types, derived and accessed types are included.
    procedure Add_Type_Decl (Decl : Ada_Program.Element; To : in out Db);

    -- record sorts only include record types in the output
    -- scalar sorts only included numerics and enumeration types
    -- subtype sort only includes subtypes
    -- kind_sort and name_sort include all types

    type Sort_Type is (Record_Sort, Kind_Sort, Name_Sort,
                       Scalar_Sort, Subtype_Sort);

    procedure Display (The_Db      : Db;
                       Sort        : Sort_Type := Type_Analysis.Kind_Sort;
                       To_Document : in out Abstract_Document.Handle);

private
    subtype Var_String is Bounded_String.Variable_String (80);

    subtype Decl_Id is Long_Integer;

    type Component_Index is range 0 .. 100;
    type Id_List         is array (Component_Index) of Decl_Id;

    use Lrm_Utilities;

    type Data (Kind : Lrm_Utilities.Type_Kinds := An_Integer_Type) is
        record
            Parent_Comp_Unit_Decl : Ada_Program.Declaration;  
            Decl : Ada_Program.Element;
            Id : Decl_Id;
            case Kind is
                when An_Integer_Type =>
                    Lower : Long_Integer;
                    Upper : Long_Integer;
                when A_Float_Type =>
                    Lower_Float_Bound : Float;
                    Upper_Float_Bound : Float;
                when A_Fixed_Type =>
                    Lower_Fixed_Bound : Long_Integer;
                    Upper_Fixed_Bound : Long_Integer;
                when An_Enumeration =>
                    Num_Lits : Integer := 0;
                when A_Boolean_Type | A_Character_Type =>
                    null;
                when A_String_Type =>
                    String_Size : Integer;
                when A_Record_Type =>
                    Component_Count : Component_Index := 1;
                    Ids             : Id_List;
                when An_Array_Type =>
                    Index_Type     : Decl_Id;
                    Component_Type : Decl_Id;
                when An_Access_Type =>
                    Accessed_Type : Decl_Id;
                when A_Derived_Type =>
                    Referenced_Type : Decl_Id;
                when A_Subtype =>
                    Subtyped_Type : Decl_Id;
                when A_Task_Type =>
                    null;
                when A_Private_Type | A_Limited_Private_Type =>
                    Completion_Type : Decl_Id;
                when None_Of_Above =>
                    null;
            end case;
        end record;

    function Hash (Id : Decl_Id) return Integer;

    package Type_Map is new Map_Generic (8000, Decl_Id, Data, Hash);

    type Db is
        record
            Map : Type_Map.Map;
        end record;
end Type_Analysis;

E3 Meta Data

    nblk1=5
    nid=4
    hdr6=8
        [0x00] rec0=1c rec1=00 rec2=01 rec3=064
        [0x01] rec0=1c rec1=00 rec2=02 rec3=048
        [0x02] rec0=17 rec1=00 rec2=05 rec3=03c
        [0x03] rec0=10 rec1=00 rec2=03 rec3=001
        [0x04] rec0=00 rec1=00 rec2=00 rec3=008
    tail 0x21700170e815c63db48c1 0x42a00088462061e03
Free Block Chain:
  0x4: 0000  00 00 01 a6 80 0b 61 74 65 5f 54 79 70 65 20 3d  ┆      ate_Type =┆