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

⟦32c9421ec⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Primary, seg_036159, seg_036398, seg_036910

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 Scanner, Object, Value, Message, Block, Block_Class, Symbol,
     Bounded_String, Printer, String_Class, Integer_Class, Bug, Table;
package body Primary is

    type Node_Structure is
        record
            Rule : Natural range 0 .. 4 := 0;
            Iden : Message.Tiny_String;
            Obj : Object.Reference := Object.Void_Reference;
            Val : Value.Node := Value.Empty_Node;
            Line : Natural;
        end record;

    procedure Parse (N : in out Node) is
        A_Block : Block.Node := Block.Empty_Node;
        A_Object : Object.Reference := Object.Void_Reference;
        Current_Table : Table.Symbol_Kind;
        In_Table : Boolean := False;
        use Scanner;
    begin
        N := new Node_Structure;
        N.Line := Scanner.Get_Line_Number;
        case Scanner.Get_Token is
            when Scanner.T_Integer =>
                N.Rule := 0;  
                N.Obj := Scanner.Get_Value;
            when Scanner.T_Identifier =>
                N.Rule := 1;
                N.Iden := Scanner.Get_Value;  
                A_Object := Symbol.Eval (N.Iden);
--              verification de l'existance.
            when Scanner.T_Parenthese_Open =>
                N.Rule := 2;
                Scanner.Next;
                Value.Parse (N.Val);
                if Scanner.Get_Token /= Scanner.T_Parenthese_End then  
                    raise Bug.Missing_Right_Parentheses;
                end if;
            when Scanner.T_Block_Open =>
                N.Rule := 3;
                Block.Parse (A_Block);
                N.Obj := Block_Class.Create (A_Block);
            when Scanner.T_String =>
                N.Rule := 4;
                N.Iden := Scanner.Get_Value;
            when others =>
                raise Bug.Unexpected_Token;
        end case;
    end Parse;

    procedure Unparse (N : in Node) is  
        A_Block : Block.Node;
        Void_Object : Object.Reference;
        A_Tiny_String, A_Message : Message.Tiny_String;
    begin  
        Scanner.Set_Line_Number (N.Line);
        case N.Rule is
            when 0 =>
                Bounded_String.Copy (A_Message, "Image");
                Void_Object := Integer_Class.Send (N.Obj, A_Message);
                A_Tiny_String := String_Class.Get_String (Void_Object);
                Printer.Write (A_Tiny_String);
                String_Class.Remove (Void_Object);
            when 1 =>
                Printer.Write (N.Iden);
            when 2 =>
                Printer.Write ("(");
                Value.Unparse (N.Val);
                Printer.Write (")");
            when 3 =>
                Printer.Write ("{");
                Printer.Forward (4);
                A_Block := Block_Class.Search (N.Obj);
                Block.Unparse (A_Block);
                Printer.Backward (4);
                Printer.New_Line;
                Printer.Write_St ("}");
            when 4 =>
                Printer.Write_St ((' ', '"'));
                Printer.Write_St (N.Iden);
                Printer.Write (('"', ' '));
        end case;
    end Unparse;

    function Interpret (N : Node) return Object.Reference is
        Result : Object.Reference;
    begin  
        Scanner.Set_Line_Number (N.Line);
        case N.Rule is
            when 0 | 3 =>
                Result := N.Obj;  
            when 1 =>
                Result := Symbol.Eval (N.Iden);
            when 2 =>
                Result := Value.Interpret (N.Val);
            when 4 =>
                Result := String_Class.Create (N.Iden);
        end case;
        return Result;
    end Interpret;
end Primary;

E3 Meta Data

    nblk1=7
    nid=4
    hdr6=a
        [0x00] rec0=1c rec1=00 rec2=01 rec3=032
        [0x01] rec0=02 rec1=00 rec2=02 rec3=058
        [0x02] rec0=1b rec1=00 rec2=06 rec3=016
        [0x03] rec0=18 rec1=00 rec2=03 rec3=032
        [0x04] rec0=17 rec1=00 rec2=05 rec3=000
        [0x05] rec0=03 rec1=00 rec2=04 rec3=001
        [0x06] rec0=bc rec1=c4 rec2=00 rec3=020
    tail 0x21733075284dd8c050191 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 07 00 03 00 00 00 6e 64 20 50 72 69 6d 61 72  ┆       nd Primar┆
  0x7: 0000  00 00 00 06 80 03 42 6c 6f 03 00 00 00 00 00 00  ┆      Blo       ┆