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

⟦c39dc9a24⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Automate, package body Lex, seg_0427d7

Derivation

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

E3 Source Code



package body Lex is
------------------------------------------------------------------------
-- <UNIT>        LEX
------------------------------------------------------------------------
--
-- <DESCRIPTION>    This package defines types and operations for lexicaly
--                  parsing characters from a stream.
--
-- <AUTHOR>         Barthe Raphael, Beck Didier, Kempe Laurent
-- <VERSION>        1.0
-- <DATE>           05-Oct-94
-- <MODIFY>         12-Jan-95
--
-- <PKG USED>       TEXT_IO, Bounded_String, Character_Utilities,
--                  String_Utilities, FILE, Token_Pkg
------------------------------------------------------------------------

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

    Thefile : Text_Io.File_Type;
    Currenttoken : Token;

    procedure Open (Name : in String := "File.test") is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Open
--
-- <DESCRIPTION> Open the stream for parsing.
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
    begin
        Text_Io.Open
           (File => Thefile, Mode => Text_Io.In_File, Name => Name, Form => "");
        File.Open;
    end Open;

    procedure Close is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Close
--
-- <DESCRIPTION> Close the stream used for parsing.
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
    begin
        Text_Io.Close (File => Thefile);
    end Close;

    function Atend return Boolean is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        AtEnd
--
-- <DESCRIPTION> Check if we have reached the end of the stream.
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
    begin
        return Currenttoken = T_Eof;
    end Atend;

    function Image return String is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Image
--
-- <DESCRIPTION> Return the image of the last lexical word.
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
    begin
        return Bounded_String.Image (Automate.Get);
    end Image;


    procedure Next is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Next
--
-- <DESCRIPTION> Read the next lexical word from the stream.
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
    begin
        Currenttoken := Automate.Start;
        if Currenttoken = T_Ident then
            if Iskeyword (Image) then
                Currenttoken := To_Token (Image);
            end if;
        end if;
    end Next;

    function Getvalue return Bounded_String.Variable_String is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        GetValue
--
-- <DESCRIPTION> return the last lexical word read from the stream.
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
    begin
        return Automate.Get;
    end Getvalue;

    function Gettoken return Token is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        GetToken
--
-- <DESCRIPTION> return the last token recognized from the stream.
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
    begin
        return Currenttoken;
    end Gettoken;

    function Integer_Convert return Integer is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        Integer_Convert
--
-- <DESCRIPTION> convert a string into a Natural
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
        Number : Integer := 0;
        Worked : Boolean := False;
    begin
        if Currenttoken = T_Integer then
            String_Utilities.String_To_Number (Image, Number, Worked);
            if Worked then
                return Number;
            end if;
        end if;
    end Integer_Convert;

    function Getline return Positive is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        GetLine
--
-- <DESCRIPTION> return the number of the current line
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
    begin
        return Positive'Val (Text_Io.Line (Thefile));
    end Getline;

    function Getcolumn return Positive is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        GetColumn
--
-- <DESCRIPTION> return the number of the current column
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
    begin
        return Positive'Val (Text_Io.Col (Thefile));
    end Getcolumn;

    function Compare (Tok1, Tok2 : Token) return Boolean is
--------------------------------------------------------------------------------
-- <SUBPROGRAM>
-- <UNIT>        GetColumn
--
-- <DESCRIPTION> return the number of the current column
--
-- <EXCEPTIONS>  Nothing
--
--------------------------------------------------------------------------------
    begin
        return (Token'Val (Token'Pos (Tok1)) = Token'Val (Token'Pos (Tok2)));
    end Compare;

    package body Automate is separate;

end Lex;


E3 Meta Data

    nblk1=7
    nid=0
    hdr6=e
        [0x00] rec0=1c rec1=00 rec2=01 rec3=050
        [0x01] rec0=18 rec1=00 rec2=07 rec3=018
        [0x02] rec0=22 rec1=00 rec2=02 rec3=006
        [0x03] rec0=1f rec1=00 rec2=03 rec3=00a
        [0x04] rec0=1f rec1=00 rec2=04 rec3=016
        [0x05] rec0=22 rec1=00 rec2=05 rec3=00a
        [0x06] rec0=12 rec1=00 rec2=06 rec3=001
    tail 0x2153dbb04862f71b20905 0x42a00088462060003