2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

syntaxtree.pxd 1.4 KB
Newer Older
Eckhart Arnold's avatar
Eckhart Arnold committed
1
2
3
4
#cython: infer_types=True
#cython: language_level=3
#cython: c_string_type=unicode
#cython: c_string_encoding=utf-8
5
6
7
8
9
10
11
12
13
14


cdef class Node:
    cdef public int _pos
    cdef public object _result
    cdef public tuple children
    cdef public int _len
    cdef public str tag_name
    cdef object _xml_attr

Eckhart Arnold's avatar
Eckhart Arnold committed
15
16
    cpdef get(self,  index_or_tagname, surrogate)
    cpdef is_anonymous(self)
17
    cpdef _content(self)
Eckhart Arnold's avatar
Eckhart Arnold committed
18
    cpdef with_pos(self, pos)
19
    cpdef has_attr(self)
Eckhart Arnold's avatar
Eckhart Arnold committed
20
21
22
23
24
25
26
27
    # cpdef compare_attr(self, other)
    # cpdef _tree_repr(self, tab, open_fn, close_fn, data_fn, density, inline, inline_fn)
    # cpdef as_sxpr(self, src, indentation, compact)
    # cpdef as_xml(self, src, indentation, inline_tags, omit_tags, empty_tags)
    # cpdef select(self, match_function, include_root, reverse)
    # cpdef select_by_tag(self, tag_names, include_root)
    cpdef pick(self, tag_names)
    # cpdef tree_size(self)
Eckhart Arnold's avatar
Eckhart Arnold committed
28
    cpdef to_json_obj(self)
Eckhart Arnold's avatar
Eckhart Arnold committed
29
30
31


cdef class FrozenNode(Node):
Eckhart Arnold's avatar
Eckhart Arnold committed
32
    cpdef with_pos(self, pos)
Eckhart Arnold's avatar
Eckhart Arnold committed
33
34


35
cdef class RootNode(Node):
Eckhart Arnold's avatar
Eckhart Arnold committed
36
    cdef public list errors
37
38
    cdef public object error_nodes
    cdef public object error_positions
39
40
41
42
    cdef public int error_flag
    cdef public set inline_tags
    cdef public set omit_tags
    cdef public set empty_tags
Eckhart Arnold's avatar
Eckhart Arnold committed
43
44
45
46
47
48

    # cpdef swallow(self, node)
    # cpdef add_error(self, node, error)
    # cpdef new_error(self, node, message, code)
    # cpdef get_errors(self, node)
    cpdef customized_XML(self)