Subversion Repositories tendra.SVN

Rev

Rev 2 | 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 TYPE_OPS_H_INCLUDED
36
#define TYPE_OPS_H_INCLUDED
37
 
38
/* Operations for union TYPE */
39
 
7 7u83 40
#define TAG_type(P)			(CHECK_NULL(P)->ag_tag)
2 7u83 41
 
42
 
43
/* Operations for component size of union TYPE */
44
 
7 7u83 45
#define type_size(P)			(CHECK_NULL(P) + 1)
2 7u83 46
 
47
 
48
/* Operations for field primitive of union TYPE */
49
 
7 7u83 50
#define type_primitive_tag		((unsigned)0)
51
#define IS_type_primitive(P)		(CHECK_NULL(P)->ag_tag == 0)
2 7u83 52
 
7 7u83 53
#define type_primitive_prim(P)		(CHECK_TAG((P), 0) + 2)
2 7u83 54
 
7 7u83 55
#define MAKE_type_primitive(size_, prim_, calculus_type)\
2 7u83 56
    {\
7 7u83 57
	calculus *x136_ = GEN_calculus(4, TYPEID_type);\
58
	x136_->ag_tag = 0;\
59
	COPY_int(x136_ + 1, (size_));\
60
	COPY_ptr(x136_ + 2, (prim_));\
61
	x136_[3].ag_tag = 0;\
62
	(calculus_type) = x136_;\
2 7u83 63
    }
64
 
7 7u83 65
#define DECONS_type_primitive(size_, prim_, calculus_type)\
2 7u83 66
    {\
7 7u83 67
	calculus *x137_ = CHECK_TAG((calculus_type), 0);\
68
	(size_) = DEREF_int(x137_ + 1);\
69
	(prim_) = DEREF_ptr(x137_ + 2);\
2 7u83 70
    }
71
 
7 7u83 72
#define DESTROY_type_primitive(destroyer_, size_, prim_, calculus_type)\
2 7u83 73
    {\
7 7u83 74
	calculus *x138_ = CHECK_TAG((calculus_type), 0);\
75
	(size_) = DEREF_int(x138_ + 1);\
76
	(prim_) = DEREF_ptr(x138_ + 2);\
77
	(destroyer_)(x138_, (unsigned)4);\
2 7u83 78
    }
79
 
80
#ifdef calculus_IO_ROUTINES
81
 
7 7u83 82
#define NEW_ALIAS_type_primitive(P, N)\
2 7u83 83
    {\
7 7u83 84
	calculus *x139_ = GEN_calculus(4, TYPEID_list);\
85
	unsigned a139_ = (N);\
86
	x139_->ag_tag = 0;\
87
	x139_[3].ag_tag = a139_;\
88
	set_calculus_alias(x139_ + 3, a139_);\
89
	(P) = x139_;\
2 7u83 90
    }
91
 
7 7u83 92
#define GET_ALIAS_type_primitive(P)	((CHECK_NULL(P) + 3)->ag_tag)
93
#define SET_ALIAS_type_primitive(P, N)	set_calculus_alias(CHECK_NULL(P) + 3, (N))
94
#define FIND_ALIAS_type_primitive(N)	(find_calculus_alias(N) - 3)
2 7u83 95
 
96
#endif
97
 
98
 
99
/* Operations for field ident of union TYPE */
100
 
7 7u83 101
#define type_ident_tag			((unsigned)1)
102
#define IS_type_ident(P)		(CHECK_NULL(P)->ag_tag == 1)
2 7u83 103
 
7 7u83 104
#define type_ident_id(P)		(CHECK_TAG((P), 1) + 2)
2 7u83 105
 
7 7u83 106
#define MAKE_type_ident(size_, id_, calculus_type)\
2 7u83 107
    {\
7 7u83 108
	calculus *x140_ = GEN_calculus(4, TYPEID_type);\
109
	x140_->ag_tag = 1;\
110
	COPY_int(x140_ + 1, (size_));\
111
	COPY_ptr(x140_ + 2, (id_));\
112
	x140_[3].ag_tag = 0;\
113
	(calculus_type) = x140_;\
2 7u83 114
    }
115
 
7 7u83 116
#define DECONS_type_ident(size_, id_, calculus_type)\
2 7u83 117
    {\
7 7u83 118
	calculus *x141_ = CHECK_TAG((calculus_type), 1);\
119
	(size_) = DEREF_int(x141_ + 1);\
120
	(id_) = DEREF_ptr(x141_ + 2);\
2 7u83 121
    }
122
 
7 7u83 123
#define DESTROY_type_ident(destroyer_, size_, id_, calculus_type)\
2 7u83 124
    {\
7 7u83 125
	calculus *x142_ = CHECK_TAG((calculus_type), 1);\
126
	(size_) = DEREF_int(x142_ + 1);\
127
	(id_) = DEREF_ptr(x142_ + 2);\
128
	(destroyer_)(x142_, (unsigned)4);\
2 7u83 129
    }
130
 
131
#ifdef calculus_IO_ROUTINES
132
 
7 7u83 133
#define NEW_ALIAS_type_ident(P, N)\
2 7u83 134
    {\
7 7u83 135
	calculus *x143_ = GEN_calculus(4, TYPEID_list);\
136
	unsigned a143_ = (N);\
137
	x143_->ag_tag = 1;\
138
	x143_[3].ag_tag = a143_;\
139
	set_calculus_alias(x143_ + 3, a143_);\
140
	(P) = x143_;\
2 7u83 141
    }
142
 
7 7u83 143
#define GET_ALIAS_type_ident(P)		((CHECK_NULL(P) + 3)->ag_tag)
144
#define SET_ALIAS_type_ident(P, N)	set_calculus_alias(CHECK_NULL(P) + 3, (N))
145
#define FIND_ALIAS_type_ident(N)	(find_calculus_alias(N) - 3)
2 7u83 146
 
147
#endif
148
 
149
 
150
/* Operations for field enumeration of union TYPE */
151
 
7 7u83 152
#define type_enumeration_tag		((unsigned)2)
153
#define IS_type_enumeration(P)		(CHECK_NULL(P)->ag_tag == 2)
2 7u83 154
 
7 7u83 155
#define type_enumeration_en(P)		(CHECK_TAG((P), 2) + 2)
2 7u83 156
 
7 7u83 157
#define MAKE_type_enumeration(size_, en_, calculus_type)\
2 7u83 158
    {\
7 7u83 159
	calculus *x144_ = GEN_calculus(4, TYPEID_type);\
160
	x144_->ag_tag = 2;\
161
	COPY_int(x144_ + 1, (size_));\
162
	COPY_ptr(x144_ + 2, (en_));\
163
	x144_[3].ag_tag = 0;\
164
	(calculus_type) = x144_;\
2 7u83 165
    }
166
 
7 7u83 167
#define DECONS_type_enumeration(size_, en_, calculus_type)\
2 7u83 168
    {\
7 7u83 169
	calculus *x145_ = CHECK_TAG((calculus_type), 2);\
170
	(size_) = DEREF_int(x145_ + 1);\
171
	(en_) = DEREF_ptr(x145_ + 2);\
2 7u83 172
    }
173
 
7 7u83 174
#define DESTROY_type_enumeration(destroyer_, size_, en_, calculus_type)\
2 7u83 175
    {\
7 7u83 176
	calculus *x146_ = CHECK_TAG((calculus_type), 2);\
177
	(size_) = DEREF_int(x146_ + 1);\
178
	(en_) = DEREF_ptr(x146_ + 2);\
179
	(destroyer_)(x146_, (unsigned)4);\
2 7u83 180
    }
181
 
182
#ifdef calculus_IO_ROUTINES
183
 
7 7u83 184
#define NEW_ALIAS_type_enumeration(P, N)\
2 7u83 185
    {\
7 7u83 186
	calculus *x147_ = GEN_calculus(4, TYPEID_list);\
187
	unsigned a147_ = (N);\
188
	x147_->ag_tag = 2;\
189
	x147_[3].ag_tag = a147_;\
190
	set_calculus_alias(x147_ + 3, a147_);\
191
	(P) = x147_;\
2 7u83 192
    }
193
 
7 7u83 194
#define GET_ALIAS_type_enumeration(P)	((CHECK_NULL(P) + 3)->ag_tag)
195
#define SET_ALIAS_type_enumeration(P, N)set_calculus_alias(CHECK_NULL(P) + 3, (N))
196
#define FIND_ALIAS_type_enumeration(N)	(find_calculus_alias(N) - 3)
2 7u83 197
 
198
#endif
199
 
200
 
201
/* Operations for field structure of union TYPE */
202
 
7 7u83 203
#define type_structure_tag		((unsigned)3)
204
#define IS_type_structure(P)		(CHECK_NULL(P)->ag_tag == 3)
2 7u83 205
 
7 7u83 206
#define type_structure_struc(P)		(CHECK_TAG((P), 3) + 2)
2 7u83 207
 
7 7u83 208
#define MAKE_type_structure(size_, struc_, calculus_type)\
2 7u83 209
    {\
7 7u83 210
	calculus *x148_ = GEN_calculus(4, TYPEID_type);\
211
	x148_->ag_tag = 3;\
212
	COPY_int(x148_ + 1, (size_));\
213
	COPY_ptr(x148_ + 2, (struc_));\
214
	x148_[3].ag_tag = 0;\
215
	(calculus_type) = x148_;\
2 7u83 216
    }
217
 
7 7u83 218
#define DECONS_type_structure(size_, struc_, calculus_type)\
2 7u83 219
    {\
7 7u83 220
	calculus *x149_ = CHECK_TAG((calculus_type), 3);\
221
	(size_) = DEREF_int(x149_ + 1);\
222
	(struc_) = DEREF_ptr(x149_ + 2);\
2 7u83 223
    }
224
 
7 7u83 225
#define DESTROY_type_structure(destroyer_, size_, struc_, calculus_type)\
2 7u83 226
    {\
7 7u83 227
	calculus *x150_ = CHECK_TAG((calculus_type), 3);\
228
	(size_) = DEREF_int(x150_ + 1);\
229
	(struc_) = DEREF_ptr(x150_ + 2);\
230
	(destroyer_)(x150_, (unsigned)4);\
2 7u83 231
    }
232
 
233
#ifdef calculus_IO_ROUTINES
234
 
7 7u83 235
#define NEW_ALIAS_type_structure(P, N)\
2 7u83 236
    {\
7 7u83 237
	calculus *x151_ = GEN_calculus(4, TYPEID_list);\
238
	unsigned a151_ = (N);\
239
	x151_->ag_tag = 3;\
240
	x151_[3].ag_tag = a151_;\
241
	set_calculus_alias(x151_ + 3, a151_);\
242
	(P) = x151_;\
2 7u83 243
    }
244
 
7 7u83 245
#define GET_ALIAS_type_structure(P)	((CHECK_NULL(P) + 3)->ag_tag)
246
#define SET_ALIAS_type_structure(P, N)	set_calculus_alias(CHECK_NULL(P) + 3, (N))
247
#define FIND_ALIAS_type_structure(N)	(find_calculus_alias(N) - 3)
2 7u83 248
 
249
#endif
250
 
251
 
252
/* Operations for field onion of union TYPE */
253
 
7 7u83 254
#define type_onion_tag			((unsigned)4)
255
#define IS_type_onion(P)		(CHECK_NULL(P)->ag_tag == 4)
2 7u83 256
 
7 7u83 257
#define type_onion_un(P)		(CHECK_TAG((P), 4) + 2)
2 7u83 258
 
7 7u83 259
#define MAKE_type_onion(size_, un_, calculus_type)\
2 7u83 260
    {\
7 7u83 261
	calculus *x152_ = GEN_calculus(4, TYPEID_type);\
262
	x152_->ag_tag = 4;\
263
	COPY_int(x152_ + 1, (size_));\
264
	COPY_ptr(x152_ + 2, (un_));\
265
	x152_[3].ag_tag = 0;\
266
	(calculus_type) = x152_;\
2 7u83 267
    }
268
 
7 7u83 269
#define DECONS_type_onion(size_, un_, calculus_type)\
2 7u83 270
    {\
7 7u83 271
	calculus *x153_ = CHECK_TAG((calculus_type), 4);\
272
	(size_) = DEREF_int(x153_ + 1);\
273
	(un_) = DEREF_ptr(x153_ + 2);\
2 7u83 274
    }
275
 
7 7u83 276
#define DESTROY_type_onion(destroyer_, size_, un_, calculus_type)\
2 7u83 277
    {\
7 7u83 278
	calculus *x154_ = CHECK_TAG((calculus_type), 4);\
279
	(size_) = DEREF_int(x154_ + 1);\
280
	(un_) = DEREF_ptr(x154_ + 2);\
281
	(destroyer_)(x154_, (unsigned)4);\
2 7u83 282
    }
283
 
284
#ifdef calculus_IO_ROUTINES
285
 
7 7u83 286
#define NEW_ALIAS_type_onion(P, N)\
2 7u83 287
    {\
7 7u83 288
	calculus *x155_ = GEN_calculus(4, TYPEID_list);\
289
	unsigned a155_ = (N);\
290
	x155_->ag_tag = 4;\
291
	x155_[3].ag_tag = a155_;\
292
	set_calculus_alias(x155_ + 3, a155_);\
293
	(P) = x155_;\
2 7u83 294
    }
295
 
7 7u83 296
#define GET_ALIAS_type_onion(P)		((CHECK_NULL(P) + 3)->ag_tag)
297
#define SET_ALIAS_type_onion(P, N)	set_calculus_alias(CHECK_NULL(P) + 3, (N))
298
#define FIND_ALIAS_type_onion(N)	(find_calculus_alias(N) - 3)
2 7u83 299
 
300
#endif
301
 
302
 
303
/* Operations for field set ptr_etc of union TYPE */
304
 
7 7u83 305
#define type_ptr_etc_tag		((unsigned)10)
306
#define IS_type_ptr_etc(P)		((unsigned)(CHECK_NULL(P)->ag_tag - 5) < (unsigned)5)
2 7u83 307
 
7 7u83 308
#define type_ptr_etc_sub(P)		(CHECK_TAG_ETC((P), 5, 10) + 2)
2 7u83 309
 
7 7u83 310
#define MAKE_type_ptr_etc(tag, size_, sub_, calculus_type)\
2 7u83 311
    {\
7 7u83 312
	calculus *x156_ = GEN_calculus(4, TYPEID_type);\
313
	x156_->ag_tag = (tag);\
314
	COPY_int(x156_ + 1, (size_));\
315
	COPY_ptr(x156_ + 2, (sub_));\
316
	x156_[3].ag_tag = 0;\
317
	(calculus_type) = CHECK_TAG_ETC(x156_, 5, 10);\
2 7u83 318
    }
319
 
7 7u83 320
#define MODIFY_type_ptr_etc(tag, calculus_type)\
2 7u83 321
    {\
7 7u83 322
	calculus *x157_ = CHECK_TAG_ETC ((calculus_type), 5, 10);\
323
	x157_->ag_tag = (tag);\
324
	(void) CHECK_TAG_ETC (x157_, 5, 10);\
2 7u83 325
    }
326
 
7 7u83 327
#define DECONS_type_ptr_etc(size_, sub_, calculus_type)\
2 7u83 328
    {\
7 7u83 329
	calculus *x158_ = CHECK_TAG_ETC((calculus_type), 5, 10);\
330
	(size_) = DEREF_int(x158_ + 1);\
331
	(sub_) = DEREF_ptr(x158_ + 2);\
2 7u83 332
    }
333
 
7 7u83 334
#define DESTROY_type_ptr_etc(destroyer_, size_, sub_, calculus_type)\
2 7u83 335
    {\
7 7u83 336
	calculus *x159_ = CHECK_TAG_ETC((calculus_type), 5, 10);\
337
	(size_) = DEREF_int(x159_ + 1);\
338
	(sub_) = DEREF_ptr(x159_ + 2);\
339
	(destroyer_)(x159_, (unsigned)4);\
2 7u83 340
    }
341
 
342
 
343
/* Operations for field ptr of union TYPE */
344
 
7 7u83 345
#define type_ptr_tag			((unsigned)5)
346
#define IS_type_ptr(P)			(CHECK_NULL(P)->ag_tag == 5)
2 7u83 347
 
7 7u83 348
#define type_ptr_sub(P)			(CHECK_TAG((P), 5) + 2)
2 7u83 349
 
7 7u83 350
#define MAKE_type_ptr(size_, sub_, calculus_type)\
2 7u83 351
    {\
7 7u83 352
	calculus *x160_ = GEN_calculus(4, TYPEID_type);\
353
	x160_->ag_tag = 5;\
354
	COPY_int(x160_ + 1, (size_));\
355
	COPY_ptr(x160_ + 2, (sub_));\
356
	x160_[3].ag_tag = 0;\
357
	(calculus_type) = x160_;\
2 7u83 358
    }
359
 
7 7u83 360
#define DECONS_type_ptr(size_, sub_, calculus_type)\
2 7u83 361
    {\
7 7u83 362
	calculus *x161_ = CHECK_TAG((calculus_type), 5);\
363
	(size_) = DEREF_int(x161_ + 1);\
364
	(sub_) = DEREF_ptr(x161_ + 2);\
2 7u83 365
    }
366
 
7 7u83 367
#define DESTROY_type_ptr(destroyer_, size_, sub_, calculus_type)\
2 7u83 368
    {\
7 7u83 369
	calculus *x162_ = CHECK_TAG((calculus_type), 5);\
370
	(size_) = DEREF_int(x162_ + 1);\
371
	(sub_) = DEREF_ptr(x162_ + 2);\
372
	(destroyer_)(x162_, (unsigned)4);\
2 7u83 373
    }
374
 
375
#ifdef calculus_IO_ROUTINES
376
 
7 7u83 377
#define NEW_ALIAS_type_ptr(P, N)\
2 7u83 378
    {\
7 7u83 379
	calculus *x163_ = GEN_calculus(4, TYPEID_list);\
380
	unsigned a163_ = (N);\
381
	x163_->ag_tag = 5;\
382
	x163_[3].ag_tag = a163_;\
383
	set_calculus_alias(x163_ + 3, a163_);\
384
	(P) = x163_;\
2 7u83 385
    }
386
 
7 7u83 387
#define GET_ALIAS_type_ptr(P)		((CHECK_NULL(P) + 3)->ag_tag)
388
#define SET_ALIAS_type_ptr(P, N)	set_calculus_alias(CHECK_NULL(P) + 3, (N))
389
#define FIND_ALIAS_type_ptr(N)		(find_calculus_alias(N) - 3)
2 7u83 390
 
391
#endif
392
 
393
 
394
/* Operations for field list of union TYPE */
395
 
7 7u83 396
#define type_list_tag			((unsigned)6)
397
#define IS_type_list(P)			(CHECK_NULL(P)->ag_tag == 6)
2 7u83 398
 
7 7u83 399
#define type_list_sub(P)		(CHECK_TAG((P), 6) + 2)
2 7u83 400
 
7 7u83 401
#define MAKE_type_list(size_, sub_, calculus_type)\
2 7u83 402
    {\
7 7u83 403
	calculus *x164_ = GEN_calculus(4, TYPEID_type);\
404
	x164_->ag_tag = 6;\
405
	COPY_int(x164_ + 1, (size_));\
406
	COPY_ptr(x164_ + 2, (sub_));\
407
	x164_[3].ag_tag = 0;\
408
	(calculus_type) = x164_;\
2 7u83 409
    }
410
 
7 7u83 411
#define DECONS_type_list(size_, sub_, calculus_type)\
2 7u83 412
    {\
7 7u83 413
	calculus *x165_ = CHECK_TAG((calculus_type), 6);\
414
	(size_) = DEREF_int(x165_ + 1);\
415
	(sub_) = DEREF_ptr(x165_ + 2);\
2 7u83 416
    }
417
 
7 7u83 418
#define DESTROY_type_list(destroyer_, size_, sub_, calculus_type)\
2 7u83 419
    {\
7 7u83 420
	calculus *x166_ = CHECK_TAG((calculus_type), 6);\
421
	(size_) = DEREF_int(x166_ + 1);\
422
	(sub_) = DEREF_ptr(x166_ + 2);\
423
	(destroyer_)(x166_, (unsigned)4);\
2 7u83 424
    }
425
 
426
#ifdef calculus_IO_ROUTINES
427
 
7 7u83 428
#define NEW_ALIAS_type_list(P, N)\
2 7u83 429
    {\
7 7u83 430
	calculus *x167_ = GEN_calculus(4, TYPEID_list);\
431
	unsigned a167_ = (N);\
432
	x167_->ag_tag = 6;\
433
	x167_[3].ag_tag = a167_;\
434
	set_calculus_alias(x167_ + 3, a167_);\
435
	(P) = x167_;\
2 7u83 436
    }
437
 
7 7u83 438
#define GET_ALIAS_type_list(P)		((CHECK_NULL(P) + 3)->ag_tag)
439
#define SET_ALIAS_type_list(P, N)	set_calculus_alias(CHECK_NULL(P) + 3, (N))
440
#define FIND_ALIAS_type_list(N)		(find_calculus_alias(N) - 3)
2 7u83 441
 
442
#endif
443
 
444
 
445
/* Operations for field stack of union TYPE */
446
 
7 7u83 447
#define type_stack_tag			((unsigned)7)
448
#define IS_type_stack(P)		(CHECK_NULL(P)->ag_tag == 7)
2 7u83 449
 
7 7u83 450
#define type_stack_sub(P)		(CHECK_TAG((P), 7) + 2)
2 7u83 451
 
7 7u83 452
#define MAKE_type_stack(size_, sub_, calculus_type)\
2 7u83 453
    {\
7 7u83 454
	calculus *x168_ = GEN_calculus(4, TYPEID_type);\
455
	x168_->ag_tag = 7;\
456
	COPY_int(x168_ + 1, (size_));\
457
	COPY_ptr(x168_ + 2, (sub_));\
458
	x168_[3].ag_tag = 0;\
459
	(calculus_type) = x168_;\
2 7u83 460
    }
461
 
7 7u83 462
#define DECONS_type_stack(size_, sub_, calculus_type)\
2 7u83 463
    {\
7 7u83 464
	calculus *x169_ = CHECK_TAG((calculus_type), 7);\
465
	(size_) = DEREF_int(x169_ + 1);\
466
	(sub_) = DEREF_ptr(x169_ + 2);\
2 7u83 467
    }
468
 
7 7u83 469
#define DESTROY_type_stack(destroyer_, size_, sub_, calculus_type)\
2 7u83 470
    {\
7 7u83 471
	calculus *x170_ = CHECK_TAG((calculus_type), 7);\
472
	(size_) = DEREF_int(x170_ + 1);\
473
	(sub_) = DEREF_ptr(x170_ + 2);\
474
	(destroyer_)(x170_, (unsigned)4);\
2 7u83 475
    }
476
 
477
#ifdef calculus_IO_ROUTINES
478
 
7 7u83 479
#define NEW_ALIAS_type_stack(P, N)\
2 7u83 480
    {\
7 7u83 481
	calculus *x171_ = GEN_calculus(4, TYPEID_list);\
482
	unsigned a171_ = (N);\
483
	x171_->ag_tag = 7;\
484
	x171_[3].ag_tag = a171_;\
485
	set_calculus_alias(x171_ + 3, a171_);\
486
	(P) = x171_;\
2 7u83 487
    }
488
 
7 7u83 489
#define GET_ALIAS_type_stack(P)		((CHECK_NULL(P) + 3)->ag_tag)
490
#define SET_ALIAS_type_stack(P, N)	set_calculus_alias(CHECK_NULL(P) + 3, (N))
491
#define FIND_ALIAS_type_stack(N)	(find_calculus_alias(N) - 3)
2 7u83 492
 
493
#endif
494
 
495
 
496
/* Operations for field vec of union TYPE */
497
 
7 7u83 498
#define type_vec_tag			((unsigned)8)
499
#define IS_type_vec(P)			(CHECK_NULL(P)->ag_tag == 8)
2 7u83 500
 
7 7u83 501
#define type_vec_sub(P)			(CHECK_TAG((P), 8) + 2)
2 7u83 502
 
7 7u83 503
#define MAKE_type_vec(size_, sub_, calculus_type)\
2 7u83 504
    {\
7 7u83 505
	calculus *x172_ = GEN_calculus(4, TYPEID_type);\
506
	x172_->ag_tag = 8;\
507
	COPY_int(x172_ + 1, (size_));\
508
	COPY_ptr(x172_ + 2, (sub_));\
509
	x172_[3].ag_tag = 0;\
510
	(calculus_type) = x172_;\
2 7u83 511
    }
512
 
7 7u83 513
#define DECONS_type_vec(size_, sub_, calculus_type)\
2 7u83 514
    {\
7 7u83 515
	calculus *x173_ = CHECK_TAG((calculus_type), 8);\
516
	(size_) = DEREF_int(x173_ + 1);\
517
	(sub_) = DEREF_ptr(x173_ + 2);\
2 7u83 518
    }
519
 
7 7u83 520
#define DESTROY_type_vec(destroyer_, size_, sub_, calculus_type)\
2 7u83 521
    {\
7 7u83 522
	calculus *x174_ = CHECK_TAG((calculus_type), 8);\
523
	(size_) = DEREF_int(x174_ + 1);\
524
	(sub_) = DEREF_ptr(x174_ + 2);\
525
	(destroyer_)(x174_, (unsigned)4);\
2 7u83 526
    }
527
 
528
#ifdef calculus_IO_ROUTINES
529
 
7 7u83 530
#define NEW_ALIAS_type_vec(P, N)\
2 7u83 531
    {\
7 7u83 532
	calculus *x175_ = GEN_calculus(4, TYPEID_list);\
533
	unsigned a175_ = (N);\
534
	x175_->ag_tag = 8;\
535
	x175_[3].ag_tag = a175_;\
536
	set_calculus_alias(x175_ + 3, a175_);\
537
	(P) = x175_;\
2 7u83 538
    }
539
 
7 7u83 540
#define GET_ALIAS_type_vec(P)		((CHECK_NULL(P) + 3)->ag_tag)
541
#define SET_ALIAS_type_vec(P, N)	set_calculus_alias(CHECK_NULL(P) + 3, (N))
542
#define FIND_ALIAS_type_vec(N)		(find_calculus_alias(N) - 3)
2 7u83 543
 
544
#endif
545
 
546
 
547
/* Operations for field vec_ptr of union TYPE */
548
 
7 7u83 549
#define type_vec_ptr_tag		((unsigned)9)
550
#define IS_type_vec_ptr(P)		(CHECK_NULL(P)->ag_tag == 9)
2 7u83 551
 
7 7u83 552
#define type_vec_ptr_sub(P)		(CHECK_TAG((P), 9) + 2)
2 7u83 553
 
7 7u83 554
#define MAKE_type_vec_ptr(size_, sub_, calculus_type)\
2 7u83 555
    {\
7 7u83 556
	calculus *x176_ = GEN_calculus(4, TYPEID_type);\
557
	x176_->ag_tag = 9;\
558
	COPY_int(x176_ + 1, (size_));\
559
	COPY_ptr(x176_ + 2, (sub_));\
560
	x176_[3].ag_tag = 0;\
561
	(calculus_type) = x176_;\
2 7u83 562
    }
563
 
7 7u83 564
#define DECONS_type_vec_ptr(size_, sub_, calculus_type)\
2 7u83 565
    {\
7 7u83 566
	calculus *x177_ = CHECK_TAG((calculus_type), 9);\
567
	(size_) = DEREF_int(x177_ + 1);\
568
	(sub_) = DEREF_ptr(x177_ + 2);\
2 7u83 569
    }
570
 
7 7u83 571
#define DESTROY_type_vec_ptr(destroyer_, size_, sub_, calculus_type)\
2 7u83 572
    {\
7 7u83 573
	calculus *x178_ = CHECK_TAG((calculus_type), 9);\
574
	(size_) = DEREF_int(x178_ + 1);\
575
	(sub_) = DEREF_ptr(x178_ + 2);\
576
	(destroyer_)(x178_, (unsigned)4);\
2 7u83 577
    }
578
 
579
#ifdef calculus_IO_ROUTINES
580
 
7 7u83 581
#define NEW_ALIAS_type_vec_ptr(P, N)\
2 7u83 582
    {\
7 7u83 583
	calculus *x179_ = GEN_calculus(4, TYPEID_list);\
584
	unsigned a179_ = (N);\
585
	x179_->ag_tag = 9;\
586
	x179_[3].ag_tag = a179_;\
587
	set_calculus_alias(x179_ + 3, a179_);\
588
	(P) = x179_;\
2 7u83 589
    }
590
 
7 7u83 591
#define GET_ALIAS_type_vec_ptr(P)	((CHECK_NULL(P) + 3)->ag_tag)
592
#define SET_ALIAS_type_vec_ptr(P, N)	set_calculus_alias(CHECK_NULL(P) + 3, (N))
593
#define FIND_ALIAS_type_vec_ptr(N)	(find_calculus_alias(N) - 3)
2 7u83 594
 
595
#endif
596
 
597
 
598
/* Operations for field quote of union TYPE */
599
 
7 7u83 600
#define type_quote_tag			((unsigned)10)
601
#define IS_type_quote(P)		(CHECK_NULL(P)->ag_tag == 10)
2 7u83 602
 
7 7u83 603
#define type_quote_defn(P)		(CHECK_TAG((P), 10) + 2)
2 7u83 604
 
7 7u83 605
#define MAKE_type_quote(size_, defn_, calculus_type)\
2 7u83 606
    {\
7 7u83 607
	calculus *x180_ = GEN_calculus(3, TYPEID_type);\
608
	x180_->ag_tag = 10;\
609
	COPY_int(x180_ + 1, (size_));\
610
	COPY_string(x180_ + 2, (defn_));\
611
	(calculus_type) = x180_;\
2 7u83 612
    }
613
 
7 7u83 614
#define DECONS_type_quote(size_, defn_, calculus_type)\
2 7u83 615
    {\
7 7u83 616
	calculus *x181_ = CHECK_TAG((calculus_type), 10);\
617
	(size_) = DEREF_int(x181_ + 1);\
618
	(defn_) = DEREF_string(x181_ + 2);\
2 7u83 619
    }
620
 
7 7u83 621
#define DESTROY_type_quote(destroyer_, size_, defn_, calculus_type)\
2 7u83 622
    {\
7 7u83 623
	calculus *x182_ = CHECK_TAG((calculus_type), 10);\
624
	(size_) = DEREF_int(x182_ + 1);\
625
	(defn_) = DEREF_string(x182_ + 2);\
626
	(destroyer_)(x182_, (unsigned)3);\
2 7u83 627
    }
628
 
629
 
630
/* Operations for field undef of union TYPE */
631
 
7 7u83 632
#define type_undef_tag			((unsigned)11)
633
#define IS_type_undef(P)		(CHECK_NULL(P)->ag_tag == 11)
2 7u83 634
 
7 7u83 635
#define type_undef_name(P)		(CHECK_TAG((P), 11) + 2)
2 7u83 636
 
7 7u83 637
#define MAKE_type_undef(size_, name_, calculus_type)\
2 7u83 638
    {\
7 7u83 639
	calculus *x183_ = GEN_calculus(3, TYPEID_type);\
640
	x183_->ag_tag = 11;\
641
	COPY_int(x183_ + 1, (size_));\
642
	COPY_string(x183_ + 2, (name_));\
643
	(calculus_type) = x183_;\
2 7u83 644
    }
645
 
7 7u83 646
#define DECONS_type_undef(size_, name_, calculus_type)\
2 7u83 647
    {\
7 7u83 648
	calculus *x184_ = CHECK_TAG((calculus_type), 11);\
649
	(size_) = DEREF_int(x184_ + 1);\
650
	(name_) = DEREF_string(x184_ + 2);\
2 7u83 651
    }
652
 
7 7u83 653
#define DESTROY_type_undef(destroyer_, size_, name_, calculus_type)\
2 7u83 654
    {\
7 7u83 655
	calculus *x185_ = CHECK_TAG((calculus_type), 11);\
656
	(size_) = DEREF_int(x185_ + 1);\
657
	(name_) = DEREF_string(x185_ + 2);\
658
	(destroyer_)(x185_, (unsigned)3);\
2 7u83 659
    }
660
 
661
 
662
#endif