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

⟦b245a1b85⟧ TextFile

    Length: 2616 (0xa38)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Pile;
with Text_Io;

package body Pile_Lex is

    type Cellule_Mem is
        record
            Name : Pointeur_Chaine;
            Letoken : Token;
            At_End : Boolean;
            Col : Text_Io.Positive_Count;
            Line : Text_Io.Positive_Count;

        end record;

    package Pile_Lx is new Pile (Item => Cellule_Mem);
    Stack : Pile_Lx.Object (1000);
    E : Cellule_Mem;


    procedure Charge_Programme_Dans_Pile_Lex (Afile : Text_Io.File_Type) is
        Error_Pile_Lx : exception;
    begin

        -- while not Text_Io.End_Of_File (Afile) loop

        while Lex_Get_Token1 /= L_Eof loop




            Lex_Next_Token1 (Afile);
            if Lex_Get_Value1 /= null then
                E.Name := Lex_Get_Value1;
            end if;
            E.Letoken := Lex_Get_Token1;
            E.At_End := Lex_At_End1 (Afile);  
            E.Col := Text_Io.Col (Afile);  
            E.Line := Text_Io.Line (Afile);  
            Pile_Lx.Empiler (Stack, E);
        end loop;
    exception
        when Constraint_Error =>
            raise Error_Pile_Lx;

    end Charge_Programme_Dans_Pile_Lex;

    function Col (Afile : Text_Io.File_Type) return Text_Io.Positive_Count is
    begin
        return E.Col;
    end Col;

    function Line (Afile : Text_Io.File_Type) return Text_Io.Positive_Count is
    begin
        return E.Line;
    end Line;

    function Lex_Get_Value return Pointeur_Chaine is
    begin
        return E.Name;
    end Lex_Get_Value;

    function Lex_Get_Value_Float return Float is
        Ch : constant Pointeur_Chaine := Lex_Get_Value;
        I : constant Integer := Integer'Value (Ch.all);
    begin
        return Float (I);
    end Lex_Get_Value_Float;


    function Lex_Get_Token return Token is
    begin
        return E.Letoken;
    end Lex_Get_Token;


    procedure Lex_Open (Afile : Text_Io.File_Type) is
    begin
        Lex_Open1 (Afile);
    end Lex_Open;



    function Lex_At_End (Afile : Text_Io.File_Type) return Boolean is
    begin
        return E.At_End;
    end Lex_At_End;

    procedure Lex_Next_Token (Afile : Text_Io.File_Type) is
    begin
        Pile_Lx.Avance (Stack);
        Pile_Lx.Lire (Stack, E);
        --Text_Io.Put_Line ("tok :" & Token'Image (Lex_Get_Token));
    end Lex_Next_Token;

    procedure Prg_Iterateur_A_Position (Posi : Natural) is
    begin
        Pile_Lx.Iterateur_A_Position (Stack, Posi);
    end Prg_Iterateur_A_Position;

    procedure Prg_Lire_Posi_Iterateur (Posi : out Natural) is
    begin
        Pile_Lx.Lire_Posi_Iterateur (Stack, Posi);
    end Prg_Lire_Posi_Iterateur;


end Pile_Lex;