DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦37ee1a407⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Automate, package body Convert, package body Lex, package body Look_Ahead, seg_03bae6

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Bounded_String;
with Text_Io;
package body Lex is

    package Look_Ahead is  
        function Exist return Boolean;
        function Get return Character;
        procedure Set (To : Character);
    end Look_Ahead;


    package Automate is
        function Start return Token;
        function Get return Bounded_String.Variable_String;
    end Automate;


    package Convert is
        function From_Int_To_Natural (S : String) return Natural;
        function From_Based_To_Natural (S : String) return Natural;
        function From_Hour_To_Natural (S : String) return Natural;
    end Convert;



    The_File : Text_Io.File_Type;  
    Current_Token : Token;
    Current_Line : Natural := 1;
    Current_Column : Natural := 1;



--
--
    function Current_Token_Is (T : Token) return Boolean is
    begin
        return Current_Token = T;
    end Current_Token_Is;


--
--
    function Current_Token_In (T : Tokens) return Boolean is
        Index : Natural := 1;
    begin  
        loop
            if Current_Token_Is (T (Index)) then
                return True;  
            else
                Index := Index + 1;
            end if;
        end loop;  
    exception
        when Constraint_Error =>
            return False;
    end Current_Token_In;


--
--
    function Get_Next_Character
                (The_File : Text_Io.File_Type) return Character is  
        C : Character;
    begin
        if Look_Ahead.Exist then
            return Look_Ahead.Get;
        else
            if Text_Io.End_Of_File (File => The_File) then
                return Ascii.Eot;
            elsif Text_Io.End_Of_Line (File => The_File) then
                Text_Io.Skip_Line (File => The_File);
                return Ascii.Cr;
            else
                Text_Io.Get (File => The_File, Item => C);
                return C;
            end if;
        end if;
    end Get_Next_Character;



--
--
    function Is_A_Keyword (The_String : String) return Boolean is
        T : Token;
    begin
        T := Token'Value (The_String);
        return True;
    exception
        when Constraint_Error =>
            return False;
    end Is_A_Keyword;


--
--
    procedure Open (Thename : String) is
    begin
        Text_Io.Open (File => The_File,
                      Mode => Text_Io.In_File,
                      Name => Thename,
                      Form => "");
    end Open;



--
--
    procedure Close is
    begin
        Text_Io.Close (File => The_File);
    end Close;



--
--
    function Value return Natural is
    begin
        case Get is
            when Int =>
                return Convert.From_Int_To_Natural (Image);
            when Based =>
                return Convert.From_Based_To_Natural (Image);
            when Hour =>
                return Convert.From_Hour_To_Natural (Image);
            when others =>
                return 0;
        end case;
    end Value;



--
--
    function Image return String is
    begin
        return Bounded_String.Image (Automate.Get);
    end Image;



--
--
    function Get return Token is
    begin
        return Current_Token;
    end Get;



--
--
    function Get_Line return Natural is
    begin
        return Current_Line;
    end Get_Line;



--
--
    function Get_Column return Natural is
    begin
        return Current_Column;
    end Get_Column;



--
--
    function At_End return Boolean is
    begin
        return Current_Token = Eof;
    end At_End;



--
--
    procedure Next is
    begin  
        Current_Token := Automate.Start;
        if Current_Token = Identifier then
            if Is_A_Keyword (Image) then
                Current_Token := Token'Value (Image);
            end if;
        end if;
    end Next;



--
--
    package body Look_Ahead is separate;
    package body Automate is separate;
    package body Convert is separate;

end Lex;

E3 Meta Data

    nblk1=5
    nid=0
    hdr6=a
        [0x00] rec0=2c rec1=00 rec2=01 rec3=056
        [0x01] rec0=22 rec1=00 rec2=02 rec3=01e
        [0x02] rec0=31 rec1=00 rec2=03 rec3=038
        [0x03] rec0=3d rec1=00 rec2=04 rec3=014
        [0x04] rec0=0d rec1=00 rec2=05 rec3=000
    tail 0x217392e2c853b7286b2c8 0x42a00088462060003