WIP
[tiger.ml.git] / compiler / src / lib / tiger / tiger_translate.ml
index 483335a..9295df9 100644 (file)
@@ -47,13 +47,13 @@ type exp =
 
 type access =
   (* must know about static links *)
-  { level        : Level.t
-  ; frame_access : Frame.access
+  { level  : Level.t
+  ; access : Frame.access
   }
 
 let alloc_local ~level ~escapes =
   { level
-  ; frame_access = Frame.alloc_local (Level.frame level) ~escapes
+  ; access = Frame.alloc_local (Level.frame level) ~escapes
   }
 
 let formals ~level =
@@ -62,6 +62,9 @@ let formals ~level =
     alloc_local ~level ~escapes
   )
 
+let not_implemented func =
+  failwith (Printf.sprintf "Not implemented: %s.%s" __MODULE__ func)
+
 let rec seq = function
   (* TODO: Is appending 0 OK? How else can the empty case be handled? *)
   | []      -> T.EXP (T.CONST 0)
@@ -100,3 +103,7 @@ let unCx = function
   | Cx g -> g
 
 let dummy__FIXME = Ex (T.CONST 0)
+
+let simple_var {level; access} =
+  let pointer = not_implemented "simple_var frame pointer" in
+  Ex (Frame.exp ~access ~pointer)
This page took 0.023081 seconds and 4 git commands to generate.