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 NameNodeCollector(TreeVisitor):
  7. cdef list name_nodes
  8. cdef class SkipDeclarations: # (object):
  9. pass
  10. cdef class NormalizeTree(CythonTransform):
  11. cdef bint is_in_statlist
  12. cdef bint is_in_expr
  13. cpdef visit_StatNode(self, node, is_listcontainer=*)
  14. cdef class PostParse(ScopeTrackingTransform):
  15. cdef dict specialattribute_handlers
  16. cdef size_t lambda_counter
  17. cdef size_t genexpr_counter
  18. cdef _visit_assignment_node(self, node, list expr_list)
  19. #def eliminate_rhs_duplicates(list expr_list_list, list ref_node_sequence)
  20. #def sort_common_subsequences(list items)
  21. @cython.locals(starred_targets=Py_ssize_t, lhs_size=Py_ssize_t, rhs_size=Py_ssize_t)
  22. cdef flatten_parallel_assignments(list input, list output)
  23. cdef map_starred_assignment(list lhs_targets, list starred_assignments, list lhs_args, list rhs_args)
  24. #class PxdPostParse(CythonTransform, SkipDeclarations):
  25. #class InterpretCompilerDirectives(CythonTransform, SkipDeclarations):
  26. #class WithTransform(CythonTransform, SkipDeclarations):
  27. #class DecoratorTransform(CythonTransform, SkipDeclarations):
  28. #class AnalyseDeclarationsTransform(EnvTransform):
  29. cdef class AnalyseExpressionsTransform(CythonTransform):
  30. pass
  31. cdef class ExpandInplaceOperators(EnvTransform):
  32. pass
  33. cdef class AlignFunctionDefinitions(CythonTransform):
  34. cdef dict directives
  35. cdef set imported_names
  36. cdef object scope
  37. @cython.final
  38. cdef class YieldNodeCollector(TreeVisitor):
  39. cdef public list yields
  40. cdef public list returns
  41. cdef public list finallys
  42. cdef public list excepts
  43. cdef public bint has_return_value
  44. cdef public bint has_yield
  45. cdef public bint has_await
  46. @cython.final
  47. cdef class MarkClosureVisitor(CythonTransform):
  48. cdef bint needs_closure
  49. @cython.final
  50. cdef class CreateClosureClasses(CythonTransform):
  51. cdef list path
  52. cdef bint in_lambda
  53. cdef module_scope
  54. cdef generator_class
  55. cdef create_class_from_scope(self, node, target_module_scope, inner_node=*)
  56. cdef find_entries_used_in_closures(self, node)
  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)