! EVE$WILDCARD.TPU 31-DEC-1992 12:18 Page 1 module eve$wildcard ident "V03-008" ! ! COPYRIGHT © 1986,1992 BY ! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS ! ALL RIGHTS RESERVED ! ! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED ! ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE ! INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER ! COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY ! OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY ! TRANSFERRED. ! ! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE ! AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT ! CORPORATION. ! ! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS ! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. ! !++ ! FACILITY: ! DECTPU - Text Processing Utility ! EVE - Extensible Versatile Editor ! ! ABSTRACT: ! This is the source program for the EVE interface synonym creation. ! ! ENVIRONMENT: ! OpenVMS VAX, OpenVMS AXP, RISC/ULTRIX ! ! Author: Jim Burrows ! ! CREATION DATE: 30-Oct-1986 ! ! MODIFIED BY: ! !-- ! EVE$WILDCARD.TPU Page 2 !++ ! Table of Contents ! ! EVE$WILDCARD.TPU ! 31-DEC-1992 12:18 ! ! Procedure name Page Description ! -------------- ---- ------------ ! ! eve_wildcard_find 3 WILDCARD FIND ! eve$$build_pattern 4 Build a pattern for wildcard ! eve$$get_wild_token 5 Get the next wildcard token ! eve$$eat_wild_code 6 Test for a specific code ! eve$wild_code 7 INT => wildcard function ! eve$$do_sub_pattern 8 Collect the current sub-pattern ! eve_set_wildcard_ultrix 9 Use Ultrix regular expressions ! eve_set_wildcard_vms 9 Use normal wildcarding ! eve_show_wildcards 10 Show the syntax ! eve$$dump_wildcard 11 One syntax line !-- ! EVE$WILDCARD.TPU Page 3 procedure eve_wildcard_find ! WILDCARD FIND (target) local saved_direction, status, found_range, how_exact; on_error [TPU$_CONTROLC]: if (saved_direction <> current_direction) and (get_info (saved_direction, "type") = KEYWORD) then set (saved_direction, current_buffer); endif; eve$learn_abort; abort; [OTHERWISE]: if (saved_direction <> current_direction) and (get_info (saved_direction, "type") = KEYWORD) then set (saved_direction, current_buffer); endif; endon_error; if current_window = eve$prompt_window then eve$learn_abort; return (FALSE); ! already a find(?) going on endif; if not eve$declare_intention (eve$k_action_reposition) then return (FALSE); endif; saved_direction := current_direction; status := eve$get_find_target (target, how_exact, 2); if status = eve$k_success then found_range := eve$find_target (how_exact, 2, 1); if found_range = eve$k_async_prompting then return (TRUE); ! wait for dialog box ok before changing direction else status := eve$remember_found (found_range); endif; else if status = eve$k_async_prompting then return (TRUE); ! wait for dialog box to supply target endif; endif; eve$x_old_find_direction := current_direction; set (saved_direction, current_buffer); if not status then eve$learn_abort; endif; return (status); endprocedure; ! eve_wildcard_find ! EVE$WILDCARD.TPU Page 4 !++ ! Build a pattern for pattern searching. Pattern characters are: ! ! % single-character wildcard ! * multi-character wildcard, do not cross record boundaries ! ** multi-character wildcard, cross record boundaries ! \* literal star ! \% literal percent ! \\ literal back-slash ! \< Beginning of line ! \> End of line ! \W whitespace (including up to one line-break) ! ! And now many others, listed in the table below (in the package init) ! ! EVE$$BUILD_PATTERN takes a search string in INPUT_STRING and returns either ! a search string or a pattern string in RESULT_STRING. If RESULT_STRING ! is a search string, EVE$$BUILD_PATTERN returns 0. If it is a pattern ! string, EVE$$BUILD_PATTERN returns 1. If an error occurs, it returns ! the error. !-- procedure eve$$build_pattern ! Build a pattern for wildcard (input_string, result_string, leading_whitespace) local pattern_string, the_string, i, j, the_char, start_char, end_char, the_code, push_back, the_function, the_pattern, sub_pattern, is_double, temp, status, code_quote, code_close, code_not; on_error [OTHERWISE]: ; endon_error; leading_whitespace := FALSE; code_quote := eve$wild_code (1); code_close := eve$wild_code (8); code_not := eve$wild_code (29); pattern_string := ""; the_string := ""; i := 1; the_function := ""; the_pattern := ""; sub_pattern := ""; !+ ! Process each character in the input string !- loop if push_back > 1 then the_code := push_back; push_back := 0; else the_code := eve$$get_wild_token (the_char, input_string, i); endif; exitif the_code < 0; case the_code [0]: ! Ordinary character if the_char = "'" then pattern_string := pattern_string + "'"; endif; pattern_string := pattern_string + the_char; the_string := the_string + the_char; [1]: ! Escape (and quote) eve$message (EVE$_UNRECWILDFIND2, 0, code_quote, the_char); return EVE$_UNRECWILDFIND2; [2]: ! Star - Wildcard !+ ! General wildcard, not crossing record boundaries ! ! Eat following * and % !- status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := ""; is_double := eve$$eat_wild_code (2, input_string, i); !+ ! Use REMAIN if at end of input_string !- if i > length (input_string) then the_pattern := the_pattern + "+ remain"; else if eve$$eat_wild_code (5, input_string, i) or eve$$eat_wild_code (6, input_string, i) then the_pattern := the_pattern + "+ remain"; else !+ ! Use the MATCH built-in. We will accumulate ! MATCH characters until another special marker ! is encountered. !- if is_double then the_function := "matchl"; else the_function := "match"; endif; endif; endif; [3]: ! Percent -- arb !+ ! Single-character wildcard. ! ! Start by counting consecutive %s !- status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; j := 1; loop exitif not eve$$eat_wild_code (3, input_string, i); j := j + 1; endloop; !+ ! Put it in the pattern !- sub_pattern := "+ arb(" + str (j) + ")"; [4]: ! Space status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; leading_whitespace := (i = length (eve$wild_code (4)) + 1); sub_pattern := "+ eve$$x_ws_pat"; loop exitif not eve$$eat_wild_code (4, input_string, i); endloop; [5]: ! \< Beginning of line status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ line_begin"; [6]: ! \> End of line status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ line_end"; [7]: ! \[ Start of any status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := ""; the_function := "any"; if eve$$eat_wild_code (29, input_string, i) then the_function := "notany"; endif; j := 0; loop exitif i > length (input_string); exitif eve$$eat_wild_code (8, input_string, i); the_char := substr (input_string, i, 1); i := i + 1; j := j + 1; if the_char = code_quote then the_char := substr (input_string, i, 1); i := i + 1; endif; if (the_char = "-") and (j > 1) then if eve$$eat_wild_code (8, input_string, i) then pattern_string := pattern_string + the_char; exitif 1; endif; eve$$eat_wild_code (1, input_string, i); start_char := substr (pattern_string, length (pattern_string), 1); pattern_string := substr (pattern_string, 1, length (pattern_string) - 1); end_char := substr (input_string, i, 1); i := i + 1; if end_char = code_quote then end_char := substr (input_string, i, 1); i := i + 1; endif; start_char := index (eve$$x_all_characters, start_char); end_char := index (eve$$x_all_characters, end_char); if start_char < end_char then pattern_string := pattern_string + substr (eve$$x_all_characters, start_char, (end_char - start_char) + 1); else pattern_string := pattern_string + substr (eve$$x_all_characters, end_char, (start_char - end_char) + 1); endif; j := 0; else pattern_string := pattern_string + the_char; endif; endloop; status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, 8); if get_info (status, "type") = KEYWORD then return status; endif; [8]: ! \] close of any pattern_string := pattern_string + code_close; the_string := the_string + code_close; [9]: ! \: Repeat (minimum of 1) if the_function = "" then if pattern_string <> "" then temp := substr (pattern_string, length (pattern_string), 1); pattern_string := substr (pattern_string, 1, length (pattern_string) - 1); status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ span('" + temp + "')"; else if substr (sub_pattern, 3, 4) = "any(" then sub_pattern := substr (sub_pattern, 1, 2) + "span(" + substr (sub_pattern, 7, length (sub_pattern)); else if substr (sub_pattern, 3, 4) = "arb(" then push_back := 2; else if substr (sub_pattern, 3, 7) = "notany(" then sub_pattern := substr (sub_pattern, 1, 2) + "scan(" + substr (sub_pattern, 10, length (sub_pattern)); else eve$message (EVE$_BADREPEATUSE); return EVE$_BADREPEATUSE; endif; endif; endif; endif; else if the_function = "match" then if length (pattern_string) > 1 then temp := substr (pattern_string, length (pattern_string), 1); pattern_string := substr (pattern_string, 1, length (pattern_string) - 1); status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ span('" + temp + "')"; else if length (pattern_string) = 1 then temp := substr (pattern_string, length (pattern_string), 1); status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ (span('" + temp + "') | '')"; else eve$message (EVE$_CANTREPEATWILD); return EVE$_CANTREPEATWILD; endif; endif; else eve$message (EVE$_BADREPEATUSE); return EVE$_BADREPEATUSE; endif; endif; [10]: ! \. Repeat (minimum of 0) if the_function = "" then if pattern_string <> "" then temp := substr (pattern_string, length (pattern_string), 1); pattern_string := substr (pattern_string, 1, length (pattern_string) - 1); status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ (span('" + temp + "') | '')"; else if substr (sub_pattern, 3, 4) = "any(" then sub_pattern := substr (sub_pattern, 1, 2) + "(span(" + substr (sub_pattern, 7, length (sub_pattern)) + " | '')"; else if substr (sub_pattern, 3, 4) = "arb(" then sub_pattern := ""; push_back := 2; else if substr (sub_pattern, 3, 7) = "notany(" then sub_pattern := substr (sub_pattern, 1, 2) + "(scan(" + substr (sub_pattern, 10, length (sub_pattern)) + " | '')"; else eve$message (EVE$_BADREPEATUSE); return EVE$_BADREPEATUSE; endif; endif; endif; endif; else if the_function = "match" then if length (pattern_string) > 1 then temp := substr (pattern_string, length (pattern_string), 1); pattern_string := substr (pattern_string, 1, length (pattern_string) - 1); status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ (span('" + temp + "') | '')"; else if length (pattern_string) = 1 then the_function := "(" + the_function; status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; sub_pattern := sub_pattern + "| remain)"; else eve$message (EVE$_CANTREPEATWILD); return EVE$_CANTREPEATWILD; endif; endif; else eve$message (EVE$_BADREPEATUSE); return EVE$_BADREPEATUSE; endif; endif; [11]: ! \d Decimal digit status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ any('1234567890')"; [12]: ! \o Octal digit status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ any('01234567')"; [13]: ! \x Hex digit status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ any('1234567890abcdefABCDEF')"; [14]: ! \a Alphabetic char status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ any(eve$$x_wild_a)"; [15]: ! \n Alphanumeric status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ any(eve$$x_wild_n)"; [16]: ! \s Symbol constituent status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ any(eve$$x_wild_s)"; [17]: ! \l Lower case letter status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; ! NOTE: UPPERCASE IS REQUIRED TO FORCE CASE-EXACT SEARCHES sub_pattern := "+ any(EVE$$X_WILD_L)"; [18]: ! \u Upper case letter status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; ! NOTE: UPPERCASE IS REQUIRED TO FORCE CASE-EXACT SEARCHES sub_pattern := "+ any(EVE$$X_WILD_U)"; [19]: ! \p Punctuation mark status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ any(eve$$x_wild_p)"; [20]: ! \f Formatting character status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ any(eve$$x_wild_f)"; [21]: ! \^ control status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ any(eve$$x_wild_control)"; [22]: ! \+ Characters 128-255 status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := "+ any(eve$$x_wild_bit_7)"; [29]: ! ~ Not used in \[] pattern_string := pattern_string + code_not; the_string := the_string + code_not; [INRANGE]: eve$message (EVE$_UNIMPLWILDFIND, 0, the_char); return EVE$_UNIMPLWILDFIND; [OUTRANGE]: eve$message (EVE$_UNRECWILDFIND1, 0, the_char); return EVE$_UNRECWILDFIND1; endcase; endloop; !+ ! Empty out pattern_string into the_pattern !- status := eve$$do_sub_pattern (sub_pattern, the_function, pattern_string, the_code); if get_info (status, "type") = KEYWORD then return status; endif; the_pattern := the_pattern + sub_pattern; sub_pattern := ""; the_pattern := substr (the_pattern, 3, length (the_pattern) - 2); !+ ! Return either a string or a pattern string !- if the_pattern = "eve$$x_ws_pat" then leading_whitespace := FALSE; endif; if eve$x_debug then eve$message (EVE$_PATTERN, 0, the_pattern); endif; if the_pattern <> "'" + the_string + "'" then result_string := the_pattern; return 1; else result_string := the_string; return 0; endif; endprocedure ! eve$$build_pattern ! EVE$WILDCARD.TPU Page 5 procedure eve$$get_wild_token ! Get the next wildcard token (the_char, input_string, i) local the_code, lower_char; on_error [OTHERWISE]: ; endon_error; if i > length (input_string) then return - 1; else the_char := substr (input_string, i, 1); if the_char <> "'" then lower_char := the_char; change_case (lower_char, LOWER); the_code := index (eve$$x_wild_functions, lower_char); if the_code = 1 ! Saw "\" then i := i + 1; the_char := substr (input_string, i, 1); lower_char := the_char; change_case (lower_char, LOWER); the_code := index (eve$$x_wild_sub_functions, lower_char); if the_code = 0 ! Not \<, \> or \\ then the_code := index (eve$$x_wild_functions, lower_char); if the_code = 0 ! Not \*, \%, etc then the_code := 1; else ! Saw \*, \%, etc the_code := 0; endif; else if the_code = 1 ! Saw \\ then the_code := 0; endif; endif; endif; endif; i := i + 1; return (the_code); endif; endprocedure; ! eve$$get_wild_token ! EVE$WILDCARD.TPU Page 6 procedure eve$$eat_wild_code ! Test for a specific code (the_code, input_string, i) local the_length, the_string; on_error [OTHERWISE]: ; endon_error; the_string := eve$wild_code (the_code); the_length := length (the_string); if the_length = 0 then return (FALSE); endif; if substr (input_string, i, the_length) = the_string then i := i + the_length; return TRUE; else return FALSE; endif; endprocedure; ! eve$$eat_wild_code ! EVE$WILDCARD.TPU Page 7 procedure eve$wild_code ! INT => wildcard function (the_code) local temp; on_error [OTHERWISE]: ; endon_error; temp := substr (eve$$x_wild_functions, the_code, 1); if the_code <> 1 then if temp = substr (eve$$x_wild_functions, 1, 1) then temp := temp + substr (eve$$x_wild_sub_functions, the_code, 1); endif; endif; if temp = substr (eve$$x_wild_functions, 1, 1) + substr (eve$$x_wild_functions, 1, 1) then temp := ""; endif; return (temp); endprocedure; ! eve$wild_code ! EVE$WILDCARD.TPU Page 8 procedure eve$$do_sub_pattern ! Collect the current sub-pattern (sub_pattern, the_function, the_string, the_code) on_error [OTHERWISE]: ; endon_error; if the_function <> "" then if the_string <> "" then if the_function = "matchl" !*** Proposed, but unimplimented then sub_pattern := sub_pattern + "+ " + "(unanchor+'" + the_string + "')"; else sub_pattern := sub_pattern + "+ " + the_function + "('" + the_string + "')"; endif; the_string := ""; else eve$message (EVE$_NOPRECEDTEXT, 0, eve$wild_code (the_code)); return EVE$_NOPRECEDTEXT; endif; the_function := ""; else if the_string <> "" then sub_pattern := sub_pattern + "+ '" + the_string + "'"; the_string := ""; endif; endif; endprocedure; ! eve$$do_sub_pattern ! EVE$WILDCARD.TPU Page 9 procedure eve_set_wildcard_ultrix ! Use Ultrix regular expressions eve$$x_wild_patterns := "ULTRIX"; eve$$x_wild_functions := "\\.\^$[]+*\\\\\\\\\\\\\\\\\\^"; eve$$x_wild_sub_functions := "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"; eve$message (EVE$_WILDCARDULTRIX); return (TRUE); endprocedure; ! eve_set_wildcard_ultrix procedure eve_set_wildcard_vms ! Use normal wildcarding eve$$x_wild_patterns := "VMS"; eve$$x_wild_functions := "\*%\\\\]\\\\\\\\\\\\\\\\\\\\~"; eve$$x_wild_sub_functions := "\\\w<>[\:.doxanslupf^+\\\\\\\"; eve$message (EVE$_WILDCARDVMS); return (TRUE); endprocedure; ! eve_set_wildcard_vms ! EVE$WILDCARD.TPU Page 10 procedure eve_show_wildcards ! Show the syntax local code_open, code_close, code_not, code_quote, the_code, i, saved_window, ! Remember window saved_mark, ! Position in current window the_pattern, temp; on_error [TPU$_CONTROLC]: if get_info (tpu$x_show_window, "buffer") <> 0 then unmap (tpu$x_show_window); endif; eve$$restore_position (saved_window, saved_mark); eve$learn_abort; abort; [OTHERWISE]: if get_info (tpu$x_show_window, "buffer") <> 0 then unmap (tpu$x_show_window); endif; eve$$restore_position (saved_window, saved_mark); endon_error; saved_mark := mark (FREE_CURSOR); saved_window := current_window; position (tpu$x_show_buffer); map (tpu$x_show_window, tpu$x_show_buffer); erase (tpu$x_show_buffer); the_pattern := eve$$x_wild_patterns; copy_text (message_text (EVE$_SHOWBUFPATTERN, 1, the_pattern)); split_line; split_line; copy_text (message_text (EVE$_PATTMATCHES, 1)); split_line; split_line; eve$$dump_wildcard (2, message_text (EVE$_ARBTEXTLINE, 1)); temp := eve$wild_code (2); if temp <> "" then copy_text (fao (" !9 !AS", temp, temp, message_text (EVE$_ARBTEXTCROSLINE, 1))); split_line; endif; eve$$dump_wildcard (3, message_text (EVE$_ARBCHARACTER, 1)); eve$$dump_wildcard (5, message_text (EVE$_BEGINLINE, 1)); eve$$dump_wildcard (6, message_text (EVE$_ENDOFLINE, 1)); code_open := eve$wild_code (7); code_close := eve$wild_code (8); code_not := eve$wild_code (29); if (code_open <> "") and (code_close <> "") then copy_text (fao (" !9 !AS", code_open, code_close, message_text (EVE$_ANYINSETABC, 1))); split_line; copy_text (fao (" !9 !AS", code_open, code_close, message_text (EVE$_ANYINSET123, 1))); split_line; copy_text (fao (" !9 !AS", code_open, code_not, code_close, message_text (EVE$_ANYNOTINSET123, 1))); split_line; endif; eve$$dump_wildcard (10, message_text (EVE$_REPPATTZERO, 1)); eve$$dump_wildcard (9, message_text (EVE$_REPPATTATONCE, 1)); code_quote := eve$wild_code (1); temp := eve$wild_code (1); i := 2; loop exitif i > 29; the_code := substr (eve$$x_wild_functions, i, 1); if the_code <> code_quote then temp := temp + the_code; endif; i := i + 1; endloop; if temp <> "" then eve$$dump_wildcard (1, message_text (EVE$_MAYQUOTEANY, 0, temp)); endif; eve$$dump_wildcard (4, message_text (EVE$_ARBWHITESPC, 1)); eve$$dump_wildcard (11, message_text (EVE$_DECIMALDIG, 1)); eve$$dump_wildcard (12, message_text (EVE$_OCTALDIG, 1)); eve$$dump_wildcard (13, message_text (EVE$_HEXDIG, 1)); eve$$dump_wildcard (14, message_text (EVE$_ALPHAINCLSUPPL, 1)); eve$$dump_wildcard (15, message_text (EVE$_ALPHANUMCHAR, 1)); eve$$dump_wildcard (16, message_text (EVE$_SYMBOLCONSTIT, 1)); eve$$dump_wildcard (17, message_text (EVE$_LOWERCASELETTER, 1)); eve$$dump_wildcard (18, message_text (EVE$_UPPERCASELETTER, 1)); eve$$dump_wildcard (19, message_text (EVE$_PUNCTUATIONCHAR, 1)); eve$$dump_wildcard (20, message_text (EVE$_FORMATCHAR, 1)); eve$$dump_wildcard (21, message_text (EVE$_CONTROLCHAR, 1)); eve$$dump_wildcard (22, message_text (EVE$_BIT7SET, 1)); eve$$dump_wildcard (23, message_text (EVE$_ANYORBOLEOL, 1)); eve$$dump_wildcard (24, message_text (EVE$_OPENPAREN, 1)); eve$$dump_wildcard (25, message_text (EVE$_CLOSEPAREN, 1)); eve$$dump_wildcard (26, message_text (EVE$_PREVNEXTPATTERN, 1)); eve$$dump_wildcard (27, message_text (EVE$_BOTTOMFILE, 1)); position (beginning_of (tpu$x_show_buffer)); eve$set_status_line (tpu$x_show_window); endprocedure ! eve_show_wildcards ! EVE$WILDCARD.TPU Page 11 procedure eve$$dump_wildcard ! One syntax line (the_code, the_text) local temp; on_error [OTHERWISE]: ; endon_error; temp := eve$wild_code (the_code); if temp <> "" then copy_text (fao (" !9 !AS", temp, the_text)); split_line; endif; endprocedure; ! eve$$dump_wildcard ! EVE$WILDCARD.TPU Page 12 ! Module initialization code local temp; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!! Sync these with EVE_SET_WILDCARD_VMS/ULTRIX !!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if eve$x_ultrix_active then eve$$x_wild_patterns := "ULTRIX"; eve$$x_wild_functions := "\\.\^$[]+*\\\\\\\\\\\\\\\\\\^"; eve$$x_wild_sub_functions := "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"; else eve$$x_wild_patterns := "VMS"; eve$$x_wild_functions := "\*%\\\\]\\\\\\\\\\\\\\\\\\\\~"; eve$$x_wild_sub_functions := "\\\w<>[\:.doxanslupf^+\\\\\\\"; endif; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! function: \*%\\\\]\\\\\\\\\\\\\\\\\\\\~ ! sub_function: \\\w<>[\:.doxanslupf^+\\\\\\\ ! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ! 1 \ Introducer ---------------+|||||||||||||||||||||||||||| ! 2 * Wildcard ------------------+||||||||||||||||||||||||||| ! 3 % ARB (place holder)----------+|||||||||||||||||||||||||| ! 4 \w Whitespace ------------------+||||||||||||||||||||||||| ! 5 \< BOL --------------------------+|||||||||||||||||||||||| ! 6 \> EOL ---------------------------+||||||||||||||||||||||| ! 7 \[ ANY (set of characters)---------+|||||||||||||||||||||| ! 8 ] Close ANY -----------------------+||||||||||||||||||||| ! 9 \: REPEAT (at least 1) --------------+|||||||||||||||||||| ! 10 \. REPEAT (zero or more) -------------+||||||||||||||||||| ! 11 \d Decimal digit ----------------------+|||||||||||||||||| ! 12 \o Octal digit -------------------------+||||||||||||||||| ! 13 \x Hex digit ----------------------------+|||||||||||||||| ! 14 \a Alphabetic ----------------------------+||||||||||||||| ! 15 \n Alphanumeric ---------------------------+|||||||||||||| ! 16 \s Symbol constituent ----------------------+||||||||||||| ! 17 \l Lower case letter ------------------------+|||||||||||| ! 18 \u Upper case letter -------------------------+||||||||||| ! 19 \p Punctuation character-----------------------+|||||||||| ! 20 \f Formatting character-------------------------+||||||||| ! 21 \^ Control (C0 or C1) character------------------+|||||||| ! 22 \+ Any character with bit 7 set-------------------+||||||| ! 23 \? Any character or BOL, EOL (BOF, & EOF)----------+|||||| ! 24 \( Open Parenthesis for grouping -------------------+||||| ! 25 \) Close Parentesis for grouping --------------------+|||| ! 26 \| Previous pattern or next pattern ------------------+||| ! 27 \b Bottom of file -------------------------------------+|| ! 28 \t Top of file -----------------------------------------+| ! 29 ~ Not (used in \[...]) ---------------------------------+ eve$$x_wild_a := "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" %if eve$x_option_2byte %then %else +"àáâãäåæçèéêëìíîïñòóôõö÷øùúûüý" + "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖ×ØÙÚÛÜÝß" %endif ; eve$$x_wild_l := "abcdefghijklmnopqrstuvwxyz" %if eve$x_option_2byte %then %else +"àáâãäåæçèéêëìíîïñòóôõö÷øùúûüýß" %endif ; eve$$x_wild_u := "ABCDEFGHIJKLMNOPQRSTUVWXYZ" %if eve$x_option_2byte %then %else +"ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖ×ØÙÚÛÜÝ" %endif ; eve$$x_wild_n := eve$x_alphanumeric_characters; eve$$x_wild_s := eve$x_symbol_characters; eve$$x_wild_p := " !""#$%&'()*+,-./0123456789:;<=>?@" + "[\]^_`{|}~" %if eve$x_option_2byte %then %else +"¡¢£¥§¨©ª«°±²³µ¶·¹º»¼½¿" %endif ; eve$$x_wild_f := ascii (8) + ascii (9) + ascii (10) + ascii (11) + ascii (12) + ascii (13); eve$$x_all_characters := ascii (0) + ascii (1) + ascii (2) + ascii (3) + ascii (4) + ascii (5) + ascii (6) + ascii (7) + ascii (8) + ascii (9) + ascii (10) + ascii (11) + ascii (12) + ascii (13) + ascii (14) + ascii (15) + ascii (16) + ascii (17) + ascii (18) + ascii (19) + ascii (20) + ascii (21) + ascii (22) + ascii (23) + ascii (24) + ascii (25) + ascii (26) + ascii (27) + ascii (28) + ascii (29) + ascii (30) + ascii (31) + " !""#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~" + ascii (127) + %if eve$x_option_2byte %then ""; %else ascii (128) + ascii (129) + ascii (130) + ascii (131) + ascii (132) + ascii (133) + ascii (134) + ascii (135) + ascii (136) + ascii (137) + ascii (138) + ascii (139) + ascii (140) + ascii (141) + ascii (142) + ascii (143) + ascii (144) + ascii (145) + ascii (146) + ascii (147) + ascii (148) + ascii (149) + ascii (150) + ascii (151) + ascii (152) + ascii (153) + ascii (154) + ascii (155) + ascii (156) + ascii (157) + ascii (158) + ascii (159) + " ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿" + "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß" + "àáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ" + ascii (255); %endif eve$$x_wild_control := substr (eve$$x_all_characters, 1, 32) + substr (eve$$x_all_characters, 129, 32); %if eve$x_option_2byte %then %else eve$$x_wild_bit_7 := substr (eve$$x_all_characters, 129, 128); %endif endmodule; ! EVE$WILDCARD.TPU Page 13 ! ! EVE$BUILD time executable code ! define_key (eve$$kt_return + "eve_wildcard_find ('')", key_name (E1, SHIFT_KEY), " wildcard_find", eve$x_standard_keys); eve$$require ("eve$core");