aboutsummaryrefslogtreecommitdiff
path: root/snug-clean/src/Snug/Compile.dcl
diff options
context:
space:
mode:
Diffstat (limited to 'snug-clean/src/Snug/Compile.dcl')
-rw-r--r--snug-clean/src/Snug/Compile.dcl28
1 files changed, 28 insertions, 0 deletions
diff --git a/snug-clean/src/Snug/Compile.dcl b/snug-clean/src/Snug/Compile.dcl
new file mode 100644
index 0000000..d329156
--- /dev/null
+++ b/snug-clean/src/Snug/Compile.dcl
@@ -0,0 +1,28 @@
+definition module Snug.Compile
+
+from Data.Map import :: Map
+
+from MIPS.MIPS32 import :: Line
+from Snug.Syntax import :: ConstructorDef, :: ConstructorIdent, :: Definition,
+ :: SymbolIdent, :: Type
+
+:: Namespace :== String
+
+:: Namespaced id =
+ { ns :: !Namespace
+ , id :: !id
+ }
+
+:: Globals =
+ { constructors :: !Map (Namespaced ConstructorIdent) ConstructorDef
+ , functions :: !Map (Namespaced SymbolIdent) FunctionInfo
+ }
+
+:: FunctionInfo =
+ { arity :: !Int
+ , type :: !Type
+ }
+
+compile :: !Namespace ![Definition] -> [Line]
+
+compileDefinition :: !Namespace !Globals !Definition -> [Line]