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 - metrics - download
Index: B T

⟦bc2d19559⟧ TextFile

    Length: 6901 (0x1af5)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile



------------------------------------------------------------------

with Text_Io;

package body Lexical_Error_Message is

    ------------------------------------------------------------------
    -- Declarations Local to Package Lexical_Error_Message
    ------------------------------------------------------------------

    Insertion_Flag : Character := '@';

    subtype Message_Text_Range is Positive range 1 .. 64;

    Message_Text :
       constant array (Message_Type) of String (Message_Text_Range) :=
       (
        -- 1234567890123456789012345678901234567890123456789012345678901234
        -- Base_Out_Of_Legal_Range_Use_16   =>
        "This base " & Insertion_Flag -- insert a String
         & " is not in the range 2 to 16. Assuming base 16.      ",
        -- Based_Literal_Delimiter_Mismatch =>
        "Based_literal delimiters must be the same.                      ",
        -- Character_Can_Not_Start_Token    =>
        "This character " & Insertion_Flag -- insert a character
            & " can not start a token.                         ",
        -- Character_Is_Non_ASCII  =>
        "This value x@VALUE@x is not an ASCII character.                 ",
        --|? should display the value, but this message is unlikely.
        --|? see Lex.bdy
        -- Character_Is_Non_Graphic=>
        "This character with decimal value" & Insertion_Flag
           -- insert the decimal value
            & " is not a graphic_character.  ",
        -- Consecutive_Underlines  =>
        "Consecutive underlines are not allowed.                         ",
        -- Digit_Invalid_For_Base  =>
        "This digit " & Insertion_Flag -- insert a Character
            & " is out of range for the base specified.            ",
        -- Digit_Needed_After_Radix_Point   =>
        "At least one digit must appear after a radix point              ",
        -- Digit_Needed_Before_Radix_Point  =>
        "At least one digit must appear before a radix point             ",
        -- Exponent_Missing_Integer_Field   =>
        "The exponent is missing its integer field.                      ",
        -- Illegal_Use_Of_Single_Quote  =>
        "Single quote is not used for an attribute or character literal. ",
        -- Integer_Literal_Conversion_Exception_Using_1 =>
        "Error while evaluating a integer_literal. Using a value of '1'. ",
        -- Leading_Underline    =>
        "Initial underlines are not allowed.                             ",
        -- Missing_Second_Based_Literal_Delimiter   =>
        "Second based_literal delimiter is missing.                      ",
        -- Negative_Exponent_Illegal_In_Integer =>
        "A negative exponent is illegal in an integer literal.           ",
        -- No_Ending_String_Delimiter   =>
        "String is improperly terminated by the end of the line.         ",
        -- No_Integer_In_Based_Number   =>
        "A based number must have a value.                               ",
        -- Only_Graphic_Characters_In_Strings   =>
        "This non-graphic character with decimal value" & Insertion_Flag
           -- insert the decimal value
            & " found in string. ",
        -- Real_Literal_Conversion_Exception_Using_1    =>
        "Error while evaluating a real_literal. Using a value of '1.0'.  ",
        -- Source_Line_Maximum_Exceeded =>
        "Maximum allowable source line number of " & Insertion_Flag
           -- insert an Integer'IMAGE
            & " exceeded.             ",
        -- Source_Line_Too_Long =>
        "Source line number " & Insertion_Flag -- insert an Integer'IMAGE
            & " is too long.                               ",
        -- Space_Must_Separate_Num_And_Ids      =>
        "A space must separate numeric_literals and identifiers.         ",
        -- Terminal_Underline   =>
        "Terminal underlines are not allowed.                            ",
        -- Too_Many_Radix_Points        =>
        "A real_literal may have only one radix point.                   ");

    ------------------------------------------------------------------
    -- Subprogram Bodies Global to Package Lexical_Error_Message
    ------------------------------------------------------------------

    procedure Output_Message (In_Line : in Hd.Source_Line;
                              In_Column : in Hd.Source_Column;
                              In_Message_Id : in Message_Type) is

    begin

        -- output error message including line and column number
        Text_Io.New_Line (Text_Io.Standard_Output);
        Text_Io.Put_Line
           (File => Text_Io.Standard_Output,
            Item => "Lexical Error: Line: " & Hd.Source_Line'Image (In_Line) &
                       " Column: " & Hd.Source_Column'Image (In_Column) &
                       " - " & Message_Text (In_Message_Id));

    end Output_Message;

    ------------------------------------------------------------------

    procedure Output_Message
                 (In_Line : in Hd.Source_Line;
                  In_Column : in Hd.Source_Column;
                  In_Insertion_Text : in String;     --| text to insert.
                  In_Message_Id : in Message_Type) is

        --------------------------------------------------------------
        -- Declarations for SubProgram Output_Message
        --------------------------------------------------------------

        Insertion_Index : Positive := (Message_Text_Range'Last + 1);
        --| if insertion flag is not found,
        --| then we append the In_Message_Text to the message

        ------------------------------------------------------------------

    begin

        --| Algorithm
        --|
        --| Find the insertion point.
        --| if the Message_Text doesn't have an Insertion_Flag,
        --| then set the Insertion_Index to the end of the message.
        for I in Message_Text_Range loop
            if (Insertion_Flag = Message_Text (In_Message_Id) (I)) then
                Insertion_Index := I;
                exit;
            end if;
        end loop;

        -- output error message with test, line and column number
        Text_Io.New_Line (Text_Io.Standard_Output);
        Text_Io.Put_Line
           (File => Text_Io.Standard_Output,
            Item => "Lexical Error: Line: " &
                       Hd.Source_Line'Image (In_Line) & " Column: " &
                       Hd.Source_Column'Image (In_Column) & " - " &
                       Message_Text (In_Message_Id)
                          (1 .. (Insertion_Index - 1)) & In_Insertion_Text &
                       Message_Text (In_Message_Id)
                          ((Insertion_Index + 1) .. Message_Text_Range'Last));

    end Output_Message;

    ------------------------------------------------------------------

end Lexical_Error_Message;

----------------------------------------------------------------------