COMPILATION LISTING OF SEGMENT create_token Compiled by: Multics PL/I Compiler, Release 28d, of September 14, 1983 Compiled at: Honeywell LCPD Phoenix, System M Compiled on: 10/03/83 1606.1 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 1 1 /* BEGIN INCLUDE FILE ... create_token.incl.pl1 */ 1 2 1 3 create_token: 1 4 procedure (bv_token_string, bv_token_type) returns (ptr); 1 5 1 6 /* Modified on: April 1977 by RHS for new allocation methods */ 1 7 /* Modified 770509 by PG to put hash_table in tree and make it bigger */ 1 8 1 9 /* parameters */ 1 10 1 11 declare ( bv_token_string char (*), 1 12 bv_token_type bit (9) aligned, 1 13 bv_protected bit (18) aligned 1 14 ) parameter; 1 15 1 16 /* automatic */ 1 17 1 18 declare (hash_index, i, n, n_chars, n_words) fixed bin, 1 19 mod_2_sum bit (36) aligned, 1 20 four_chars char (4) aligned, 1 21 protected bit (18) aligned, 1 22 (old_q, q, p, token_string_ptr) ptr; 1 23 1 24 /* based */ 1 25 1 26 declare token_array_overlay (64) char (4) based (token_string_ptr), 1 27 token_overlay char (n) based (token_string_ptr); 1 28 1 29 /* builtins */ 1 30 1 31 declare (addr, binary, bool, dim, divide, length, mod, null, substr, unspec) builtin; 1 32 1 33 /* external static */ 1 34 1 35 declare pl1_stat_$node_uses (18) external fixed bin; 1 36 1 37 /* include files */ 1 38 2 1 /* BEGIN INCLUDE FILE ... pl1_token_hash_table.incl.pl1 */ 2 2 2 3 declare 1 hash_table_structure aligned based (pl1_stat_$hash_table_ptr), 2 4 2 hash_table (0:630) ptr unaligned; 2 5 2 6 declare pl1_stat_$hash_table_ptr ptr external static; 2 7 2 8 /* END INCLUDE FILE ... pl1_token_hash_table.incl.pl1 */ 1 39 3 1 /* BEGIN INCLUDE FILE ... pl1_tree_areas.incl.pl1 */ 3 2 3 3 /* format: style3 */ 3 4 dcl tree_area area based (pl1_stat_$tree_area_ptr); 3 5 dcl xeq_tree_area area based (pl1_stat_$xeq_tree_area_ptr); 3 6 3 7 dcl pl1_stat_$tree_area_ptr 3 8 ptr ext static, 3 9 pl1_stat_$xeq_tree_area_ptr 3 10 ptr ext static; 3 11 3 12 /* END INCLUDE FILE ... op_codes.incl.pl1 */ 1 40 4 1 /* BEGIN INCLUDE FILE ... nodes.incl.pl1 */ 4 2 4 3 /* Modified: 26 Dec 1979 by PCK to implement by name assignment */ 4 4 4 5 dcl ( block_node initial("000000001"b), 4 6 statement_node initial("000000010"b), 4 7 operator_node initial("000000011"b), 4 8 reference_node initial("000000100"b), 4 9 token_node initial("000000101"b), 4 10 symbol_node initial("000000110"b), 4 11 context_node initial("000000111"b), 4 12 array_node initial("000001000"b), 4 13 bound_node initial("000001001"b), 4 14 format_value_node initial("000001010"b), 4 15 list_node initial("000001011"b), 4 16 default_node initial("000001100"b), 4 17 machine_state_node initial("000001101"b), 4 18 source_node initial("000001110"b), 4 19 label_node initial("000001111"b), 4 20 cross_reference_node initial("000010000"b), 4 21 sf_par_node initial("000010001"b), 4 22 temporary_node initial("000010010"b), 4 23 label_array_element_node initial("000010011"b), 4 24 by_name_agg_node initial("000010100"b)) 4 25 bit(9) internal static aligned options(constant); 4 26 4 27 dcl 1 node based aligned, 4 28 2 type unal bit(9), 4 29 2 source_id unal structure, 4 30 3 file_number bit(8), 4 31 3 line_number bit(14), 4 32 3 statement_number bit(5); 4 33 4 34 /* END INCLUDE FILE ... nodes.incl.pl1 */ 1 41 5 1 /* BEGIN INCLUDE FILE ... token.incl.pl1 */ 5 2 5 3 dcl 1 token based aligned, 5 4 2 node_type bit(9) unaligned, 5 5 2 type bit(9) unaligned, 5 6 2 loc bit(18) unaligned, /* symtab offset for identifiers, "p" flag for constants */ 5 7 2 declaration ptr unaligned, 5 8 2 next ptr unaligned, 5 9 2 size fixed(9), 5 10 2 string char(n refer(token.size)); 5 11 5 12 /* END INCLUDE FILE ... token.incl.pl1 */ 1 42 1 43 1 44 /* program */ 1 45 1 46 protected = ""b; 1 47 1 48 join: 1 49 token_string_ptr = addr (bv_token_string); 1 50 1 51 n = length (bv_token_string); 1 52 n_words = divide (n, 4, 21, 0); 1 53 n_chars = n - n_words * 4; 1 54 mod_2_sum = ""b; 1 55 1 56 do i = 1 to n_words; 1 57 four_chars = token_array_overlay (i); 1 58 mod_2_sum = bool (mod_2_sum, unspec (four_chars), "0110"b); 1 59 end; 1 60 1 61 if n_chars ^= 0 1 62 then do; 1 63 four_chars = substr (token_array_overlay (i), 1, n_chars); 1 64 mod_2_sum = bool (mod_2_sum, unspec (four_chars), "0110"b); 1 65 end; 1 66 1 67 hash_index = mod (binary (mod_2_sum, 35), dim (hash_table, 1)); 1 68 old_q = null; 1 69 1 70 do q = hash_table (hash_index) repeat (q -> token.next) while (q ^= null); 1 71 if n < q -> token.size 1 72 then go to insert_token; 1 73 1 74 if n = q -> token.size 1 75 then if bv_token_type = q -> token.type 1 76 then if token_overlay = q -> token.string 1 77 then if protected = q -> token.loc 1 78 then return (q); 1 79 1 80 old_q = q; 1 81 end; 1 82 1 83 insert_token: 1 84 pl1_stat_$node_uses (5) = pl1_stat_$node_uses (5) + 1; 1 85 1 86 allocate token in (tree_area) set (p); 1 87 p -> token.node_type = token_node; 1 88 p -> token.type = bv_token_type; 1 89 p -> token.declaration = null; 1 90 p -> token.loc = protected; 1 91 p -> token.string = token_overlay; 1 92 p -> token.next = q; 1 93 1 94 if old_q = null 1 95 then hash_table (hash_index) = p; 1 96 else old_q -> token.next = p; 1 97 return (p); 1 98 1 99 create_token$protected: 1 100 entry (bv_token_string, bv_token_type, bv_protected) returns (ptr); 1 101 1 102 protected = bv_protected; 1 103 go to join; 1 104 1 105 /* END INCLUDE FILE ... create_token.incl.pl1 */ 11 12 13 /* Entry to initialize the hash table used by create_token. Note that the length of the hash table 14* must be a prime number */ 15 16 init_hash_table: 17 entry (); 18 19 allocate hash_table_structure in (tree_area); 20 hash_table (*) = null; 21 return; 22 23 end /* create_token */; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 10/03/83 1007.3 create_token.pl1 >spec>on>pl128d>create_token.pl1 11 1 09/14/77 1706.1 create_token.incl.pl1 >ldd>include>create_token.incl.pl1 1-39 2 09/14/77 1705.7 pl1_token_hash_table.incl.pl1 >ldd>include>pl1_token_hash_table.incl.pl1 1-40 3 07/21/80 1546.3 pl1_tree_areas.incl.pl1 >ldd>include>pl1_tree_areas.incl.pl1 1-41 4 07/21/80 1546.3 nodes.incl.pl1 >ldd>include>nodes.incl.pl1 1-42 5 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. addr builtin function dcl 1-31 ref 1-48 binary builtin function dcl 1-31 ref 1-67 bool builtin function dcl 1-31 ref 1-58 1-64 bv_protected parameter bit(18) dcl 1-11 ref 1-99 1-102 bv_token_string parameter char unaligned dcl 1-11 set ref 1-3 1-48 1-51 1-99 bv_token_type parameter bit(9) dcl 1-11 ref 1-3 1-74 1-88 1-99 declaration 1 based pointer level 2 packed unaligned dcl 5-3 set ref 1-89* dim builtin function dcl 1-31 ref 1-67 divide builtin function dcl 1-31 ref 1-52 four_chars 000106 automatic char(4) dcl 1-18 set ref 1-57* 1-58 1-63* 1-64 hash_index 000100 automatic fixed bin(17,0) dcl 1-18 set ref 1-67* 1-70 1-94 hash_table based pointer array level 2 packed unaligned dcl 2-3 set ref 1-67 1-70 1-94* 20* hash_table_structure based structure level 1 dcl 2-3 set ref 19 i 000101 automatic fixed bin(17,0) dcl 1-18 set ref 1-56* 1-57* 1-63 length builtin function dcl 1-31 ref 1-51 loc 0(18) based bit(18) level 2 packed unaligned dcl 5-3 set ref 1-74 1-90* mod builtin function dcl 1-31 ref 1-67 mod_2_sum 000105 automatic bit(36) dcl 1-18 set ref 1-54* 1-58* 1-58 1-64* 1-64 1-67 n 000102 automatic fixed bin(17,0) dcl 1-18 set ref 1-51* 1-52 1-53 1-71 1-74 1-74 1-86 1-86 1-91 n_chars 000103 automatic fixed bin(17,0) dcl 1-18 set ref 1-53* 1-61 1-63 n_words 000104 automatic fixed bin(17,0) dcl 1-18 set ref 1-52* 1-53 1-56 next 2 based pointer level 2 packed unaligned dcl 5-3 set ref 1-81 1-92* 1-96* node_type based bit(9) level 2 packed unaligned dcl 5-3 set ref 1-87* null builtin function dcl 1-31 ref 1-68 1-70 1-89 1-94 20 old_q 000110 automatic pointer dcl 1-18 set ref 1-68* 1-80* 1-94 1-96 p 000114 automatic pointer dcl 1-18 set ref 1-86* 1-87 1-88 1-89 1-90 1-91 1-92 1-94 1-96 1-97 pl1_stat_$hash_table_ptr 000012 external static pointer dcl 2-6 set ref 1-67 1-70 1-94 19* 20 pl1_stat_$node_uses 000010 external static fixed bin(17,0) array dcl 1-35 set ref 1-83* 1-83 pl1_stat_$tree_area_ptr 000014 external static pointer dcl 3-7 ref 1-86 19 protected 000107 automatic bit(18) dcl 1-18 set ref 1-46* 1-74 1-90 1-102* q 000112 automatic pointer dcl 1-18 set ref 1-70* 1-70* 1-71 1-74 1-74 1-74 1-74 1-74 1-80* 1-81 1-92 size 3 based fixed bin(9,0) level 2 dcl 5-3 set ref 1-71 1-74 1-74 1-86* 1-91 string 4 based char level 2 dcl 5-3 set ref 1-74 1-91* substr builtin function dcl 1-31 ref 1-63 token based structure level 1 dcl 5-3 set ref 1-86 token_array_overlay based char(4) array unaligned dcl 1-26 ref 1-57 1-63 token_node constant bit(9) initial dcl 4-5 ref 1-87 token_overlay based char unaligned dcl 1-26 ref 1-74 1-91 token_string_ptr 000116 automatic pointer dcl 1-18 set ref 1-48* 1-57 1-63 1-74 1-91 tree_area based area(1024) dcl 3-4 ref 1-86 19 type 0(09) based bit(9) level 2 packed unaligned dcl 5-3 set ref 1-74 1-88* unspec builtin function dcl 1-31 ref 1-58 1-64 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. array_node internal static bit(9) initial dcl 4-5 block_node internal static bit(9) initial dcl 4-5 bound_node internal static bit(9) initial dcl 4-5 by_name_agg_node internal static bit(9) initial dcl 4-5 context_node internal static bit(9) initial dcl 4-5 cross_reference_node internal static bit(9) initial dcl 4-5 default_node internal static bit(9) initial dcl 4-5 format_value_node internal static bit(9) initial dcl 4-5 label_array_element_node internal static bit(9) initial dcl 4-5 label_node internal static bit(9) initial dcl 4-5 list_node internal static bit(9) initial dcl 4-5 machine_state_node internal static bit(9) initial dcl 4-5 node based structure level 1 dcl 4-27 operator_node internal static bit(9) initial dcl 4-5 pl1_stat_$xeq_tree_area_ptr external static pointer dcl 3-7 reference_node internal static bit(9) initial dcl 4-5 sf_par_node internal static bit(9) initial dcl 4-5 source_node internal static bit(9) initial dcl 4-5 statement_node internal static bit(9) initial dcl 4-5 symbol_node internal static bit(9) initial dcl 4-5 temporary_node internal static bit(9) initial dcl 4-5 xeq_tree_area based area(1024) dcl 3-5 NAMES DECLARED BY EXPLICIT CONTEXT. create_token 000020 constant entry external dcl 1-3 create_token$protected 000271 constant entry external dcl 1-99 init_hash_table 000317 constant entry external dcl 16 insert_token 000177 constant label dcl 1-83 ref 1-71 join 000041 constant label dcl 1-48 ref 1-103 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 464 502 362 474 Length 756 362 16 240 102 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME create_token 88 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME create_token 000100 hash_index create_token 000101 i create_token 000102 n create_token 000103 n_chars create_token 000104 n_words create_token 000105 mod_2_sum create_token 000106 four_chars create_token 000107 protected create_token 000110 old_q create_token 000112 q create_token 000114 p create_token 000116 token_string_ptr create_token THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return mod_fx1 signal ext_entry ext_entry_desc alloc_based NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. pl1_stat_$hash_table_ptr pl1_stat_$node_uses pl1_stat_$tree_area_ptr LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 1 3 000014 1 46 000040 1 48 000041 1 51 000044 1 52 000046 1 53 000050 1 54 000055 1 56 000056 1 57 000065 1 58 000072 1 59 000074 1 61 000076 1 63 000100 1 64 000107 1 67 000111 1 68 000116 1 70 000120 1 71 000132 1 74 000136 1 80 000173 1 81 000174 1 83 000177 1 86 000202 1 87 000216 1 88 000220 1 89 000224 1 90 000226 1 91 000231 1 92 000237 1 94 000241 1 96 000252 1 97 000254 1 99 000264 1 102 000311 1 103 000315 16 000316 19 000325 20 000335 21 000352 ----------------------------------------------------------- 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