/title "KERMIT Grammar" -- Author : Bruce Jolliffe -- This is the grammar for the KERMIT program procedure main_semantics for ks_exit_command, ks_finish_command, ks_server_command, ks_status_command, ks_get_simple_filename, ks_get_remote_filename, ks_get_local_filename, ks_error_bad_get_parm, ks_receive, ks_error_bad_receive_parm, ks_receive_local_filename, ks_save_filename, ks_send_simple_filename, ks_send_remote_filename, ks_send_local_filename, ks_error_bad_send_parm, ks_set_debug_on, ks_set_debug_off, ks_mcmd, ks_set_filetype_text, ks_set_filetype_binary, ks_set_filetype_mts_binary, ks_set_binary_blocksize, ks_set_text_blocksize, ks_set_delay, ks_bye_command, ks_set_failure, ks_set_line, ks_invalid_command, ks_error_on_off; procedure set_semantics for ks_my_end_of_line, ks_my_packet_length, ks_my_padding, ks_my_padchar, ks_my_quote, ks_my_start_of_packet, ks_my_timeout, ks_your_end_of_line, ks_your_packet_length, ks_your_padding, ks_your_padchar, ks_your_quote, ks_your_start_of_packet, ks_your_timeout, ks_set_packet_count_interval, ks_set_packet_count_interval_off, ks_set_escape; procedure show_semantics for kssh_my_end_of_line, kssh_my_packet_length, kssh_my_padding, kssh_my_padchar, kssh_my_quote, kssh_my_start_of_packet, kssh_my_timeout, kssh_your_end_of_line, kssh_your_packet_length, kssh_your_padding, kssh_your_padchar, kssh_your_quote, kssh_your_start_of_packet, kssh_your_timeout, kssh_binary_blocksize, kssh_notify, kssh_filetype, kssh_delay, kssh_debug; goal is *blanks* ; is "BYE" *blanks* *end_of_line* #ks_bye_command or "EXIT" *blanks* *end_of_line* #ks_exit_command or "FINISH" *blanks* *end_of_line* #ks_finish_command or or or "LOGOFF" *blanks* *end_of_line* #ks_bye_command or "QUIT" *blanks* *end_of_line* #ks_exit_command or "STOP" *blanks* *end_of_line* #ks_exit_command or or or "SERVER" *blanks* *end_of_line* #ks_server_command or or or "STATUS" *blanks* *end_of_line* #ks_status_command or or *blanks* *end_of_line* #ks_invalid_comman is "?" or "HELP"  *help_command*; is "GET" ; is or #ks_save_filename *blanks* *end_of_line* #ks_get_simple_filename or *end_of_line* #ks_error_bad is #ks_get_remot is #ks_save_filename *blanks* *end_of_line* #ks_get_local_filename; is "REC"!"EIVE"! ; is or *blanks* *end_of_line* #ks_receive or *end_of_line* #ks_error_bad is #ks_save_filename *blanks* *end_of_line* #ks_receive_local_filename; is "SEND" ; is or #ks_save_filename *blanks* *end_of_line* #ks_send_simple_filename or *end_of_line* #ks_error_bad_send is #ks_send_local_filename; is #ks_save_filename *blanks* *end_of_line* #ks_send_remote_filename; is "SET" ; is or or or or or or or or or or ; is "DEBUG" ; is *blanks* *end_of_line* #ks_set_debug_on or "ON" *blanks* *end_of_line* #ks_set_debug_on or "OFF" *blanks* *end_of_line* #ks_set_debug_off or *end_of_line* #ks_error_on_off; is "FILETYPE" ; is "TEXT" *blanks* *end_of_line* #ks_set_filetype_tex or "BIN"!"ARY"! *blanks* *end_of_line* #ks_set_filetype_bin or "MTS-BIN"!"ARY"! *blanks* *end_of_line* #ks_set_filetype_mt is "DELAY" *blanks* *integer* *blanks* *end_of_line* #ks_set_delay; is "RECEIVE" ; is "END-OF-LINE" *blanks* or "PACKET-LENGTH" *blanks* or "PADDING" *blanks* or "PADCHAR" *blanks* or "QUOTE" *blanks* or "START-OF-PACKET" *blanks* or "TIMEOUT" *blanks* ; is *integer* *blanks* *end_of_line* #ks_my_end_of_line; is *integer* *blanks* *end_of_line* #ks_my_packet_length; is *integer* *blanks* *end_of_line* #ks_my_padding; is *integer* *blanks* *end_of_line* #ks_my_padchar; is *integer* *blanks* *end_of_line* #ks_my_quote; is *integer* *blanks* *end_of_line* #ks_my_start_of_packet; is *integer* *blanks* *end_of_line* #ks_my_timeout; is "SEND" ; is "END-OF-LINE" *blanks* or "PACKET-LENGTH" *blanks* or "PADDING" *blanks* or "PADCHAR" *blanks* or "QUOTE" *blanks* or "START-OF-PACKET" *blanks* or "TIMEOUT" *blanks* ; is *integer* *blanks* *end_of_line* #ks_your_end_of_line; is *integer* *blanks* *end_of_line* #ks_your_packet_lengt is *integer* *blanks* *end_of_line* #ks_your_padding; is *integer* *blanks* *end_of_line* #ks_your_padchar; is *integer* *blanks* *end_of_line* #ks_your_quote; is *integer* *blanks* *end_of_line* #ks_your_start_of_pac is *integer* *blanks* *end_of_line* #ks_your_timeout; is "SHOW" ; is "BINARY-BLOCKSIZE" *blanks* *end_of_line* #kssh_binary_block or "DEBUG" *blanks* *end_of_line* #kssh_debug or "DELAY" *blanks* *end_of_line* #kssh_delay or "FILETYPE" *blanks* *end_of_line* #kssh_filetype or "NOTIFY" *blanks* *end_of_line* #kssh_notify or "RECEIVE" or "SEND" ; is "END-OF_LINE" *blanks* *end_of_line* #kssh_my_en or "PACKET-LENGTH" *blanks* *end_of_line* #kssh_my_pa or "PADDING" *blanks* *end_of_line* #kssh_my_pa or "PADCHAR" *blanks* *end_of_line* #kssh_my_pa or "QUOTE" *blanks* *end_of_line* #kssh_my_qu or "START-OF-PACKET" *blanks* *end_of_line* #kssh_my_s or "TIMEOUT" *blanks* *end_of_line* #kssh_my_ti is "END-OF-LINE" *blanks* *end_of_line* #kssh_your_ or "PACKET-LENGTH" *blanks* *end_of_line* #kssh_your_ or "PADDING" *blanks* *end_of_line* #kssh_your_ or "PADCHAR" *blanks* *end_of_line* #kssh_your_ or "QUOTE" *blanks* *end_of_line* #kssh_your_ or "START-OF-PACKET" *blanks* *end_of_line* #kssh_your or "TIMEOUT" *blanks* *end_of_line* #kssh_your_ is *blanks* "LINE" *blanks* ; is "*" "*" *blanks* *end_of_line* #ks_set_ terminal is 1 or more of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"; is "BINARY-BLOCKSIZE" *blanks* *integer* *blanks* *end_of_line* #ks_set_binary_block is "TEXT-BLOCKSIZE" *blanks* *integer* *blanks* *end_of_line* #ks_set_text_blocksi is "NOTIFY" *blanks* ; is *integer* *blanks* *end_of_line* #ks_set_packet_count_inte or "OFF" *blanks* *end_of_line* #ks_set_packet_count_inte is *blanks* "ESCAPE" *blanks* ; is *blanks* *end_of_line* #ks_set_escape; terminal is 1 character; is *end_of_line* #ks_set_failure; is "$" *blanks* *end_of_line* #ks_mcmd; terminal is 0 or more characters; terminal is 1 or more of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.<]$*-/%_>#:"; terminal is 1 or more excluding " ,"; terminal is 0 or more characters; terminal is 1 or more of " "; -- This section of the grammer is used to parse the PAR string when -- Kermit is called as a main program procedure par_string_semantics for ps_set_mode_user, ps_set_mode_server, ps_set_filetype_binary, ps_set_filetype_mts_binary, ps_set_filetype_text, ps_remote_mts, ps_set_debug; goal is *blanks* *blanks*  *blanks* *blanks* ... *end_of_line*; is "D"!"EBUG"! #ps_set_debug or "F"!"ILE"!"T"!"YPE"! "B"!"INARY"! #ps_set_filetype_binary or "F"!"ILE"!"T"!"YPE"! "MTS-B"!"INARY"! #ps_set_filetype_mts_binary or "F"!"ILE"!"T"!"YPE"! "T"!"EXT"! #ps_set_filetype_text or "RM" #ps_remote_mts or "S"!"ERVER"! #ps_set_mode_server or "U"!"SER"! #ps_set_mode_user; terminal is 1 of ", "; ---------------------------------------------------------------------------- -- Semantics for breaking an mts filename into its component parts procedure filename_semantics for ks_mts_simple_filename; goal is or ; is *End_Of_Line* #ks_mts_simple_f is *ccid* ":"; -- do a simple parse on filename. Use semantics to check the validity of -- the filename characters, viz. Fnametrt terminal is 1 to 12 excluding ": ";