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

⟦dbc74ebd1⟧ Ada Source

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

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 Lex;
with Object;
with Bloc;
with Bloc_Class;
with Value;
with Unparser;
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;

    procedure Unparse (N : in out Node) is
        Entexte : Object.Message;
    begin

        case N.Rule is
            when 0 =>
                Bloc.Unparse (N.Bl);
            when 1 =>

                Bounded_String.Copy (Entexte, "Entexte");
                Unparser.Put (Object.Send (N.Obj, Entexte));
            when 2 =>
                Unparser.Put (Bounded_String.Image (N.Ident));  
                Unparser.Put (" ");
            when 3 =>
                Unparser.Put ("(");
                Value.Unparse (N.Val);
                Unparser.Put (") ");
        end case;
    end Unparse;

    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=01c
        [0x01] rec0=16 rec1=00 rec2=03 rec3=022
        [0x02] rec0=1f rec1=00 rec2=04 rec3=044
        [0x03] rec0=16 rec1=00 rec2=05 rec3=000
        [0x04] rec0=15 rec1=00 rec2=05 rec3=000
    tail 0x21533c75885157f4b6142 0x42a00088462060003
Free Block Chain:
  0x2: 0000  00 00 00 04 80 01 20 01 20 20 20 20 20 20 20 20  ┆                ┆