1 /*                COMPDV/COMP_DSM STRUCTURE INTERCONNECTION                  */
  2 
  3 /*                   TABLES USED BY compdv WHILE PARSING,                    */
  4 /*                  NAMES MARKED WITH * ARE internal ONLY                    */
  5 /*              Tables are generally shown in order generated                */
  6 /*               (except for strings, which crop up all over)                */
  7 
  8 /* dcl_l_p(1)>----+                                                          */
  9 /* dcl_l_p(2)>-+  |                               dcls are made first.       */
 10 /*             |  |  dcl_*                        They are strings which     */
 11 /*             |  |   ________                    are referenced by name     */
 12 /*             |  +->|next    >--+                as an aid to understanding */
 13 /*             |     |dcl_name|  |                the DSM definition. They   */
 14 /*             |     |leng    |  |                are not necessary to do    */
 15 /*             |     |dcl_v   |  |                the job.                   */
 16 /*             |     |________|  |                                           */
 17 /*             |  +--------------+      Strings used by mediachars are       */
 18 /*             |  |  dcl_*              temporary, i.e. only used by compdv, */
 19 /*             |  |   ________          pointers to these go in strl_p(1,*). */
 20 /*             |  +->|next    >--+                                           */
 21 /*             |     |dcl_name|  |      Strings used by font, cleanup, etc.  */
 22 /*             |     |leng    |  |      are permanent, i.e. they end up in   */
 23 /*             |     |dcl_v   |  |      the DSM, pointers to these go in     */
 24 /*             |     |________|  |      strl_p(2,*).                         */
 25 /*             |  +--------------+                                           */
 26 /*             |  |  dcl_*              strl_p*                              */
 27 /*             |  |   ________           _________          bstr*            */
 28 /*             +--+->|next    >null     |1,1 |2,1 >...       ____            */
 29 /*                   |dcl_name|         |1,2 |2,2 >-------->|leng|           */
 30 /*                   |leng    |         .    .    .         |str |           */
 31 /*                   |dcl_v   |         :    :    :         |____|           */
 32 /*                   |________|                                              */
 33 
 34 dcl str_p           ptr;
 35 dcl 1 bstr          based (str_p),      /* based string used for building    */
 36       2 leng        fixed bin,          /*  pseudo-char_var strings          */
 37       2 str         char (bstr.leng),
 38       2 dummy       bit (36) aligned;   /* where next structure will go      */
 39 
 40 dcl dcl_l_p         (2) ptr;            /* dcl_ list begin/end               */
 41 dcl dcl_p           ptr;
 42 dcl 1 dcl_          based (dcl_p),      /* ** symbol declaration             */
 43       2 next        ptr,                /* linked list next element          */
 44       2 dcl_name    char (8),           /* declared name                     */
 45       2 leng        fixed bin,          /* length of definition string       */
 46       2 dcl_v       char (dcl_.leng),   /* symbol definition string          */
 47       2 dummy       ptr;                /* where next one is based           */
 48 %page;
 49 /*      mediachars*                                                          */
 50 /*       _______                        Next, all mediachars are defined     */
 51 /*      |count=n|__                     in terms of dcl'ed symbols or        */
 52 /*   (1)|name|out_r>----------+         literals.                            */
 53 /*   (2)|name|out_r>...       |                             bstr*            */
 54 /*      .    .     .          |                              ____            */
 55 /*      :    :     :          +---------------------------->|leng|           */
 56 /*   (n)|name|out_r>...                                     |str |           */
 57 /*      |____|_____|                                        |____|           */
 58 dcl mediachars_p    ptr;
 59 dcl 1 mediachars    based (mediachars_p),
 60       2 count       fixed bin,          /* how many have been defined        */
 61       2 e           (mediachars.count),
 62         3 name      char (32),          /* name of the char                  */
 63         3 out_r     bit (18) aligned;   /* output string to get it           */
 64 
 65 /*               media*
 66 /*                _______                         Then, all media are        */
 67 /*         ______|count=m|_________ ... ______    described in terms of the  */
 68 /*     (1)|name|rel_units|w11 |w12 |... |w1n |    mediachars, with the       */
 69 /*     (2)|name|rel_units|w21 |w22 |... | @  |    widths being defined for   */
 70 /*        .    .         .    .    .    .    .    each. Values might not     */
 71 /*        :    :         :    :    :    :    :    exist for all mediachars   */
 72 /*     (m)|name|rel_units|wm1 | @  |... |wmn |    in all media (shown as @). */
 73 /*        |____|_________|____|____|... |____|                               */
 74 /*    mediachar # -->     (1)  (2)  ...  (n)                                 */
 75 dcl media_p         ptr;
 76 dcl 1 media         based (media_p),
 77       2 count       fixed bin,          /* how many have been defined        */
 78       2 e           (media.count),
 79         3 name      char (32),          /* name of the media                 */
 80         3 rel_units fixed bin,          /* its stroke value                  */
 81         3 width     (mediachars.count) fixed bin;   /* for each mediachar    */
 82 %page;
 83 /*         view*                                                             */
 84 /*          _______                               Views are then made up     */
 85 /*         |count=k|__                            from the defined media.    */
 86 /*      (1)|view1|med4|                           Views can share a media,   */
 87 /*      (2)|view2|med2|                           but will differ media      */
 88 /*         .     .    .                           select string. Each Device */
 89 /*         :     :    :                           specifies its own set of   */
 90 /*      (k)|viewk|med4|                           media select strings.
 91 /*         |_____|____|                                                      */
 92 
 93 dcl view_p          ptr;
 94 dcl 1 view          based (view_p),
 95       2 count       fixed bin,          /* how many defined                  */
 96       2 e           (view.count),
 97         3 name      char (32),          /* viewname                          */
 98         3 media     fixed bin;          /* media being referenced            */
 99 
100 
101 /*        Def*                                                               */
102 /*         _______            Def's are a sort of macro definition.          */
103 /*        |count=d|_          Whenever a set of Multics chars have the same  */
104 /*     (1)|name1|pt1|         definition in several fonts, instead of        */
105 /*     (2)|name2|pt2|         entering the description again and again, a    */
106 /*        .     .   .         Def is made containing the needed info and     */
107 /*        :     :   :         then they are ref'ed in each table as needed.  */
108 /*     (d)|named|ptd|                                                        */
109 /*        |_____|___|                                                        */
110 
111 dcl Def_p           ptr;
112 dcl 1 Def           based (Def_p),
113       2 count       fixed bin,          /* how many Def's present            */
114       2 e           (Def.count),
115         3 name      char (32),          /* internal name of this Def         */
116         3 pt        ptr;                /* Points to the node in the         */
117                                         /*  lex_string_ list at which source */
118                                         /*  of the Def begins.  At ref time, */
119                                         /*  this source will be be re-parsed */
120                                         /*  via this pointer.                */
121 %page;
122 /* fntl_p(1)>----+                                                           */
123 /* fntl_p(2)>---)|(---------------------+                                    */
124 /*    +----------+                      |                                    */
125 /*    |   fnt*                fnt*      |         fnt*                       */
126 /*    |    _____               _____    |          _____                     */
127 /*    +-->|next >------------>|next >---+-------->|next >null                */
128 /*        |name |             |name |             |name |                    */
129 /*        |refno|             |refno|             |refno|                    */
130 /*        |node >...          |node >...          |node >...                 */
131 /*        |pt   >---+         |pt   >...          |pt   >...                 */
132 /*        |_____|   |         |_____|             |_____|                    */
133 /*    +-------------+                                                        */
134 /*    |    font                         Fonts are made up by selecting one   */
135 /*    |    _________                    or more mediachars from a view and   */
136 /*    +-->|units_r  >-----+             associating them to Multics (input)  */
137 /*        |oput_r   >--+  |             characters. To speed up measuring,   */
138 /*        |rel_units|  |  |             the width portion of the font table  */
139 /*        |footsep  |  |  |             is a fixed size.                     */
140 /*        |min_spb  |  |  |               To save space, however, the output */
141 /*        |avg_spb  |  |  |             string portion of the font is only   */
142 /*        |max_spb  |  |  |             as long as the highest Multics char  */
143 /*        |_________|  |  |             defined.                             */
144 /*    +----------------+  |                                                  */
145 /*    |    opu*           |    uni*                  The oput and units      */
146 /*    |    _____          |    _____         units   tables often end up     */
147 /*    +-->|next >...      +-->|next >...     _____   looking like others of  */
148 /*        |ref_p>---+         |ref_p>------>|(0)  |  their kind. Thus when   */
149 /*        |seqno|   |         |seqno|       |(1)  |  each is completed, it   */
150 /*        |refno|   |         |refno|       .     .  is matched against all  */
151 /*        |_____|   |         |_____|       :     :  prior ones & logically  */
152 /*    +-------------+                       |(511)|  removed if already      */
153 /*    |   oput                              |_____|  there, reducing DSM     */
154 /*    |    ____________                              size.                   */
155 /*    +-->|data_count=k|                                                     */
156 /*     (0)|which|what_r>...                                                  */
157 /*     (1)|which|what_r>...                       From compdv's point of     */
158 /*        .     .      .          medchar_sel     view, medchar_sel is a     */
159 /*        :     :      :         ________..._     bstr.                      */
160 /*     (k)|which|what_r>------->|len|text... |                               */
161 /*        |_____|______|        |___|________|                               */
162 /*                                                                           */
163 /*                                      oput.which references an entry in    */
164 /*                                      the Device's med_sel_table.          */
165 %page;
166 dcl font_count      fixed bin;          /* # font entries present            */
167 dcl fntl_p          (2) ptr;            /* begin/end fnt list                */
168 dcl fnt_p           ptr;
169 dcl 1 fnt           based (fnt_p),      /* === font info entry               */
170       2 next        ptr,                /* next entry                        */
171       2 name        char (32),          /* internal reference only           */
172       2 refno       fixed bin,          /* internal reference #              */
173       2 node        ptr,                /* rdc node for Font: statement      */
174                                         /*  used for error messages          */
175       2 pt          ptr,                /* points to the font table          */
176       2 dummy       ptr;                /* where next structure goes         */
177 
178 dcl uni_ct          fixed bin init (0);
179 dcl unil_p          (2) ptr;
180 dcl uni_p           ptr;
181 dcl 1 uni           based (uni_p),      /* === units entry                   */
182       2 next        ptr,                /* next entry                        */
183       2 ref_p       ptr,                /* points to units table             */
184       2 seqno       fixed bin,          /* internal sequence #               */
185       2 refno       fixed bin;          /* internal reference #              */
186                                         /* when seqno=refno this is a "real" */
187                                         /* entry, otherwise it's a duplicate */
188 
189 dcl opul_p          (2) ptr;
190 dcl opu_p           ptr;
191 dcl 1 opu           based (opu_p),      /* === oputs entry                   */
192       2 next        ptr,                /* next entry                        */
193       2 ref_p       ptr,                /* points to oput table              */
194       2 seqno       fixed bin,          /* internal sequence #               */
195       2 refno       fixed bin;          /* internal reference #              */
196                                         /* when seqno=refno this is a "real" */
197                                         /* entry, otherwise it's a duplicate */
198 
199 %page;
200 /*                             dvid*                                         */
201 /*                             _______                                       */
202 /*  dvidl_p(1)>-------------->|next   >------+     dvid*                     */
203 /*  dvidl_p(2)>----------+    |ndx    |      |     _______                   */
204 /*                       |    |real   |      +--->|next   >null              */
205 /*                       |    |refname|      |    |ndx    |                  */
206 /*                       |    |devname|      |    |real   |                  */
207 /*                       |    |dvt_ndx|      |    |refname|                  */
208 /*                       |    |_______|      |    |devname|                  */
209 /*                       |                   |    |dvt_ndx|                  */
210 /*                       +-------------------+    |_______|                  */
211 dcl comp_dvid_new   bit (1);            /* a new comp_dvid is being started  */
212 dcl comp_dvid_ct    fixed bin init (0); /* how many actual comp_dvid defined */
213 dcl dvid_ct         fixed bin;          /* # dvid entries present            */
214 dcl dvidl_p         (2) ptr;            /* begin/end of dvid list            */
215 dcl dvid_p          ptr;
216 dcl 1 dvid          based (dvid_p),     /* === comp_dvid data                */
217       2 next        ptr,                /* link to next entry                */
218       2 ndx         fixed bin,          /* which dvid being referenced       */
219       2 real        bit (1) aligned,    /* 1- defines a comp_dvid            */
220       2 refname     char (32),          /* external reference name           */
221       2 devname     char (32),          /* comp_dvid.devname                 */
222       2 dvt_ndx     fixed bin,          /* comp_dvid.dvt_r derived from this */
223       2 dummy       ptr;                /* place where next structure goes   */
224 
225 /* This structure contains all the info necessary to generate comp_dvid.     */
226 %page;
227 /*                                                           dvt*            */
228 /*  dvtl_p(1) >------+                                       _______         */
229 /*  dvtl_p(2) >-----)|(-------------------------------+---->|next   >null    */
230 /*                   |        dvt*                    |     |ndx    |        */
231 /*                   |        _______                 |     |prent  >-...    */
232 /*                   +------>|next   >----------------+     |med_sel>--...   */
233 /*                           |ndx    |                      |ref    >-...    */
234 /*                           |prent  >--------+             |_______|        */
235 /*                           |med_sel>-----+  |                              */
236 /*                           |ref    >--+  |  |              prent*          */
237 /*                           |_______|  |  |  |              __________      */
238 /*            +-------------------------+  |  +------------>|outproc   |     */
239 /*            |                            |                |artproc   |     */
240 /*            |      comp_dvt              |   med_sel      |footproc  |     */
241 /*            |      _________             |    _________   |__________|     */
242 /*            +---->| details |            +-->| details |                   */
243 /*                  | below   |                |  below  |                   */
244 /*                  |_________|                |_________|                   */
245 
246 dcl dvt_ct          fixed bin;          /* # dvt entries present             */
247 dcl dvtl_p          (2) ptr;            /* begin/end of dvt list             */
248 dcl dvt_p           ptr;
249 dcl 1 dvt           based (dvt_p),      /* === comp_dvt reference info       */
250       2 next        ptr,                /* link to next entry                */
251       2 ndx         fixed bin,          /* which index this represents       */
252       2 prent       ptr,                /* ptr to prent data                 */
253       2 med_sel     ptr,                /* ptr to associated med_sel array   */
254       2 ref         ptr,                /* ptr to comp_dvt                   */
255       2 dummy       ptr;                /* place where next structure goes   */
256 dcl prent_p         ptr;
257 dcl 1 prent         based (prent_p),    /* === entryname strings, comp_dvt   */
258       2 outproc     char (68) var,
259       2 artproc     char (68) var,
260       2 footproc    char (68) var,
261       2 dummy       ptr;                /* place where next structure goes   */
262 
263 %page;
264 /*                      mem*                                                 */
265 /*                      ______                                               */
266 /*  meml_p(1) >---- +->|next  >--+                                           */
267 /*  meml_p(2) >--+     |ref_p >  |                                           */
268 /*               |     |seqno |  |                                           */
269 /*               |     |______|  |                                           */
270 /*               +---------------+                                           */
271 /*               |     mem*                                                  */
272 /*               |     ______           member                               */
273 /*               +--->|next  >null      _________                            */
274 /*                    |ref_p >-------->| details |                           */
275 /*                    |seqno |         |  below  |                           */
276 /*                    |______|         |_________|                           */
277 
278 dcl meml_p          (2) ptr;            /* begin/end member list             */
279 dcl mem_ct          fixed bin init (0); /* internal sequence counter         */
280 dcl mem_p           ptr;
281 dcl 1 mem           based (mem_p),      /* === member table (code gen only)  */
282       2 next        ptr,                /* next entry                        */
283       2 ref_p       ptr,                /* pointer to the member table       */
284       2 seqno       fixed bin,          /* internal sequence #               */
285       2 refno       fixed bin,          /* internal reference #              */
286                                         /* when seqno=refno this is a "real" */
287                                         /* entry, otherwise it's a duplicate */
288       2 dummy       ptr;                /* where next structure goes         */
289 ^L
290 /*                   EXTERNAL INTERCONNECTION in the DSM                     */
291 /*  linkage                                                                  */
292 /*  section                                                    comp_dvid     */
293 /*  ______     +-----------------------------------------+     _______       */
294 /* |      |    |                                         +--->|       |      */
295 /* |name1 >----+                                              |devname|      */
296 /* |name2 >---)|(-------------------+    comp_dvid            |dvt_r  >--+   */
297 /* |name3 >----+   comp_dvid        |    _______              |_______|  |   */
298 /* |name4 >--+     _______          +-->|       |     comp_dvt           |   */
299 /* | etc. |  +--->|       |             |devname|     ________           |   */
300 /* |______|       |devname|             |dvt_r  >--->| ...               |   */
301 /*                |dvt_r  >--+          |_______|    |                   |   */
302 /*                |_______|  |                                           |   */
303 /*  +-------<----------------+-----------------------------------<-------+   */
304 /*  |    comp_dvt                                                            */
305 /*  |    _____________                                         bstr          */
306 /*  +-->|             |                                        ___________   */
307 /*      |atd_r        >-------------------------------------->|len|str... |  */
308 /*      |dvc_r        >...                                    |___|_______|  */
309 /*      |med_sel_tab_r>-----------------+    med_sel_tab                     */
310 /*      | ...         |                 |    _______           med_sel       */
311 /*      |family_ct=F  |                 +-->|count=K|          ___________   */
312 /*   (1)|.member_r    >--+               (1)|ref_r>---------->|len|str... |  */
313 /*   (1)|.name        |  |                  .     .           |___|_______|  */
314 /*      | ...         |  |               (n)|ref_r>nullo                     */
315 /*      |_____________|  |                  .     .                          */
316 /*       +---------------+               (K)|ref_r>...       sizel           */
317 /*       |    member                        |_____|          ________        */
318 /*       |    _______          +--------------------------->|val_ct=S|       */
319 /*       +-->|count=L|_________|________________         (1)|val     |       */
320 /*        (1)|font_r> size_r>  | lex|Scaley|name|           .        .       */
321 /*        (2)|font_r> size_r>--+ lex|Scaley|name|           :        :       */
322 /*           .      .       .       .      .    .        (S)|val     |       */
323 /*           :      :       :       :      :    :           |________|       */
324 /*        (L)|font_r>---+   > Scalex|Scaley|name|                            */
325 /*           |______|___|___|_______|______|____|                            */
326 /*                      |                                                    */
327 /*    +-----------------+                                                    */
328 /*    |    font                                             units            */
329 /*    |    _________                                        _____            */
330 /*    +-->|units_r  >-------------------------------------->|(0)  |          */
331 /*        |oput_r   >---+                                   |(1)  |          */
332 /*        |rel_units|   |                                   .     .          */
333 /*        |footsep  |   |     oput                          :     :          */
334 /*        |min_spb  |   |    _________                      |(511)|          */
335 /*        |avg_spb  |   +-->|data_ct=k|__                   |_____|          */
336 /*        |max_spb  |    (0)|which|what_r>...                                */
337 /*        |_________|    (1)|which|what_r>...                                */
338 /*                          .     .      .            medchar_sel            */
339 /*                          :     :      :           ________..._            */
340 /*                       (k)|which|what_r>--------->|len|text... |           */
341 /*                          |_____|______|          |___|________|           */
342 /*                                                                           */
343 /*                                      oput.which references an entry in    */
344 /*                                      the Device's med_sel_table.          */