!+ ! NAME ! CHECK_MAP -- driver for the check_map software ! ! DESCRIPTION ! This scan module parses the command line and ! sets up the input and output report file names, ! reads in the exclusion list file if any (by ! calling scan module Handle_Exclude_File), ! and calls the MAP_CRUNCHER routine cmap_testor. ! ! The format of this command is: ! ! $ CK_MAP [/EXCLUDE=] ! ! Examples: ! ! $ CK_MAP disk$bruno:[b192.oss.exe]anyoss.map sys$output /EXCLUDE=XSF ! $ CK_MAP disk$bruno:[b192.oss.exe]anyoss.map anmoss.ckm ! ! RETURN VALUE ! CHKMAP_OKAY, CHKMAP_BADMAP ! ! HISTORY ! 4-12-88 Bauer, Pollizzi Initial implementation. ! !- MODULE CHECK$MAP IDENT 'v1.0'; ! ! SET Declarations ! SET digit ( '0' .. '9' ); SET alpha ( 'a'.. 'z' OR 'A'..'Z'); SET any_ascii ( x'21' .. x'7f' ); SET white_space ( ' ' OR s'ht' ); SET id_part ( alpha OR digit OR '_' OR '$' OR '[' OR ']' OR ';' OR ':' OR '.'); SET id_start ( alpha OR digit OR '_' OR '$' OR '[' ); ! ! TOKEN Declarations ! TOKEN exclude_eq CASELESS { '/EXC' ['LUDE'] '=' }; ! For using EXCLUSION lists TOKEN slash_nolog CASELESS { '/NOL' | '/NOLO' | '/NOLOG' }; TOKEN at_sign ALIAS '@' { '@' }; ! For using EXCLUSION LIST FILES TOKEN comma ALIAS ',' { ',' }; TOKEN blanks { white_space [white_space...] }; TOKEN id { id_start [id_part...] }; ! Catchall identifier (maybe to catchall) ! ! GLOBAL DATA Declarations ! DECLARE nolog : BOOLEAN; DECLARE input_file_name : STRING; ! Parses the input map name DECLARE output_file_name : STRING; ! Parses the output map name DECLARE exclude_tree : GLOBAL TREE(STRING) OF BOOLEAN; ! GLOBAL tree of exclusion PSECT and ! UNDEFINED symbol names DECLARE command_line_status : INTEGER; ! Set to !SS$_NORMAL upon error ! ! CONSTANT Declarations ! CONSTANT SS$_NORMAL EXTERNAL INTEGER; CONSTANT CHKMAP_OKAY EXTERNAL INTEGER; ! ! EXTERNAL PROCEDURE Declarations ! EXTERNAL PROCEDURE lib$get_foreign ( STRING,STRING,INTEGER,INTEGER ) ! Retrieves command line for parsing OF INTEGER; EXTERNAL PROCEDURE lib$stop( INTEGER ); EXTERNAL PROCEDURE lib$signal( VALUE INTEGER, VALUE INTEGER, STRING ); EXTERNAL PROCEDURE cmap_testor( STRING, STRING) of INTEGER; ! Guts of Check_Map - handles map file EXTERNAL PROCEDURE handle_exclude_file (STRING) of INTEGER; ! Handles exclusion lists from a file !+ ! There are 5 MACROs in this file: ! exclusion_list ! at_file ! mode_ids ! exclude_list ! get_name ! !- ! ! This macro handles /NOLOG on command line ! MACRO nologger TRIGGER { slash_nolog }; nolog = TRUE; END MACRO; ! ! This macro handles exclusion lists on command line ! MACRO exclusion_list TRIGGER { exclude_eq { at_file | exclude_list } }; END MACRO; ! ! This macro handles exclusion list files ! MACRO at_file SYNTAX { '@' exclude_file_name: id }; command_line_status = handle_exclude_file ( exclude_file_name ); ! CAll scan module to proces that file END MACRO; ! ! This macro handles the second, third, .. excludion list ids ! MACRO more_ids SYNTAX { [blanks] ',' [blanks] next_exclude_name: id }; exclude_tree (next_exclude_name) = TRUE; END MACRO; ! ! This macro processes an exclusion list on the command line ! MACRO exclude_list SYNTAX { first_one: id [ rest_of_the_list: { more_ids ... } ] }; exclude_tree (first_one) = TRUE; END MACRO; ! ! This macro get the input and output file names ! MACRO get_name TRIGGER { [blanks] inp: id [blanks out: id ] }; inp = UPPER( inp ); out = UPPER( out ); IF INDEX( inp, '.' ) = 0 THEN inp = inp & '.MAP'; END IF; IF out = '' THEN out = inp [1..index(inp, '.')] & 'CKM'; END IF; input_file_name = inp; output_file_name = out; END MACRO /* get_name */; !+ ! NAME ! check_map -- main routine for check_map software ! ! DESCRIPTION ! This main routine parses the command line figuring out ! what the input map file, output report file, and exclusion ! list is (if there is one). ! ! It then cals cmap_testor to do the guts of the map parsing. ! ! RETURN VALUE ! CHKMAP_OKAY, CHKMAP_BADMAP ! ! HISTORY ! 4-12-88 Bauer, Pollizzi Initial implementation. ! 4-14-88 Bauer Added exclusion list stuff. ! !- PROCEDURE Check_map MAIN; DECLARE in_string : STRING; ! Input command line DECLARE dummy_string : STRING; ! Bogus output string DECLARE exit_code : INTEGER; ! Exit status code command_line_status = lib$get_foreign( in_string, 'CKM>', *, *); ! Get input line ... IF command_line_status <> SS$_NORMAL THEN CALL lib$stop( command_line_status ); END IF; nolog = FALSE; START SCAN ! Scan the command line INPUT STRING in_string OUTPUT STRING dummy_string; IF command_line_status <> SS$_NORMAL THEN CALL lib$stop( command_line_status ); ! Stop this madness END IF; exit_code = CMAP_TESTOR( input_file_name, output_file_name); ! Call MAP scanning routine IF NOT NOLOG OR (NOLOG AND NOT (exit_code = CHKMAP_OKAY)) THEN CALL lib$signal( exit_code, 1, input_file_name ); ! Bubble back exit status END IF; END PROCEDURE /* Check_map */; END MODULE /* Check$map */;