comparison Python/Python-ast.c @ 36743:dbf9cc6c36eb legacy-trunk

Don't pollute namespace as bad as before. All the types are static now.
author Neal Norwitz <nnorwitz@gmail.com>
date Tue, 28 Feb 2006 22:47:29 +0000
parents bbf16fd024df
children 57322cb2ca11
comparison
equal deleted inserted replaced
36742:658f8ff2a442 36743:dbf9cc6c36eb
1 /* File automatically generated by Parser/asdl_c.py */ 1 /* File automatically generated by Parser/asdl_c.py */
2 2
3 #include "Python.h" 3 #include "Python.h"
4 #include "Python-ast.h" 4 #include "Python-ast.h"
5 5
6 PyTypeObject* AST_type; 6 static PyTypeObject* AST_type;
7 PyTypeObject *mod_type; 7 static PyTypeObject *mod_type;
8 static PyObject* ast2obj_mod(void*); 8 static PyObject* ast2obj_mod(void*);
9 PyTypeObject *Module_type; 9 static PyTypeObject *Module_type;
10 char *Module_fields[]={ 10 static char *Module_fields[]={
11 "body", 11 "body",
12 }; 12 };
13 PyTypeObject *Interactive_type; 13 static PyTypeObject *Interactive_type;
14 char *Interactive_fields[]={ 14 static char *Interactive_fields[]={
15 "body", 15 "body",
16 }; 16 };
17 PyTypeObject *Expression_type; 17 static PyTypeObject *Expression_type;
18 char *Expression_fields[]={ 18 static char *Expression_fields[]={
19 "body", 19 "body",
20 }; 20 };
21 PyTypeObject *Suite_type; 21 static PyTypeObject *Suite_type;
22 char *Suite_fields[]={ 22 static char *Suite_fields[]={
23 "body", 23 "body",
24 }; 24 };
25 PyTypeObject *stmt_type; 25 static PyTypeObject *stmt_type;
26 char *stmt_attributes[] = { 26 static char *stmt_attributes[] = {
27 "lineno", 27 "lineno",
28 }; 28 };
29 static PyObject* ast2obj_stmt(void*); 29 static PyObject* ast2obj_stmt(void*);
30 PyTypeObject *FunctionDef_type; 30 static PyTypeObject *FunctionDef_type;
31 char *FunctionDef_fields[]={ 31 static char *FunctionDef_fields[]={
32 "name", 32 "name",
33 "args", 33 "args",
34 "body", 34 "body",
35 "decorators", 35 "decorators",
36 }; 36 };
37 PyTypeObject *ClassDef_type; 37 static PyTypeObject *ClassDef_type;
38 char *ClassDef_fields[]={ 38 static char *ClassDef_fields[]={
39 "name", 39 "name",
40 "bases", 40 "bases",
41 "body", 41 "body",
42 }; 42 };
43 PyTypeObject *Return_type; 43 static PyTypeObject *Return_type;
44 char *Return_fields[]={ 44 static char *Return_fields[]={
45 "value", 45 "value",
46 }; 46 };
47 PyTypeObject *Delete_type; 47 static PyTypeObject *Delete_type;
48 char *Delete_fields[]={ 48 static char *Delete_fields[]={
49 "targets", 49 "targets",
50 }; 50 };
51 PyTypeObject *Assign_type; 51 static PyTypeObject *Assign_type;
52 char *Assign_fields[]={ 52 static char *Assign_fields[]={
53 "targets", 53 "targets",
54 "value", 54 "value",
55 }; 55 };
56 PyTypeObject *AugAssign_type; 56 static PyTypeObject *AugAssign_type;
57 char *AugAssign_fields[]={ 57 static char *AugAssign_fields[]={
58 "target", 58 "target",
59 "op", 59 "op",
60 "value", 60 "value",
61 }; 61 };
62 PyTypeObject *Print_type; 62 static PyTypeObject *Print_type;
63 char *Print_fields[]={ 63 static char *Print_fields[]={
64 "dest", 64 "dest",
65 "values", 65 "values",
66 "nl", 66 "nl",
67 }; 67 };
68 PyTypeObject *For_type; 68 static PyTypeObject *For_type;
69 char *For_fields[]={ 69 static char *For_fields[]={
70 "target", 70 "target",
71 "iter", 71 "iter",
72 "body", 72 "body",
73 "orelse", 73 "orelse",
74 }; 74 };
75 PyTypeObject *While_type; 75 static PyTypeObject *While_type;
76 char *While_fields[]={ 76 static char *While_fields[]={
77 "test", 77 "test",
78 "body", 78 "body",
79 "orelse", 79 "orelse",
80 }; 80 };
81 PyTypeObject *If_type; 81 static PyTypeObject *If_type;
82 char *If_fields[]={ 82 static char *If_fields[]={
83 "test", 83 "test",
84 "body", 84 "body",
85 "orelse", 85 "orelse",
86 }; 86 };
87 PyTypeObject *With_type; 87 static PyTypeObject *With_type;
88 char *With_fields[]={ 88 static char *With_fields[]={
89 "context_expr", 89 "context_expr",
90 "optional_vars", 90 "optional_vars",
91 "body", 91 "body",
92 }; 92 };
93 PyTypeObject *Raise_type; 93 static PyTypeObject *Raise_type;
94 char *Raise_fields[]={ 94 static char *Raise_fields[]={
95 "type", 95 "type",
96 "inst", 96 "inst",
97 "tback", 97 "tback",
98 }; 98 };
99 PyTypeObject *TryExcept_type; 99 static PyTypeObject *TryExcept_type;
100 char *TryExcept_fields[]={ 100 static char *TryExcept_fields[]={
101 "body", 101 "body",
102 "handlers", 102 "handlers",
103 "orelse", 103 "orelse",
104 }; 104 };
105 PyTypeObject *TryFinally_type; 105 static PyTypeObject *TryFinally_type;
106 char *TryFinally_fields[]={ 106 static char *TryFinally_fields[]={
107 "body", 107 "body",
108 "finalbody", 108 "finalbody",
109 }; 109 };
110 PyTypeObject *Assert_type; 110 static PyTypeObject *Assert_type;
111 char *Assert_fields[]={ 111 static char *Assert_fields[]={
112 "test", 112 "test",
113 "msg", 113 "msg",
114 }; 114 };
115 PyTypeObject *Import_type; 115 static PyTypeObject *Import_type;
116 char *Import_fields[]={ 116 static char *Import_fields[]={
117 "names", 117 "names",
118 }; 118 };
119 PyTypeObject *ImportFrom_type; 119 static PyTypeObject *ImportFrom_type;
120 char *ImportFrom_fields[]={ 120 static char *ImportFrom_fields[]={
121 "module", 121 "module",
122 "names", 122 "names",
123 "level", 123 "level",
124 }; 124 };
125 PyTypeObject *Exec_type; 125 static PyTypeObject *Exec_type;
126 char *Exec_fields[]={ 126 static char *Exec_fields[]={
127 "body", 127 "body",
128 "globals", 128 "globals",
129 "locals", 129 "locals",
130 }; 130 };
131 PyTypeObject *Global_type; 131 static PyTypeObject *Global_type;
132 char *Global_fields[]={ 132 static char *Global_fields[]={
133 "names", 133 "names",
134 }; 134 };
135 PyTypeObject *Expr_type; 135 static PyTypeObject *Expr_type;
136 char *Expr_fields[]={ 136 static char *Expr_fields[]={
137 "value", 137 "value",
138 }; 138 };
139 PyTypeObject *Pass_type; 139 static PyTypeObject *Pass_type;
140 PyTypeObject *Break_type; 140 static PyTypeObject *Break_type;
141 PyTypeObject *Continue_type; 141 static PyTypeObject *Continue_type;
142 PyTypeObject *expr_type; 142 static PyTypeObject *expr_type;
143 char *expr_attributes[] = { 143 static char *expr_attributes[] = {
144 "lineno", 144 "lineno",
145 }; 145 };
146 static PyObject* ast2obj_expr(void*); 146 static PyObject* ast2obj_expr(void*);
147 PyTypeObject *BoolOp_type; 147 static PyTypeObject *BoolOp_type;
148 char *BoolOp_fields[]={ 148 static char *BoolOp_fields[]={
149 "op", 149 "op",
150 "values", 150 "values",
151 }; 151 };
152 PyTypeObject *BinOp_type; 152 static PyTypeObject *BinOp_type;
153 char *BinOp_fields[]={ 153 static char *BinOp_fields[]={
154 "left", 154 "left",
155 "op", 155 "op",
156 "right", 156 "right",
157 }; 157 };
158 PyTypeObject *UnaryOp_type; 158 static PyTypeObject *UnaryOp_type;
159 char *UnaryOp_fields[]={ 159 static char *UnaryOp_fields[]={
160 "op", 160 "op",
161 "operand", 161 "operand",
162 }; 162 };
163 PyTypeObject *Lambda_type; 163 static PyTypeObject *Lambda_type;
164 char *Lambda_fields[]={ 164 static char *Lambda_fields[]={
165 "args", 165 "args",
166 "body", 166 "body",
167 }; 167 };
168 PyTypeObject *IfExp_type; 168 static PyTypeObject *IfExp_type;
169 char *IfExp_fields[]={ 169 static char *IfExp_fields[]={
170 "test", 170 "test",
171 "body", 171 "body",
172 "orelse", 172 "orelse",
173 }; 173 };
174 PyTypeObject *Dict_type; 174 static PyTypeObject *Dict_type;
175 char *Dict_fields[]={ 175 static char *Dict_fields[]={
176 "keys", 176 "keys",
177 "values", 177 "values",
178 }; 178 };
179 PyTypeObject *ListComp_type; 179 static PyTypeObject *ListComp_type;
180 char *ListComp_fields[]={ 180 static char *ListComp_fields[]={
181 "elt", 181 "elt",
182 "generators", 182 "generators",
183 }; 183 };
184 PyTypeObject *GeneratorExp_type; 184 static PyTypeObject *GeneratorExp_type;
185 char *GeneratorExp_fields[]={ 185 static char *GeneratorExp_fields[]={
186 "elt", 186 "elt",
187 "generators", 187 "generators",
188 }; 188 };
189 PyTypeObject *Yield_type; 189 static PyTypeObject *Yield_type;
190 char *Yield_fields[]={ 190 static char *Yield_fields[]={
191 "value", 191 "value",
192 }; 192 };
193 PyTypeObject *Compare_type; 193 static PyTypeObject *Compare_type;
194 char *Compare_fields[]={ 194 static char *Compare_fields[]={
195 "left", 195 "left",
196 "ops", 196 "ops",
197 "comparators", 197 "comparators",
198 }; 198 };
199 PyTypeObject *Call_type; 199 static PyTypeObject *Call_type;
200 char *Call_fields[]={ 200 static char *Call_fields[]={
201 "func", 201 "func",
202 "args", 202 "args",
203 "keywords", 203 "keywords",
204 "starargs", 204 "starargs",
205 "kwargs", 205 "kwargs",
206 }; 206 };
207 PyTypeObject *Repr_type; 207 static PyTypeObject *Repr_type;
208 char *Repr_fields[]={ 208 static char *Repr_fields[]={
209 "value", 209 "value",
210 }; 210 };
211 PyTypeObject *Num_type; 211 static PyTypeObject *Num_type;
212 char *Num_fields[]={ 212 static char *Num_fields[]={
213 "n", 213 "n",
214 }; 214 };
215 PyTypeObject *Str_type; 215 static PyTypeObject *Str_type;
216 char *Str_fields[]={ 216 static char *Str_fields[]={
217 "s", 217 "s",
218 }; 218 };
219 PyTypeObject *Attribute_type; 219 static PyTypeObject *Attribute_type;
220 char *Attribute_fields[]={ 220 static char *Attribute_fields[]={
221 "value", 221 "value",
222 "attr", 222 "attr",
223 "ctx", 223 "ctx",
224 }; 224 };
225 PyTypeObject *Subscript_type; 225 static PyTypeObject *Subscript_type;
226 char *Subscript_fields[]={ 226 static char *Subscript_fields[]={
227 "value", 227 "value",
228 "slice", 228 "slice",
229 "ctx", 229 "ctx",
230 }; 230 };
231 PyTypeObject *Name_type; 231 static PyTypeObject *Name_type;
232 char *Name_fields[]={ 232 static char *Name_fields[]={
233 "id", 233 "id",
234 "ctx", 234 "ctx",
235 }; 235 };
236 PyTypeObject *List_type; 236 static PyTypeObject *List_type;
237 char *List_fields[]={ 237 static char *List_fields[]={
238 "elts", 238 "elts",
239 "ctx", 239 "ctx",
240 }; 240 };
241 PyTypeObject *Tuple_type; 241 static PyTypeObject *Tuple_type;
242 char *Tuple_fields[]={ 242 static char *Tuple_fields[]={
243 "elts", 243 "elts",
244 "ctx", 244 "ctx",
245 }; 245 };
246 PyTypeObject *expr_context_type; 246 static PyTypeObject *expr_context_type;
247 static PyObject *Load_singleton, *Store_singleton, *Del_singleton, 247 static PyObject *Load_singleton, *Store_singleton, *Del_singleton,
248 *AugLoad_singleton, *AugStore_singleton, *Param_singleton; 248 *AugLoad_singleton, *AugStore_singleton, *Param_singleton;
249 static PyObject* ast2obj_expr_context(expr_context_ty); 249 static PyObject* ast2obj_expr_context(expr_context_ty);
250 PyTypeObject *Load_type; 250 static PyTypeObject *Load_type;
251 PyTypeObject *Store_type; 251 static PyTypeObject *Store_type;
252 PyTypeObject *Del_type; 252 static PyTypeObject *Del_type;
253 PyTypeObject *AugLoad_type; 253 static PyTypeObject *AugLoad_type;
254 PyTypeObject *AugStore_type; 254 static PyTypeObject *AugStore_type;
255 PyTypeObject *Param_type; 255 static PyTypeObject *Param_type;
256 PyTypeObject *slice_type; 256 static PyTypeObject *slice_type;
257 static PyObject* ast2obj_slice(void*); 257 static PyObject* ast2obj_slice(void*);
258 PyTypeObject *Ellipsis_type; 258 static PyTypeObject *Ellipsis_type;
259 PyTypeObject *Slice_type; 259 static PyTypeObject *Slice_type;
260 char *Slice_fields[]={ 260 static char *Slice_fields[]={
261 "lower", 261 "lower",
262 "upper", 262 "upper",
263 "step", 263 "step",
264 }; 264 };
265 PyTypeObject *ExtSlice_type; 265 static PyTypeObject *ExtSlice_type;
266 char *ExtSlice_fields[]={ 266 static char *ExtSlice_fields[]={
267 "dims", 267 "dims",
268 }; 268 };
269 PyTypeObject *Index_type; 269 static PyTypeObject *Index_type;
270 char *Index_fields[]={ 270 static char *Index_fields[]={
271 "value", 271 "value",
272 }; 272 };
273 PyTypeObject *boolop_type; 273 static PyTypeObject *boolop_type;
274 static PyObject *And_singleton, *Or_singleton; 274 static PyObject *And_singleton, *Or_singleton;
275 static PyObject* ast2obj_boolop(boolop_ty); 275 static PyObject* ast2obj_boolop(boolop_ty);
276 PyTypeObject *And_type; 276 static PyTypeObject *And_type;
277 PyTypeObject *Or_type; 277 static PyTypeObject *Or_type;
278 PyTypeObject *operator_type; 278 static PyTypeObject *operator_type;
279 static PyObject *Add_singleton, *Sub_singleton, *Mult_singleton, 279 static PyObject *Add_singleton, *Sub_singleton, *Mult_singleton,
280 *Div_singleton, *Mod_singleton, *Pow_singleton, *LShift_singleton, 280 *Div_singleton, *Mod_singleton, *Pow_singleton, *LShift_singleton,
281 *RShift_singleton, *BitOr_singleton, *BitXor_singleton, *BitAnd_singleton, 281 *RShift_singleton, *BitOr_singleton, *BitXor_singleton, *BitAnd_singleton,
282 *FloorDiv_singleton; 282 *FloorDiv_singleton;
283 static PyObject* ast2obj_operator(operator_ty); 283 static PyObject* ast2obj_operator(operator_ty);
284 PyTypeObject *Add_type; 284 static PyTypeObject *Add_type;
285 PyTypeObject *Sub_type; 285 static PyTypeObject *Sub_type;
286 PyTypeObject *Mult_type; 286 static PyTypeObject *Mult_type;
287 PyTypeObject *Div_type; 287 static PyTypeObject *Div_type;
288 PyTypeObject *Mod_type; 288 static PyTypeObject *Mod_type;
289 PyTypeObject *Pow_type; 289 static PyTypeObject *Pow_type;
290 PyTypeObject *LShift_type; 290 static PyTypeObject *LShift_type;
291 PyTypeObject *RShift_type; 291 static PyTypeObject *RShift_type;
292 PyTypeObject *BitOr_type; 292 static PyTypeObject *BitOr_type;
293 PyTypeObject *BitXor_type; 293 static PyTypeObject *BitXor_type;
294 PyTypeObject *BitAnd_type; 294 static PyTypeObject *BitAnd_type;
295 PyTypeObject *FloorDiv_type; 295 static PyTypeObject *FloorDiv_type;
296 PyTypeObject *unaryop_type; 296 static PyTypeObject *unaryop_type;
297 static PyObject *Invert_singleton, *Not_singleton, *UAdd_singleton, 297 static PyObject *Invert_singleton, *Not_singleton, *UAdd_singleton,
298 *USub_singleton; 298 *USub_singleton;
299 static PyObject* ast2obj_unaryop(unaryop_ty); 299 static PyObject* ast2obj_unaryop(unaryop_ty);
300 PyTypeObject *Invert_type; 300 static PyTypeObject *Invert_type;
301 PyTypeObject *Not_type; 301 static PyTypeObject *Not_type;
302 PyTypeObject *UAdd_type; 302 static PyTypeObject *UAdd_type;
303 PyTypeObject *USub_type; 303 static PyTypeObject *USub_type;
304 PyTypeObject *cmpop_type; 304 static PyTypeObject *cmpop_type;
305 static PyObject *Eq_singleton, *NotEq_singleton, *Lt_singleton, *LtE_singleton, 305 static PyObject *Eq_singleton, *NotEq_singleton, *Lt_singleton, *LtE_singleton,
306 *Gt_singleton, *GtE_singleton, *Is_singleton, *IsNot_singleton, *In_singleton, 306 *Gt_singleton, *GtE_singleton, *Is_singleton, *IsNot_singleton, *In_singleton,
307 *NotIn_singleton; 307 *NotIn_singleton;
308 static PyObject* ast2obj_cmpop(cmpop_ty); 308 static PyObject* ast2obj_cmpop(cmpop_ty);
309 PyTypeObject *Eq_type; 309 static PyTypeObject *Eq_type;
310 PyTypeObject *NotEq_type; 310 static PyTypeObject *NotEq_type;
311 PyTypeObject *Lt_type; 311 static PyTypeObject *Lt_type;
312 PyTypeObject *LtE_type; 312 static PyTypeObject *LtE_type;
313 PyTypeObject *Gt_type; 313 static PyTypeObject *Gt_type;
314 PyTypeObject *GtE_type; 314 static PyTypeObject *GtE_type;
315 PyTypeObject *Is_type; 315 static PyTypeObject *Is_type;
316 PyTypeObject *IsNot_type; 316 static PyTypeObject *IsNot_type;
317 PyTypeObject *In_type; 317 static PyTypeObject *In_type;
318 PyTypeObject *NotIn_type; 318 static PyTypeObject *NotIn_type;
319 PyTypeObject *comprehension_type; 319 static PyTypeObject *comprehension_type;
320 static PyObject* ast2obj_comprehension(void*); 320 static PyObject* ast2obj_comprehension(void*);
321 char *comprehension_fields[]={ 321 static char *comprehension_fields[]={
322 "target", 322 "target",
323 "iter", 323 "iter",
324 "ifs", 324 "ifs",
325 }; 325 };
326 PyTypeObject *excepthandler_type; 326 static PyTypeObject *excepthandler_type;
327 static PyObject* ast2obj_excepthandler(void*); 327 static PyObject* ast2obj_excepthandler(void*);
328 char *excepthandler_fields[]={ 328 static char *excepthandler_fields[]={
329 "type", 329 "type",
330 "name", 330 "name",
331 "body", 331 "body",
332 }; 332 };
333 PyTypeObject *arguments_type; 333 static PyTypeObject *arguments_type;
334 static PyObject* ast2obj_arguments(void*); 334 static PyObject* ast2obj_arguments(void*);
335 char *arguments_fields[]={ 335 static char *arguments_fields[]={
336 "args", 336 "args",
337 "vararg", 337 "vararg",
338 "kwarg", 338 "kwarg",
339 "defaults", 339 "defaults",
340 }; 340 };
341 PyTypeObject *keyword_type; 341 static PyTypeObject *keyword_type;
342 static PyObject* ast2obj_keyword(void*); 342 static PyObject* ast2obj_keyword(void*);
343 char *keyword_fields[]={ 343 static char *keyword_fields[]={
344 "arg", 344 "arg",
345 "value", 345 "value",
346 }; 346 };
347 PyTypeObject *alias_type; 347 static PyTypeObject *alias_type;
348 static PyObject* ast2obj_alias(void*); 348 static PyObject* ast2obj_alias(void*);
349 char *alias_fields[]={ 349 static char *alias_fields[]={
350 "name", 350 "name",
351 "asname", 351 "asname",
352 }; 352 };
353 353
354 354