aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/lark-stubs/tree.pyi
blob: 0c128198404179d37776578ff49cfce2649a67cc (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# -*- coding: utf-8 -*-

from typing import List, Callable, Iterator, Union, Optional, Literal, Any
from .lexer import TerminalDef

class Meta:
    empty: bool
    line: int
    column: int
    start_pos: int
    end_line: int
    end_column: int
    end_pos: int
    orig_expansion: List[TerminalDef]
    match_tree: bool


class Tree:
    data: str
    children: List[Union[str, Tree]]
    meta: Meta

    def __init__(
        self,
        data: str,
        children: List[Union[str, Tree]],
        meta: Optional[Meta] = None
    ) -> None:
        ...

    def pretty(self, indent_str: str = ...) -> str:
        ...

    def find_pred(self, pred: Callable[[Tree], bool]) -> Iterator[Tree]:
        ...

    def find_data(self, data: str) -> Iterator[Tree]:
        ...

    def expand_kids_by_index(self, *indices: int) -> None:
        ...

    def expand_kids_by_data(self, *data_values: str) -> bool:
        ...

    def scan_values(self, pred: Callable[[Union[str, Tree]], bool]) -> Iterator[str]:
        ...

    def iter_subtrees(self) -> Iterator[Tree]:
        ...

    def iter_subtrees_topdown(self) -> Iterator[Tree]:
        ...

    def copy(self) -> Tree:
        ...

    def set(self, data: str, children: List[Union[str, Tree]]) -> None:
        ...

    def __hash__(self) -> int:
        ...


class SlottedTree(Tree):
    pass


def pydot__tree_to_png(
    tree: Tree,
    filename: str,
    rankdir: Literal["TB", "LR", "BT", "RL"] = ...,
    **kwargs
) -> None:
    ...