diff options
author | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
---|---|---|
committer | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
commit | bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch) | |
tree | 1d1df72c0541a59a81439842f46d95396d3e7189 /contrib/tools/cython/Cython/Compiler/Visitor.pxd | |
parent | 8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff) | |
download | ydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz |
add ymake export to ydb
Diffstat (limited to 'contrib/tools/cython/Cython/Compiler/Visitor.pxd')
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/Visitor.pxd | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/contrib/tools/cython/Cython/Compiler/Visitor.pxd b/contrib/tools/cython/Cython/Compiler/Visitor.pxd new file mode 100644 index 0000000000..d5d5692aa7 --- /dev/null +++ b/contrib/tools/cython/Cython/Compiler/Visitor.pxd @@ -0,0 +1,55 @@ +from __future__ import absolute_import + +cimport cython + +cdef class TreeVisitor: + cdef public list access_path + cdef dict dispatch_table + + cpdef visit(self, obj) + cdef _visit(self, obj) + cdef find_handler(self, obj) + cdef _visitchild(self, child, parent, attrname, idx) + cdef dict _visitchildren(self, parent, attrs) + cpdef visitchildren(self, parent, attrs=*) + cdef _raise_compiler_error(self, child, e) + +cdef class VisitorTransform(TreeVisitor): + cdef dict _process_children(self, parent, attrs=*) + cpdef visitchildren(self, parent, attrs=*, exclude=*) + cdef list _flatten_list(self, list orig_list) + cdef list _select_attrs(self, attrs, exclude) + +cdef class CythonTransform(VisitorTransform): + cdef public context + cdef public current_directives + +cdef class ScopeTrackingTransform(CythonTransform): + cdef public scope_type + cdef public scope_node + cdef visit_scope(self, node, scope_type) + +cdef class EnvTransform(CythonTransform): + cdef public list env_stack + +cdef class MethodDispatcherTransform(EnvTransform): + @cython.final + cdef _visit_binop_node(self, node) + @cython.final + cdef _find_handler(self, match_name, bint has_kwargs) + @cython.final + cdef _delegate_to_assigned_value(self, node, function, arg_list, kwargs) + @cython.final + cdef _dispatch_to_handler(self, node, function, arg_list, kwargs) + @cython.final + cdef _dispatch_to_method_handler(self, attr_name, self_arg, + is_unbound_method, type_name, + node, function, arg_list, kwargs) + +cdef class RecursiveNodeReplacer(VisitorTransform): + cdef public orig_node + cdef public new_node + +cdef class NodeFinder(TreeVisitor): + cdef node + cdef public bint found |