![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|
Public Member Functions | |
| __init__ (self, t.Iterable[Token] generator, t.Optional[str] name, t.Optional[str] filename) | |
| TokenStreamIterator | __iter__ (self) |
| bool | __bool__ (self) |
| bool | eos (self) |
| None | push (self, Token token) |
| Token | look (self) |
| None | skip (self, int n=1) |
| t.Optional[Token] | next_if (self, str expr) |
| bool | skip_if (self, str expr) |
| Token | __next__ (self) |
| None | close (self) |
| Token | expect (self, str expr) |
Public Attributes | |
| name | |
| filename | |
| closed | |
| current | |
Protected Attributes | |
| _iter | |
| _pushed | |
A token stream is an iterable that yields :class:`Token`\\s. The parser however does not iterate over it but calls :meth:`next` to go one token ahead. The current active token is stored as :attr:`current`.
| Token jinja2.lexer.TokenStream.__next__ | ( | self | ) |
Go one token ahead and return the old one. Use the built-in :func:`next` instead of calling this directly.
| None jinja2.lexer.TokenStream.close | ( | self | ) |
Close the stream.
| bool jinja2.lexer.TokenStream.eos | ( | self | ) |
Are we at the end of the stream?
| Token jinja2.lexer.TokenStream.expect | ( | self, | |
| str | expr | ||
| ) |
Expect a given token type and return it. This accepts the same argument as :meth:`jinja2.lexer.Token.test`.
| Token jinja2.lexer.TokenStream.look | ( | self | ) |
Look at the next token.
| t.Optional[Token] jinja2.lexer.TokenStream.next_if | ( | self, | |
| str | expr | ||
| ) |
Perform the token test and return the token if it matched. Otherwise the return value is `None`.
| None jinja2.lexer.TokenStream.push | ( | self, | |
| Token | token | ||
| ) |
Push a token back to the stream.
| None jinja2.lexer.TokenStream.skip | ( | self, | |
| int | n = 1 |
||
| ) |
Got n tokens ahead.
| bool jinja2.lexer.TokenStream.skip_if | ( | self, | |
| str | expr | ||
| ) |
Like :meth:`next_if` but only returns `True` or `False`.