Package EasyExtend :: Package trail :: Module nfaparser :: Class AbstractTokenStream
[hide private]
[frames] | no frames]

Class AbstractTokenStream

object --+
         |
        AbstractTokenStream
Known Subclasses:

TokenStream class objects encapsulate iterator functionality over a token stream for a parser.

Instance Methods [hide private]
 
__init__(self, stream, ignored=[])
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__iter__(self)
 
__getitem__(self, idx)
 
is_ignored(self, tok)
Returns True when input token is in ignore list otherwise False
 
shift_read_position(self)
Shifts read position of token stream without returning token.
 
next(self)
returns next token in token stream.
 
__len__(self)

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, stream, ignored=[])
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

next(self)

 

returns next token in token stream. Using a previous shift_read_position it is actually the current token. Raises StopIteration when the token stream is exhausted.