This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

40 righe
881 B

  1. # -*- coding: utf-8 -*-
  2. from typing import List, Dict, Union, Callable, Iterable
  3. from .grammar import Symbol
  4. from .lark import Lark
  5. from .tree import Tree
  6. from .visitors import Transformer_InPlace
  7. from .lexer import TerminalDef
  8. class WriteTokensTransformer(Transformer_InPlace):
  9. def __init__(self, tokens: Dict[str, TerminalDef], Dict[str, Callable[[Symbol], str]] = ...):
  10. ...
  11. class MatchTree(Tree):
  12. pass
  13. class MakeMatchTree:
  14. name: str
  15. expansion: List[TerminalDef]
  16. def __init__(self, name: str, expansion: List[TerminalDef]):
  17. ...
  18. def __call__(self, args: List[Union[str, Tree]]):
  19. ...
  20. class Reconstructor:
  21. def __init__(self, parser: Lark, term_subs: Dict[str, Callable[[Symbol], str]] = ...):
  22. ...
  23. def reconstruct(self, tree: Tree, postproc: Callable[[Iterable[str]], Iterable[str]]) -> str:
  24. ...