Python-ast.h 26 KB

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