ast.h 947 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef Py_LIMITED_API
  2. #ifndef Py_AST_H
  3. #define Py_AST_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #include "Python-ast.h" /* mod_ty */
  8. #include "node.h" /* node */
  9. PyAPI_FUNC(int) PyAST_Validate(mod_ty);
  10. PyAPI_FUNC(mod_ty) PyAST_FromNode(
  11. const node *n,
  12. PyCompilerFlags *flags,
  13. const char *filename, /* decoded from the filesystem encoding */
  14. PyArena *arena);
  15. PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
  16. const node *n,
  17. PyCompilerFlags *flags,
  18. PyObject *filename,
  19. PyArena *arena);
  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 statements 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. #ifdef __cplusplus
  27. }
  28. #endif
  29. #endif /* !Py_AST_H */
  30. #endif /* !Py_LIMITED_API */