DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦9b27a6fe9⟧ TextFile

    Length: 2534 (0x9e6)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Element_Size;
separate (Analyze_Generic)
procedure Length_Clause (For_Clause :        Representation_Clause;
                         Result     : in out Lines.Lines_Type) is

    type Data_Pointer is access Re.Data;

    function "=" (A, B : Ti.Type_Definition_Kinds) return Boolean
        renames Ti."=";

    function "=" (A, B : Ap.Element) return Boolean renames Ap."=";

    Reps_Type    : Ap.Element := Reps.Associated_Type (For_Clause);
    Rep_Spec     : Ap.Element;
    Size_Element : Ap.Element;
    Actual_Size  : Long_Integer;
    Reps_Size    : Long_Integer;
    Enum_Agg     : Ap.Element;
begin
    Result := Lines.Make;
    Lines.Add (Ap.Image (For_Clause), Result);
    case Ti.Kind (Reps_Type) is
        when Ti.A_Record_Type_Definition =>
            Size_Element := Reps.Associated_Size (Reps_Type);
            Reps_Size    := Ne.Static_Value (Size_Element);
            Rep_Spec     := Reps.Associated_Record_Representation (Reps_Type);

            if Rep_Spec = Ap.Nil_Element then
                Actual_Size := Element_Size (Reps_Type);
            else
                declare
                    List : Data_Pointer := new Re.Data'(Re.Make (Rep_Spec));
                    Last : Natural      := List.all'Last;
                begin
                    Sort_On_Position (List.all);
                    Actual_Size := Re.Word_Position (List (Last)) *
                                      Long_Integer (Word_Size) +
                                   Re.End_Bit (List (Last)) + 1;
                end;
            end if;

            if Reps_Size /= Actual_Size then
                Lines.Add
                   (Filler & "Size Mismatch; Type's size of " &
                    Su.Number_To_String (Actual_Size) &
                    " vs Rep's size of " & Su.Number_To_String (Reps_Size),
                    Result);

            end if;
        when Ti.An_Enumeration_Type_Definition =>
            Result := Lines.Make;
        when others =>

            Size_Element := Reps.Associated_Size (Reps_Type);
            Reps_Size    := Ne.Static_Value (Size_Element);
            Actual_Size  := Element_Size (Reps_Type);
            if Reps_Size /= Actual_Size then
                Lines.Add
                   (Filler & "Size Mismatch; Type's size of " &
                    Su.Number_To_String (Actual_Size) &
                    " vs Rep's size of " & Su.Number_To_String (Reps_Size),
                    Result);
            end if;
    end case;
    Lines.Add ("", Result);
end Length_Clause;