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

⟦f2a28e613⟧ TextFile

    Length: 1930 (0x78a)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Lex, Error, Debug, Symbol;
with Expression;
package body Affect is

    procedure Parse (N : in out Binary_Tree.Node; Success : in out Boolean) is
        N1 : Binary_Tree.Node;
        The_Type : Symbol.Symbol_Type;
        The_Value : Natural;
        Ok, Variable_Exist : Boolean := True;
    begin  
        Success := True;
        if Lex.Current_Token_Is (Lex.Identifier) then
            N1 := new Binary_Tree.Node_Structure;  
            N1.The_Type := Binary_Tree.Affect_Type;
            N1.S := new String'(Lex.Image);
            Debug.Put (500);
            Lex.Next;
            if Lex.Current_Token_Is (Lex.Let) then
                if Symbol.Get_Current_Level = 2 then
                    Symbol.Get_Variable_From_2 (N1.S.all, The_Type,
                                                The_Value, Variable_Exist);
                else
                    if Symbol.Get_Current_Level = 1 then
                        Symbol.Get_Variable_From_1 (N1.S.all, The_Type,
                                                    The_Value, Variable_Exist);
                    end if;
                end if;
                if not Variable_Exist then
                    Symbol.Add_Variable (Variable_Name => N1.S.all);
                end if;
                Debug.Put (501);
                Lex.Next;
                Expression.Parse (N1.Right_Son, Ok);
                Success := Ok and Success;
            else
                Error.Append (8);  
                Success := False;
            end if;
            N := N1;
        else
            Error.Append (9);
            Success := False;
        end if;
    end Parse;


    procedure Generate (N : Binary_Tree.Node) is
        Value : Natural := 0;
        The_Type : Symbol.Symbol_Type;
        Ok : Boolean := True;
    begin
        Expression.Generate (N.Right_Son, Value);  
        Symbol.Set_Var_Value (N.S.all, Value);
    end Generate;

end Affect;