'The main interface with the bottom matcher. The tree is
traversed from the bottom using the constructed
automaton. Nodes are only checked once as the tree is
retraversed. When the automaton fails, we give it one more
shot(in case the above tree matches as a whole with the
rejected leaf), then we break for the next leaf. There is the
special case of multiple arguments(see code comments) where we
recheck the nodes
Args:
The leaves of the AST tree to be matched
Returns:
A dictionary of node matches with fixers as the keys'

def run(self, leaves):

    current_ac_node = self.root
    results = defaultdict(list)
    for leaf in leaves:
        current_ast_node = leaf
        while current_ast_node:
            current_ast_node.was_checked = True
            for child in current_ast_node.children:
                if (isinstance(child, pytree.Leaf) and (child.value == ';')):
                    current_ast_node.was_checked = False
                    break
            if (current_ast_node.type == 1):
                node_token = current_ast_node.value
            else:
                node_token = current_ast_node.type
            if (node_token in current_ac_node.transition_table):
                current_ac_node = current_ac_node.transition_table[node_token]
                for fixer in current_ac_node.fixers:
                    if (fixer not in results):
                        results[fixer] = []
                    results[fixer].append(current_ast_node)
            else:
                current_ac_node = self.root
                if ((current_ast_node.parent is not None) and current_ast_node.parent.was_checked):
                    break
                if (node_token in current_ac_node.transition_table):
                    current_ac_node = current_ac_node.transition_table[node_token]
                    for fixer in current_ac_node.fixers:
                        if (fixer not in results.keys()):
                            results[fixer] = []
                        results[fixer].append(current_ast_node)
            current_ast_node = current_ast_node.parent
    return results
