summaryrefslogtreecommitdiff
path: root/assignment-13/C.dcl
diff options
context:
space:
mode:
authorCamil Staps2018-01-03 09:24:21 +0100
committerCamil Staps2018-01-03 09:24:21 +0100
commit33db1946d2a09898761b7d397fe4028725f2215b (patch)
tree1f68cb8b276b7a20f42f325c76e6d4853ea8e68f /assignment-13/C.dcl
parentCleanup (diff)
Rename & restructure
Diffstat (limited to 'assignment-13/C.dcl')
-rw-r--r--assignment-13/C.dcl73
1 files changed, 0 insertions, 73 deletions
diff --git a/assignment-13/C.dcl b/assignment-13/C.dcl
deleted file mode 100644
index 40f93d0..0000000
--- a/assignment-13/C.dcl
+++ /dev/null
@@ -1,73 +0,0 @@
-definition module C
-
-from Data.Maybe import :: Maybe
-
-from Arduino import :: Button
-from Util import class print
-
-:: Signedness = Sig | Unsig
-
-:: CType
- = CTChar Signedness
- | CTBool
- | CTInt Signedness
- | CTLong Signedness
- | CTVoid
- | CTArray CType
- | CTStruct String
-
-:: CExpr
- = CEButton Button
- | CEGlobal String
- | CEInfix String CExpr CExpr
- | CEApp String [CExpr]
- | CEBool Bool
- | CEInt Int
- | CEChar Char
- | CEBArray Int [Bool]
- | CEIArray Int [Int]
- | CEIf CExpr CExpr CExpr
- | CERef CExpr
- | CEDeref CExpr
- | CEStruct [(String, CExpr)]
-
-:: CBody
- = CBReturn (Maybe CExpr)
- | CBIf CExpr CBody CBody
- | CBWhile CExpr CBody
- | CBAssign String CExpr
- | CBSeq CBody CBody
- | CBEmpty
- | CBExpr CExpr
-
-(`seq`) infix 0 :: CBody CBody -> CBody
-
-:: CVar =
- { name :: String
- , type :: CType
- , value :: CExpr
- }
-
-:: CFun =
- { params :: [(Int, CType)]
- , body :: CBody
- , fresh :: Int
- , type :: CType
- , name :: String
- }
-
-:: CProg =
- { bootstrap :: String
- , globals :: [CVar]
- , funs :: [CFun]
- }
-
-instance print Signedness
-instance print CType
-instance print CExpr
-instance print CBody
-instance print CVar
-instance print CFun
-instance print CProg
-
-combinePrograms :: CProg CProg -> CProg