DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦3ef624ccf⟧ TextFile

    Length: 2453 (0x995)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Block;
with Table;  
with Object;
package body Symbol is

    function Eval (Name : Message.Tiny_String) return Object.Reference is
        New_Reference : Object.Reference := Object.Void_Reference;
        Success : Boolean := False;
        Current_Table : Table.Symbol_Kind;
    begin
        Find (Name, New_Reference, Current_Table, Success);
        return Table.Eval (Current_Table, Name);
    end Eval;

    procedure Find (Name : Message.Tiny_String;
                    New_Reference : in out Object.Reference;
                    Current_Table : out Table.Symbol_Kind;
                    Is_Found : out Boolean) is
        use Block;
        Current_Node : Block.Node := Block.Current;
        Success : Boolean := False;  
        Origin_Table, Table_In_Use : Table.Symbol_Kind :=
           Block.Symbol (Current_Node);
    begin  
        while (Current_Node /= Block.Empty_Node) loop
            Table.Find (The_Table => Table_In_Use,
                        Name => Name,
                        New_Reference => New_Reference,
                        Success => Success);
            exit when Success;

            Current_Node := Block.Parent (Current_Node);
            if Current_Node /= Block.Empty_Node then
                Table_In_Use := Block.Symbol (Current_Node);
            end if;
        end loop;
        if Success then
            Current_Table := Table_In_Use;
        else
            Current_Table := Origin_Table;
        end if;
        Is_Found := Success;  
    end Find;

    procedure Insert (Name : Message.Tiny_String;
                      New_Reference : Object.Reference) is
        Object_Found : Object.Reference := Object.Void_Reference;
        Table_In_Use : Table.Symbol_Kind;
        Is_Found : Boolean := False;
    begin
        Find (Name, Object_Found, Table_In_Use, Is_Found);
        Table.Insert (Table_In_Use, Name, New_Reference);
    end Insert;

    procedure In_Text is
        Current_Node : Block.Node := Block.Current;
        Table_In_Use : Table.Symbol_Kind;
        use Block;
    begin
        Table_In_Use := Block.Symbol (Current_Node);
        while (Current_Node /= Block.Empty_Node) loop
            Table.In_Text (Table_In_Use);
            Current_Node := Block.Parent (Current_Node);
            if Current_Node /= Block.Empty_Node then
                Table_In_Use := Block.Symbol (Current_Node);
            end if;
        end loop;
    end In_Text;
end Symbol;