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

⟦d6f27061f⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package String_Map_Generic, seg_05238c

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



generic
    Size : Integer;

    type Range_Type is private;
    -- Range_Type is a pure value
    -- no initialization or finalization of values of range_type is
    -- necessary
    -- = and := can be used for equality and copy

    Ignore_Case : Boolean := True;
    --[removed for vads] pragma Must_Be_Constrained (Yes => Range_Type);

package String_Map_Generic is

    type Map is private;

    function Eval (The_Map : Map; D : String) return Range_Type;

    procedure Find (The_Map :        Map;
                    D       :        String;
                    R       : in out Range_Type;
                    Success : out    Boolean);

    procedure Define   (The_Map        : in out Map;
                        D              :        String;
                        R              :        Range_Type;
                        Trap_Multiples :        Boolean := False);
    procedure Undefine (The_Map : in out Map; D : String);

    procedure Initialize (The_Map : out Map);
    function  Is_Empty   (The_Map : Map) return Boolean;
    procedure Make_Empty (The_Map : in out Map);

    procedure Copy (Target : in out Map; Source : Map);

    type Iterator is private;

    procedure Init  (Iter : out Iterator; The_Map : Map);
    procedure Next  (Iter : in out Iterator);
    function  Value (Iter : Iterator) return String;
    function  Done  (Iter : Iterator) return Boolean;

    Undefined : exception;
    -- raised by eval if the domain value in not in the map

    Multiply_Defined : exception;
    -- raised by define if the domain value is already defined and
    -- the trap_multiples flag has been specified (ie. is true)

    function Nil                    return Map;
    function Is_Nil (The_Map : Map) return Boolean;

    function Cardinality (The_Map : Map) return Natural;

    ------------------------------------------------------
    -- Implementation Notes and Non-Standard Operations --
    ------------------------------------------------------

    -- := and = operate on references
    --   := implies sharing (introduces an alias)
    --   = means is the same set, not the same value of type set
    -- Initializing a map also makes it empty
    -- Accessing an uninitialized map will raise CONSTRAINT_ERROR.

    -- garbage may be generated

private

    subtype Index is Natural range 0 .. Size - 1;

    type Node (Size : Natural);
    type Set is access Node;

    type Table is array (Index) of Set;

    type Map_Data is
        record
            Bucket : Table;
            Size   : Integer := 0;
        end record;

    type Map is access Map_Data;

    type Iterator is
        record
            The_Map     : Map;
            Index_Value : Index;
            Set_Iter    : Set;
            Done        : Boolean;
        end record;

    type Node (Size : Natural) is
        record
            Link  : Set;
            Value : Range_Type;
            Name  : String (1 .. Size);
        end record;

end String_Map_Generic;

E3 Meta Data

    nblk1=6
    nid=4
    hdr6=a
        [0x00] rec0=1f rec1=00 rec2=01 rec3=00e
        [0x01] rec0=00 rec1=00 rec2=06 rec3=046
        [0x02] rec0=1b rec1=00 rec2=02 rec3=02a
        [0x03] rec0=26 rec1=00 rec2=05 rec3=030
        [0x04] rec0=05 rec1=00 rec2=03 rec3=000
        [0x05] rec0=04 rec1=00 rec2=04 rec3=000
    tail 0x21759b00687a069b767a8 0x42a00088462063203
Free Block Chain:
  0x4: 0000  00 00 00 4f 80 16 20 3a 20 53 74 72 69 6e 67 20  ┆   O   : String ┆