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

⟦5f94293f3⟧ TextFile

    Length: 1590 (0x636)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Value, Relational_Operator, Binary_Tree, Symbol;
package body Condition is

    procedure Parse (N : in out Binary_Tree.Node; Success : in out Boolean) is
        N1 : Binary_Tree.Node;
        Ok : Boolean := True;  
        Relation_Type : Binary_Tree.Node_Type;
    begin  
        N1 := new Binary_Tree.Node_Structure;
        Value.Parse (N1.Left_Son, Ok);
        Success := Success and Ok;
        Relational_Operator.Parse (Relation_Type, Ok);
        N1.The_Type := Relation_Type;
        Success := Success and Ok;
        Value.Parse (N1.Right_Son, Ok);
        Success := Success and Ok;
        N := N1;
    end Parse;


    function Generate (N : Binary_Tree.Node) return Boolean is
        Var1, Var2 : Natural;
        The_Type : Symbol.Symbol_Type;
        Ok : Boolean := True;
    begin  
        Symbol.Get_Variable (N.Left_Son.S.all, The_Type, Var1, Ok);
        Symbol.Get_Variable (N.Right_Son.S.all, The_Type, Var2, Ok);
        case N.The_Type is
            when Binary_Tree.Equal_Type =>
                return Var1 = Var2;
            when Binary_Tree.Greater_Or_Equal_Type =>
                return Var1 >= Var2;
            when Binary_Tree.Greater_Than_Type =>
                return Var1 > Var2;
            when Binary_Tree.Less_Than_Type =>
                return Var1 < Var2;
            when Binary_Tree.Less_Or_Equal_Type =>
                return Var1 <= Var2;
            when Binary_Tree.Not_Equal_Type =>
                return Var1 /= Var2;
            when others =>
                null;
        end case;
    end Generate;


end Condition;