From 33db1946d2a09898761b7d397fe4028725f2215b Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 3 Jan 2018 09:24:21 +0100 Subject: Rename & restructure --- assignment-13/C.dcl | 73 ----------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 assignment-13/C.dcl (limited to 'assignment-13/C.dcl') 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 -- cgit v1.2.3