OLD | NEW |
1 /* File automatically generated by Parser/asdl_c.py. */ | 1 /* File automatically generated by Parser/asdl_c.py. */ |
2 | 2 |
3 #include "asdl.h" | 3 #include "asdl.h" |
4 | 4 |
5 typedef struct _mod *mod_ty; | 5 typedef struct _mod *mod_ty; |
6 | 6 |
7 typedef struct _stmt *stmt_ty; | 7 typedef struct _stmt *stmt_ty; |
8 | 8 |
9 typedef struct _expr *expr_ty; | 9 typedef struct _expr *expr_ty; |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 typedef struct _alias *alias_ty; | 37 typedef struct _alias *alias_ty; |
38 | 38 |
39 | 39 |
40 enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, | 40 enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, |
41 Suite_kind=4}; | 41 Suite_kind=4}; |
42 struct _mod { | 42 struct _mod { |
43 enum _mod_kind kind; | 43 enum _mod_kind kind; |
44 union { | 44 union { |
45 struct { | 45 struct { |
46 asdl_seq *body; | 46 asdl_seq *body; |
| 47 string docstring; |
47 } Module; | 48 } Module; |
48 ················ | 49 ················ |
49 struct { | 50 struct { |
50 asdl_seq *body; | 51 asdl_seq *body; |
51 } Interactive; | 52 } Interactive; |
52 ················ | 53 ················ |
53 struct { | 54 struct { |
54 expr_ty body; | 55 expr_ty body; |
55 } Expression; | 56 } Expression; |
56 ················ | 57 ················ |
(...skipping 13 matching lines...) Expand all Loading... |
70 Continue_kind=22}; | 71 Continue_kind=22}; |
71 struct _stmt { | 72 struct _stmt { |
72 enum _stmt_kind kind; | 73 enum _stmt_kind kind; |
73 union { | 74 union { |
74 struct { | 75 struct { |
75 identifier name; | 76 identifier name; |
76 arguments_ty args; | 77 arguments_ty args; |
77 asdl_seq *body; | 78 asdl_seq *body; |
78 asdl_seq *decorator_list; | 79 asdl_seq *decorator_list; |
79 expr_ty returns; | 80 expr_ty returns; |
| 81 string docstring; |
80 } FunctionDef; | 82 } FunctionDef; |
81 ················ | 83 ················ |
82 struct { | 84 struct { |
83 identifier name; | 85 identifier name; |
84 asdl_seq *bases; | 86 asdl_seq *bases; |
85 asdl_seq *keywords; | 87 asdl_seq *keywords; |
86 expr_ty starargs; | 88 expr_ty starargs; |
87 expr_ty kwargs; | 89 expr_ty kwargs; |
88 asdl_seq *body; | 90 asdl_seq *body; |
89 asdl_seq *decorator_list; | 91 asdl_seq *decorator_list; |
| 92 string docstring; |
90 } ClassDef; | 93 } ClassDef; |
91 ················ | 94 ················ |
92 struct { | 95 struct { |
93 expr_ty value; | 96 expr_ty value; |
94 } Return; | 97 } Return; |
95 ················ | 98 ················ |
96 struct { | 99 struct { |
97 asdl_seq *targets; | 100 asdl_seq *targets; |
98 } Delete; | 101 } Delete; |
99 ················ | 102 ················ |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } Expr; | 180 } Expr; |
178 ················ | 181 ················ |
179 } v; | 182 } v; |
180 int lineno; | 183 int lineno; |
181 int col_offset; | 184 int col_offset; |
182 }; | 185 }; |
183 | 186 |
184 enum _expr_kind {BoolOp_kind=1, BinOp_kind=2, UnaryOp_kind=3, Lambda_kind=4, | 187 enum _expr_kind {BoolOp_kind=1, BinOp_kind=2, UnaryOp_kind=3, Lambda_kind=4, |
185 IfExp_kind=5, Dict_kind=6, Set_kind=7, ListComp_kind=8, | 188 IfExp_kind=5, Dict_kind=6, Set_kind=7, ListComp_kind=8, |
186 SetComp_kind=9, DictComp_kind=10, GeneratorExp_kind=11, | 189 SetComp_kind=9, DictComp_kind=10, GeneratorExp_kind=11, |
187 Yield_kind=12, Compare_kind=13, Call_kind=14, Num_kind=15, | 190 Yield_kind=12, Compare_kind=13, Call_kind=14, Lit_kind=15, |
188 Str_kind=16, Bytes_kind=17, Ellipsis_kind=18, | 191 Attribute_kind=16, Subscript_kind=17, Starred_kind=18, |
189 Attribute_kind=19, Subscript_kind=20, Starred_kind=21, | 192 Name_kind=19, List_kind=20, Tuple_kind=21}; |
190 Name_kind=22, List_kind=23, Tuple_kind=24}; | |
191 struct _expr { | 193 struct _expr { |
192 enum _expr_kind kind; | 194 enum _expr_kind kind; |
193 union { | 195 union { |
194 struct { | 196 struct { |
195 boolop_ty op; | 197 boolop_ty op; |
196 asdl_seq *values; | 198 asdl_seq *values; |
197 } BoolOp; | 199 } BoolOp; |
198 ················ | 200 ················ |
199 struct { | 201 struct { |
200 expr_ty left; | 202 expr_ty left; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 ················ | 262 ················ |
261 struct { | 263 struct { |
262 expr_ty func; | 264 expr_ty func; |
263 asdl_seq *args; | 265 asdl_seq *args; |
264 asdl_seq *keywords; | 266 asdl_seq *keywords; |
265 expr_ty starargs; | 267 expr_ty starargs; |
266 expr_ty kwargs; | 268 expr_ty kwargs; |
267 } Call; | 269 } Call; |
268 ················ | 270 ················ |
269 struct { | 271 struct { |
270 object n; | 272 object v; |
271 } Num; | 273 } Lit; |
272 ················ | |
273 struct { | |
274 string s; | |
275 } Str; | |
276 ················ | |
277 struct { | |
278 string s; | |
279 } Bytes; | |
280 ················ | 274 ················ |
281 struct { | 275 struct { |
282 expr_ty value; | 276 expr_ty value; |
283 identifier attr; | 277 identifier attr; |
284 expr_context_ty ctx; | 278 expr_context_ty ctx; |
285 } Attribute; | 279 } Attribute; |
286 ················ | 280 ················ |
287 struct { | 281 struct { |
288 expr_ty value; | 282 expr_ty value; |
289 slice_ty slice; | 283 slice_ty slice; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 identifier arg; | 371 identifier arg; |
378 expr_ty value; | 372 expr_ty value; |
379 }; | 373 }; |
380 | 374 |
381 struct _alias { | 375 struct _alias { |
382 identifier name; | 376 identifier name; |
383 identifier asname; | 377 identifier asname; |
384 }; | 378 }; |
385 | 379 |
386 | 380 |
387 #define Module(a0, a1) _Py_Module(a0, a1) | 381 #define Module(a0, a1, a2) _Py_Module(a0, a1, a2) |
388 mod_ty _Py_Module(asdl_seq * body, PyArena *arena); | 382 mod_ty _Py_Module(asdl_seq * body, string docstring, PyArena *arena); |
389 #define Interactive(a0, a1) _Py_Interactive(a0, a1) | 383 #define Interactive(a0, a1) _Py_Interactive(a0, a1) |
390 mod_ty _Py_Interactive(asdl_seq * body, PyArena *arena); | 384 mod_ty _Py_Interactive(asdl_seq * body, PyArena *arena); |
391 #define Expression(a0, a1) _Py_Expression(a0, a1) | 385 #define Expression(a0, a1) _Py_Expression(a0, a1) |
392 mod_ty _Py_Expression(expr_ty body, PyArena *arena); | 386 mod_ty _Py_Expression(expr_ty body, PyArena *arena); |
393 #define Suite(a0, a1) _Py_Suite(a0, a1) | 387 #define Suite(a0, a1) _Py_Suite(a0, a1) |
394 mod_ty _Py_Suite(asdl_seq * body, PyArena *arena); | 388 mod_ty _Py_Suite(asdl_seq * body, PyArena *arena); |
395 #define FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7) _Py_FunctionDef(a0, a1, a2,
a3, a4, a5, a6, a7) | 389 #define FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_FunctionDef(a0, a1,
a2, a3, a4, a5, a6, a7, a8) |
396 stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_seq * body, | 390 stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_seq * body, |
397 asdl_seq * decorator_list, expr_ty returns, int lineno, | 391 asdl_seq * decorator_list, expr_ty returns, string |
398 int col_offset, PyArena *arena); | 392 docstring, int lineno, int col_offset, PyArena *arena); |
399 #define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_ClassDef(a0, a1, a2
, a3, a4, a5, a6, a7, a8, a9) | 393 #define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_ClassDef(a0, a
1, a2, a3, a4, a5, a6, a7, a8, a9, a10) |
400 stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords, | 394 stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords, |
401 expr_ty starargs, expr_ty kwargs, asdl_seq * body, | 395 expr_ty starargs, expr_ty kwargs, asdl_seq * body, |
402 asdl_seq * decorator_list, int lineno, int col_offset, | 396 asdl_seq * decorator_list, string docstring, int lineno, |
403 PyArena *arena); | 397 int col_offset, PyArena *arena); |
404 #define Return(a0, a1, a2, a3) _Py_Return(a0, a1, a2, a3) | 398 #define Return(a0, a1, a2, a3) _Py_Return(a0, a1, a2, a3) |
405 stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, PyArena *arena); | 399 stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, PyArena *arena); |
406 #define Delete(a0, a1, a2, a3) _Py_Delete(a0, a1, a2, a3) | 400 #define Delete(a0, a1, a2, a3) _Py_Delete(a0, a1, a2, a3) |
407 stmt_ty _Py_Delete(asdl_seq * targets, int lineno, int col_offset, PyArena | 401 stmt_ty _Py_Delete(asdl_seq * targets, int lineno, int col_offset, PyArena |
408 *arena); | 402 *arena); |
409 #define Assign(a0, a1, a2, a3, a4) _Py_Assign(a0, a1, a2, a3, a4) | 403 #define Assign(a0, a1, a2, a3, a4) _Py_Assign(a0, a1, a2, a3, a4) |
410 stmt_ty _Py_Assign(asdl_seq * targets, expr_ty value, int lineno, int | 404 stmt_ty _Py_Assign(asdl_seq * targets, expr_ty value, int lineno, int |
411 col_offset, PyArena *arena); | 405 col_offset, PyArena *arena); |
412 #define AugAssign(a0, a1, a2, a3, a4, a5) _Py_AugAssign(a0, a1, a2, a3, a4, a5) | 406 #define AugAssign(a0, a1, a2, a3, a4, a5) _Py_AugAssign(a0, a1, a2, a3, a4, a5) |
413 stmt_ty _Py_AugAssign(expr_ty target, operator_ty op, expr_ty value, int | 407 stmt_ty _Py_AugAssign(expr_ty target, operator_ty op, expr_ty value, int |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 col_offset, PyArena *arena); | 484 col_offset, PyArena *arena); |
491 #define Yield(a0, a1, a2, a3) _Py_Yield(a0, a1, a2, a3) | 485 #define Yield(a0, a1, a2, a3) _Py_Yield(a0, a1, a2, a3) |
492 expr_ty _Py_Yield(expr_ty value, int lineno, int col_offset, PyArena *arena); | 486 expr_ty _Py_Yield(expr_ty value, int lineno, int col_offset, PyArena *arena); |
493 #define Compare(a0, a1, a2, a3, a4, a5) _Py_Compare(a0, a1, a2, a3, a4, a5) | 487 #define Compare(a0, a1, a2, a3, a4, a5) _Py_Compare(a0, a1, a2, a3, a4, a5) |
494 expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_seq * comparators, | 488 expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_seq * comparators, |
495 int lineno, int col_offset, PyArena *arena); | 489 int lineno, int col_offset, PyArena *arena); |
496 #define Call(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Call(a0, a1, a2, a3, a4, a5, a6
, a7) | 490 #define Call(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Call(a0, a1, a2, a3, a4, a5, a6
, a7) |
497 expr_ty _Py_Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, expr_ty | 491 expr_ty _Py_Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, expr_ty |
498 starargs, expr_ty kwargs, int lineno, int col_offset, PyArena | 492 starargs, expr_ty kwargs, int lineno, int col_offset, PyArena |
499 *arena); | 493 *arena); |
500 #define Num(a0, a1, a2, a3) _Py_Num(a0, a1, a2, a3) | 494 #define Lit(a0, a1, a2, a3) _Py_Lit(a0, a1, a2, a3) |
501 expr_ty _Py_Num(object n, int lineno, int col_offset, PyArena *arena); | 495 expr_ty _Py_Lit(object v, int lineno, int col_offset, PyArena *arena); |
502 #define Str(a0, a1, a2, a3) _Py_Str(a0, a1, a2, a3) | |
503 expr_ty _Py_Str(string s, int lineno, int col_offset, PyArena *arena); | |
504 #define Bytes(a0, a1, a2, a3) _Py_Bytes(a0, a1, a2, a3) | |
505 expr_ty _Py_Bytes(string s, int lineno, int col_offset, PyArena *arena); | |
506 #define Ellipsis(a0, a1, a2) _Py_Ellipsis(a0, a1, a2) | |
507 expr_ty _Py_Ellipsis(int lineno, int col_offset, PyArena *arena); | |
508 #define Attribute(a0, a1, a2, a3, a4, a5) _Py_Attribute(a0, a1, a2, a3, a4, a5) | 496 #define Attribute(a0, a1, a2, a3, a4, a5) _Py_Attribute(a0, a1, a2, a3, a4, a5) |
509 expr_ty _Py_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int | 497 expr_ty _Py_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int |
510 lineno, int col_offset, PyArena *arena); | 498 lineno, int col_offset, PyArena *arena); |
511 #define Subscript(a0, a1, a2, a3, a4, a5) _Py_Subscript(a0, a1, a2, a3, a4, a5) | 499 #define Subscript(a0, a1, a2, a3, a4, a5) _Py_Subscript(a0, a1, a2, a3, a4, a5) |
512 expr_ty _Py_Subscript(expr_ty value, slice_ty slice, expr_context_ty ctx, int | 500 expr_ty _Py_Subscript(expr_ty value, slice_ty slice, expr_context_ty ctx, int |
513 lineno, int col_offset, PyArena *arena); | 501 lineno, int col_offset, PyArena *arena); |
514 #define Starred(a0, a1, a2, a3, a4) _Py_Starred(a0, a1, a2, a3, a4) | 502 #define Starred(a0, a1, a2, a3, a4) _Py_Starred(a0, a1, a2, a3, a4) |
515 expr_ty _Py_Starred(expr_ty value, expr_context_ty ctx, int lineno, int | 503 expr_ty _Py_Starred(expr_ty value, expr_context_ty ctx, int lineno, int |
516 col_offset, PyArena *arena); | 504 col_offset, PyArena *arena); |
517 #define Name(a0, a1, a2, a3, a4) _Py_Name(a0, a1, a2, a3, a4) | 505 #define Name(a0, a1, a2, a3, a4) _Py_Name(a0, a1, a2, a3, a4) |
(...skipping 26 matching lines...) Expand all Loading... |
544 #define arg(a0, a1, a2) _Py_arg(a0, a1, a2) | 532 #define arg(a0, a1, a2) _Py_arg(a0, a1, a2) |
545 arg_ty _Py_arg(identifier arg, expr_ty annotation, PyArena *arena); | 533 arg_ty _Py_arg(identifier arg, expr_ty annotation, PyArena *arena); |
546 #define keyword(a0, a1, a2) _Py_keyword(a0, a1, a2) | 534 #define keyword(a0, a1, a2) _Py_keyword(a0, a1, a2) |
547 keyword_ty _Py_keyword(identifier arg, expr_ty value, PyArena *arena); | 535 keyword_ty _Py_keyword(identifier arg, expr_ty value, PyArena *arena); |
548 #define alias(a0, a1, a2) _Py_alias(a0, a1, a2) | 536 #define alias(a0, a1, a2) _Py_alias(a0, a1, a2) |
549 alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena); | 537 alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena); |
550 | 538 |
551 PyObject* PyAST_mod2obj(mod_ty t); | 539 PyObject* PyAST_mod2obj(mod_ty t); |
552 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); | 540 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); |
553 int PyAST_Check(PyObject* obj); | 541 int PyAST_Check(PyObject* obj); |
OLD | NEW |