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.

44 lines
1.0 KiB

  1. from typing import Set, Dict, Any
  2. from lark import Token, Tree
  3. class ParserPuppet(object):
  4. """
  5. Provides an interface to interactively step through the parser (LALR(1) only for now)
  6. Accessible via `UnexpectedToken.puppet` (raised by the parser on token error)
  7. """
  8. parser: Any
  9. parser_state: Any
  10. lexer_state: Any
  11. def feed_token(self, token: Token) -> Any: ...
  12. def exhaust_lexer(self) -> None: ...
  13. def feed_eof(self, last_token: Token = None) -> Any: ...
  14. def copy(self) -> ParserPuppet: ...
  15. def as_immutable(self) -> ImmutableParserPuppet: ...
  16. def pretty(self) -> str: ...
  17. def choices(self) -> Dict[str, Any]: ...
  18. def accepts(self) -> Set[str]: ...
  19. def resume_parse(self) -> Tree: ...
  20. class ImmutableParserPuppet(ParserPuppet):
  21. result: Any = None
  22. def feed_token(self, token: Token) -> ImmutableParserPuppet: ...
  23. def exhaust_lexer(self) -> ImmutableParserPuppet: ...
  24. def feed_eof(self, last_token: Token = None) -> ImmutableParserPuppet: ...