Lex a string.
        
        :param string: The input to lex. 
        :return: A generator which will continue yielding tokens until the end
                 of the input is reached.

def lex(self, string):
        """
        Lex a string.
        
        :param string: The input to lex. 
        :return: A generator which will continue yielding tokens until the end
                 of the input is reached.
        """
        self.lexer.input(string)
        for token in self.lexer:
            yield token