projects
/
openpower-isa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
09bea91
)
insndb/core: introduce basic walker
author
Dmitry Selyutin
<ghostmansd@gmail.com>
Thu, 22 Jun 2023 15:32:18 +0000
(18:32 +0300)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Fri, 22 Dec 2023 19:26:19 +0000
(19:26 +0000)
src/openpower/insndb/core.py
patch
|
blob
|
history
diff --git
a/src/openpower/insndb/core.py
b/src/openpower/insndb/core.py
index 01a029d12fb0dac9d85f201ed4e7039166f17d25..e5b1b12ef01c4a94b628fb58a686c08ee69abc25 100644
(file)
--- a/
src/openpower/insndb/core.py
+++ b/
src/openpower/insndb/core.py
@@
-12,6
+12,9
@@
import re as _re
import types as _types
import typing as _typing
+import mdis.dispatcher
+import mdis.walker
+
try:
from functools import cached_property
except ImportError:
@@
-3707,3
+3710,9
@@
class Database:
return self.__names.get(key)
raise ValueError("instruction or name expected")
+
+
+class Walker(mdis.walker.Walker):
+ @mdis.dispatcher.Hook(Database)
+ def dispatch_database(self, node):
+ yield from self(tuple(node))