diff options
author | Unai Martinez-Corral <38422348+umarcor@users.noreply.github.com> | 2021-06-22 12:05:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-22 12:05:45 +0100 |
commit | bf45d9939dc26d0d584dd549923b9962f83360ec (patch) | |
tree | 976beef99129705fa8d0e592dfba4fad61b80135 /pyGHDL/cli/DOM.py | |
parent | 15f447b1270a815748fdbcce46d97abd9eecc21d (diff) | |
parent | 0a69901be945dfb6c5372e657332d5e5ddfa10c7 (diff) | |
download | ghdl-bf45d9939dc26d0d584dd549923b9962f83360ec.tar.gz ghdl-bf45d9939dc26d0d584dd549923b9962f83360ec.tar.bz2 ghdl-bf45d9939dc26d0d584dd549923b9962f83360ec.zip |
More expression kinds and function calls (#1802)
Diffstat (limited to 'pyGHDL/cli/DOM.py')
-rwxr-xr-x | pyGHDL/cli/DOM.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/pyGHDL/cli/DOM.py b/pyGHDL/cli/DOM.py index d7ffc7319..2b846edde 100755 --- a/pyGHDL/cli/DOM.py +++ b/pyGHDL/cli/DOM.py @@ -7,24 +7,25 @@ from pathlib import Path from pydecor import export -from pyGHDL.dom import Misc -from pyGHDL import GHDLBaseException +from pyGHDL.dom import NonStandard __all__ = [] __api__ = __all__ -from pyGHDL.dom.formatting.prettyprint import PrettyPrint +from pyGHDL.dom.Common import DOMException + +from pyGHDL.dom.formatting.prettyprint import PrettyPrint, PrettyPrintException @export class Application: - _design: Misc.Design + _design: NonStandard.Design def __init__(self): - self._design = Misc.Design() + self._design = NonStandard.Design() def addFile(self, filename: Path, library: str): - document = Misc.Document(filename) + document = NonStandard.Document(filename) self._design.Documents.append(document) def prettyPrint(self): @@ -45,15 +46,17 @@ def main(items): if len(items) < 1: print("Please, provide the files to be analyzed as CLI arguments.") print("Using <testsuite/pyunit/SimpleEntity.vhdl> for demo purposes.\n") - items = ["testsuite/pyunit/SimpleEntity.vhdl"] + items = ["testsuite/pyunit/Current.vhdl"] for item in items: try: app = Application() app.addFile(Path(item), "default_lib") app.prettyPrint() - except GHDLBaseException as ex: - print(ex) + except DOMException as ex: + print("DOM:", ex) + except PrettyPrintException as ex: + print("PP:", ex) _exitcode = 1 return _exitcode |