COMPILATION LISTING OF SEGMENT sym_sort_alphabetic Compiled by: Multics PL/I Compiler, Release 28d, of September 14, 1983 Compiled at: Honeywell LCPD Phoenix, System M Compiled on: 10/03/83 1620.9 mst Mon Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 /* This procedure is called with an array of ptrs to symbol table nodes and a 12* count of the nodes. It does a Shell sort alphabetizing the entries on the 13* basis of the string in the token pointed to by the symbol. 14* 15* Modified 20 Nov 1978 by David Spector to change symbol_list from 2000 to 3072. 16* Modified 25 March 1980 by M. N. Davidoff so calling sequence does not depend on pl1_symbol_print's internal limit. 17**/ 18 /* format: style3 */ 19 sym_sort_alphabetic: 20 proc (symbol_list_ptr, nn); 21 22 dcl symbol_list_ptr ptr; 23 dcl nn fixed bin; 24 25 dcl list (nn) ptr based (symbol_list_ptr); 26 27 dcl (d, i, j, k) fixed bin; 28 dcl (p, p1, p2) ptr; 29 dcl by_size bit (1) aligned; 30 31 dcl divide builtin; 32 1 1 /* BEGIN INCLUDE FILE ... symbol.incl.pl1 */ 1 2 1 3 dcl 1 symbol based aligned, 1 4 2 node_type bit(9) unal, 1 5 2 source_id structure unal, 1 6 3 file_number bit(8), 1 7 3 line_number bit(14), 1 8 3 statement_number bit(5), 1 9 2 location fixed(18) unal unsigned, 1 10 2 allocated bit(1) unal, 1 11 2 dcl_type bit(3) unal, 1 12 2 reserved bit(6) unal, 1 13 2 pix unal, 1 14 3 pic_fixed bit(1) unal, 1 15 3 pic_float bit(1) unal, 1 16 3 pic_char bit(1) unal, 1 17 3 pic_scale fixed(7) unal, 1 18 3 pic_size fixed(7) unal, 1 19 2 level fixed(8) unal, 1 20 2 boundary fixed(3) unal, 1 21 2 size_units fixed(3) unal, 1 22 2 scale fixed(7) unal, 1 23 2 runtime bit(18) unal, 1 24 2 runtime_offset bit(18) unal, 1 25 2 block_node ptr unal, 1 26 2 token ptr unal, 1 27 2 next ptr unal, 1 28 2 multi_use ptr unal, 1 29 2 cross_references ptr unal, 1 30 2 initial ptr unal, 1 31 2 array ptr unal, 1 32 2 descriptor ptr unal, 1 33 2 equivalence ptr unal, 1 34 2 reference ptr unal, 1 35 2 general ptr unal, 1 36 2 father ptr unal, 1 37 2 brother ptr unal, 1 38 2 son ptr unal, 1 39 2 word_size ptr unal, 1 40 2 bit_size ptr unal, 1 41 2 dcl_size ptr unal, 1 42 2 symtab_size ptr unal, 1 43 2 c_word_size fixed(24), 1 44 2 c_bit_size fixed(24), 1 45 2 c_dcl_size fixed(24), 1 46 1 47 2 attributes structure aligned, 1 48 3 data_type structure unal, 1 49 4 structure bit(1) , 1 50 4 fixed bit(1), 1 51 4 float bit(1), 1 52 4 bit bit(1), 1 53 4 char bit(1), 1 54 4 ptr bit(1), 1 55 4 offset bit(1), 1 56 4 area bit(1), 1 57 4 label bit(1), 1 58 4 entry bit(1), 1 59 4 file bit(1), 1 60 4 arg_descriptor bit(1), 1 61 4 storage_block bit(1), 1 62 4 explicit_packed bit(1), /* options(packed) */ 1 63 4 condition bit(1), 1 64 4 format bit(1), 1 65 4 builtin bit(1), 1 66 4 generic bit(1), 1 67 4 picture bit(1), 1 68 1 69 3 misc_attributes structure unal, 1 70 4 dimensioned bit(1), 1 71 4 initialed bit(1), 1 72 4 aligned bit(1), 1 73 4 unaligned bit(1), 1 74 4 signed bit(1), 1 75 4 unsigned bit(1), 1 76 4 precision bit(1), 1 77 4 varying bit(1), 1 78 4 local bit(1), 1 79 4 decimal bit(1), 1 80 4 binary bit(1), 1 81 4 real bit(1), 1 82 4 complex bit(1), 1 83 4 variable bit(1), 1 84 4 reducible bit(1), 1 85 4 irreducible bit(1), 1 86 4 returns bit(1), 1 87 4 position bit(1), 1 88 4 internal bit(1), 1 89 4 external bit(1), 1 90 4 like bit(1), 1 91 4 member bit(1), 1 92 4 non_varying bit(1), 1 93 4 options bit(1), 1 94 4 variable_arg_list bit(1), /* options(variable) */ 1 95 4 alloc_in_text bit(1), /* options(constant) */ 1 96 1 97 3 storage_class structure unal, 1 98 4 auto bit(1), 1 99 4 based bit(1), 1 100 4 static bit(1), 1 101 4 controlled bit(1), 1 102 4 defined bit(1), 1 103 4 parameter bit(1), 1 104 4 param_desc bit(1), 1 105 4 constant bit(1), 1 106 4 temporary bit(1), 1 107 4 return_value bit(1), 1 108 1 109 3 file_attributes structure unal, 1 110 4 print bit(1), 1 111 4 input bit(1), 1 112 4 output bit(1), 1 113 4 update bit(1), 1 114 4 stream bit(1), 1 115 4 reserved_1 bit(1), 1 116 4 record bit(1), 1 117 4 sequential bit(1), 1 118 4 direct bit(1), 1 119 4 interactive bit(1), /* env(interactive) */ 1 120 4 reserved_2 bit(1), 1 121 4 reserved_3 bit(1), 1 122 4 stringvalue bit(1), /* env(stringvalue) */ 1 123 4 keyed bit(1), 1 124 4 reserved_4 bit(1), 1 125 4 environment bit(1), 1 126 1 127 3 compiler_developed structure unal, 1 128 4 aliasable bit(1), 1 129 4 packed bit(1), 1 130 4 passed_as_arg bit(1), 1 131 4 allocate bit(1), 1 132 4 set bit(1), 1 133 4 exp_extents bit(1), 1 134 4 refer_extents bit(1), 1 135 4 star_extents bit(1), 1 136 4 isub bit(1), 1 137 4 put_in_symtab bit(1), 1 138 4 contiguous bit(1), 1 139 4 put_data bit(1), 1 140 4 overlayed bit(1), 1 141 4 error bit(1), 1 142 4 symtab_processed bit(1), 1 143 4 overlayed_by_builtin bit(1), 1 144 4 defaulted bit(1), 1 145 4 connected bit(1); 1 146 1 147 /* END INCLUDE FILE ... symbol.incl.pl1 */ 33 2 1 /* BEGIN INCLUDE FILE ... token.incl.pl1 */ 2 2 2 3 dcl 1 token based aligned, 2 4 2 node_type bit(9) unaligned, 2 5 2 type bit(9) unaligned, 2 6 2 loc bit(18) unaligned, /* symtab offset for identifiers, "p" flag for constants */ 2 7 2 declaration ptr unaligned, 2 8 2 next ptr unaligned, 2 9 2 size fixed(9), 2 10 2 string char(n refer(token.size)); 2 11 2 12 /* END INCLUDE FILE ... token.incl.pl1 */ 34 35 36 /* program */ 37 38 by_size = "0"b; 39 goto start; 40 41 by_size: 42 entry (symbol_list_ptr, nn); 43 44 by_size = "1"b; 45 46 start: 47 d = nn; 48 49 do while (d > 1); 50 d = 2 * divide (d, 4, 15, 0) + 1; 51 52 do i = 1 to nn - d; 53 k = i + d; 54 p2 = list (k) -> symbol.token; 55 56 up: 57 j = k - d; 58 p1 = list (j) -> symbol.token; 59 60 if by_size 61 then do; 62 if p1 -> token.size > p2 -> token.size 63 then goto inter; 64 if p1 -> token.size < p2 -> token.size 65 then goto ok; 66 end; 67 68 if p1 -> token.string <= p2 -> token.string 69 then goto ok; 70 71 inter: 72 p = list (j); 73 list (j) = list (k); 74 list (k) = p; 75 76 if j > d 77 then do; 78 k = j; 79 goto up; 80 end; 81 82 ok: 83 end; 84 end; 85 end sym_sort_alphabetic; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 10/03/83 1007.7 sym_sort_alphabetic.pl1 >spec>on>pl128d>sym_sort_alphabetic.pl1 33 1 10/02/83 0828.4 symbol.incl.pl1 >spec>on>pl128d>symbol.incl.pl1 34 2 09/14/77 1705.7 token.incl.pl1 >ldd>include>token.incl.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. by_size 000112 automatic bit(1) dcl 29 set ref 38* 44* 60 d 000100 automatic fixed bin(17,0) dcl 27 set ref 46* 49 50* 50 52 53 56 76 divide builtin function dcl 31 ref 50 i 000101 automatic fixed bin(17,0) dcl 27 set ref 52* 53* j 000102 automatic fixed bin(17,0) dcl 27 set ref 56* 58 71 73 76 78 k 000103 automatic fixed bin(17,0) dcl 27 set ref 53* 54 56 73 74 78* list based pointer array dcl 25 set ref 54 58 71 73* 73 74* nn parameter fixed bin(17,0) dcl 23 ref 19 41 46 52 p 000104 automatic pointer dcl 28 set ref 71* 74 p1 000106 automatic pointer dcl 28 set ref 58* 62 64 68 p2 000110 automatic pointer dcl 28 set ref 54* 62 64 68 size 3 based fixed bin(9,0) level 2 dcl 2-3 ref 62 62 64 64 68 68 string 4 based char level 2 dcl 2-3 ref 68 68 symbol based structure level 1 dcl 1-3 symbol_list_ptr parameter pointer dcl 22 ref 19 41 54 58 71 73 73 74 token 5 based pointer level 2 in structure "symbol" packed unaligned dcl 1-3 in procedure "sym_sort_alphabetic" ref 54 58 token based structure level 1 dcl 2-3 in procedure "sym_sort_alphabetic" NAMES DECLARED BY EXPLICIT CONTEXT. by_size 000017 constant entry external dcl 41 inter 000117 constant label dcl 71 ref 62 ok 000136 constant label dcl 82 ref 64 68 start 000026 constant label dcl 46 ref 39 sym_sort_alphabetic 000006 constant entry external dcl 19 up 000064 constant label dcl 56 ref 79 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 176 206 142 206 Length 402 142 10 160 33 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME sym_sort_alphabetic 77 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME sym_sort_alphabetic 000100 d sym_sort_alphabetic 000101 i sym_sort_alphabetic 000102 j sym_sort_alphabetic 000103 k sym_sort_alphabetic 000104 p sym_sort_alphabetic 000106 p1 sym_sort_alphabetic 000110 p2 sym_sort_alphabetic 000112 by_size sym_sort_alphabetic THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return ext_entry NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 19 000002 38 000013 39 000014 41 000015 44 000024 46 000026 49 000031 50 000035 52 000041 53 000053 54 000055 56 000064 58 000067 60 000076 62 000101 64 000105 68 000106 71 000117 73 000120 74 000125 76 000131 78 000134 79 000135 82 000136 84 000140 85 000141 ----------------------------------------------------------- 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