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

⟦0b432a210⟧ TextFile

    Length: 10364 (0x287c)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

separate (Lex)
package body Automate is
    The_String : Standard_String.Object;


    function Get return Standard_String.Object is
    begin
        return The_String;
    end Get;



    function Double_Point_State return Token is
        C : Character;
    begin
        C := Get_Next_Character (The_File);
        case C is
            when '=' =>
                return Token'(Let);
            when others =>  
                Look_Ahead.Set (To => C);
                return Token'(Unk);
        end case;  
    end Double_Point_State;



    function Greater_State return Token is
        C : Character;
    begin
        C := Get_Next_Character (The_File);
        case C is
            when '=' =>
                return Token'(Geq);
            when others =>  
                Look_Ahead.Set (To => C);
                return Token'(Great);
        end case;  
    end Greater_State;



    function Less_State return Token is
        C : Character;
    begin
        C := Get_Next_Character (The_File);
        case C is  
            when '>' =>
                return Token'(Neq);
            when '=' =>
                return Token'(Leq);
            when others =>  
                Look_Ahead.Set (To => C);
                return Token'(Less);
        end case;  
    end Less_State;



    function Comment_State return Token;


    function End_Of_Comment_State return Token is
        C : Character;
    begin
        C := Get_Next_Character (The_File);
        case C is
            when '/' =>
                return Start;
            when others =>
                return Comment_State;
        end case;  
    end End_Of_Comment_State;



    function Comment_State return Token is
        C : Character;
    begin
        C := Get_Next_Character (The_File);
        case C is
            when '*' =>
                return End_Of_Comment_State;
            when others =>
                return Comment_State;
        end case;  
    end Comment_State;



    function Start_Comment_State return Token is
        C : Character;
    begin
        C := Get_Next_Character (The_File);
        case C is
            when '*' =>
                return Comment_State;
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Unk);
        end case;  
    end Start_Comment_State;





    function Based_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' =>
                return Based_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Based);
        end case;  
    end Based_State;



    function Based_Number_Value_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z' =>
                return Based_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Unk);
        end case;  
    end Based_Number_Value_State;



    function The_Base_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when '0' .. '9' =>
                return The_Base_State (C);
            when '#' =>
                return Based_Number_Value_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Unk);
        end case;  
    end The_Base_State;



    function Start_Of_Based_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when '0' .. '9' =>
                return The_Base_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Unk);
        end case;  
    end Start_Of_Based_State;



    function Hour_With_S_State (In_Character : Character) return Token is
    begin
        Standard_String.Append (In_Character, To => The_String);
        return Token'(Hour);
    end Hour_With_S_State;



    function Tenth_Of_Second_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when 's' | 'S' =>
                return Hour_With_S_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Unk);
        end case;  
    end Tenth_Of_Second_State;



    function Point_Of_Second_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when '0' .. '9' =>
                return Tenth_Of_Second_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Unk);
        end case;  
    end Point_Of_Second_State;



    function Second_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when '0' .. '9' =>
                return Second_State (C);
            when '.' =>
                return Point_Of_Second_State (C);
            when 's' | 'S' =>
                return Hour_With_S_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Unk);
        end case;  
    end Second_State;



    function Hour_With_M_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when '0' .. '9' =>
                return Second_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Hour);
        end case;  
    end Hour_With_M_State;



    function Minute_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when '0' .. '9' =>
                return Minute_State (C);
            when '.' =>
                return Point_Of_Second_State (C);
            when 'm' | 'M' =>
                return Hour_With_M_State (C);
            when 's' | 'S' =>
                return Hour_With_S_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Unk);
        end case;  
    end Minute_State;



    function Hour_With_H_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when '0' .. '9' =>
                return Minute_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Hour);
        end case;  
    end Hour_With_H_State;



    function Int_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when '0' .. '9' =>
                return Int_State (C);
            when 'h' | 'H' =>
                return Hour_With_H_State (C);
            when 'm' | 'M' =>
                return Hour_With_M_State (C);
            when '.' =>
                return Point_Of_Second_State (C);
            when 's' | 'S' =>
                return Hour_With_S_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Int);
        end case;  
    end Int_State;


    function Identifier_State (In_Character : Character) return Token is
        C : Character;
    begin
        Standard_String.Append (In_Character, To => The_String);
        C := Get_Next_Character (The_File);
        case C is
            when 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' =>
                return Identifier_State (C);
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Id);
        end case;  
    end Identifier_State;


    function Start return Token is
        C : Character;
    begin
        Standard_String.Clear (The_String);
        C := Get_Next_Character (The_File);
        case C is
            when Ascii.Eot =>
                return Token'(Eof);
            when ' ' | Ascii.Cr =>
                return Start;
            when '0' .. '9' =>
                return Int_State (C);
            when '#' =>
                return Start_Of_Based_State (C);
            when 'a' .. 'z' | 'A' .. 'Z' =>
                return Identifier_State (C);
            when '/' =>
                return Start_Comment_State;  
            when '{' =>
                return Token'('{');  
            when '}' =>
                return Token'('}');  
            when '(' =>
                return Token'('(');  
            when ')' =>
                return Token'(')');  
            when '*' =>
                return Token'('{');  
            when '+' =>
                return Token'('+');
            when '-' =>
                return Token'('-');
            when '=' =>
                return Token'(Eq);
            when ':' =>
                return Double_Point_State;
            when '<' =>
                return Less_State;
            when '>' =>
                return Greater_State;
            when others =>
                Look_Ahead.Set (To => C);
                return Token'(Unk);
        end case;  
    end Start;

end Automate;