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 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_, calculus_cmd )\
55
#define MAKE_cmd_simple(line_, text_, calculus_cmd)\
56
    {\
56
    {\
57
	calculus *x186_ = GEN_calculus ( 3, TYPEID_cmd ) ;\
57
	calculus *x186_ = GEN_calculus(3, TYPEID_cmd);\
58
	x186_->ag_tag = 0 ;\
58
	x186_->ag_tag = 0;\
59
	COPY_int ( x186_ + 1, ( line_ ) ) ;\
59
	COPY_int(x186_ + 1, (line_));\
60
	COPY_string ( x186_ + 2, ( text_ ) ) ;\
60
	COPY_string(x186_ + 2, (text_));\
61
	( calculus_cmd ) = x186_ ;\
61
	(calculus_cmd) = x186_;\
62
    }
62
    }
63
 
63
 
64
#define DECONS_cmd_simple( line_, text_, calculus_cmd )\
64
#define DECONS_cmd_simple(line_, text_, calculus_cmd)\
65
    {\
65
    {\
66
	calculus *x187_ = CHECK_TAG ( ( calculus_cmd ), 0 ) ;\
66
	calculus *x187_ = CHECK_TAG((calculus_cmd), 0);\
67
	( line_ ) = DEREF_int ( x187_ + 1 ) ;\
67
	(line_) = DEREF_int(x187_ + 1);\
68
	( text_ ) = DEREF_string ( x187_ + 2 ) ;\
68
	(text_) = DEREF_string(x187_ + 2);\
69
    }
69
    }
70
 
70
 
71
#define DESTROY_cmd_simple( destroyer_, line_, text_, calculus_cmd )\
71
#define DESTROY_cmd_simple(destroyer_, line_, text_, calculus_cmd)\
72
    {\
72
    {\
73
	calculus *x188_ = CHECK_TAG ( ( calculus_cmd ), 0 ) ;\
73
	calculus *x188_ = CHECK_TAG((calculus_cmd), 0);\
74
	( line_ ) = DEREF_int ( x188_ + 1 ) ;\
74
	(line_) = DEREF_int(x188_ + 1);\
75
	( text_ ) = DEREF_string ( x188_ + 2 ) ;\
75
	(text_) = DEREF_string(x188_ + 2);\
76
	( destroyer_ ) ( x188_, ( unsigned ) 3 ) ;\
76
	(destroyer_)(x188_, (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_, calculus_cmd )\
87
#define MAKE_cmd_compound(line_, seq_, calculus_cmd)\
88
    {\
88
    {\
89
	calculus *x189_ = GEN_calculus ( 3, TYPEID_cmd ) ;\
89
	calculus *x189_ = GEN_calculus(3, TYPEID_cmd);\
90
	x189_->ag_tag = 1 ;\
90
	x189_->ag_tag = 1;\
91
	COPY_int ( x189_ + 1, ( line_ ) ) ;\
91
	COPY_int(x189_ + 1, (line_));\
92
	COPY_list ( x189_ + 2, ( seq_ ) ) ;\
92
	COPY_list(x189_ + 2, (seq_));\
93
	( calculus_cmd ) = x189_ ;\
93
	(calculus_cmd) = x189_;\
94
    }
94
    }
95
 
95
 
96
#define DECONS_cmd_compound( line_, seq_, calculus_cmd )\
96
#define DECONS_cmd_compound(line_, seq_, calculus_cmd)\
97
    {\
97
    {\
98
	calculus *x190_ = CHECK_TAG ( ( calculus_cmd ), 1 ) ;\
98
	calculus *x190_ = CHECK_TAG((calculus_cmd), 1);\
99
	( line_ ) = DEREF_int ( x190_ + 1 ) ;\
99
	(line_) = DEREF_int(x190_ + 1);\
100
	( seq_ ) = DEREF_list ( x190_ + 2 ) ;\
100
	(seq_) = DEREF_list(x190_ + 2);\
101
    }
101
    }
102
 
102
 
103
#define DESTROY_cmd_compound( destroyer_, line_, seq_, calculus_cmd )\
103
#define DESTROY_cmd_compound(destroyer_, line_, seq_, calculus_cmd)\
104
    {\
104
    {\
105
	calculus *x191_ = CHECK_TAG ( ( calculus_cmd ), 1 ) ;\
105
	calculus *x191_ = CHECK_TAG((calculus_cmd), 1);\
106
	( line_ ) = DEREF_int ( x191_ + 1 ) ;\
106
	(line_) = DEREF_int(x191_ + 1);\
107
	( seq_ ) = DEREF_list ( x191_ + 2 ) ;\
107
	(seq_) = DEREF_list(x191_ + 2);\
108
	( destroyer_ ) ( x191_, ( unsigned ) 3 ) ;\
108
	(destroyer_)(x191_, (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_, calculus_cmd )\
120
#define MAKE_cmd_loop(line_, control_, body_, calculus_cmd)\
121
    {\
121
    {\
122
	calculus *x192_ = GEN_calculus ( 4, TYPEID_cmd ) ;\
122
	calculus *x192_ = GEN_calculus(4, TYPEID_cmd);\
123
	x192_->ag_tag = 2 ;\
123
	x192_->ag_tag = 2;\
124
	COPY_int ( x192_ + 1, ( line_ ) ) ;\
124
	COPY_int(x192_ + 1, (line_));\
125
	COPY_string ( x192_ + 2, ( control_ ) ) ;\
125
	COPY_string(x192_ + 2, (control_));\
126
	COPY_cmd ( x192_ + 3, ( body_ ) ) ;\
126
	COPY_cmd(x192_ + 3, (body_));\
127
	( calculus_cmd ) = x192_ ;\
127
	(calculus_cmd) = x192_;\
128
    }
128
    }
129
 
129
 
130
#define DECONS_cmd_loop( line_, control_, body_, calculus_cmd )\
130
#define DECONS_cmd_loop(line_, control_, body_, calculus_cmd)\
131
    {\
131
    {\
132
	calculus *x193_ = CHECK_TAG ( ( calculus_cmd ), 2 ) ;\
132
	calculus *x193_ = CHECK_TAG((calculus_cmd), 2);\
133
	( line_ ) = DEREF_int ( x193_ + 1 ) ;\
133
	(line_) = DEREF_int(x193_ + 1);\
134
	( control_ ) = DEREF_string ( x193_ + 2 ) ;\
134
	(control_) = DEREF_string(x193_ + 2);\
135
	( body_ ) = DEREF_cmd ( x193_ + 3 ) ;\
135
	(body_) = DEREF_cmd(x193_ + 3);\
136
    }
136
    }
137
 
137
 
138
#define DESTROY_cmd_loop( destroyer_, line_, control_, body_, calculus_cmd )\
138
#define DESTROY_cmd_loop(destroyer_, line_, control_, body_, calculus_cmd)\
139
    {\
139
    {\
140
	calculus *x194_ = CHECK_TAG ( ( calculus_cmd ), 2 ) ;\
140
	calculus *x194_ = CHECK_TAG((calculus_cmd), 2);\
141
	( line_ ) = DEREF_int ( x194_ + 1 ) ;\
141
	(line_) = DEREF_int(x194_ + 1);\
142
	( control_ ) = DEREF_string ( x194_ + 2 ) ;\
142
	(control_) = DEREF_string(x194_ + 2);\
143
	( body_ ) = DEREF_cmd ( x194_ + 3 ) ;\
143
	(body_) = DEREF_cmd(x194_ + 3);\
144
	( destroyer_ ) ( x194_, ( unsigned ) 4 ) ;\
144
	(destroyer_)(x194_, (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_, calculus_cmd )\
157
#define MAKE_cmd_cond(line_, control_, true_code_, false_code_, calculus_cmd)\
158
    {\
158
    {\
159
	calculus *x195_ = GEN_calculus ( 5, TYPEID_cmd ) ;\
159
	calculus *x195_ = GEN_calculus(5, TYPEID_cmd);\
160
	x195_->ag_tag = 3 ;\
160
	x195_->ag_tag = 3;\
161
	COPY_int ( x195_ + 1, ( line_ ) ) ;\
161
	COPY_int(x195_ + 1, (line_));\
162
	COPY_string ( x195_ + 2, ( control_ ) ) ;\
162
	COPY_string(x195_ + 2, (control_));\
163
	COPY_cmd ( x195_ + 3, ( true_code_ ) ) ;\
163
	COPY_cmd(x195_ + 3, (true_code_));\
164
	COPY_cmd ( x195_ + 4, ( false_code_ ) ) ;\
164
	COPY_cmd(x195_ + 4, (false_code_));\
165
	( calculus_cmd ) = x195_ ;\
165
	(calculus_cmd) = x195_;\
166
    }
166
    }
167
 
167
 
168
#define DECONS_cmd_cond( line_, control_, true_code_, false_code_, calculus_cmd )\
168
#define DECONS_cmd_cond(line_, control_, true_code_, false_code_, calculus_cmd)\
169
    {\
169
    {\
170
	calculus *x196_ = CHECK_TAG ( ( calculus_cmd ), 3 ) ;\
170
	calculus *x196_ = CHECK_TAG((calculus_cmd), 3);\
171
	( line_ ) = DEREF_int ( x196_ + 1 ) ;\
171
	(line_) = DEREF_int(x196_ + 1);\
172
	( control_ ) = DEREF_string ( x196_ + 2 ) ;\
172
	(control_) = DEREF_string(x196_ + 2);\
173
	( true_code_ ) = DEREF_cmd ( x196_ + 3 ) ;\
173
	(true_code_) = DEREF_cmd(x196_ + 3);\
174
	( false_code_ ) = DEREF_cmd ( x196_ + 4 ) ;\
174
	(false_code_) = DEREF_cmd(x196_ + 4);\
175
    }
175
    }
176
 
176
 
177
#define DESTROY_cmd_cond( destroyer_, line_, control_, true_code_, false_code_, calculus_cmd )\
177
#define DESTROY_cmd_cond(destroyer_, line_, control_, true_code_, false_code_, calculus_cmd)\
178
    {\
178
    {\
179
	calculus *x197_ = CHECK_TAG ( ( calculus_cmd ), 3 ) ;\
179
	calculus *x197_ = CHECK_TAG((calculus_cmd), 3);\
180
	( line_ ) = DEREF_int ( x197_ + 1 ) ;\
180
	(line_) = DEREF_int(x197_ + 1);\
181
	( control_ ) = DEREF_string ( x197_ + 2 ) ;\
181
	(control_) = DEREF_string(x197_ + 2);\
182
	( true_code_ ) = DEREF_cmd ( x197_ + 3 ) ;\
182
	(true_code_) = DEREF_cmd(x197_ + 3);\
183
	( false_code_ ) = DEREF_cmd ( x197_ + 4 ) ;\
183
	(false_code_) = DEREF_cmd(x197_ + 4);\
184
	( destroyer_ ) ( x197_, ( unsigned ) 5 ) ;\
184
	(destroyer_)(x197_, (unsigned)5);\
185
    }
185
    }
186
 
186
 
187
 
187
 
188
#endif
188
#endif