This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1 KiB

  1. from typing import List, Tuple, Union, Callable, Dict, Optional
  2. from .tree import Tree
  3. from .grammar import RuleOptions
  4. from .exceptions import UnexpectedInput
  5. class Grammar:
  6. rule_defs: List[Tuple[str, Tuple[str, ...], Tree, RuleOptions]]
  7. term_defs: List[Tuple[str, Tuple[Tree, int]]]
  8. ignore: List[str]
  9. class GrammarBuilder:
  10. global_keep_all_tokens: bool
  11. import_paths: List[Union[str, Callable]]
  12. used_files: Dict[str, str]
  13. def __init__(self, global_keep_all_tokens: bool = False, import_paths: List[Union[str, Callable]] = None, used_files: Dict[str, str]=None) -> None: ...
  14. def load_grammar(self, grammar_text: str, grammar_name: str = ..., mangle: Callable[[str], str] = None) -> None: ...
  15. def do_import(self, dotted_path: Tuple[str, ...], base_path: Optional[str], aliases: Dict[str, str],
  16. base_mangle: Callable[[str], str] = None) -> None: ...
  17. def validate(self) -> None: ...
  18. def build(self) -> Grammar: ...
  19. def find_grammar_errors(text: str, start: str='start') -> List[Tuple[UnexpectedInput, str]]: ...