From 64483a5f85b1a81e4eb4aa903c6bb0f71124d235 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 9 Jan 2024 21:08:41 +0300 Subject: [PATCH] oppc: decouple pseudocode module --- src/openpower/oppc/__main__.py | 6 +++--- src/openpower/oppc/{pc_util.py => pc_pseudocode.py} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename src/openpower/oppc/{pc_util.py => pc_pseudocode.py} (100%) diff --git a/src/openpower/oppc/__main__.py b/src/openpower/oppc/__main__.py index 420b4d84..deb165a2 100644 --- a/src/openpower/oppc/__main__.py +++ b/src/openpower/oppc/__main__.py @@ -8,7 +8,7 @@ from openpower.decoder.power_enums import ( import openpower.oppc.pc_lexer as pc_lexer import openpower.oppc.pc_parser as pc_parser -import openpower.oppc.pc_util as pc_util +import openpower.oppc.pc_pseudocode as pc_pseudocode def dedent(line): @@ -21,7 +21,7 @@ def parse(parser, origin): origin = tuple(origin) tree = parser.parse(code="\n".join(origin)) stream = io.StringIO() - for (level, line) in pc_util.pseudocode(tree): + for (level, line) in pc_pseudocode.pseudocode(tree): print(f"{' ' * 4 * level}{line}", file=stream) stream.seek(0) target = tuple(stream) @@ -64,5 +64,5 @@ RA <- result[64-XLEN:63] """ tree = parser.parse(code=code) print(tree) -for (level, line) in pc_util.pseudocode(tree): +for (level, line) in pc_pseudocode.pseudocode(tree): print(f"{' ' * 4 * level}{line}") diff --git a/src/openpower/oppc/pc_util.py b/src/openpower/oppc/pc_pseudocode.py similarity index 100% rename from src/openpower/oppc/pc_util.py rename to src/openpower/oppc/pc_pseudocode.py -- 2.30.2