def __get_driven_sig_name(self, tree: Tree): """ determines which signal is the signal that is being driven currently, it returns the first hvarref node, which is true. But this might be changed at a later point """ for t in tree.iter_subtrees_topdown(): if type(t) == Tree and t.data == 'hvarref': return t.children[0]
def iter_tokens(tree: Tree) -> Iterable[Token]: for t in tree.iter_subtrees_topdown(): for child in t.children: if isinstance(child, Token): yield child