oppc: print C code instead of pseudocode
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 14 Jan 2024 18:51:34 +0000 (21:51 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:07 +0000 (22:10 +0300)
src/openpower/oppc/__main__.py

index 90e29bc0419205aefa0c564863d619f9364106eb..d8bcec71bb72002154feb3df3488f6bc5d686db4 100644 (file)
@@ -19,8 +19,8 @@ db = Database(find_wiki_dir())
 for insn in db:
     try:
         tree = parser.parse(code="\n".join(insn.pcode))
-        for (level, line) in pc_pseudocode.pseudocode(tree):
-            pass
+        for (level, line) in pc_code.code(name=insn.name, root=tree):
+            print(f"{' ' * 4 * level}{line}")
     except Exception as exc:
         print(insn.name)
         print(insn.pcode)