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

⟦27757e349⟧ Ada Source

    Length: 13312 (0x3400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Values, seg_045bec

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



------------------------------------------------------------------------
-- <UNIT>        Values
------------------------------------------------------------------------
--
-- <DESCRIPTION>  Allow dynamic creation of data type Natural, Boolean or string
--
--            !!!!Danger : Dynamic object must be initialized with New_Value
--                         Dynamic object must be de-allocated after usage with Dispose
--
-- <AUTHOR>       Barthe Raphael, Beck Didier, Kempe Laurent
-- <VERSION>      1.0
-- <DATE>         24-jan-95
-- <MODIFY>       24-jan-95
--
-- <PKG USED>     Bounded_String,Text_io.
------------------------------------------------------------------------

with Bounded_String, Text_Io, Struct_Component, String_Table;

package Values is

    subtype My_String is Bounded_String.Variable_String (128);

-- exception

    No_Natural_Value : exception;
    No_Boolean_Value : exception;
    No_String_Value : exception;

    type Kind_Of_Values is (Undef, Bool, Int, Enum,
                            Chaine, Ref2struct, Ref2att);


-- use of limited type in order to forbid the egal operation
-- we have to redefine a fonction to copy two elements

    type Value (Kind : Kind_Of_Values := Undef) is
        record
            case Kind is
                when Undef =>
                    null;
                when Int =>
                    The_Natural : Natural;  
                when Bool =>
                    The_Boolean : Boolean;
                when Chaine =>
                    The_String : My_String;  
                when Enum =>
                    Enum_String : My_String;
                when Ref2struct =>
                    The_Refs : Struct_Component.Liste_Structure.Listiter;  
                when Ref2att =>
                    The_Refa : Struct_Component.Liste_Attribut.Listiter;
            end case;
        end record;

    subtype My_List is String_Table.Int_List.List;

    type Box is
        record
            The_Type : Kind_Of_Values := Undef;
            Id : My_String;
            Val : Value;
            Acc : My_List := String_Table.Int_List.Create;
        end record;

-- creation

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        New_Value
--
-- <DESCRIPTION> create an undefine value
--
-- <PARAMETERS>  V (Value) : for creating an undefine object
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------

    procedure New_Value (V : out Value);

-- access

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Kind_Of
--
-- <DESCRIPTION> return the type of the value
--
-- <PARAMETERS>  V (Value)
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------

    function Kind_Of (V : in Value) return Kind_Of_Values;

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Value_As
--
-- <DESCRIPTION> return the value of the data (for natural)
--
-- <PARAMETERS>   V (Value)
--
-- <EXCEPTIONS>  No_Natural_Value
--
--------------------------------------------------------------------------------

    function Value_As (V : in Value) return Natural;

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Value_As
--
-- <DESCRIPTION> return the value of the data (for boolean)
--
-- <PARAMETERS>   V (Value)
--
-- <EXCEPTIONS>  No_Boolean_Value
--
--------------------------------------------------------------------------------

    function Value_As (V : in Value) return Boolean;

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Value_As
--
-- <DESCRIPTION> return the value of the data (for string)
--
-- <PARAMETERS>   V (Value)
--
-- <EXCEPTIONS>  No_String_Value
--
--------------------------------------------------------------------------------

    function Value_As (V : in Value) return String;  
    function Value_As (V : in Value)
                      return Struct_Component.Liste_Structure.Listiter;
    function Value_As (V : in Value)
                      return Struct_Component.Liste_Attribut.Listiter;

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Equal
--
-- <DESCRIPTION> test between two values; return a boolean
--
-- <PARAMETERS>   V1 (Value), V2 (Value) : make a comparaison between V1 and V2
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------

    function Equal (V1 : in Value; V2 : in Value) return Boolean;

---------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Image
--
-- <DESCRIPTION> Give the string of a value
--
-- <PARAMETERS>  V (Value)
--
-- <EXCEPTIONS>  No

    function Image (V : in Value) return String;

    procedure Image (L : in My_List);

    procedure Image (B : in Box);

-- modification

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Undefine
--
-- <DESCRIPTION> deallocation and creation of a new undefine object
--
-- <PARAMETERS>   V (Value)
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------

    procedure Undefine (V : in out Value);

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Set_To
--
-- <DESCRIPTION> initialize a value
--
-- <PARAMETERS>  V (Value), B (Boolean) : change V in a natural I
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------

    procedure Set_To (V : in out Value; I : in Natural);

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Set_To
--
-- <DESCRIPTION> initialize a value
--
-- <PARAMETERS>  V (Value), B (Boolean) : change V in a boolean B
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------

    procedure Set_To (V : in out Value; B : in Boolean);

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Set_To
--
-- <DESCRIPTION> initialize a value
--
-- <PARAMETERS>  V (Value), S (String) : change V in a string S
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------

    procedure Set_To (V : in out Value; S : in String);
    procedure Set_To (V : in out Value;
                      I : in Struct_Component.Liste_Structure.Listiter);

    procedure Set_To (V : in out Value;
                      I : in Struct_Component.Liste_Attribut.Listiter);


    procedure Set_Id (B : in out Box; S : in String);

    procedure Set_Type (B : in out Box; E : in Kind_Of_Values);

    procedure Set_Acc (B : in out Box; L : in My_List);

    procedure Set_Val (B : in out Box; S : in String);

    procedure Set_Val (B : in out Box; Bo : in Boolean);

    procedure Set_Val (B : in out Box; I : in Natural);

    procedure Set_Val (B : in out Box;
                       Its : in Struct_Component.Liste_Structure.Listiter);

    procedure Set_Val (B : in out Box;
                       It : in Struct_Component.Liste_Attribut.Listiter);

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Copy
--
-- <DESCRIPTION> copy between two values; usefull because we haven't "=" !
--
-- <PARAMETERS>  To_Value (Value), The_Value (Value) : copy The_Value in To_Value
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------

--    procedure Copy (To_Value : in out Value; The_Value : in Value);

-- liberation

--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Dispose
--
-- <DESCRIPTION> liberate the memory which was allocated
--
-- <PARAMETERS>   V (Value)
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------

    procedure Dispose (V : in out Value);


-- definition of the abstract data type

end Values;

E3 Meta Data

    nblk1=c
    nid=a
    hdr6=12
        [0x00] rec0=1f rec1=00 rec2=01 rec3=016
        [0x01] rec0=1b rec1=00 rec2=0b rec3=056
        [0x02] rec0=26 rec1=00 rec2=02 rec3=03e
        [0x03] rec0=20 rec1=00 rec2=04 rec3=070
        [0x04] rec0=1e rec1=00 rec2=03 rec3=034
        [0x05] rec0=26 rec1=00 rec2=09 rec3=028
        [0x06] rec0=22 rec1=00 rec2=08 rec3=046
        [0x07] rec0=1c rec1=00 rec2=06 rec3=068
        [0x08] rec0=22 rec1=00 rec2=07 rec3=000
        [0x09] rec0=06 rec1=00 rec2=05 rec3=001
        [0x0a] rec0=db rec1=92 rec2=60 rec3=000
        [0x0b] rec0=9d rec1=00 rec2=00 rec3=000
    tail 0x21747c934864c5169af60 0x42a00088462060003
Free Block Chain:
  0xa: 0000  00 05 00 04 80 01 69 01 02 03 04 05 06 07 08 09  ┆      i         ┆
  0x5: 0000  00 0c 00 04 80 01 73 01 02 2d 2d 2d 2d 2d 2d 2d  ┆      s  -------┆
  0xc: 0000  00 00 00 06 80 03 2d 2d 2d 03 00 00 00 00 00 6c  ┆      ---      l┆