blob: a8c52af786b1472200b9b3651462f8101f2d8e0a [file] [log] [blame]
Zackery Spytz421a72a2019-09-12 03:27:14 -06001#ifndef Py_LIMITED_API
Jeremy Hylton3e0055f2005-10-20 19:59:25 +00002#ifndef Py_AST_H
3#define Py_AST_H
4#ifdef __cplusplus
5extern "C" {
6#endif
7
Victor Stinner5f2df882018-11-12 00:56:19 +01008#include "Python-ast.h" /* mod_ty */
9#include "node.h" /* node */
10
Benjamin Peterson832bfe22011-08-09 16:15:04 -050011PyAPI_FUNC(int) PyAST_Validate(mod_ty);
Victor Stinner00676d12010-12-27 01:49:31 +000012PyAPI_FUNC(mod_ty) PyAST_FromNode(
13 const node *n,
14 PyCompilerFlags *flags,
15 const char *filename, /* decoded from the filesystem encoding */
16 PyArena *arena);
Victor Stinner14e461d2013-08-26 22:28:21 +020017PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
18 const node *n,
19 PyCompilerFlags *flags,
20 PyObject *filename,
21 PyArena *arena);
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000022
Guido van Rossum95e4d582018-01-26 08:20:18 -080023/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
Serhiy Storchaka64fddc42018-05-17 06:17:48 +030024PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty);
Guido van Rossum95e4d582018-01-26 08:20:18 -080025
Serhiy Storchaka143ce5c2018-05-30 10:56:16 +030026/* Return the borrowed reference to the first literal string in the
Min ho Kimc4cacc82019-07-31 08:16:13 +100027 sequence of statements or NULL if it doesn't start from a literal string.
Serhiy Storchaka143ce5c2018-05-30 10:56:16 +030028 Doesn't set exception. */
29PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_seq *);
30
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000031#ifdef __cplusplus
32}
33#endif
34#endif /* !Py_AST_H */
Zackery Spytz421a72a2019-09-12 03:27:14 -060035#endif /* !Py_LIMITED_API */