AMModelBridge.Mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Russ Atkinson, February 11, 1985 11:52:47 pm PST
Rovner, July 14, 1983 9:37 am
DIRECTORY
AMModel USING [Context, Section],
AMTypes USING [TV],
PrincOps USING [BytePC];
AMModelBridge: DEFINITIONS
= BEGIN OPEN AMModel, PrincOps, AMTypes;
LoadedSection: TYPE = RECORD[section: Section, context: --prog--Context, pc: BytePC];
A LoadedSection is a convenience for clients of AMModelBridge. Each represents one of:
loaded compiler output bundle for a prog module
loaded compiler output bundle for a proc
loaded compiler output bundle for a statement
LoadedSectionForProc: PROC [tv: TV--proc--] RETURNS [LoadedSection];
ProcFromLoadedSection: PROC [proc: LoadedSection] RETURNS [TV--proc--];
LoadedSectionForProgPC: PROC [prog: Context, pc: BytePC] RETURNS [LoadedSection];
The (INTERIM) procs below provide conversion between TVs and Contexts. The right way to do all this is to have AMModel include the operations of AMTypes that deal with localFrame and globalFrame TVs. TVForFHReferent and friends should be replaced here with appropriate replacements for the guys below.
ContextForIR: PROC [tv: TV--interface record--] RETURNS [Context] = INLINE {
RETURN[tv]};
IRFromContext: PROC [context: Context--interface--] RETURNS [TV--interface record--] = INLINE {
RETURN[context]};
ContextForFrame: PROC [tv: TV--globalFrame or localFrame--] RETURNS [Context] = INLINE {
RETURN[tv]};
FrameFromContext: PROC [context: Context--prog, proc--] RETURNS [TV--globalFrame, localFrame--] = INLINE {
RETURN[context]};
END.