Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
jinja2.lexer.TokenStream Class Reference

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[Tokennext_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
 

Detailed Description

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`.

Member Function Documentation

◆ __next__()

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.

◆ close()

None jinja2.lexer.TokenStream.close (   self)
Close the stream.

◆ eos()

bool jinja2.lexer.TokenStream.eos (   self)
Are we at the end of the stream?

◆ expect()

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`.

◆ look()

Token jinja2.lexer.TokenStream.look (   self)
Look at the next token.

◆ next_if()

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`.

◆ push()

None jinja2.lexer.TokenStream.push (   self,
Token  token 
)
Push a token back to the stream.

◆ skip()

None jinja2.lexer.TokenStream.skip (   self,
int   n = 1 
)
Got n tokens ahead.

◆ skip_if()

bool jinja2.lexer.TokenStream.skip_if (   self,
str  expr 
)
Like :meth:`next_if` but only returns `True` or `False`.

The documentation for this class was generated from the following file: