def iter_rev_tokens(revision):
    """Yield tokens of the revision in order."""
    tmp = {'p': [], 's': []}
    for hash_paragraph in revision.ordered_paragraphs:
        if len(revision.paragraphs[hash_paragraph]) > 1:
            tmp['p'].append(hash_paragraph)
            paragraph = revision.paragraphs[hash_paragraph][tmp['p'].count(
                hash_paragraph) - 1]
        else:
            paragraph = revision.paragraphs[hash_paragraph][0]
        tmp['s'][:] = []
        for hash_sentence in paragraph.ordered_sentences:
            if len(paragraph.sentences[hash_sentence]) > 1:
                tmp['s'].append(hash_sentence)
                sentence = paragraph.sentences[hash_sentence][tmp['s'].
                    count(hash_sentence) - 1]
            else:
                sentence = paragraph.sentences[hash_sentence][0]
            for word in sentence.words:
                yield word
