compile.mli 748 Bytes
Newer Older
1
open Ident 
2
open Lambda
3 4

type env
5
val global_size: env -> int
6 7
val from_comp_unit: (Types.CompUnit.t -> env) ref

8 9
val dump: Format.formatter -> env -> unit

10 11
val empty : Types.CompUnit.t -> env
val empty_toplevel : env
12 13 14
val serialize: env Serialize.Put.f
val deserialize: env Serialize.Get.f

15
(*
16 17
val enter_global : env -> id -> env
val enter_globals : env -> id list -> env
18
*)
19
val find : id -> env -> var_loc
20

21 22

val compile_expr : env -> Typed.texpr -> Lambda.expr
23 24


25 26 27 28 29 30
val comp_unit:
  ?run:bool ->
  ?show:(id option -> Types.t -> Value.t option -> unit) ->
  ?loading:(Types.CompUnit.t -> unit) ->
  ?directive:(Typer.t -> env -> Ast.toplevel_directive -> unit) ->

31 32
  Typer.t -> env -> Ast.pmodule_item list -> 
  Typer.t * env * Lambda.code_item list