02/13/84 lex_error_ Entry points in lex_error_: (List is generated by the help command) :Entry: lex_error_: 02/13/84 lex_error_ Function: generates compiler-style error messages on the error_output I/O switch for translators generated by the reduction_compiler command and for other procedures that process tokens generated by the lex_string_ subroutine. See "Notes" below for a description of the error message format. Syntax: declare lex_error_ entry options (variable); call lex_error_ (error_number, Serror_printed, severity_no, max_severity_no, Pstmt, Ptoken, Scontrol, message, brief_message, arg1, ..., argN); Arguments: error_number is the error number (fixed bin), as it should appear in the error message. (Input) Serror_printed is a switch (bit(1) unaligned) that is "1"b if the text of the error message has been printed in a previous error and "0"b, otherwise. (Input/Output). If Serror_printed is "1"b, the text is omitted from the error message. Otherwise, text is included and the switch is set to "1"b to suppress this text in any subsequent occurrence of the same error. severity_no is the severity number (fixed bin) of the error. (Input). It must have a value from 0 through 4. See "Notes" below for an interpretation of the severity_no value. max_severity_no is the severity number (fixed bin) of the highest severity error message that has been printed by the lex_error_ subroutine. (Input/Output). Before the lex_error_ is invoked by a translator, max_severity_no should be initialized to 0. Each time it is called, the lex_error_ subroutine compares this value with the severity_no of the current message and sets max_severity_no to the higher of these two numbers. Pstmt is a pointer to the statement descriptor generated by the lex_string_ subroutine for the statement that is to be printed after the error message. (Input). The line number and statement number given in this statement descriptor are included in the error message. Ptoken is a pointer to the token descriptor of the token that is in error. (Input). If Pstmt is null, then the number of the line that contains the token described by the descriptor is included in the error message. If both Pstmt and Ptoken are null, then no line number is included in the error message. Scontrol is a control bit string (bit(*)) that determines whether the message character string or the brief_message character string is used in the error message. (Input). The interpretation of the bits in this string is described in "Notes" below. error_message_text is an ioa_ control string (char(*) or char(*) varying) that contains the long form of the error message text. (Input) brief_message_text is an ioa_ control string (char(*) or char(*) varying) that contains the brief form of the error message text. (Input) argN are optional arguments that are substituted into the ioa_ message texts, in place of the ioa_ control characters. (Input) Notes: The error messages that are generated by the lex_error_ subroutine have the form shown below. prefix error_number, SEVERITY severity_no IN STATEMENT k OF LINE l. error_message_text SOURCE: statement_in_error For example, ERROR 7, SEVERITY 2 IN STATEMENT 2 OF LINE 2. A bad track specification was given in a Volume statement. 9track has been assumed. SOURCE: Volume: 70082, 8track; The severity_no associated with an error controls the prefix that is placed in the error message, as shown in the list below. 0 COMMENT Comment. The error message is a comment, which does not indicate that an error has occurred, but merely provides information for the user. 1 WARNING Warning only. The error message warns of a statement that may or may not be in error, but compilation continues without ill effect. 2 ERROR Correctable error. The message diagnoses an error that the translator can correct, probably without ill effect. Compilation continues, but correct results cannot be guaranteed. 3 FATAL ERROR An uncorrectable but recoverable error. The translator has detected an error that it cannot correct. Translation continues in an attempt to diagnose further errors, but no output is produced by the translation. 4 TRANSLATOR ERROR An unrecoverable error. The translator cannot continue beyond this error. The translation is aborted after the error message is printed. The phrase "IN STATEMENT k OF LINE l" appears in the error message only if Pstmt is a nonnull pointer. Pstmt is assumed to point to a statement descriptor generated by the lex_string_ subroutine. The values for k and l come from this descriptor. If the error occurred in the first statement of line l, then the phrase "STATEMENT k OF" is omitted from the error message. If Pstmt is null, then "STATEMENT k OF" is omitted from the error message, and l is the line number on which the token described by Ptoken appears. If Ptoken is a null pointer, "IN STATEMENT k OF LINE l" is omitted altogether. Currently, only the first two bits of the Scontrol bit string have meaning, as shown in the table below. "00"b The printed error contains the error_message_text the first time the error occurs, and the brief_message_text for subsequent occurrences of that error during a given translation. "10"b The printed error always contains the error_message_text. "11"b The printed error always contains the error_message_text. "01"b The printed error always contains the brief_message_text. If Serror_printed is "1"b, then the lex_error_ subroutine assumes the text of the error message has already been printed in a previous message. It uses the long or brief error message text, according to the value of Scontrol. If Pstmt points to a statement descriptor, then the lex_error_ subroutine sets the error_in_stmt switch in the statement descriptor. It also checks the value of the output_in_err_msg switch in the descriptor. If this switch is "0"b, the lex_error_ subroutine sets it to "1"b and prints the character string representation of the statement in the error message. If it is already "1"b, then the lex_error_ subroutine assumes that the statement has already appeared in another error message and omits the "SOURCE:" phrase from the error message. If max_severity_no is less than severity_no, then the lex_error_ subroutine sets max_severity_no equal to severity_no. Refer to the lex_string_ subroutine for a description of statement and token descriptors. ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved