aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/dom/Symbol.py
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2022-12-29 23:16:27 +0100
committerPatrick Lehmann <Patrick.Lehmann@plc2.de>2022-12-29 23:16:27 +0100
commit9cf69f324186932e4308e1ca0b19f563dab90e5e (patch)
treea5e4c126feee8b28af9aa74fd54c67f939fe9632 /pyGHDL/dom/Symbol.py
parent3b019ea6a8eac23ed3270a7112bd092526402211 (diff)
downloadghdl-9cf69f324186932e4308e1ca0b19f563dab90e5e.tar.gz
ghdl-9cf69f324186932e4308e1ca0b19f563dab90e5e.tar.bz2
ghdl-9cf69f324186932e4308e1ca0b19f563dab90e5e.zip
Added Get***Symbol functions. Improved Symbol handling.
Diffstat (limited to 'pyGHDL/dom/Symbol.py')
-rw-r--r--pyGHDL/dom/Symbol.py68
1 files changed, 48 insertions, 20 deletions
diff --git a/pyGHDL/dom/Symbol.py b/pyGHDL/dom/Symbol.py
index 40d877c3f..a9b919ccb 100644
--- a/pyGHDL/dom/Symbol.py
+++ b/pyGHDL/dom/Symbol.py
@@ -35,9 +35,6 @@ from typing import List, Iterator
from pyTooling.Decorators import export, InheritDocString
from pyVHDLModel.SyntaxModel import (
- EntitySymbol as VHDLModel_EntitySymbol,
- ArchitectureSymbol as VHDLModel_ArchitectureSymbol,
- PackageSymbol as VHDLModel_PackageSymbol,
SimpleSubtypeSymbol as VHDLModel_SimpleSubtypeSymbol,
ConstrainedScalarSubtypeSymbol as VHDLModel_ConstrainedScalarSubtypeSymbol,
ConstrainedCompositeSubtypeSymbol as VHDLModel_ConstrainedCompositeSubtypeSymbol,
@@ -50,76 +47,107 @@ from pyVHDLModel.SyntaxModel import (
PackageMembersReferenceSymbol as VHDLModel_PackageMembersReferenceSymbol,
AllPackageMembersReferenceSymbol as VHDLModel_AllPackageMembersReferenceSymbol,
ContextReferenceSymbol as VHDLModel_ContextReferenceSymbol,
+ EntityInstantiationSymbol as VHDLModel_EntityInstantiationSymbol,
+ ComponentInstantiationSymbol as VHDLModel_ComponentInstantiationSymbol,
+ ConfigurationInstantiationSymbol as VHDLModel_ConfigurationInstantiationSymbol,
+ EntitySymbol as VHDLModel_EntitySymbol,
+ ArchitectureSymbol as VHDLModel_ArchitectureSymbol,
+ PackageSymbol as VHDLModel_PackageSymbol,
)
from pyGHDL.libghdl._types import Iir
from pyGHDL.dom import DOMMixin
-from pyGHDL.dom.Names import SimpleName
from pyGHDL.dom.Range import Range
@export
class LibraryReferenceSymbol(VHDLModel_LibraryReferenceSymbol, DOMMixin):
@InheritDocString(VHDLModel_LibraryReferenceSymbol)
- def __init__(self, libraryNode: Iir, identifier: str):
+ def __init__(self, identifierNode: Iir, identifier: str):
super().__init__(identifier)
- DOMMixin.__init__(self, libraryNode)
+ DOMMixin.__init__(self, identifierNode)
@export
class PackageReferenceSymbol(VHDLModel_PackageReferenceSymbol, DOMMixin):
@InheritDocString(VHDLModel_PackageReferenceSymbol)
- def __init__(self, libraryNode: Iir, identifier: str, prefix: LibraryReferenceSymbol):
+ def __init__(self, identifierNode: Iir, identifier: str, prefix: LibraryReferenceSymbol):
super().__init__(identifier, prefix)
- DOMMixin.__init__(self, libraryNode)
+ DOMMixin.__init__(self, identifierNode)
@export
class PackageMembersReferenceSymbol(VHDLModel_PackageMembersReferenceSymbol, DOMMixin):
@InheritDocString(VHDLModel_PackageMembersReferenceSymbol)
- def __init__(self, libraryNode: Iir, identifier: str, prefix: PackageReferenceSymbol):
+ def __init__(self, identifierNode: Iir, identifier: str, prefix: PackageReferenceSymbol):
super().__init__(identifier, prefix)
- DOMMixin.__init__(self, libraryNode)
+ DOMMixin.__init__(self, identifierNode)
@export
class AllPackageMembersReferenceSymbol(VHDLModel_AllPackageMembersReferenceSymbol, DOMMixin):
@InheritDocString(VHDLModel_AllPackageMembersReferenceSymbol)
- def __init__(self, libraryNode: Iir, prefix: PackageReferenceSymbol):
+ def __init__(self, identifierNode: Iir, prefix: PackageReferenceSymbol):
super().__init__(prefix)
- DOMMixin.__init__(self, libraryNode)
+ DOMMixin.__init__(self, identifierNode)
@export
class ContextReferenceSymbol(VHDLModel_ContextReferenceSymbol, DOMMixin):
@InheritDocString(VHDLModel_ContextReferenceSymbol)
- def __init__(self, libraryNode: Iir, identifier: str, prefix: LibraryReferenceSymbol):
+ def __init__(self, identifierNode: Iir, identifier: str, prefix: LibraryReferenceSymbol):
super().__init__(identifier, prefix)
- DOMMixin.__init__(self, libraryNode)
+ 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)
+ DOMMixin.__init__(self, identifierNode)
+
+
+@export
+class ComponentInstantiationSymbol(VHDLModel_ComponentInstantiationSymbol, DOMMixin):
+ @InheritDocString(VHDLModel_ComponentInstantiationSymbol)
+ def __init__(self, identifierNode: Iir, identifier: str):
+ super().__init__(identifier)
+ DOMMixin.__init__(self, identifierNode)
+
+
+@export
+class ConfigurationInstantiationSymbol(VHDLModel_ConfigurationInstantiationSymbol, DOMMixin):
+ @InheritDocString(VHDLModel_ConfigurationInstantiationSymbol)
+ def __init__(self, identifierNode: Iir, identifier: str):
+ super().__init__(identifier)
+ DOMMixin.__init__(self, identifierNode)
@export
class EntitySymbol(VHDLModel_EntitySymbol, DOMMixin):
@InheritDocString(VHDLModel_EntitySymbol)
- def __init__(self, node: Iir, identifier: str):
+ def __init__(self, identifierNode: Iir, identifier: str):
super().__init__(identifier)
- DOMMixin.__init__(self, node)
+ DOMMixin.__init__(self, identifierNode)
@export
class ArchitectureSymbol(VHDLModel_ArchitectureSymbol, DOMMixin):
@InheritDocString(VHDLModel_ArchitectureSymbol)
- def __init__(self, node: Iir, identifier: str, prefix: EntitySymbol):
+ def __init__(self, identifierNode: Iir, identifier: str, prefix: EntitySymbol):
super().__init__(identifier, prefix)
- DOMMixin.__init__(self, node)
+ DOMMixin.__init__(self, identifierNode)
@export
class PackageSymbol(VHDLModel_PackageSymbol, DOMMixin):
@InheritDocString(VHDLModel_PackageSymbol)
- def __init__(self, node: Iir, identifier: str):
+ def __init__(self, identifierNode: Iir, identifier: str):
super().__init__(identifier)
- DOMMixin.__init__(self, node)
+ DOMMixin.__init__(self, identifierNode)
+# TODO: |||| ||||
+# TODO: VVVV old symbols VVVV
@export
class SimpleSubtypeSymbol(VHDLModel_SimpleSubtypeSymbol, DOMMixin):