summaryrefslogtreecommitdiffstats
path: root/src/main_test.py
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/main_test.py
parent9344849de249310c4b9454005ebecc4121b10aca (diff)
downloadswppy-5dd84e8e76132ad2e1a58de28ec94ca7ee1ab969.tar.gz
swppy-5dd84e8e76132ad2e1a58de28ec94ca7ee1ab969.tar.xz
swppy-5dd84e8e76132ad2e1a58de28ec94ca7ee1ab969.zip
added a main_test (currently for back)
Diffstat (limited to 'src/main_test.py')
-rwxr-xr-xsrc/main_test.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main_test.py b/src/main_test.py
new file mode 100755
index 0000000..8649a74
--- /dev/null
+++ b/src/main_test.py
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+
+import sys
+
+from front import ast
+#import SymbolTable
+from back import tac
+
+def main():
+ mUn = ast.UnaryExpression("PLUS","a")
+ mIf = ast.IfStatement(mUn,"true","false")
+ mFunc1 = ast.Function("func1",["param1","param2"],mIf)
+ mFunc2 = ast.Function("func2",["param0","param1"],mIf)
+ mProg = ast.Program([mFunc1,mFunc2])
+ Test()
+
+
+class Test:
+ def __init__(self):
+ x = tac.TacElem("PLUS",3,5)
+ y = tac.TacElem("MINUS",8,3)
+ z = tac.TacArray()
+ z.append(x)
+ z.append(y)
+ z.createList()
+
+
+
+
+
+if __name__ == "__main__":
+ sys.exit(main())