summaryrefslogtreecommitdiff
path: root/projects/10/Square/SquareGame.ast
diff options
context:
space:
mode:
Diffstat (limited to 'projects/10/Square/SquareGame.ast')
-rw-r--r--projects/10/Square/SquareGame.ast1
1 files changed, 1 insertions, 0 deletions
diff --git a/projects/10/Square/SquareGame.ast b/projects/10/Square/SquareGame.ast
new file mode 100644
index 0000000..55a9ff0
--- /dev/null
+++ b/projects/10/Square/SquareGame.ast
@@ -0,0 +1 @@
+Right (JClass "SquareGame" [JClassVarDec "field" ("Square","square"),JClassVarDec "field" ("int","direction")] [JSubroutineDec (JSubroutineHeader "constructor" ("SquareGame","new") []) (JSubroutineBody [] [JLetStatment (JVarId "square" Nothing) (JExpCall (JSubroutineCall "Square" (Just "new") [JIntConst 0,JIntConst 0,JIntConst 30])),JLetStatment (JVarId "direction" Nothing) (JIntConst 0),JReturnStatement (Just (JKeywordConst "this"))]),JSubroutineDec (JSubroutineHeader "method" ("void","dispose") []) (JSubroutineBody [] [JDoStatement (JSubroutineCall "square" (Just "dispose") []),JDoStatement (JSubroutineCall "Memory" (Just "deAlloc") [JKeywordConst "this"]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","moveSquare") []) (JSubroutineBody [] [JIfStatement (JExpBin (JExpVar (JVarId "direction" Nothing)) [('=',JIntConst 1)]) [JDoStatement (JSubroutineCall "square" (Just "moveUp") [])] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "direction" Nothing)) [('=',JIntConst 2)]) [JDoStatement (JSubroutineCall "square" (Just "moveDown") [])] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "direction" Nothing)) [('=',JIntConst 3)]) [JDoStatement (JSubroutineCall "square" (Just "moveLeft") [])] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "direction" Nothing)) [('=',JIntConst 4)]) [JDoStatement (JSubroutineCall "square" (Just "moveRight") [])] Nothing,JDoStatement (JSubroutineCall "Sys" (Just "wait") [JIntConst 5]),JReturnStatement Nothing]),JSubroutineDec (JSubroutineHeader "method" ("void","run") []) (JSubroutineBody [("char","key"),("boolean","exit")] [JLetStatment (JVarId "exit" Nothing) (JKeywordConst "false"),JWhileStatment (JExpUna '~' (JExpVar (JVarId "exit" Nothing))) [JWhileStatment (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 0)]) [JLetStatment (JVarId "key" Nothing) (JExpCall (JSubroutineCall "Keyboard" (Just "keyPressed") [])),JDoStatement (JSubroutineCall "moveSquare" Nothing [])],JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 81)]) [JLetStatment (JVarId "exit" Nothing) (JKeywordConst "true")] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 90)]) [JDoStatement (JSubroutineCall "square" (Just "decSize") [])] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 88)]) [JDoStatement (JSubroutineCall "square" (Just "incSize") [])] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 131)]) [JLetStatment (JVarId "direction" Nothing) (JIntConst 1)] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 133)]) [JLetStatment (JVarId "direction" Nothing) (JIntConst 2)] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 130)]) [JLetStatment (JVarId "direction" Nothing) (JIntConst 3)] Nothing,JIfStatement (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 132)]) [JLetStatment (JVarId "direction" Nothing) (JIntConst 4)] Nothing,JWhileStatment (JExpUna '~' (JExpBin (JExpVar (JVarId "key" Nothing)) [('=',JIntConst 0)])) [JLetStatment (JVarId "key" Nothing) (JExpCall (JSubroutineCall "Keyboard" (Just "keyPressed") [])),JDoStatement (JSubroutineCall "moveSquare" Nothing [])]],JReturnStatement Nothing])]) \ No newline at end of file