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

⟦cd6d8f99b⟧ TextFile

    Length: 1969 (0x7b1)
    Types: TextFile
    Names: »B«

Derivation

└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Text_Io;

package body Lex_File is

    F : Text_Io.File_Type;

    Current_Char : Character;
    Unget_Request : Boolean;

    -- ***********************************
    -- * ouverture du fichier a analyser *
    -- ***********************************

    procedure Open (File_Name : String) is
    begin
        Text_Io.Open (F, Text_Io.In_File, File_Name);
        Unget_Request := False;
    end Open;


    -- ******************************************
    -- * renvoi VRAI si fin de fichier atteinte *
    -- ******************************************

    function At_End return Boolean is
    begin
        if Unget_Request then
            return False;
        elsif Text_Io.End_Of_File (F) then
            Text_Io.Close (F);
            return True;
        else
            return False;
        end if;
    end At_End;


    -- **************************
    -- * avance dans le fichier *
    -- **************************

    procedure Next is
    begin
        if Unget_Request then
            Unget_Request := False;
        else
            Text_Io.Get (F, Current_Char);
        end if;
    end Next;


    -- ********************************************
    -- * retourne le caractere courant du fichier *
    -- ********************************************

    function Value return Character is
    begin
        return Current_Char;
    end Value;


    -- **************************************************************************
    -- * avance d'un caractere dans le fichier et retourne le caractere courant *
    -- **************************************************************************

    function Get return Character is
    begin
        Next;
        return Value;
    end Get;


    -- *****************************************
    -- * recule d'un caractere dans le fichier *
    -- *****************************************

    procedure Unget is
    begin
        Unget_Request := True;
    end Unget;

end Lex_File;