Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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