Source

Opifex / src / Language / Common / Environment.mli

Full commit
(*
 * Opifex
 *
 * Copyrights(C) 2012 by Pawel Wieczorek <wieczyk at gmail>
 *)

open AST

exception Environment_unknown_variable

type 'value t

val create : unit -> 'value t

val clone : 'value t -> 'value t

val put : 'value t -> variable -> 'value -> unit

val get : 'value t -> variable -> 'value

val with_extended_environment : 'value t -> variable -> 'value -> (unit -> 'a) -> 'a

val with_extended_environment_m  : 'value t -> (variable * 'value) list -> (unit -> 'a) -> 'a

val get_list : 'value t -> (variable * 'value) list

val map : (variable -> 'value -> 'value) -> 'value t -> unit

(*************************************************************************************************
 * PrettyPrinter
 ************************************************************************************************)

module PrettyPrinter : sig
    open Formatter

    val show_environment : ('ncxt -> 'value -> painter list) 
                        -> ('pcxt -> variable -> 'ncxt)
                        -> 'pcxt -> 'value t -> painter list

end