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

⟦3005414de⟧ TextFile

    Length: 2399 (0x95f)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Spectacle_Tree;
with Tad_Abstract;
with Text_Io;

package body Codage is
    package Int_Io is new Text_Io.Integer_Io (Natural);

    The_File : Text_Io.File_Type;
    The_Time : Natural := 1;

    procedure Generer_Code_Activer (Ptr : Tad_Abstract.Pobject) is

    begin
        Text_Io.Put_Line ("code ACTIVER");
        Int_Io.Put (The_File, The_Time);
        Text_Io.Put (The_File, "  ");
        Int_Io.Put (The_File, Ptr.Left.all.Station);
        Int_Io.Put (The_File, Ptr.Left.all.Acteur);
        Text_Io.Put_Line (" 0001");
    end Generer_Code_Activer;


    procedure Generer_Code_Desactiver (Ptr : Tad_Abstract.Pobject) is

    begin  
        Text_Io.Put_Line ("code DESACTIVER");
        Int_Io.Put (The_File, The_Time);
        Text_Io.Put (The_File, "  ");
        Int_Io.Put (The_File, Ptr.Left.all.Station);
        Int_Io.Put (The_File, Ptr.Left.all.Acteur);
        Text_Io.Put_Line (The_File, " 0000");
    end Generer_Code_Desactiver;


    procedure Generer_Code_Au_Temps (Ptr : Tad_Abstract.Pobject) is

    begin  
        Text_Io.Put_Line ("code AU TEMPS");
        The_Time := The_Time + Ptr.all.Valeur;
    end Generer_Code_Au_Temps;


    procedure Parcourir (Ptr : Tad_Abstract.Pobject) is
    begin
        if not Tad_Abstract."=" (Ptr, null) then  
            begin  
                Text_Io.Put_Line ("parcours de l'arbre");
                case Tad_Abstract.Type_Of_Node (Ptr.all) is
                    when Tad_Abstract.Chainage =>
                        Parcourir (Ptr.Left);
                        Parcourir (Ptr.Right);
                    when Tad_Abstract.Activer =>
                        Generer_Code_Activer (Ptr);
                    when Tad_Abstract.Desactiver =>
                        Generer_Code_Desactiver (Ptr);
                    when Tad_Abstract.Au_Temps =>
                        Generer_Code_Au_Temps (Ptr);
                    when others =>
                        null;
                end case;
            end;
        end if;
    end Parcourir;


    function Generer_Code return String is

    begin
        Text_Io.Create (File => The_File,
                        Mode => Text_Io.Out_File,
                        Name => "fichier_code",
                        Form => "");
        Parcourir (Spectacle_Tree.Object);
        Text_Io.Close (The_File);
        return ("fichier_code");
    end Generer_Code;
end Codage;