'Generator yielding ungrouped tokens.
This method is recursively called for all child tokens.'

def flatten(self):

    for token in self.tokens:
        if token.is_group():
            for item in token.flatten():
                (yield item)
        else:
            (yield token)
