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

⟦70244dd26⟧ TextFile

    Length: 10084 (0x2764)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Text_Io;
package body Nodes is
    package Int_Io is new Text_Io.Integer_Io (Integer);

    function Mkactivernode (Id1, Id2 : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Activer);
        Ptrnode.Thetype := Activer;
        Ptrnode.Act_Id1 := Id1;
        Ptrnode.Act_Id2 := Id2;
        return Ptrnode;
    end Mkactivernode;

    function Mkdesactivernode (Id1, Id2 : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Desactiver);
        Ptrnode.Thetype := Desactiver;
        Ptrnode.Des_Id1 := Id1;
        Ptrnode.Des_Id2 := Id2;
        return Ptrnode;
    end Mkdesactivernode;

    function Mkmodifiernode (Id1, Id2, Expr : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Modifier);
        Ptrnode.Thetype := Modifier;
        Ptrnode.Mod_Id1 := Id1;
        Ptrnode.Mod_Id2 := Id2;
        Ptrnode.Mod_Expr := Expr;
        return Ptrnode;
    end Mkmodifiernode;

    function Mkevoluernode (Id1, Id2, Expr1, Expr2 : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Evoluer);
        Ptrnode.Thetype := Evoluer;
        Ptrnode.Evo_Id1 := Id1;
        Ptrnode.Evo_Id2 := Id2;
        Ptrnode.Evo_Expr1 := Expr1;
        Ptrnode.Evo_Expr2 := Expr2;
        return Ptrnode;
    end Mkevoluernode;

    function Mkexprnode (Term, Exprprime : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Expression);
        Ptrnode.Thetype := Expression;
        Ptrnode.Exp_Exprprime := Exprprime;
        Ptrnode.Exp_Term := Term;
        return Ptrnode;
    end Mkexprnode;

    function Mkexprprimenode
                (Term, Exprprime : Pnode; Anoperator : Operator) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Expressionprime);
        Ptrnode.Thetype := Expressionprime;
        Ptrnode.Expp_Exprprime := Exprprime;
        Ptrnode.Expp_Term := Term;
        Ptrnode.Expp_Op := Anoperator;
        return Ptrnode;
    end Mkexprprimenode;

    function Mktermnode (Fact, Termprime : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Terme);
        Ptrnode.Thetype := Terme;
        Ptrnode.Ter_Termprime := Termprime;
        Ptrnode.Ter_Fact := Fact;
        return Ptrnode;
    end Mktermnode;

    function Mktermprimenode
                (Fact, Termprime : Pnode; Anoperator : Operator) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Termeprime);
        Ptrnode.Thetype := Termeprime;
        Ptrnode.Terp_Termprime := Termprime;
        Ptrnode.Terp_Fact := Fact;
        Ptrnode.Terp_Op := Anoperator;
        return Ptrnode;
    end Mktermprimenode;

    function Mkfactnode (Anode : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Facteur);
        Ptrnode.Thetype := Facteur;
        Ptrnode.Fac_Node := Anode;
        return Ptrnode;
    end Mkfactnode;

    function Mkidnode (Val : Lexical.Lexeme) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Id);
        Ptrnode.Thetype := Id;
        Ptrnode.Id_Val := Val;
        return Ptrnode;
    end Mkidnode;

    function Mknbnode (Val : Integer) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Nombre);
        Ptrnode.Thetype := Nombre;
        Ptrnode.Nb_Val := Val;
        return Ptrnode;
    end Mknbnode;

    function Mkaffectnode (Id, Expr : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Affect);
        Ptrnode.Thetype := Affect;
        Ptrnode.Aff_Id := Id;
        Ptrnode.Aff_Expr := Expr;
        return Ptrnode;
    end Mkaffectnode;

    function Mkfairenode (Id1, Id2 : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Faire);
        Ptrnode.Thetype := Faire;
        Ptrnode.Fai_Id1 := Id1;
        Ptrnode.Fai_Id2 := Id2;
        return Ptrnode;
    end Mkfairenode;

    function Mkrepeternode (Expr, Instr : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Repeter);
        Ptrnode.Thetype := Repeter;
        Ptrnode.Rep_Expr := Expr;
        Ptrnode.Rep_Instr := Instr;
        return Ptrnode;
    end Mkrepeternode;

    function Mksinode (Cond, Instr, Sinon : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Si);
        Ptrnode.Thetype := Si;
        Ptrnode.Si_Cond := Cond;
        Ptrnode.Si_Instr := Instr;
        Ptrnode.Si_Sinon := Sinon;
        return Ptrnode;
    end Mksinode;

    function Mksinonnode (Instr : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Sinon);
        Ptrnode.Thetype := Sinon;
        Ptrnode.Sin_Instr := Instr;
        return Ptrnode;
    end Mksinonnode;

    function Mkautempsnode (Expr, Instr : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Autemps);
        Ptrnode.Thetype := Autemps;
        Ptrnode.Aut_Expr := Expr;
        Ptrnode.Aut_Instr := Instr;
        return Ptrnode;
    end Mkautempsnode;

    function Mkattendrenode (Expr : Pnode) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Attendre);
        Ptrnode.Thetype := Attendre;
        Ptrnode.Att_Expr := Expr;
        return Ptrnode;
    end Mkattendrenode;

    function Mkcondnode (Expr1, Expr2 : Pnode; Anoprel : Op_Rel) return Pnode is
        Ptrnode : Pnode;
    begin
        Ptrnode := new Node (Condition);
        Ptrnode.Thetype := Condition;
        Ptrnode.Con_Expr1 := Expr1;
        Ptrnode.Con_Expr2 := Expr2;
        Ptrnode.Con_Op := Anoprel;
        return Ptrnode;
    end Mkcondnode;

    function Nbgetvalue (Anbnode : Pnode) return Integer is
    begin
        return Anbnode.Nb_Val;
    end Nbgetvalue;

    function Idgetlex (Aidnode : Pnode) return Lexical.Lexeme is
    begin
        return Aidnode.Id_Val;
    end Idgetlex;

    function Conditionistrue (Acondnode : Pnode) return Boolean is
    begin
        return Acondnode.Con_Val;
    end Conditionistrue;

    procedure Idsetvalue (Aidnode : Pnode; Aval : Lexical.Lexeme) is
    begin
        Aidnode.Id_Val := Aval;
    end Idsetvalue;

    procedure Printid (Ptr : Pnode) is
    begin
        Text_Io.Put ("Id");
        Text_Io.Put (' ');
    end Printid;

    procedure Printexpr (Ptr : Pnode) is
    begin
        Text_Io.Put ("Exp_Val");
        Text_Io.Put (' ');
    end Printexpr;

    procedure Printfaire (Ptr : Pnode) is
    begin
        Text_Io.Put ("-> Faire ");
        Printid (Ptr.Fai_Id1);
        Printid (Ptr.Fai_Id2);
        Text_Io.New_Line;
    end Printfaire;

    procedure Printactiver (Ptr : Pnode) is
    begin
        Text_Io.Put (" -> Activer ");
        Printid (Ptr.Act_Id1);
        Printid (Ptr.Act_Id2);
        Text_Io.New_Line;
    end Printactiver;

    procedure Printdesactiver (Ptr : Pnode) is
    begin
        Text_Io.Put (" -> Desactiver ");
        Printid (Ptr.Des_Id1);
        Printid (Ptr.Des_Id2);
        Text_Io.New_Line;
    end Printdesactiver;

    procedure Printmodifier (Ptr : Pnode) is
    begin
        Text_Io.Put (" -> Modifier ");
        Printid (Ptr.Mod_Id1);
        Printid (Ptr.Mod_Id2);
        Printexpr (Ptr.Mod_Expr);
        Text_Io.New_Line;
    end Printmodifier;

    procedure Printevoluer (Ptr : Pnode) is
    begin
        Text_Io.Put (" -> Evoluer ");
        Printid (Ptr.Evo_Id1);
        Printid (Ptr.Evo_Id2);
        Printexpr (Ptr.Evo_Expr1);
        Printexpr (Ptr.Evo_Expr2);
        Text_Io.New_Line;
    end Printevoluer;

    procedure Printrepeter (Ptr : Pnode) is
    begin
        Text_Io.Put (" -------> Repeter ");
        Printexpr (Ptr.Rep_Expr);
        Text_Io.New_Line;
        Printtree (Ptr.Rep_Instr);
        Text_Io.New_Line;
        Text_Io.Put_Line (" -------> fin Repeter ");
    end Printrepeter;

    procedure Printsinon (Ptr : Pnode) is
    begin
        Text_Io.Put ("--------> Sinon ");
        Printtree (Ptr.Sin_Instr);
        Text_Io.New_Line;
    end Printsinon;

    procedure Printcond (Ptr : Pnode) is
    begin
        Text_Io.Put (Boolean'Image (Ptr.Con_Val));
    end Printcond;

    procedure Printsi (Ptr : Pnode) is
    begin
        Text_Io.Put ("--------> Si ");
        Printcond (Ptr.Si_Cond);
        Text_Io.Put (" alors ");
        Text_Io.New_Line;
        Printtree (Ptr.Si_Instr);
        if Ptr.Si_Sinon /= null then
            Printsinon (Ptr.Si_Sinon);
        end if;
        Text_Io.Put_Line ("-------> fin Si ");
    end Printsi;

    procedure Printautemps (Ptr : Pnode) is
    begin
        Text_Io.Put ("--------> Autemps ");
        Printexpr (Ptr.Aut_Expr);
        Text_Io.New_Line;
        Printtree (Ptr.Aut_Instr);
        Text_Io.New_Line;
        Text_Io.Put_Line ("-------> fin Autemps ");
    end Printautemps;

    procedure Printattendre (Ptr : Pnode) is
    begin
        Text_Io.Put ("--------> Attendre ");
        Printexpr (Ptr.Att_Expr);
        Text_Io.New_Line;
    end Printattendre;

    procedure Printtree (Anode : Pnode) is
        Ptr : Pnode;
    begin
        Ptr := Anode;
        while Ptr /= null loop
            case Ptr.Thetype is
                when Faire =>
                    Printfaire (Ptr);
                when Activer =>
                    Printactiver (Ptr);
                when Desactiver =>
                    Printdesactiver (Ptr);
                when Modifier =>
                    Printmodifier (Ptr);
                when Evoluer =>
                    Printevoluer (Ptr);
                when Repeter =>
                    Printrepeter (Ptr);
                when Si =>
                    Printsi (Ptr);
                when Autemps =>
                    Printautemps (Ptr);
                when Attendre =>
                    Printattendre (Ptr);
                when others =>
                    null;
            end case;
            Ptr := Ptr.Next;
        end loop;
    end Printtree;

end Nodes;