diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2023-04-13 23:44:29 +0200 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2023-04-13 23:44:29 +0200 |
commit | e95d45e41d32c0d73179cea22c8b3ea812eafb41 (patch) | |
tree | 3eb2158353af41195a8a614bea84207e21b922f1 /pyGHDL/dom/Symbol.py | |
parent | f11446e1cfaf0ed4db2d43ec3b9b421de313b6ae (diff) | |
download | ghdl-e95d45e41d32c0d73179cea22c8b3ea812eafb41.tar.gz ghdl-e95d45e41d32c0d73179cea22c8b3ea812eafb41.tar.bz2 ghdl-e95d45e41d32c0d73179cea22c8b3ea812eafb41.zip |
Reworking symbols.
Diffstat (limited to 'pyGHDL/dom/Symbol.py')
-rw-r--r-- | pyGHDL/dom/Symbol.py | 72 |
1 files changed, 28 insertions, 44 deletions
diff --git a/pyGHDL/dom/Symbol.py b/pyGHDL/dom/Symbol.py index e62ec4137..7c29acf06 100644 --- a/pyGHDL/dom/Symbol.py +++ b/pyGHDL/dom/Symbol.py @@ -61,88 +61,72 @@ from pyGHDL.dom.Range import Range @export class LibraryReferenceSymbol(VHDLModel_LibraryReferenceSymbol, DOMMixin): @InheritDocString(VHDLModel_LibraryReferenceSymbol) - def __init__(self, identifierNode: Iir, identifier: str): - super().__init__(identifier) + def __init__(self, identifierNode: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, identifierNode) @export class PackageReferenceSymbol(VHDLModel_PackageReferenceSymbol, DOMMixin): @InheritDocString(VHDLModel_PackageReferenceSymbol) - def __init__(self, identifierNode: Iir, identifier: str, prefix: LibraryReferenceSymbol): - super().__init__(identifier, prefix) - DOMMixin.__init__(self, identifierNode) - - -@export -class PackageMembersReferenceSymbol(VHDLModel_PackageMembersReferenceSymbol, DOMMixin): - @InheritDocString(VHDLModel_PackageMembersReferenceSymbol) - def __init__(self, identifierNode: Iir, identifier: str, prefix: PackageReferenceSymbol): - super().__init__(identifier, prefix) - DOMMixin.__init__(self, identifierNode) - - -@export -class AllPackageMembersReferenceSymbol(VHDLModel_AllPackageMembersReferenceSymbol, DOMMixin): - @InheritDocString(VHDLModel_AllPackageMembersReferenceSymbol) - def __init__(self, identifierNode: Iir, prefix: PackageReferenceSymbol): - super().__init__(prefix) + def __init__(self, identifierNode: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, identifierNode) @export class ContextReferenceSymbol(VHDLModel_ContextReferenceSymbol, DOMMixin): @InheritDocString(VHDLModel_ContextReferenceSymbol) - def __init__(self, identifierNode: Iir, identifier: str, prefix: LibraryReferenceSymbol): - super().__init__(identifier, prefix) + def __init__(self, identifierNode: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, identifierNode) @export class EntityInstantiationSymbol(VHDLModel_EntityInstantiationSymbol, DOMMixin): @InheritDocString(VHDLModel_EntityInstantiationSymbol) - def __init__(self, identifierNode: Iir, identifier: str, prefix: LibraryReferenceSymbol): - super().__init__(identifier, prefix) + def __init__(self, identifierNode: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, identifierNode) @export class ComponentInstantiationSymbol(VHDLModel_ComponentInstantiationSymbol, DOMMixin): @InheritDocString(VHDLModel_ComponentInstantiationSymbol) - def __init__(self, identifierNode: Iir, identifier: str): - super().__init__(identifier) + def __init__(self, identifierNode: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, identifierNode) @export class ConfigurationInstantiationSymbol(VHDLModel_ConfigurationInstantiationSymbol, DOMMixin): @InheritDocString(VHDLModel_ConfigurationInstantiationSymbol) - def __init__(self, identifierNode: Iir, identifier: str): - super().__init__(identifier) + def __init__(self, identifierNode: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, identifierNode) @export class EntitySymbol(VHDLModel_EntitySymbol, DOMMixin): @InheritDocString(VHDLModel_EntitySymbol) - def __init__(self, identifierNode: Iir, identifier: str): - super().__init__(identifier) + def __init__(self, identifierNode: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, identifierNode) @export class ArchitectureSymbol(VHDLModel_ArchitectureSymbol, DOMMixin): @InheritDocString(VHDLModel_ArchitectureSymbol) - def __init__(self, identifierNode: Iir, identifier: str, prefix: EntitySymbol): - super().__init__(identifier, prefix) + def __init__(self, identifierNode: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, identifierNode) @export class PackageSymbol(VHDLModel_PackageSymbol, DOMMixin): @InheritDocString(VHDLModel_PackageSymbol) - def __init__(self, identifierNode: Iir, identifier: str): - super().__init__(identifier) + def __init__(self, identifierNode: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, identifierNode) @@ -184,29 +168,29 @@ class ConstrainedCompositeSubtypeSymbol(VHDLModel_ConstrainedCompositeSubtypeSym @export class SimpleObjectOrFunctionCallSymbol(VHDLModel_SimpleObjectOrFunctionCallSymbol, DOMMixin): - def __init__(self, node: Iir, identifier: str): - super().__init__(identifier) + def __init__(self, node: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, node) @classmethod def parse(cls, node: Iir): - from pyGHDL.dom._Translate import GetNameFromNode + from pyGHDL.dom._Translate import GetName - name = GetNameFromNode(node) + name = GetName(node) - return cls(node, str(name)) # XXX: hacked + return cls(node, name) @export class IndexedObjectOrFunctionCallSymbol(VHDLModel_IndexedObjectOrFunctionCallSymbol, DOMMixin): - def __init__(self, node: Iir, prefix: Name, indices: Iterable[ExpressionUnion]): - super().__init__(prefix, indices) + def __init__(self, node: Iir, name: Name): + super().__init__(name) DOMMixin.__init__(self, node) @classmethod def parse(cls, node: Iir): - from pyGHDL.dom._Translate import GetNameFromNode + from pyGHDL.dom._Translate import GetName - name = GetNameFromNode(node) + name = GetName(node) - return cls(node, name, []) + return cls(node, name) |