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

⟦0a84defc0⟧ Ada Source

    Length: 9216 (0x2400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Field, seg_044f7f

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



with Text_Io, Field_Identifier_Array, Enumeration_Array;
package body Field is

--    procedure create_number(item : out object;name : in string) is

--    begin
--      item := (kind =>number,number_name=>identifier.from_string(name),number_value=>0);
--    end;

--    procedure create_sentence(item : out object;name: in string) is

--    begin
--    item := (kind =>sentence,sentence_name=>identifier.from_string(name),sentence_value=>identifier.null_object);
    --   end;

--    procedure create_enumerate(item : out object;name: in string) is

--    begin
--      item:=(kind=>enumerate,enumerate_name=>identifier.from_string(name),enumeration=>0,literal=>0);
--    end;

    procedure Create_Number (Item : out Object; Index : in Positive) is

    begin
        Item := (Kind => Number, Number_Index => Index, Number_Value => 0);
    end Create_Number;

    procedure Create_Sentence (Item : out Object; Index : in Positive) is

    begin
        Item := (Kind => Sentence,
                 Sentence_Index => Index,
                 Sentence_Value => Identifier.Null_Object);  
    end Create_Sentence;

    procedure Create_Enumerate (Item : out Object; Index : in Positive) is

    begin
        Item := (Kind => Enumerate,
                 Enumerate_Index => Index,
                 Enumeration => 0,
                 Literal => 0);
    end Create_Enumerate;

    procedure Put_Number (Item : in out Object;
                          A_Number : in Integer;
                          Ok : out Boolean) is

    begin
        if Item.Kind = Number then
            Item.Number_Value := A_Number;
            Ok := True;
        else
            Ok := False;
        end if;
    end Put_Number;

    procedure Put_Sentence (Item : in out Object;
                            A_Sentence : in Identifier.Object;
                            Ok : out Boolean) is

    begin
        if Item.Kind = Sentence then
            Item.Sentence_Value := A_Sentence;
            Ok := True;
        else
            Ok := False;
        end if;
    end Put_Sentence;

    procedure Put_Enumerate (Item : in out Object;
                             Enumeration, Literal : in Positive;
                             Ok : out Boolean) is

    begin
        if Item.Kind = Enumerate then
            Item.Enumeration := Enumeration;
            Item.Literal := Literal;
            Ok := True;
        else
            Ok := False;
        end if;
    end Put_Enumerate;

    procedure Show (Item : in Object) is

    begin
        Text_Io.Put_Line ("Field : Kind : " & Field_Kind'Image (Item.Kind) &
                          " Name : " & Name (Item) &
                          " Value : " & Image (Item));
    end Show;


    function Index (Item : in Object) return Natural is

    begin
        case Item.Kind is
            when Number =>
                return Item.Number_Index;
            when Sentence =>
                return Item.Sentence_Index;
            when Enumerate =>
                return Item.Enumerate_Index;
            when Unknown =>
                return 0;
        end case;
    end Index;

    function Name (Item : in Object) return String is

    begin
        return Field_Identifier_Array.Image (Index (Item));
    end Name;

    function Is_A_Number (Item : in Object) return Boolean is

    begin
        return Item.Kind = Number;
    end Is_A_Number;

    function Is_A_Sentence (Item : in Object) return Boolean is

    begin
        return Item.Kind = Sentence;
    end Is_A_Sentence;

    function Is_An_Enumerate (Item : in Object) return Boolean is

    begin
        return Item.Kind = Enumerate;
    end Is_An_Enumerate;

    function Image (Item : in Object) return String is

    begin
        case Item.Kind is
            when Number =>
                return Integer'Image (Number (Item));
            when Sentence =>
                return Sentence (Item);
            when Enumerate =>
                return Enumeration_Array.Literal_Image
                          (Enumeration (Item), Literal (Item));
            when Unknown =>
                return "";
        end case;
    end Image;

    function Number (Item : in Object) return Integer is

    begin
        if Item.Kind = Number then
            return Item.Number_Value;
        else
            return 0;
        end if;
    end Number;

    function Sentence (Item : in Object) return String is

    begin
        if Item.Kind = Sentence then
            return Identifier.Image (Item.Sentence_Value);
        else
            return "";
        end if;
    end Sentence;

    function Enumeration (Item : in Object) return Natural is

    begin
        if Item.Kind = Enumerate then
            return Item.Enumeration;
        else
            return 0;
        end if;

    end Enumeration;
    function Literal (Item : in Object) return Natural is

    begin
        if Item.Kind = Enumerate then
            return Item.Literal;
        else
            return 0;
        end if;
    end Literal;

end Field;

E3 Meta Data

    nblk1=8
    nid=8
    hdr6=c
        [0x00] rec0=20 rec1=00 rec2=01 rec3=00e
        [0x01] rec0=20 rec1=00 rec2=05 rec3=03e
        [0x02] rec0=24 rec1=00 rec2=04 rec3=00e
        [0x03] rec0=27 rec1=00 rec2=06 rec3=004
        [0x04] rec0=23 rec1=00 rec2=07 rec3=040
        [0x05] rec0=11 rec1=00 rec2=03 rec3=000
        [0x06] rec0=12 rec1=00 rec2=08 rec3=000
        [0x07] rec0=0e rec1=00 rec2=08 rec3=000
    tail 0x21746529a86493af7b758 0x42a00088462060003
Free Block Chain:
  0x8: 0000  00 02 03 fc 80 1b 20 49 74 65 6d 20 3a 3d 20 28  ┆       Item := (┆
  0x2: 0000  00 00 00 2c 00 29 20 20 20 20 20 20 20 20 20 20  ┆   , )          ┆