Package lepl :: Package lexer :: Module stream :: Class FilteredTokenHelper
[hide private]
[frames] | no frames]

Class FilteredTokenHelper

source code


Used by RestrictTokensBy to filter tokens from the delegate.

This filters a list of token IDs in order. If the entire list does not match then then next token is returned (even if it appears in the list).

Instance Methods [hide private]
 
__init__(self, delegate, *ids)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
next(self, state, count=1)
Return (value, stream) where value is the next value (or values if count > 1) from the stream and stream is advanced to the next character.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from stream.facade.HelperFacade: __eq__, cacheable, debug, deepest, delta, empty, eq, fmt, join, kargs, key, len, line, new_max, stream

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, delegate, *ids)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: stream.core.StreamHelper.__init__

next(self, state, count=1)

source code 

Return (value, stream) where value is the next value (or values if count > 1) from the stream and stream is advanced to the next character. Note that value is always a sequence (so if the stream is a list of integers, and `count`=1, then it will be a unitary list, for example).

Should raise StopIteration when no more data are available.

Overrides: stream.core.StreamHelper.next
(inherited documentation)