COMPILATION LISTING OF SEGMENT linus_eval_expr Compiled by: Multics PL/I Compiler, Release 33a, of May 30, 1990 Compiled at: ACTC Technologies Inc. Compiled on: 10/14/90 0920.6 mdt Sun Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) BULL HN Information Systems Inc., 1990 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 13 14 /****^ HISTORY COMMENTS: 15* 1) change(90-04-23,Leskiw), approve(90-10-05,MCR8202), 16* audit(90-10-11,Bubric), install(90-10-14,MR12.4-1039): 17* Changed calls to assign_round_ from assign_ so that selected expressions 18* will be rounded instead of truncated. 19* END HISTORY COMMENTS */ 20 21 22 linus_eval_expr: 23 proc (lcb_ptr, ex_ptr, destination_ptr, caller, index, icode); 24 25 26 /* DESCRIPTION: 27* 28* Evaluate LINUS expressions. 29* 30* 31* HISTORY: 32* 33* 77-07-01 J. C. C. Jagernauth: Initially written. 34* 35* 80-01-10 Rickie E. Brinegar: Modified to use the mdbm_util_$(complex 36* number)_data_class entry points. 37* 38* 81-07-13 Rickie E. Brinegar: Removed trapping of conversion conditions. 39* This is now relegated to the higher level routines. 40* 41* 81-10-09 Rickie E. Brinegar: changed stack from a based variable to an 42* automatic variable to avoid area problems. 43* 44**/ 45 1 1 /* BEGIN INCLUDE FILE linus_lcb.incl.pl1 -- jaw 8/30/77 */ 1 2 1 3 1 4 1 5 /****^ HISTORY COMMENTS: 1 6* 1) change(86-04-23,Dupuis), approve(86-05-23,MCR7188), audit(86-07-23,GWMay), 1 7* install(86-07-29,MR12.0-1106): 1 8* Added general_work_area_ptr and renamed sfr_ptr to 1 9* force_retrieve_scope_ptr. 1 10* END HISTORY COMMENTS */ 1 11 1 12 1 13 /* HISTORY: 1 14* 1 15* 78-09-29 J. C. C. Jagernauth: Modified for MR7.0. 1 16* 1 17* 81-05-11 Rickie E. Brinegar: added security bit and andministrator bit as 1 18* a part of the attribute level control work. 1 19* 1 20* 81-06-17 Rickie E. Brinegar: deleted the sd_ptr as a part of removing the 1 21* scope_data structure from LINUS. LINUS now depends totally on MRDS for 1 22* scope information. 1 23* 1 24* 81-11-11 Rickie E. Brinegar: added the timing bit and three fields for 1 25* retaining various vcpu times to be collected when in timing mode. The 1 26* times to be collected are: LINUS parsing time, LINUS processing time, and 1 27* MRDS processing time. 1 28* 1 29* 82-01-15 DJ Schimke: Added the build_increment and build_start fields as 1 30* part of the line numbering implementation. This allows for possible later 1 31* LINUS control of the build defaults. 1 32* 1 33* 82-03-01 Paul W. Benjamin: Removed linus_prompt_chars_ptr, as that 1 34* information is now retained by ssu_. Removed parse_timer as no longer 1 35* meaningful. Added linus_version. Added iteration bit. Added 6 entry 1 36* variables for ssu_ replaceable procedures. Added actual_input_iocbp. 1 37* 1 38* 82-06-23 Al Dupuis: Added subsystem_control_info_ptr, 1 39* subsystem_invocation_level, and selection_expression_identifier. 1 40* 1 41* 82-08-26 DJ Schimke: Added report_control_info_ptr, and 1 42* table_control_info_ptr. 1 43* 1 44* 82-10-19 DJ Schimke: Added ssu_abort_line. 1 45* 1 46* 83-06-06 Bert Moberg: Added print_search_order (pso) and no_optimize (no_ot) 1 47* 1 48* 83-04-07 DJ Schimke: Added temp_seg_info_ptr. 1 49* 1 50* 83-08-26 Al Dupuis: Added query_temp_segment_ptr. 1 51**/ 1 52 1 53 dcl 1 lcb aligned based (lcb_ptr), /* LINUS control block */ 1 54 2 db_index fixed bin (35), /* index of open data base, or 0 */ 1 55 2 rb_len fixed bin (21), /* length of request buffer */ 1 56 2 lila_count fixed bin (35), /* number of LILA text lines */ 1 57 2 lila_chars fixed bin (35), /* number of LILA source test chars */ 1 58 2 trans_id fixed bin (35), /* used by checkpoint and rollback facilities (MR7.0) */ 1 59 2 lila_fn char (32) unal, /* entry name of lila data file */ 1 60 2 prompt_flag bit (1) unal, /* on if in prompt mode */ 1 61 2 test_flag bit (1) unal, /* on if in test mode */ 1 62 2 new_version bit (1) unal init (1), /* on for new version data base (MR7.0) */ 1 63 2 secured_db bit (1) unal, /* on if the db is in a secure state */ 1 64 2 administrator bit (1) unal, /* on if the user is a db administrator */ 1 65 2 timing_mode bit (1) unal, /* on if timing is to be done */ 1 66 2 iteration bit (1) unal, /* interpret parens as iteration sets */ 1 67 2 pso_flag bit (1) unal, /* add print_search_order to select */ 1 68 2 no_ot_flag bit (1) unal, /* add no_optimize to select */ 1 69 2 reserved bit (27) unal, 1 70 2 liocb_ptr ptr, /* iocb ptr for lila file */ 1 71 2 rb_ptr ptr, /* ptr to request buffer */ 1 72 2 is_ptr ptr, /* iocb ptr for currentinput stream switch */ 1 73 2 cal_ptr ptr, /* ptr to current arg list for invoke (or null) */ 1 74 2 ttn_ptr ptr, /* pointer to table info structure */ 1 75 2 force_retrieve_scope_info_ptr ptr, /* structure pointer to force retrieve scope operation */ 1 76 2 lv_ptr ptr, /* pointer linus variables */ 1 77 2 si_ptr ptr, /* pointer to select_info structure */ 1 78 2 setfi_ptr ptr, /* pointer to set function information */ 1 79 2 sclfi_ptr ptr, /* pointer to user declared scalar fun. names */ 1 80 2 ivs_ptr ptr, /* pointer to stack of invoke iocb pointers */ 1 81 2 lit_ptr ptr, /* pointer to literal pool */ 1 82 2 lvv_ptr ptr, /* pointer to linus variable alloc. pool */ 1 83 2 rd_ptr ptr, /* point to readied files mode information (MR7.0) */ 1 84 2 rt_ptr ptr, /* point to table of relation names and their readied modes 1 85* (MR7.0) */ 1 86 2 actual_input_iocbp ptr, /* ptr to input while in macros */ 1 87 2 lila_promp_chars_ptr ptr, /* pointer to the prompt characters for lila */ 1 88 2 linus_area_ptr ptr, /* LINUS temporary segment pointer */ 1 89 2 lila_area_ptr ptr, /* LILA temporary segment pointer */ 1 90 2 i_o_area_ptr ptr, /* temporary segment pointer used by write, print, create_list */ 1 91 2 rel_array_ptr ptr, /* ptr to array of names rslt info structure 1 92* for current lila expression */ 1 93 2 unused_timer float bin (63), /* future expansion */ 1 94 2 request_time float bin (63), /* How much request time was spent 1 95* in LINUS. (-1 = user has just enabled 1 96* timing, do not report) */ 1 97 2 mrds_time float bin (63), /* How much time was spent in MRDS */ 1 98 2 build_increment fixed bin, /* default increment for build mode */ 1 99 2 build_start fixed bin, /* default start count for build mode */ 1 100 2 linus_version char (4), /* current version of LINUS */ 1 101 2 subsystem_control_info_ptr ptr, /* the same ptr passed by ssu_ to each request procedure */ 1 102 2 subsystem_invocation_level fixed bin, /* identifies this invocation of LINUS */ 1 103 2 selection_expression_identifier fixed bin, /* identifies the current processed selection expression */ 1 104 2 report_control_info_ptr ptr, /* pointer to linus_report_control_info structure */ 1 105 2 table_control_info_ptr ptr, /* pointer to linus_table control structure */ 1 106 2 temp_seg_info_ptr ptr, /* pointer to linus_temp_seg_mgr control structure */ 1 107 2 query_temp_segment_ptr ptr, /* points to temp seg used for manipulating query */ 1 108 2 general_work_area_ptr ptr, /* a freeing area for general use */ 1 109 2 word_pad (6) bit (36) unal, 1 110 /* procedures that will be optionally */ 1 111 /* replaced by the user. Saved so they */ 1 112 /* can be reinstated if desired. */ 1 113 2 ssu_abort_line entry options (variable), 1 114 2 ssu_post_request_line variable entry (ptr), 1 115 2 ssu_pre_request_line variable entry (ptr), 1 116 1 117 2 curr_lit_offset fixed bin (35), /* index of first free bit in lit. pool */ 1 118 2 curr_lv_val_offset fixed bin (35), /* index of first free bit lv. val. pool */ 1 119 2 static_area area (sys_info$max_seg_size - fixed (rel (addr (lcb.static_area))) + 1); 1 120 1 121 dcl lcb_ptr ptr; 1 122 1 123 /* END INCLUDE FILE linus_lcb.incl.pl1 */ 46 47 2 1 /* BEGIN INCLUDE FILE linus_expession.incl.pl1 -- jaw 6/29/77 */ 2 2 2 3 dcl 1 expression aligned based (ex_ptr), /* internal representation of an 2 4* arithmetic expr. Is in postfix polish form. */ 2 5 2 rslt_desc bit (36), /* descriptor for result */ 2 6 2 nelems fixed bin, /* no. of operators + no of operands */ 2 7 2 elem (nelems_init refer (expression.nelems)), 2 8 3 type fixed bin (4) unal, /* 1 => constant 2 9* 2 => linus variable 2 10* 3 => scalar function 2 11* 4 => set function 2 12* 5 => not used 2 13* 6 => data base item 2 14* 15 => operator */ 2 15 3 op_code fixed bin (3) unal, /* 1 => add 2 16* 2 => subtract 2 17* 3 => multiply 2 18* 4 => divide */ 2 19 3 reserved bit (27) unal, 2 20 3 desc bit (36), /* descriptor for item */ 2 21 3 bit_length fixed bin (35), /* bit length of item */ 2 22 3 assn_ptr ptr, /* assign_ pointer to item */ 2 23 3 assn_type fixed bin, /* assign_ type code for item */ 2 24 3 assn_len fixed bin (35), /* assign_ length for this item */ 2 25 3 fn_ptr ptr; /* pointer to function structure */ 2 26 2 27 dcl ex_ptr ptr; 2 28 dcl nelems_init fixed bin; 2 29 2 30 /* END INCLUDE FILE linus_expression.incl.pl1 */ 48 49 3 1 /* BEGIN INCLUDE FILE linus_select_info.incl.pl1 */ 3 2 /* History: 77-07-29 J. A. Weeldreyer: Originally written. 3 3* Modified: 82-18-82 Dave Schimke: Added user_item.table_name 3 4**/ 3 5 dcl 1 select_info aligned based (si_ptr), /* info from LILA select clause */ 3 6 2 set_fn bit (1) unal, /* on if set fn to be applied */ 3 7 2 se_flags unal, /* flags pertaining to selection expr. */ 3 8 3 val_ret bit (1) unal, /* valid for retrieval */ 3 9 3 val_dtt bit (1) unal, /* valid for define_temp_table */ 3 10 3 val_del bit (1) unal, /* valid for delete */ 3 11 3 val_mod bit (1) unal, /* valid for modify */ 3 12 2 dup_flag bit (1) unal, /* on if dup explic. spec. somewhere */ 3 13 2 unique_flag bit (1) unal, /* on if unique explic. spec. somewhere */ 3 14 2 pad bit (29) unal, /* reserved */ 3 15 2 prior_sf_ptr ptr, /* pointer to set fns for prior eval. */ 3 16 2 se_ptr ptr, /* pointer to mrds selection expression */ 3 17 2 sel_items_ptr ptr, /* pointer to list of selected items */ 3 18 2 sel_items_len fixed bin, /* length in characters of list of selected items */ 3 19 2 se_len fixed bin (35), /* length of mrds sel. expr. */ 3 20 2 nsv_alloc fixed bin, /* no. of se. vals aloc. */ 3 21 2 nmi_alloc fixed bin, /* no. of mrds items alloc. */ 3 22 2 nui_alloc fixed bin, /* no. of user items alloc. */ 3 23 2 nsevals fixed bin, /* number of selection expr. vaules */ 3 24 2 n_mrds_items fixed bin, /* no. of items in mrds select list */ 3 25 2 n_user_items fixed bin, /* no. of items user will see */ 3 26 2 se_vals (nsv_init refer (select_info.nsv_alloc)), 3 27 3 arg_ptr ptr, 3 28 3 desc_ptr ptr, 3 29 2 mrds_item (nmi_init refer (select_info.nmi_alloc)), /* mrds select items */ 3 30 3 arg_ptr ptr, /* pointer to receiving field */ 3 31 3 bit_len fixed bin (35), /* bit length of receiving field */ 3 32 3 desc bit (36), /* descriptor for receiving field */ 3 33 3 assn_type fixed bin, /* type code for assign_ */ 3 34 3 assn_len fixed bin (35), /* length for assign_ */ 3 35 2 user_item (nui_init refer (select_info.nui_alloc)), /* user select item */ 3 36 3 name char (32) var, /* name for col. header */ 3 37 3 table_name char (32) var, /* name of containing linus table */ 3 38 3 item_type fixed bin, /* indicates type of item: 3 39* 1 => raw mrds, 3 40* 2 => expr. */ 3 41 3 rslt_desc bit (36), /* descriptor for expr. result */ 3 42 3 rslt_bit_len fixed bin (35), /* bit length of expr. result */ 3 43 3 rslt_assn_ptr ptr, /* pointer to expr. result storage loc. */ 3 44 3 rslt_assn_type fixed bin, /* assign_ type code of expr. result */ 3 45 3 rslt_assn_len fixed bin (35), /* assign_ length for expr. result */ 3 46 3 item_ptr ptr; /* pointer to item or expr. or applied set_func. structure */ 3 47 3 48 dcl (nsv_init, nmi_init, nui_init) fixed bin; 3 49 dcl si_ptr ptr; 3 50 3 51 /* END INCLUDE FILE linus_select_info.incl.pl1 */ 50 51 4 1 /* BEGIN INCLUDE FILE linus_set_fn.incl.pl1 -- jaw 7/13/77 4 2* 4 3* 81-10-26 Rickie E. Brinegar: Modified to have entry variables instead of 4 4* entry pointers. This change included the addition of bit switches inorder 4 5* to be able to tell if the entry variable had been set yet. Also changed 4 6* the name of the structure from set_fn to linus_set_fn and the name of the 4 7* variable that it was based on from setf_ptr to linus_set_fn_ptr. 4 8* 4 9* 81-11-05 Rickie E. Brinegar: Changed the entry pointers to entry variables 4 10* and added bit switches to determine when the entries have or have not been 4 11* set. Renamed set_fn sturcture to linus_set_fn, setf_ptr to 4 12* linus_set_fn_ptr, and nset_fn_init_args to 4 13* initial_number_of_linus_set_fn_args. 4 14* 4 15**/ 4 16 4 17 dcl 1 linus_set_fn aligned based (linus_set_fn_ptr), /* internal rep. of set fun. */ 4 18 2 fwd_ptr ptr, /* pointer to next set function to be eval. 4 19* at this level */ 4 20 2 prior_ptr ptr, /* pointer to head of list of set functions 4 21* to be evaluated prior to this one */ 4 22 2 assign_entry entry variable, /* pointer to assign entry */ 4 23 2 calc_entry entry variable, /* pointer to calc entry */ 4 24 2 init_entry entry variable, /* pointer to initialization entry */ 4 25 2 assign_al_ptr ptr, /* pointer to assign entry arg list */ 4 26 2 calc_al_ptr ptr, /* pointer to calc entry arg list */ 4 27 2 rtrv_al_ptr ptr, /* pointer to arg list for dsl_$retrieve */ 4 28 2 flags, 4 29 3 assign_entry_set bit (1) unaligned, /* 0 => null, 1 => not null */ 4 30 3 calc_entry_set bit (1) unaligned, /* 0 => null, 1 => not null */ 4 31 3 init_entry_set bit (1) unaligned, /* 0 => null, 1 => not null */ 4 32 3 pad_bits bit (33) unaligned, 4 33 2 rslt_desc bit (36), /* descriptor for result */ 4 34 2 nargs fixed bin, /* number of input args to calc entry */ 4 35 2 arg (initial_number_of_linus_set_fn_args refer (linus_set_fn.nargs)), 4 36 3 type fixed bin (4) unal, /* 1 => constant 4 37* 2 => linus variable 4 38* 3 => scalar function 4 39* 4 => set function 4 40* 5 => expression 4 41* 6 => data base item */ 4 42 3 must_convert bit (1) unal, /* on if must convert prior to call */ 4 43 3 reserved bit (30) unal, 4 44 3 desc bit (36), /* descriptor of source data */ 4 45 3 assn_ptr ptr, /* assign_ ptr for source data */ 4 46 3 assn_type fixed bin, /* assign_ type for source data */ 4 47 3 assn_len fixed bin (35), /* assign_ length for source data */ 4 48 3 arg_desc bit (36), /* descriptor for converted arg */ 4 49 3 arg_assn_ptr ptr, /* assign_ ptr for converted arg */ 4 50 3 arg_assn_type fixed bin, /* assign_ type code for converted arg */ 4 51 3 arg_assn_len fixed bin (35), /* assign_ length for converted arg */ 4 52 3 ef_ptr ptr; /* pointer to express. or function structure */ 4 53 4 54 dcl initial_number_of_linus_set_fn_args fixed bin; 4 55 dcl linus_set_fn_ptr ptr; 4 56 4 57 /* END INCLUDE FILE linus_set_fn.incl.pl1 */ 52 53 5 1 /* BEGIN INCLUDE FILE linus_scal_fn.incl.pl1 -- jaw 6/29/77 */ 5 2 5 3 dcl 1 scal_fn aligned based (sclf_ptr), /* internal rep. of scalar func. */ 5 4 2 entry_ptr ptr, /* pointer to entry to be called */ 5 5 2 arg_list_ptr ptr, /* pointer to arg list for entry call */ 5 6 2 rslt_desc bit (36), /* descriptor for result */ 5 7 2 nargs fixed bin, /* number of input args */ 5 8 2 arg (nsclf_args_init refer (scal_fn.nargs)), 5 9 3 type fixed bin (4) unal, /* 1 => constant, 5 10* 2 => linus variable 5 11* 3 => scalar function 5 12* 4 => set function 5 13* 5 => expression 5 14* 6 => data base item */ 5 15 3 must_convert bit (1) unal, /* on if source data must be converted prior to call */ 5 16 3 reserved bit (30) unal, 5 17 3 desc bit (36), /* descriptor of source data */ 5 18 3 assn_ptr ptr, /* pointer to data or result */ 5 19 3 assn_type fixed bin, /* assign_ type code of source data */ 5 20 3 assn_len fixed bin (35), /* assign_ length of source data */ 5 21 3 arg_desc bit (36), /* descriptor for converted arg */ 5 22 3 arg_assn_ptr ptr, /* assign_ ptr for converted arg */ 5 23 3 arg_assn_type fixed bin, /* assign_ type code of converted arg */ 5 24 3 arg_assn_len fixed bin (35), /* assign_ length of converted arg */ 5 25 3 ef_ptr ptr; /* pointer to expression or function structure */ 5 26 5 27 dcl sclf_ptr ptr; 5 28 dcl nsclf_args_init fixed bin; 5 29 5 30 /* END INCLUDE FILE linus_scal_fn.incl.pl1 */ 54 55 56 57 dcl 1 stack aligned, /* Operand stack aligned */ 58 2 nelems fixed bin, 59 2 operand (expression.nelems), 60 3 ptr ptr, 61 3 real real float dec (59), 62 3 cmpx complex float dec (59); 63 dcl ( 64 SCAL_FUNC init (3), 65 OPERATOR init (15), 66 CMPX_ASSN_TYPE init (24), 67 REAL_ASSN_TYPE init (20) 68 ) fixed bin int static options (constant); 69 dcl EVAL_ITEM_ASSN_LENGTH init (59) fixed bin (35) int static 70 options (constant); 71 72 dcl ( 73 stk_ptr init (null), 74 destination_ptr, /* Points to scalar function, set function or select_info 75*structure */ 76 eval_item_assn_ptr init (null) 77 ) ptr; 78 79 dcl ( 80 i, 81 caller, /* 1 = from request processor, 82* 2 = from scalar function, 83* 3 = from set function */ 84 eval_item_assn_type, 85 index 86 ) fixed bin; 87 88 dcl icode fixed bin (35); 89 90 91 dcl arith_scal_fn bit (1); /* 1 = arithmetic scalar function */ 92 dcl cmpx bit (1); /* "1" = complex; "0" = real */ 93 94 dcl ( 95 linus_error_$inv_sclf_use, 96 linus_error_$inv_expr 97 ) fixed bin (35) ext; 98 99 dcl linus_eval_scal_func entry (ptr, ptr, fixed bin (35)); 100 dcl assign_round_ 101 entry (ptr, fixed bin, fixed bin (35), ptr, fixed bin, fixed bin (35)); 102 dcl ( 103 mdbm_util_$complex_data_class, 104 mdbm_util_$number_data_class 105 ) entry (ptr) returns (bit (1)); 106 107 dcl (addr, null) builtin; 108 109 icode = 0; 110 si_ptr, linus_set_fn_ptr, sclf_ptr, stk_ptr = null (); 111 arith_scal_fn = "1"b; /* assume arith scalar function */ 112 cmpx = "0"b; /* Init to real */ 113 eval_item_assn_type = REAL_ASSN_TYPE; /* Init to real assign_ type */ 114 115 stack.nelems = 0; 116 117 if mdbm_util_$number_data_class (addr (expression.rslt_desc)) 118 & mdbm_util_$complex_data_class (addr (expression.rslt_desc)) then do; 119 cmpx = "1"b; /* Complex */ 120 eval_item_assn_type = CMPX_ASSN_TYPE; 121 end; 122 do i = 1 to expression.nelems while (icode = 0); 123 if expression.elem.type (i) = OPERATOR then 124 call calculate; /* Evaluate */ 125 else do; 126 if expression.elem.type (i) = SCAL_FUNC then 127 call 128 linus_eval_scal_func (lcb_ptr, expression.elem.fn_ptr (i), 129 icode); 130 if icode = 0 131 & mdbm_util_$number_data_class (addr (expression.elem.desc)) 132 then do; 133 stack.nelems = stack.nelems + 1; /* Push item onto stack */ 134 if cmpx then /* Type is complex */ 135 stack.operand.ptr (stack.nelems), eval_item_assn_ptr = 136 addr (stack.operand.cmpx (stack.nelems)); 137 else stack.operand.ptr (stack.nelems), eval_item_assn_ptr = 138 addr (stack.operand.real (stack.nelems)); 139 call 140 assign_round_ (eval_item_assn_ptr, eval_item_assn_type, 141 EVAL_ITEM_ASSN_LENGTH, expression.elem.assn_ptr (i), 142 expression.elem.assn_type (i), expression.elem.assn_len (i)); 143 end; 144 else if expression.nelems = 1 then do; /* expression should contain only one item */ 145 arith_scal_fn = "0"b; 146 si_ptr = destination_ptr; 147 call 148 assign_round_ (select_info.user_item.rslt_assn_ptr (index), 149 select_info.user_item.rslt_assn_type (index), 150 select_info.user_item.rslt_assn_len (index), 151 expression.elem.assn_ptr (1), expression.elem.assn_type (1), 152 expression.elem.assn_len (1)); 153 end; 154 else call error (linus_error_$inv_sclf_use); 155 end; 156 end; 157 158 if icode ^= 0 then 159 call error (icode); 160 if cmpx then 161 eval_item_assn_ptr = addr (stack.operand.cmpx (1)); 162 else eval_item_assn_ptr = addr (stack.operand.real (1)); 163 164 if arith_scal_fn then 165 go to store_rslt (caller); 166 else go to exit; 167 168 store_rslt (1): 169 si_ptr = destination_ptr; /* The request processor called */ 170 call 171 assign_round_ (select_info.user_item.rslt_assn_ptr (index), 172 select_info.user_item.rslt_assn_type (index), 173 select_info.user_item.rslt_assn_len (index), eval_item_assn_ptr, 174 eval_item_assn_type, EVAL_ITEM_ASSN_LENGTH); 175 go to exit; 176 177 store_rslt (2): 178 sclf_ptr = destination_ptr; /* A scalar function called */ 179 call 180 assign_round_ (scal_fn.arg.assn_ptr (index), scal_fn.arg.assn_type (index), 181 scal_fn.arg.assn_len (index), eval_item_assn_ptr, eval_item_assn_type, 182 EVAL_ITEM_ASSN_LENGTH); 183 go to exit; 184 185 store_rslt (3): 186 linus_set_fn_ptr = destination_ptr; /* A set function called */ 187 call 188 assign_round_ (linus_set_fn.arg.assn_ptr (index), 189 linus_set_fn.arg.assn_type (index), linus_set_fn.arg.assn_len (index), 190 eval_item_assn_ptr, eval_item_assn_type, EVAL_ITEM_ASSN_LENGTH); 191 192 exit: 193 return; 194 195 calculate: 196 proc; 197 198 /* Perform arithmetic operation on the two items on top of the operand stack */ 199 200 if stack.nelems < 2 then 201 call error (linus_error_$inv_expr); /* operation cannot be performed if stack does not have 2 items */ 202 203 go to case (expression.elem.op_code (i)); 204 205 case (1): 206 if cmpx then /* ADD */ 207 stack.operand.cmpx (stack.nelems - 1) = 208 stack.operand.cmpx (stack.nelems - 1) 209 + stack.operand.cmpx (stack.nelems); 210 else stack.operand.real (stack.nelems - 1) = 211 stack.operand.real (stack.nelems - 1) 212 + stack.operand.real (stack.nelems); 213 go to calculate_exit; 214 215 case (2): 216 if cmpx then /* SUBTRACT */ 217 stack.operand.cmpx (stack.nelems - 1) = 218 stack.operand.cmpx (stack.nelems - 1) 219 - stack.operand.cmpx (stack.nelems); 220 else stack.operand.real (stack.nelems - 1) = 221 stack.operand.real (stack.nelems - 1) 222 - stack.operand.real (stack.nelems); 223 go to calculate_exit; 224 225 case (3): 226 if cmpx then /* MULTIPLY */ 227 stack.operand.cmpx (stack.nelems - 1) = 228 stack.operand.cmpx (stack.nelems - 1) 229 * stack.operand.cmpx (stack.nelems); 230 else stack.operand.real (stack.nelems - 1) = 231 stack.operand.real (stack.nelems - 1) 232 * stack.operand.real (stack.nelems); 233 go to calculate_exit; 234 235 case (4): 236 if cmpx then /* DIVIDE */ 237 stack.operand.cmpx (stack.nelems - 1) = 238 stack.operand.cmpx (stack.nelems - 1) 239 / stack.operand.cmpx (stack.nelems); 240 else stack.operand.real (stack.nelems - 1) = 241 stack.operand.real (stack.nelems - 1) 242 / stack.operand.real (stack.nelems); 243 244 calculate_exit: 245 stack.nelems = stack.nelems - 1; /* Pop 1 item */ 246 247 end calculate; 248 249 250 251 error: 252 proc (err_code); 253 254 dcl err_code fixed bin (35); 255 256 icode = err_code; 257 258 go to exit; 259 260 end error; 261 262 end linus_eval_expr; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 10/14/90 0915.0 linus_eval_expr.pl1 >spec>install>1039>linus_eval_expr.pl1 46 1 07/29/86 1248.4 linus_lcb.incl.pl1 >ldd>include>linus_lcb.incl.pl1 48 2 03/27/82 0534.5 linus_expression.incl.pl1 >ldd>include>linus_expression.incl.pl1 50 3 09/16/83 1438.0 linus_select_info.incl.pl1 >ldd>include>linus_select_info.incl.pl1 52 4 11/23/82 1427.2 linus_set_fn.incl.pl1 >ldd>include>linus_set_fn.incl.pl1 54 5 03/27/82 0534.5 linus_scal_fn.incl.pl1 >ldd>include>linus_scal_fn.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. CMPX_ASSN_TYPE constant fixed bin(17,0) initial dcl 63 ref 120 EVAL_ITEM_ASSN_LENGTH 000007 constant fixed bin(35,0) initial dcl 69 set ref 139* 170* 179* 187* OPERATOR constant fixed bin(17,0) initial dcl 63 ref 123 REAL_ASSN_TYPE constant fixed bin(17,0) initial dcl 63 ref 113 SCAL_FUNC constant fixed bin(17,0) initial dcl 63 ref 126 addr builtin function dcl 107 ref 117 117 117 117 130 130 134 137 160 162 arg 6 based structure array level 2 in structure "scal_fn" dcl 5-3 in procedure "linus_eval_expr" arg 32 based structure array level 2 in structure "linus_set_fn" dcl 4-17 in procedure "linus_eval_expr" arith_scal_fn 000114 automatic bit(1) packed unaligned dcl 91 set ref 111* 145* 164 assign_round_ 000016 constant entry external dcl 100 ref 139 147 170 179 187 assn_len 11 based fixed bin(35,0) array level 3 in structure "expression" dcl 2-3 in procedure "linus_eval_expr" set ref 139* 147* assn_len 13 based fixed bin(35,0) array level 3 in structure "scal_fn" dcl 5-3 in procedure "linus_eval_expr" set ref 179* assn_len 37 based fixed bin(35,0) array level 3 in structure "linus_set_fn" dcl 4-17 in procedure "linus_eval_expr" set ref 187* assn_ptr 10 based pointer array level 3 in structure "scal_fn" dcl 5-3 in procedure "linus_eval_expr" set ref 179* assn_ptr 6 based pointer array level 3 in structure "expression" dcl 2-3 in procedure "linus_eval_expr" set ref 139* 147* assn_ptr 34 based pointer array level 3 in structure "linus_set_fn" dcl 4-17 in procedure "linus_eval_expr" set ref 187* assn_type 10 based fixed bin(17,0) array level 3 in structure "expression" dcl 2-3 in procedure "linus_eval_expr" set ref 139* 147* assn_type 12 based fixed bin(17,0) array level 3 in structure "scal_fn" dcl 5-3 in procedure "linus_eval_expr" set ref 179* assn_type 36 based fixed bin(17,0) array level 3 in structure "linus_set_fn" dcl 4-17 in procedure "linus_eval_expr" set ref 187* caller parameter fixed bin(17,0) dcl 79 ref 22 164 cmpx 24 000106 automatic complex float dec(59) array level 3 in structure "stack" dcl 57 in procedure "linus_eval_expr" set ref 134 160 205* 205 205 215* 215 215 225* 225 225 235* 235 235 cmpx 000115 automatic bit(1) packed unaligned dcl 92 in procedure "linus_eval_expr" set ref 112* 119* 134 160 205 215 225 235 desc 3 based bit(36) array level 3 dcl 2-3 set ref 130 130 destination_ptr parameter pointer dcl 72 ref 22 146 168 177 185 elem 2 based structure array level 2 dcl 2-3 err_code parameter fixed bin(35,0) dcl 254 ref 251 256 eval_item_assn_ptr 000110 automatic pointer initial dcl 72 set ref 72* 134* 137* 139* 160* 162* 170* 179* 187* eval_item_assn_type 000113 automatic fixed bin(17,0) dcl 79 set ref 113* 120* 139* 170* 179* 187* ex_ptr parameter pointer dcl 2-27 ref 22 57 117 117 117 117 122 123 126 126 130 130 139 139 139 144 147 147 147 203 expression based structure level 1 dcl 2-3 fn_ptr 12 based pointer array level 3 dcl 2-3 set ref 126* i 000112 automatic fixed bin(17,0) dcl 79 set ref 122* 123 126 126 139 139 139* 203 icode parameter fixed bin(35,0) dcl 88 set ref 22 109* 122 126* 130 158 158* 256* index parameter fixed bin(17,0) dcl 79 ref 22 147 147 147 170 170 170 179 179 179 187 187 187 lcb_ptr parameter pointer dcl 1-121 set ref 22 126* linus_error_$inv_expr 000012 external static fixed bin(35,0) dcl 94 set ref 200* linus_error_$inv_sclf_use 000010 external static fixed bin(35,0) dcl 94 set ref 154* linus_eval_scal_func 000014 constant entry external dcl 99 ref 126 linus_set_fn based structure level 1 dcl 4-17 linus_set_fn_ptr 000102 automatic pointer dcl 4-55 set ref 110* 185* 187 187 187 mdbm_util_$complex_data_class 000020 constant entry external dcl 102 ref 117 mdbm_util_$number_data_class 000022 constant entry external dcl 102 ref 117 130 nelems 000106 automatic fixed bin(17,0) level 2 in structure "stack" dcl 57 in procedure "linus_eval_expr" set ref 115* 133* 133 134 134 137 137 200 205 205 205 210 210 210 215 215 215 220 220 220 225 225 225 230 230 230 235 235 235 240 240 240 244* 244 nelems 1 based fixed bin(17,0) level 2 in structure "expression" dcl 2-3 in procedure "linus_eval_expr" ref 57 122 144 nmi_alloc 13 based fixed bin(17,0) level 2 dcl 3-5 ref 147 147 147 170 170 170 nsv_alloc 12 based fixed bin(17,0) level 2 dcl 3-5 ref 147 147 147 170 170 170 null builtin function dcl 107 ref 72 72 110 op_code 2(05) based fixed bin(3,0) array level 3 packed packed unaligned dcl 2-3 ref 203 operand 2 000106 automatic structure array level 2 dcl 57 ptr 2 000106 automatic pointer array level 3 dcl 57 set ref 134* 137* real 4 000106 automatic float dec(59) array level 3 dcl 57 set ref 137 162 210* 210 210 220* 220 220 230* 230 230 240* 240 240 rslt_assn_len based fixed bin(35,0) array level 3 dcl 3-5 set ref 147* 170* rslt_assn_ptr based pointer array level 3 dcl 3-5 set ref 147* 170* rslt_assn_type based fixed bin(17,0) array level 3 dcl 3-5 set ref 147* 170* rslt_desc based bit(36) level 2 dcl 2-3 set ref 117 117 117 117 scal_fn based structure level 1 dcl 5-3 sclf_ptr 000104 automatic pointer dcl 5-27 set ref 110* 177* 179 179 179 select_info based structure level 1 dcl 3-5 si_ptr 000100 automatic pointer dcl 3-49 set ref 110* 146* 147 147 147 168* 170 170 170 stack 000106 automatic structure level 1 dcl 57 stk_ptr 000106 automatic pointer initial dcl 72 set ref 72* 110* type 2 based fixed bin(4,0) array level 3 packed packed unaligned dcl 2-3 ref 123 126 user_item based structure array level 2 dcl 3-5 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. initial_number_of_linus_set_fn_args automatic fixed bin(17,0) dcl 4-54 lcb based structure level 1 dcl 1-53 nelems_init automatic fixed bin(17,0) dcl 2-28 nmi_init automatic fixed bin(17,0) dcl 3-48 nsclf_args_init automatic fixed bin(17,0) dcl 5-28 nsv_init automatic fixed bin(17,0) dcl 3-48 nui_init automatic fixed bin(17,0) dcl 3-48 NAMES DECLARED BY EXPLICIT CONTEXT. calculate 000551 constant entry internal dcl 195 ref 123 calculate_exit 000750 constant label dcl 244 ref 213 223 233 case 000003 constant label array(4) dcl 205 ref 203 error 000753 constant entry internal dcl 251 ref 154 158 200 exit 000550 constant label dcl 192 ref 166 175 183 258 linus_eval_expr 000024 constant entry external dcl 22 store_rslt 000000 constant label array(3) dcl 168 ref 164 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1076 1122 764 1106 Length 1402 764 24 243 111 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME linus_eval_expr 184 external procedure is an external procedure. calculate internal procedure shares stack frame of external procedure linus_eval_expr. error internal procedure shares stack frame of external procedure linus_eval_expr. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME linus_eval_expr 000100 si_ptr linus_eval_expr 000102 linus_set_fn_ptr linus_eval_expr 000104 sclf_ptr linus_eval_expr 000106 stack linus_eval_expr 000106 stk_ptr linus_eval_expr 000110 eval_item_assn_ptr linus_eval_expr 000112 i linus_eval_expr 000113 eval_item_assn_type linus_eval_expr 000114 arith_scal_fn linus_eval_expr 000115 cmpx linus_eval_expr THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_e_as call_ext_out return_mac alloc_auto_adj ext_entry mpcdec dvcdec THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. assign_round_ linus_eval_scal_func mdbm_util_$complex_data_class mdbm_util_$number_data_class THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. linus_error_$inv_expr linus_error_$inv_sclf_use LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 22 000016 57 000031 72 000042 109 000045 110 000046 111 000053 112 000055 113 000056 115 000060 117 000061 119 000120 120 000122 122 000124 123 000142 126 000156 130 000174 133 000222 134 000223 137 000237 139 000247 143 000273 144 000274 145 000301 146 000302 147 000305 153 000355 154 000356 156 000365 158 000367 160 000400 162 000406 164 000411 166 000416 168 000417 170 000422 175 000472 177 000473 179 000476 183 000521 185 000522 187 000525 192 000550 195 000551 200 000552 203 000564 205 000575 210 000615 213 000626 215 000627 220 000647 223 000660 225 000661 230 000700 233 000711 235 000712 240 000731 244 000750 247 000752 251 000753 256 000755 258 000760 ----------------------------------------------------------- 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