Mercurial > cpython-lru_cache-weakref
annotate Include/Python-ast.h @ 36035:4bfcd5dcd0bf legacy-trunk
added cElementTree tests
| author | Fredrik Lundh <fredrik@pythonware.com> |
|---|---|
| date | Thu, 15 Dec 2005 18:41:22 +0000 |
| parents | 52f1d57f237d |
| children | ea083efdc96c |
| rev | line source |
|---|---|
|
36003
52f1d57f237d
SF #1373150, diffs in working copy after a build
Neal Norwitz <nnorwitz@gmail.com>
parents:
35866
diff
changeset
|
1 /* File automatically generated by Parser/asdl_c.py */ |
| 35742 | 2 |
| 3 #include "asdl.h" | |
| 4 | |
| 5 typedef struct _mod *mod_ty; | |
| 6 | |
| 7 typedef struct _stmt *stmt_ty; | |
| 8 | |
| 9 typedef struct _expr *expr_ty; | |
| 10 | |
| 11 typedef enum _expr_context { Load=1, Store=2, Del=3, AugLoad=4, AugStore=5, | |
| 12 Param=6 } expr_context_ty; | |
| 13 | |
| 14 typedef struct _slice *slice_ty; | |
| 15 | |
| 16 typedef enum _boolop { And=1, Or=2 } boolop_ty; | |
| 17 | |
| 18 typedef enum _operator { Add=1, Sub=2, Mult=3, Div=4, Mod=5, Pow=6, LShift=7, | |
| 19 RShift=8, BitOr=9, BitXor=10, BitAnd=11, FloorDiv=12 } | |
| 20 operator_ty; | |
| 21 | |
| 22 typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; | |
| 23 | |
| 24 typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, | |
| 25 In=9, NotIn=10 } cmpop_ty; | |
| 26 | |
| 27 typedef struct _comprehension *comprehension_ty; | |
| 28 | |
| 29 typedef struct _excepthandler *excepthandler_ty; | |
| 30 | |
| 31 typedef struct _arguments *arguments_ty; | |
| 32 | |
| 33 typedef struct _keyword *keyword_ty; | |
| 34 | |
| 35 typedef struct _alias *alias_ty; | |
| 36 | |
|
35866
9f73dc0953d2
Whoops, checkin consistent versions of *all* files to stop polluting
Neal Norwitz <nnorwitz@gmail.com>
parents:
35862
diff
changeset
|
37 |
| 35742 | 38 struct _mod { |
| 39 enum { Module_kind=1, Interactive_kind=2, Expression_kind=3, | |
| 40 Suite_kind=4 } kind; | |
| 41 union { | |
| 42 struct { | |
| 43 asdl_seq *body; | |
| 44 } Module; | |
| 45 | |
| 46 struct { | |
| 47 asdl_seq *body; | |
| 48 } Interactive; | |
| 49 | |
| 50 struct { | |
| 51 expr_ty body; | |
| 52 } Expression; | |
| 53 | |
| 54 struct { | |
| 55 asdl_seq *body; | |
| 56 } Suite; | |
| 57 | |
| 58 } v; | |
| 59 }; | |
| 60 | |
| 61 struct _stmt { | |
| 62 enum { FunctionDef_kind=1, ClassDef_kind=2, Return_kind=3, | |
| 63 Delete_kind=4, Assign_kind=5, AugAssign_kind=6, Print_kind=7, | |
| 64 For_kind=8, While_kind=9, If_kind=10, Raise_kind=11, | |
| 65 TryExcept_kind=12, TryFinally_kind=13, Assert_kind=14, | |
| 66 Import_kind=15, ImportFrom_kind=16, Exec_kind=17, | |
| 67 Global_kind=18, Expr_kind=19, Pass_kind=20, Break_kind=21, | |
| 68 Continue_kind=22 } kind; | |
| 69 union { | |
| 70 struct { | |
| 71 identifier name; | |
| 72 arguments_ty args; | |
| 73 asdl_seq *body; | |
| 74 asdl_seq *decorators; | |
| 75 } FunctionDef; | |
| 76 | |
| 77 struct { | |
| 78 identifier name; | |
| 79 asdl_seq *bases; | |
| 80 asdl_seq *body; | |
| 81 } ClassDef; | |
| 82 | |
| 83 struct { | |
| 84 expr_ty value; | |
| 85 } Return; | |
| 86 | |
| 87 struct { | |
| 88 asdl_seq *targets; | |
| 89 } Delete; | |
| 90 | |
| 91 struct { | |
| 92 asdl_seq *targets; | |
| 93 expr_ty value; | |
| 94 } Assign; | |
| 95 | |
| 96 struct { | |
| 97 expr_ty target; | |
| 98 operator_ty op; | |
| 99 expr_ty value; | |
| 100 } AugAssign; | |
| 101 | |
| 102 struct { | |
| 103 expr_ty dest; | |
| 104 asdl_seq *values; | |
| 105 bool nl; | |
| 106 } Print; | |
| 107 | |
| 108 struct { | |
| 109 expr_ty target; | |
| 110 expr_ty iter; | |
| 111 asdl_seq *body; | |
| 112 asdl_seq *orelse; | |
| 113 } For; | |
| 114 | |
| 115 struct { | |
| 116 expr_ty test; | |
| 117 asdl_seq *body; | |
| 118 asdl_seq *orelse; | |
| 119 } While; | |
| 120 | |
| 121 struct { | |
| 122 expr_ty test; | |
| 123 asdl_seq *body; | |
| 124 asdl_seq *orelse; | |
| 125 } If; | |
| 126 | |
| 127 struct { | |
| 128 expr_ty type; | |
| 129 expr_ty inst; | |
| 130 expr_ty tback; | |
| 131 } Raise; | |
| 132 | |
| 133 struct { | |
| 134 asdl_seq *body; | |
| 135 asdl_seq *handlers; | |
| 136 asdl_seq *orelse; | |
| 137 } TryExcept; | |
| 138 | |
| 139 struct { | |
| 140 asdl_seq *body; | |
| 141 asdl_seq *finalbody; | |
| 142 } TryFinally; | |
| 143 | |
| 144 struct { | |
| 145 expr_ty test; | |
| 146 expr_ty msg; | |
| 147 } Assert; | |
| 148 | |
| 149 struct { | |
| 150 asdl_seq *names; | |
| 151 } Import; | |
| 152 | |
| 153 struct { | |
| 154 identifier module; | |
| 155 asdl_seq *names; | |
| 156 } ImportFrom; | |
| 157 | |
| 158 struct { | |
| 159 expr_ty body; | |
| 160 expr_ty globals; | |
| 161 expr_ty locals; | |
| 162 } Exec; | |
| 163 | |
| 164 struct { | |
| 165 asdl_seq *names; | |
| 166 } Global; | |
| 167 | |
| 168 struct { | |
| 169 expr_ty value; | |
| 170 } Expr; | |
| 171 | |
| 172 } v; | |
| 173 int lineno; | |
| 174 }; | |
| 175 | |
| 176 struct _expr { | |
| 177 enum { BoolOp_kind=1, BinOp_kind=2, UnaryOp_kind=3, Lambda_kind=4, | |
| 178 Dict_kind=5, ListComp_kind=6, GeneratorExp_kind=7, Yield_kind=8, | |
| 179 Compare_kind=9, Call_kind=10, Repr_kind=11, Num_kind=12, | |
| 180 Str_kind=13, Attribute_kind=14, Subscript_kind=15, Name_kind=16, | |
| 181 List_kind=17, Tuple_kind=18 } kind; | |
| 182 union { | |
| 183 struct { | |
| 184 boolop_ty op; | |
| 185 asdl_seq *values; | |
| 186 } BoolOp; | |
| 187 | |
| 188 struct { | |
| 189 expr_ty left; | |
| 190 operator_ty op; | |
| 191 expr_ty right; | |
| 192 } BinOp; | |
| 193 | |
| 194 struct { | |
| 195 unaryop_ty op; | |
| 196 expr_ty operand; | |
| 197 } UnaryOp; | |
| 198 | |
| 199 struct { | |
| 200 arguments_ty args; | |
| 201 expr_ty body; | |
| 202 } Lambda; | |
| 203 | |
| 204 struct { | |
| 205 asdl_seq *keys; | |
| 206 asdl_seq *values; | |
| 207 } Dict; | |
| 208 | |
| 209 struct { | |
| 210 expr_ty elt; | |
| 211 asdl_seq *generators; | |
| 212 } ListComp; | |
| 213 | |
| 214 struct { | |
| 215 expr_ty elt; | |
| 216 asdl_seq *generators; | |
| 217 } GeneratorExp; | |
| 218 | |
| 219 struct { | |
| 220 expr_ty value; | |
| 221 } Yield; | |
| 222 | |
| 223 struct { | |
| 224 expr_ty left; | |
| 225 asdl_seq *ops; | |
| 226 asdl_seq *comparators; | |
| 227 } Compare; | |
| 228 | |
| 229 struct { | |
| 230 expr_ty func; | |
| 231 asdl_seq *args; | |
| 232 asdl_seq *keywords; | |
| 233 expr_ty starargs; | |
| 234 expr_ty kwargs; | |
| 235 } Call; | |
| 236 | |
| 237 struct { | |
| 238 expr_ty value; | |
| 239 } Repr; | |
| 240 | |
| 241 struct { | |
| 242 object n; | |
| 243 } Num; | |
| 244 | |
| 245 struct { | |
| 246 string s; | |
| 247 } Str; | |
| 248 | |
| 249 struct { | |
| 250 expr_ty value; | |
| 251 identifier attr; | |
| 252 expr_context_ty ctx; | |
| 253 } Attribute; | |
| 254 | |
| 255 struct { | |
| 256 expr_ty value; | |
| 257 slice_ty slice; | |
| 258 expr_context_ty ctx; | |
| 259 } Subscript; | |
| 260 | |
| 261 struct { | |
| 262 identifier id; | |
| 263 expr_context_ty ctx; | |
| 264 } Name; | |
| 265 | |
| 266 struct { | |
| 267 asdl_seq *elts; | |
| 268 expr_context_ty ctx; | |
| 269 } List; | |
| 270 | |
| 271 struct { | |
| 272 asdl_seq *elts; | |
| 273 expr_context_ty ctx; | |
| 274 } Tuple; | |
| 275 | |
| 276 } v; | |
| 277 int lineno; | |
| 278 }; | |
| 279 | |
| 280 struct _slice { | |
| 281 enum { Ellipsis_kind=1, Slice_kind=2, ExtSlice_kind=3, Index_kind=4 } | |
| 282 kind; | |
| 283 union { | |
| 284 struct { | |
| 285 expr_ty lower; | |
| 286 expr_ty upper; | |
| 287 expr_ty step; | |
| 288 } Slice; | |
| 289 | |
| 290 struct { | |
| 291 asdl_seq *dims; | |
| 292 } ExtSlice; | |
| 293 | |
| 294 struct { | |
| 295 expr_ty value; | |
| 296 } Index; | |
| 297 | |
| 298 } v; | |
| 299 }; | |
| 300 | |
| 301 struct _comprehension { | |
| 302 expr_ty target; | |
| 303 expr_ty iter; | |
| 304 asdl_seq *ifs; | |
| 305 }; | |
| 306 | |
| 307 struct _excepthandler { | |
| 308 expr_ty type; | |
| 309 expr_ty name; | |
| 310 asdl_seq *body; | |
| 311 }; | |
| 312 | |
| 313 struct _arguments { | |
| 314 asdl_seq *args; | |
| 315 identifier vararg; | |
| 316 identifier kwarg; | |
| 317 asdl_seq *defaults; | |
| 318 }; | |
| 319 | |
| 320 struct _keyword { | |
| 321 identifier arg; | |
| 322 expr_ty value; | |
| 323 }; | |
| 324 | |
| 325 struct _alias { | |
| 326 identifier name; | |
| 327 identifier asname; | |
| 328 }; | |
| 329 | |
|
35866
9f73dc0953d2
Whoops, checkin consistent versions of *all* files to stop polluting
Neal Norwitz <nnorwitz@gmail.com>
parents:
35862
diff
changeset
|
330 |
| 35742 | 331 mod_ty Module(asdl_seq * body); |
| 332 mod_ty Interactive(asdl_seq * body); | |
| 333 mod_ty Expression(expr_ty body); | |
| 334 mod_ty Suite(asdl_seq * body); | |
| 335 stmt_ty FunctionDef(identifier name, arguments_ty args, asdl_seq * body, | |
| 336 asdl_seq * decorators, int lineno); | |
| 337 stmt_ty ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, int | |
| 338 lineno); | |
| 339 stmt_ty Return(expr_ty value, int lineno); | |
| 340 stmt_ty Delete(asdl_seq * targets, int lineno); | |
| 341 stmt_ty Assign(asdl_seq * targets, expr_ty value, int lineno); | |
| 342 stmt_ty AugAssign(expr_ty target, operator_ty op, expr_ty value, int lineno); | |
| 343 stmt_ty Print(expr_ty dest, asdl_seq * values, bool nl, int lineno); | |
| 344 stmt_ty For(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse, | |
| 345 int lineno); | |
| 346 stmt_ty While(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno); | |
| 347 stmt_ty If(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno); | |
| 348 stmt_ty Raise(expr_ty type, expr_ty inst, expr_ty tback, int lineno); | |
| 349 stmt_ty TryExcept(asdl_seq * body, asdl_seq * handlers, asdl_seq * orelse, int | |
| 350 lineno); | |
| 351 stmt_ty TryFinally(asdl_seq * body, asdl_seq * finalbody, int lineno); | |
| 352 stmt_ty Assert(expr_ty test, expr_ty msg, int lineno); | |
| 353 stmt_ty Import(asdl_seq * names, int lineno); | |
| 354 stmt_ty ImportFrom(identifier module, asdl_seq * names, int lineno); | |
| 355 stmt_ty Exec(expr_ty body, expr_ty globals, expr_ty locals, int lineno); | |
| 356 stmt_ty Global(asdl_seq * names, int lineno); | |
| 357 stmt_ty Expr(expr_ty value, int lineno); | |
| 358 stmt_ty Pass(int lineno); | |
| 359 stmt_ty Break(int lineno); | |
| 360 stmt_ty Continue(int lineno); | |
| 361 expr_ty BoolOp(boolop_ty op, asdl_seq * values, int lineno); | |
| 362 expr_ty BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno); | |
| 363 expr_ty UnaryOp(unaryop_ty op, expr_ty operand, int lineno); | |
| 364 expr_ty Lambda(arguments_ty args, expr_ty body, int lineno); | |
| 365 expr_ty Dict(asdl_seq * keys, asdl_seq * values, int lineno); | |
| 366 expr_ty ListComp(expr_ty elt, asdl_seq * generators, int lineno); | |
| 367 expr_ty GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno); | |
| 368 expr_ty Yield(expr_ty value, int lineno); | |
| 369 expr_ty Compare(expr_ty left, asdl_seq * ops, asdl_seq * comparators, int | |
| 370 lineno); | |
| 371 expr_ty Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, expr_ty | |
| 372 starargs, expr_ty kwargs, int lineno); | |
| 373 expr_ty Repr(expr_ty value, int lineno); | |
| 374 expr_ty Num(object n, int lineno); | |
| 375 expr_ty Str(string s, int lineno); | |
| 376 expr_ty Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int | |
| 377 lineno); | |
| 378 expr_ty Subscript(expr_ty value, slice_ty slice, expr_context_ty ctx, int | |
| 379 lineno); | |
| 380 expr_ty Name(identifier id, expr_context_ty ctx, int lineno); | |
| 381 expr_ty List(asdl_seq * elts, expr_context_ty ctx, int lineno); | |
| 382 expr_ty Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno); | |
| 383 slice_ty Ellipsis(void); | |
| 384 slice_ty Slice(expr_ty lower, expr_ty upper, expr_ty step); | |
| 385 slice_ty ExtSlice(asdl_seq * dims); | |
| 386 slice_ty Index(expr_ty value); | |
| 387 comprehension_ty comprehension(expr_ty target, expr_ty iter, asdl_seq * ifs); | |
| 388 excepthandler_ty excepthandler(expr_ty type, expr_ty name, asdl_seq * body); | |
| 389 arguments_ty arguments(asdl_seq * args, identifier vararg, identifier kwarg, | |
| 390 asdl_seq * defaults); | |
| 391 keyword_ty keyword(identifier arg, expr_ty value); | |
| 392 alias_ty alias(identifier name, identifier asname); | |
|
35866
9f73dc0953d2
Whoops, checkin consistent versions of *all* files to stop polluting
Neal Norwitz <nnorwitz@gmail.com>
parents:
35862
diff
changeset
|
393 |
| 35742 | 394 void free_mod(mod_ty); |
| 395 void free_stmt(stmt_ty); | |
| 396 void free_expr(expr_ty); | |
| 397 void free_expr_context(expr_context_ty); | |
| 398 void free_slice(slice_ty); | |
| 399 void free_boolop(boolop_ty); | |
| 400 void free_operator(operator_ty); | |
| 401 void free_unaryop(unaryop_ty); | |
| 402 void free_cmpop(cmpop_ty); | |
| 403 void free_comprehension(comprehension_ty); | |
| 404 void free_excepthandler(excepthandler_ty); | |
| 405 void free_arguments(arguments_ty); | |
| 406 void free_keyword(keyword_ty); | |
| 407 void free_alias(alias_ty); | |
|
35866
9f73dc0953d2
Whoops, checkin consistent versions of *all* files to stop polluting
Neal Norwitz <nnorwitz@gmail.com>
parents:
35862
diff
changeset
|
408 |
