1 (**************************************************************************)
2 (* *)
3 (* OCaml *)
4 (* *)
5 (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
6 (* *)
7 (* Copyright 1996 Institut National de Recherche en Informatique et *)
8 (* en Automatique. *)
9 (* *)
10 (* All rights reserved. This file is distributed under the terms of *)
11 (* the GNU Lesser General Public License version 2.1, with the *)
12 (* special exception on linking described in the file LICENSE. *)
13 (* *)
14 (**************************************************************************)
15
16 (* Translation from typed abstract syntax to lambda terms,
17 for the module language *)
18
19 open Typedtree
20 open Lambda
21
22 val transl_implementation:
23 string -> structure * module_coercion -> Lambda.program
24 val transl_store_phrases: string -> structure -> int * lambda
25 val transl_store_implementation:
26 string -> structure * module_coercion -> Lambda.program
27
28 val transl_implementation_flambda:
29 string -> structure * module_coercion -> Lambda.program
30
31 val transl_toplevel_definition: structure -> lambda
32 val transl_package:
33 Ident.t option list -> Ident.t -> module_coercion -> lambda
34 val transl_store_package:
35 Ident.t option list -> Ident.t -> module_coercion -> int * lambda
36
37 val transl_package_flambda:
38 Ident.t option list -> module_coercion -> int * lambda
39
40 val toplevel_name: Ident.t -> string
41 val nat_toplevel_name: Ident.t -> Ident.t * int
42
43 val primitive_declarations: Primitive.description list ref
44
45 type unsafe_component =
46 | Unsafe_module_binding
47 | Unsafe_functor
48 | Unsafe_non_function
49 | Unsafe_typext
50
51 type unsafe_info =
52 | Unsafe of { reason:unsafe_component; loc:Location.t; subid:Ident.t }
53 | Unnamed
54
55 type error =
56 Circular_dependency of (Ident.t * unsafe_info) list
57 | Conflicting_inline_attributes
58
59 exception Error of Location.t * error
60
61 val report_error: Location.t -> error -> Location.error
62
63 val reset: unit -> unit
64