Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997, 1998
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 c_class (VERSION 1.1)
32
    BY calculus (VERSION 1.2)
33
*/
34
 
35
#ifndef TOK_OPS_H_INCLUDED
36
#define TOK_OPS_H_INCLUDED
37
 
38
/* Operations for union TOKEN */
39
 
40
#define TAG_tok( P )			( CHECK_NULL ( P )->ag_tag )
41
 
42
 
43
/* Operations for field exp of union TOKEN */
44
 
45
#define tok_exp_tag			( ( unsigned ) 0 )
46
#define IS_tok_exp( P )			( CHECK_NULL ( P )->ag_tag == 0 )
47
 
48
#define tok_exp_type( P )		( CHECK_TAG ( ( P ), 0 ) + 1 )
49
#define tok_exp_constant( P )		( CHECK_TAG ( ( P ), 0 ) + 2 )
50
#define tok_exp_value( P )		( CHECK_TAG ( ( P ), 0 ) + 3 )
51
 
52
#define MAKE_tok_exp( type_, constant_, value_, c_class_tok )\
53
    {\
54
	c_class *x817_ = GEN_c_class ( 4, TYPEID_tok ) ;\
55
	x817_->ag_tag = 0 ;\
56
	COPY_type ( x817_ + 1, ( type_ ) ) ;\
57
	COPY_int ( x817_ + 2, ( constant_ ) ) ;\
58
	COPY_exp ( x817_ + 3, ( value_ ) ) ;\
59
	( c_class_tok ) = x817_ ;\
60
    }
61
 
62
#define DECONS_tok_exp( type_, constant_, value_, c_class_tok )\
63
    {\
64
	c_class *x818_ = CHECK_TAG ( ( c_class_tok ), 0 ) ;\
65
	( type_ ) = DEREF_type ( x818_ + 1 ) ;\
66
	( constant_ ) = DEREF_int ( x818_ + 2 ) ;\
67
	( value_ ) = DEREF_exp ( x818_ + 3 ) ;\
68
    }
69
 
70
#define DESTROY_tok_exp( destroyer_, type_, constant_, value_, c_class_tok )\
71
    {\
72
	c_class *x819_ = CHECK_TAG ( ( c_class_tok ), 0 ) ;\
73
	( type_ ) = DEREF_type ( x819_ + 1 ) ;\
74
	( constant_ ) = DEREF_int ( x819_ + 2 ) ;\
75
	( value_ ) = DEREF_exp ( x819_ + 3 ) ;\
76
	( destroyer_ ) ( x819_, ( unsigned ) 4 ) ;\
77
    }
78
 
79
 
80
/* Operations for field stmt of union TOKEN */
81
 
82
#define tok_stmt_tag			( ( unsigned ) 1 )
83
#define IS_tok_stmt( P )		( CHECK_NULL ( P )->ag_tag == 1 )
84
 
85
#define tok_stmt_value( P )		( CHECK_TAG ( ( P ), 1 ) + 1 )
86
 
87
#define MAKE_tok_stmt( value_, c_class_tok )\
88
    {\
89
	c_class *x820_ = GEN_c_class ( 2, TYPEID_tok ) ;\
90
	x820_->ag_tag = 1 ;\
91
	COPY_exp ( x820_ + 1, ( value_ ) ) ;\
92
	( c_class_tok ) = x820_ ;\
93
    }
94
 
95
#define DECONS_tok_stmt( value_, c_class_tok )\
96
    {\
97
	c_class *x821_ = CHECK_TAG ( ( c_class_tok ), 1 ) ;\
98
	( value_ ) = DEREF_exp ( x821_ + 1 ) ;\
99
    }
100
 
101
#define DESTROY_tok_stmt( destroyer_, value_, c_class_tok )\
102
    {\
103
	c_class *x822_ = CHECK_TAG ( ( c_class_tok ), 1 ) ;\
104
	( value_ ) = DEREF_exp ( x822_ + 1 ) ;\
105
	( destroyer_ ) ( x822_, ( unsigned ) 2 ) ;\
106
    }
107
 
108
 
109
/* Operations for field set nat_etc of union TOKEN */
110
 
111
#define tok_nat_etc_tag			( ( unsigned ) 4 )
112
#define IS_tok_nat_etc( P )		( ( unsigned ) ( CHECK_NULL ( P )->ag_tag - 2 ) < ( unsigned ) 2 )
113
 
114
#define tok_nat_etc_value( P )		( CHECK_TAG_ETC ( ( P ), 2, 4 ) + 1 )
115
 
116
#define MAKE_tok_nat_etc( tag, value_, c_class_tok )\
117
    {\
118
	c_class *x823_ = GEN_c_class ( 2, TYPEID_tok ) ;\
119
	x823_->ag_tag = ( tag ) ;\
120
	COPY_nat ( x823_ + 1, ( value_ ) ) ;\
121
	( c_class_tok ) = CHECK_TAG_ETC ( x823_, 2, 4 ) ;\
122
    }
123
 
124
#define MODIFY_tok_nat_etc( tag, c_class_tok )\
125
    {\
126
	c_class *x824_ = CHECK_TAG_ETC ( ( c_class_tok ), 2, 4 ) ;\
127
	x824_->ag_tag = ( tag ) ;\
128
	( void ) CHECK_TAG_ETC ( x824_, 2, 4 ) ;\
129
    }
130
 
131
#define DECONS_tok_nat_etc( value_, c_class_tok )\
132
    {\
133
	c_class *x825_ = CHECK_TAG_ETC ( ( c_class_tok ), 2, 4 ) ;\
134
	( value_ ) = DEREF_nat ( x825_ + 1 ) ;\
135
    }
136
 
137
#define DESTROY_tok_nat_etc( destroyer_, value_, c_class_tok )\
138
    {\
139
	c_class *x826_ = CHECK_TAG_ETC ( ( c_class_tok ), 2, 4 ) ;\
140
	( value_ ) = DEREF_nat ( x826_ + 1 ) ;\
141
	( destroyer_ ) ( x826_, ( unsigned ) 2 ) ;\
142
    }
143
 
144
 
145
/* Operations for field nat of union TOKEN */
146
 
147
#define tok_nat_tag			( ( unsigned ) 2 )
148
#define IS_tok_nat( P )			( CHECK_NULL ( P )->ag_tag == 2 )
149
 
150
#define tok_nat_value( P )		( CHECK_TAG ( ( P ), 2 ) + 1 )
151
 
152
#define MAKE_tok_nat( value_, c_class_tok )\
153
    {\
154
	c_class *x827_ = GEN_c_class ( 2, TYPEID_tok ) ;\
155
	x827_->ag_tag = 2 ;\
156
	COPY_nat ( x827_ + 1, ( value_ ) ) ;\
157
	( c_class_tok ) = x827_ ;\
158
    }
159
 
160
#define DECONS_tok_nat( value_, c_class_tok )\
161
    {\
162
	c_class *x828_ = CHECK_TAG ( ( c_class_tok ), 2 ) ;\
163
	( value_ ) = DEREF_nat ( x828_ + 1 ) ;\
164
    }
165
 
166
#define DESTROY_tok_nat( destroyer_, value_, c_class_tok )\
167
    {\
168
	c_class *x829_ = CHECK_TAG ( ( c_class_tok ), 2 ) ;\
169
	( value_ ) = DEREF_nat ( x829_ + 1 ) ;\
170
	( destroyer_ ) ( x829_, ( unsigned ) 2 ) ;\
171
    }
172
 
173
 
174
/* Operations for field snat of union TOKEN */
175
 
176
#define tok_snat_tag			( ( unsigned ) 3 )
177
#define IS_tok_snat( P )		( CHECK_NULL ( P )->ag_tag == 3 )
178
 
179
#define tok_snat_value( P )		( CHECK_TAG ( ( P ), 3 ) + 1 )
180
 
181
#define MAKE_tok_snat( value_, c_class_tok )\
182
    {\
183
	c_class *x830_ = GEN_c_class ( 2, TYPEID_tok ) ;\
184
	x830_->ag_tag = 3 ;\
185
	COPY_nat ( x830_ + 1, ( value_ ) ) ;\
186
	( c_class_tok ) = x830_ ;\
187
    }
188
 
189
#define DECONS_tok_snat( value_, c_class_tok )\
190
    {\
191
	c_class *x831_ = CHECK_TAG ( ( c_class_tok ), 3 ) ;\
192
	( value_ ) = DEREF_nat ( x831_ + 1 ) ;\
193
    }
194
 
195
#define DESTROY_tok_snat( destroyer_, value_, c_class_tok )\
196
    {\
197
	c_class *x832_ = CHECK_TAG ( ( c_class_tok ), 3 ) ;\
198
	( value_ ) = DEREF_nat ( x832_ + 1 ) ;\
199
	( destroyer_ ) ( x832_, ( unsigned ) 2 ) ;\
200
    }
201
 
202
 
203
/* Operations for field type of union TOKEN */
204
 
205
#define tok_type_tag			( ( unsigned ) 4 )
206
#define IS_tok_type( P )		( CHECK_NULL ( P )->ag_tag == 4 )
207
 
208
#define tok_type_kind( P )		( CHECK_TAG ( ( P ), 4 ) + 1 )
209
#define tok_type_value( P )		( CHECK_TAG ( ( P ), 4 ) + 2 )
210
#define tok_type_alt( P )		( CHECK_TAG ( ( P ), 4 ) + 3 )
211
 
212
#define MAKE_tok_type( kind_, value_, c_class_tok )\
213
    {\
214
	c_class *x833_ = GEN_c_class ( 4, TYPEID_tok ) ;\
215
	x833_->ag_tag = 4 ;\
216
	COPY_btype ( x833_ + 1, ( kind_ ) ) ;\
217
	COPY_type ( x833_ + 2, ( value_ ) ) ;\
218
	COPY_type ( x833_ + 3, NULL_type ) ;\
219
	( c_class_tok ) = x833_ ;\
220
    }
221
 
222
#define DECONS_tok_type( kind_, value_, alt_, c_class_tok )\
223
    {\
224
	c_class *x834_ = CHECK_TAG ( ( c_class_tok ), 4 ) ;\
225
	( kind_ ) = DEREF_btype ( x834_ + 1 ) ;\
226
	( value_ ) = DEREF_type ( x834_ + 2 ) ;\
227
	( alt_ ) = DEREF_type ( x834_ + 3 ) ;\
228
    }
229
 
230
#define DESTROY_tok_type( destroyer_, kind_, value_, alt_, c_class_tok )\
231
    {\
232
	c_class *x835_ = CHECK_TAG ( ( c_class_tok ), 4 ) ;\
233
	( kind_ ) = DEREF_btype ( x835_ + 1 ) ;\
234
	( value_ ) = DEREF_type ( x835_ + 2 ) ;\
235
	( alt_ ) = DEREF_type ( x835_ + 3 ) ;\
236
	( destroyer_ ) ( x835_, ( unsigned ) 4 ) ;\
237
    }
238
 
239
 
240
/* Operations for field func of union TOKEN */
241
 
242
#define tok_func_tag			( ( unsigned ) 5 )
243
#define IS_tok_func( P )		( CHECK_NULL ( P )->ag_tag == 5 )
244
 
245
#define tok_func_type( P )		( CHECK_TAG ( ( P ), 5 ) + 1 )
246
#define tok_func_defn( P )		( CHECK_TAG ( ( P ), 5 ) + 2 )
247
#define tok_func_proc( P )		( CHECK_TAG ( ( P ), 5 ) + 3 )
248
 
249
#define MAKE_tok_func( type_, c_class_tok )\
250
    {\
251
	c_class *x836_ = GEN_c_class ( 4, TYPEID_tok ) ;\
252
	x836_->ag_tag = 5 ;\
253
	COPY_type ( x836_ + 1, ( type_ ) ) ;\
254
	COPY_id ( x836_ + 2, NULL_id ) ;\
255
	COPY_tok ( x836_ + 3, NULL_tok ) ;\
256
	( c_class_tok ) = x836_ ;\
257
    }
258
 
259
#define DECONS_tok_func( type_, defn_, proc_, c_class_tok )\
260
    {\
261
	c_class *x837_ = CHECK_TAG ( ( c_class_tok ), 5 ) ;\
262
	( type_ ) = DEREF_type ( x837_ + 1 ) ;\
263
	( defn_ ) = DEREF_id ( x837_ + 2 ) ;\
264
	( proc_ ) = DEREF_tok ( x837_ + 3 ) ;\
265
    }
266
 
267
#define DESTROY_tok_func( destroyer_, type_, defn_, proc_, c_class_tok )\
268
    {\
269
	c_class *x838_ = CHECK_TAG ( ( c_class_tok ), 5 ) ;\
270
	( type_ ) = DEREF_type ( x838_ + 1 ) ;\
271
	( defn_ ) = DEREF_id ( x838_ + 2 ) ;\
272
	( proc_ ) = DEREF_tok ( x838_ + 3 ) ;\
273
	( destroyer_ ) ( x838_, ( unsigned ) 4 ) ;\
274
    }
275
 
276
 
277
/* Operations for field member of union TOKEN */
278
 
279
#define tok_member_tag			( ( unsigned ) 6 )
280
#define IS_tok_member( P )		( CHECK_NULL ( P )->ag_tag == 6 )
281
 
282
#define tok_member_of( P )		( CHECK_TAG ( ( P ), 6 ) + 1 )
283
#define tok_member_type( P )		( CHECK_TAG ( ( P ), 6 ) + 2 )
284
#define tok_member_value( P )		( CHECK_TAG ( ( P ), 6 ) + 3 )
285
 
286
#define MAKE_tok_member( of_, type_, value_, c_class_tok )\
287
    {\
288
	c_class *x839_ = GEN_c_class ( 4, TYPEID_tok ) ;\
289
	x839_->ag_tag = 6 ;\
290
	COPY_type ( x839_ + 1, ( of_ ) ) ;\
291
	COPY_type ( x839_ + 2, ( type_ ) ) ;\
292
	COPY_off ( x839_ + 3, ( value_ ) ) ;\
293
	( c_class_tok ) = x839_ ;\
294
    }
295
 
296
#define DECONS_tok_member( of_, type_, value_, c_class_tok )\
297
    {\
298
	c_class *x840_ = CHECK_TAG ( ( c_class_tok ), 6 ) ;\
299
	( of_ ) = DEREF_type ( x840_ + 1 ) ;\
300
	( type_ ) = DEREF_type ( x840_ + 2 ) ;\
301
	( value_ ) = DEREF_off ( x840_ + 3 ) ;\
302
    }
303
 
304
#define DESTROY_tok_member( destroyer_, of_, type_, value_, c_class_tok )\
305
    {\
306
	c_class *x841_ = CHECK_TAG ( ( c_class_tok ), 6 ) ;\
307
	( of_ ) = DEREF_type ( x841_ + 1 ) ;\
308
	( type_ ) = DEREF_type ( x841_ + 2 ) ;\
309
	( value_ ) = DEREF_off ( x841_ + 3 ) ;\
310
	( destroyer_ ) ( x841_, ( unsigned ) 4 ) ;\
311
    }
312
 
313
 
314
/* Operations for field class of union TOKEN */
315
 
316
#define tok_class_tag			( ( unsigned ) 7 )
317
#define IS_tok_class( P )		( CHECK_NULL ( P )->ag_tag == 7 )
318
 
319
#define tok_class_type( P )		( CHECK_TAG ( ( P ), 7 ) + 1 )
320
#define tok_class_value( P )		( CHECK_TAG ( ( P ), 7 ) + 2 )
321
#define tok_class_alt( P )		( CHECK_TAG ( ( P ), 7 ) + 3 )
322
 
323
#define MAKE_tok_class( type_, value_, c_class_tok )\
324
    {\
325
	c_class *x842_ = GEN_c_class ( 4, TYPEID_tok ) ;\
326
	x842_->ag_tag = 7 ;\
327
	COPY_type ( x842_ + 1, ( type_ ) ) ;\
328
	COPY_id ( x842_ + 2, ( value_ ) ) ;\
329
	COPY_type ( x842_ + 3, NULL_type ) ;\
330
	( c_class_tok ) = x842_ ;\
331
    }
332
 
333
#define DECONS_tok_class( type_, value_, alt_, c_class_tok )\
334
    {\
335
	c_class *x843_ = CHECK_TAG ( ( c_class_tok ), 7 ) ;\
336
	( type_ ) = DEREF_type ( x843_ + 1 ) ;\
337
	( value_ ) = DEREF_id ( x843_ + 2 ) ;\
338
	( alt_ ) = DEREF_type ( x843_ + 3 ) ;\
339
    }
340
 
341
#define DESTROY_tok_class( destroyer_, type_, value_, alt_, c_class_tok )\
342
    {\
343
	c_class *x844_ = CHECK_TAG ( ( c_class_tok ), 7 ) ;\
344
	( type_ ) = DEREF_type ( x844_ + 1 ) ;\
345
	( value_ ) = DEREF_id ( x844_ + 2 ) ;\
346
	( alt_ ) = DEREF_type ( x844_ + 3 ) ;\
347
	( destroyer_ ) ( x844_, ( unsigned ) 4 ) ;\
348
    }
349
 
350
 
351
/* Operations for field proc of union TOKEN */
352
 
353
#define tok_proc_tag			( ( unsigned ) 8 )
354
#define IS_tok_proc( P )		( CHECK_NULL ( P )->ag_tag == 8 )
355
 
356
#define tok_proc_res( P )		( CHECK_TAG ( ( P ), 8 ) + 1 )
357
#define tok_proc_pars( P )		( CHECK_TAG ( ( P ), 8 ) + 2 )
358
#define tok_proc_key( P )		( CHECK_TAG ( ( P ), 8 ) + 3 )
359
#define tok_proc_apps( P )		( CHECK_TAG ( ( P ), 8 ) + 4 )
360
#define tok_proc_bids( P )		( CHECK_TAG ( ( P ), 8 ) + 5 )
361
#define tok_proc_pids( P )		( CHECK_TAG ( ( P ), 8 ) + 6 )
362
 
363
#define MAKE_tok_proc( res_, pars_, key_, c_class_tok )\
364
    {\
365
	c_class *x845_ = GEN_c_class ( 7, TYPEID_tok ) ;\
366
	x845_->ag_tag = 8 ;\
367
	COPY_tok ( x845_ + 1, ( res_ ) ) ;\
368
	COPY_nspace ( x845_ + 2, ( pars_ ) ) ;\
369
	COPY_int ( x845_ + 3, ( key_ ) ) ;\
370
	COPY_inst ( x845_ + 4, NULL_inst ) ;\
371
	COPY_list ( x845_ + 5, NULL_list ( IDENTIFIER ) ) ;\
372
	COPY_list ( x845_ + 6, NULL_list ( IDENTIFIER ) ) ;\
373
	( c_class_tok ) = x845_ ;\
374
    }
375
 
376
#define DECONS_tok_proc( res_, pars_, key_, apps_, bids_, pids_, c_class_tok )\
377
    {\
378
	c_class *x846_ = CHECK_TAG ( ( c_class_tok ), 8 ) ;\
379
	( res_ ) = DEREF_tok ( x846_ + 1 ) ;\
380
	( pars_ ) = DEREF_nspace ( x846_ + 2 ) ;\
381
	( key_ ) = DEREF_int ( x846_ + 3 ) ;\
382
	( apps_ ) = DEREF_inst ( x846_ + 4 ) ;\
383
	( bids_ ) = DEREF_list ( x846_ + 5 ) ;\
384
	( pids_ ) = DEREF_list ( x846_ + 6 ) ;\
385
    }
386
 
387
#define DESTROY_tok_proc( destroyer_, res_, pars_, key_, apps_, bids_, pids_, c_class_tok )\
388
    {\
389
	c_class *x847_ = CHECK_TAG ( ( c_class_tok ), 8 ) ;\
390
	( res_ ) = DEREF_tok ( x847_ + 1 ) ;\
391
	( pars_ ) = DEREF_nspace ( x847_ + 2 ) ;\
392
	( key_ ) = DEREF_int ( x847_ + 3 ) ;\
393
	( apps_ ) = DEREF_inst ( x847_ + 4 ) ;\
394
	( bids_ ) = DEREF_list ( x847_ + 5 ) ;\
395
	( pids_ ) = DEREF_list ( x847_ + 6 ) ;\
396
	( destroyer_ ) ( x847_, ( unsigned ) 7 ) ;\
397
    }
398
 
399
 
400
/* Operations for field templ of union TOKEN */
401
 
402
#define tok_templ_tag			( ( unsigned ) 9 )
403
#define IS_tok_templ( P )		( CHECK_NULL ( P )->ag_tag == 9 )
404
 
405
#define tok_templ_usage( P )		( CHECK_TAG ( ( P ), 9 ) + 1 )
406
#define tok_templ_pars( P )		( CHECK_TAG ( ( P ), 9 ) + 2 )
407
#define tok_templ_apps( P )		( CHECK_TAG ( ( P ), 9 ) + 3 )
408
#define tok_templ_pids( P )		( CHECK_TAG ( ( P ), 9 ) + 4 )
409
#define tok_templ_dargs( P )		( CHECK_TAG ( ( P ), 9 ) + 5 )
410
 
411
#define MAKE_tok_templ( usage_, pars_, c_class_tok )\
412
    {\
413
	c_class *x848_ = GEN_c_class ( 6, TYPEID_tok ) ;\
414
	x848_->ag_tag = 9 ;\
415
	COPY_dspec ( x848_ + 1, ( usage_ ) ) ;\
416
	COPY_nspace ( x848_ + 2, ( pars_ ) ) ;\
417
	COPY_inst ( x848_ + 3, NULL_inst ) ;\
418
	COPY_list ( x848_ + 4, NULL_list ( IDENTIFIER ) ) ;\
419
	COPY_list ( x848_ + 5, NULL_list ( TOKEN ) ) ;\
420
	( c_class_tok ) = x848_ ;\
421
    }
422
 
423
#define DECONS_tok_templ( usage_, pars_, apps_, pids_, dargs_, c_class_tok )\
424
    {\
425
	c_class *x849_ = CHECK_TAG ( ( c_class_tok ), 9 ) ;\
426
	( usage_ ) = DEREF_dspec ( x849_ + 1 ) ;\
427
	( pars_ ) = DEREF_nspace ( x849_ + 2 ) ;\
428
	( apps_ ) = DEREF_inst ( x849_ + 3 ) ;\
429
	( pids_ ) = DEREF_list ( x849_ + 4 ) ;\
430
	( dargs_ ) = DEREF_list ( x849_ + 5 ) ;\
431
    }
432
 
433
#define DESTROY_tok_templ( destroyer_, usage_, pars_, apps_, pids_, dargs_, c_class_tok )\
434
    {\
435
	c_class *x850_ = CHECK_TAG ( ( c_class_tok ), 9 ) ;\
436
	( usage_ ) = DEREF_dspec ( x850_ + 1 ) ;\
437
	( pars_ ) = DEREF_nspace ( x850_ + 2 ) ;\
438
	( apps_ ) = DEREF_inst ( x850_ + 3 ) ;\
439
	( pids_ ) = DEREF_list ( x850_ + 4 ) ;\
440
	( dargs_ ) = DEREF_list ( x850_ + 5 ) ;\
441
	( destroyer_ ) ( x850_, ( unsigned ) 6 ) ;\
442
    }
443
 
444
 
445
#endif