(self)
This is where the magic happens.

        We do our usually processing through the states and when we have a token
        to return we yield the token which pauses processing until the next token
        is requested.
This is where the magic happens.
This is where the magic happens .
def __iter__(self):
        """ This is where the magic happens.

        We do our usually processing through the states and when we have a token
        to return we yield the token which pauses processing until the next token
        is requested.
        """
        self.tokenQueue = deque([])
        # Start processing. When EOF is reached self.state will return False
        # instead of True and the loop will terminate.
        while self.state():
            while self.stream.errors:
                yield {"type": tokenTypes["ParseError"], "data": self.stream.errors.pop(0)}
            while self.tokenQueue:
                yield self.tokenQueue.popleft()
def __iter__ ( self ) : self . tokenQueue = deque ( [ ] ) # Start processing. When EOF is reached self.state will return False # instead of True and the loop will terminate. while self . state ( ) : while self . stream . errors : yield { "type" : tokenTypes [ "ParseError" ] , "data" : self . stream . errors . pop ( 0 ) } while self . tokenQueue : yield self . tokenQueue . popleft ( )