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

⟦bf12cb3b7⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Test_Case_Analysis, seg_00460b

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 Io;
with Case_Analysis;
with Lrm_Renames;
use Lrm_Renames;
procedure Test_Case_Analysis (Units : String := "") is

    B : Boolean := True;

    Ada_Units : Ada.Element_List := Ada.Conversion.Resolve (Units);

    procedure Pre_Op (Program_Element :        Ada.Element;
                      Is_When_Others  : in out Boolean;
                      Control         : in out Ada.Traversal_Control) is
        Arms : Ada.Element_Iterator;  
        Arm  : Ada.Element;
    begin
        case Stmts.Kind (Program_Element) is
            when Stmts.A_Case_Statement =>
                Arms := Stmts.Case_Arms_List (Program_Element);
                while not Ada.Done (Arms) loop
                    Arm            := Ada.Value (Arms);
                    Is_When_Others := Stmts.Is_When_Others (Arm);
                    declare
                        Vals : Case_Analysis.Value_Iterator :=
                           Case_Analysis.Values (Arm);
                    begin
                        Io.Put_Line (Ada.Image (Arm));
                        while not Case_Analysis.Done (Vals) loop
                            case Case_Analysis.Expression_Kind
                                    (Program_Element) is
                                when Case_Analysis.An_Enumeration =>
                                    Io.Put
                                       (Ada.Image
                                           (Case_Analysis.Enumeration_Literal
                                               (Vals)) & ", ");
                                when Case_Analysis.An_Integer =>
                                    Io.Put (Long_Integer'Image
                                               (Case_Analysis.Integer_Value
                                                   (Vals)) & ", ");

                            end case;
                            Case_Analysis.Next (Vals);
                        end loop;
                        Case_Analysis.Reset (Vals);
                        while not Case_Analysis.Done (Vals) loop
                            case Case_Analysis.Expression_Kind
                                    (Program_Element) is
                                when Case_Analysis.An_Enumeration =>
                                    Io.Put
                                       (Ada.Image
                                           (Case_Analysis.Enumeration_Literal
                                               (Vals)) & ", ");
                                when Case_Analysis.An_Integer =>
                                    Io.Put (Long_Integer'Image
                                               (Case_Analysis.Integer_Value
                                                   (Vals)) & ", ");

                            end case;
                            Case_Analysis.Next (Vals);
                        end loop;
                        Io.New_Line;
                    end;
                    Ada.Next (Arms);
                end loop;
            when others =>
                null;
        end case;
        Control := Ada.Continue;
    end Pre_Op;

    procedure Post_Op (Program_Element :        Ada.Element;
                       State           : in out Boolean;
                       Control         : in out Ada.Traversal_Control) is
    begin
        Control := Ada.Continue;
    end Post_Op;

    procedure Traverse is new Ada.Depth_First_Traversal
                                 (Boolean, Pre_Op, Post_Op);

begin
    while not Ada.Done (Ada_Units) loop
        Traverse (Root_Element        =>
                     Comp_Units.Parent_Compilation_Unit (Ada.Value (Ada_Units)),
                  State               => B,
                  Major_Elements_Only => True);
        Ada.Next (Ada_Units);
    end loop;
end Test_Case_Analysis;

E3 Meta Data

    nblk1=5
    nid=0
    hdr6=a
        [0x00] rec0=1b rec1=00 rec2=01 rec3=020
        [0x01] rec0=00 rec1=00 rec2=05 rec3=012
        [0x02] rec0=12 rec1=00 rec2=02 rec3=04e
        [0x03] rec0=13 rec1=00 rec2=03 rec3=01e
        [0x04] rec0=1b rec1=00 rec2=04 rec3=000
    tail 0x215004178815c65a41140 0x42a00088462061e03