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

⟦07420d4f5⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Primary, seg_0367a4

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



with Bounded_String;  
with Error_Broadcaster;
with Text_Io;
with Lex;
with Object;
with Bloc;
with Bloc_Class;
with Value;
package body Primary is
    type Node_Structure is
        record
            Rule : Natural range 0 .. 3 := 0;
            Ident : Object.Message;
            Bl : Bloc.Node := Bloc.Empty_Node;
            Val : Value.Node := Value.Empty_Node;
            Obj : Object.Reference := Object.Void_Reference;
        end record;

    procedure Parse (N : in out Node; Error : out Boolean) is
        Failed : Boolean := False;
    begin
        N := new Node_Structure;  
        case Lex.Get_Token is
            when Lex.Open_Bracket =>  
                N.Rule := 0;
                N.Obj := Object.Create (Lex.Get_Token, Lex.Get_Value);
                Bloc.Parse (N.Bl, Failed);
            when Lex.Integer =>  
                N.Rule := 1;
                N.Obj := Object.Create (Lex.Get_Token, Lex.Get_Value);
                Lex.Next_Token;  
            when Lex.Tiny_String =>
                N.Rule := 1;
                N.Obj := Object.Create (Lex.Get_Token, Lex.Get_Value);
                Lex.Next_Token;
            when Lex.Identifier =>
                N.Rule := 2;
                Bounded_String.Copy (N.Ident, Lex.Get_Value);  
                Lex.Next_Token;
            when Lex.Open_Parenthesis =>  
                N.Rule := 3;
                Lex.Next_Token;
                Value.Parse (N.Val, Failed);
                if Lex.Token'Pos (Lex.Get_Token) =
                   Lex.Token'Pos (Lex.Close_Parenthesis) then
                    Lex.Next_Token;
                else
                    raise Error_Broadcaster.Parenthesis_Is_Missing;
                end if;
            when Lex.Avec | Lex.Binary_Message | Lex.Key_Word |
                 Lex.L_End | Lex.Ok | Lex.Pour | Lex.Prendre |
                 Lex.Renvoyer | Lex.Special | Lex.Close_Parenthesis |
                 Lex.Unknown | Lex.Dot | Lex.Close_Bracket =>
                raise Error_Broadcaster.Unexpected_Token;
        end case;  
        Error := Failed;  
    end Parse;

    function Is_First (T : Lex.Token) return Boolean is
        use Lex;
    begin
        return T = Lex.Integer or else T = Lex.Tiny_String or else
                  T = Lex.Identifier or else
                  T = Lex.Open_Parenthesis or else Bloc.Is_First (T);
    end Is_First;

    function Interpret (N : Node;
                        Inherited : Object.Reference := Object.Void_Reference)
                       return Object.Reference is
        Result : Object.Reference;
    begin
        case N.Rule is
            when 0 =>
                Result := N.Obj;
            when 1 =>
                Result := N.Obj;
            when 2 =>
                Result := Bloc_Class.Get (N.Ident);
            when 3 =>
                Result := Value.Interpret (N.Val, Result);
        end case;
        return Result;
    end Interpret;
end Primary;

E3 Meta Data

    nblk1=5
    nid=2
    hdr6=8
        [0x00] rec0=20 rec1=00 rec2=01 rec3=01e
        [0x01] rec0=16 rec1=00 rec2=05 rec3=024
        [0x02] rec0=1c rec1=00 rec2=04 rec3=020
        [0x03] rec0=04 rec1=00 rec2=03 rec3=000
        [0x04] rec0=80 rec1=00 rec2=00 rec3=100
    tail 0x2152ff73a84df5ce88b89 0x42a00088462060003
Free Block Chain:
  0x2: 0000  00 00 00 08 80 02 79 3b 02 00 00 00 00 00 00 80  ┆      y;        ┆