Subversion Repositories tendra.SVN

Rev

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

Rev 5 Rev 6
Line 35... Line 35...
35
#ifndef CMD_OPS_H_INCLUDED
35
#ifndef CMD_OPS_H_INCLUDED
36
#define CMD_OPS_H_INCLUDED
36
#define CMD_OPS_H_INCLUDED
37
 
37
 
38
/* Operations for union COMMAND */
38
/* Operations for union COMMAND */
39
 
39
 
40
#define TAG_cmd( P )			( CHECK_NULL ( P )->ag_tag )
40
#define TAG_cmd(P)			(CHECK_NULL(P)->ag_tag)
41
 
41
 
42
 
42
 
43
/* Operations for component line of union COMMAND */
43
/* Operations for component line of union COMMAND */
44
 
44
 
45
#define cmd_line( P )			( CHECK_NULL ( P ) + 1 )
45
#define cmd_line(P)			(CHECK_NULL(P) + 1)
46
 
46
 
47
 
47
 
48
/* Operations for field simple of union COMMAND */
48
/* Operations for field simple of union COMMAND */
49
 
49
 
50
#define cmd_simple_tag			( ( unsigned ) 0 )
50
#define cmd_simple_tag			((unsigned)0)
51
#define IS_cmd_simple( P )		( CHECK_NULL ( P )->ag_tag == 0 )
51
#define IS_cmd_simple(P)		(CHECK_NULL(P)->ag_tag == 0)
52
 
52
 
53
#define cmd_simple_text( P )		( CHECK_TAG ( ( P ), 0 ) + 2 )
53
#define cmd_simple_text(P)		(CHECK_TAG((P), 0) + 2)
54
 
54
 
55
#define MAKE_cmd_simple( line_, text_, tdf_cmd )\
55
#define MAKE_cmd_simple(line_, text_, tdf_cmd)\
56
    {\
56
    {\
57
	tdf *x102_ = GEN_tdf ( 3, TYPEID_cmd ) ;\
57
	tdf *x102_ = GEN_tdf(3, TYPEID_cmd);\
58
	x102_->ag_tag = 0 ;\
58
	x102_->ag_tag = 0;\
59
	COPY_int ( x102_ + 1, ( line_ ) ) ;\
59
	COPY_int(x102_ + 1, (line_));\
60
	COPY_string ( x102_ + 2, ( text_ ) ) ;\
60
	COPY_string(x102_ + 2, (text_));\
61
	( tdf_cmd ) = x102_ ;\
61
	(tdf_cmd) = x102_;\
62
    }
62
    }
63
 
63
 
64
#define DECONS_cmd_simple( line_, text_, tdf_cmd )\
64
#define DECONS_cmd_simple(line_, text_, tdf_cmd)\
65
    {\
65
    {\
66
	tdf *x103_ = CHECK_TAG ( ( tdf_cmd ), 0 ) ;\
66
	tdf *x103_ = CHECK_TAG((tdf_cmd), 0);\
67
	( line_ ) = DEREF_int ( x103_ + 1 ) ;\
67
	(line_) = DEREF_int(x103_ + 1);\
68
	( text_ ) = DEREF_string ( x103_ + 2 ) ;\
68
	(text_) = DEREF_string(x103_ + 2);\
69
    }
69
    }
70
 
70
 
71
#define DESTROY_cmd_simple( destroyer_, line_, text_, tdf_cmd )\
71
#define DESTROY_cmd_simple(destroyer_, line_, text_, tdf_cmd)\
72
    {\
72
    {\
73
	tdf *x104_ = CHECK_TAG ( ( tdf_cmd ), 0 ) ;\
73
	tdf *x104_ = CHECK_TAG((tdf_cmd), 0);\
74
	( line_ ) = DEREF_int ( x104_ + 1 ) ;\
74
	(line_) = DEREF_int(x104_ + 1);\
75
	( text_ ) = DEREF_string ( x104_ + 2 ) ;\
75
	(text_) = DEREF_string(x104_ + 2);\
76
	( destroyer_ ) ( x104_, ( unsigned ) 3 ) ;\
76
	(destroyer_)(x104_, (unsigned)3);\
77
    }
77
    }
78
 
78
 
79
 
79
 
80
/* Operations for field compound of union COMMAND */
80
/* Operations for field compound of union COMMAND */
81
 
81
 
82
#define cmd_compound_tag		( ( unsigned ) 1 )
82
#define cmd_compound_tag		((unsigned)1)
83
#define IS_cmd_compound( P )		( CHECK_NULL ( P )->ag_tag == 1 )
83
#define IS_cmd_compound(P)		(CHECK_NULL(P)->ag_tag == 1)
84
 
84
 
85
#define cmd_compound_seq( P )		( CHECK_TAG ( ( P ), 1 ) + 2 )
85
#define cmd_compound_seq(P)		(CHECK_TAG((P), 1) + 2)
86
 
86
 
87
#define MAKE_cmd_compound( line_, seq_, tdf_cmd )\
87
#define MAKE_cmd_compound(line_, seq_, tdf_cmd)\
88
    {\
88
    {\
89
	tdf *x105_ = GEN_tdf ( 3, TYPEID_cmd ) ;\
89
	tdf *x105_ = GEN_tdf(3, TYPEID_cmd);\
90
	x105_->ag_tag = 1 ;\
90
	x105_->ag_tag = 1;\
91
	COPY_int ( x105_ + 1, ( line_ ) ) ;\
91
	COPY_int(x105_ + 1, (line_));\
92
	COPY_list ( x105_ + 2, ( seq_ ) ) ;\
92
	COPY_list(x105_ + 2, (seq_));\
93
	( tdf_cmd ) = x105_ ;\
93
	(tdf_cmd) = x105_;\
94
    }
94
    }
95
 
95
 
96
#define DECONS_cmd_compound( line_, seq_, tdf_cmd )\
96
#define DECONS_cmd_compound(line_, seq_, tdf_cmd)\
97
    {\
97
    {\
98
	tdf *x106_ = CHECK_TAG ( ( tdf_cmd ), 1 ) ;\
98
	tdf *x106_ = CHECK_TAG((tdf_cmd), 1);\
99
	( line_ ) = DEREF_int ( x106_ + 1 ) ;\
99
	(line_) = DEREF_int(x106_ + 1);\
100
	( seq_ ) = DEREF_list ( x106_ + 2 ) ;\
100
	(seq_) = DEREF_list(x106_ + 2);\
101
    }
101
    }
102
 
102
 
103
#define DESTROY_cmd_compound( destroyer_, line_, seq_, tdf_cmd )\
103
#define DESTROY_cmd_compound(destroyer_, line_, seq_, tdf_cmd)\
104
    {\
104
    {\
105
	tdf *x107_ = CHECK_TAG ( ( tdf_cmd ), 1 ) ;\
105
	tdf *x107_ = CHECK_TAG((tdf_cmd), 1);\
106
	( line_ ) = DEREF_int ( x107_ + 1 ) ;\
106
	(line_) = DEREF_int(x107_ + 1);\
107
	( seq_ ) = DEREF_list ( x107_ + 2 ) ;\
107
	(seq_) = DEREF_list(x107_ + 2);\
108
	( destroyer_ ) ( x107_, ( unsigned ) 3 ) ;\
108
	(destroyer_)(x107_, (unsigned)3);\
109
    }
109
    }
110
 
110
 
111
 
111
 
112
/* Operations for field loop of union COMMAND */
112
/* Operations for field loop of union COMMAND */
113
 
113
 
114
#define cmd_loop_tag			( ( unsigned ) 2 )
114
#define cmd_loop_tag			((unsigned)2)
115
#define IS_cmd_loop( P )		( CHECK_NULL ( P )->ag_tag == 2 )
115
#define IS_cmd_loop(P)			(CHECK_NULL(P)->ag_tag == 2)
116
 
116
 
117
#define cmd_loop_control( P )		( CHECK_TAG ( ( P ), 2 ) + 2 )
117
#define cmd_loop_control(P)		(CHECK_TAG((P), 2) + 2)
118
#define cmd_loop_body( P )		( CHECK_TAG ( ( P ), 2 ) + 3 )
118
#define cmd_loop_body(P)		(CHECK_TAG((P), 2) + 3)
119
 
119
 
120
#define MAKE_cmd_loop( line_, control_, body_, tdf_cmd )\
120
#define MAKE_cmd_loop(line_, control_, body_, tdf_cmd)\
121
    {\
121
    {\
122
	tdf *x108_ = GEN_tdf ( 4, TYPEID_cmd ) ;\
122
	tdf *x108_ = GEN_tdf(4, TYPEID_cmd);\
123
	x108_->ag_tag = 2 ;\
123
	x108_->ag_tag = 2;\
124
	COPY_int ( x108_ + 1, ( line_ ) ) ;\
124
	COPY_int(x108_ + 1, (line_));\
125
	COPY_string ( x108_ + 2, ( control_ ) ) ;\
125
	COPY_string(x108_ + 2, (control_));\
126
	COPY_cmd ( x108_ + 3, ( body_ ) ) ;\
126
	COPY_cmd(x108_ + 3, (body_));\
127
	( tdf_cmd ) = x108_ ;\
127
	(tdf_cmd) = x108_;\
128
    }
128
    }
129
 
129
 
130
#define DECONS_cmd_loop( line_, control_, body_, tdf_cmd )\
130
#define DECONS_cmd_loop(line_, control_, body_, tdf_cmd)\
131
    {\
131
    {\
132
	tdf *x109_ = CHECK_TAG ( ( tdf_cmd ), 2 ) ;\
132
	tdf *x109_ = CHECK_TAG((tdf_cmd), 2);\
133
	( line_ ) = DEREF_int ( x109_ + 1 ) ;\
133
	(line_) = DEREF_int(x109_ + 1);\
134
	( control_ ) = DEREF_string ( x109_ + 2 ) ;\
134
	(control_) = DEREF_string(x109_ + 2);\
135
	( body_ ) = DEREF_cmd ( x109_ + 3 ) ;\
135
	(body_) = DEREF_cmd(x109_ + 3);\
136
    }
136
    }
137
 
137
 
138
#define DESTROY_cmd_loop( destroyer_, line_, control_, body_, tdf_cmd )\
138
#define DESTROY_cmd_loop(destroyer_, line_, control_, body_, tdf_cmd)\
139
    {\
139
    {\
140
	tdf *x110_ = CHECK_TAG ( ( tdf_cmd ), 2 ) ;\
140
	tdf *x110_ = CHECK_TAG((tdf_cmd), 2);\
141
	( line_ ) = DEREF_int ( x110_ + 1 ) ;\
141
	(line_) = DEREF_int(x110_ + 1);\
142
	( control_ ) = DEREF_string ( x110_ + 2 ) ;\
142
	(control_) = DEREF_string(x110_ + 2);\
143
	( body_ ) = DEREF_cmd ( x110_ + 3 ) ;\
143
	(body_) = DEREF_cmd(x110_ + 3);\
144
	( destroyer_ ) ( x110_, ( unsigned ) 4 ) ;\
144
	(destroyer_)(x110_, (unsigned)4);\
145
    }
145
    }
146
 
146
 
147
 
147
 
148
/* Operations for field cond of union COMMAND */
148
/* Operations for field cond of union COMMAND */
149
 
149
 
150
#define cmd_cond_tag			( ( unsigned ) 3 )
150
#define cmd_cond_tag			((unsigned)3)
151
#define IS_cmd_cond( P )		( CHECK_NULL ( P )->ag_tag == 3 )
151
#define IS_cmd_cond(P)			(CHECK_NULL(P)->ag_tag == 3)
152
 
152
 
153
#define cmd_cond_control( P )		( CHECK_TAG ( ( P ), 3 ) + 2 )
153
#define cmd_cond_control(P)		(CHECK_TAG((P), 3) + 2)
154
#define cmd_cond_true_code( P )		( CHECK_TAG ( ( P ), 3 ) + 3 )
154
#define cmd_cond_true_code(P)		(CHECK_TAG((P), 3) + 3)
155
#define cmd_cond_false_code( P )	( CHECK_TAG ( ( P ), 3 ) + 4 )
155
#define cmd_cond_false_code(P)		(CHECK_TAG((P), 3) + 4)
156
 
156
 
157
#define MAKE_cmd_cond( line_, control_, true_code_, false_code_, tdf_cmd )\
157
#define MAKE_cmd_cond(line_, control_, true_code_, false_code_, tdf_cmd)\
158
    {\
158
    {\
159
	tdf *x111_ = GEN_tdf ( 5, TYPEID_cmd ) ;\
159
	tdf *x111_ = GEN_tdf(5, TYPEID_cmd);\
160
	x111_->ag_tag = 3 ;\
160
	x111_->ag_tag = 3;\
161
	COPY_int ( x111_ + 1, ( line_ ) ) ;\
161
	COPY_int(x111_ + 1, (line_));\
162
	COPY_string ( x111_ + 2, ( control_ ) ) ;\
162
	COPY_string(x111_ + 2, (control_));\
163
	COPY_cmd ( x111_ + 3, ( true_code_ ) ) ;\
163
	COPY_cmd(x111_ + 3, (true_code_));\
164
	COPY_cmd ( x111_ + 4, ( false_code_ ) ) ;\
164
	COPY_cmd(x111_ + 4, (false_code_));\
165
	( tdf_cmd ) = x111_ ;\
165
	(tdf_cmd) = x111_;\
166
    }
166
    }
167
 
167
 
168
#define DECONS_cmd_cond( line_, control_, true_code_, false_code_, tdf_cmd )\
168
#define DECONS_cmd_cond(line_, control_, true_code_, false_code_, tdf_cmd)\
169
    {\
169
    {\
170
	tdf *x112_ = CHECK_TAG ( ( tdf_cmd ), 3 ) ;\
170
	tdf *x112_ = CHECK_TAG((tdf_cmd), 3);\
171
	( line_ ) = DEREF_int ( x112_ + 1 ) ;\
171
	(line_) = DEREF_int(x112_ + 1);\
172
	( control_ ) = DEREF_string ( x112_ + 2 ) ;\
172
	(control_) = DEREF_string(x112_ + 2);\
173
	( true_code_ ) = DEREF_cmd ( x112_ + 3 ) ;\
173
	(true_code_) = DEREF_cmd(x112_ + 3);\
174
	( false_code_ ) = DEREF_cmd ( x112_ + 4 ) ;\
174
	(false_code_) = DEREF_cmd(x112_ + 4);\
175
    }
175
    }
176
 
176
 
177
#define DESTROY_cmd_cond( destroyer_, line_, control_, true_code_, false_code_, tdf_cmd )\
177
#define DESTROY_cmd_cond(destroyer_, line_, control_, true_code_, false_code_, tdf_cmd)\
178
    {\
178
    {\
179
	tdf *x113_ = CHECK_TAG ( ( tdf_cmd ), 3 ) ;\
179
	tdf *x113_ = CHECK_TAG((tdf_cmd), 3);\
180
	( line_ ) = DEREF_int ( x113_ + 1 ) ;\
180
	(line_) = DEREF_int(x113_ + 1);\
181
	( control_ ) = DEREF_string ( x113_ + 2 ) ;\
181
	(control_) = DEREF_string(x113_ + 2);\
182
	( true_code_ ) = DEREF_cmd ( x113_ + 3 ) ;\
182
	(true_code_) = DEREF_cmd(x113_ + 3);\
183
	( false_code_ ) = DEREF_cmd ( x113_ + 4 ) ;\
183
	(false_code_) = DEREF_cmd(x113_ + 4);\
184
	( destroyer_ ) ( x113_, ( unsigned ) 5 ) ;\
184
	(destroyer_)(x113_, (unsigned)5);\
185
    }
185
    }
186
 
186
 
187
 
187
 
188
/* Operations for field use of union COMMAND */
188
/* Operations for field use of union COMMAND */
189
 
189
 
190
#define cmd_use_tag			( ( unsigned ) 4 )
190
#define cmd_use_tag			((unsigned)4)
191
#define IS_cmd_use( P )			( CHECK_NULL ( P )->ag_tag == 4 )
191
#define IS_cmd_use(P)			(CHECK_NULL(P)->ag_tag == 4)
192
 
192
 
193
#define cmd_use_sort( P )		( CHECK_TAG ( ( P ), 4 ) + 2 )
193
#define cmd_use_sort(P)			(CHECK_TAG((P), 4) + 2)
194
#define cmd_use_cons( P )		( CHECK_TAG ( ( P ), 4 ) + 3 )
194
#define cmd_use_cons(P)			(CHECK_TAG((P), 4) + 3)
195
 
195
 
196
#define MAKE_cmd_use( line_, sort_, cons_, tdf_cmd )\
196
#define MAKE_cmd_use(line_, sort_, cons_, tdf_cmd)\
197
    {\
197
    {\
198
	tdf *x114_ = GEN_tdf ( 4, TYPEID_cmd ) ;\
198
	tdf *x114_ = GEN_tdf(4, TYPEID_cmd);\
199
	x114_->ag_tag = 4 ;\
199
	x114_->ag_tag = 4;\
200
	COPY_int ( x114_ + 1, ( line_ ) ) ;\
200
	COPY_int(x114_ + 1, (line_));\
201
	COPY_string ( x114_ + 2, ( sort_ ) ) ;\
201
	COPY_string(x114_ + 2, (sort_));\
202
	COPY_string ( x114_ + 3, ( cons_ ) ) ;\
202
	COPY_string(x114_ + 3, (cons_));\
203
	( tdf_cmd ) = x114_ ;\
203
	(tdf_cmd) = x114_;\
204
    }
204
    }
205
 
205
 
206
#define DECONS_cmd_use( line_, sort_, cons_, tdf_cmd )\
206
#define DECONS_cmd_use(line_, sort_, cons_, tdf_cmd)\
207
    {\
207
    {\
208
	tdf *x115_ = CHECK_TAG ( ( tdf_cmd ), 4 ) ;\
208
	tdf *x115_ = CHECK_TAG((tdf_cmd), 4);\
209
	( line_ ) = DEREF_int ( x115_ + 1 ) ;\
209
	(line_) = DEREF_int(x115_ + 1);\
210
	( sort_ ) = DEREF_string ( x115_ + 2 ) ;\
210
	(sort_) = DEREF_string(x115_ + 2);\
211
	( cons_ ) = DEREF_string ( x115_ + 3 ) ;\
211
	(cons_) = DEREF_string(x115_ + 3);\
212
    }
212
    }
213
 
213
 
214
#define DESTROY_cmd_use( destroyer_, line_, sort_, cons_, tdf_cmd )\
214
#define DESTROY_cmd_use(destroyer_, line_, sort_, cons_, tdf_cmd)\
215
    {\
215
    {\
216
	tdf *x116_ = CHECK_TAG ( ( tdf_cmd ), 4 ) ;\
216
	tdf *x116_ = CHECK_TAG((tdf_cmd), 4);\
217
	( line_ ) = DEREF_int ( x116_ + 1 ) ;\
217
	(line_) = DEREF_int(x116_ + 1);\
218
	( sort_ ) = DEREF_string ( x116_ + 2 ) ;\
218
	(sort_) = DEREF_string(x116_ + 2);\
219
	( cons_ ) = DEREF_string ( x116_ + 3 ) ;\
219
	(cons_) = DEREF_string(x116_ + 3);\
220
	( destroyer_ ) ( x116_, ( unsigned ) 4 ) ;\
220
	(destroyer_)(x116_, (unsigned)4);\
221
    }
221
    }
222
 
222
 
223
 
223
 
224
/* Operations for field special of union COMMAND */
224
/* Operations for field special of union COMMAND */
225
 
225
 
226
#define cmd_special_tag			( ( unsigned ) 5 )
226
#define cmd_special_tag			((unsigned)5)
227
#define IS_cmd_special( P )		( CHECK_NULL ( P )->ag_tag == 5 )
227
#define IS_cmd_special(P)		(CHECK_NULL(P)->ag_tag == 5)
228
 
228
 
229
#define cmd_special_sort( P )		( CHECK_TAG ( ( P ), 5 ) + 2 )
229
#define cmd_special_sort(P)		(CHECK_TAG((P), 5) + 2)
230
#define cmd_special_cons( P )		( CHECK_TAG ( ( P ), 5 ) + 3 )
230
#define cmd_special_cons(P)		(CHECK_TAG((P), 5) + 3)
231
 
231
 
232
#define MAKE_cmd_special( line_, sort_, cons_, tdf_cmd )\
232
#define MAKE_cmd_special(line_, sort_, cons_, tdf_cmd)\
233
    {\
233
    {\
234
	tdf *x117_ = GEN_tdf ( 4, TYPEID_cmd ) ;\
234
	tdf *x117_ = GEN_tdf(4, TYPEID_cmd);\
235
	x117_->ag_tag = 5 ;\
235
	x117_->ag_tag = 5;\
236
	COPY_int ( x117_ + 1, ( line_ ) ) ;\
236
	COPY_int(x117_ + 1, (line_));\
237
	COPY_string ( x117_ + 2, ( sort_ ) ) ;\
237
	COPY_string(x117_ + 2, (sort_));\
238
	COPY_string ( x117_ + 3, ( cons_ ) ) ;\
238
	COPY_string(x117_ + 3, (cons_));\
239
	( tdf_cmd ) = x117_ ;\
239
	(tdf_cmd) = x117_;\
240
    }
240
    }
241
 
241
 
242
#define DECONS_cmd_special( line_, sort_, cons_, tdf_cmd )\
242
#define DECONS_cmd_special(line_, sort_, cons_, tdf_cmd)\
243
    {\
243
    {\
244
	tdf *x118_ = CHECK_TAG ( ( tdf_cmd ), 5 ) ;\
244
	tdf *x118_ = CHECK_TAG((tdf_cmd), 5);\
245
	( line_ ) = DEREF_int ( x118_ + 1 ) ;\
245
	(line_) = DEREF_int(x118_ + 1);\
246
	( sort_ ) = DEREF_string ( x118_ + 2 ) ;\
246
	(sort_) = DEREF_string(x118_ + 2);\
247
	( cons_ ) = DEREF_string ( x118_ + 3 ) ;\
247
	(cons_) = DEREF_string(x118_ + 3);\
248
    }
248
    }
249
 
249
 
250
#define DESTROY_cmd_special( destroyer_, line_, sort_, cons_, tdf_cmd )\
250
#define DESTROY_cmd_special(destroyer_, line_, sort_, cons_, tdf_cmd)\
251
    {\
251
    {\
252
	tdf *x119_ = CHECK_TAG ( ( tdf_cmd ), 5 ) ;\
252
	tdf *x119_ = CHECK_TAG((tdf_cmd), 5);\
253
	( line_ ) = DEREF_int ( x119_ + 1 ) ;\
253
	(line_) = DEREF_int(x119_ + 1);\
254
	( sort_ ) = DEREF_string ( x119_ + 2 ) ;\
254
	(sort_) = DEREF_string(x119_ + 2);\
255
	( cons_ ) = DEREF_string ( x119_ + 3 ) ;\
255
	(cons_) = DEREF_string(x119_ + 3);\
256
	( destroyer_ ) ( x119_, ( unsigned ) 4 ) ;\
256
	(destroyer_)(x119_, (unsigned)4);\
257
    }
257
    }
258
 
258
 
259
 
259
 
260
#endif
260
#endif