Subversion Repositories tendra.SVN

Rev

Rev 5 | Details | Compare with Previous | 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 NAT_OPS_H_INCLUDED
36
#define NAT_OPS_H_INCLUDED
37
 
38
/* Operations for union NAT */
39
 
6 7u83 40
#define TAG_nat(P)			(CHECK_NULL(P)->ag_tag)
2 7u83 41
 
42
 
43
/* Operations for field small of union NAT */
44
 
6 7u83 45
#define nat_small_tag			((unsigned)0)
46
#define IS_nat_small(P)			(CHECK_NULL(P)->ag_tag == 0)
2 7u83 47
 
6 7u83 48
#define nat_small_value(P)		(CHECK_TAG((P), 0) + 1)
2 7u83 49
 
6 7u83 50
#define MAKE_nat_small(value_, c_class_nat)\
2 7u83 51
    {\
6 7u83 52
	c_class *x465_ = GEN_c_class(2, TYPEID_nat);\
53
	x465_->ag_tag = 0;\
54
	COPY_unsigned(x465_ + 1, (value_));\
55
	(c_class_nat) = x465_;\
2 7u83 56
    }
57
 
6 7u83 58
#define DECONS_nat_small(value_, c_class_nat)\
2 7u83 59
    {\
6 7u83 60
	c_class *x466_ = CHECK_TAG((c_class_nat), 0);\
61
	(value_) = DEREF_unsigned(x466_ + 1);\
2 7u83 62
    }
63
 
6 7u83 64
#define DESTROY_nat_small(destroyer_, value_, c_class_nat)\
2 7u83 65
    {\
6 7u83 66
	c_class *x467_ = CHECK_TAG((c_class_nat), 0);\
67
	(value_) = DEREF_unsigned(x467_ + 1);\
68
	(destroyer_)(x467_, (unsigned)2);\
2 7u83 69
    }
70
 
71
 
72
/* Operations for field large of union NAT */
73
 
6 7u83 74
#define nat_large_tag			((unsigned)1)
75
#define IS_nat_large(P)			(CHECK_NULL(P)->ag_tag == 1)
2 7u83 76
 
6 7u83 77
#define nat_large_values(P)		(CHECK_TAG((P), 1) + 1)
2 7u83 78
 
6 7u83 79
#define MAKE_nat_large(values_, c_class_nat)\
2 7u83 80
    {\
6 7u83 81
	c_class *x468_ = GEN_c_class(2, TYPEID_nat);\
82
	x468_->ag_tag = 1;\
83
	COPY_list(x468_ + 1, (values_));\
84
	(c_class_nat) = x468_;\
2 7u83 85
    }
86
 
6 7u83 87
#define DECONS_nat_large(values_, c_class_nat)\
2 7u83 88
    {\
6 7u83 89
	c_class *x469_ = CHECK_TAG((c_class_nat), 1);\
90
	(values_) = DEREF_list(x469_ + 1);\
2 7u83 91
    }
92
 
6 7u83 93
#define DESTROY_nat_large(destroyer_, values_, c_class_nat)\
2 7u83 94
    {\
6 7u83 95
	c_class *x470_ = CHECK_TAG((c_class_nat), 1);\
96
	(values_) = DEREF_list(x470_ + 1);\
97
	(destroyer_)(x470_, (unsigned)2);\
2 7u83 98
    }
99
 
100
 
101
/* Operations for field calc of union NAT */
102
 
6 7u83 103
#define nat_calc_tag			((unsigned)2)
104
#define IS_nat_calc(P)			(CHECK_NULL(P)->ag_tag == 2)
2 7u83 105
 
6 7u83 106
#define nat_calc_value(P)		(CHECK_TAG((P), 2) + 1)
107
#define nat_calc_tok(P)			(CHECK_TAG((P), 2) + 2)
2 7u83 108
 
6 7u83 109
#define MAKE_nat_calc(value_, c_class_nat)\
2 7u83 110
    {\
6 7u83 111
	c_class *x471_ = GEN_c_class(3, TYPEID_nat);\
112
	x471_->ag_tag = 2;\
113
	COPY_exp(x471_ + 1, (value_));\
114
	COPY_ulong(x471_ + 2, LINK_NONE);\
115
	(c_class_nat) = x471_;\
2 7u83 116
    }
117
 
6 7u83 118
#define DECONS_nat_calc(value_, tok_, c_class_nat)\
2 7u83 119
    {\
6 7u83 120
	c_class *x472_ = CHECK_TAG((c_class_nat), 2);\
121
	(value_) = DEREF_exp(x472_ + 1);\
122
	(tok_) = DEREF_ulong(x472_ + 2);\
2 7u83 123
    }
124
 
6 7u83 125
#define DESTROY_nat_calc(destroyer_, value_, tok_, c_class_nat)\
2 7u83 126
    {\
6 7u83 127
	c_class *x473_ = CHECK_TAG((c_class_nat), 2);\
128
	(value_) = DEREF_exp(x473_ + 1);\
129
	(tok_) = DEREF_ulong(x473_ + 2);\
130
	(destroyer_)(x473_, (unsigned)3);\
2 7u83 131
    }
132
 
133
 
134
/* Operations for field neg of union NAT */
135
 
6 7u83 136
#define nat_neg_tag			((unsigned)3)
137
#define IS_nat_neg(P)			(CHECK_NULL(P)->ag_tag == 3)
2 7u83 138
 
6 7u83 139
#define nat_neg_arg(P)			(CHECK_TAG((P), 3) + 1)
2 7u83 140
 
6 7u83 141
#define MAKE_nat_neg(arg_, c_class_nat)\
2 7u83 142
    {\
6 7u83 143
	c_class *x474_ = GEN_c_class(2, TYPEID_nat);\
144
	x474_->ag_tag = 3;\
145
	COPY_nat(x474_ + 1, (arg_));\
146
	(c_class_nat) = x474_;\
2 7u83 147
    }
148
 
6 7u83 149
#define DECONS_nat_neg(arg_, c_class_nat)\
2 7u83 150
    {\
6 7u83 151
	c_class *x475_ = CHECK_TAG((c_class_nat), 3);\
152
	(arg_) = DEREF_nat(x475_ + 1);\
2 7u83 153
    }
154
 
6 7u83 155
#define DESTROY_nat_neg(destroyer_, arg_, c_class_nat)\
2 7u83 156
    {\
6 7u83 157
	c_class *x476_ = CHECK_TAG((c_class_nat), 3);\
158
	(arg_) = DEREF_nat(x476_ + 1);\
159
	(destroyer_)(x476_, (unsigned)2);\
2 7u83 160
    }
161
 
162
 
163
/* Operations for field token of union NAT */
164
 
6 7u83 165
#define nat_token_tag			((unsigned)4)
166
#define IS_nat_token(P)			(CHECK_NULL(P)->ag_tag == 4)
2 7u83 167
 
6 7u83 168
#define nat_token_tok(P)		(CHECK_TAG((P), 4) + 1)
169
#define nat_token_args(P)		(CHECK_TAG((P), 4) + 2)
2 7u83 170
 
6 7u83 171
#define MAKE_nat_token(tok_, args_, c_class_nat)\
2 7u83 172
    {\
6 7u83 173
	c_class *x477_ = GEN_c_class(3, TYPEID_nat);\
174
	x477_->ag_tag = 4;\
175
	COPY_id(x477_ + 1, (tok_));\
176
	COPY_list(x477_ + 2, (args_));\
177
	(c_class_nat) = x477_;\
2 7u83 178
    }
179
 
6 7u83 180
#define DECONS_nat_token(tok_, args_, c_class_nat)\
2 7u83 181
    {\
6 7u83 182
	c_class *x478_ = CHECK_TAG((c_class_nat), 4);\
183
	(tok_) = DEREF_id(x478_ + 1);\
184
	(args_) = DEREF_list(x478_ + 2);\
2 7u83 185
    }
186
 
6 7u83 187
#define DESTROY_nat_token(destroyer_, tok_, args_, c_class_nat)\
2 7u83 188
    {\
6 7u83 189
	c_class *x479_ = CHECK_TAG((c_class_nat), 4);\
190
	(tok_) = DEREF_id(x479_ + 1);\
191
	(args_) = DEREF_list(x479_ + 2);\
192
	(destroyer_)(x479_, (unsigned)3);\
2 7u83 193
    }
194
 
195
 
196
#endif