aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/dom/Misc.py
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-26 13:48:09 +0200
committerGitHub <noreply@github.com>2021-06-26 13:48:09 +0200
commit111fe055b2f0f3a0225d2553cf739572d691a14d (patch)
tree50d3a874bb78107627a6509fd4054c7fdc96cd25 /pyGHDL/dom/Misc.py
parent15c6de72bc8dd316cb5262e1b5f373ca45b05f68 (diff)
downloadghdl-111fe055b2f0f3a0225d2553cf739572d691a14d.tar.gz
ghdl-111fe055b2f0f3a0225d2553cf739572d691a14d.tar.bz2
ghdl-111fe055b2f0f3a0225d2553cf739572d691a14d.zip
More DOM improvements (#1806)
* First try to handle names. * Reworked names. * Reworked range expressions. * Handle AttributeNames. * Added handling of file declaration and attribute declarations. * Improved error outputs. * Handle protected types. * Make black happy with ugly code. * Handle Null literal and File parameters. * File type and physical type. * Don't fail on reported syntax errors. Catch call errors into libghdl. * Improved Sanity checks for pyGHDL.dom. * Load sourcecode via Python and process in-memory. Fixed testcases. * Added package instantiations and packages with generics. * Added UseClause, AttributeSpecification and PhysicalTypes. * Improved pretty-printing. * Fixed AttributeName in subtype indication. * Get code position of IIR nodes. * Added DOMMixin into all derived classes. * Mark as not yet implemented. * Pinned pyVHDLModel version to v0.10.4. * Removed xfail in LSP test. Bumped requirement of pyVHDLModel to v0.10.4. Fixed some Codacy issues. (cherry picked from commit f64e7ed7c3d69cbf84cd60db8e9b085e90b846cb)
Diffstat (limited to 'pyGHDL/dom/Misc.py')
-rw-r--r--pyGHDL/dom/Misc.py36
1 files changed, 12 insertions, 24 deletions
diff --git a/pyGHDL/dom/Misc.py b/pyGHDL/dom/Misc.py
index 8bea6cf61..b80c64a82 100644
--- a/pyGHDL/dom/Misc.py
+++ b/pyGHDL/dom/Misc.py
@@ -40,36 +40,24 @@ from pydecor import export
from pyVHDLModel.VHDLModel import (
Alias as VHDLModel_Alias,
)
+from pyGHDL.libghdl._types import Iir
+from pyGHDL.dom._Utils import GetNameOfNode
+from pyGHDL.dom import DOMMixin
__all__ = []
@export
-class Position:
- _filename: str
- _line: int
- _column: int
-
- def __init__(self, filename: str, line: int, column: int):
- self._filename = filename
- self._line = line
- self._column = column
-
- @property
- def Filename(self):
- return self._filename
-
- @property
- def Line(self):
- return self._line
+class Alias(VHDLModel_Alias, DOMMixin):
+ def __init__(self, node: Iir, aliasName: str):
+ super().__init__(aliasName)
+ DOMMixin.__init__(self, node)
- @property
- def Column(self):
- return self._column
+ @classmethod
+ def parse(cls, node: Iir):
+ aliasName = GetNameOfNode(node)
+ # FIXME: add an implementation
-@export
-class Alias(VHDLModel_Alias):
- def __init__(self, aliasName: str):
- super().__init__(aliasName)
+ return cls(node, aliasName)