oppc: rename NotEq to Ne
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:09:45 +0000 (22:09 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:08 +0000 (22:10 +0300)
src/openpower/oppc/pc_ast.py
src/openpower/oppc/pc_code.py
src/openpower/oppc/pc_lexer.py
src/openpower/oppc/pc_parser.py
src/openpower/oppc/pc_pseudocode.py

index 3505fa8834ebb5e82bff0966ddb72d2dae4b5ae1..520ea089b01da1862f13033363b9d23cedc25127 100644 (file)
@@ -346,7 +346,7 @@ class Eq(Token):
     pass
 
 
-class NotEq(Token):
+class Ne(Token):
     r"""(?:≠|!=)"""
     pass
 
index 49b045e6a602105aee2352327f2382fd6f1bb4dd..a178a65c133551b1a55d73b5af7626f645a99448 100644 (file)
@@ -261,7 +261,7 @@ class CodeVisitor(pc_util.Visitor):
 
         comparison = (
             pc_ast.Lt, pc_ast.Le,
-            pc_ast.Eq, pc_ast.NotEq,
+            pc_ast.Eq, pc_ast.Ne,
             pc_ast.Ge, pc_ast.Gt,
             pc_ast.LtU, pc_ast.GtU,
         )
@@ -296,7 +296,7 @@ class CodeVisitor(pc_util.Visitor):
             pc_ast.Not, pc_ast.Add, pc_ast.Sub,
             pc_ast.Mul, pc_ast.Div, pc_ast.Mod,
             pc_ast.Lt, pc_ast.Le,
-            pc_ast.Eq, pc_ast.NotEq,
+            pc_ast.Eq, pc_ast.Ne,
             pc_ast.Ge, pc_ast.Gt,
             pc_ast.LtU, pc_ast.GtU,
             pc_ast.LShift, pc_ast.RShift,
@@ -315,9 +315,9 @@ class CodeVisitor(pc_util.Visitor):
             pc_ast.Lt: "oppc_lt",
             pc_ast.Le: "oppc_le",
             pc_ast.Eq: "oppc_eq",
+            pc_ast.Ne: "oppc_ne",
             pc_ast.LtU: "oppc_ltu",
             pc_ast.GtU: "oppc_gtu",
-            pc_ast.NotEq: "oppc_noteq",
             pc_ast.Ge: "oppc_ge",
             pc_ast.Gt: "oppc_gt",
             pc_ast.LShift: "oppc_lshift",
index bfa2c3b02a50a78148befb79d4bcecd1a672a29a..b7290ef19c4be8892f80deec16be06e8473491a3 100644 (file)
@@ -408,7 +408,7 @@ class Lexer:
     t_ASSIGN = pc_ast.AssignOp.__doc__
     t_LTU = pc_ast.LtU.__doc__
     t_GTU = pc_ast.GtU.__doc__
-    t_NE = pc_ast.NotEq.__doc__
+    t_NE = pc_ast.Ne.__doc__
     t_LE = pc_ast.Le.__doc__
     t_GE = pc_ast.Ge.__doc__
     t_LSHIFT = pc_ast.LShift.__doc__
@@ -537,7 +537,7 @@ class IndentLexer(Lexer):
             "ASSIGN": pc_ast.AssignOp,
             "LTU": pc_ast.LtU,
             "GTU": pc_ast.GtU,
-            "NE": pc_ast.NotEq,
+            "NE": pc_ast.Ne,
             "LE": pc_ast.Le,
             "GE": pc_ast.Ge,
             "LSHIFT": pc_ast.LShift,
index a7a0ffbef6b4c0ad7bf7f1dd00c420ff6d0b8fea..0de6673f196dd8d6a533e3d3159321ad009b0cc4 100644 (file)
@@ -53,7 +53,7 @@ binary_ops = {
     "<": pc_ast.Lt,
     ">": pc_ast.Gt,
     "=": pc_ast.Eq,
-    "!=": pc_ast.NotEq,
+    "!=": pc_ast.Ne,
 }
 unary_ops = {
     "+": pc_ast.Plus,
index 6804eb26020f11d5dbaa2f095817d3d24f745c79..c53c8315428237241fc3ce896f4813018129dcc0 100644 (file)
@@ -223,7 +223,7 @@ class PseudocodeVisitor(pc_util.Visitor):
             pc_ast.Mul, pc_ast.MulS, pc_ast.MulU,
             pc_ast.Div, pc_ast.DivT, pc_ast.Mod,
             pc_ast.Sqrt,
-            pc_ast.Eq, pc_ast.NotEq,
+            pc_ast.Eq, pc_ast.Ne,
             pc_ast.Lt, pc_ast.Le, pc_ast.LtU,
             pc_ast.Gt, pc_ast.Ge, pc_ast.GtU,
             pc_ast.LShift, pc_ast.RShift,
@@ -244,7 +244,7 @@ class PseudocodeVisitor(pc_util.Visitor):
             pc_ast.Mod: "%",
             pc_ast.Sqrt: "√",
             pc_ast.Eq: "=",
-            pc_ast.NotEq: "!=",
+            pc_ast.Ne: "!=",
             pc_ast.Lt: "<",
             pc_ast.Le: "<=",
             pc_ast.LtU: "<u",