compile.mli 690 Bytes
Newer Older
1 2
(* From Ast to Lambda. *)

3
open Ident 
4
open Lambda
5 6

type env
7
val global_size: env -> int
8

9
val empty : Compunit.t -> env
10
val empty_toplevel : env
11
val pp_env : Format.formatter -> env -> unit
12

13
val find : id -> env -> var_loc
14
val find_slot : id -> env -> int
15

16
val compile_expr : env -> Typed.texpr -> Lambda.expr * int
17
val compile_eval_expr : env -> Typed.texpr -> Value.t
18

19 20 21 22 23
val comp_unit:
  ?run:bool ->
  ?show:(id option -> Types.t -> Value.t option -> unit) ->
  ?directive:(Typer.t -> env -> Ast.toplevel_directive -> unit) ->

24 25
  Typer.t -> env -> Ast.pmodule_item list -> 
  Typer.t * env * Lambda.code_item list
26 27 28 29


val from_comp_unit: (Compunit.t -> env) ref
  (* Defined in Librarian *)