blob: f1d734852eca79ffb0ebf213751461c8ec54d64d [file] [log] [blame]
Jeremy Hylton3e0055f2005-10-20 19:59:25 +00001#ifndef Py_AST_H
2#define Py_AST_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
Victor Stinner5f2df882018-11-12 00:56:19 +01007#include "Python-ast.h" /* mod_ty */
8#include "node.h" /* node */
9
Benjamin Peterson832bfe22011-08-09 16:15:04 -050010PyAPI_FUNC(int) PyAST_Validate(mod_ty);
Victor Stinner00676d12010-12-27 01:49:31 +000011PyAPI_FUNC(mod_ty) PyAST_FromNode(
12 const node *n,
13 PyCompilerFlags *flags,
14 const char *filename, /* decoded from the filesystem encoding */
15 PyArena *arena);
Victor Stinner14e461d2013-08-26 22:28:21 +020016PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
17 const node *n,
18 PyCompilerFlags *flags,
19 PyObject *filename,
20 PyArena *arena);
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000021
Guido van Rossum95e4d582018-01-26 08:20:18 -080022#ifndef Py_LIMITED_API
23
24/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
Serhiy Storchaka64fddc42018-05-17 06:17:48 +030025PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty);
Guido van Rossum95e4d582018-01-26 08:20:18 -080026
Serhiy Storchaka143ce5c2018-05-30 10:56:16 +030027/* Return the borrowed reference to the first literal string in the
28 sequence of statemnts or NULL if it doesn't start from a literal string.
29 Doesn't set exception. */
30PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_seq *);
31
Guido van Rossum95e4d582018-01-26 08:20:18 -080032#endif /* !Py_LIMITED_API */
33
Jeremy Hylton3e0055f2005-10-20 19:59:25 +000034#ifdef __cplusplus
35}
36#endif
37#endif /* !Py_AST_H */