AMModelBridge.Mesa
Russ Atkinson, October 21, 1982 3:41 pm
last modified on July 14, 1983 9:37 am by Paul Rovner
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--];
This guy goes away when the conversion of BugBane and friends to the AMModel world is complete
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.