from ..tools import flatten
from ..hdl.ast import *
-from ..hdl.xfrm import AbstractValueTransformer, AbstractStatementTransformer
+from ..hdl.xfrm import ValueVisitor, StatementVisitor
__all__ = ["Simulator", "Delay", "Tick", "Passive", "DeadlineError"]
normalize = Const.normalize
-class _RHSValueCompiler(AbstractValueTransformer):
+class _RHSValueCompiler(ValueVisitor):
def __init__(self, signal_slots, sensitivity=None, mode="rhs"):
self.signal_slots = signal_slots
self.sensitivity = sensitivity
return eval
-class _LHSValueCompiler(AbstractValueTransformer):
+class _LHSValueCompiler(ValueVisitor):
def __init__(self, signal_slots, rhs_compiler):
self.signal_slots = signal_slots
self.rhs_compiler = rhs_compiler
return eval
-class _StatementCompiler(AbstractStatementTransformer):
+class _StatementCompiler(StatementVisitor):
def __init__(self, signal_slots):
self.sensitivity = SignalSet()
self.rrhs_compiler = _RHSValueCompiler(signal_slots, self.sensitivity, mode="rhs")
from .ir import *
-__all__ = ["AbstractValueTransformer", "ValueTransformer",
- "AbstractStatementTransformer", "StatementTransformer",
+__all__ = ["ValueVisitor", "ValueTransformer",
+ "StatementVisitor", "StatementTransformer",
"FragmentTransformer",
"DomainRenamer", "DomainLowerer", "ResetInserter", "CEInserter"]
-class AbstractValueTransformer(metaclass=ABCMeta):
+class ValueVisitor(metaclass=ABCMeta):
@abstractmethod
def on_Const(self, value):
pass # :nocov:
return self.on_value(value)
-class ValueTransformer(AbstractValueTransformer):
+class ValueTransformer(ValueVisitor):
def on_Const(self, value):
return value
self.on_value(value.index))
-class AbstractStatementTransformer(metaclass=ABCMeta):
+class StatementVisitor(metaclass=ABCMeta):
@abstractmethod
def on_Assign(self, stmt):
pass # :nocov:
return self.on_statement(value)
-class StatementTransformer(AbstractStatementTransformer):
+class StatementTransformer(StatementVisitor):
def on_value(self, value):
return value