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 - download
Index: ┃ B T

⟦22c87b5d8⟧ TextFile

    Length: 2981 (0xba5)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Ada_Program;
with Compilation_Units;  
with Declarations;
with Representation_Clauses;
with Text_Io;
with Type_Information;
package body Analyzer is

    package Ap renames Ada_Program;
    package Apc renames Ada_Program.Conversion;
    package Cu renames Compilation_Units;
    package D renames Declarations;
    package Rc renames Representation_Clauses;
    package Ti renames Type_Information;


    procedure Enums (Elt : Ap.Element;
                     State : in out Boolean;
                     Control : in out Ap.Traversal_Control) is
        use Ap, D, Ti;
    begin  
        if Ap.Kind (Elt) = Ap.A_Declaration then
            if D.Kind (Elt) = D.A_Type_Declaration then

                if Ti.Kind (D.Type_Specification (Elt)) =
                   Ti.An_Enumeration_Type_Definition then
                    Text_Io.Put_Line (Ap.Image (Elt));
                end if;

            end if;
        end if;

        State := True;
        Control := Ap.Continue;
    end Enums;

    procedure Representations (Elt : Ap.Element;
                               State : in out Boolean;
                               Control : in out Ap.Traversal_Control) is
        use Ap, D, Rc, Ti;
        E : Ap.Element;
    begin
        if Ap.Kind (Elt) = Ap.A_Representation_Clause then
            if Rc.Kind (Elt) = Rc.An_Enumeration_Representation_Clause then
                E := Rc.Associated_Type (Elt);
                Text_Io.Put_Line (Ap.Image (E));
            end if;
        end if;


    end Representations;



    procedure Nothing (Elt : Ap.Element;
                       State : in out Boolean;
                       Control : in out Ap.Traversal_Control) is
    begin
        null;
    end Nothing;



    procedure Locate_Enumeration_Types (Units : String := "<Image>") is
        Elt : Ap.Element := Cu.Parent_Compilation_Unit (Apc.Resolve (Units));

        procedure Traverse is new Ap.Depth_First_Traversal
                                     (State_Record => Boolean,
                                      Pre_Operation => Enums,
                                      Post_Operation => Nothing);

        State : Boolean;
    begin  
        Traverse (Root_Element => Elt,
                  State => State,
                  Major_Elements_Only => True);
    end Locate_Enumeration_Types;

    procedure Locate_Enumeration_Representations
                 (Units : String := "<Images>") is
        Elt : Ap.Element := Cu.Parent_Compilation_Unit (Apc.Resolve (Units));

        procedure Traverse is new Ap.Depth_First_Traversal
                                     (State_Record => Boolean,
                                      Pre_Operation => Representations,
                                      Post_Operation => Nothing);

        State : Boolean;
    begin
        Traverse (Root_Element => Elt,
                  State => State,
                  Major_Elements_Only => True);
    end Locate_Enumeration_Representations;


end Analyzer;