Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
/*
31
    AUTOMATICALLY GENERATED FROM ALGEBRA calculus (VERSION 1.2)
32
    BY calculus (VERSION 1.2)
33
*/
34
 
35
#ifndef PRINT_DEF_H_INCLUDED
36
#define PRINT_DEF_H_INCLUDED
37
 
38
#include "calculus.h"
39
#include "type_ops.h"
40
#include "cmd_ops.h"
41
 
42
/* Printing function declarations */
43
 
44
#ifndef PRINT_list_cmd
45
static void PRINT_list_cmd PROTO_S ( ( FILE *, LIST ( COMMAND ), char *, int ) ) ;
46
#endif
47
 
48
#ifndef PRINT_cmd
49
static void PRINT_cmd PROTO_S ( ( FILE *, COMMAND, char *, int ) ) ;
50
#endif
51
 
52
#ifndef PRINT_list_ptr_map
53
static void PRINT_list_ptr_map PROTO_S ( ( FILE *, LIST ( PTR ( MAP ) ), char *, int ) ) ;
54
#endif
55
 
56
#ifndef PRINT_list_MAP_P
57
#define PRINT_list_MAP_P( A, B, C, D ) PRINT_list_ptr_map ( ( A ), ( B ), ( C ), ( D ) )
58
#endif
59
 
60
#ifndef PRINT_list_ptr_fld
61
static void PRINT_list_ptr_fld PROTO_S ( ( FILE *, LIST ( PTR ( FIELD ) ), char *, int ) ) ;
62
#endif
63
 
64
#ifndef PRINT_list_FIELD_P
65
#define PRINT_list_FIELD_P( A, B, C, D ) PRINT_list_ptr_fld ( ( A ), ( B ), ( C ), ( D ) )
66
#endif
67
 
68
#ifndef PRINT_list_ptr_arg
69
static void PRINT_list_ptr_arg PROTO_S ( ( FILE *, LIST ( PTR ( ARGUMENT ) ), char *, int ) ) ;
70
#endif
71
 
72
#ifndef PRINT_list_ARGUMENT_P
73
#define PRINT_list_ARGUMENT_P( A, B, C, D ) PRINT_list_ptr_arg ( ( A ), ( B ), ( C ), ( D ) )
74
#endif
75
 
76
#ifndef PRINT_list_ptr_cmp
77
static void PRINT_list_ptr_cmp PROTO_S ( ( FILE *, LIST ( PTR ( COMPONENT ) ), char *, int ) ) ;
78
#endif
79
 
80
#ifndef PRINT_list_COMPONENT_P
81
#define PRINT_list_COMPONENT_P( A, B, C, D ) PRINT_list_ptr_cmp ( ( A ), ( B ), ( C ), ( D ) )
82
#endif
83
 
84
#ifndef PRINT_list_ptr_ec
85
static void PRINT_list_ptr_ec PROTO_S ( ( FILE *, LIST ( PTR ( ECONST ) ), char *, int ) ) ;
86
#endif
87
 
88
#ifndef PRINT_list_ECONST_P
89
#define PRINT_list_ECONST_P( A, B, C, D ) PRINT_list_ptr_ec ( ( A ), ( B ), ( C ), ( D ) )
90
#endif
91
 
92
#ifndef PRINT_alg
93
static void PRINT_alg PROTO_S ( ( FILE *, ALGEBRA_DEFN, char *, int ) ) ;
94
#endif
95
 
96
#ifndef PRINT_list_ptr_type
97
static void PRINT_list_ptr_type PROTO_S ( ( FILE *, LIST ( PTR ( TYPE ) ), char *, int ) ) ;
98
#endif
99
 
100
#ifndef PRINT_list_TYPE_P
101
#define PRINT_list_TYPE_P( A, B, C, D ) PRINT_list_ptr_type ( ( A ), ( B ), ( C ), ( D ) )
102
#endif
103
 
104
#ifndef PRINT_list_ptr_un
105
static void PRINT_list_ptr_un PROTO_S ( ( FILE *, LIST ( PTR ( UNION ) ), char *, int ) ) ;
106
#endif
107
 
108
#ifndef PRINT_list_UNION_P
109
#define PRINT_list_UNION_P( A, B, C, D ) PRINT_list_ptr_un ( ( A ), ( B ), ( C ), ( D ) )
110
#endif
111
 
112
#ifndef PRINT_list_ptr_str
113
static void PRINT_list_ptr_str PROTO_S ( ( FILE *, LIST ( PTR ( STRUCTURE ) ), char *, int ) ) ;
114
#endif
115
 
116
#ifndef PRINT_list_STRUCTURE_P
117
#define PRINT_list_STRUCTURE_P( A, B, C, D ) PRINT_list_ptr_str ( ( A ), ( B ), ( C ), ( D ) )
118
#endif
119
 
120
#ifndef PRINT_list_ptr_en
121
static void PRINT_list_ptr_en PROTO_S ( ( FILE *, LIST ( PTR ( ENUM ) ), char *, int ) ) ;
122
#endif
123
 
124
#ifndef PRINT_list_ENUM_P
125
#define PRINT_list_ENUM_P( A, B, C, D ) PRINT_list_ptr_en ( ( A ), ( B ), ( C ), ( D ) )
126
#endif
127
 
128
#ifndef PRINT_list_ptr_ident
129
static void PRINT_list_ptr_ident PROTO_S ( ( FILE *, LIST ( PTR ( IDENTITY ) ), char *, int ) ) ;
130
#endif
131
 
132
#ifndef PRINT_list_IDENTITY_P
133
#define PRINT_list_IDENTITY_P( A, B, C, D ) PRINT_list_ptr_ident ( ( A ), ( B ), ( C ), ( D ) )
134
#endif
135
 
136
#ifndef PRINT_list_ptr_prim
137
static void PRINT_list_ptr_prim PROTO_S ( ( FILE *, LIST ( PTR ( PRIMITIVE ) ), char *, int ) ) ;
138
#endif
139
 
140
#ifndef PRINT_list_PRIMITIVE_P
141
#define PRINT_list_PRIMITIVE_P( A, B, C, D ) PRINT_list_ptr_prim ( ( A ), ( B ), ( C ), ( D ) )
142
#endif
143
 
144
#ifndef PRINT_UNION_P
145
#define PRINT_UNION_P( A, B, C, D ) PRINT_ptr_un ( ( A ), ( B ), ( C ), ( D ) )
146
#endif
147
 
148
#ifndef PRINT_ptr_un
149
static void PRINT_ptr_un PROTO_S ( ( FILE *, PTR ( UNION ), char *, int ) ) ;
150
#endif
151
 
152
#ifndef PRINT_un
153
static void PRINT_un PROTO_S ( ( FILE *, UNION, char *, int ) ) ;
154
#endif
155
 
156
#ifndef PRINT_TYPE_P_P
157
#define PRINT_TYPE_P_P( A, B, C, D ) PRINT_ptr_TYPE_P ( ( A ), ( B ), ( C ), ( D ) )
158
#endif
159
 
160
#ifndef PRINT_ptr_ptr_type
161
static void PRINT_ptr_ptr_type PROTO_S ( ( FILE *, PTR ( PTR ( TYPE ) ), char *, int ) ) ;
162
#endif
163
 
164
#ifndef PRINT_ptr_TYPE_P
165
#define PRINT_ptr_TYPE_P( A, B, C, D ) PRINT_ptr_ptr_type ( ( A ), ( B ), ( C ), ( D ) )
166
#endif
167
 
168
#ifndef PRINT_TYPE_P
169
#define PRINT_TYPE_P( A, B, C, D ) PRINT_ptr_type ( ( A ), ( B ), ( C ), ( D ) )
170
#endif
171
 
172
#ifndef PRINT_ptr_type
173
static void PRINT_ptr_type PROTO_S ( ( FILE *, PTR ( TYPE ), char *, int ) ) ;
174
#endif
175
 
176
#ifndef PRINT_type
177
static void PRINT_type PROTO_S ( ( FILE *, TYPE, char *, int ) ) ;
178
#endif
179
 
180
#ifndef PRINT_STRUCTURE_P
181
#define PRINT_STRUCTURE_P( A, B, C, D ) PRINT_ptr_str ( ( A ), ( B ), ( C ), ( D ) )
182
#endif
183
 
184
#ifndef PRINT_ptr_str
185
static void PRINT_ptr_str PROTO_S ( ( FILE *, PTR ( STRUCTURE ), char *, int ) ) ;
186
#endif
187
 
188
#ifndef PRINT_str
189
static void PRINT_str PROTO_S ( ( FILE *, STRUCTURE, char *, int ) ) ;
190
#endif
191
 
192
#ifndef PRINT_PRIMITIVE_P
193
#define PRINT_PRIMITIVE_P( A, B, C, D ) PRINT_ptr_prim ( ( A ), ( B ), ( C ), ( D ) )
194
#endif
195
 
196
#ifndef PRINT_ptr_prim
197
static void PRINT_ptr_prim PROTO_S ( ( FILE *, PTR ( PRIMITIVE ), char *, int ) ) ;
198
#endif
199
 
200
#ifndef PRINT_prim
201
static void PRINT_prim PROTO_S ( ( FILE *, PRIMITIVE, char *, int ) ) ;
202
#endif
203
 
204
#ifndef PRINT_MAP_P
205
#define PRINT_MAP_P( A, B, C, D ) PRINT_ptr_map ( ( A ), ( B ), ( C ), ( D ) )
206
#endif
207
 
208
#ifndef PRINT_ptr_map
209
static void PRINT_ptr_map PROTO_S ( ( FILE *, PTR ( MAP ), char *, int ) ) ;
210
#endif
211
 
212
#ifndef PRINT_map
213
static void PRINT_map PROTO_S ( ( FILE *, MAP, char *, int ) ) ;
214
#endif
215
 
216
#ifndef PRINT_IDENTITY_P
217
#define PRINT_IDENTITY_P( A, B, C, D ) PRINT_ptr_ident ( ( A ), ( B ), ( C ), ( D ) )
218
#endif
219
 
220
#ifndef PRINT_ptr_ident
221
static void PRINT_ptr_ident PROTO_S ( ( FILE *, PTR ( IDENTITY ), char *, int ) ) ;
222
#endif
223
 
224
#ifndef PRINT_ident
225
static void PRINT_ident PROTO_S ( ( FILE *, IDENTITY, char *, int ) ) ;
226
#endif
227
 
228
#ifndef PRINT_FIELD_P
229
#define PRINT_FIELD_P( A, B, C, D ) PRINT_ptr_fld ( ( A ), ( B ), ( C ), ( D ) )
230
#endif
231
 
232
#ifndef PRINT_ptr_fld
233
static void PRINT_ptr_fld PROTO_S ( ( FILE *, PTR ( FIELD ), char *, int ) ) ;
234
#endif
235
 
236
#ifndef PRINT_fld
237
static void PRINT_fld PROTO_S ( ( FILE *, FIELD, char *, int ) ) ;
238
#endif
239
 
240
#ifndef PRINT_ENUM_P
241
#define PRINT_ENUM_P( A, B, C, D ) PRINT_ptr_en ( ( A ), ( B ), ( C ), ( D ) )
242
#endif
243
 
244
#ifndef PRINT_ptr_en
245
static void PRINT_ptr_en PROTO_S ( ( FILE *, PTR ( ENUM ), char *, int ) ) ;
246
#endif
247
 
248
#ifndef PRINT_en
249
static void PRINT_en PROTO_S ( ( FILE *, ENUM, char *, int ) ) ;
250
#endif
251
 
252
#ifndef PRINT_ECONST_P
253
#define PRINT_ECONST_P( A, B, C, D ) PRINT_ptr_ec ( ( A ), ( B ), ( C ), ( D ) )
254
#endif
255
 
256
#ifndef PRINT_ptr_ec
257
static void PRINT_ptr_ec PROTO_S ( ( FILE *, PTR ( ECONST ), char *, int ) ) ;
258
#endif
259
 
260
#ifndef PRINT_ec
261
static void PRINT_ec PROTO_S ( ( FILE *, ECONST, char *, int ) ) ;
262
#endif
263
 
264
#ifndef PRINT_COMPONENT_P
265
#define PRINT_COMPONENT_P( A, B, C, D ) PRINT_ptr_cmp ( ( A ), ( B ), ( C ), ( D ) )
266
#endif
267
 
268
#ifndef PRINT_ptr_cmp
269
static void PRINT_ptr_cmp PROTO_S ( ( FILE *, PTR ( COMPONENT ), char *, int ) ) ;
270
#endif
271
 
272
#ifndef PRINT_cmp
273
static void PRINT_cmp PROTO_S ( ( FILE *, COMPONENT, char *, int ) ) ;
274
#endif
275
 
276
#ifndef PRINT_CLASS_ID_P_P
277
#define PRINT_CLASS_ID_P_P( A, B, C, D ) PRINT_ptr_CLASS_ID_P ( ( A ), ( B ), ( C ), ( D ) )
278
#endif
279
 
280
#ifndef PRINT_ptr_ptr_cid
281
static void PRINT_ptr_ptr_cid PROTO_S ( ( FILE *, PTR ( PTR ( CLASS_ID ) ), char *, int ) ) ;
282
#endif
283
 
284
#ifndef PRINT_ptr_CLASS_ID_P
285
#define PRINT_ptr_CLASS_ID_P( A, B, C, D ) PRINT_ptr_ptr_cid ( ( A ), ( B ), ( C ), ( D ) )
286
#endif
287
 
288
#ifndef PRINT_CLASS_ID_P
289
#define PRINT_CLASS_ID_P( A, B, C, D ) PRINT_ptr_cid ( ( A ), ( B ), ( C ), ( D ) )
290
#endif
291
 
292
#ifndef PRINT_ptr_cid
293
static void PRINT_ptr_cid PROTO_S ( ( FILE *, PTR ( CLASS_ID ), char *, int ) ) ;
294
#endif
295
 
296
#ifndef PRINT_cid
297
static void PRINT_cid PROTO_S ( ( FILE *, CLASS_ID, char *, int ) ) ;
298
#endif
299
 
300
#ifndef PRINT_ARGUMENT_P
301
#define PRINT_ARGUMENT_P( A, B, C, D ) PRINT_ptr_arg ( ( A ), ( B ), ( C ), ( D ) )
302
#endif
303
 
304
#ifndef PRINT_ptr_arg
305
static void PRINT_ptr_arg PROTO_S ( ( FILE *, PTR ( ARGUMENT ), char *, int ) ) ;
306
#endif
307
 
308
#ifndef PRINT_arg
309
static void PRINT_arg PROTO_S ( ( FILE *, ARGUMENT, char *, int ) ) ;
310
#endif
311
 
312
#ifndef PRINT_string_P
313
#define PRINT_string_P( A, B, C, D ) PRINT_ptr_string ( ( A ), ( B ), ( C ), ( D ) )
314
#endif
315
 
316
#ifndef PRINT_ptr_string
317
static void PRINT_ptr_string PROTO_S ( ( FILE *, PTR ( string ), char *, int ) ) ;
318
#endif
319
 
320
#ifndef PRINT_number_P
321
#define PRINT_number_P( A, B, C, D ) PRINT_ptr_number ( ( A ), ( B ), ( C ), ( D ) )
322
#endif
323
 
324
#ifndef PRINT_ptr_number
325
static void PRINT_ptr_number PROTO_S ( ( FILE *, PTR ( number ), char *, int ) ) ;
326
#endif
327
 
328
#ifndef PRINT_int_P
329
#define PRINT_int_P( A, B, C, D ) PRINT_ptr_int ( ( A ), ( B ), ( C ), ( D ) )
330
#endif
331
 
332
#ifndef PRINT_ptr_int
333
static void PRINT_ptr_int PROTO_S ( ( FILE *, PTR ( int ), char *, int ) ) ;
334
#endif
335
 
336
#ifndef PRINT_zero_int
337
#define PRINT_zero_int( A, B, C, D ) PRINT_int ( ( A ), ( B ), ( C ), ( D ) )
338
#endif
339
 
340
#ifndef PRINT_name_string
341
#define PRINT_name_string( A, B, C, D ) PRINT_string ( ( A ), ( B ), ( C ), ( D ) )
342
#endif
343
 
344
#ifndef PRINT_string
345
static void PRINT_string PROTO_S ( ( FILE *, string, char *, int ) ) ;
346
#endif
347
 
348
#ifndef PRINT_number
349
static void PRINT_number PROTO_S ( ( FILE *, number, char *, int ) ) ;
350
#endif
351
 
352
#ifndef PRINT_int
353
static void PRINT_int PROTO_S ( ( FILE *, int, char *, int ) ) ;
354
#endif
355
 
356
 
357
 
358
/* Printing variables */
359
 
360
static int print_indent_step = 4 ;
361
static int print_ptr_depth = 1 ;
362
static int print_list_expand = 0 ;
363
 
364
 
365
/* Printing indentation routine */
366
 
367
static void print_indent
368
    PROTO_N ( ( f, d ) )
369
    PROTO_T ( FILE *f X int d )
370
{
371
    int i = print_indent_step * d ;
372
    while ( i-- ) ( void ) fputc ( ' ', f ) ;
373
    return ;
374
}
375
 
376
 
377
/* Printing routines for LIST ( COMMAND ) */
378
 
379
#ifndef PRINT_list_cmd
380
 
381
static void PRINT_list_cmd
382
    PROTO_N ( ( f_, x_, nm_, d_ ) )
383
    PROTO_T ( FILE *f_ X LIST ( COMMAND ) x_ X char *nm_ X int d_ )
384
{
385
    print_indent ( f_, d_ ) ;
386
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
387
    while ( !IS_NULL_list ( x_ ) ) {
388
	COMMAND z_ ;
389
	UN_CONS_cmd ( z_, x_, x_ ) ;
390
	PRINT_cmd ( f_, z_, "(cmd)", d_ + 1 ) ;
391
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
392
	    print_indent ( f_, d_ + 1 ) ;
393
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
394
	    break ;
395
	}
396
    }
397
    print_indent ( f_, d_ ) ;
398
    ( void ) fprintf ( f_, "}\n" ) ;
399
    return ;
400
}
401
 
402
#ifdef DEBUG
403
 
404
void DEBUG_list_cmd
405
    PROTO_N ( ( x_ ) )
406
    PROTO_T ( LIST ( COMMAND ) x_ )
407
{
408
    PRINT_list_cmd ( stdout, x_, "list_cmd", 0 ) ;
409
    return ;
410
}
411
 
412
#endif
413
 
414
#endif
415
 
416
 
417
/* Printing routines for COMMAND */
418
 
419
#ifndef PRINT_cmd
420
 
421
static void PRINT_cmd
422
    PROTO_N ( ( f_, x_, nm_, d_ ) )
423
    PROTO_T ( FILE *f_ X COMMAND x_ X char *nm_ X int d_ )
424
{
425
    print_indent ( f_, d_ ) ;
426
    if ( IS_NULL_cmd ( x_ ) ) {
427
	( void ) fprintf ( f_, "%s = NULL_cmd ;\n", nm_ ) ;
428
    } else {
429
	switch ( TAG_cmd ( x_ ) ) {
430
	    case cmd_simple_tag : {
431
		( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
432
		print_indent ( f_, d_ + 1 ) ;
433
		( void ) fprintf ( f_, "(tag) = simple ;\n" ) ;
434
		{
435
		    int z_ ;
436
		    z_ = DEREF_int ( cmd_line ( x_ ) ) ;
437
		    PRINT_int ( f_, z_, "line", d_ + 1 ) ;
438
		}
439
		{
440
		    string z_ ;
441
		    z_ = DEREF_string ( cmd_simple_text ( x_ ) ) ;
442
		    PRINT_string ( f_, z_, "text", d_ + 1 ) ;
443
		}
444
		print_indent ( f_, d_ ) ;
445
		( void ) fprintf ( f_, "}\n" ) ;
446
		break ;
447
	    }
448
	    case cmd_compound_tag : {
449
		( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
450
		print_indent ( f_, d_ + 1 ) ;
451
		( void ) fprintf ( f_, "(tag) = compound ;\n" ) ;
452
		{
453
		    int z_ ;
454
		    z_ = DEREF_int ( cmd_line ( x_ ) ) ;
455
		    PRINT_int ( f_, z_, "line", d_ + 1 ) ;
456
		}
457
		{
458
		    LIST ( COMMAND ) z_ ;
459
		    z_ = DEREF_list ( cmd_compound_seq ( x_ ) ) ;
460
		    PRINT_list_cmd ( f_, z_, "seq", d_ + 1 ) ;
461
		}
462
		print_indent ( f_, d_ ) ;
463
		( void ) fprintf ( f_, "}\n" ) ;
464
		break ;
465
	    }
466
	    case cmd_loop_tag : {
467
		( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
468
		print_indent ( f_, d_ + 1 ) ;
469
		( void ) fprintf ( f_, "(tag) = loop ;\n" ) ;
470
		{
471
		    int z_ ;
472
		    z_ = DEREF_int ( cmd_line ( x_ ) ) ;
473
		    PRINT_int ( f_, z_, "line", d_ + 1 ) ;
474
		}
475
		{
476
		    string z_ ;
477
		    z_ = DEREF_string ( cmd_loop_control ( x_ ) ) ;
478
		    PRINT_string ( f_, z_, "control", d_ + 1 ) ;
479
		}
480
		{
481
		    COMMAND z_ ;
482
		    z_ = DEREF_cmd ( cmd_loop_body ( x_ ) ) ;
483
		    PRINT_cmd ( f_, z_, "body", d_ + 1 ) ;
484
		}
485
		print_indent ( f_, d_ ) ;
486
		( void ) fprintf ( f_, "}\n" ) ;
487
		break ;
488
	    }
489
	    case cmd_cond_tag : {
490
		( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
491
		print_indent ( f_, d_ + 1 ) ;
492
		( void ) fprintf ( f_, "(tag) = cond ;\n" ) ;
493
		{
494
		    int z_ ;
495
		    z_ = DEREF_int ( cmd_line ( x_ ) ) ;
496
		    PRINT_int ( f_, z_, "line", d_ + 1 ) ;
497
		}
498
		{
499
		    string z_ ;
500
		    z_ = DEREF_string ( cmd_cond_control ( x_ ) ) ;
501
		    PRINT_string ( f_, z_, "control", d_ + 1 ) ;
502
		}
503
		{
504
		    COMMAND z_ ;
505
		    z_ = DEREF_cmd ( cmd_cond_true_code ( x_ ) ) ;
506
		    PRINT_cmd ( f_, z_, "true_code", d_ + 1 ) ;
507
		}
508
		{
509
		    COMMAND z_ ;
510
		    z_ = DEREF_cmd ( cmd_cond_false_code ( x_ ) ) ;
511
		    PRINT_cmd ( f_, z_, "false_code", d_ + 1 ) ;
512
		}
513
		print_indent ( f_, d_ ) ;
514
		( void ) fprintf ( f_, "}\n" ) ;
515
		break ;
516
	    }
517
	    default : {
518
		( void ) fprintf ( f_, "%s = ERROR!\n", nm_ ) ;
519
		break ;
520
	    }
521
	}
522
    }
523
    return ;
524
}
525
 
526
#ifdef DEBUG
527
 
528
void DEBUG_cmd
529
    PROTO_N ( ( x_ ) )
530
    PROTO_T ( COMMAND x_ )
531
{
532
    PRINT_cmd ( stdout, x_, "cmd", 0 ) ;
533
    return ;
534
}
535
 
536
#endif
537
 
538
#endif
539
 
540
 
541
/* Printing routines for LIST ( PTR ( MAP ) ) */
542
 
543
#ifndef PRINT_list_ptr_map
544
 
545
static void PRINT_list_ptr_map
546
    PROTO_N ( ( f_, x_, nm_, d_ ) )
547
    PROTO_T ( FILE *f_ X LIST ( PTR ( MAP ) ) x_ X char *nm_ X int d_ )
548
{
549
    print_indent ( f_, d_ ) ;
550
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
551
    while ( !IS_NULL_list ( x_ ) ) {
552
	PTR ( MAP ) z_ ;
553
	UN_CONS_ptr ( z_, x_, x_ ) ;
554
	PRINT_ptr_map ( f_, z_, "(ptr_map)", d_ + 1 ) ;
555
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
556
	    print_indent ( f_, d_ + 1 ) ;
557
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
558
	    break ;
559
	}
560
    }
561
    print_indent ( f_, d_ ) ;
562
    ( void ) fprintf ( f_, "}\n" ) ;
563
    return ;
564
}
565
 
566
#ifdef DEBUG
567
 
568
void DEBUG_list_ptr_map
569
    PROTO_N ( ( x_ ) )
570
    PROTO_T ( LIST ( PTR ( MAP ) ) x_ )
571
{
572
    PRINT_list_ptr_map ( stdout, x_, "list_ptr_map", 0 ) ;
573
    return ;
574
}
575
 
576
#endif
577
 
578
#endif
579
 
580
 
581
/* Printing routines for LIST ( PTR ( FIELD ) ) */
582
 
583
#ifndef PRINT_list_ptr_fld
584
 
585
static void PRINT_list_ptr_fld
586
    PROTO_N ( ( f_, x_, nm_, d_ ) )
587
    PROTO_T ( FILE *f_ X LIST ( PTR ( FIELD ) ) x_ X char *nm_ X int d_ )
588
{
589
    print_indent ( f_, d_ ) ;
590
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
591
    while ( !IS_NULL_list ( x_ ) ) {
592
	PTR ( FIELD ) z_ ;
593
	UN_CONS_ptr ( z_, x_, x_ ) ;
594
	PRINT_ptr_fld ( f_, z_, "(ptr_fld)", d_ + 1 ) ;
595
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
596
	    print_indent ( f_, d_ + 1 ) ;
597
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
598
	    break ;
599
	}
600
    }
601
    print_indent ( f_, d_ ) ;
602
    ( void ) fprintf ( f_, "}\n" ) ;
603
    return ;
604
}
605
 
606
#ifdef DEBUG
607
 
608
void DEBUG_list_ptr_fld
609
    PROTO_N ( ( x_ ) )
610
    PROTO_T ( LIST ( PTR ( FIELD ) ) x_ )
611
{
612
    PRINT_list_ptr_fld ( stdout, x_, "list_ptr_fld", 0 ) ;
613
    return ;
614
}
615
 
616
#endif
617
 
618
#endif
619
 
620
 
621
/* Printing routines for LIST ( PTR ( ARGUMENT ) ) */
622
 
623
#ifndef PRINT_list_ptr_arg
624
 
625
static void PRINT_list_ptr_arg
626
    PROTO_N ( ( f_, x_, nm_, d_ ) )
627
    PROTO_T ( FILE *f_ X LIST ( PTR ( ARGUMENT ) ) x_ X char *nm_ X int d_ )
628
{
629
    print_indent ( f_, d_ ) ;
630
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
631
    while ( !IS_NULL_list ( x_ ) ) {
632
	PTR ( ARGUMENT ) z_ ;
633
	UN_CONS_ptr ( z_, x_, x_ ) ;
634
	PRINT_ptr_arg ( f_, z_, "(ptr_arg)", d_ + 1 ) ;
635
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
636
	    print_indent ( f_, d_ + 1 ) ;
637
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
638
	    break ;
639
	}
640
    }
641
    print_indent ( f_, d_ ) ;
642
    ( void ) fprintf ( f_, "}\n" ) ;
643
    return ;
644
}
645
 
646
#ifdef DEBUG
647
 
648
void DEBUG_list_ptr_arg
649
    PROTO_N ( ( x_ ) )
650
    PROTO_T ( LIST ( PTR ( ARGUMENT ) ) x_ )
651
{
652
    PRINT_list_ptr_arg ( stdout, x_, "list_ptr_arg", 0 ) ;
653
    return ;
654
}
655
 
656
#endif
657
 
658
#endif
659
 
660
 
661
/* Printing routines for LIST ( PTR ( COMPONENT ) ) */
662
 
663
#ifndef PRINT_list_ptr_cmp
664
 
665
static void PRINT_list_ptr_cmp
666
    PROTO_N ( ( f_, x_, nm_, d_ ) )
667
    PROTO_T ( FILE *f_ X LIST ( PTR ( COMPONENT ) ) x_ X char *nm_ X int d_ )
668
{
669
    print_indent ( f_, d_ ) ;
670
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
671
    while ( !IS_NULL_list ( x_ ) ) {
672
	PTR ( COMPONENT ) z_ ;
673
	UN_CONS_ptr ( z_, x_, x_ ) ;
674
	PRINT_ptr_cmp ( f_, z_, "(ptr_cmp)", d_ + 1 ) ;
675
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
676
	    print_indent ( f_, d_ + 1 ) ;
677
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
678
	    break ;
679
	}
680
    }
681
    print_indent ( f_, d_ ) ;
682
    ( void ) fprintf ( f_, "}\n" ) ;
683
    return ;
684
}
685
 
686
#ifdef DEBUG
687
 
688
void DEBUG_list_ptr_cmp
689
    PROTO_N ( ( x_ ) )
690
    PROTO_T ( LIST ( PTR ( COMPONENT ) ) x_ )
691
{
692
    PRINT_list_ptr_cmp ( stdout, x_, "list_ptr_cmp", 0 ) ;
693
    return ;
694
}
695
 
696
#endif
697
 
698
#endif
699
 
700
 
701
/* Printing routines for LIST ( PTR ( ECONST ) ) */
702
 
703
#ifndef PRINT_list_ptr_ec
704
 
705
static void PRINT_list_ptr_ec
706
    PROTO_N ( ( f_, x_, nm_, d_ ) )
707
    PROTO_T ( FILE *f_ X LIST ( PTR ( ECONST ) ) x_ X char *nm_ X int d_ )
708
{
709
    print_indent ( f_, d_ ) ;
710
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
711
    while ( !IS_NULL_list ( x_ ) ) {
712
	PTR ( ECONST ) z_ ;
713
	UN_CONS_ptr ( z_, x_, x_ ) ;
714
	PRINT_ptr_ec ( f_, z_, "(ptr_ec)", d_ + 1 ) ;
715
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
716
	    print_indent ( f_, d_ + 1 ) ;
717
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
718
	    break ;
719
	}
720
    }
721
    print_indent ( f_, d_ ) ;
722
    ( void ) fprintf ( f_, "}\n" ) ;
723
    return ;
724
}
725
 
726
#ifdef DEBUG
727
 
728
void DEBUG_list_ptr_ec
729
    PROTO_N ( ( x_ ) )
730
    PROTO_T ( LIST ( PTR ( ECONST ) ) x_ )
731
{
732
    PRINT_list_ptr_ec ( stdout, x_, "list_ptr_ec", 0 ) ;
733
    return ;
734
}
735
 
736
#endif
737
 
738
#endif
739
 
740
 
741
/* Printing routines for ALGEBRA_DEFN */
742
 
743
#ifndef PRINT_alg
744
 
745
static void PRINT_alg
746
    PROTO_N ( ( f_, x_, nm_, d_ ) )
747
    PROTO_T ( FILE *f_ X ALGEBRA_DEFN x_ X char *nm_ X int d_ )
748
{
749
    print_indent ( f_, d_ ) ;
750
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
751
    PRINT_string ( f_, x_.name, "name", d_ + 1 ) ;
752
    PRINT_int ( f_, x_.major_no, "major_no", d_ + 1 ) ;
753
    PRINT_int ( f_, x_.minor_no, "minor_no", d_ + 1 ) ;
754
    PRINT_list_PRIMITIVE_P ( f_, x_.primitives, "primitives", d_ + 1 ) ;
755
    PRINT_list_IDENTITY_P ( f_, x_.identities, "identities", d_ + 1 ) ;
756
    PRINT_list_ENUM_P ( f_, x_.enumerations, "enumerations", d_ + 1 ) ;
757
    PRINT_list_STRUCTURE_P ( f_, x_.structures, "structures", d_ + 1 ) ;
758
    PRINT_list_UNION_P ( f_, x_.unions, "unions", d_ + 1 ) ;
759
    PRINT_list_TYPE_P ( f_, x_.types, "types", d_ + 1 ) ;
760
    print_indent ( f_, d_ ) ;
761
    ( void ) fprintf ( f_, "}\n" ) ;
762
    return ;
763
}
764
 
765
#ifdef DEBUG
766
 
767
void DEBUG_alg
768
    PROTO_N ( ( x_ ) )
769
    PROTO_T ( ALGEBRA_DEFN *x_ )
770
{
771
    if ( x_ ) PRINT_alg ( stdout, *x_, "alg", 0 ) ;
772
    return ;
773
}
774
 
775
#endif
776
 
777
#endif
778
 
779
 
780
/* Printing routines for LIST ( PTR ( TYPE ) ) */
781
 
782
#ifndef PRINT_list_ptr_type
783
 
784
static void PRINT_list_ptr_type
785
    PROTO_N ( ( f_, x_, nm_, d_ ) )
786
    PROTO_T ( FILE *f_ X LIST ( PTR ( TYPE ) ) x_ X char *nm_ X int d_ )
787
{
788
    print_indent ( f_, d_ ) ;
789
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
790
    while ( !IS_NULL_list ( x_ ) ) {
791
	PTR ( TYPE ) z_ ;
792
	UN_CONS_ptr ( z_, x_, x_ ) ;
793
	PRINT_ptr_type ( f_, z_, "(ptr_type)", d_ + 1 ) ;
794
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
795
	    print_indent ( f_, d_ + 1 ) ;
796
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
797
	    break ;
798
	}
799
    }
800
    print_indent ( f_, d_ ) ;
801
    ( void ) fprintf ( f_, "}\n" ) ;
802
    return ;
803
}
804
 
805
#ifdef DEBUG
806
 
807
void DEBUG_list_ptr_type
808
    PROTO_N ( ( x_ ) )
809
    PROTO_T ( LIST ( PTR ( TYPE ) ) x_ )
810
{
811
    PRINT_list_ptr_type ( stdout, x_, "list_ptr_type", 0 ) ;
812
    return ;
813
}
814
 
815
#endif
816
 
817
#endif
818
 
819
 
820
/* Printing routines for LIST ( PTR ( UNION ) ) */
821
 
822
#ifndef PRINT_list_ptr_un
823
 
824
static void PRINT_list_ptr_un
825
    PROTO_N ( ( f_, x_, nm_, d_ ) )
826
    PROTO_T ( FILE *f_ X LIST ( PTR ( UNION ) ) x_ X char *nm_ X int d_ )
827
{
828
    print_indent ( f_, d_ ) ;
829
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
830
    while ( !IS_NULL_list ( x_ ) ) {
831
	PTR ( UNION ) z_ ;
832
	UN_CONS_ptr ( z_, x_, x_ ) ;
833
	PRINT_ptr_un ( f_, z_, "(ptr_un)", d_ + 1 ) ;
834
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
835
	    print_indent ( f_, d_ + 1 ) ;
836
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
837
	    break ;
838
	}
839
    }
840
    print_indent ( f_, d_ ) ;
841
    ( void ) fprintf ( f_, "}\n" ) ;
842
    return ;
843
}
844
 
845
#ifdef DEBUG
846
 
847
void DEBUG_list_ptr_un
848
    PROTO_N ( ( x_ ) )
849
    PROTO_T ( LIST ( PTR ( UNION ) ) x_ )
850
{
851
    PRINT_list_ptr_un ( stdout, x_, "list_ptr_un", 0 ) ;
852
    return ;
853
}
854
 
855
#endif
856
 
857
#endif
858
 
859
 
860
/* Printing routines for LIST ( PTR ( STRUCTURE ) ) */
861
 
862
#ifndef PRINT_list_ptr_str
863
 
864
static void PRINT_list_ptr_str
865
    PROTO_N ( ( f_, x_, nm_, d_ ) )
866
    PROTO_T ( FILE *f_ X LIST ( PTR ( STRUCTURE ) ) x_ X char *nm_ X int d_ )
867
{
868
    print_indent ( f_, d_ ) ;
869
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
870
    while ( !IS_NULL_list ( x_ ) ) {
871
	PTR ( STRUCTURE ) z_ ;
872
	UN_CONS_ptr ( z_, x_, x_ ) ;
873
	PRINT_ptr_str ( f_, z_, "(ptr_str)", d_ + 1 ) ;
874
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
875
	    print_indent ( f_, d_ + 1 ) ;
876
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
877
	    break ;
878
	}
879
    }
880
    print_indent ( f_, d_ ) ;
881
    ( void ) fprintf ( f_, "}\n" ) ;
882
    return ;
883
}
884
 
885
#ifdef DEBUG
886
 
887
void DEBUG_list_ptr_str
888
    PROTO_N ( ( x_ ) )
889
    PROTO_T ( LIST ( PTR ( STRUCTURE ) ) x_ )
890
{
891
    PRINT_list_ptr_str ( stdout, x_, "list_ptr_str", 0 ) ;
892
    return ;
893
}
894
 
895
#endif
896
 
897
#endif
898
 
899
 
900
/* Printing routines for LIST ( PTR ( ENUM ) ) */
901
 
902
#ifndef PRINT_list_ptr_en
903
 
904
static void PRINT_list_ptr_en
905
    PROTO_N ( ( f_, x_, nm_, d_ ) )
906
    PROTO_T ( FILE *f_ X LIST ( PTR ( ENUM ) ) x_ X char *nm_ X int d_ )
907
{
908
    print_indent ( f_, d_ ) ;
909
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
910
    while ( !IS_NULL_list ( x_ ) ) {
911
	PTR ( ENUM ) z_ ;
912
	UN_CONS_ptr ( z_, x_, x_ ) ;
913
	PRINT_ptr_en ( f_, z_, "(ptr_en)", d_ + 1 ) ;
914
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
915
	    print_indent ( f_, d_ + 1 ) ;
916
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
917
	    break ;
918
	}
919
    }
920
    print_indent ( f_, d_ ) ;
921
    ( void ) fprintf ( f_, "}\n" ) ;
922
    return ;
923
}
924
 
925
#ifdef DEBUG
926
 
927
void DEBUG_list_ptr_en
928
    PROTO_N ( ( x_ ) )
929
    PROTO_T ( LIST ( PTR ( ENUM ) ) x_ )
930
{
931
    PRINT_list_ptr_en ( stdout, x_, "list_ptr_en", 0 ) ;
932
    return ;
933
}
934
 
935
#endif
936
 
937
#endif
938
 
939
 
940
/* Printing routines for LIST ( PTR ( IDENTITY ) ) */
941
 
942
#ifndef PRINT_list_ptr_ident
943
 
944
static void PRINT_list_ptr_ident
945
    PROTO_N ( ( f_, x_, nm_, d_ ) )
946
    PROTO_T ( FILE *f_ X LIST ( PTR ( IDENTITY ) ) x_ X char *nm_ X int d_ )
947
{
948
    print_indent ( f_, d_ ) ;
949
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
950
    while ( !IS_NULL_list ( x_ ) ) {
951
	PTR ( IDENTITY ) z_ ;
952
	UN_CONS_ptr ( z_, x_, x_ ) ;
953
	PRINT_ptr_ident ( f_, z_, "(ptr_ident)", d_ + 1 ) ;
954
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
955
	    print_indent ( f_, d_ + 1 ) ;
956
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
957
	    break ;
958
	}
959
    }
960
    print_indent ( f_, d_ ) ;
961
    ( void ) fprintf ( f_, "}\n" ) ;
962
    return ;
963
}
964
 
965
#ifdef DEBUG
966
 
967
void DEBUG_list_ptr_ident
968
    PROTO_N ( ( x_ ) )
969
    PROTO_T ( LIST ( PTR ( IDENTITY ) ) x_ )
970
{
971
    PRINT_list_ptr_ident ( stdout, x_, "list_ptr_ident", 0 ) ;
972
    return ;
973
}
974
 
975
#endif
976
 
977
#endif
978
 
979
 
980
/* Printing routines for LIST ( PTR ( PRIMITIVE ) ) */
981
 
982
#ifndef PRINT_list_ptr_prim
983
 
984
static void PRINT_list_ptr_prim
985
    PROTO_N ( ( f_, x_, nm_, d_ ) )
986
    PROTO_T ( FILE *f_ X LIST ( PTR ( PRIMITIVE ) ) x_ X char *nm_ X int d_ )
987
{
988
    print_indent ( f_, d_ ) ;
989
    ( void ) fprintf ( f_, "%s = LIST {\n", nm_ ) ;
990
    while ( !IS_NULL_list ( x_ ) ) {
991
	PTR ( PRIMITIVE ) z_ ;
992
	UN_CONS_ptr ( z_, x_, x_ ) ;
993
	PRINT_ptr_prim ( f_, z_, "(ptr_prim)", d_ + 1 ) ;
994
	if ( !print_list_expand && !IS_NULL_list ( x_ ) ) {
995
	    print_indent ( f_, d_ + 1 ) ;
996
	    ( void ) fprintf ( f_, "(tail) = 0x%p ;\n", VOIDSTAR_list ( x_ ) ) ;
997
	    break ;
998
	}
999
    }
1000
    print_indent ( f_, d_ ) ;
1001
    ( void ) fprintf ( f_, "}\n" ) ;
1002
    return ;
1003
}
1004
 
1005
#ifdef DEBUG
1006
 
1007
void DEBUG_list_ptr_prim
1008
    PROTO_N ( ( x_ ) )
1009
    PROTO_T ( LIST ( PTR ( PRIMITIVE ) ) x_ )
1010
{
1011
    PRINT_list_ptr_prim ( stdout, x_, "list_ptr_prim", 0 ) ;
1012
    return ;
1013
}
1014
 
1015
#endif
1016
 
1017
#endif
1018
 
1019
 
1020
/* Printing routines for PTR ( UNION ) */
1021
 
1022
#ifndef PRINT_ptr_un
1023
 
1024
static void PRINT_ptr_un
1025
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1026
    PROTO_T ( FILE *f_ X PTR ( UNION ) x_ X char *nm_ X int d_ )
1027
{
1028
    print_indent ( f_, d_ ) ;
1029
    if ( IS_NULL_ptr ( x_ ) ) {
1030
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
1031
    } else if ( d_ < print_ptr_depth ) {
1032
	UNION z_ ;
1033
	DEREF_un ( x_, z_ ) ;
1034
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
1035
	PRINT_un ( f_, z_, "(un)", d_ + 1 ) ;
1036
	print_indent ( f_, d_ ) ;
1037
	( void ) fprintf ( f_, "}\n" ) ;
1038
    } else {
1039
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
1040
    }
1041
    return ;
1042
}
1043
 
1044
#ifdef DEBUG
1045
 
1046
void DEBUG_ptr_un
1047
    PROTO_N ( ( x_ ) )
1048
    PROTO_T ( PTR ( UNION ) x_ )
1049
{
1050
    PRINT_ptr_un ( stdout, x_, "ptr_un", 0 ) ;
1051
    return ;
1052
}
1053
 
1054
#endif
1055
 
1056
#endif
1057
 
1058
 
1059
/* Printing routines for UNION */
1060
 
1061
#ifndef PRINT_un
1062
 
1063
static void PRINT_un
1064
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1065
    PROTO_T ( FILE *f_ X UNION x_ X char *nm_ X int d_ )
1066
{
1067
    print_indent ( f_, d_ ) ;
1068
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
1069
    PRINT_CLASS_ID_P ( f_, x_.id, "id", d_ + 1 ) ;
1070
    PRINT_UNION_P ( f_, x_.base, "base", d_ + 1 ) ;
1071
    PRINT_list_COMPONENT_P ( f_, x_.s_defn, "s_defn", d_ + 1 ) ;
1072
    PRINT_list_FIELD_P ( f_, x_.u_defn, "u_defn", d_ + 1 ) ;
1073
    PRINT_list_MAP_P ( f_, x_.map, "map", d_ + 1 ) ;
1074
    PRINT_int ( f_, x_.no_fields, "no_fields", d_ + 1 ) ;
1075
    print_indent ( f_, d_ ) ;
1076
    ( void ) fprintf ( f_, "}\n" ) ;
1077
    return ;
1078
}
1079
 
1080
#ifdef DEBUG
1081
 
1082
void DEBUG_un
1083
    PROTO_N ( ( x_ ) )
1084
    PROTO_T ( UNION *x_ )
1085
{
1086
    if ( x_ ) PRINT_un ( stdout, *x_, "un", 0 ) ;
1087
    return ;
1088
}
1089
 
1090
#endif
1091
 
1092
#endif
1093
 
1094
 
1095
/* Printing routines for PTR ( PTR ( TYPE ) ) */
1096
 
1097
#ifndef PRINT_ptr_ptr_type
1098
 
1099
static void PRINT_ptr_ptr_type
1100
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1101
    PROTO_T ( FILE *f_ X PTR ( PTR ( TYPE ) ) x_ X char *nm_ X int d_ )
1102
{
1103
    print_indent ( f_, d_ ) ;
1104
    if ( IS_NULL_ptr ( x_ ) ) {
1105
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
1106
    } else if ( d_ < print_ptr_depth ) {
1107
	PTR ( TYPE ) z_ ;
1108
	z_ = DEREF_ptr ( x_ ) ;
1109
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
1110
	PRINT_ptr_type ( f_, z_, "(ptr_type)", d_ + 1 ) ;
1111
	print_indent ( f_, d_ ) ;
1112
	( void ) fprintf ( f_, "}\n" ) ;
1113
    } else {
1114
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
1115
    }
1116
    return ;
1117
}
1118
 
1119
#ifdef DEBUG
1120
 
1121
void DEBUG_ptr_ptr_type
1122
    PROTO_N ( ( x_ ) )
1123
    PROTO_T ( PTR ( PTR ( TYPE ) ) x_ )
1124
{
1125
    PRINT_ptr_ptr_type ( stdout, x_, "ptr_ptr_type", 0 ) ;
1126
    return ;
1127
}
1128
 
1129
#endif
1130
 
1131
#endif
1132
 
1133
 
1134
/* Printing routines for PTR ( TYPE ) */
1135
 
1136
#ifndef PRINT_ptr_type
1137
 
1138
static void PRINT_ptr_type
1139
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1140
    PROTO_T ( FILE *f_ X PTR ( TYPE ) x_ X char *nm_ X int d_ )
1141
{
1142
    print_indent ( f_, d_ ) ;
1143
    if ( IS_NULL_ptr ( x_ ) ) {
1144
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
1145
    } else if ( d_ < print_ptr_depth ) {
1146
	TYPE z_ ;
1147
	z_ = DEREF_type ( x_ ) ;
1148
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
1149
	PRINT_type ( f_, z_, "(type)", d_ + 1 ) ;
1150
	print_indent ( f_, d_ ) ;
1151
	( void ) fprintf ( f_, "}\n" ) ;
1152
    } else {
1153
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
1154
    }
1155
    return ;
1156
}
1157
 
1158
#ifdef DEBUG
1159
 
1160
void DEBUG_ptr_type
1161
    PROTO_N ( ( x_ ) )
1162
    PROTO_T ( PTR ( TYPE ) x_ )
1163
{
1164
    PRINT_ptr_type ( stdout, x_, "ptr_type", 0 ) ;
1165
    return ;
1166
}
1167
 
1168
#endif
1169
 
1170
#endif
1171
 
1172
 
1173
/* Printing routines for TYPE */
1174
 
1175
#ifndef PRINT_type
1176
 
1177
static void PRINT_type
1178
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1179
    PROTO_T ( FILE *f_ X TYPE x_ X char *nm_ X int d_ )
1180
{
1181
    print_indent ( f_, d_ ) ;
1182
    if ( IS_NULL_type ( x_ ) ) {
1183
	( void ) fprintf ( f_, "%s = NULL_type ;\n", nm_ ) ;
1184
    } else {
1185
	switch ( TAG_type ( x_ ) ) {
1186
	    case type_primitive_tag : {
1187
		unsigned alias_ = GET_ALIAS_type_primitive ( x_ ) ;
1188
		if ( alias_ ) {
1189
		    ( void ) fprintf ( f_, "%s = [%u] ;\n", nm_, alias_ ) ;
1190
		    break ;
1191
		}
1192
		alias_ = ++crt_calculus_alias ;
1193
		SET_ALIAS_type_primitive ( x_, alias_ ) ;
1194
		( void ) fprintf ( f_, "%s = [%u] = {\n", nm_, alias_ ) ;
1195
		print_indent ( f_, d_ + 1 ) ;
1196
		( void ) fprintf ( f_, "(tag) = primitive ;\n" ) ;
1197
		{
1198
		    zero_int z_ ;
1199
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1200
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1201
		}
1202
		{
1203
		    PRIMITIVE_P z_ ;
1204
		    z_ = DEREF_ptr ( type_primitive_prim ( x_ ) ) ;
1205
		    PRINT_PRIMITIVE_P ( f_, z_, "prim", d_ + 1 ) ;
1206
		}
1207
		print_indent ( f_, d_ ) ;
1208
		( void ) fprintf ( f_, "}\n" ) ;
1209
		break ;
1210
	    }
1211
	    case type_ident_tag : {
1212
		unsigned alias_ = GET_ALIAS_type_ident ( x_ ) ;
1213
		if ( alias_ ) {
1214
		    ( void ) fprintf ( f_, "%s = [%u] ;\n", nm_, alias_ ) ;
1215
		    break ;
1216
		}
1217
		alias_ = ++crt_calculus_alias ;
1218
		SET_ALIAS_type_ident ( x_, alias_ ) ;
1219
		( void ) fprintf ( f_, "%s = [%u] = {\n", nm_, alias_ ) ;
1220
		print_indent ( f_, d_ + 1 ) ;
1221
		( void ) fprintf ( f_, "(tag) = ident ;\n" ) ;
1222
		{
1223
		    zero_int z_ ;
1224
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1225
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1226
		}
1227
		{
1228
		    IDENTITY_P z_ ;
1229
		    z_ = DEREF_ptr ( type_ident_id ( x_ ) ) ;
1230
		    PRINT_IDENTITY_P ( f_, z_, "id", d_ + 1 ) ;
1231
		}
1232
		print_indent ( f_, d_ ) ;
1233
		( void ) fprintf ( f_, "}\n" ) ;
1234
		break ;
1235
	    }
1236
	    case type_enumeration_tag : {
1237
		unsigned alias_ = GET_ALIAS_type_enumeration ( x_ ) ;
1238
		if ( alias_ ) {
1239
		    ( void ) fprintf ( f_, "%s = [%u] ;\n", nm_, alias_ ) ;
1240
		    break ;
1241
		}
1242
		alias_ = ++crt_calculus_alias ;
1243
		SET_ALIAS_type_enumeration ( x_, alias_ ) ;
1244
		( void ) fprintf ( f_, "%s = [%u] = {\n", nm_, alias_ ) ;
1245
		print_indent ( f_, d_ + 1 ) ;
1246
		( void ) fprintf ( f_, "(tag) = enumeration ;\n" ) ;
1247
		{
1248
		    zero_int z_ ;
1249
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1250
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1251
		}
1252
		{
1253
		    ENUM_P z_ ;
1254
		    z_ = DEREF_ptr ( type_enumeration_en ( x_ ) ) ;
1255
		    PRINT_ENUM_P ( f_, z_, "en", d_ + 1 ) ;
1256
		}
1257
		print_indent ( f_, d_ ) ;
1258
		( void ) fprintf ( f_, "}\n" ) ;
1259
		break ;
1260
	    }
1261
	    case type_structure_tag : {
1262
		unsigned alias_ = GET_ALIAS_type_structure ( x_ ) ;
1263
		if ( alias_ ) {
1264
		    ( void ) fprintf ( f_, "%s = [%u] ;\n", nm_, alias_ ) ;
1265
		    break ;
1266
		}
1267
		alias_ = ++crt_calculus_alias ;
1268
		SET_ALIAS_type_structure ( x_, alias_ ) ;
1269
		( void ) fprintf ( f_, "%s = [%u] = {\n", nm_, alias_ ) ;
1270
		print_indent ( f_, d_ + 1 ) ;
1271
		( void ) fprintf ( f_, "(tag) = structure ;\n" ) ;
1272
		{
1273
		    zero_int z_ ;
1274
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1275
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1276
		}
1277
		{
1278
		    STRUCTURE_P z_ ;
1279
		    z_ = DEREF_ptr ( type_structure_struc ( x_ ) ) ;
1280
		    PRINT_STRUCTURE_P ( f_, z_, "struc", d_ + 1 ) ;
1281
		}
1282
		print_indent ( f_, d_ ) ;
1283
		( void ) fprintf ( f_, "}\n" ) ;
1284
		break ;
1285
	    }
1286
	    case type_onion_tag : {
1287
		unsigned alias_ = GET_ALIAS_type_onion ( x_ ) ;
1288
		if ( alias_ ) {
1289
		    ( void ) fprintf ( f_, "%s = [%u] ;\n", nm_, alias_ ) ;
1290
		    break ;
1291
		}
1292
		alias_ = ++crt_calculus_alias ;
1293
		SET_ALIAS_type_onion ( x_, alias_ ) ;
1294
		( void ) fprintf ( f_, "%s = [%u] = {\n", nm_, alias_ ) ;
1295
		print_indent ( f_, d_ + 1 ) ;
1296
		( void ) fprintf ( f_, "(tag) = onion ;\n" ) ;
1297
		{
1298
		    zero_int z_ ;
1299
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1300
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1301
		}
1302
		{
1303
		    UNION_P z_ ;
1304
		    z_ = DEREF_ptr ( type_onion_un ( x_ ) ) ;
1305
		    PRINT_UNION_P ( f_, z_, "un", d_ + 1 ) ;
1306
		}
1307
		print_indent ( f_, d_ ) ;
1308
		( void ) fprintf ( f_, "}\n" ) ;
1309
		break ;
1310
	    }
1311
	    case type_ptr_tag : {
1312
		unsigned alias_ = GET_ALIAS_type_ptr ( x_ ) ;
1313
		if ( alias_ ) {
1314
		    ( void ) fprintf ( f_, "%s = [%u] ;\n", nm_, alias_ ) ;
1315
		    break ;
1316
		}
1317
		alias_ = ++crt_calculus_alias ;
1318
		SET_ALIAS_type_ptr ( x_, alias_ ) ;
1319
		( void ) fprintf ( f_, "%s = [%u] = {\n", nm_, alias_ ) ;
1320
		print_indent ( f_, d_ + 1 ) ;
1321
		( void ) fprintf ( f_, "(tag) = ptr ;\n" ) ;
1322
		{
1323
		    zero_int z_ ;
1324
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1325
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1326
		}
1327
		{
1328
		    TYPE_P z_ ;
1329
		    z_ = DEREF_ptr ( type_ptr_sub ( x_ ) ) ;
1330
		    PRINT_TYPE_P ( f_, z_, "sub", d_ + 1 ) ;
1331
		}
1332
		print_indent ( f_, d_ ) ;
1333
		( void ) fprintf ( f_, "}\n" ) ;
1334
		break ;
1335
	    }
1336
	    case type_list_tag : {
1337
		unsigned alias_ = GET_ALIAS_type_list ( x_ ) ;
1338
		if ( alias_ ) {
1339
		    ( void ) fprintf ( f_, "%s = [%u] ;\n", nm_, alias_ ) ;
1340
		    break ;
1341
		}
1342
		alias_ = ++crt_calculus_alias ;
1343
		SET_ALIAS_type_list ( x_, alias_ ) ;
1344
		( void ) fprintf ( f_, "%s = [%u] = {\n", nm_, alias_ ) ;
1345
		print_indent ( f_, d_ + 1 ) ;
1346
		( void ) fprintf ( f_, "(tag) = list ;\n" ) ;
1347
		{
1348
		    zero_int z_ ;
1349
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1350
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1351
		}
1352
		{
1353
		    TYPE_P z_ ;
1354
		    z_ = DEREF_ptr ( type_list_sub ( x_ ) ) ;
1355
		    PRINT_TYPE_P ( f_, z_, "sub", d_ + 1 ) ;
1356
		}
1357
		print_indent ( f_, d_ ) ;
1358
		( void ) fprintf ( f_, "}\n" ) ;
1359
		break ;
1360
	    }
1361
	    case type_stack_tag : {
1362
		unsigned alias_ = GET_ALIAS_type_stack ( x_ ) ;
1363
		if ( alias_ ) {
1364
		    ( void ) fprintf ( f_, "%s = [%u] ;\n", nm_, alias_ ) ;
1365
		    break ;
1366
		}
1367
		alias_ = ++crt_calculus_alias ;
1368
		SET_ALIAS_type_stack ( x_, alias_ ) ;
1369
		( void ) fprintf ( f_, "%s = [%u] = {\n", nm_, alias_ ) ;
1370
		print_indent ( f_, d_ + 1 ) ;
1371
		( void ) fprintf ( f_, "(tag) = stack ;\n" ) ;
1372
		{
1373
		    zero_int z_ ;
1374
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1375
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1376
		}
1377
		{
1378
		    TYPE_P z_ ;
1379
		    z_ = DEREF_ptr ( type_stack_sub ( x_ ) ) ;
1380
		    PRINT_TYPE_P ( f_, z_, "sub", d_ + 1 ) ;
1381
		}
1382
		print_indent ( f_, d_ ) ;
1383
		( void ) fprintf ( f_, "}\n" ) ;
1384
		break ;
1385
	    }
1386
	    case type_vec_tag : {
1387
		unsigned alias_ = GET_ALIAS_type_vec ( x_ ) ;
1388
		if ( alias_ ) {
1389
		    ( void ) fprintf ( f_, "%s = [%u] ;\n", nm_, alias_ ) ;
1390
		    break ;
1391
		}
1392
		alias_ = ++crt_calculus_alias ;
1393
		SET_ALIAS_type_vec ( x_, alias_ ) ;
1394
		( void ) fprintf ( f_, "%s = [%u] = {\n", nm_, alias_ ) ;
1395
		print_indent ( f_, d_ + 1 ) ;
1396
		( void ) fprintf ( f_, "(tag) = vec ;\n" ) ;
1397
		{
1398
		    zero_int z_ ;
1399
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1400
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1401
		}
1402
		{
1403
		    TYPE_P z_ ;
1404
		    z_ = DEREF_ptr ( type_vec_sub ( x_ ) ) ;
1405
		    PRINT_TYPE_P ( f_, z_, "sub", d_ + 1 ) ;
1406
		}
1407
		print_indent ( f_, d_ ) ;
1408
		( void ) fprintf ( f_, "}\n" ) ;
1409
		break ;
1410
	    }
1411
	    case type_vec_ptr_tag : {
1412
		unsigned alias_ = GET_ALIAS_type_vec_ptr ( x_ ) ;
1413
		if ( alias_ ) {
1414
		    ( void ) fprintf ( f_, "%s = [%u] ;\n", nm_, alias_ ) ;
1415
		    break ;
1416
		}
1417
		alias_ = ++crt_calculus_alias ;
1418
		SET_ALIAS_type_vec_ptr ( x_, alias_ ) ;
1419
		( void ) fprintf ( f_, "%s = [%u] = {\n", nm_, alias_ ) ;
1420
		print_indent ( f_, d_ + 1 ) ;
1421
		( void ) fprintf ( f_, "(tag) = vec_ptr ;\n" ) ;
1422
		{
1423
		    zero_int z_ ;
1424
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1425
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1426
		}
1427
		{
1428
		    TYPE_P z_ ;
1429
		    z_ = DEREF_ptr ( type_vec_ptr_sub ( x_ ) ) ;
1430
		    PRINT_TYPE_P ( f_, z_, "sub", d_ + 1 ) ;
1431
		}
1432
		print_indent ( f_, d_ ) ;
1433
		( void ) fprintf ( f_, "}\n" ) ;
1434
		break ;
1435
	    }
1436
	    case type_quote_tag : {
1437
		( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
1438
		print_indent ( f_, d_ + 1 ) ;
1439
		( void ) fprintf ( f_, "(tag) = quote ;\n" ) ;
1440
		{
1441
		    zero_int z_ ;
1442
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1443
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1444
		}
1445
		{
1446
		    string z_ ;
1447
		    z_ = DEREF_string ( type_quote_defn ( x_ ) ) ;
1448
		    PRINT_string ( f_, z_, "defn", d_ + 1 ) ;
1449
		}
1450
		print_indent ( f_, d_ ) ;
1451
		( void ) fprintf ( f_, "}\n" ) ;
1452
		break ;
1453
	    }
1454
	    case type_undef_tag : {
1455
		( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
1456
		print_indent ( f_, d_ + 1 ) ;
1457
		( void ) fprintf ( f_, "(tag) = undef ;\n" ) ;
1458
		{
1459
		    zero_int z_ ;
1460
		    z_ = DEREF_int ( type_size ( x_ ) ) ;
1461
		    PRINT_zero_int ( f_, z_, "size", d_ + 1 ) ;
1462
		}
1463
		{
1464
		    string z_ ;
1465
		    z_ = DEREF_string ( type_undef_name ( x_ ) ) ;
1466
		    PRINT_string ( f_, z_, "name", d_ + 1 ) ;
1467
		}
1468
		print_indent ( f_, d_ ) ;
1469
		( void ) fprintf ( f_, "}\n" ) ;
1470
		break ;
1471
	    }
1472
	    default : {
1473
		( void ) fprintf ( f_, "%s = ERROR!\n", nm_ ) ;
1474
		break ;
1475
	    }
1476
	}
1477
    }
1478
    return ;
1479
}
1480
 
1481
#ifdef DEBUG
1482
 
1483
void DEBUG_type
1484
    PROTO_N ( ( x_ ) )
1485
    PROTO_T ( TYPE x_ )
1486
{
1487
    PRINT_type ( stdout, x_, "type", 0 ) ;
1488
    return ;
1489
}
1490
 
1491
#endif
1492
 
1493
#endif
1494
 
1495
 
1496
/* Printing routines for PTR ( STRUCTURE ) */
1497
 
1498
#ifndef PRINT_ptr_str
1499
 
1500
static void PRINT_ptr_str
1501
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1502
    PROTO_T ( FILE *f_ X PTR ( STRUCTURE ) x_ X char *nm_ X int d_ )
1503
{
1504
    print_indent ( f_, d_ ) ;
1505
    if ( IS_NULL_ptr ( x_ ) ) {
1506
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
1507
    } else if ( d_ < print_ptr_depth ) {
1508
	STRUCTURE z_ ;
1509
	DEREF_str ( x_, z_ ) ;
1510
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
1511
	PRINT_str ( f_, z_, "(str)", d_ + 1 ) ;
1512
	print_indent ( f_, d_ ) ;
1513
	( void ) fprintf ( f_, "}\n" ) ;
1514
    } else {
1515
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
1516
    }
1517
    return ;
1518
}
1519
 
1520
#ifdef DEBUG
1521
 
1522
void DEBUG_ptr_str
1523
    PROTO_N ( ( x_ ) )
1524
    PROTO_T ( PTR ( STRUCTURE ) x_ )
1525
{
1526
    PRINT_ptr_str ( stdout, x_, "ptr_str", 0 ) ;
1527
    return ;
1528
}
1529
 
1530
#endif
1531
 
1532
#endif
1533
 
1534
 
1535
/* Printing routines for STRUCTURE */
1536
 
1537
#ifndef PRINT_str
1538
 
1539
static void PRINT_str
1540
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1541
    PROTO_T ( FILE *f_ X STRUCTURE x_ X char *nm_ X int d_ )
1542
{
1543
    print_indent ( f_, d_ ) ;
1544
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
1545
    PRINT_CLASS_ID_P ( f_, x_.id, "id", d_ + 1 ) ;
1546
    PRINT_STRUCTURE_P ( f_, x_.base, "base", d_ + 1 ) ;
1547
    PRINT_list_COMPONENT_P ( f_, x_.defn, "defn", d_ + 1 ) ;
1548
    PRINT_zero_int ( f_, x_.output, "output", d_ + 1 ) ;
1549
    print_indent ( f_, d_ ) ;
1550
    ( void ) fprintf ( f_, "}\n" ) ;
1551
    return ;
1552
}
1553
 
1554
#ifdef DEBUG
1555
 
1556
void DEBUG_str
1557
    PROTO_N ( ( x_ ) )
1558
    PROTO_T ( STRUCTURE *x_ )
1559
{
1560
    if ( x_ ) PRINT_str ( stdout, *x_, "str", 0 ) ;
1561
    return ;
1562
}
1563
 
1564
#endif
1565
 
1566
#endif
1567
 
1568
 
1569
/* Printing routines for PTR ( PRIMITIVE ) */
1570
 
1571
#ifndef PRINT_ptr_prim
1572
 
1573
static void PRINT_ptr_prim
1574
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1575
    PROTO_T ( FILE *f_ X PTR ( PRIMITIVE ) x_ X char *nm_ X int d_ )
1576
{
1577
    print_indent ( f_, d_ ) ;
1578
    if ( IS_NULL_ptr ( x_ ) ) {
1579
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
1580
    } else if ( d_ < print_ptr_depth ) {
1581
	PRIMITIVE z_ ;
1582
	DEREF_prim ( x_, z_ ) ;
1583
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
1584
	PRINT_prim ( f_, z_, "(prim)", d_ + 1 ) ;
1585
	print_indent ( f_, d_ ) ;
1586
	( void ) fprintf ( f_, "}\n" ) ;
1587
    } else {
1588
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
1589
    }
1590
    return ;
1591
}
1592
 
1593
#ifdef DEBUG
1594
 
1595
void DEBUG_ptr_prim
1596
    PROTO_N ( ( x_ ) )
1597
    PROTO_T ( PTR ( PRIMITIVE ) x_ )
1598
{
1599
    PRINT_ptr_prim ( stdout, x_, "ptr_prim", 0 ) ;
1600
    return ;
1601
}
1602
 
1603
#endif
1604
 
1605
#endif
1606
 
1607
 
1608
/* Printing routines for PRIMITIVE */
1609
 
1610
#ifndef PRINT_prim
1611
 
1612
static void PRINT_prim
1613
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1614
    PROTO_T ( FILE *f_ X PRIMITIVE x_ X char *nm_ X int d_ )
1615
{
1616
    print_indent ( f_, d_ ) ;
1617
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
1618
    PRINT_CLASS_ID_P ( f_, x_.id, "id", d_ + 1 ) ;
1619
    PRINT_string ( f_, x_.defn, "defn", d_ + 1 ) ;
1620
    print_indent ( f_, d_ ) ;
1621
    ( void ) fprintf ( f_, "}\n" ) ;
1622
    return ;
1623
}
1624
 
1625
#ifdef DEBUG
1626
 
1627
void DEBUG_prim
1628
    PROTO_N ( ( x_ ) )
1629
    PROTO_T ( PRIMITIVE *x_ )
1630
{
1631
    if ( x_ ) PRINT_prim ( stdout, *x_, "prim", 0 ) ;
1632
    return ;
1633
}
1634
 
1635
#endif
1636
 
1637
#endif
1638
 
1639
 
1640
/* Printing routines for PTR ( MAP ) */
1641
 
1642
#ifndef PRINT_ptr_map
1643
 
1644
static void PRINT_ptr_map
1645
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1646
    PROTO_T ( FILE *f_ X PTR ( MAP ) x_ X char *nm_ X int d_ )
1647
{
1648
    print_indent ( f_, d_ ) ;
1649
    if ( IS_NULL_ptr ( x_ ) ) {
1650
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
1651
    } else if ( d_ < print_ptr_depth ) {
1652
	MAP z_ ;
1653
	DEREF_map ( x_, z_ ) ;
1654
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
1655
	PRINT_map ( f_, z_, "(map)", d_ + 1 ) ;
1656
	print_indent ( f_, d_ ) ;
1657
	( void ) fprintf ( f_, "}\n" ) ;
1658
    } else {
1659
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
1660
    }
1661
    return ;
1662
}
1663
 
1664
#ifdef DEBUG
1665
 
1666
void DEBUG_ptr_map
1667
    PROTO_N ( ( x_ ) )
1668
    PROTO_T ( PTR ( MAP ) x_ )
1669
{
1670
    PRINT_ptr_map ( stdout, x_, "ptr_map", 0 ) ;
1671
    return ;
1672
}
1673
 
1674
#endif
1675
 
1676
#endif
1677
 
1678
 
1679
/* Printing routines for MAP */
1680
 
1681
#ifndef PRINT_map
1682
 
1683
static void PRINT_map
1684
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1685
    PROTO_T ( FILE *f_ X MAP x_ X char *nm_ X int d_ )
1686
{
1687
    print_indent ( f_, d_ ) ;
1688
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
1689
    PRINT_string ( f_, x_.name, "name", d_ + 1 ) ;
1690
    PRINT_int ( f_, x_.flag, "flag", d_ + 1 ) ;
1691
    PRINT_TYPE_P ( f_, x_.ret_type, "ret_type", d_ + 1 ) ;
1692
    PRINT_list_ARGUMENT_P ( f_, x_.args, "args", d_ + 1 ) ;
1693
    print_indent ( f_, d_ ) ;
1694
    ( void ) fprintf ( f_, "}\n" ) ;
1695
    return ;
1696
}
1697
 
1698
#ifdef DEBUG
1699
 
1700
void DEBUG_map
1701
    PROTO_N ( ( x_ ) )
1702
    PROTO_T ( MAP *x_ )
1703
{
1704
    if ( x_ ) PRINT_map ( stdout, *x_, "map", 0 ) ;
1705
    return ;
1706
}
1707
 
1708
#endif
1709
 
1710
#endif
1711
 
1712
 
1713
/* Printing routines for PTR ( IDENTITY ) */
1714
 
1715
#ifndef PRINT_ptr_ident
1716
 
1717
static void PRINT_ptr_ident
1718
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1719
    PROTO_T ( FILE *f_ X PTR ( IDENTITY ) x_ X char *nm_ X int d_ )
1720
{
1721
    print_indent ( f_, d_ ) ;
1722
    if ( IS_NULL_ptr ( x_ ) ) {
1723
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
1724
    } else if ( d_ < print_ptr_depth ) {
1725
	IDENTITY z_ ;
1726
	DEREF_ident ( x_, z_ ) ;
1727
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
1728
	PRINT_ident ( f_, z_, "(ident)", d_ + 1 ) ;
1729
	print_indent ( f_, d_ ) ;
1730
	( void ) fprintf ( f_, "}\n" ) ;
1731
    } else {
1732
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
1733
    }
1734
    return ;
1735
}
1736
 
1737
#ifdef DEBUG
1738
 
1739
void DEBUG_ptr_ident
1740
    PROTO_N ( ( x_ ) )
1741
    PROTO_T ( PTR ( IDENTITY ) x_ )
1742
{
1743
    PRINT_ptr_ident ( stdout, x_, "ptr_ident", 0 ) ;
1744
    return ;
1745
}
1746
 
1747
#endif
1748
 
1749
#endif
1750
 
1751
 
1752
/* Printing routines for IDENTITY */
1753
 
1754
#ifndef PRINT_ident
1755
 
1756
static void PRINT_ident
1757
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1758
    PROTO_T ( FILE *f_ X IDENTITY x_ X char *nm_ X int d_ )
1759
{
1760
    print_indent ( f_, d_ ) ;
1761
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
1762
    PRINT_CLASS_ID_P ( f_, x_.id, "id", d_ + 1 ) ;
1763
    PRINT_TYPE_P ( f_, x_.defn, "defn", d_ + 1 ) ;
1764
    print_indent ( f_, d_ ) ;
1765
    ( void ) fprintf ( f_, "}\n" ) ;
1766
    return ;
1767
}
1768
 
1769
#ifdef DEBUG
1770
 
1771
void DEBUG_ident
1772
    PROTO_N ( ( x_ ) )
1773
    PROTO_T ( IDENTITY *x_ )
1774
{
1775
    if ( x_ ) PRINT_ident ( stdout, *x_, "ident", 0 ) ;
1776
    return ;
1777
}
1778
 
1779
#endif
1780
 
1781
#endif
1782
 
1783
 
1784
/* Printing routines for PTR ( FIELD ) */
1785
 
1786
#ifndef PRINT_ptr_fld
1787
 
1788
static void PRINT_ptr_fld
1789
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1790
    PROTO_T ( FILE *f_ X PTR ( FIELD ) x_ X char *nm_ X int d_ )
1791
{
1792
    print_indent ( f_, d_ ) ;
1793
    if ( IS_NULL_ptr ( x_ ) ) {
1794
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
1795
    } else if ( d_ < print_ptr_depth ) {
1796
	FIELD z_ ;
1797
	DEREF_fld ( x_, z_ ) ;
1798
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
1799
	PRINT_fld ( f_, z_, "(fld)", d_ + 1 ) ;
1800
	print_indent ( f_, d_ ) ;
1801
	( void ) fprintf ( f_, "}\n" ) ;
1802
    } else {
1803
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
1804
    }
1805
    return ;
1806
}
1807
 
1808
#ifdef DEBUG
1809
 
1810
void DEBUG_ptr_fld
1811
    PROTO_N ( ( x_ ) )
1812
    PROTO_T ( PTR ( FIELD ) x_ )
1813
{
1814
    PRINT_ptr_fld ( stdout, x_, "ptr_fld", 0 ) ;
1815
    return ;
1816
}
1817
 
1818
#endif
1819
 
1820
#endif
1821
 
1822
 
1823
/* Printing routines for FIELD */
1824
 
1825
#ifndef PRINT_fld
1826
 
1827
static void PRINT_fld
1828
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1829
    PROTO_T ( FILE *f_ X FIELD x_ X char *nm_ X int d_ )
1830
{
1831
    print_indent ( f_, d_ ) ;
1832
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
1833
    PRINT_string ( f_, x_.name, "name", d_ + 1 ) ;
1834
    PRINT_int ( f_, x_.tag, "tag", d_ + 1 ) ;
1835
    PRINT_int ( f_, x_.flag, "flag", d_ + 1 ) ;
1836
    PRINT_int ( f_, x_.set, "set", d_ + 1 ) ;
1837
    PRINT_FIELD_P ( f_, x_.base, "base", d_ + 1 ) ;
1838
    PRINT_list_COMPONENT_P ( f_, x_.defn, "defn", d_ + 1 ) ;
1839
    print_indent ( f_, d_ ) ;
1840
    ( void ) fprintf ( f_, "}\n" ) ;
1841
    return ;
1842
}
1843
 
1844
#ifdef DEBUG
1845
 
1846
void DEBUG_fld
1847
    PROTO_N ( ( x_ ) )
1848
    PROTO_T ( FIELD *x_ )
1849
{
1850
    if ( x_ ) PRINT_fld ( stdout, *x_, "fld", 0 ) ;
1851
    return ;
1852
}
1853
 
1854
#endif
1855
 
1856
#endif
1857
 
1858
 
1859
/* Printing routines for PTR ( ENUM ) */
1860
 
1861
#ifndef PRINT_ptr_en
1862
 
1863
static void PRINT_ptr_en
1864
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1865
    PROTO_T ( FILE *f_ X PTR ( ENUM ) x_ X char *nm_ X int d_ )
1866
{
1867
    print_indent ( f_, d_ ) ;
1868
    if ( IS_NULL_ptr ( x_ ) ) {
1869
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
1870
    } else if ( d_ < print_ptr_depth ) {
1871
	ENUM z_ ;
1872
	DEREF_en ( x_, z_ ) ;
1873
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
1874
	PRINT_en ( f_, z_, "(en)", d_ + 1 ) ;
1875
	print_indent ( f_, d_ ) ;
1876
	( void ) fprintf ( f_, "}\n" ) ;
1877
    } else {
1878
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
1879
    }
1880
    return ;
1881
}
1882
 
1883
#ifdef DEBUG
1884
 
1885
void DEBUG_ptr_en
1886
    PROTO_N ( ( x_ ) )
1887
    PROTO_T ( PTR ( ENUM ) x_ )
1888
{
1889
    PRINT_ptr_en ( stdout, x_, "ptr_en", 0 ) ;
1890
    return ;
1891
}
1892
 
1893
#endif
1894
 
1895
#endif
1896
 
1897
 
1898
/* Printing routines for ENUM */
1899
 
1900
#ifndef PRINT_en
1901
 
1902
static void PRINT_en
1903
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1904
    PROTO_T ( FILE *f_ X ENUM x_ X char *nm_ X int d_ )
1905
{
1906
    print_indent ( f_, d_ ) ;
1907
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
1908
    PRINT_CLASS_ID_P ( f_, x_.id, "id", d_ + 1 ) ;
1909
    PRINT_list_ECONST_P ( f_, x_.consts, "consts", d_ + 1 ) ;
1910
    PRINT_number ( f_, x_.order, "order", d_ + 1 ) ;
1911
    PRINT_int ( f_, x_.lists, "lists", d_ + 1 ) ;
1912
    print_indent ( f_, d_ ) ;
1913
    ( void ) fprintf ( f_, "}\n" ) ;
1914
    return ;
1915
}
1916
 
1917
#ifdef DEBUG
1918
 
1919
void DEBUG_en
1920
    PROTO_N ( ( x_ ) )
1921
    PROTO_T ( ENUM *x_ )
1922
{
1923
    if ( x_ ) PRINT_en ( stdout, *x_, "en", 0 ) ;
1924
    return ;
1925
}
1926
 
1927
#endif
1928
 
1929
#endif
1930
 
1931
 
1932
/* Printing routines for PTR ( ECONST ) */
1933
 
1934
#ifndef PRINT_ptr_ec
1935
 
1936
static void PRINT_ptr_ec
1937
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1938
    PROTO_T ( FILE *f_ X PTR ( ECONST ) x_ X char *nm_ X int d_ )
1939
{
1940
    print_indent ( f_, d_ ) ;
1941
    if ( IS_NULL_ptr ( x_ ) ) {
1942
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
1943
    } else if ( d_ < print_ptr_depth ) {
1944
	ECONST z_ ;
1945
	DEREF_ec ( x_, z_ ) ;
1946
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
1947
	PRINT_ec ( f_, z_, "(ec)", d_ + 1 ) ;
1948
	print_indent ( f_, d_ ) ;
1949
	( void ) fprintf ( f_, "}\n" ) ;
1950
    } else {
1951
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
1952
    }
1953
    return ;
1954
}
1955
 
1956
#ifdef DEBUG
1957
 
1958
void DEBUG_ptr_ec
1959
    PROTO_N ( ( x_ ) )
1960
    PROTO_T ( PTR ( ECONST ) x_ )
1961
{
1962
    PRINT_ptr_ec ( stdout, x_, "ptr_ec", 0 ) ;
1963
    return ;
1964
}
1965
 
1966
#endif
1967
 
1968
#endif
1969
 
1970
 
1971
/* Printing routines for ECONST */
1972
 
1973
#ifndef PRINT_ec
1974
 
1975
static void PRINT_ec
1976
    PROTO_N ( ( f_, x_, nm_, d_ ) )
1977
    PROTO_T ( FILE *f_ X ECONST x_ X char *nm_ X int d_ )
1978
{
1979
    print_indent ( f_, d_ ) ;
1980
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
1981
    PRINT_string ( f_, x_.name, "name", d_ + 1 ) ;
1982
    PRINT_number ( f_, x_.value, "value", d_ + 1 ) ;
1983
    print_indent ( f_, d_ ) ;
1984
    ( void ) fprintf ( f_, "}\n" ) ;
1985
    return ;
1986
}
1987
 
1988
#ifdef DEBUG
1989
 
1990
void DEBUG_ec
1991
    PROTO_N ( ( x_ ) )
1992
    PROTO_T ( ECONST *x_ )
1993
{
1994
    if ( x_ ) PRINT_ec ( stdout, *x_, "ec", 0 ) ;
1995
    return ;
1996
}
1997
 
1998
#endif
1999
 
2000
#endif
2001
 
2002
 
2003
/* Printing routines for PTR ( COMPONENT ) */
2004
 
2005
#ifndef PRINT_ptr_cmp
2006
 
2007
static void PRINT_ptr_cmp
2008
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2009
    PROTO_T ( FILE *f_ X PTR ( COMPONENT ) x_ X char *nm_ X int d_ )
2010
{
2011
    print_indent ( f_, d_ ) ;
2012
    if ( IS_NULL_ptr ( x_ ) ) {
2013
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
2014
    } else if ( d_ < print_ptr_depth ) {
2015
	COMPONENT z_ ;
2016
	DEREF_cmp ( x_, z_ ) ;
2017
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
2018
	PRINT_cmp ( f_, z_, "(cmp)", d_ + 1 ) ;
2019
	print_indent ( f_, d_ ) ;
2020
	( void ) fprintf ( f_, "}\n" ) ;
2021
    } else {
2022
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
2023
    }
2024
    return ;
2025
}
2026
 
2027
#ifdef DEBUG
2028
 
2029
void DEBUG_ptr_cmp
2030
    PROTO_N ( ( x_ ) )
2031
    PROTO_T ( PTR ( COMPONENT ) x_ )
2032
{
2033
    PRINT_ptr_cmp ( stdout, x_, "ptr_cmp", 0 ) ;
2034
    return ;
2035
}
2036
 
2037
#endif
2038
 
2039
#endif
2040
 
2041
 
2042
/* Printing routines for COMPONENT */
2043
 
2044
#ifndef PRINT_cmp
2045
 
2046
static void PRINT_cmp
2047
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2048
    PROTO_T ( FILE *f_ X COMPONENT x_ X char *nm_ X int d_ )
2049
{
2050
    print_indent ( f_, d_ ) ;
2051
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
2052
    PRINT_string ( f_, x_.name, "name", d_ + 1 ) ;
2053
    PRINT_TYPE_P ( f_, x_.type, "type", d_ + 1 ) ;
2054
    PRINT_string ( f_, x_.value, "value", d_ + 1 ) ;
2055
    print_indent ( f_, d_ ) ;
2056
    ( void ) fprintf ( f_, "}\n" ) ;
2057
    return ;
2058
}
2059
 
2060
#ifdef DEBUG
2061
 
2062
void DEBUG_cmp
2063
    PROTO_N ( ( x_ ) )
2064
    PROTO_T ( COMPONENT *x_ )
2065
{
2066
    if ( x_ ) PRINT_cmp ( stdout, *x_, "cmp", 0 ) ;
2067
    return ;
2068
}
2069
 
2070
#endif
2071
 
2072
#endif
2073
 
2074
 
2075
/* Printing routines for PTR ( PTR ( CLASS_ID ) ) */
2076
 
2077
#ifndef PRINT_ptr_ptr_cid
2078
 
2079
static void PRINT_ptr_ptr_cid
2080
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2081
    PROTO_T ( FILE *f_ X PTR ( PTR ( CLASS_ID ) ) x_ X char *nm_ X int d_ )
2082
{
2083
    print_indent ( f_, d_ ) ;
2084
    if ( IS_NULL_ptr ( x_ ) ) {
2085
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
2086
    } else if ( d_ < print_ptr_depth ) {
2087
	PTR ( CLASS_ID ) z_ ;
2088
	z_ = DEREF_ptr ( x_ ) ;
2089
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
2090
	PRINT_ptr_cid ( f_, z_, "(ptr_cid)", d_ + 1 ) ;
2091
	print_indent ( f_, d_ ) ;
2092
	( void ) fprintf ( f_, "}\n" ) ;
2093
    } else {
2094
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
2095
    }
2096
    return ;
2097
}
2098
 
2099
#ifdef DEBUG
2100
 
2101
void DEBUG_ptr_ptr_cid
2102
    PROTO_N ( ( x_ ) )
2103
    PROTO_T ( PTR ( PTR ( CLASS_ID ) ) x_ )
2104
{
2105
    PRINT_ptr_ptr_cid ( stdout, x_, "ptr_ptr_cid", 0 ) ;
2106
    return ;
2107
}
2108
 
2109
#endif
2110
 
2111
#endif
2112
 
2113
 
2114
/* Printing routines for PTR ( CLASS_ID ) */
2115
 
2116
#ifndef PRINT_ptr_cid
2117
 
2118
static void PRINT_ptr_cid
2119
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2120
    PROTO_T ( FILE *f_ X PTR ( CLASS_ID ) x_ X char *nm_ X int d_ )
2121
{
2122
    print_indent ( f_, d_ ) ;
2123
    if ( IS_NULL_ptr ( x_ ) ) {
2124
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
2125
    } else if ( d_ < print_ptr_depth ) {
2126
	CLASS_ID z_ ;
2127
	DEREF_cid ( x_, z_ ) ;
2128
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
2129
	PRINT_cid ( f_, z_, "(cid)", d_ + 1 ) ;
2130
	print_indent ( f_, d_ ) ;
2131
	( void ) fprintf ( f_, "}\n" ) ;
2132
    } else {
2133
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
2134
    }
2135
    return ;
2136
}
2137
 
2138
#ifdef DEBUG
2139
 
2140
void DEBUG_ptr_cid
2141
    PROTO_N ( ( x_ ) )
2142
    PROTO_T ( PTR ( CLASS_ID ) x_ )
2143
{
2144
    PRINT_ptr_cid ( stdout, x_, "ptr_cid", 0 ) ;
2145
    return ;
2146
}
2147
 
2148
#endif
2149
 
2150
#endif
2151
 
2152
 
2153
/* Printing routines for CLASS_ID */
2154
 
2155
#ifndef PRINT_cid
2156
 
2157
static void PRINT_cid
2158
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2159
    PROTO_T ( FILE *f_ X CLASS_ID x_ X char *nm_ X int d_ )
2160
{
2161
    print_indent ( f_, d_ ) ;
2162
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
2163
    PRINT_string ( f_, x_.name, "name", d_ + 1 ) ;
2164
    PRINT_string ( f_, x_.name_aux, "name_aux", d_ + 1 ) ;
2165
    PRINT_int ( f_, x_.flag, "flag", d_ + 1 ) ;
2166
    PRINT_name_string ( f_, x_.file, "file", d_ + 1 ) ;
2167
    PRINT_int ( f_, x_.line, "line", d_ + 1 ) ;
2168
    print_indent ( f_, d_ ) ;
2169
    ( void ) fprintf ( f_, "}\n" ) ;
2170
    return ;
2171
}
2172
 
2173
#ifdef DEBUG
2174
 
2175
void DEBUG_cid
2176
    PROTO_N ( ( x_ ) )
2177
    PROTO_T ( CLASS_ID *x_ )
2178
{
2179
    if ( x_ ) PRINT_cid ( stdout, *x_, "cid", 0 ) ;
2180
    return ;
2181
}
2182
 
2183
#endif
2184
 
2185
#endif
2186
 
2187
 
2188
/* Printing routines for PTR ( ARGUMENT ) */
2189
 
2190
#ifndef PRINT_ptr_arg
2191
 
2192
static void PRINT_ptr_arg
2193
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2194
    PROTO_T ( FILE *f_ X PTR ( ARGUMENT ) x_ X char *nm_ X int d_ )
2195
{
2196
    print_indent ( f_, d_ ) ;
2197
    if ( IS_NULL_ptr ( x_ ) ) {
2198
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
2199
    } else if ( d_ < print_ptr_depth ) {
2200
	ARGUMENT z_ ;
2201
	DEREF_arg ( x_, z_ ) ;
2202
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
2203
	PRINT_arg ( f_, z_, "(arg)", d_ + 1 ) ;
2204
	print_indent ( f_, d_ ) ;
2205
	( void ) fprintf ( f_, "}\n" ) ;
2206
    } else {
2207
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
2208
    }
2209
    return ;
2210
}
2211
 
2212
#ifdef DEBUG
2213
 
2214
void DEBUG_ptr_arg
2215
    PROTO_N ( ( x_ ) )
2216
    PROTO_T ( PTR ( ARGUMENT ) x_ )
2217
{
2218
    PRINT_ptr_arg ( stdout, x_, "ptr_arg", 0 ) ;
2219
    return ;
2220
}
2221
 
2222
#endif
2223
 
2224
#endif
2225
 
2226
 
2227
/* Printing routines for ARGUMENT */
2228
 
2229
#ifndef PRINT_arg
2230
 
2231
static void PRINT_arg
2232
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2233
    PROTO_T ( FILE *f_ X ARGUMENT x_ X char *nm_ X int d_ )
2234
{
2235
    print_indent ( f_, d_ ) ;
2236
    ( void ) fprintf ( f_, "%s = {\n", nm_ ) ;
2237
    PRINT_string ( f_, x_.name, "name", d_ + 1 ) ;
2238
    PRINT_TYPE_P ( f_, x_.type, "type", d_ + 1 ) ;
2239
    print_indent ( f_, d_ ) ;
2240
    ( void ) fprintf ( f_, "}\n" ) ;
2241
    return ;
2242
}
2243
 
2244
#ifdef DEBUG
2245
 
2246
void DEBUG_arg
2247
    PROTO_N ( ( x_ ) )
2248
    PROTO_T ( ARGUMENT *x_ )
2249
{
2250
    if ( x_ ) PRINT_arg ( stdout, *x_, "arg", 0 ) ;
2251
    return ;
2252
}
2253
 
2254
#endif
2255
 
2256
#endif
2257
 
2258
 
2259
/* Printing routines for PTR ( string ) */
2260
 
2261
#ifndef PRINT_ptr_string
2262
 
2263
static void PRINT_ptr_string
2264
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2265
    PROTO_T ( FILE *f_ X PTR ( string ) x_ X char *nm_ X int d_ )
2266
{
2267
    print_indent ( f_, d_ ) ;
2268
    if ( IS_NULL_ptr ( x_ ) ) {
2269
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
2270
    } else if ( d_ < print_ptr_depth ) {
2271
	string z_ ;
2272
	z_ = DEREF_string ( x_ ) ;
2273
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
2274
	PRINT_string ( f_, z_, "(string)", d_ + 1 ) ;
2275
	print_indent ( f_, d_ ) ;
2276
	( void ) fprintf ( f_, "}\n" ) ;
2277
    } else {
2278
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
2279
    }
2280
    return ;
2281
}
2282
 
2283
#ifdef DEBUG
2284
 
2285
void DEBUG_ptr_string
2286
    PROTO_N ( ( x_ ) )
2287
    PROTO_T ( PTR ( string ) x_ )
2288
{
2289
    PRINT_ptr_string ( stdout, x_, "ptr_string", 0 ) ;
2290
    return ;
2291
}
2292
 
2293
#endif
2294
 
2295
#endif
2296
 
2297
 
2298
/* Printing routines for PTR ( number ) */
2299
 
2300
#ifndef PRINT_ptr_number
2301
 
2302
static void PRINT_ptr_number
2303
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2304
    PROTO_T ( FILE *f_ X PTR ( number ) x_ X char *nm_ X int d_ )
2305
{
2306
    print_indent ( f_, d_ ) ;
2307
    if ( IS_NULL_ptr ( x_ ) ) {
2308
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
2309
    } else if ( d_ < print_ptr_depth ) {
2310
	number z_ ;
2311
	z_ = DEREF_number ( x_ ) ;
2312
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
2313
	PRINT_number ( f_, z_, "(number)", d_ + 1 ) ;
2314
	print_indent ( f_, d_ ) ;
2315
	( void ) fprintf ( f_, "}\n" ) ;
2316
    } else {
2317
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
2318
    }
2319
    return ;
2320
}
2321
 
2322
#ifdef DEBUG
2323
 
2324
void DEBUG_ptr_number
2325
    PROTO_N ( ( x_ ) )
2326
    PROTO_T ( PTR ( number ) x_ )
2327
{
2328
    PRINT_ptr_number ( stdout, x_, "ptr_number", 0 ) ;
2329
    return ;
2330
}
2331
 
2332
#endif
2333
 
2334
#endif
2335
 
2336
 
2337
/* Printing routines for PTR ( int ) */
2338
 
2339
#ifndef PRINT_ptr_int
2340
 
2341
static void PRINT_ptr_int
2342
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2343
    PROTO_T ( FILE *f_ X PTR ( int ) x_ X char *nm_ X int d_ )
2344
{
2345
    print_indent ( f_, d_ ) ;
2346
    if ( IS_NULL_ptr ( x_ ) ) {
2347
	( void ) fprintf ( f_, "%s = NULL_ptr ;\n", nm_ ) ;
2348
    } else if ( d_ < print_ptr_depth ) {
2349
	int z_ ;
2350
	z_ = DEREF_int ( x_ ) ;
2351
	( void ) fprintf ( f_, "%s = PTR {\n", nm_ ) ;
2352
	PRINT_int ( f_, z_, "(int)", d_ + 1 ) ;
2353
	print_indent ( f_, d_ ) ;
2354
	( void ) fprintf ( f_, "}\n" ) ;
2355
    } else {
2356
	( void ) fprintf ( f_, "%s = 0x%p ;\n", nm_, VOIDSTAR_ptr ( x_ ) ) ;
2357
    }
2358
    return ;
2359
}
2360
 
2361
#ifdef DEBUG
2362
 
2363
void DEBUG_ptr_int
2364
    PROTO_N ( ( x_ ) )
2365
    PROTO_T ( PTR ( int ) x_ )
2366
{
2367
    PRINT_ptr_int ( stdout, x_, "ptr_int", 0 ) ;
2368
    return ;
2369
}
2370
 
2371
#endif
2372
 
2373
#endif
2374
 
2375
 
2376
/* Printing routines for string */
2377
 
2378
#ifndef PRINT_string
2379
 
2380
static void PRINT_string
2381
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2382
    PROTO_T ( FILE *f_ X string x_ X char *nm_ X int d_ )
2383
{
2384
    print_indent ( f_, d_ ) ;
2385
    ( void ) fprintf ( f_, "%s = ", nm_ ) ;
2386
    OUTPUT_string ( f_, x_ ) ;
2387
    ( void ) fprintf ( f_, " ;\n" ) ;
2388
    return ;
2389
}
2390
 
2391
#ifdef DEBUG
2392
 
2393
void DEBUG_string
2394
    PROTO_N ( ( x_ ) )
2395
    PROTO_T ( string x_ )
2396
{
2397
    PRINT_string ( stdout, x_, "string", 0 ) ;
2398
    return ;
2399
}
2400
 
2401
#endif
2402
 
2403
#endif
2404
 
2405
 
2406
/* Printing routines for number */
2407
 
2408
#ifndef PRINT_number
2409
 
2410
static void PRINT_number
2411
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2412
    PROTO_T ( FILE *f_ X number x_ X char *nm_ X int d_ )
2413
{
2414
    print_indent ( f_, d_ ) ;
2415
    ( void ) fprintf ( f_, "%s = ", nm_ ) ;
2416
    OUTPUT_number ( f_, x_ ) ;
2417
    ( void ) fprintf ( f_, " ;\n" ) ;
2418
    return ;
2419
}
2420
 
2421
#ifdef DEBUG
2422
 
2423
void DEBUG_number
2424
    PROTO_N ( ( x_ ) )
2425
    PROTO_T ( number x_ )
2426
{
2427
    PRINT_number ( stdout, x_, "number", 0 ) ;
2428
    return ;
2429
}
2430
 
2431
#endif
2432
 
2433
#endif
2434
 
2435
 
2436
/* Printing routines for int */
2437
 
2438
#ifndef PRINT_int
2439
 
2440
static void PRINT_int
2441
    PROTO_N ( ( f_, x_, nm_, d_ ) )
2442
    PROTO_T ( FILE *f_ X int x_ X char *nm_ X int d_ )
2443
{
2444
    print_indent ( f_, d_ ) ;
2445
    ( void ) fprintf ( f_, "%s = ", nm_ ) ;
2446
    OUTPUT_int ( f_, x_ ) ;
2447
    ( void ) fprintf ( f_, " ;\n" ) ;
2448
    return ;
2449
}
2450
 
2451
#ifdef DEBUG
2452
 
2453
void DEBUG_int
2454
    PROTO_N ( ( x_ ) )
2455
    PROTO_T ( int x_ )
2456
{
2457
    PRINT_int ( stdout, x_, "int", 0 ) ;
2458
    return ;
2459
}
2460
 
2461
#endif
2462
 
2463
#endif
2464
 
2465
 
2466
#endif