! ! RECOVERY_PACKET.SCN_INC ! ! defines the SCAN error recovery packet ! and a generic error handling routine ! TYPE recovery_packet: RECORD error_code: INTEGER, error_token: INTEGER, error_token_text: POINTER TO STRING, error_token_line: INTEGER, error_token_column: INTEGER, recovery_token: INTEGER, recovery_token_text: POINTER TO STRING, recovery_token_line: INTEGER, recovery_token_column: INTEGER, failing_instruction: INTEGER, global_state_block: INTEGER, END RECORD /* recovery_packet */ ; ! ! defines the SCAN RTL function that will ! return the symbolic name for a token ! from the internal name in the packet ! ! Parameters: ! ! error_token or recovery_token in a recovery_packet ! global_state_block in a recovery_packet ! EXTERNAL PROCEDURE scn$get_token_name( VALUE INTEGER, VALUE INTEGER ) OF STRING; ! ! generic error procedure and its common variables ! DECLARE syntax_error : BOOLEAN; DECLARE error_column, error_line : INTEGER; DECLARE error_token_name, error_text : STRING; PROCEDURE generic_error ( pkt: recovery_packet ); syntax_error = TRUE; error_column = pkt.error_token_column; error_line = pkt.error_token_line; error_text = pkt.error_token_text->; error_token_name = scn$get_token_name( pkt.error_token, pkt.global_state_block ); END PROCEDURE /* generic_error */ ;