ParseTreeTransforms.pxd 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. from __future__ import absolute_import
  2. cimport cython
  3. from .Visitor cimport (
  4. CythonTransform, VisitorTransform, TreeVisitor,
  5. ScopeTrackingTransform, EnvTransform)
  6. cdef class SkipDeclarations: # (object):
  7. pass
  8. cdef class NormalizeTree(CythonTransform):
  9. cdef bint is_in_statlist
  10. cdef bint is_in_expr
  11. cpdef visit_StatNode(self, node, is_listcontainer=*)
  12. cdef class PostParse(ScopeTrackingTransform):
  13. cdef dict specialattribute_handlers
  14. cdef size_t lambda_counter
  15. cdef size_t genexpr_counter
  16. cdef _visit_assignment_node(self, node, list expr_list)
  17. #def eliminate_rhs_duplicates(list expr_list_list, list ref_node_sequence)
  18. #def sort_common_subsequences(list items)
  19. @cython.locals(starred_targets=Py_ssize_t, lhs_size=Py_ssize_t, rhs_size=Py_ssize_t)
  20. cdef flatten_parallel_assignments(list input, list output)
  21. cdef map_starred_assignment(list lhs_targets, list starred_assignments, list lhs_args, list rhs_args)
  22. #class PxdPostParse(CythonTransform, SkipDeclarations):
  23. #class InterpretCompilerDirectives(CythonTransform, SkipDeclarations):
  24. #class WithTransform(CythonTransform, SkipDeclarations):
  25. #class DecoratorTransform(CythonTransform, SkipDeclarations):
  26. #class AnalyseDeclarationsTransform(EnvTransform):
  27. cdef class AnalyseExpressionsTransform(CythonTransform):
  28. pass
  29. cdef class ExpandInplaceOperators(EnvTransform):
  30. pass
  31. cdef class AlignFunctionDefinitions(CythonTransform):
  32. cdef dict directives
  33. cdef set imported_names
  34. cdef object scope
  35. @cython.final
  36. cdef class YieldNodeCollector(TreeVisitor):
  37. cdef public list yields
  38. cdef public list returns
  39. cdef public list finallys
  40. cdef public list excepts
  41. cdef public bint has_return_value
  42. cdef public bint has_yield
  43. cdef public bint has_await
  44. @cython.final
  45. cdef class MarkClosureVisitor(CythonTransform):
  46. cdef bint needs_closure
  47. @cython.final
  48. cdef class CreateClosureClasses(CythonTransform):
  49. cdef list path
  50. cdef bint in_lambda
  51. cdef module_scope
  52. cdef generator_class
  53. cdef create_class_from_scope(self, node, target_module_scope, inner_node=*)
  54. cdef find_entries_used_in_closures(self, node)
  55. #cdef class InjectGilHandling(VisitorTransform, SkipDeclarations):
  56. # cdef bint nogil
  57. cdef class GilCheck(VisitorTransform):
  58. cdef list env_stack
  59. cdef bint nogil
  60. cdef bint nogil_declarator_only
  61. cdef class TransformBuiltinMethods(EnvTransform):
  62. cdef visit_cython_attribute(self, node)