Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
(**********************************************************
Sous-module pour SrcTab
************************************************************
Une SymbolTab.t est une association ``contextuelle'' entre
des ident simple (string) et ce quoi ils correspondent.
N.B. il est inutile de grer les idents absolus (pack+nom)
qui sont par dfinition NON-CONTEXTUELS.
Dans une table, on a 3 espaces de noms, un par nature d'item
(const, type et oper).
***********************************************************)
open CompUtils
type 'a hereflaged =
Here of 'a
| NotHere of fullid
(* Type principal *)
type t
(* Cration/initialisation d'une symbol_tab
n.b. l'argument est juste un commentaire pour les
messages d'erreurs et les verbose !!!
*)
val create : unit -> t
(* Manip de SymbolTab.t *)
(* Recherche d'items *)
val find_type : t -> string -> (Syntaxe.type_info Lxm.srcflaged) hereflaged
val find_const : t -> string -> (Syntaxe.const_info Lxm.srcflaged) hereflaged
val find_oper : t -> string -> (Syntaxe.oper_info Lxm.srcflaged) hereflaged
(* Ajout de nom d'item imports (via uses) *)
val add_import_const : t -> string -> fullid -> unit
val add_import_type : t -> string -> fullid -> unit
val add_import_oper : t -> string -> fullid -> unit
(* Ajout de decl d'item locaux *)
val add_type : t -> string -> Syntaxe.type_info Lxm.srcflaged -> unit
val add_const : t -> string -> Syntaxe.const_info Lxm.srcflaged -> unit
val add_oper : t -> string -> Syntaxe.oper_info Lxm.srcflaged -> unit
(* Itrer sur les items *)
val iter_types : t -> (string -> (Syntaxe.type_info Lxm.srcflaged) hereflaged -> unit) -> unit
val iter_consts : t -> (string -> (Syntaxe.const_info Lxm.srcflaged) hereflaged -> unit) -> unit
val iter_opers : t -> (string -> (Syntaxe.oper_info Lxm.srcflaged) hereflaged -> unit) -> unit
val dump : t -> unit