ast.h 948 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef Py_AST_H
  2. #define Py_AST_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "Python-ast.h" /* mod_ty */
  7. #include "node.h" /* node */
  8. PyAPI_FUNC(int) PyAST_Validate(mod_ty);
  9. PyAPI_FUNC(mod_ty) PyAST_FromNode(
  10. const node *n,
  11. PyCompilerFlags *flags,
  12. const char *filename, /* decoded from the filesystem encoding */
  13. PyArena *arena);
  14. PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
  15. const node *n,
  16. PyCompilerFlags *flags,
  17. PyObject *filename,
  18. PyArena *arena);
  19. #ifndef Py_LIMITED_API
  20. /* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
  21. PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty);
  22. /* Return the borrowed reference to the first literal string in the
  23. sequence of statemnts or NULL if it doesn't start from a literal string.
  24. Doesn't set exception. */
  25. PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_seq *);
  26. #endif /* !Py_LIMITED_API */
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #endif /* !Py_AST_H */