import openpower.oppc.pc_ast as pc_ast
+class Hook(mdis.dispatcher.Hook):
+ def __call__(self, call):
+ hook = super().__call__(call)
+
+ class ConcreteHook(hook.__class__):
+ @functools.wraps(hook.__call__)
+ @contextlib.contextmanager
+ def __call__(self, dispatcher, node, *args, **kwargs):
+ return hook(dispatcher, node, *args, **kwargs)
+
+ return ConcreteHook(*tuple(self))
+
+
class Code(list):
def __init__(self):
self.__level = 0
self.append(item)
-class Hook(mdis.dispatcher.Hook):
- def __call__(self, call):
- hook = super().__call__(call)
-
- class ConcreteHook(hook.__class__):
- @functools.wraps(hook.__call__)
- @contextlib.contextmanager
- def __call__(self, dispatcher, node, *args, **kwargs):
- return hook(dispatcher, node, *args, **kwargs)
-
- return ConcreteHook(*tuple(self))
-
-
class PseudocodeVisitor(mdis.visitor.ContextVisitor):
def __init__(self, root):
self.__root = root