1 /* File automatically generated by Parser/asdl_c.py. */ 2 3 #ifndef Py_PYTHON_AST_H 4 #define Py_PYTHON_AST_H 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 9 #ifndef Py_LIMITED_API 10 #include "asdl.h" 11 12 #undef Yield /* undefine macro conflicting with <winbase.h> */ 13 14 typedef struct _mod *mod_ty; 15 16 typedef struct _stmt *stmt_ty; 17 18 typedef struct _expr *expr_ty; 19 20 typedef enum _expr_context { Load=1, Store=2, Del=3 } expr_context_ty; 21 22 typedef enum _boolop { And=1, Or=2 } boolop_ty; 23 24 typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7, 25 LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12, 26 FloorDiv=13 } operator_ty; 27 28 typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; 29 30 typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, 31 In=9, NotIn=10 } cmpop_ty; 32 33 typedef struct _comprehension *comprehension_ty; 34 35 typedef struct _excepthandler *excepthandler_ty; 36 37 typedef struct _arguments *arguments_ty; 38 39 typedef struct _arg *arg_ty; 40 41 typedef struct _keyword *keyword_ty; 42 43 typedef struct _alias *alias_ty; 44 45 typedef struct _withitem *withitem_ty; 46 47 typedef struct _type_ignore *type_ignore_ty; 48 49 50 enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, 51 FunctionType_kind=4}; 52 struct _mod { 53 enum _mod_kind kind; 54 union { 55 struct { 56 asdl_seq *body; 57 asdl_seq *type_ignores; 58 } Module; 59 60 struct { 61 asdl_seq *body; 62 } Interactive; 63 64 struct { 65 expr_ty body; 66 } Expression; 67 68 struct { 69 asdl_seq *argtypes; 70 expr_ty returns; 71 } FunctionType; 72 73 } v; 74 }; 75 76 enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3, 77 Return_kind=4, Delete_kind=5, Assign_kind=6, 78 AugAssign_kind=7, AnnAssign_kind=8, For_kind=9, 79 AsyncFor_kind=10, While_kind=11, If_kind=12, With_kind=13, 80 AsyncWith_kind=14, Raise_kind=15, Try_kind=16, 81 Assert_kind=17, Import_kind=18, ImportFrom_kind=19, 82 Global_kind=20, Nonlocal_kind=21, Expr_kind=22, Pass_kind=23, 83 Break_kind=24, Continue_kind=25}; 84 struct _stmt { 85 enum _stmt_kind kind; 86 union { 87 struct { 88 identifier name; 89 arguments_ty args; 90 asdl_seq *body; 91 asdl_seq *decorator_list; 92 expr_ty returns; 93 string type_comment; 94 } FunctionDef; 95 96 struct { 97 identifier name; 98 arguments_ty args; 99 asdl_seq *body; 100 asdl_seq *decorator_list; 101 expr_ty returns; 102 string type_comment; 103 } AsyncFunctionDef; 104 105 struct { 106 identifier name; 107 asdl_seq *bases; 108 asdl_seq *keywords; 109 asdl_seq *body; 110 asdl_seq *decorator_list; 111 } ClassDef; 112 113 struct { 114 expr_ty value; 115 } Return; 116 117 struct { 118 asdl_seq *targets; 119 } Delete; 120 121 struct { 122 asdl_seq *targets; 123 expr_ty value; 124 string type_comment; 125 } Assign; 126 127 struct { 128 expr_ty target; 129 operator_ty op; 130 expr_ty value; 131 } AugAssign; 132 133 struct { 134 expr_ty target; 135 expr_ty annotation; 136 expr_ty value; 137 int simple; 138 } AnnAssign; 139 140 struct { 141 expr_ty target; 142 expr_ty iter; 143 asdl_seq *body; 144 asdl_seq *orelse; 145 string type_comment; 146 } For; 147 148 struct { 149 expr_ty target; 150 expr_ty iter; 151 asdl_seq *body; 152 asdl_seq *orelse; 153 string type_comment; 154 } AsyncFor; 155 156 struct { 157 expr_ty test; 158 asdl_seq *body; 159 asdl_seq *orelse; 160 } While; 161 162 struct { 163 expr_ty test; 164 asdl_seq *body; 165 asdl_seq *orelse; 166 } If; 167 168 struct { 169 asdl_seq *items; 170 asdl_seq *body; 171 string type_comment; 172 } With; 173 174 struct { 175 asdl_seq *items; 176 asdl_seq *body; 177 string type_comment; 178 } AsyncWith; 179 180 struct { 181 expr_ty exc; 182 expr_ty cause; 183 } Raise; 184 185 struct { 186 asdl_seq *body; 187 asdl_seq *handlers; 188 asdl_seq *orelse; 189 asdl_seq *finalbody; 190 } Try; 191 192 struct { 193 expr_ty test; 194 expr_ty msg; 195 } Assert; 196 197 struct { 198 asdl_seq *names; 199 } Import; 200 201 struct { 202 identifier module; 203 asdl_seq *names; 204 int level; 205 } ImportFrom; 206 207 struct { 208 asdl_seq *names; 209 } Global; 210 211 struct { 212 asdl_seq *names; 213 } Nonlocal; 214 215 struct { 216 expr_ty value; 217 } Expr; 218 219 } v; 220 int lineno; 221 int col_offset; 222 int end_lineno; 223 int end_col_offset; 224 }; 225 226 enum _expr_kind {BoolOp_kind=1, NamedExpr_kind=2, BinOp_kind=3, UnaryOp_kind=4, 227 Lambda_kind=5, IfExp_kind=6, Dict_kind=7, Set_kind=8, 228 ListComp_kind=9, SetComp_kind=10, DictComp_kind=11, 229 GeneratorExp_kind=12, Await_kind=13, Yield_kind=14, 230 YieldFrom_kind=15, Compare_kind=16, Call_kind=17, 231 FormattedValue_kind=18, JoinedStr_kind=19, Constant_kind=20, 232 Attribute_kind=21, Subscript_kind=22, Starred_kind=23, 233 Name_kind=24, List_kind=25, Tuple_kind=26, Slice_kind=27}; 234 struct _expr { 235 enum _expr_kind kind; 236 union { 237 struct { 238 boolop_ty op; 239 asdl_seq *values; 240 } BoolOp; 241 242 struct { 243 expr_ty target; 244 expr_ty value; 245 } NamedExpr; 246 247 struct { 248 expr_ty left; 249 operator_ty op; 250 expr_ty right; 251 } BinOp; 252 253 struct { 254 unaryop_ty op; 255 expr_ty operand; 256 } UnaryOp; 257 258 struct { 259 arguments_ty args; 260 expr_ty body; 261 } Lambda; 262 263 struct { 264 expr_ty test; 265 expr_ty body; 266 expr_ty orelse; 267 } IfExp; 268 269 struct { 270 asdl_seq *keys; 271 asdl_seq *values; 272 } Dict; 273 274 struct { 275 asdl_seq *elts; 276 } Set; 277 278 struct { 279 expr_ty elt; 280 asdl_seq *generators; 281 } ListComp; 282 283 struct { 284 expr_ty elt; 285 asdl_seq *generators; 286 } SetComp; 287 288 struct { 289 expr_ty key; 290 expr_ty value; 291 asdl_seq *generators; 292 } DictComp; 293 294 struct { 295 expr_ty elt; 296 asdl_seq *generators; 297 } GeneratorExp; 298 299 struct { 300 expr_ty value; 301 } Await; 302 303 struct { 304 expr_ty value; 305 } Yield; 306 307 struct { 308 expr_ty value; 309 } YieldFrom; 310 311 struct { 312 expr_ty left; 313 asdl_int_seq *ops; 314 asdl_seq *comparators; 315 } Compare; 316 317 struct { 318 expr_ty func; 319 asdl_seq *args; 320 asdl_seq *keywords; 321 } Call; 322 323 struct { 324 expr_ty value; 325 int conversion; 326 expr_ty format_spec; 327 } FormattedValue; 328 329 struct { 330 asdl_seq *values; 331 } JoinedStr; 332 333 struct { 334 constant value; 335 string kind; 336 } Constant; 337 338 struct { 339 expr_ty value; 340 identifier attr; 341 expr_context_ty ctx; 342 } Attribute; 343 344 struct { 345 expr_ty value; 346 expr_ty slice; 347 expr_context_ty ctx; 348 } Subscript; 349 350 struct { 351 expr_ty value; 352 expr_context_ty ctx; 353 } Starred; 354 355 struct { 356 identifier id; 357 expr_context_ty ctx; 358 } Name; 359 360 struct { 361 asdl_seq *elts; 362 expr_context_ty ctx; 363 } List; 364 365 struct { 366 asdl_seq *elts; 367 expr_context_ty ctx; 368 } Tuple; 369 370 struct { 371 expr_ty lower; 372 expr_ty upper; 373 expr_ty step; 374 } Slice; 375 376 } v; 377 int lineno; 378 int col_offset; 379 int end_lineno; 380 int end_col_offset; 381 }; 382 383 struct _comprehension { 384 expr_ty target; 385 expr_ty iter; 386 asdl_seq *ifs; 387 int is_async; 388 }; 389 390 enum _excepthandler_kind {ExceptHandler_kind=1}; 391 struct _excepthandler { 392 enum _excepthandler_kind kind; 393 union { 394 struct { 395 expr_ty type; 396 identifier name; 397 asdl_seq *body; 398 } ExceptHandler; 399 400 } v; 401 int lineno; 402 int col_offset; 403 int end_lineno; 404 int end_col_offset; 405 }; 406 407 struct _arguments { 408 asdl_seq *posonlyargs; 409 asdl_seq *args; 410 arg_ty vararg; 411 asdl_seq *kwonlyargs; 412 asdl_seq *kw_defaults; 413 arg_ty kwarg; 414 asdl_seq *defaults; 415 }; 416 417 struct _arg { 418 identifier arg; 419 expr_ty annotation; 420 string type_comment; 421 int lineno; 422 int col_offset; 423 int end_lineno; 424 int end_col_offset; 425 }; 426 427 struct _keyword { 428 identifier arg; 429 expr_ty value; 430 int lineno; 431 int col_offset; 432 int end_lineno; 433 int end_col_offset; 434 }; 435 436 struct _alias { 437 identifier name; 438 identifier asname; 439 }; 440 441 struct _withitem { 442 expr_ty context_expr; 443 expr_ty optional_vars; 444 }; 445 446 enum _type_ignore_kind {TypeIgnore_kind=1}; 447 struct _type_ignore { 448 enum _type_ignore_kind kind; 449 union { 450 struct { 451 int lineno; 452 string tag; 453 } TypeIgnore; 454 455 } v; 456 }; 457 458 459 // Note: these macros affect function definitions, not only call sites. 460 #define Module(a0, a1, a2) _Py_Module(a0, a1, a2) 461 mod_ty _Py_Module(asdl_seq * body, asdl_seq * type_ignores, PyArena *arena); 462 #define Interactive(a0, a1) _Py_Interactive(a0, a1) 463 mod_ty _Py_Interactive(asdl_seq * body, PyArena *arena); 464 #define Expression(a0, a1) _Py_Expression(a0, a1) 465 mod_ty _Py_Expression(expr_ty body, PyArena *arena); 466 #define FunctionType(a0, a1, a2) _Py_FunctionType(a0, a1, a2) 467 mod_ty _Py_FunctionType(asdl_seq * argtypes, expr_ty returns, PyArena *arena); 468 #define FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) 469 stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_seq * body, 470 asdl_seq * decorator_list, expr_ty returns, string 471 type_comment, int lineno, int col_offset, int 472 end_lineno, int end_col_offset, PyArena *arena); 473 #define AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) 474 stmt_ty _Py_AsyncFunctionDef(identifier name, arguments_ty args, asdl_seq * 475 body, asdl_seq * decorator_list, expr_ty returns, 476 string type_comment, int lineno, int col_offset, 477 int end_lineno, int end_col_offset, PyArena 478 *arena); 479 #define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) 480 stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords, 481 asdl_seq * body, asdl_seq * decorator_list, int lineno, 482 int col_offset, int end_lineno, int end_col_offset, 483 PyArena *arena); 484 #define Return(a0, a1, a2, a3, a4, a5) _Py_Return(a0, a1, a2, a3, a4, a5) 485 stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, int end_lineno, 486 int end_col_offset, PyArena *arena); 487 #define Delete(a0, a1, a2, a3, a4, a5) _Py_Delete(a0, a1, a2, a3, a4, a5) 488 stmt_ty _Py_Delete(asdl_seq * targets, int lineno, int col_offset, int 489 end_lineno, int end_col_offset, PyArena *arena); 490 #define Assign(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Assign(a0, a1, a2, a3, a4, a5, a6, a7) 491 stmt_ty _Py_Assign(asdl_seq * targets, expr_ty value, string type_comment, int 492 lineno, int col_offset, int end_lineno, int end_col_offset, 493 PyArena *arena); 494 #define AugAssign(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AugAssign(a0, a1, a2, a3, a4, a5, a6, a7) 495 stmt_ty _Py_AugAssign(expr_ty target, operator_ty op, expr_ty value, int 496 lineno, int col_offset, int end_lineno, int 497 end_col_offset, PyArena *arena); 498 #define AnnAssign(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_AnnAssign(a0, a1, a2, a3, a4, a5, a6, a7, a8) 499 stmt_ty _Py_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int 500 simple, int lineno, int col_offset, int end_lineno, int 501 end_col_offset, PyArena *arena); 502 #define For(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_For(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) 503 stmt_ty _Py_For(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * 504 orelse, string type_comment, int lineno, int col_offset, int 505 end_lineno, int end_col_offset, PyArena *arena); 506 #define AsyncFor(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_AsyncFor(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) 507 stmt_ty _Py_AsyncFor(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * 508 orelse, string type_comment, int lineno, int col_offset, 509 int end_lineno, int end_col_offset, PyArena *arena); 510 #define While(a0, a1, a2, a3, a4, a5, a6, a7) _Py_While(a0, a1, a2, a3, a4, a5, a6, a7) 511 stmt_ty _Py_While(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno, 512 int col_offset, int end_lineno, int end_col_offset, PyArena 513 *arena); 514 #define If(a0, a1, a2, a3, a4, a5, a6, a7) _Py_If(a0, a1, a2, a3, a4, a5, a6, a7) 515 stmt_ty _Py_If(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno, 516 int col_offset, int end_lineno, int end_col_offset, PyArena 517 *arena); 518 #define With(a0, a1, a2, a3, a4, a5, a6, a7) _Py_With(a0, a1, a2, a3, a4, a5, a6, a7) 519 stmt_ty _Py_With(asdl_seq * items, asdl_seq * body, string type_comment, int 520 lineno, int col_offset, int end_lineno, int end_col_offset, 521 PyArena *arena); 522 #define AsyncWith(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AsyncWith(a0, a1, a2, a3, a4, a5, a6, a7) 523 stmt_ty _Py_AsyncWith(asdl_seq * items, asdl_seq * body, string type_comment, 524 int lineno, int col_offset, int end_lineno, int 525 end_col_offset, PyArena *arena); 526 #define Raise(a0, a1, a2, a3, a4, a5, a6) _Py_Raise(a0, a1, a2, a3, a4, a5, a6) 527 stmt_ty _Py_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int 528 end_lineno, int end_col_offset, PyArena *arena); 529 #define Try(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_Try(a0, a1, a2, a3, a4, a5, a6, a7, a8) 530 stmt_ty _Py_Try(asdl_seq * body, asdl_seq * handlers, asdl_seq * orelse, 531 asdl_seq * finalbody, int lineno, int col_offset, int 532 end_lineno, int end_col_offset, PyArena *arena); 533 #define Assert(a0, a1, a2, a3, a4, a5, a6) _Py_Assert(a0, a1, a2, a3, a4, a5, a6) 534 stmt_ty _Py_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int 535 end_lineno, int end_col_offset, PyArena *arena); 536 #define Import(a0, a1, a2, a3, a4, a5) _Py_Import(a0, a1, a2, a3, a4, a5) 537 stmt_ty _Py_Import(asdl_seq * names, int lineno, int col_offset, int 538 end_lineno, int end_col_offset, PyArena *arena); 539 #define ImportFrom(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ImportFrom(a0, a1, a2, a3, a4, a5, a6, a7) 540 stmt_ty _Py_ImportFrom(identifier module, asdl_seq * names, int level, int 541 lineno, int col_offset, int end_lineno, int 542 end_col_offset, PyArena *arena); 543 #define Global(a0, a1, a2, a3, a4, a5) _Py_Global(a0, a1, a2, a3, a4, a5) 544 stmt_ty _Py_Global(asdl_seq * names, int lineno, int col_offset, int 545 end_lineno, int end_col_offset, PyArena *arena); 546 #define Nonlocal(a0, a1, a2, a3, a4, a5) _Py_Nonlocal(a0, a1, a2, a3, a4, a5) 547 stmt_ty _Py_Nonlocal(asdl_seq * names, int lineno, int col_offset, int 548 end_lineno, int end_col_offset, PyArena *arena); 549 #define Expr(a0, a1, a2, a3, a4, a5) _Py_Expr(a0, a1, a2, a3, a4, a5) 550 stmt_ty _Py_Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int 551 end_col_offset, PyArena *arena); 552 #define Pass(a0, a1, a2, a3, a4) _Py_Pass(a0, a1, a2, a3, a4) 553 stmt_ty _Py_Pass(int lineno, int col_offset, int end_lineno, int 554 end_col_offset, PyArena *arena); 555 #define Break(a0, a1, a2, a3, a4) _Py_Break(a0, a1, a2, a3, a4) 556 stmt_ty _Py_Break(int lineno, int col_offset, int end_lineno, int 557 end_col_offset, PyArena *arena); 558 #define Continue(a0, a1, a2, a3, a4) _Py_Continue(a0, a1, a2, a3, a4) 559 stmt_ty _Py_Continue(int lineno, int col_offset, int end_lineno, int 560 end_col_offset, PyArena *arena); 561 #define BoolOp(a0, a1, a2, a3, a4, a5, a6) _Py_BoolOp(a0, a1, a2, a3, a4, a5, a6) 562 expr_ty _Py_BoolOp(boolop_ty op, asdl_seq * values, int lineno, int col_offset, 563 int end_lineno, int end_col_offset, PyArena *arena); 564 #define NamedExpr(a0, a1, a2, a3, a4, a5, a6) _Py_NamedExpr(a0, a1, a2, a3, a4, a5, a6) 565 expr_ty _Py_NamedExpr(expr_ty target, expr_ty value, int lineno, int 566 col_offset, int end_lineno, int end_col_offset, PyArena 567 *arena); 568 #define BinOp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_BinOp(a0, a1, a2, a3, a4, a5, a6, a7) 569 expr_ty _Py_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int 570 col_offset, int end_lineno, int end_col_offset, PyArena 571 *arena); 572 #define UnaryOp(a0, a1, a2, a3, a4, a5, a6) _Py_UnaryOp(a0, a1, a2, a3, a4, a5, a6) 573 expr_ty _Py_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, 574 int end_lineno, int end_col_offset, PyArena *arena); 575 #define Lambda(a0, a1, a2, a3, a4, a5, a6) _Py_Lambda(a0, a1, a2, a3, a4, a5, a6) 576 expr_ty _Py_Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, 577 int end_lineno, int end_col_offset, PyArena *arena); 578 #define IfExp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_IfExp(a0, a1, a2, a3, a4, a5, a6, a7) 579 expr_ty _Py_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int 580 col_offset, int end_lineno, int end_col_offset, PyArena 581 *arena); 582 #define Dict(a0, a1, a2, a3, a4, a5, a6) _Py_Dict(a0, a1, a2, a3, a4, a5, a6) 583 expr_ty _Py_Dict(asdl_seq * keys, asdl_seq * values, int lineno, int 584 col_offset, int end_lineno, int end_col_offset, PyArena 585 *arena); 586 #define Set(a0, a1, a2, a3, a4, a5) _Py_Set(a0, a1, a2, a3, a4, a5) 587 expr_ty _Py_Set(asdl_seq * elts, int lineno, int col_offset, int end_lineno, 588 int end_col_offset, PyArena *arena); 589 #define ListComp(a0, a1, a2, a3, a4, a5, a6) _Py_ListComp(a0, a1, a2, a3, a4, a5, a6) 590 expr_ty _Py_ListComp(expr_ty elt, asdl_seq * generators, int lineno, int 591 col_offset, int end_lineno, int end_col_offset, PyArena 592 *arena); 593 #define SetComp(a0, a1, a2, a3, a4, a5, a6) _Py_SetComp(a0, a1, a2, a3, a4, a5, a6) 594 expr_ty _Py_SetComp(expr_ty elt, asdl_seq * generators, int lineno, int 595 col_offset, int end_lineno, int end_col_offset, PyArena 596 *arena); 597 #define DictComp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_DictComp(a0, a1, a2, a3, a4, a5, a6, a7) 598 expr_ty _Py_DictComp(expr_ty key, expr_ty value, asdl_seq * generators, int 599 lineno, int col_offset, int end_lineno, int 600 end_col_offset, PyArena *arena); 601 #define GeneratorExp(a0, a1, a2, a3, a4, a5, a6) _Py_GeneratorExp(a0, a1, a2, a3, a4, a5, a6) 602 expr_ty _Py_GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno, int 603 col_offset, int end_lineno, int end_col_offset, 604 PyArena *arena); 605 #define Await(a0, a1, a2, a3, a4, a5) _Py_Await(a0, a1, a2, a3, a4, a5) 606 expr_ty _Py_Await(expr_ty value, int lineno, int col_offset, int end_lineno, 607 int end_col_offset, PyArena *arena); 608 #define Yield(a0, a1, a2, a3, a4, a5) _Py_Yield(a0, a1, a2, a3, a4, a5) 609 expr_ty _Py_Yield(expr_ty value, int lineno, int col_offset, int end_lineno, 610 int end_col_offset, PyArena *arena); 611 #define YieldFrom(a0, a1, a2, a3, a4, a5) _Py_YieldFrom(a0, a1, a2, a3, a4, a5) 612 expr_ty _Py_YieldFrom(expr_ty value, int lineno, int col_offset, int 613 end_lineno, int end_col_offset, PyArena *arena); 614 #define Compare(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Compare(a0, a1, a2, a3, a4, a5, a6, a7) 615 expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_seq * comparators, 616 int lineno, int col_offset, int end_lineno, int 617 end_col_offset, PyArena *arena); 618 #define Call(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Call(a0, a1, a2, a3, a4, a5, a6, a7) 619 expr_ty _Py_Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, int 620 lineno, int col_offset, int end_lineno, int end_col_offset, 621 PyArena *arena); 622 #define FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) _Py_FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) 623 expr_ty _Py_FormattedValue(expr_ty value, int conversion, expr_ty format_spec, 624 int lineno, int col_offset, int end_lineno, int 625 end_col_offset, PyArena *arena); 626 #define JoinedStr(a0, a1, a2, a3, a4, a5) _Py_JoinedStr(a0, a1, a2, a3, a4, a5) 627 expr_ty _Py_JoinedStr(asdl_seq * values, int lineno, int col_offset, int 628 end_lineno, int end_col_offset, PyArena *arena); 629 #define Constant(a0, a1, a2, a3, a4, a5, a6) _Py_Constant(a0, a1, a2, a3, a4, a5, a6) 630 expr_ty _Py_Constant(constant value, string kind, int lineno, int col_offset, 631 int end_lineno, int end_col_offset, PyArena *arena); 632 #define Attribute(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Attribute(a0, a1, a2, a3, a4, a5, a6, a7) 633 expr_ty _Py_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int 634 lineno, int col_offset, int end_lineno, int 635 end_col_offset, PyArena *arena); 636 #define Subscript(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Subscript(a0, a1, a2, a3, a4, a5, a6, a7) 637 expr_ty _Py_Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int 638 lineno, int col_offset, int end_lineno, int 639 end_col_offset, PyArena *arena); 640 #define Starred(a0, a1, a2, a3, a4, a5, a6) _Py_Starred(a0, a1, a2, a3, a4, a5, a6) 641 expr_ty _Py_Starred(expr_ty value, expr_context_ty ctx, int lineno, int 642 col_offset, int end_lineno, int end_col_offset, PyArena 643 *arena); 644 #define Name(a0, a1, a2, a3, a4, a5, a6) _Py_Name(a0, a1, a2, a3, a4, a5, a6) 645 expr_ty _Py_Name(identifier id, expr_context_ty ctx, int lineno, int 646 col_offset, int end_lineno, int end_col_offset, PyArena 647 *arena); 648 #define List(a0, a1, a2, a3, a4, a5, a6) _Py_List(a0, a1, a2, a3, a4, a5, a6) 649 expr_ty _Py_List(asdl_seq * elts, expr_context_ty ctx, int lineno, int 650 col_offset, int end_lineno, int end_col_offset, PyArena 651 *arena); 652 #define Tuple(a0, a1, a2, a3, a4, a5, a6) _Py_Tuple(a0, a1, a2, a3, a4, a5, a6) 653 expr_ty _Py_Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno, int 654 col_offset, int end_lineno, int end_col_offset, PyArena 655 *arena); 656 #define Slice(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Slice(a0, a1, a2, a3, a4, a5, a6, a7) 657 expr_ty _Py_Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, int 658 col_offset, int end_lineno, int end_col_offset, PyArena 659 *arena); 660 #define comprehension(a0, a1, a2, a3, a4) _Py_comprehension(a0, a1, a2, a3, a4) 661 comprehension_ty _Py_comprehension(expr_ty target, expr_ty iter, asdl_seq * 662 ifs, int is_async, PyArena *arena); 663 #define ExceptHandler(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ExceptHandler(a0, a1, a2, a3, a4, a5, a6, a7) 664 excepthandler_ty _Py_ExceptHandler(expr_ty type, identifier name, asdl_seq * 665 body, int lineno, int col_offset, int 666 end_lineno, int end_col_offset, PyArena 667 *arena); 668 #define arguments(a0, a1, a2, a3, a4, a5, a6, a7) _Py_arguments(a0, a1, a2, a3, a4, a5, a6, a7) 669 arguments_ty _Py_arguments(asdl_seq * posonlyargs, asdl_seq * args, arg_ty 670 vararg, asdl_seq * kwonlyargs, asdl_seq * 671 kw_defaults, arg_ty kwarg, asdl_seq * defaults, 672 PyArena *arena); 673 #define arg(a0, a1, a2, a3, a4, a5, a6, a7) _Py_arg(a0, a1, a2, a3, a4, a5, a6, a7) 674 arg_ty _Py_arg(identifier arg, expr_ty annotation, string type_comment, int 675 lineno, int col_offset, int end_lineno, int end_col_offset, 676 PyArena *arena); 677 #define keyword(a0, a1, a2, a3, a4, a5, a6) _Py_keyword(a0, a1, a2, a3, a4, a5, a6) 678 keyword_ty _Py_keyword(identifier arg, expr_ty value, int lineno, int 679 col_offset, int end_lineno, int end_col_offset, PyArena 680 *arena); 681 #define alias(a0, a1, a2) _Py_alias(a0, a1, a2) 682 alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena); 683 #define withitem(a0, a1, a2) _Py_withitem(a0, a1, a2) 684 withitem_ty _Py_withitem(expr_ty context_expr, expr_ty optional_vars, PyArena 685 *arena); 686 #define TypeIgnore(a0, a1, a2) _Py_TypeIgnore(a0, a1, a2) 687 type_ignore_ty _Py_TypeIgnore(int lineno, string tag, PyArena *arena); 688 689 PyObject* PyAST_mod2obj(mod_ty t); 690 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); 691 int PyAST_Check(PyObject* obj); 692 #endif /* !Py_LIMITED_API */ 693 694 #ifdef __cplusplus 695 } 696 #endif 697 #endif /* !Py_PYTHON_AST_H */ 698