/* START OF: rdc_delete_stmt_.incl.pl1 * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* */ /* N__a_m_e: rdc_delete_stmt_.incl.pl1 */ /* */ /* This include segment is used by compilers generated by the reduction_compiler. */ /* It includes a procedure which deletes all of the tokens associated with the current */ /* statement (i.e., the statement which contains the token identified by Pthis_token). */ /* */ /* S__t_a_t_u_s */ /* */ /* 0) created by: G. C. Dixon in February, 1975. */ /* */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ DELETE_STMT: procedure; dcl (Plast, Pnext) ptr, /* ptr to (first, last) token to be deleted. */ Ssearching bit(1) aligned; /* on if scan for first/last token continuing. */ if Pthis_token = null then return; /* if input list exhausted, we can't do anything. */ Pstmt = Pthis_token -> token.Pstmt; /* address the statement descriptor of "current" */ if Pstmt = null then return; /* token, if it exists. */ Plast = Pthis_token; /* start scanning with "current" token. */ Ssearching = "1"b; /* set switch indicating search still continuing. */ do while (Ssearching & Plast -> token.Plast ^= null); if Plast -> token.Plast -> token.Pstmt = Pstmt then Plast = Plast -> token.Plast; /* scan backward for 1st _n_o_n-__d_e_l_e_t_e_d token of stmt*/ else Ssearching = "0"b; /* when found, stop searching. */ end; /* Recall that 1st token of stmt (ie, token */ /* pointed to by stmt.Pfirst_token) may have */ /* been deleted. */ Pnext = Pthis_token; /* start scanning forward with "current" token. */ Ssearching = "1"b; do while (Ssearching & Pnext -> token.Pnext ^= null); if Pnext -> token.Pnext -> token.Pstmt = Pstmt then Pnext = Pnext -> token.Pnext; /* scan forward for last _n_o_n-__d_e_l_e_t_e_d token of stmt*/ else Ssearching = "0"b; /* when found, stop searching. */ end; if Pnext -> token.Pnext = null then /* if there is no next statement, and */ if SPDL then /* if in PUSH DOWN LANGUAGE mode, and */ if Plast -> token.Plast = null then /* if there are no more tokens before the */ Ptoken, Pthis_token = null; /* "current" statement, then input exhausted. */ else do; Ptoken, Pthis_token = Plast -> token.Plast; /* otherwise, make token preceding the "current"*/ /* statement the "current" token. */ token.Pnext = null; /* indicate that input list exhausted. Only the*/ /* tokens before the new "current" token exist. */ end; else Ptoken, Pthis_token = null; /* not in PUSH DOWN LANGUAGE - input exhausted. */ else do; Ptoken, Pthis_token = Pnext -> token.Pnext; /* normally, token following "current" statement */ /* becomes the "current" token. */ token.Plast = Plast -> token.Plast; /* unthread the deleted tokens. */ if Plast -> token.Plast ^= null then Plast -> token.Plast -> token.Pnext = Ptoken; end; if Pnext -> token.Pnext = null then /* unthread statement descriptor from list. */ Pnext = null; else Pnext = Pnext -> token.Pnext -> token.Pstmt; if Plast -> token.Plast = null then Plast = null; else Plast = Plast -> token.Plast -> token.Pstmt; if Pnext ^= null then Pnext -> stmt.Plast = Plast; if Plast ^= null then Plast -> stmt.Pnext = Pnext; end DELETE_STMT; /* END OF: rdc_delete_stmt_.incl.pl1 * * * * * * * * * * * * * * * * */ */ ----------------------------------------------------------- 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 */