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

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

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

9
val empty : env
10
11
12
val serialize: env Serialize.Put.f
val deserialize: env Serialize.Get.f

13
14
val enter_global : env -> id -> env
val enter_globals : env -> id list -> env
15
val find : id -> env -> var_loc
16

17
18
19
val compile_eval : env -> Typed.texpr -> code_item
val compile_let_decl : env -> Typed.let_decl -> env * code_item
val compile_rec_funs : env -> Typed.texpr list -> env * code_item
20
21


22
23
24
25
26
27
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) ->

28
29
  Typer.t -> env -> 
  Ast.pmodule_item list -> Typer.t * env * Lambda.code_item list