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

⟦da4dbc95c⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Find_Visible_Types, seg_00441d

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 Lrm_Utilities;
with Log;
with Profile;
with Common;
with More_String_Utilities;
with Add_Hyper_Table;
with Create_Null_Document;
with Lrm_Renames;
use Lrm_Renames;
with Directory_Renames;
use Directory_Renames;
with Errors;
with Simple_Status;
package body Find_Visible_Types is


    procedure Add (Units       :        String := "";
                   To_Document : in out Abstract_Document.Handle;
                   Response    :        String := "<PROFILE>") is

        Units_Iter : Object.Iterator := Naming.Resolution (Units);

        type Columns is (Parent_Package, Type_Decl, Kind, References);

        Type_Kind : Types.Type_Definition_Kinds;
        Parent_Id : Ada.Element;
        Decl_Refs : Ada.Element_List;

        function Is_Integer_Column (C : Columns) return Boolean is
        begin
            return False;
        end Is_Integer_Column;

        function Is_Included (Elem : Ada.Element) return Boolean is
        begin
            case Decls.Kind (Elem) is
                when Decls.A_Type_Declaration =>
                    if Decls.Is_Visible (Elem) and then
                       Lrm_Utilities.Is_Actual_Declaration (Elem) then
                        Type_Kind := Types.Kind
                                        (Decls.Type_Specification (Elem));
                        case Type_Kind is
                            when Types.A_Private_Type_Definition |
                                 Types.A_Limited_Private_Type_Definition =>
                                return False;
                            when others =>
                                Parent_Id := Lrm_Utilities.Comp_Unit_Id (Elem);
                                Decl_Refs := Ada.Usage (Elem);
                                return True;
                        end case;
                    else
                        return False;
                    end if;
                when others =>
                    return False;
            end case;
        end Is_Included;

        function Column_Image (C : Columns; Elem : Ada.Element) return String is
        begin
            case C is
                when Parent_Package =>
                    return Decls.Name (Parent_Id);
                when Type_Decl =>
                    return Decls.Name (Elem);
                when Kind =>
                    return More_String_Utilities.Replaced
                              (Types.Type_Definition_Kinds'Image (Type_Kind));
                when References =>
                    return Integer'Image (Lrm_Utilities.Count (Decl_Refs));
            end case;
        end Column_Image;

        function Explanation (C : Columns; Elem : Ada.Element) return String is
        begin
            case C is
                when Parent_Package =>
                    return "Parent unit contatining the type declartion";
                when Type_Decl =>
                    return "Name of the visible type declaration";
                when Kind =>
                    return "Kind of the type declaration";
                when References =>
                    return "Number of references to the type declaration";
            end case;

        end Explanation;

        procedure Linkage (C                :     Columns;
                           Elem             :     Ada.Element;
                           Linkage_Element  : out Ada.Element;
                           Linkage_Elements : out Ada.Element_List) is
        begin
            -- default values changed within the case statement as necessary
            Linkage_Element  := Ada.Nil_Element;
            Linkage_Elements := Ada.Nil_List;

            case C is
                when Parent_Package =>
                    Linkage_Element := Parent_Id;
                when Type_Decl =>
                    Linkage_Element := Elem;
                when Kind =>
                   Linkage_Element := Elem;
                when References =>
                    Linkage_Elements := Decl_Refs;
            end case;

        end Linkage;

        procedure Add_Hyper_Table_To_Doc is
           new Add_Hyper_Table
                  (Is_Included,  
                   Columns,  
                   Is_Integer_Column,  
                   Column_Image,  
                   Explanation,  
                   Linkage,  
                   Table_Title =>
                      "Non-private type declarations in the visible part of packages");
    begin
        if Object.Is_Bad (Units_Iter) then
            Log.Put_Line (Units & " is not a valid pathname",
                          Profile.Error_Msg);
        else
            Add_Hyper_Table_To_Doc (Units_Iter, To_Document, Response);
        end if;
    end Add;

    procedure Display (Units             : String := "";
                       To_Preview_Object : String := "visible_type_info";
                       Response          : String := "<PROFILE>") is
        Document  : Abstract_Document.Handle;
        Condition : Errors.Condition;
    begin

        Create_Null_Document (Named           => To_Preview_Object,
                              Error_Info      => Condition,
                              Document_Handle => Document);

        case Errors.Severity (Condition) is
            when Simple_Status.Problem | Simple_Status.Fatal =>
                Log.Put_Line ("Problem creating object " & To_Preview_Object &
                              ".  " & Errors.Info (Condition),
                              Profile.Error_Msg);
            when others =>

                Add (Units, Document, Response);

                Abstract_Document.Close (Document);

                Common.Definition (To_Preview_Object);

        end case;
    end Display;
end Find_Visible_Types;

E3 Meta Data

    nblk1=7
    nid=0
    hdr6=e
        [0x00] rec0=24 rec1=00 rec2=01 rec3=00a
        [0x01] rec0=14 rec1=00 rec2=02 rec3=01a
        [0x02] rec0=19 rec1=00 rec2=03 rec3=02c
        [0x03] rec0=18 rec1=00 rec2=04 rec3=01e
        [0x04] rec0=00 rec1=00 rec2=07 rec3=002
        [0x05] rec0=1b rec1=00 rec2=05 rec3=08c
        [0x06] rec0=1a rec1=00 rec2=06 rec3=000
    tail 0x21500357c815c63c16698 0x42a00088462061e03