'Read the next lexical token from the stream and return a
tuple (value, text), where |value| is the value associated with
the token as specified by the Lexicon, and |text| is the actual
string read from the stream. Returns (None, \'\') on end of file.'

def read(self):

    queue = self.queue
    while (not queue):
        (self.text, action) = self.scan_a_token()
        if (action is None):
            self.produce(None)
            self.eof()
        else:
            value = action.perform(self, self.text)
            if (value is not None):
                self.produce(value)
    result = queue[0]
    del queue[0]
    return result
