COMPILATION LISTING OF SEGMENT hyphenate_word_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/18/82 1647.6 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 hyphenate_word_: proc (pm_word, pm_space, pm_hpoint, pm_code); 12 13 /* This procedure finds the rightmost hyphenation point within 14* a specified word that fits within a specified number of spaces. 15**/ 16 17 /* Coded 10/19/77 by J. Stern */ 18 /* Modified 3/5/80 by E. Wallman to incorporate changes in J. Stern's */ 19 /* private version that never got into the >unb product. */ 20 /* Modified 7/10/81 by P. Benjamin to reflect change in find_dict_word_ 21* calling sequence. */ 22 23 /* Parameters */ 24 25 dcl pm_word char (*); /* the word to be hyphenated (Input) */ 26 dcl pm_space fixed bin; /* the space available up to and including the hyphen (Input) */ 27 dcl pm_hpoint fixed bin; /* the hyphenation point (Output) */ 28 dcl pm_code fixed bin (35); /* an error code (Output) */ 29 30 31 /* Automatic */ 32 33 dcl nargs fixed bin; 34 dcl space fixed bin; 35 dcl i fixed bin; 36 dcl code fixed bin (35); 37 dcl word_found char (256); 38 dcl dict_path char (168); 39 dcl word char (256); 40 dcl word_len fixed bin; 41 dcl (leader, trailer) fixed bin; 42 43 dcl 1 descriptor aligned, 44 2 hpoints bit (32) unal, 45 2 pad bit (4) unal; 46 47 /* Based */ 48 49 dcl based_descrip bit (36) aligned based (addr (descriptor)); 50 51 52 /* Static */ 53 54 dcl error_table_$id_not_found fixed bin (35) ext; 55 56 57 /* Builtins */ 58 59 dcl (length, substr, addr, index, reverse, min, dim, verify, null) builtin; 60 61 62 /* Entries */ 63 64 dcl find_dict_word_ entry (char (*), bit (36) aligned, char (256), 65 bit (36) aligned, char (168), ptr, fixed bin (35)); 66 dcl cu_$arg_count entry (fixed bin); 67 68 call cu_$arg_count (nargs); /* see how many args */ 69 if nargs = 4 /* fourth arg is optional */ 70 then pm_code = 0; 71 pm_hpoint = 0; 72 73 leader, trailer = 0; /* do punctuation stripping */ 74 leader = verify (pm_word, "([{""") -1; 75 if leader = -1 76 then return; 77 trailer = verify (reverse (pm_word), " )]}""!,.;:?") -1; 78 if trailer = -1 79 then return; 80 81 word_len = length (pm_word) - leader - trailer; 82 if word_len > 256 83 then return; 84 word = substr (pm_word, leader+1, word_len); 85 86 space = pm_space - leader; 87 if space < 2 | space > length (pm_word) 88 then return; 89 space = min (space, word_len); 90 91 /* first_try = "1"b; */ 92 retry: call find_dict_word_ (word, ""b, word_found, based_descrip, dict_path, null, code); 93 if code ^= 0 /* | based_descrip = ""b */ 94 then do; 95 96 /* The code following involves parts-of-speech processing that was rejected 97* for the >unb product. It is preserved here for posterity. */ 98 99 /* dcl first_try bit (1) aligned; 100* /*dcl new_suffix (6) char (1) varying int static options (constant) init ("y", "o", "", "y", "", ""); 101* /*dcl (si, sl) fixed bin; 102* /*dcl suffix (6) char (3) varying int static options (constant) init ("ies", "oes", "s", "ied", "ed", "ing"); 103* /*dcl suffix_syllable (6) bit (1) int static options (constant) init ((5) (1) "0"b, "1"b); 104* /* if first_try 105* /* then do si = 1 to dim (suffix, 1); /* see if we recognize a suffix */ 106 /* sl = length (suffix (si)); 107* /* if substr (word, word_len-sl+1, sl) = suffix (si) 108* /* then do; 109* /* first_try = "0"b; 110* /* substr (word, word_len-sl+1, sl) = new_suffix (si); 111* /* word_len = word_len -sl + length (new_suffix (si)); 112* /* go to retry; 113* /* end; 114* /* end; */ 115 116 if nargs = 4 117 then if code ^= error_table_$id_not_found 118 then pm_code = code; 119 return; 120 end; 121 122 /* if ^first_try 123* /* then if suffix_syllable (si) 124* /* then if word_len <= 32 125* /* then substr (descriptor.hpoints, word_len, 1) = "1"b; */ 126 127 space = min (33, space); 128 i = index (reverse (substr (descriptor.hpoints, 1, space-1)), "1"b); 129 if i ^= 0 130 then do; 131 i = space - i; 132 if i < word_len 133 then if substr (word, i+1, 1) = "-" 134 then if nargs = 4 135 then i = i + 1; 136 else return; /* runoff can't handle this */ 137 pm_hpoint = i + leader; 138 end; 139 140 end hyphenate_word_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/18/82 1629.2 hyphenate_word_.pl1 >dumps>old>recomp>hyphenate_word_.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. addr builtin function dcl 59 ref 92 based_descrip based bit(36) dcl 49 set ref 92* code 000103 automatic fixed bin(35,0) dcl 36 set ref 92* 93 116 116 cu_$arg_count 000014 constant entry external dcl 66 ref 68 descriptor 000361 automatic structure level 1 dcl 43 set ref 92 dict_path 000204 automatic char(168) unaligned dcl 38 set ref 92* error_table_$id_not_found 000010 external static fixed bin(35,0) dcl 54 ref 116 find_dict_word_ 000012 constant entry external dcl 64 ref 92 hpoints 000361 automatic bit(32) level 2 packed unaligned dcl 43 set ref 128 i 000102 automatic fixed bin(17,0) dcl 35 set ref 128* 129 131* 131 132 132 132* 132 137 index builtin function dcl 59 ref 128 leader 000357 automatic fixed bin(17,0) dcl 41 set ref 73* 74* 75 81 84 86 137 length builtin function dcl 59 ref 81 87 min builtin function dcl 59 ref 89 127 nargs 000100 automatic fixed bin(17,0) dcl 33 set ref 68* 69 116 132 null builtin function dcl 59 ref 92 92 pm_code parameter fixed bin(35,0) dcl 28 set ref 11 69* 116* pm_hpoint parameter fixed bin(17,0) dcl 27 set ref 11 71* 137* pm_space parameter fixed bin(17,0) dcl 26 ref 11 86 pm_word parameter char unaligned dcl 25 ref 11 74 77 81 84 87 reverse builtin function dcl 59 ref 77 128 space 000101 automatic fixed bin(17,0) dcl 34 set ref 86* 87 87 89* 89 127* 127 128 131 substr builtin function dcl 59 ref 84 128 132 trailer 000360 automatic fixed bin(17,0) dcl 41 set ref 73* 77* 78 81 verify builtin function dcl 59 ref 74 77 word 000256 automatic char(256) unaligned dcl 39 set ref 84* 92* 132 word_found 000104 automatic char(256) unaligned dcl 37 set ref 92* word_len 000356 automatic fixed bin(17,0) dcl 40 set ref 81* 82 84 89 132 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. dim builtin function dcl 59 NAMES DECLARED BY EXPLICIT CONTEXT. hyphenate_word_ 000022 constant entry external dcl 11 retry 000131 constant label dcl 92 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 736 754 660 746 Length 1124 660 16 133 56 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME hyphenate_word_ 280 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME hyphenate_word_ 000100 nargs hyphenate_word_ 000101 space hyphenate_word_ 000102 i hyphenate_word_ 000103 code hyphenate_word_ 000104 word_found hyphenate_word_ 000204 dict_path hyphenate_word_ 000256 word hyphenate_word_ 000356 word_len hyphenate_word_ 000357 leader hyphenate_word_ 000360 trailer hyphenate_word_ 000361 descriptor hyphenate_word_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_ext_out return shorten_stack ext_entry_desc reverse_bs set_bs_eis index_bs_eis THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. cu_$arg_count find_dict_word_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$id_not_found LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000015 68 000035 69 000043 71 000050 73 000052 74 000054 75 000067 77 000071 78 000102 81 000104 82 000110 84 000112 86 000116 87 000121 89 000125 92 000131 93 000174 116 000176 119 000207 127 000210 128 000215 129 000226 131 000231 132 000233 136 000247 137 000250 140 000254 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved