<> <> <> DIRECTORY AMModel USING[CharIndex, Class], BcdDefs USING[VersionStamp], BcdOps USING[BcdBase], PilotLoadStateFormat USING[NullConfig, ConfigIndex], PrincOps USING[EPRange, MaxNGfi, BytePC, GFTIndex], Rope USING[ROPE], RTBasic USING[TV], RTSymbolDefs USING[SymbolTableBase], RTTypesPrivate USING[TypedVariableRec], WorldVM USING[World]; AMModelPrivate: DEFINITIONS = BEGIN OPEN AMModel, PilotLoadStateFormat, Rope, RTSymbolDefs, WorldVM; FGIndex: TYPE = RECORD[fgCard: CARDINAL, fudge: BOOL]; <> <> FGNull: FGIndex = [LAST[CARDINAL], FALSE]; EPI: TYPE = [0..PrincOps.EPRange*PrincOps.MaxNGfi); PCOffset: TYPE = INT; -- # of bytes from start of procedure NullPCOffset: PCOffset = -1; -- indicates no such PCOffset available RefTVRec: TYPE = REF RTTypesPrivate.TypedVariableRec; <> <> SectionRec: TYPE = RECORD[ SELECT class: Class FROM model => [ configName: ROPE _ , -- require specification versionStamp: BcdDefs.VersionStamp _ , configContext: ConfigContext _ NIL -- useful if it's loaded, but not required ], prog => [ moduleName: ROPE _ , versionStamp: BcdDefs.VersionStamp _ , someGFHTV: RefTVRec _ NIL -- useful if it's loaded, not required ], interface => [ moduleName: ROPE _ , versionStamp: BcdDefs.VersionStamp _ ], proc => [ prog: REF prog SectionRec _ , entryPointIndex: EPI, procTV: RefTVRec _ NIL -- useful if it's loaded, but not required ], statement => [ prog: REF prog SectionRec _ , fgtIndex: FGIndex ] ENDCASE ]; <> <> ConfigContext: TYPE = REF ConfigContextObj; ConfigContextObj: TYPE = RECORD[world: World _ , worldIncarnation: LONG CARDINAL, configIndex: ConfigIndex _ NullConfig -- NullConfig represents rootContext ]; StatementContext: TYPE = REF StatementContextObj; StatementContextObj: TYPE = RECORD[localFrameTV: RefTVRec]; z: ZONE; <> FGIToEPI: PROC [stb: SymbolTableBase, fgi: FGIndex] RETURNS [EPI]; <> EPIToFirstFGI: PROC [stb: SymbolTableBase, epi: EPI, skipArgs: BOOL] RETURNS [FGIndex]; <> EPIToLastFGI: PROC [stb: SymbolTableBase, epi: EPI] RETURNS [FGIndex]; <> <<(FGNull for invalid epi)>> EPIToFirstPC: PROC [stb: SymbolTableBase, epi: EPI, skipArgs: BOOL] RETURNS [PCOffset]; <> EPIToLastPC: PROC [stb: SymbolTableBase, epi: EPI] RETURNS [PCOffset]; <> CharIndexToFGI: PROC [stb: SymbolTableBase, ci: CharIndex] RETURNS [FGIndex]; <> <<(FGNull for invalid position)>> PCToFGI: PROC [stb: SymbolTableBase, epi: EPI, pc: PCOffset] RETURNS [FGIndex]; <> <<(FGNull for invalid epi or invalid pc)>> NextFGI: PROC [stb: SymbolTableBase, fgi: FGIndex, epi: EPI] RETURNS [FGIndex]; <> FGIToFirstChar: PROC [stb: SymbolTableBase, fgi: FGIndex] RETURNS [CharIndex]; <> <<(-1 for invalid fgi)>> FGIToLastChar: PROC [stb: SymbolTableBase, fgi: FGIndex] RETURNS [CharIndex]; <> <<(-1 for invalid fgi)>> FGIToFirstPC: PROC [stb: SymbolTableBase, fgi: FGIndex] RETURNS [PCOffset]; <> FGIToLastPC: PROC [stb: SymbolTableBase, fgi: FGIndex] RETURNS [PCOffset]; <> ProgPCToFGI: PROC[prog: RTBasic.TV, pc: PrincOps.BytePC] RETURNS[FGIndex]; <> GetLocalBCD: PROC[rgfi: PrincOps.GFTIndex] RETURNS[bcd: BcdOps.BcdBase _ NIL]; <> GetRemoteBCD: PROC[world: World, rgfi: PrincOps.GFTIndex] RETURNS[bcd: BcdOps.BcdBase _ NIL]; GetModuleSTB: PROC[bcd: BcdOps.BcdBase, versionStamp: BcdDefs.VersionStamp] RETURNS[SymbolTableBase]; END.