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

⟦85d36d672⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Block, seg_034a45

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 Statements, Arguments;
with Class_Block;  
with Bug_Report;

package body Block is

    type Node_Structure is
        record
            Table : Symbols.Table := Symbols.Create;
            Kwd : Message.Unary;
            Ident : Message.Unary;
            Stat : Statements.Node := Statements.Empty_Node;
            Parent : Block.Node := Block.Empty_Node;
        end record;

    Current_Node : Block.Node;

    Ghost : Object.Reference;

    function Get_Ident (N : Node) return Message.Unary is
    begin
        return N.Ident;
    end Get_Ident;

    function Get_Kwd (N : Node) return Message.Unary is
    begin
        return N.Kwd;
    end Get_Kwd;

    function Get_Table (N : Node) return Symbols.Table is
    begin
        return N.Table;
    end Get_Table;

    procedure Put_Table (This_Object : Object.Reference;
                         Named : Object.Tiny_String;
                         Into : in out Node) is
    begin
        Symbols.Put (This_Object, Named, Into.Table);
    end Put_Table;

    procedure Get_From_Table (Object_Named : Object.Tiny_String;
                              From_Block : Node;
                              Into : in out Object.Reference;
                              Status : out Boolean) is
        Block_Node : Node := From_Block;
        Success : Boolean := False;
    begin
        while not Success and then Block_Node /= Empty_Node loop
            Symbols.Get (Object_Named => Object_Named,
                         From_Table => Block_Node.Table,
                         Into => Into,
                         Status => Success);

            if not Success then
                Block_Node := Block_Node.Parent;
            end if;
        end loop;
        Status := Success;
    end Get_From_Table;

    procedure Put_Into_Table (This_Object : Object.Reference;
                              Named : Object.Tiny_String;
                              Into_Block : in out Node) is
        Block_Node : Node := Into_Block;
        Success : Boolean := False;
        Result : Object.Reference;
    begin
        while not Success and then Block_Node /= Empty_Node loop
            Symbols.Get (Object_Named => Named,
                         From_Table => Block_Node.Table,
                         Into => Result,
                         Status => Success);

            if not Success then
                Block_Node := Block_Node.Parent;
            end if;
        end loop;
        if Block_Node = Empty_Node and Block_Node /= Into_Block then
            Symbols.Put (This_Object, Named, Into_Block.Table);
        else  
            Symbols.Put (This_Object, Named, Block_Node.Table);
        end if;
    end Put_Into_Table;

    function Get_Current_Node return Node is
    begin
        return Current_Node;
    end Get_Current_Node;

    function Get_Current_Table return Symbols.Table is
    begin
        return Current_Node.Table;
    end Get_Current_Table;

    procedure Put_Current_Table (This_Object : Object.Reference;
                                 Named : Object.Tiny_String) is
    begin
        Symbols.Put (This_Object, Named, Current_Node.Table);
    end Put_Current_Table;

    function Get_Parent (N : Node) return Node is
    begin
        return N.Parent;
    end Get_Parent;

    function Is_Nil (N : Node) return Boolean is
    begin
        return N = Empty_Node;
    end Is_Nil;

    procedure Parse (N : in out Node) is
        use Scanner;
    begin  
        N := new Node_Structure;
        N.Parent := Current_Node;
        Current_Node := N;
        if Scanner.Get_Token = Scanner.Open_Brace then
            Scanner.Next;  
            Arguments.Parse (N.Ident, N.Kwd);
            Statements.Parse (N.Stat);
            if Scanner.Get_Token = Scanner.Close_Brace then
                Scanner.Next;
            else
                raise Bug_Report.Brace_Is_Missing;
            end if;
            Current_Node := N.Parent;  
        else
            raise Bug_Report.Unexpected_Token;
        end if;
    end Parse;

    function Is_First (T : Scanner.Token) return Boolean is
        use Scanner;
    begin
        return T = Open_Brace;
    end Is_First;

    function Interpret (N : Node) return Object.Reference is
        Result : Object.Reference := Object.Void_Reference;
        Node : Block.Node := Block.Current_Node;
    begin  
        Current_Node := N;
        Result := Statements.Interpret (N.Stat);
        Current_Node := Node;
        return Result;
    end Interpret;

begin
    Current_Node := new Node_Structure;

    Ghost := Class_Block.Create (Block.Get_Current_Node);

end Block;

E3 Meta Data

    nblk1=7
    nid=4
    hdr6=c
        [0x00] rec0=26 rec1=00 rec2=01 rec3=05e
        [0x01] rec0=1b rec1=00 rec2=02 rec3=014
        [0x02] rec0=00 rec1=00 rec2=05 rec3=03a
        [0x03] rec0=1d rec1=00 rec2=07 rec3=018
        [0x04] rec0=20 rec1=00 rec2=06 rec3=022
        [0x05] rec0=1e rec1=00 rec2=03 rec3=000
        [0x06] rec0=23 rec1=00 rec2=03 rec3=001
    tail 0x2152d05e084d389dc42c9 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 00 00 15 80 12 20 3a 20 69 6e 20 6f 75 74 20  ┆       : in out ┆