def METHOD_NAME(self):
    def iterate():
        # An API just for Jedi.
        for stack_node in reversed(self):
            for transition in stack_node.dfa.transitions:
                if isinstance(transition, ReservedString):
                    yield transition.value
                else:
                    yield transition  # A token type
            if not stack_node.dfa.is_final:
                break
    return list(iterate())