/[svn]/typing/typer.mli
ViewVC logotype

Contents of /typing/typer.mli

Parent Directory Parent Directory | Revision Log Revision Log


Revision 695 - (show annotations)
Tue Jul 10 17:56:03 2007 UTC (5 years, 11 months ago) by abate
File size: 2496 byte(s)
[r2003-10-02 20:04:31 by cvscast] Cleaning + new semantics for default values in regexps

Original author: cvscast
Date: 2003-10-02 20:04:32+00:00
1 open Ident
2 open Location
3
4 exception NonExhaustive of Types.descr
5 exception Constraint of Types.descr * Types.descr
6 exception ShouldHave of Types.descr * string
7 exception WrongLabel of Types.descr * label
8 exception UnboundId of id * bool
9 exception ShouldHave2 of Types.descr * string * Types.descr
10 exception Error of string
11 val warning: loc -> string -> unit
12 val error: loc -> string -> 'a
13
14 include Custom.T
15
16 val empty_env: t
17 val get_ns_table : t -> Ns.table
18
19 val enter_ns : U.t -> Ns.t -> t -> t
20
21 val enter_value: id -> Types.t -> t -> t
22 val enter_values: (id * Types.t) list -> t -> t
23 val find_value: id -> t -> Types.t
24 val iter_values: t -> (id -> Types.t -> unit) -> unit
25
26 val enter_type: id -> Types.t -> t -> t
27 val enter_types: (id * Types.t) list -> t -> t
28 val find_type: id -> t -> Types.t
29
30 val type_defs: t -> (id * Ast.ppat) list -> (id * Types.t) list
31 val typ: t -> Ast.ppat -> Types.Node.t
32 val pat: t -> Ast.ppat -> Patterns.node
33
34 val dump_types: Format.formatter -> t -> unit
35
36
37
38 val dump_ns: Format.formatter -> t -> unit
39 val set_ns_table_for_printer: t -> unit
40
41 val expr: t -> Ast.pexpr -> Typed.texpr
42 val let_decl : t -> Ast.ppat -> Ast.pexpr -> Typed.let_decl
43
44 val type_check:
45 t -> Typed.texpr -> Types.descr -> bool -> Types.descr
46 (* [type_check env e t precise] checks that expression [e]
47 has type [t] under typing environment [env]; if [precise=true],
48 also returns a possible more precise type for [e].
49 *)
50 val type_let_decl: t -> Typed.let_decl -> (id * Types.t) list
51
52 val type_rec_funs: t -> Typed.texpr list -> (id * Types.t) list
53 (* Assume that all the expressions are Abstractions *)
54
55 val report_unused_branches : unit -> unit
56 (* Issue warnings for unused branches *)
57 val clear_unused_branches : unit -> unit
58
59 val flatten: loc ->
60 (Types.t -> bool -> Types.t) -> (Types.t -> bool -> Types.t)
61
62 (** {2 Schema stuff} *)
63
64 (** register a schema *)
65 val register_schema: string -> Schema_types.schema -> unit
66
67 (** @return the validator for a Schema global element *)
68 val get_schema_validator: string * string -> Schema_validator.validator
69
70 (** DEBUG ONLY *)
71
72 (* return the type of a global schema element *)
73 val get_schema_type: string * string -> Types.descr
74
75
76
77 (* Operators *)
78
79 type type_fun = Types.t -> bool -> Types.t
80 val mk_unary_op: (string -> t -> int) ref
81 val typ_unary_op: (int -> loc -> type_fun -> type_fun) ref
82
83 val mk_binary_op: (string -> t -> int) ref
84 val typ_binary_op: (int -> loc -> type_fun -> type_fun -> type_fun) ref
85

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5