Python-ast.h 26 KB

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