!+ ! NAME ! scan_for_set_lib -- scans CMS command line to see if RCMS SET LIBRARY ! command has been executed. ! ! DESCRIPTION ! This module scans for SET LIB NODE::LIBARY commands and ! sends back the remote library name and TRUE if it finds them. ! ! RETURN VALUE ! ! HISTORY ! 7-19-88 Bauer Initial version. ! !- MODULE RCMS$SCAN_FOR_SET_LIB IDENT 'V1.0'; ! ! Set definitions ! SET digit ( '0' .. '9' ); SET alpha ( 'a'.. 'z' OR 'A'..'Z' OR '_' OR '$'); SET alpha_num ( alpha OR digit ); SET white_space ( ' ' OR S'ht' ); SET id_start ( alpha OR digit OR '_' OR '$' ); SET id_part ( alpha OR digit OR '_' OR '$' ); ! ! Token Definitions ! TOKEN blanks IGNORE { white_space [white_space ...] }; TOKEN help_T CASELESS { {'HE' | 'HEL' | 'HELP' } }; TOKEN set_T CASELESS { {'SE' | 'SET' } }; TOKEN library_T CASELESS { {'LI' | 'LIB' | 'LIBR' | 'LIBRA' | 'LIBRAR' | 'LIBRARY' } }; TOKEN identifier CASELESS { id_start [id_part ...] }; TOKEN semi_colon ALIAS ';' { ';' }; TOKEN lbracket ALIAS '[' { '[' }; TOKEN rbracket ALIAS ']' { ']' }; TOKEN quote ALIAS '"' { '"' }; TOKEN dot ALIAS '.' { '.' }; TOKEN equals ALIAS '=' { '=' }; TOKEN colon { ':' }; TOKEN colon_colon { '::' }; ! ! Global Variables ! DECLARE current_node : GLOBAL STRING; DECLARE current_cmslib : GLOBAL STRING; DECLARE node_name : STRING; DECLARE disk_name : STRING; DECLARE directory_name : STRING; DECLARE file_name : STRING; DECLARE set_lib_flag : GLOBAL INTEGER; DECLARE temp_library : GLOBAL STRING; DECLARE password_seen : GLOBAL INTEGER; !+ ! MACRO Definitions follow for MACROS: ! !- MACRO node_name_M SYNTAX { node1: { identifier colon_colon } | node2: { identifier quote identifier identifier quote colon_colon } }; IF node1 <> '' THEN node_name = node1; password_seen = 0; ELSE password_seen = 2; STOP SCAN; END IF; END MACRO; MACRO disk_spec_M SYNTAX { save_disk: { identifier colon } }; disk_name = UPPER(save_disk); END MACRO; MACRO dir_spec_M SYNTAX { save_dir: { '[' FIND ( ']' ) ']' } }; directory_name = directory_name & save_dir; END MACRO; MACRO file_spec_M SYNTAX { save_file: { [ identifier ] [ '.' [ identifier [ ';' [ identifier ] ] ] ] } }; file_name = UPPER(save_file); END MACRO; MACRO set_M SYNTAX { set_T }; END MACRO; MACRO library_M SYNTAX { library_T }; END MACRO; MACRO library_spec_M SYNTAX { save_node: node_name_M save_lib: { { disk_spec_M dir_spec_M ... } | file_spec_M } }; temp_library = node_name & disk_name & directory_name & file_name; END MACRO; MACRO set_lib_command_M TRIGGER { set_T library_T library_spec_M }; EXTERNAL PROCEDURE send_full_lib_name_back ( STRING ); set_lib_flag = 1; CALL send_full_lib_name_back ( temp_library ); STOP SCAN; END MACRO; ! ! PROCEDURES Follow ! PROCEDURE scan_for_set_lib ( tcommand : STRING ) OF INTEGER; DECLARE trash_bin : STRING; set_lib_flag = 0; node_name = ''; disk_name = ''; directory_name = ''; file_name = ''; START SCAN INPUT STRING tcommand OUTPUT STRING trash_bin; IF password_seen = 0 THEN return (set_lib_flag); ELSE return (password_seen); END IF; END PROCEDURE; END MODULE;