summaryrefslogtreecommitdiffstats
path: root/src/back
diff options
context:
space:
mode:
authorAndreas Nüßlein <nutz@unfoog.de>2009-05-26 11:58:02 +0200
committerAndreas Nüßlein <nutz@unfoog.de>2009-05-26 11:58:02 +0200
commit5dd84e8e76132ad2e1a58de28ec94ca7ee1ab969 (patch)
treec8f89a6ccb6d06ec67b2d36a2a5ebddf61ced506 /src/back
parent9344849de249310c4b9454005ebecc4121b10aca (diff)
downloadswppy-5dd84e8e76132ad2e1a58de28ec94ca7ee1ab969.tar.gz
swppy-5dd84e8e76132ad2e1a58de28ec94ca7ee1ab969.tar.xz
swppy-5dd84e8e76132ad2e1a58de28ec94ca7ee1ab969.zip
added a main_test (currently for back)
Diffstat (limited to 'src/back')
-rw-r--r--src/back/tac.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/back/tac.py b/src/back/tac.py
index a875a7d..fc072d9 100644
--- a/src/back/tac.py
+++ b/src/back/tac.py
@@ -27,10 +27,10 @@ Op.ASSIGN = Op("ASSIGN") # x = y -> x y
Op.JMP = Op("JMP") # "goto" x -> x
Op.BEQ = Op("EQ") # "if x == y" -> x y
Op.BNE = Op("NE") # "if x != y" -> x y
-Op.BLE = Op("LE") # ...
-Op.BGE = Op("GE")
-Op.BLT = Op("LT")
-Op.BGT = Op("GT")
+Op.LE = Op("LE") # ...
+Op.GE = Op("GE")
+Op.LT = Op("LT")
+Op.GT = Op("GT")
Op.PARAM = Op("PARAM") # param x -> x
Op.CALL = Op("CALL") # fun x (y-args..) -> x y
@@ -60,9 +60,10 @@ class TacArray:
return len(self.liste)-1
def createList(self):
- i = 0
+ i = 1
output = ""
for item in self.liste:
print "%08d | %s\t%s\t%s" % (i,item.op,item.arg1,item.arg2)
+ i = i+1