1 #ifndef Py_AST_H
2 #define Py_AST_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 #include "Python-ast.h"   /* mod_ty */
8 #include "node.h"         /* node */
9 
10 PyAPI_FUNC(int) PyAST_Validate(mod_ty);
11 PyAPI_FUNC(mod_ty) PyAST_FromNode(
12     const node *n,
13     PyCompilerFlags *flags,
14     const char *filename,       /* decoded from the filesystem encoding */
15     PyArena *arena);
16 PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
17     const node *n,
18     PyCompilerFlags *flags,
19     PyObject *filename,
20     PyArena *arena);
21 
22 #ifndef Py_LIMITED_API
23 
24 /* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
25 PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty);
26 
27 /* 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. */
30 PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_seq *);
31 
32 #endif /* !Py_LIMITED_API */
33 
34 #ifdef __cplusplus
35 }
36 #endif
37 #endif /* !Py_AST_H */
38