<> <<>> <> <> <<>> DIRECTORY IP USING [AGet, Any, Array, ArrayFromVector, ASet, Context, ContextRep, CurrentPool, Get, Integer, Marker, MasterError, nullMarker, Operator, OperatorFromPool, Pool, Pop, PopInteger, Push, PushOperator, PushVector, State, Vector, VectorFromArray], IPBase USING []; IPContextImpl: CEDAR PROGRAM IMPORTS IP EXPORTS IP, IPBase ~ BEGIN OPEN IP; NewMarker: PROC[self: State] RETURNS[Marker] ~ { last: Marker ~ self.lastMarker; IF last self.context _ caller]; self.context _ caller; }; GetMarker: PUBLIC PROC[self: State] RETURNS[Marker] ~ { context: Context ~ self.context; IF context=NIL THEN RETURN[nullMarker] ELSE RETURN[context.marker]; }; Frame: PUBLIC PROC[self: State] RETURNS[Vector] ~ { context: Context ~ self.context; IF context.frame=NIL THEN RETURN[context.initialFrame] ELSE RETURN[VectorFromArray[context.frame]]; }; FGet: PUBLIC PROC[self: State, j: Integer] RETURNS[Any] ~ { context: Context ~ self.context; IF context.frame=NIL THEN RETURN[Get[context.initialFrame, j]] ELSE RETURN[AGet[context.frame, j]] }; FSet: PUBLIC PROC[self: State, x: Any, j: Integer] ~ { context: Context ~ self.context; IF context.frame=NIL THEN context.frame _ ArrayFromVector[context.initialFrame]; ASet[context.frame, x, j]; }; PoolOp: PUBLIC PROC[self: State] RETURNS[Pool] ~ { RETURN[self.context.pool] }; PGet: PUBLIC PROC[self: State, j: Integer] RETURNS[Any] ~ { pool: Pool ~ self.context.pool; RETURN[AGet[pool.array, j]]; }; PSet: PUBLIC PROC[self: State, x: Any, j: Integer] ~ { pool: Pool ~ self.context.pool; -- SavePool[self, pool, ...]; -- ASet[pool.array, x, j]; }; Env: PUBLIC PROC[self: State] RETURNS[Vector] ~ { RETURN[self.context.env]; }; ApplyFRAME: PUBLIC PROC[self: State] ~ { PushVector[self, Frame[self]]; }; ApplyFGET: PUBLIC PROC[self: State] ~ { j: Integer ~ PopInteger[self]; Push[self, FGet[self, j]]; }; ApplyFSET: PUBLIC PROC[self: State] ~ { j: Integer ~ PopInteger[self]; x: Any ~ Pop[self]; FSet[self, x, j]; }; ApplyPOOLOP: PUBLIC PROC[self: State] ~ { PushOperator[self, OperatorFromPool[PoolOp[self]]]; }; ApplyPOOL: PUBLIC PROC[self: State] ~ { PushVector[self, CurrentPool[PoolOp[self]]]; }; ApplyPGET: PUBLIC PROC[self: State] ~ { j: Integer ~ PopInteger[self]; Push[self, PGet[self, j]]; }; ApplyPSET: PUBLIC PROC[self: State] ~ { j: Integer ~ PopInteger[self]; x: Any ~ Pop[self]; PSet[self, x, j]; }; ApplyENV: PUBLIC PROC[self: State] ~ { PushVector[self, Env[self]]; }; END.