aboutsummaryrefslogtreecommitdiff
path: root/backend/CC/Backend/Dumb.hs
diff options
context:
space:
mode:
Diffstat (limited to 'backend/CC/Backend/Dumb.hs')
-rw-r--r--backend/CC/Backend/Dumb.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/backend/CC/Backend/Dumb.hs b/backend/CC/Backend/Dumb.hs
new file mode 100644
index 0000000..070fece
--- /dev/null
+++ b/backend/CC/Backend/Dumb.hs
@@ -0,0 +1,14 @@
+module CC.Backend.Dumb(builtins) where
+
+import CC.AST.Typed
+import CC.Context
+
+
+builtins :: Builtins
+builtins = Builtins
+ [ ("print", TFunT TIntT (TTupT []))
+ , ("fst", TFunT (TTupT [TyVar 1, TyVar 2]) (TyVar 1))
+ , ("snd", TFunT (TTupT [TyVar 1, TyVar 2]) (TyVar 2))
+ , ("_add", TFunT TIntT (TFunT TIntT TIntT))
+ , ("_sub", TFunT TIntT (TFunT TIntT TIntT))
+ , ("_mul", TFunT TIntT (TFunT TIntT TIntT)) ]