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

⟦96fde30ce⟧ TextFile

    Length: 2274 (0x8e2)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Bounded_String;
with Statements;
with Text_Io;
with Tiny_File;

package body Unparser is

    Log_File : Text_Io.File_Type;

    Indent_Level : Natural := 0;
    Indent_Width : Natural := 3;
    Current_Line : Natural := 0;

    procedure Put_Header (From_File : String; To_File : String) is
    begin
        Tiny_File.Set_Line (Log_File, 2);
        Tiny_File.Set_Col (Log_File, 15);
        Tiny_File.Put_Line (Log_File,
                            "---  FICHIER " & To_File &
                               " : RESULTAT DU REFORMATAGE DU FICHIER " &
                               From_File & "  ---");
        Tiny_File.New_Line (Log_File, 2);  
    end Put_Header;

    procedure Start (The_Root : Statements.Node;
                     From_File : String;
                     To_File : String) is
    begin
        Tiny_File.Create (Log_File, To_File);
        Put_Header (From_File, To_File);
    end Start;

    procedure Put (The_String : String; At_Col : Natural := 0) is
    begin
        if At_Col > 0 then
            Tiny_File.Set_Col (Log_File, At_Col);
        end if;
        Tiny_File.Put (Log_File, The_String);
    end Put;

    procedure Put (The_Lexeme : Scanner.Lexeme; At_Col : Natural := 0) is
    begin
        if At_Col > 0 then
            Tiny_File.Set_Col (Log_File, At_Col);
        end if;
        Tiny_File.Put (Log_File, Bounded_String.Image (The_Lexeme));
    end Put;

    procedure New_Line is
    begin
        Tiny_File.New_Line (Log_File);
        Tiny_File.Set_Col (Log_File, Indent_Width * Indent_Level + 1);
        Current_Line := Current_Line + 1;
    end New_Line;

    procedure New_Right (The_String : String) is
    begin
        New_Line;
        Tiny_File.Put (Log_File, The_String);
        Indent_Level := Indent_Level + 1;
    end New_Right;

    procedure New_Left (The_String : String) is
    begin
        Indent_Level := Indent_Level - 1;
        Tiny_File.Set_Col (Log_File, Indent_Width * Indent_Level + 1);
        Tiny_File.Put (Log_File, The_String);
    end New_Left;

    procedure Go (The_Root : Statements.Node) is
    begin
        Current_Line := 5;
        Statements.Unparse (The_Root);
    end Go;

    procedure Stop is
    begin
        Tiny_File.Close (Log_File);
    end Stop;

end Unparser;