1
(***********************************************************************)
5
(* Pierre Weis, projet Cristal, INRIA Rocquencourt *)
7
(* Copyright 2001 Institut National de Recherche en Informatique et *)
8
(* en Automatique. All rights reserved. This file is distributed *)
9
(* only by permission. *)
11
(***********************************************************************)
15
{ vars : (string * 'a) list;
16
procs : (string * d�cl_proc) list;
17
foncs : (string * d�cl_fonc) list };;
19
exception Pas_trouv� of string;;
21
let environnement_initial p f =
22
{ vars = []; procs = p; foncs = f };;
24
let ajoute_variable nom info env =
25
{ vars = (nom,info) :: env.vars; procs = env.procs; foncs = env.foncs };;
27
let cherche nom liste =
28
try List.assoc nom liste with Not_found -> raise(Pas_trouv� nom);;
30
let cherche_variable nom env = cherche nom env.vars
31
and cherche_fonction nom env = cherche nom env.foncs
32
and cherche_proc�dure nom env = cherche nom env.procs;;