This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1018 B

  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. def __init__(self, global_keep_all_tokens: bool = False, import_paths: List[Union[str, Callable]] = None) -> None: ...
  13. def load_grammar(self, grammar_text: str, grammar_name: str = ..., mangle: Callable[[str], str] = None) -> None: ...
  14. def do_import(self, dotted_path: Tuple[str, ...], base_path: Optional[str], aliases: Dict[str, str],
  15. base_mangle: Callable[[str], str] = None) -> None: ...
  16. def validate(self) -> None: ...
  17. def build(self) -> Grammar: ...
  18. def find_grammar_errors(text: str, start: str='start') -> List[Tuple[UnexpectedInput, str]]: ...