]> git.madduck.net Git - etc/vim.git/blob - blib2to3/pgen2/pgen.pyi

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fix tests on 3.7
[etc/vim.git] / blib2to3 / pgen2 / pgen.pyi
1 # Stubs for lib2to3.pgen2.pgen (Python 3.6)
2
3 from typing import Any, Dict, IO, Iterable, Iterator, List, Optional, Text, Tuple
4 from mypy_extensions import NoReturn
5
6 from blib2to3.pgen2 import _Path, grammar
7 from blib2to3.pgen2.tokenize import _TokenInfo
8
9 class PgenGrammar(grammar.Grammar): ...
10
11 class ParserGenerator:
12     filename: _Path
13     stream: IO[Text]
14     generator: Iterator[_TokenInfo]
15     first: Dict[Text, Dict[Text, int]]
16     def __init__(self, filename: _Path, stream: Optional[IO[Text]] = ...) -> None: ...
17     def make_grammar(self) -> PgenGrammar: ...
18     def make_first(self, c: PgenGrammar, name: Text) -> Dict[int, int]: ...
19     def make_label(self, c: PgenGrammar, label: Text) -> int: ...
20     def addfirstsets(self) -> None: ...
21     def calcfirst(self, name: Text) -> None: ...
22     def parse(self) -> Tuple[Dict[Text, List[DFAState]], Text]: ...
23     def make_dfa(self, start: NFAState, finish: NFAState) -> List[DFAState]: ...
24     def dump_nfa(self, name: Text, start: NFAState, finish: NFAState) -> List[DFAState]: ...
25     def dump_dfa(self, name: Text, dfa: Iterable[DFAState]) -> None: ...
26     def simplify_dfa(self, dfa: List[DFAState]) -> None: ...
27     def parse_rhs(self) -> Tuple[NFAState, NFAState]: ...
28     def parse_alt(self) -> Tuple[NFAState, NFAState]: ...
29     def parse_item(self) -> Tuple[NFAState, NFAState]: ...
30     def parse_atom(self) -> Tuple[NFAState, NFAState]: ...
31     def expect(self, type: int, value: Optional[Any] = ...) -> Text: ...
32     def gettoken(self) -> None: ...
33     def raise_error(self, msg: str, *args: Any) -> NoReturn: ...
34
35 class NFAState:
36     arcs: List[Tuple[Optional[Text], NFAState]]
37     def __init__(self) -> None: ...
38     def addarc(self, next: NFAState, label: Optional[Text] = ...) -> None: ...
39
40 class DFAState:
41     nfaset: Dict[NFAState, Any]
42     isfinal: bool
43     arcs: Dict[Text, DFAState]
44     def __init__(self, nfaset: Dict[NFAState, Any], final: NFAState) -> None: ...
45     def addarc(self, next: DFAState, label: Text) -> None: ...
46     def unifystate(self, old: DFAState, new: DFAState) -> None: ...
47     def __eq__(self, other: Any) -> bool: ...
48
49 def generate_grammar(filename: _Path = ...) -> PgenGrammar: ...