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