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