1 // File automatically generated by Parser/asdl_c.py. 2 3 #ifndef Py_INTERNAL_AST_H 4 #define Py_INTERNAL_AST_H 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 9 #ifndef Py_BUILD_CORE 10 # error "this header requires Py_BUILD_CORE define" 11 #endif 12 13 #include "pycore_asdl.h" 14 15 typedef struct _mod *mod_ty; 16 17 typedef struct _stmt *stmt_ty; 18 19 typedef struct _expr *expr_ty; 20 21 typedef enum _expr_context { Load=1, Store=2, Del=3 } expr_context_ty; 22 23 typedef enum _boolop { And=1, Or=2 } boolop_ty; 24 25 typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7, 26 LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12, 27 FloorDiv=13 } operator_ty; 28 29 typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; 30 31 typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, 32 In=9, NotIn=10 } cmpop_ty; 33 34 typedef struct _comprehension *comprehension_ty; 35 36 typedef struct _excepthandler *excepthandler_ty; 37 38 typedef struct _arguments *arguments_ty; 39 40 typedef struct _arg *arg_ty; 41 42 typedef struct _keyword *keyword_ty; 43 44 typedef struct _alias *alias_ty; 45 46 typedef struct _withitem *withitem_ty; 47 48 typedef struct _match_case *match_case_ty; 49 50 typedef struct _pattern *pattern_ty; 51 52 typedef struct _type_ignore *type_ignore_ty; 53 54 55 typedef struct { 56 _ASDL_SEQ_HEAD 57 mod_ty typed_elements[1]; 58 } asdl_mod_seq; 59 60 asdl_mod_seq *_Py_asdl_mod_seq_new(Py_ssize_t size, PyArena *arena); 61 62 typedef struct { 63 _ASDL_SEQ_HEAD 64 stmt_ty typed_elements[1]; 65 } asdl_stmt_seq; 66 67 asdl_stmt_seq *_Py_asdl_stmt_seq_new(Py_ssize_t size, PyArena *arena); 68 69 typedef struct { 70 _ASDL_SEQ_HEAD 71 expr_ty typed_elements[1]; 72 } asdl_expr_seq; 73 74 asdl_expr_seq *_Py_asdl_expr_seq_new(Py_ssize_t size, PyArena *arena); 75 76 typedef struct { 77 _ASDL_SEQ_HEAD 78 comprehension_ty typed_elements[1]; 79 } asdl_comprehension_seq; 80 81 asdl_comprehension_seq *_Py_asdl_comprehension_seq_new(Py_ssize_t size, PyArena 82 *arena); 83 84 typedef struct { 85 _ASDL_SEQ_HEAD 86 excepthandler_ty typed_elements[1]; 87 } asdl_excepthandler_seq; 88 89 asdl_excepthandler_seq *_Py_asdl_excepthandler_seq_new(Py_ssize_t size, PyArena 90 *arena); 91 92 typedef struct { 93 _ASDL_SEQ_HEAD 94 arguments_ty typed_elements[1]; 95 } asdl_arguments_seq; 96 97 asdl_arguments_seq *_Py_asdl_arguments_seq_new(Py_ssize_t size, PyArena *arena); 98 99 typedef struct { 100 _ASDL_SEQ_HEAD 101 arg_ty typed_elements[1]; 102 } asdl_arg_seq; 103 104 asdl_arg_seq *_Py_asdl_arg_seq_new(Py_ssize_t size, PyArena *arena); 105 106 typedef struct { 107 _ASDL_SEQ_HEAD 108 keyword_ty typed_elements[1]; 109 } asdl_keyword_seq; 110 111 asdl_keyword_seq *_Py_asdl_keyword_seq_new(Py_ssize_t size, PyArena *arena); 112 113 typedef struct { 114 _ASDL_SEQ_HEAD 115 alias_ty typed_elements[1]; 116 } asdl_alias_seq; 117 118 asdl_alias_seq *_Py_asdl_alias_seq_new(Py_ssize_t size, PyArena *arena); 119 120 typedef struct { 121 _ASDL_SEQ_HEAD 122 withitem_ty typed_elements[1]; 123 } asdl_withitem_seq; 124 125 asdl_withitem_seq *_Py_asdl_withitem_seq_new(Py_ssize_t size, PyArena *arena); 126 127 typedef struct { 128 _ASDL_SEQ_HEAD 129 match_case_ty typed_elements[1]; 130 } asdl_match_case_seq; 131 132 asdl_match_case_seq *_Py_asdl_match_case_seq_new(Py_ssize_t size, PyArena 133 *arena); 134 135 typedef struct { 136 _ASDL_SEQ_HEAD 137 pattern_ty typed_elements[1]; 138 } asdl_pattern_seq; 139 140 asdl_pattern_seq *_Py_asdl_pattern_seq_new(Py_ssize_t size, PyArena *arena); 141 142 typedef struct { 143 _ASDL_SEQ_HEAD 144 type_ignore_ty typed_elements[1]; 145 } asdl_type_ignore_seq; 146 147 asdl_type_ignore_seq *_Py_asdl_type_ignore_seq_new(Py_ssize_t size, PyArena 148 *arena); 149 150 151 enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, 152 FunctionType_kind=4}; 153 struct _mod { 154 enum _mod_kind kind; 155 union { 156 struct { 157 asdl_stmt_seq *body; 158 asdl_type_ignore_seq *type_ignores; 159 } Module; 160 161 struct { 162 asdl_stmt_seq *body; 163 } Interactive; 164 165 struct { 166 expr_ty body; 167 } Expression; 168 169 struct { 170 asdl_expr_seq *argtypes; 171 expr_ty returns; 172 } FunctionType; 173 174 } v; 175 }; 176 177 enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3, 178 Return_kind=4, Delete_kind=5, Assign_kind=6, 179 AugAssign_kind=7, AnnAssign_kind=8, For_kind=9, 180 AsyncFor_kind=10, While_kind=11, If_kind=12, With_kind=13, 181 AsyncWith_kind=14, Match_kind=15, Raise_kind=16, Try_kind=17, 182 TryStar_kind=18, Assert_kind=19, Import_kind=20, 183 ImportFrom_kind=21, Global_kind=22, Nonlocal_kind=23, 184 Expr_kind=24, Pass_kind=25, Break_kind=26, Continue_kind=27}; 185 struct _stmt { 186 enum _stmt_kind kind; 187 union { 188 struct { 189 identifier name; 190 arguments_ty args; 191 asdl_stmt_seq *body; 192 asdl_expr_seq *decorator_list; 193 expr_ty returns; 194 string type_comment; 195 } FunctionDef; 196 197 struct { 198 identifier name; 199 arguments_ty args; 200 asdl_stmt_seq *body; 201 asdl_expr_seq *decorator_list; 202 expr_ty returns; 203 string type_comment; 204 } AsyncFunctionDef; 205 206 struct { 207 identifier name; 208 asdl_expr_seq *bases; 209 asdl_keyword_seq *keywords; 210 asdl_stmt_seq *body; 211 asdl_expr_seq *decorator_list; 212 } ClassDef; 213 214 struct { 215 expr_ty value; 216 } Return; 217 218 struct { 219 asdl_expr_seq *targets; 220 } Delete; 221 222 struct { 223 asdl_expr_seq *targets; 224 expr_ty value; 225 string type_comment; 226 } Assign; 227 228 struct { 229 expr_ty target; 230 operator_ty op; 231 expr_ty value; 232 } AugAssign; 233 234 struct { 235 expr_ty target; 236 expr_ty annotation; 237 expr_ty value; 238 int simple; 239 } AnnAssign; 240 241 struct { 242 expr_ty target; 243 expr_ty iter; 244 asdl_stmt_seq *body; 245 asdl_stmt_seq *orelse; 246 string type_comment; 247 } For; 248 249 struct { 250 expr_ty target; 251 expr_ty iter; 252 asdl_stmt_seq *body; 253 asdl_stmt_seq *orelse; 254 string type_comment; 255 } AsyncFor; 256 257 struct { 258 expr_ty test; 259 asdl_stmt_seq *body; 260 asdl_stmt_seq *orelse; 261 } While; 262 263 struct { 264 expr_ty test; 265 asdl_stmt_seq *body; 266 asdl_stmt_seq *orelse; 267 } If; 268 269 struct { 270 asdl_withitem_seq *items; 271 asdl_stmt_seq *body; 272 string type_comment; 273 } With; 274 275 struct { 276 asdl_withitem_seq *items; 277 asdl_stmt_seq *body; 278 string type_comment; 279 } AsyncWith; 280 281 struct { 282 expr_ty subject; 283 asdl_match_case_seq *cases; 284 } Match; 285 286 struct { 287 expr_ty exc; 288 expr_ty cause; 289 } Raise; 290 291 struct { 292 asdl_stmt_seq *body; 293 asdl_excepthandler_seq *handlers; 294 asdl_stmt_seq *orelse; 295 asdl_stmt_seq *finalbody; 296 } Try; 297 298 struct { 299 asdl_stmt_seq *body; 300 asdl_excepthandler_seq *handlers; 301 asdl_stmt_seq *orelse; 302 asdl_stmt_seq *finalbody; 303 } TryStar; 304 305 struct { 306 expr_ty test; 307 expr_ty msg; 308 } Assert; 309 310 struct { 311 asdl_alias_seq *names; 312 } Import; 313 314 struct { 315 identifier module; 316 asdl_alias_seq *names; 317 int level; 318 } ImportFrom; 319 320 struct { 321 asdl_identifier_seq *names; 322 } Global; 323 324 struct { 325 asdl_identifier_seq *names; 326 } Nonlocal; 327 328 struct { 329 expr_ty value; 330 } Expr; 331 332 } v; 333 int lineno; 334 int col_offset; 335 int end_lineno; 336 int end_col_offset; 337 }; 338 339 enum _expr_kind {BoolOp_kind=1, NamedExpr_kind=2, BinOp_kind=3, UnaryOp_kind=4, 340 Lambda_kind=5, IfExp_kind=6, Dict_kind=7, Set_kind=8, 341 ListComp_kind=9, SetComp_kind=10, DictComp_kind=11, 342 GeneratorExp_kind=12, Await_kind=13, Yield_kind=14, 343 YieldFrom_kind=15, Compare_kind=16, Call_kind=17, 344 FormattedValue_kind=18, JoinedStr_kind=19, Constant_kind=20, 345 Attribute_kind=21, Subscript_kind=22, Starred_kind=23, 346 Name_kind=24, List_kind=25, Tuple_kind=26, Slice_kind=27}; 347 struct _expr { 348 enum _expr_kind kind; 349 union { 350 struct { 351 boolop_ty op; 352 asdl_expr_seq *values; 353 } BoolOp; 354 355 struct { 356 expr_ty target; 357 expr_ty value; 358 } NamedExpr; 359 360 struct { 361 expr_ty left; 362 operator_ty op; 363 expr_ty right; 364 } BinOp; 365 366 struct { 367 unaryop_ty op; 368 expr_ty operand; 369 } UnaryOp; 370 371 struct { 372 arguments_ty args; 373 expr_ty body; 374 } Lambda; 375 376 struct { 377 expr_ty test; 378 expr_ty body; 379 expr_ty orelse; 380 } IfExp; 381 382 struct { 383 asdl_expr_seq *keys; 384 asdl_expr_seq *values; 385 } Dict; 386 387 struct { 388 asdl_expr_seq *elts; 389 } Set; 390 391 struct { 392 expr_ty elt; 393 asdl_comprehension_seq *generators; 394 } ListComp; 395 396 struct { 397 expr_ty elt; 398 asdl_comprehension_seq *generators; 399 } SetComp; 400 401 struct { 402 expr_ty key; 403 expr_ty value; 404 asdl_comprehension_seq *generators; 405 } DictComp; 406 407 struct { 408 expr_ty elt; 409 asdl_comprehension_seq *generators; 410 } GeneratorExp; 411 412 struct { 413 expr_ty value; 414 } Await; 415 416 struct { 417 expr_ty value; 418 } Yield; 419 420 struct { 421 expr_ty value; 422 } YieldFrom; 423 424 struct { 425 expr_ty left; 426 asdl_int_seq *ops; 427 asdl_expr_seq *comparators; 428 } Compare; 429 430 struct { 431 expr_ty func; 432 asdl_expr_seq *args; 433 asdl_keyword_seq *keywords; 434 } Call; 435 436 struct { 437 expr_ty value; 438 int conversion; 439 expr_ty format_spec; 440 } FormattedValue; 441 442 struct { 443 asdl_expr_seq *values; 444 } JoinedStr; 445 446 struct { 447 constant value; 448 string kind; 449 } Constant; 450 451 struct { 452 expr_ty value; 453 identifier attr; 454 expr_context_ty ctx; 455 } Attribute; 456 457 struct { 458 expr_ty value; 459 expr_ty slice; 460 expr_context_ty ctx; 461 } Subscript; 462 463 struct { 464 expr_ty value; 465 expr_context_ty ctx; 466 } Starred; 467 468 struct { 469 identifier id; 470 expr_context_ty ctx; 471 } Name; 472 473 struct { 474 asdl_expr_seq *elts; 475 expr_context_ty ctx; 476 } List; 477 478 struct { 479 asdl_expr_seq *elts; 480 expr_context_ty ctx; 481 } Tuple; 482 483 struct { 484 expr_ty lower; 485 expr_ty upper; 486 expr_ty step; 487 } Slice; 488 489 } v; 490 int lineno; 491 int col_offset; 492 int end_lineno; 493 int end_col_offset; 494 }; 495 496 struct _comprehension { 497 expr_ty target; 498 expr_ty iter; 499 asdl_expr_seq *ifs; 500 int is_async; 501 }; 502 503 enum _excepthandler_kind {ExceptHandler_kind=1}; 504 struct _excepthandler { 505 enum _excepthandler_kind kind; 506 union { 507 struct { 508 expr_ty type; 509 identifier name; 510 asdl_stmt_seq *body; 511 } ExceptHandler; 512 513 } v; 514 int lineno; 515 int col_offset; 516 int end_lineno; 517 int end_col_offset; 518 }; 519 520 struct _arguments { 521 asdl_arg_seq *posonlyargs; 522 asdl_arg_seq *args; 523 arg_ty vararg; 524 asdl_arg_seq *kwonlyargs; 525 asdl_expr_seq *kw_defaults; 526 arg_ty kwarg; 527 asdl_expr_seq *defaults; 528 }; 529 530 struct _arg { 531 identifier arg; 532 expr_ty annotation; 533 string type_comment; 534 int lineno; 535 int col_offset; 536 int end_lineno; 537 int end_col_offset; 538 }; 539 540 struct _keyword { 541 identifier arg; 542 expr_ty value; 543 int lineno; 544 int col_offset; 545 int end_lineno; 546 int end_col_offset; 547 }; 548 549 struct _alias { 550 identifier name; 551 identifier asname; 552 int lineno; 553 int col_offset; 554 int end_lineno; 555 int end_col_offset; 556 }; 557 558 struct _withitem { 559 expr_ty context_expr; 560 expr_ty optional_vars; 561 }; 562 563 struct _match_case { 564 pattern_ty pattern; 565 expr_ty guard; 566 asdl_stmt_seq *body; 567 }; 568 569 enum _pattern_kind {MatchValue_kind=1, MatchSingleton_kind=2, 570 MatchSequence_kind=3, MatchMapping_kind=4, 571 MatchClass_kind=5, MatchStar_kind=6, MatchAs_kind=7, 572 MatchOr_kind=8}; 573 struct _pattern { 574 enum _pattern_kind kind; 575 union { 576 struct { 577 expr_ty value; 578 } MatchValue; 579 580 struct { 581 constant value; 582 } MatchSingleton; 583 584 struct { 585 asdl_pattern_seq *patterns; 586 } MatchSequence; 587 588 struct { 589 asdl_expr_seq *keys; 590 asdl_pattern_seq *patterns; 591 identifier rest; 592 } MatchMapping; 593 594 struct { 595 expr_ty cls; 596 asdl_pattern_seq *patterns; 597 asdl_identifier_seq *kwd_attrs; 598 asdl_pattern_seq *kwd_patterns; 599 } MatchClass; 600 601 struct { 602 identifier name; 603 } MatchStar; 604 605 struct { 606 pattern_ty pattern; 607 identifier name; 608 } MatchAs; 609 610 struct { 611 asdl_pattern_seq *patterns; 612 } MatchOr; 613 614 } v; 615 int lineno; 616 int col_offset; 617 int end_lineno; 618 int end_col_offset; 619 }; 620 621 enum _type_ignore_kind {TypeIgnore_kind=1}; 622 struct _type_ignore { 623 enum _type_ignore_kind kind; 624 union { 625 struct { 626 int lineno; 627 string tag; 628 } TypeIgnore; 629 630 } v; 631 }; 632 633 634 // Note: these macros affect function definitions, not only call sites. 635 mod_ty _PyAST_Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores, 636 PyArena *arena); 637 mod_ty _PyAST_Interactive(asdl_stmt_seq * body, PyArena *arena); 638 mod_ty _PyAST_Expression(expr_ty body, PyArena *arena); 639 mod_ty _PyAST_FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena 640 *arena); 641 stmt_ty _PyAST_FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * 642 body, asdl_expr_seq * decorator_list, expr_ty 643 returns, string type_comment, int lineno, int 644 col_offset, int end_lineno, int end_col_offset, 645 PyArena *arena); 646 stmt_ty _PyAST_AsyncFunctionDef(identifier name, arguments_ty args, 647 asdl_stmt_seq * body, asdl_expr_seq * 648 decorator_list, expr_ty returns, string 649 type_comment, int lineno, int col_offset, int 650 end_lineno, int end_col_offset, PyArena *arena); 651 stmt_ty _PyAST_ClassDef(identifier name, asdl_expr_seq * bases, 652 asdl_keyword_seq * keywords, asdl_stmt_seq * body, 653 asdl_expr_seq * decorator_list, int lineno, int 654 col_offset, int end_lineno, int end_col_offset, PyArena 655 *arena); 656 stmt_ty _PyAST_Return(expr_ty value, int lineno, int col_offset, int 657 end_lineno, int end_col_offset, PyArena *arena); 658 stmt_ty _PyAST_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int 659 end_lineno, int end_col_offset, PyArena *arena); 660 stmt_ty _PyAST_Assign(asdl_expr_seq * targets, expr_ty value, string 661 type_comment, int lineno, int col_offset, int end_lineno, 662 int end_col_offset, PyArena *arena); 663 stmt_ty _PyAST_AugAssign(expr_ty target, operator_ty op, expr_ty value, int 664 lineno, int col_offset, int end_lineno, int 665 end_col_offset, PyArena *arena); 666 stmt_ty _PyAST_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int 667 simple, int lineno, int col_offset, int end_lineno, 668 int end_col_offset, PyArena *arena); 669 stmt_ty _PyAST_For(expr_ty target, expr_ty iter, asdl_stmt_seq * body, 670 asdl_stmt_seq * orelse, string type_comment, int lineno, int 671 col_offset, int end_lineno, int end_col_offset, PyArena 672 *arena); 673 stmt_ty _PyAST_AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body, 674 asdl_stmt_seq * orelse, string type_comment, int 675 lineno, int col_offset, int end_lineno, int 676 end_col_offset, PyArena *arena); 677 stmt_ty _PyAST_While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * 678 orelse, int lineno, int col_offset, int end_lineno, int 679 end_col_offset, PyArena *arena); 680 stmt_ty _PyAST_If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, 681 int lineno, int col_offset, int end_lineno, int 682 end_col_offset, PyArena *arena); 683 stmt_ty _PyAST_With(asdl_withitem_seq * items, asdl_stmt_seq * body, string 684 type_comment, int lineno, int col_offset, int end_lineno, 685 int end_col_offset, PyArena *arena); 686 stmt_ty _PyAST_AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body, 687 string type_comment, int lineno, int col_offset, int 688 end_lineno, int end_col_offset, PyArena *arena); 689 stmt_ty _PyAST_Match(expr_ty subject, asdl_match_case_seq * cases, int lineno, 690 int col_offset, int end_lineno, int end_col_offset, 691 PyArena *arena); 692 stmt_ty _PyAST_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, 693 int end_lineno, int end_col_offset, PyArena *arena); 694 stmt_ty _PyAST_Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, 695 asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int 696 lineno, int col_offset, int end_lineno, int end_col_offset, 697 PyArena *arena); 698 stmt_ty _PyAST_TryStar(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, 699 asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int 700 lineno, int col_offset, int end_lineno, int 701 end_col_offset, PyArena *arena); 702 stmt_ty _PyAST_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, 703 int end_lineno, int end_col_offset, PyArena *arena); 704 stmt_ty _PyAST_Import(asdl_alias_seq * names, int lineno, int col_offset, int 705 end_lineno, int end_col_offset, PyArena *arena); 706 stmt_ty _PyAST_ImportFrom(identifier module, asdl_alias_seq * names, int level, 707 int lineno, int col_offset, int end_lineno, int 708 end_col_offset, PyArena *arena); 709 stmt_ty _PyAST_Global(asdl_identifier_seq * names, int lineno, int col_offset, 710 int end_lineno, int end_col_offset, PyArena *arena); 711 stmt_ty _PyAST_Nonlocal(asdl_identifier_seq * names, int lineno, int 712 col_offset, int end_lineno, int end_col_offset, PyArena 713 *arena); 714 stmt_ty _PyAST_Expr(expr_ty value, int lineno, int col_offset, int end_lineno, 715 int end_col_offset, PyArena *arena); 716 stmt_ty _PyAST_Pass(int lineno, int col_offset, int end_lineno, int 717 end_col_offset, PyArena *arena); 718 stmt_ty _PyAST_Break(int lineno, int col_offset, int end_lineno, int 719 end_col_offset, PyArena *arena); 720 stmt_ty _PyAST_Continue(int lineno, int col_offset, int end_lineno, int 721 end_col_offset, PyArena *arena); 722 expr_ty _PyAST_BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int 723 col_offset, int end_lineno, int end_col_offset, PyArena 724 *arena); 725 expr_ty _PyAST_NamedExpr(expr_ty target, expr_ty value, int lineno, int 726 col_offset, int end_lineno, int end_col_offset, 727 PyArena *arena); 728 expr_ty _PyAST_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, 729 int col_offset, int end_lineno, int end_col_offset, 730 PyArena *arena); 731 expr_ty _PyAST_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int 732 col_offset, int end_lineno, int end_col_offset, PyArena 733 *arena); 734 expr_ty _PyAST_Lambda(arguments_ty args, expr_ty body, int lineno, int 735 col_offset, int end_lineno, int end_col_offset, PyArena 736 *arena); 737 expr_ty _PyAST_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, 738 int col_offset, int end_lineno, int end_col_offset, 739 PyArena *arena); 740 expr_ty _PyAST_Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno, 741 int col_offset, int end_lineno, int end_col_offset, PyArena 742 *arena); 743 expr_ty _PyAST_Set(asdl_expr_seq * elts, int lineno, int col_offset, int 744 end_lineno, int end_col_offset, PyArena *arena); 745 expr_ty _PyAST_ListComp(expr_ty elt, asdl_comprehension_seq * generators, int 746 lineno, int col_offset, int end_lineno, int 747 end_col_offset, PyArena *arena); 748 expr_ty _PyAST_SetComp(expr_ty elt, asdl_comprehension_seq * generators, int 749 lineno, int col_offset, int end_lineno, int 750 end_col_offset, PyArena *arena); 751 expr_ty _PyAST_DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq * 752 generators, int lineno, int col_offset, int end_lineno, 753 int end_col_offset, PyArena *arena); 754 expr_ty _PyAST_GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, 755 int lineno, int col_offset, int end_lineno, int 756 end_col_offset, PyArena *arena); 757 expr_ty _PyAST_Await(expr_ty value, int lineno, int col_offset, int end_lineno, 758 int end_col_offset, PyArena *arena); 759 expr_ty _PyAST_Yield(expr_ty value, int lineno, int col_offset, int end_lineno, 760 int end_col_offset, PyArena *arena); 761 expr_ty _PyAST_YieldFrom(expr_ty value, int lineno, int col_offset, int 762 end_lineno, int end_col_offset, PyArena *arena); 763 expr_ty _PyAST_Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq * 764 comparators, int lineno, int col_offset, int end_lineno, 765 int end_col_offset, PyArena *arena); 766 expr_ty _PyAST_Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq * 767 keywords, int lineno, int col_offset, int end_lineno, int 768 end_col_offset, PyArena *arena); 769 expr_ty _PyAST_FormattedValue(expr_ty value, int conversion, expr_ty 770 format_spec, int lineno, int col_offset, int 771 end_lineno, int end_col_offset, PyArena *arena); 772 expr_ty _PyAST_JoinedStr(asdl_expr_seq * values, int lineno, int col_offset, 773 int end_lineno, int end_col_offset, PyArena *arena); 774 expr_ty _PyAST_Constant(constant value, string kind, int lineno, int 775 col_offset, int end_lineno, int end_col_offset, PyArena 776 *arena); 777 expr_ty _PyAST_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, 778 int lineno, int col_offset, int end_lineno, int 779 end_col_offset, PyArena *arena); 780 expr_ty _PyAST_Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int 781 lineno, int col_offset, int end_lineno, int 782 end_col_offset, PyArena *arena); 783 expr_ty _PyAST_Starred(expr_ty value, expr_context_ty ctx, int lineno, int 784 col_offset, int end_lineno, int end_col_offset, PyArena 785 *arena); 786 expr_ty _PyAST_Name(identifier id, expr_context_ty ctx, int lineno, int 787 col_offset, int end_lineno, int end_col_offset, PyArena 788 *arena); 789 expr_ty _PyAST_List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int 790 col_offset, int end_lineno, int end_col_offset, PyArena 791 *arena); 792 expr_ty _PyAST_Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int 793 col_offset, int end_lineno, int end_col_offset, PyArena 794 *arena); 795 expr_ty _PyAST_Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, 796 int col_offset, int end_lineno, int end_col_offset, 797 PyArena *arena); 798 comprehension_ty _PyAST_comprehension(expr_ty target, expr_ty iter, 799 asdl_expr_seq * ifs, int is_async, 800 PyArena *arena); 801 excepthandler_ty _PyAST_ExceptHandler(expr_ty type, identifier name, 802 asdl_stmt_seq * body, int lineno, int 803 col_offset, int end_lineno, int 804 end_col_offset, PyArena *arena); 805 arguments_ty _PyAST_arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args, 806 arg_ty vararg, asdl_arg_seq * kwonlyargs, 807 asdl_expr_seq * kw_defaults, arg_ty kwarg, 808 asdl_expr_seq * defaults, PyArena *arena); 809 arg_ty _PyAST_arg(identifier arg, expr_ty annotation, string type_comment, int 810 lineno, int col_offset, int end_lineno, int end_col_offset, 811 PyArena *arena); 812 keyword_ty _PyAST_keyword(identifier arg, expr_ty value, int lineno, int 813 col_offset, int end_lineno, int end_col_offset, 814 PyArena *arena); 815 alias_ty _PyAST_alias(identifier name, identifier asname, int lineno, int 816 col_offset, int end_lineno, int end_col_offset, PyArena 817 *arena); 818 withitem_ty _PyAST_withitem(expr_ty context_expr, expr_ty optional_vars, 819 PyArena *arena); 820 match_case_ty _PyAST_match_case(pattern_ty pattern, expr_ty guard, 821 asdl_stmt_seq * body, PyArena *arena); 822 pattern_ty _PyAST_MatchValue(expr_ty value, int lineno, int col_offset, int 823 end_lineno, int end_col_offset, PyArena *arena); 824 pattern_ty _PyAST_MatchSingleton(constant value, int lineno, int col_offset, 825 int end_lineno, int end_col_offset, PyArena 826 *arena); 827 pattern_ty _PyAST_MatchSequence(asdl_pattern_seq * patterns, int lineno, int 828 col_offset, int end_lineno, int end_col_offset, 829 PyArena *arena); 830 pattern_ty _PyAST_MatchMapping(asdl_expr_seq * keys, asdl_pattern_seq * 831 patterns, identifier rest, int lineno, int 832 col_offset, int end_lineno, int end_col_offset, 833 PyArena *arena); 834 pattern_ty _PyAST_MatchClass(expr_ty cls, asdl_pattern_seq * patterns, 835 asdl_identifier_seq * kwd_attrs, asdl_pattern_seq 836 * kwd_patterns, int lineno, int col_offset, int 837 end_lineno, int end_col_offset, PyArena *arena); 838 pattern_ty _PyAST_MatchStar(identifier name, int lineno, int col_offset, int 839 end_lineno, int end_col_offset, PyArena *arena); 840 pattern_ty _PyAST_MatchAs(pattern_ty pattern, identifier name, int lineno, int 841 col_offset, int end_lineno, int end_col_offset, 842 PyArena *arena); 843 pattern_ty _PyAST_MatchOr(asdl_pattern_seq * patterns, int lineno, int 844 col_offset, int end_lineno, int end_col_offset, 845 PyArena *arena); 846 type_ignore_ty _PyAST_TypeIgnore(int lineno, string tag, PyArena *arena); 847 848 849 PyObject* PyAST_mod2obj(mod_ty t); 850 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); 851 int PyAST_Check(PyObject* obj); 852 853 extern int _PyAST_Validate(mod_ty); 854 855 /* _PyAST_ExprAsUnicode is defined in ast_unparse.c */ 856 extern PyObject* _PyAST_ExprAsUnicode(expr_ty); 857 858 /* Return the borrowed reference to the first literal string in the 859 sequence of statements or NULL if it doesn't start from a literal string. 860 Doesn't set exception. */ 861 extern PyObject* _PyAST_GetDocString(asdl_stmt_seq *); 862 863 #ifdef __cplusplus 864 } 865 #endif 866 #endif /* !Py_INTERNAL_AST_H */ 867