Module Oug_env


module Oug_env: sig .. end
Environment.

type absname = string list 
val string_of_absname : string list -> string
val absname_of_string : string -> string list
val basename : 'a list -> 'a
val parentname : 'a list -> 'a list

type 'a variant_fields = {
   vflds_constant : (string * 'a option) array;
   vflds_block : (string * 'a option) array;
}
type kind_abbr =
| Kvalue
| Kmethod
| Kclass
| Kmodule
| Ktype

type 'a type_kind =
| Abstract
| Record of (string * 'a option) array
| Variant of 'a variant_fields
val dummy_variant : 'a type_kind
val dummy_record : 'a type_kind
val ids_of_type_kind : 'a type_kind -> 'a list
val id_of_field_name : string -> 'a type_kind -> 'a option
exception Unbound_path of bool
The boolean indicate whether we partially found the name in a lookup (true) or not (false).
val raise_unbound : bool -> 'a
module Interface: sig .. end
type 'a t = 'a Interface.t list 
An environement is a list of ordered accessible interfaces.
val empty : 'a t
val get_val : 'a Oug_tmap.key Interface.t list ->
string list -> 'a Oug_tmap.key option

Lookup of elements by their name

These functions raise Unbound_path when no element matching the name could be found.
val get_module : 'a Interface.t list ->
string list -> 'a option * 'a Interface.t
val get_functor : 'a Interface.t list ->
string list -> 'a option * 'a Interface.t * (string * 'a) list
Return the module interface and the paramters of the function.
val get_class : 'a Interface.t list ->
string list -> 'a option * 'a Interface.t
val get_type : 'a Interface.t list ->
string list -> 'a option * 'a type_kind
val get_type_field : 'a Interface.t list -> string list -> 'a option
val get_type_id : 'a Interface.t list -> string list -> 'a option

Mapping over environments


val map_env : ('a -> 'b) ->
'a Interface.SMap.t list -> 'b Interface.SMap.t list
val mapi_env : (Interface.SMap.key -> 'a -> 'b) ->
'a Interface.SMap.t list -> 'b Interface.SMap.t list
val map_env_ids : ('a -> 'b) ->
'a Interface.env_item Interface.SMap.t list ->
'b Interface.env_item Interface.SMap.t list
val filter_env : (kind_abbr * string -> 'a Interface.env_item -> bool) ->
'a Interface.env_item Interface.SMap.t list ->
'a Interface.env_item Interface.SMap.t list

Adding elements to the environment


val add_val : 'a Interface.env_item Interface.SMap.t list ->
?id:'a ->
string -> 'a Interface.env_item Interface.SMap.t list
val add_pattern : 'a Interface.env_item Interface.SMap.t list ->
?id:'a ->
string -> 'a Interface.env_item Interface.SMap.t list
val add_type : 'a Interface.env_item Interface.SMap.t list ->
?id:'a ->
string ->
'a type_kind ->
'a Interface.env_item Interface.SMap.t list
val add_module : 'a Interface.env_item Interface.SMap.t list ->
?id:'a ->
intf:'a Interface.t ->
?args:(string * 'a) list ->
string -> 'a Interface.env_item Interface.SMap.t list
val add_method : 'a Interface.env_item Interface.SMap.t list ->
?id:'a ->
string -> 'a Interface.env_item Interface.SMap.t list

Utilities


val interface_of_env : 'a Interface.SMap.t list -> 'a Interface.SMap.t
val string_of_env : 'a Oug_tmap.key Interface.t list -> string