From 4eb53e4877fec34abf199192bf82348e601791a7 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Mon, 8 Jan 2024 23:26:32 +0300 Subject: [PATCH] oppc: rename Assign classes --- src/openpower/oppc/pc_ast.py | 4 ++-- src/openpower/oppc/pc_parser.py | 4 ++-- src/openpower/oppc/pc_util.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openpower/oppc/pc_ast.py b/src/openpower/oppc/pc_ast.py index 5a8d0a06..d139d2db 100644 --- a/src/openpower/oppc/pc_ast.py +++ b/src/openpower/oppc/pc_ast.py @@ -245,12 +245,12 @@ class AssignIEAOp(Token): pass -class Assign(Dataclass): +class AssignExpr(Dataclass): lvalue: Node rvalue: Node -class AssignIEA(Assign): +class AssignIEAExpr(AssignExpr): lvalue: Node rvalue: Node diff --git a/src/openpower/oppc/pc_parser.py b/src/openpower/oppc/pc_parser.py index 596830ed..03adc635 100644 --- a/src/openpower/oppc/pc_parser.py +++ b/src/openpower/oppc/pc_parser.py @@ -207,9 +207,9 @@ class Parser: else: (lvalue, rvalue) = (p[1], p[3]) if isinstance(p[2], pc_ast.AssignOp): - cls = pc_ast.Assign + cls = pc_ast.AssignExpr else: - cls = pc_ast.AssignIEA + cls = pc_ast.AssignIEAExpr if (isinstance(lvalue, pc_ast.Symbol) and (str(lvalue) in self.__class__.REGS)): lvalue = self.__class__.REGS[str(lvalue)](lvalue) diff --git a/src/openpower/oppc/pc_util.py b/src/openpower/oppc/pc_util.py index e3e184ed..76058ecb 100644 --- a/src/openpower/oppc/pc_util.py +++ b/src/openpower/oppc/pc_util.py @@ -88,11 +88,11 @@ class PseudocodeVisitor(mdis.visitor.ContextVisitor): stmt = f"{node.name}({args})" self[node].emit(stmt=stmt) - @Hook(pc_ast.Assign, pc_ast.AssignIEA) - def Assign(self, node): + @Hook(pc_ast.AssignExpr, pc_ast.AssignIEAExpr) + def AssignExpr(self, node): mapping = { - pc_ast.Assign: "<-", - pc_ast.AssignIEA: "<-iea", + pc_ast.AssignExpr: "<-", + pc_ast.AssignIEAExpr: "<-iea", } yield node lvalue = str(self[node.lvalue]) -- 2.30.2