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

⟦56006e5f4⟧ Ada Source

    Length: 5120 (0x1400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Case_Analysis, seg_00461b

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



--| @SUMMARY Provides analysis of case statements including the kind
--| of discrete expression use in the case and values that are selected
--| on any arm of the case.
--| @INDICES (Ada_Analysis)
with Ada_Program;
with Discrete_Hole_Manager;
with Discrete_Value_Manager;
package Case_Analysis is

    type Case_Expression_Kind is (An_Enumeration, An_Integer);

    function Expression_Kind (For_Case_Statement : Ada_Program.Statement)
                             return Case_Expression_Kind;

    type Value_Iterator is private;

    --| @DESCRIPTION Computes the set of values selected by a case arm.
    --| This will also work for an others clause.
    function Values (For_Case_Arm : Ada_Program.Element) return Value_Iterator;

    procedure Reset (Iter : in out Value_Iterator);
    function  Done  (Iter : Value_Iterator) return Boolean;
    procedure Next  (Iter : in out Value_Iterator);

    --| @DESCRIPTION Returns the current integer value of the iterator
    --| @RAISES (Bad_Kind)
    function Integer_Value (Iter : Value_Iterator) return Long_Integer;

    --| @DESCRIPTION Returns the current enumeration value of the iterator
    --| @RAISES (Bad_Kind)
    function Enumeration_Literal
                (Iter : Value_Iterator) return Ada_Program.Element;

    --| @DESCRIPTION Provided to process ranges of values instead of each
    --| specific value.  This is most useful when processing integer case
    --| statements
    procedure Value_Range (Iter : Value_Iterator; Low, High : out Long_Integer);
    procedure Next_Range  (Iter : in out Value_Iterator);

    --| @DESCRIPTION Raised when the user requests an integer value from a
    --| case statement that is an enumeration kind and vice-versa.
    Bad_Kind : exception;

private
    type Value_Iterator is
        record
            Kind            : Case_Expression_Kind;
            Ground_Type_Def : Ada_Program.Type_Definition;

            Arm : Ada_Program.Element;

            Holes  : Discrete_Hole_Manager.Hole_List;
            Values : Discrete_Value_Manager.Value_List;

            Is_Others_Iterator : Boolean;

            Current_Lower : Long_Integer;
            Current_Upper : Long_Integer;

            Current_Value : Long_Integer;

            Is_Done : Boolean;
        end record;
end Case_Analysis;

E3 Meta Data

    nblk1=4
    nid=0
    hdr6=8
        [0x00] rec0=1a rec1=00 rec2=01 rec3=084
        [0x01] rec0=00 rec1=00 rec2=04 rec3=006
        [0x02] rec0=19 rec1=00 rec2=02 rec3=02e
        [0x03] rec0=0f rec1=00 rec2=03 rec3=001
    tail 0x2150042d2815c65c375e5 0x42a00088462061e03