1 /*
  2 The function of cobol_gen_driver_ is to direct the generation of the
  3 object code necessary to implement the source code comprising a
  4 given COBOL program.  The primary input to cobol_gen_driver_ is the
  5 file Minpral5.  This file comprises a sequence of tokens which
  6 are, in effect, a coded version of the source program.  These
  7 tokens are grouped, by PD Syntax, into logical sets for process-
  8 ing by the insertion of type-19 End of "Statement" (EOS) tokens.
  9 cobol_gen_driver_ creates a structure (in_token) consisting primarily
 10 of pointers to each token comprising a "statement", as delimited
 11 by EOS tokens, and passes a pointer to this structure to the
 12 appropriate generator.  In addition, cobol_gen_driver_ performs a
 13 number of auxiliary functions, such as;
 14 
 15   1.  Initialization of a number of variables to pre-code-gener-
 16       ation values.
 17 
 18   2.  Initialization of the definition and linkage sections.
 19 
 20   3.  Deallocation of the stack and determination of maximum re-
 21       quired stack size.
 22 
 23   4.  Deallocation of the area (temp_token_area) in which tokens
 24       to temporaries are built.
 25 
 26   5.  Tabulation of data for the construction of the procedure
 27       division map.
 28 
 29   6.  Resolution of internal tag definition and tag equivalence
 30       tokens not bracketed within EOS tokens.
 31 
 32 
 33 U^H__^Hs_^Ha_^Hg_^He:^H_
 34 
 35      declare cobol_gen_driver_ entry;
 36 
 37      call cobol_gen_driver_;
 38 
 39 
 40 D^H__^Ha_^Ht_^Ha:^H_
 41 
 42       include cobol_;
 43 
 44           Items in cobol_ include file used (u) and/or set (s) by
 45           cobol_gen_driver_:
 46 
 47                cobol_ptr (u)
 48                com_ptr (u)
 49                alter_flag (s)
 50                alter_index (s)
 51                alter_list_ptr (s)
 52                init_stack_off (s)
 53                map_data_ptr (u)
 54                map_data_max (u)
 55                max_stack_off (s)
 56                minpral5_ptr (u)
 57                misc_end_ptr (u)
 58                misc_max (u)
 59                para_eop_flag (s)
 60                perform_list_ptr (u/s)
 61                perform_para_index (s)
 62                perform_sect_index (s)
 63                priority_no (s)
 64                sect_eop_flag (s)
 65                seg_init_list_ptr (s)
 66                stack_off (u/s)
 67                temp_token_area_ptr (s)
 68                temp_token_ptr (s)
 69                temp_token_max (s)
 70                token_block1_ptr (u)
 71                token_block2_ptr (u)
 72                text_wd_off (u)
 73 
 74       include fixed_common;
 75 
 76           Items in fixed_common include file used (u) and/or set (s) by
 77           cobol_gen_driver_:
 78 
 79                perf_alter_info (u)
 80                size_perform_info (u)
 81 
 82 Conditional Statements:
 83 
 84 (1) STATEMENT OPTION
 85 
 86           (a) cobol_pdout_
 87 
 88                     STATEMENT
 89                     type19(vt = CODE, b = 1, f = 00)
 90                     OPTION
 91                     type19(vt = 3, b = 0)
 92 
 93           (b) generated code
 94 
 95                               STATEMENT -> (L1)
 96                               OPTION
 97                     L1:
 98 
 99 (2) STATEMENT OPTION NOT OPTION
100 
101           (a) cobol_pdout_
102 
103                     STATEMENT
104                     type19(vt = CODE, b = 1, f = 00)
105                     OPTION
106                     type19(vt  = 3, b = 1, f = 01)
107                     NOT OPTION
108                     type19(vt = 3, b = 0)
109 
110           (b) generated code
111 
112                               STATEMENT -> (L1)
113                               OPTION
114                               TRA L3
115                     L1:
116                               NOT OPTION
117                     L2:
118 
119 (3) STATEMENT NOT OPTION OPTION
120 
121           (a) cobol_pdout_
122 
123                     STATEMENT
124                     type19(vt = CODE, b = 1, f = 01)
125                     NOT OPTION
126                     type19(vt = 3, b = 1, f = 00)
127                     OPTION
128                     type19(vt = 3, b = 0)
129 
130           (b) generated code
131 
132                               STATEMENT -> (L1)
133                               NOT OPTION
134                               TRA L2
135                     L1:
136                               OPTION
137                     L2:
138 
139 (4) STATEMENT NOT OPTION
140 
141           (a) cobol_pdout_
142 
143                     STATEMENT
144                     type19(vt = CODE, b = 1, f = 01)
145                     NOT OPTION
146                     type19(vt = 3, b = 0)
147 
148           (b) generated code
149 
150                               STATEMENT -> (L1)
151                               NOT-OPTION
152                     L1:
153                                                               */