class documentation
class Tokenizer: (source)
Context-sensitive token parsing. Provides methods to examine the input stream to check whether the next token matches.
Method | __init__ |
Undocumented |
Method | check |
Check whether the next token has the provided name. |
Method | consume |
Move beyond provided token name, if at current position. |
Method | enclosing |
Undocumented |
Method | expect |
Expect a certain token name next, failing with a syntax error otherwise. |
Method | raise |
Raise ParserSyntaxError at the given position. |
Method | read |
Consume the next token and return it. |
Instance Variable | next |
Undocumented |
Instance Variable | position |
Undocumented |
Instance Variable | rules |
Undocumented |
Instance Variable | source |
Undocumented |
Check whether the next token has the provided name. By default, if the check succeeds, the token *must* be read before another check. If `peek` is set to `True`, the token is not loaded and would need to be checked again.
@contextlib.contextmanager
def enclosing_tokens(self, open_token:
def enclosing_tokens(self, open_token:
str
, close_token: str
) -> Iterator[ bool]
:
(source)
¶
Undocumented