diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-06-28 17:24:40 +0200 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-07-01 06:39:46 +0200 |
commit | e8556a64e6ad3cedbe4862e6be992f516536abf7 (patch) | |
tree | 5f5f7f3cd8cc0522742488c7060f014d92a2e5b6 /pyGHDL/dom/InterfaceItem.py | |
parent | 3c26dd63f093e156c9bf4143aeddafd3a4664ecc (diff) | |
download | ghdl-e8556a64e6ad3cedbe4862e6be992f516536abf7.tar.gz ghdl-e8556a64e6ad3cedbe4862e6be992f516536abf7.tar.bz2 ghdl-e8556a64e6ad3cedbe4862e6be992f516536abf7.zip |
Rework and fine tuning.
Diffstat (limited to 'pyGHDL/dom/InterfaceItem.py')
-rw-r--r-- | pyGHDL/dom/InterfaceItem.py | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/pyGHDL/dom/InterfaceItem.py b/pyGHDL/dom/InterfaceItem.py index 97ef0cfe8..31e2058cb 100644 --- a/pyGHDL/dom/InterfaceItem.py +++ b/pyGHDL/dom/InterfaceItem.py @@ -89,7 +89,7 @@ class GenericTypeInterfaceItem(VHDLModel_GenericTypeInterfaceItem, DOMMixin): node: Iir, name: str, ): - super().__init__(name=name) + super().__init__(name) DOMMixin.__init__(self, node) @classmethod @@ -129,10 +129,6 @@ class GenericProcedureInterfaceItem(VHDLModel_GenericProcedureInterfaceItem, DOM @classmethod def parse(cls, genericNode: Iir) -> "GenericProcedureInterfaceItem": name = GetNameOfNode(genericNode) - mode = GetModeOfNode(genericNode) - subTypeIndication = GetSubTypeIndicationFromNode(genericNode, "generic", name) - default = nodes.Get_Default_Value(genericNode) - value = GetExpressionFromNode(default) if default else None return cls(genericNode, name) @@ -150,10 +146,6 @@ class GenericFunctionInterfaceItem(VHDLModel_GenericFunctionInterfaceItem, DOMMi @classmethod def parse(cls, genericNode: Iir) -> "GenericFunctionInterfaceItem": name = GetNameOfNode(genericNode) - mode = GetModeOfNode(genericNode) - subTypeIndication = GetSubTypeIndicationFromNode(genericNode, "generic", name) - default = nodes.Get_Default_Value(genericNode) - value = GetExpressionFromNode(default) if default else None return cls(genericNode, name) @@ -232,13 +224,9 @@ class ParameterVariableInterfaceItem( subType: SubTypeOrSymbol, defaultExpression: Expression = None, ): - super().__init__(name, mode) + super().__init__(name, mode, subType, defaultExpression) DOMMixin.__init__(self, node) - # TODO: move to model - self._subType = subType - self._defaultExpression = defaultExpression - @classmethod def parse(cls, parameterNode: Iir) -> "ParameterVariableInterfaceItem": name = GetNameOfNode(parameterNode) @@ -267,13 +255,9 @@ class ParameterSignalInterfaceItem(VHDLModel_ParameterSignalInterfaceItem, DOMMi subType: SubTypeOrSymbol, defaultExpression: Expression = None, ): - super().__init__(name, mode) + super().__init__(name, mode, subType, defaultExpression) DOMMixin.__init__(self, node) - # TODO: move to model - self._subType = subType - self._defaultExpression = defaultExpression - @classmethod def parse(cls, parameterNode: Iir) -> "ParameterSignalInterfaceItem": name = GetNameOfNode(parameterNode) @@ -298,21 +282,16 @@ class ParameterFileInterfaceItem(VHDLModel_ParameterFileInterfaceItem, DOMMixin) self, node: Iir, name: str, - mode: Mode, subType: SubTypeOrSymbol, ): - super().__init__(name, mode) + super().__init__(name, subType) DOMMixin.__init__(self, node) - # TODO: move to model - self._subType = subType - @classmethod def parse(cls, parameterNode: Iir) -> "ParameterFileInterfaceItem": name = GetNameOfNode(parameterNode) - mode = GetModeOfNode(parameterNode) subTypeIndication = GetSubTypeIndicationFromNode( parameterNode, "parameter", name ) - return cls(parameterNode, name, mode, subTypeIndication) + return cls(parameterNode, name, subTypeIndication) |