-- filename: evalenv.ads 2:47PM 10/25/95 -- evaluation environments are stacks of symbol tables (frames) with framelist.stacks, expr.io, Frame; use framelist.stacks, expr.io, expr, framelist; package EvalEnv is type Env is new Stack; -- in order to debug things we need to look at environments procedure put(E:in Env); procedure Initialize(E:in out Env); procedure AddFrame(F: in Frame.Table; E: in out Env) renames push; procedure FlushFrame(E: in out Env) renames Pop; procedure Assign(OldEnv:in Env; ToEnv: in out Env) renames MkSame; function FirstFrame(E: in Env) return Frame.Table renames TopOf; -- function Is_Empty is already there function RestOf(E:Env) return Env; -- the following procedures and functions operate on environments -- by operating on the frames in the environments, thus many are -- defined in terms of similar operations on frames procedure AddEntry(S: in Symbol; V: in Exp; E: in out Env); procedure ChangeEntry(S:in Symbol; V: in Exp; E:in out Env); function Lookup(S:in Symbol; E:in Env) return Exp; function IsBound(S: in Symbol; E:in Env) return Boolean; procedure ExtendEnv(Names:in SymbolList; Vals:in ExpList; E:in out Env); end EvalEnv;