-- RTWalkSymbolsImpl.mesa -- Last Modified On January 6, 1983 4:54 pm by Paul Rovner DIRECTORY BrandXSymbolDefs USING[SymbolTableBase, SymbolIndex, SymbolIdIndex, symbolIndexForTYPE, SymbolRecordIndex, SymbolContextIndex, nullHandle, nullModuleIndex, ExtensionClass, TreeLink, rootBodyIndex, nullBodyIndex], BrandYSymbolDefs USING[SymbolTableBase, SymbolIndex, SymbolIdIndex, symbolIndexForTYPE, SymbolRecordIndex, SymbolContextIndex, nullHandle, nullModuleIndex, ExtensionClass, TreeLink, rootBodyIndex, nullBodyIndex], ConvertUnsafe USING[ToRope], PrincOps USING[EPRange, MaxNGfi], Rope USING[ROPE], RTSymbolDefs USING[SymbolTableBase, SymbolIndex, SymbolContextIndex, SymbolIdIndex, SymbolRecordIndex, SymbolNameIndex, nullXSymbolIndex, nullYSymbolIndex, nullXSymbolNameIndex, nullYSymbolNameIndex, nullXSymbolContextIndex, nullYSymbolContextIndex, SymbolConstructorIndex, SymbolTableHandle, SymbolModuleIndex, ExtensionClass, TreeLink, BodyIndex, BlockContextLevel, CallableBodyIndex], RTSymbolOps USING[Xfm], RTSymbols USING[Outer], Strings USING[AppendSubString, SubStringDescriptor, SubString], TimeStamp USING [Stamp]; RTWalkSymbolsImpl: PROGRAM IMPORTS ConvertUnsafe, RTSymbols, Strings EXPORTS RTSymbolOps = BEGIN OPEN bx: BrandXSymbolDefs, by: BrandYSymbolDefs, Rope, RTSymbolDefs, RTSymbols; --Procedures-- IsRC: PUBLIC PROC[stb: SymbolTableBase, seIndex: SymbolIndex, checkCommon: BOOL _ TRUE] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[IsRCX[t.e, NARROW[seIndex, SymbolIndex.x].e, checkCommon]]; t: SymbolTableBase.y => RETURN[IsRCY[t.e, NARROW[seIndex, SymbolIndex.y].e, checkCommon]]; ENDCASE => ERROR}; IsRCX: PROC[stb: bx.SymbolTableBase, seIndex: bx.SymbolIndex, checkCommon: BOOL _ TRUE] RETURNS[BOOL] = { WITH cr: stb.seb[stb.UnderType[seIndex]] SELECT FROM record => { rcP: PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[stop: BOOL] = { sei: bx.SymbolIndex _ NARROW[ISEType[stb, isei], SymbolIndex.x].e; nstb: bx.SymbolTableBase _ NARROW[stb, SymbolTableBase.x].e; WITH cse1: nstb.seb[nstb.UnderType[sei]] SELECT FROM union => {urcP: PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[stop: BOOL _ FALSE] = {stop _ IsRC[stb, LOOPHOLE[isei], FALSE]}; tagCardinality: CARDINAL _ nstb.Cardinality[nstb.seb[cse1.tagSei].idType]; RETURN[EnumerateCtxIseis[stb, [x[cse1.caseCtx]], urcP, (tagCardinality = nstb.CtxEntries[cse1.caseCtx])]]}; sequence => IF IsRC[stb, [x[cse1.componentType]]] THEN RETURN[TRUE]; -- here 'tis ENDCASE => IF IsRC[stb, [x[sei]]] THEN RETURN[TRUE]; -- stop looking. This is it RETURN[FALSE]}; -- end rcP IF checkCommon THEN RETURN[cr.hints.refField] -- easy if the common parts are to be included ELSE RETURN[EnumerateCtxIseis[[x[stb]], [x[cr.fieldCtx]], rcP]]}; -- look individually at the fields sequence, union => ERROR; transfer => RETURN[FALSE]; -- NOTE for now relative => RETURN[FALSE]; -- NOTE for now long => RETURN[WITH rse: stb.seb[stb.UnderType[cr.rangeType] ] SELECT FROM ref => rse.counted, ENDCASE => FALSE]; zone => RETURN[cr.counted]; array => RETURN[IsRC[[x[stb]], [x[cr.componentType]]]]; ENDCASE => RETURN[FALSE]}; IsRCY: PROC[stb: by.SymbolTableBase, seIndex: by.SymbolIndex, checkCommon: BOOL _ TRUE] RETURNS[BOOL] = { WITH cr: stb.seb[stb.UnderType[seIndex]] SELECT FROM record => { rcP: PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[stop: BOOL] = { sei: bx.SymbolIndex _ NARROW[ISEType[stb, isei], SymbolIndex.y].e; nstb: bx.SymbolTableBase _ NARROW[stb, SymbolTableBase.y].e; WITH cse1: nstb.seb[nstb.UnderType[sei]] SELECT FROM union => {urcP: PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[stop: BOOL _ FALSE] = {stop _ IsRC[stb, LOOPHOLE[isei], FALSE]}; tagCardinality: CARDINAL _ nstb.Cardinality[nstb.seb[cse1.tagSei].idType]; RETURN[EnumerateCtxIseis[stb, [y[cse1.caseCtx]], urcP, (tagCardinality = nstb.CtxEntries[cse1.caseCtx])]]}; sequence => IF IsRC[stb, [y[cse1.componentType]]] THEN RETURN[TRUE]; -- here 'tis ENDCASE => IF IsRC[stb, [y[sei]]] THEN RETURN[TRUE]; -- stop looking. This is it RETURN[FALSE]}; -- end rcP IF checkCommon THEN RETURN[cr.hints.refField] -- easy if the common parts are to be included ELSE RETURN[EnumerateCtxIseis[[y[stb]], [y[cr.fieldCtx]], rcP]]}; -- look individually at the fields sequence, union => ERROR; transfer => RETURN[FALSE]; -- NOTE for now relative => RETURN[FALSE]; -- NOTE for now long => RETURN[WITH rse: stb.seb[stb.UnderType[cr.rangeType] ] SELECT FROM ref => rse.counted, ENDCASE => FALSE]; zone => RETURN[cr.counted]; array => RETURN[IsRC[[y[stb]], [y[cr.componentType]]]]; ENDCASE => RETURN[FALSE]}; IsUnion: PUBLIC PROC [stb: SymbolTableBase, seIndex: SymbolIndex] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.seb[t.e.UnderType[NARROW[seIndex, SymbolIndex.x].e]].typeTag = union]; t: SymbolTableBase.y => RETURN[t.e.seb[t.e.UnderType[NARROW[seIndex, SymbolIndex.y].e]].typeTag = union]; ENDCASE => ERROR}; IsSequence: PUBLIC PROC [stb: SymbolTableBase, seIndex: SymbolIndex] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.seb[t.e.UnderType[NARROW[seIndex, SymbolIndex.x].e]].typeTag = sequence]; t: SymbolTableBase.y => RETURN[t.e.seb[t.e.UnderType[NARROW[seIndex, SymbolIndex.y].e]].typeTag = sequence]; ENDCASE => ERROR}; EnumerateRecordIseis: PUBLIC PROC [ stb: SymbolTableBase, rsei: SymbolRecordIndex, p: PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[stop: BOOL], level: CARDINAL _ 0, mesaSymbolsOK: BOOL _ FALSE] RETURNS [stopped: BOOL] = { proc: PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[stop: BOOL] = { sei: SymbolIndex _ ISEType[stb, isei]; IF NOT (IsUnion[stb, sei] OR IsSequence[stb, sei]) OR level = 0 THEN RETURN[p[stb, isei]]; RETURN[FALSE]}; IF NullISEI[LOOPHOLE[rsei]] THEN RETURN[FALSE]; WITH stb SELECT FROM t: SymbolTableBase.x => {WITH lrc: t.e.seb[NARROW[rsei, SymbolRecordIndex.x].e] SELECT FROM linked => { stopped _ EnumerateRecordIseis [stb, [x[LOOPHOLE[t.e.UnderType[lrc.linkType], bx.SymbolRecordIndex]]], p, level + 1, mesaSymbolsOK]; IF stopped THEN RETURN[TRUE]}; ENDCASE; RETURN[EnumerateCtxIseis [stb, [x[t.e.seb[NARROW[rsei, SymbolRecordIndex.x].e].fieldCtx]], proc, mesaSymbolsOK]]; }; t: SymbolTableBase.y => {WITH lrc: t.e.seb[NARROW[rsei, SymbolRecordIndex.y].e] SELECT FROM linked => { stopped _ EnumerateRecordIseis [stb, [y[LOOPHOLE[t.e.UnderType[lrc.linkType], by.SymbolRecordIndex]]], p, level + 1, mesaSymbolsOK]; IF stopped THEN RETURN[TRUE]}; ENDCASE; RETURN[EnumerateCtxIseis [stb, [y[t.e.seb[NARROW[rsei, SymbolRecordIndex.y].e].fieldCtx]], proc, mesaSymbolsOK]]; }; ENDCASE => ERROR}; -- copied in RCMapBuilderImpl EnumerateCtxIseis: PUBLIC PROC [stb: SymbolTableBase, ctx: SymbolContextIndex, proc: PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[stop: BOOL], reallyComplete: BOOL _ FALSE, mesaSymbolsOK: BOOL _ FALSE] RETURNS[stopped: BOOL] = { isei: SymbolIdIndex; IF NullCtx[ctx] THEN RETURN[FALSE]; IF NOT reallyComplete THEN { WITH stb SELECT FROM t: SymbolTableBase.x => WITH c: t.e.ctxb[NARROW[ctx, SymbolContextIndex.x].e] SELECT FROM included => IF ~c.complete THEN { p: PROC[base: SymbolTableBase] = -- called once {stopped _ EnumerateCtxIseis[base, [x[c.map]], proc]}; Outer[stb, [x[c.module]], p, mesaSymbolsOK]; RETURN[stopped]; }; simple => NULL; ENDCASE => ERROR; t: SymbolTableBase.y => WITH c: t.e.ctxb[NARROW[ctx, SymbolContextIndex.y].e] SELECT FROM included => IF ~c.complete THEN { p: PROC[base: SymbolTableBase] = -- called once {stopped _ EnumerateCtxIseis[base, [y[c.map]], proc]}; Outer[stb, [y[c.module]], p, mesaSymbolsOK]; RETURN[stopped]; }; simple => NULL; ENDCASE => ERROR; ENDCASE => ERROR; }; FOR isei _ FirstCtxSe[stb, ctx], NextSe[stb, isei] UNTIL NullISEI[isei] DO IF NullName[ISEName[stb, isei]] AND NullCtx[ISECtx[stb, isei]] THEN LOOP; -- padding IF proc[stb, isei] THEN RETURN[TRUE]; ENDLOOP; RETURN[FALSE]}; CountComponents: PUBLIC PROC [stb: SymbolTableBase, rsei: SymbolRecordIndex] RETURNS [n: NAT] = { n _ CountCommonComponents[stb, rsei]; IF RSEVariant[stb, rsei] THEN n _ n + 1}; CountCommonComponents: PROC [stb: SymbolTableBase, rsei: SymbolRecordIndex] RETURNS [n: CARDINAL] = { count: PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[stop: BOOL] = { sei: SymbolIndex _ ISEType[stb, isei]; IF NOT (IsUnion[stb, sei] OR IsSequence[stb, sei]) THEN n _ n + 1; RETURN[FALSE]; -- keep counting }; n _ 0; [] _ EnumerateRecordIseis[stb, rsei, count]}; -- peel layers of id until the last one before either the underlying cons or a change of name -- or a specification of default initialization PeelAllButLast: PUBLIC PROC [stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[SymbolIdIndex] = { WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[PeelAllButLastX[t.e, NARROW[isei, SymbolIdIndex.x].e]]; t: SymbolTableBase.y => RETURN[PeelAllButLastY[t.e, NARROW[isei, SymbolIdIndex.y].e]]; ENDCASE => ERROR}; PeelAllButLastX: PROC [stb: bx.SymbolTableBase, isei: bx.SymbolIdIndex] RETURNS[SymbolIdIndex] = { FOR sei: bx.SymbolIndex _ stb.seb[isei].idInfo, stb.seb[isei].idInfo UNTIL stb.seb[isei].extended -- i.e. isei has default initialization specified DO WITH se: stb.seb[sei] SELECT FROM id => IF se.idType # bx.symbolIndexForTYPE THEN ERROR ELSE IF stb.seb[isei].hash # stb.seb[LOOPHOLE[sei, bx.SymbolIdIndex]].hash THEN EXIT ELSE isei _ LOOPHOLE[sei, bx.SymbolIdIndex]; cons => EXIT; ENDCASE => ERROR; ENDLOOP; RETURN[[x[isei]]]}; PeelAllButLastY: PROC [stb: by.SymbolTableBase, isei: by.SymbolIdIndex] RETURNS[SymbolIdIndex] = { FOR sei: by.SymbolIndex _ stb.seb[isei].idInfo, stb.seb[isei].idInfo UNTIL stb.seb[isei].extended -- i.e. isei has default initialization specified DO WITH se: stb.seb[sei] SELECT FROM id => IF se.idType # by.symbolIndexForTYPE THEN ERROR ELSE IF stb.seb[isei].hash # stb.seb[LOOPHOLE[sei, by.SymbolIdIndex]].hash THEN EXIT ELSE isei _ LOOPHOLE[sei, by.SymbolIdIndex]; cons => EXIT; ENDCASE => ERROR; ENDLOOP; RETURN[[y[isei]]]}; SEUnderType: PUBLIC PROC[stb: SymbolTableBase, sei: SymbolIndex] RETURNS[SymbolConstructorIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.UnderType[NARROW[sei, SymbolIndex.x].e]]]]; t: SymbolTableBase.y => RETURN[[y[t.e.UnderType[NARROW[sei, SymbolIndex.y].e]]]]; ENDCASE => ERROR; }; ISEType: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[SymbolIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.seb[NARROW[isei, SymbolIdIndex.x].e].idType]]]; t: SymbolTableBase.y => RETURN[[y[t.e.seb[NARROW[isei, SymbolIdIndex.y].e].idType]]]; ENDCASE => ERROR; }; BodyType: PUBLIC PROC[stb: SymbolTableBase, bti: BodyIndex] RETURNS[SymbolIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.bb[NARROW[bti, BodyIndex.x].e].type]]]; t: SymbolTableBase.y => RETURN[[y[t.e.bb[NARROW[bti, BodyIndex.y].e].type]]]; ENDCASE => ERROR; }; CallableBodyEntryIndex: PUBLIC PROC[stb: SymbolTableBase, cbti: CallableBodyIndex] RETURNS[[0..PrincOps.EPRange*PrincOps.MaxNGfi)] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.bb[NARROW[cbti, CallableBodyIndex.x].e].entryIndex]; t: SymbolTableBase.y => RETURN[t.e.bb[NARROW[cbti, CallableBodyIndex.y].e].entryIndex]; ENDCASE => ERROR; }; SEBitsForType: PUBLIC PROC[stb: SymbolTableBase, sei: SymbolIndex] RETURNS[INT] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.BitsForType[NARROW[sei, SymbolIndex.x].e]]; t: SymbolTableBase.y => RETURN[t.e.BitsForType[NARROW[sei, SymbolIndex.y].e]]; ENDCASE => ERROR; }; IDCardinalValue: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[CARDINAL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.x].e].idValue]; t: SymbolTableBase.y => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.y].e].idValue]; ENDCASE => ERROR; }; IDCardinalInfo: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[CARDINAL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.x].e].idInfo]; t: SymbolTableBase.y => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.y].e].idInfo]; ENDCASE => ERROR; }; BodyLevel: PUBLIC PROC[stb: SymbolTableBase, bti: BodyIndex] RETURNS[BlockContextLevel] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.bb[NARROW[bti, BodyIndex.x].e].level]]]; t: SymbolTableBase.y => RETURN[[y[t.e.bb[NARROW[bti, BodyIndex.y].e].level]]]; ENDCASE => ERROR; }; ParentBody: PUBLIC PROC[stb: SymbolTableBase, bti: BodyIndex] RETURNS[BodyIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.ParentBti[NARROW[bti, BodyIndex.x].e]]]]; t: SymbolTableBase.y => RETURN[[y[t.e.ParentBti[NARROW[bti, BodyIndex.y].e]]]]; ENDCASE => ERROR; }; BodyName: PUBLIC PROC[stb: SymbolTableBase, cbti: CallableBodyIndex] RETURNS[SymbolNameIndex] = {RETURN [ISEName[stb, WITH stb SELECT FROM t: SymbolTableBase.x => [x[t.e.bb[NARROW[cbti, CallableBodyIndex.x].e].id]], t: SymbolTableBase.y =>[y[t.e.bb[NARROW[cbti, CallableBodyIndex.y].e].id]] ENDCASE => ERROR]]; }; RootBodyType: PUBLIC PROC[stb: SymbolTableBase] RETURNS[SymbolIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.bb[bx.rootBodyIndex].type]]]; t: SymbolTableBase.y => RETURN[[y[t.e.bb[by.rootBodyIndex].type]]]; ENDCASE => ERROR; }; ISEInfo: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[SymbolIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.seb[NARROW[isei, SymbolIdIndex.x].e].idInfo]]]; t: SymbolTableBase.y => RETURN[[y[t.e.seb[NARROW[isei, SymbolIdIndex.y].e].idInfo]]]; ENDCASE => ERROR; }; ISECtx: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[SymbolContextIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.seb[NARROW[isei, SymbolIdIndex.x].e].idCtx]]]; t: SymbolTableBase.y => RETURN[[y[t.e.seb[NARROW[isei, SymbolIdIndex.y].e].idCtx]]]; ENDCASE => ERROR; }; ISEFindExtension: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[ec: ExtensionClass, tl: TreeLink] = {WITH stb SELECT FROM t: SymbolTableBase.x => {ecx: bx.ExtensionClass; tlx: bx.TreeLink; [ecx, tlx] _ t.e.FindExtension[NARROW[isei, SymbolIdIndex.x].e]; ec _ [x[ecx]]; tl _ [x[tlx]]}; t: SymbolTableBase.y => {ecy: by.ExtensionClass; tly: by.TreeLink; [ecy, tly] _ t.e.FindExtension[NARROW[isei, SymbolIdIndex.y].e]; ec _ [y[ecy]]; tl _ [y[tly]]}; ENDCASE => ERROR; }; STBDirectoryCtx: PUBLIC PROC[stb: SymbolTableBase] RETURNS[SymbolContextIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.stHandle.directoryCtx]]]; t: SymbolTableBase.y => RETURN[[y[t.e.stHandle.directoryCtx]]]; ENDCASE => ERROR; }; STBVersion: PUBLIC PROC[stb: SymbolTableBase] RETURNS[TimeStamp.Stamp] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.stHandle.version]; t: SymbolTableBase.y => RETURN[t.e.stHandle.version]; ENDCASE => ERROR; }; STBSourceVersion: PUBLIC PROC[stb: SymbolTableBase] RETURNS[TimeStamp.Stamp] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.stHandle.sourceVersion]; t: SymbolTableBase.y => RETURN[t.e.stHandle.sourceVersion]; ENDCASE => ERROR; }; ISEName: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[SymbolNameIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.seb[NARROW[isei, SymbolIdIndex.x].e].hash]]]; t: SymbolTableBase.y => RETURN[[y[t.e.seb[NARROW[isei, SymbolIdIndex.y].e].hash]]]; ENDCASE => ERROR; }; ISEPublic: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.x].e].public]; t: SymbolTableBase.y => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.y].e].public]; ENDCASE => ERROR; }; SETypeXferMode: PUBLIC PROC[stb: SymbolTableBase, sei: SymbolIndex] RETURNS[RTSymbolOps.Xfm] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[SELECT t.e.XferMode[NARROW[sei, SymbolIndex.x].e] FROM none => none, signal, error => signalOrError, proc => proc, ENDCASE => other]; t: SymbolTableBase.y => RETURN[SELECT t.e.XferMode[NARROW[sei, SymbolIndex.y].e] FROM none => none, signal, error => signalOrError, proc => proc, ENDCASE => other]; ENDCASE => ERROR; }; SETagIDP: PUBLIC PROC[stb: SymbolTableBase, sei: SymbolIndex] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[WITH t.e.seb[NARROW[sei, SymbolIndex.x].e] SELECT FROM id => TRUE, ENDCASE => FALSE]; t: SymbolTableBase.y => RETURN[WITH t.e.seb[NARROW[sei, SymbolIndex.y].e] SELECT FROM id => TRUE, ENDCASE => FALSE]; ENDCASE => ERROR; }; ISEExtended: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.x].e].extended]; t: SymbolTableBase.y => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.y].e].extended]; ENDCASE => ERROR; }; ISEConstant: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.x].e].constant]; t: SymbolTableBase.y => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.y].e].constant]; ENDCASE => ERROR; }; ISEImmutable: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.x].e].immutable]; t: SymbolTableBase.y => RETURN[t.e.seb[NARROW[isei, SymbolIdIndex.y].e].immutable]; ENDCASE => ERROR; }; IsTypeSEI: PUBLIC PROC[sei: SymbolIndex] RETURNS[BOOL] = {WITH sei SELECT FROM t: SymbolIndex.x => RETURN[t.e = bx.symbolIndexForTYPE]; t: SymbolIndex.y => RETURN[t.e = by.symbolIndexForTYPE]; ENDCASE => ERROR; }; IsTransferConstructorSEI: PUBLIC PROC[stb: SymbolTableBase, sei: SymbolConstructorIndex] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.seb[NARROW[sei, SymbolConstructorIndex.x].e].typeTag = transfer]; t: SymbolTableBase.y => RETURN[t.e.seb[NARROW[sei, SymbolConstructorIndex.y].e].typeTag = transfer]; ENDCASE => ERROR; }; RSEVariant: PUBLIC PROC[stb: SymbolTableBase, rsei: SymbolRecordIndex] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e.seb[NARROW[rsei, SymbolRecordIndex.x].e].hints.variant]; t: SymbolTableBase.y => RETURN[t.e.seb[NARROW[rsei, SymbolRecordIndex.y].e].hints.variant]; ENDCASE => ERROR; }; STBDirectoryCTX: PUBLIC PROC[stb: SymbolTableBase] RETURNS[SymbolContextIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.stHandle.directoryCtx]]]; t: SymbolTableBase.y => RETURN[[y[t.e.stHandle.directoryCtx]]]; ENDCASE => ERROR; }; FirstCtxSe: PUBLIC PROC[stb: SymbolTableBase, ctx: SymbolContextIndex] RETURNS[SymbolIdIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.FirstCtxSe[NARROW[ctx, SymbolContextIndex.x].e]]]]; t: SymbolTableBase.y => RETURN[[y[t.e.FirstCtxSe[NARROW[ctx, SymbolContextIndex.y].e]]]]; ENDCASE => ERROR; }; NextSe: PUBLIC PROC[stb: SymbolTableBase, isei: SymbolIdIndex] RETURNS[SymbolIdIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[[x[t.e.NextSe[NARROW[isei, SymbolIdIndex.x].e]]]]; t: SymbolTableBase.y => RETURN[[y[t.e.NextSe[NARROW[isei, SymbolIdIndex.y].e]]]]; ENDCASE => ERROR; }; NullISEI: PUBLIC PROC[isei: SymbolIdIndex] RETURNS[BOOL] = {WITH isei SELECT FROM t: SymbolIdIndex.x => RETURN[t.e = nullXSymbolIndex]; t: SymbolIdIndex.y => RETURN[t.e = nullYSymbolIndex]; ENDCASE => ERROR; }; NullSEI: PUBLIC PROC[sei: SymbolIndex] RETURNS[BOOL] = {WITH sei SELECT FROM t: SymbolIndex.x => RETURN[t.e = nullXSymbolIndex]; t: SymbolIndex.y => RETURN[t.e = nullYSymbolIndex]; ENDCASE => ERROR; }; NullBTI: PUBLIC PROC[bti: BodyIndex] RETURNS[BOOL] = {WITH bti SELECT FROM t: BodyIndex.x => RETURN[t.e = bx.nullBodyIndex]; t: BodyIndex.y => RETURN[t.e = by.nullBodyIndex]; ENDCASE => ERROR; }; CallableBTI: PUBLIC PROC[stb: SymbolTableBase, bti: BodyIndex] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[WITH t.e.bb[NARROW[bti, BodyIndex.x].e] SELECT FROM Callable => TRUE, ENDCASE => FALSE]; t: SymbolTableBase.y => RETURN[WITH t.e.bb[NARROW[bti, BodyIndex.y].e] SELECT FROM Callable => TRUE, ENDCASE => FALSE]; ENDCASE => ERROR; }; IsRootBTI: PUBLIC PROC[bti: BodyIndex] RETURNS[BOOL] = {WITH bti SELECT FROM t: BodyIndex.x => RETURN[t.e = bx.rootBodyIndex]; t: BodyIndex.y => RETURN[t.e = by.rootBodyIndex]; ENDCASE => ERROR; }; NullName: PUBLIC PROC[hti: SymbolNameIndex] RETURNS[BOOL] = {WITH hti SELECT FROM t: SymbolNameIndex.x => RETURN[t.e = nullXSymbolNameIndex]; t: SymbolNameIndex.y => RETURN[t.e = nullYSymbolNameIndex]; ENDCASE => ERROR; }; NullCtx: PUBLIC PROC[ctx: SymbolContextIndex] RETURNS[BOOL] = {WITH ctx SELECT FROM t: SymbolContextIndex.x => RETURN[t.e = nullXSymbolContextIndex]; t: SymbolContextIndex.y => RETURN[t.e = nullYSymbolContextIndex]; ENDCASE => ERROR; }; NullStb: PUBLIC PROC[stb: SymbolTableBase] RETURNS[BOOL] = {WITH stb SELECT FROM t: SymbolTableBase.x => RETURN[t.e = NIL]; t: SymbolTableBase.y => RETURN[t.e = NIL]; ENDCASE => ERROR; }; NullSth: PUBLIC PROC[sth: SymbolTableHandle] RETURNS[BOOL] = {WITH sth SELECT FROM t: SymbolTableHandle.x => RETURN[t.e = bx.nullHandle]; t: SymbolTableHandle.y => RETURN[t.e = by.nullHandle]; ENDCASE => ERROR; }; NullModuleIndex: PUBLIC PROC[mdi: SymbolModuleIndex] RETURNS[BOOL] = {WITH mdi SELECT FROM t: SymbolModuleIndex.x => RETURN[t.e = bx.nullModuleIndex]; t: SymbolModuleIndex.y => RETURN[t.e = by.nullModuleIndex]; ENDCASE => ERROR; }; SubStringForHash: PUBLIC PROC[stb: SymbolTableBase, ss: Strings.SubString, hti: SymbolNameIndex] = {WITH stb SELECT FROM t: SymbolTableBase.x => t.e.SubStringForHash[ss, NARROW[hti, SymbolNameIndex.x].e]; t: SymbolTableBase.y => t.e.SubStringForHash[ss, NARROW[hti, SymbolNameIndex.y].e]; ENDCASE => ERROR; }; STBToModuleName: PUBLIC PROC[stb: SymbolTableBase] RETURNS[ROPE] = {modName: STRING = [100]; STBToModName[stb, modName]; RETURN[ConvertUnsafe.ToRope[LONG[modName]]]}; STBToModName: PROC[stb: SymbolTableBase, modName: LONG STRING] = {modName.length _ 0; FOR isei: SymbolIdIndex _ FirstCtxSe[stb, STBDirectoryCTX[stb]], NextSe[stb, isei] UNTIL NullISEI[isei] DO IF ISEPublic[stb, isei] THEN {modNameDesc: Strings.SubStringDescriptor; SubStringForHash[stb, @modNameDesc, ISEName[stb, isei]]; Strings.AppendSubString[modName, @modNameDesc]; RETURN}; ENDLOOP}; END. ÊG˜Jš†ÏcUœÏk œžœµžœ²žœžœžœžœžœ¢žœœ žœžœ?žœžœžœ%žœžœžœMœÏnœžœžœhžœžœ žœžœžœžœžœ-žœ žœWžœ žœ0žœžœŸœžœ@žœžœ žœžœžœ%žœžœžœ,žœžœ$žœLžœ&žœ%žœžœ/žœFžœžœžœ.žœžœ'žœFžœ±žœ@žœžœžœ œ žœžœžœžœžœœ žœžœ œ žœžœžœ/œ žœžœT#œžœžœžœœžœžœœ žœžœ,žœžœHžœžœžœžœ-žœžœžœŸœžœ@žœžœ žœžœžœ%žœžœžœ,žœžœ$žœLžœ&žœ%žœžœ/žœFžœžœžœ.žœžœ'žœFžœ±žœ@žœžœžœ œ žœžœžœžœžœœ žœžœ œ žœžœžœ/œ žœžœT#œžœžœžœœžœžœœ žœžœ,žœžœHžœžœžœžœ-žœžœžœŸœžœžœ4žœžœžœžœžœ)žœžœWžœžœ4žœžœŸ œžœžœ4žœžœžœžœžœ'žœžœXžœžœ7žœžœŸœžœžœcžœ,žœžœžœ%žœžœ žœ žœ žœ,žœžœ?žœžœžœžœžœžœžœžœžœ žœžœžœžœžœžœžœ,žœžœžœžœ¿žœÉžœ žœžœžœžœžœ_žœ¹žœžœžœžœ¿žœÈžœ žœžœžœžœžœ_žœ“žœžœŸœžœžœQžœ,žœžœžœžœžœžœžœ žœžœžœžœžœžœžœžœžœžœžœžœ2žœžœ0žœ žœžœœªžœ:žœžœžœ žœ2žœžœ0žœ žœžœœªžœ:žœžœžœžœžœžœ0žœžœžœžœ&žœžœ œžœžœžœžœžœžœžœŸœžœžœ:žœžœ6žœžœŸœžœ7žœžœžœ,žœžœ?žœžœžœžœžœžœœO^œ0Ÿœžœžœ3žœžœžœžœžœžœ;žœžœ"žœžœŸœžœ9žœžœGžœ2œžœžœžœžœžœ#žœžœžœžœžœ5žœžœžœžœ+žœ žœžœžœžœŸœžœ9žœžœGžœ2œžœžœžœžœžœ#žœžœžœžœžœ5žœžœžœžœ+žœ žœžœžœžœŸ œžœžœ/žœžœžœžœžœžœ:žœžœ!žœžœŸœžœžœ,žœžœžœžœžœ žœDžœ žœ+žœžœŸœžœžœ'žœžœžœžœžœ žœ=žœ žœ$žœžœŸœžœžœ6žœ.žœžœžœžœžœJžœžœ1žœžœŸ œžœžœ/žœžœžœžœžœžœžœ8žœžœžœžœŸœžœžœ2žœžœžœžœžœžœ žœCžœ žœ*žœžœŸœžœžœ2žœžœžœžœžœžœ žœBžœ žœ)žœžœŸ œžœžœ'žœžœžœžœžœ žœ>žœ žœ%žœžœŸ œžœžœ'žœžœžœžœžœžœ8žœžœžœžœŸœžœžœ6žœžœžœžœžœ=žœ­žœŠžœžœ Ÿ œžœžœžœžœžœžœžœDžœ+žœžœŸœžœžœ,žœžœžœžœžœ žœDžœ žœ+žœžœŸœžœžœ,žœžœžœžœžœ žœCžœ žœ*žœžœŸœžœžœ2žœ(žœžœžœžœãžœZžœžœŸœžœžœžœžœžœžœžœ@žœ'žœžœŸ œžœžœžœžœžœžœžœ6žœžœžœŸœžœžœžœžœžœžœžœ<žœ#žœžœŸœžœžœ,žœžœžœžœžœ žœBžœ žœ)žœžœŸ œžœžœ,žœžœžœžœžœžœ žœBžœ žœ)žœžœŸœžœžœ/žœžœžœžœ(ž œžœžœžœ3ž œžœžœžœžœžœŸœžœžœ)žœžœžœžœžœ(žœžœ žœžœžœžœžœžœ*žœžœ žœžœžœžœžœžœžœžœŸ œžœžœ,žœžœžœžœžœžœ žœDžœ žœ+žœžœŸ œžœžœ,žœžœžœžœžœžœ žœDžœ žœ+žœžœŸ œžœžœ,žœžœžœžœžœžœ žœEžœ žœ,žœžœŸ œžœžœžœžœžœžœžœžœ9žœ$žœžœŸœžœžœ:žœžœžœžœžœ+žœ žœbžœ žœ=žœžœŸ œžœžœ0žœžœžœžœžœžœ žœMžœ žœ4žœžœŸœžœžœžœžœžœžœžœ@žœ'žœžœŸ œžœžœ6žœžœžœžœžœžœAžœžœ(žœžœŸœžœžœ,žœžœžœžœžœžœ=žœžœ$žœžœŸœžœžœžœžœžœžœžœžœ6žœžœžœŸœžœžœžœžœžœžœžœžœ4žœžœžœÐbnœžœžœžœžœžœžœžœžœ2žœžœžœŸ œžœžœ'žœžœžœžœžœžœžœžœžœžœ<žœ0žœžœ!žœžœžœžœžœ<žœ0žœžœžœžœ  œžœžœžœžœžœžœžœžœ2žœžœžœŸœžœžœžœžœžœžœžœžœ<žœ#žœžœŸœžœžœžœžœžœžœžœ"žœBžœ&žœžœ œžœžœžœžœžœžœžœžœžœ!žœžœžœžœ œžœžœžœžœžœžœžœ!žœ7žœžœžœ œžœžœžœžœžœžœžœ!žœ<žœ!žœžœŸœžœžœ›žœžœžœ8žœTžœ"žœžœŸœžœžœžœžœžœ.žœžœŸ œžœ žœžœžœVžœžœžœžœËžœžœžœ˜œØ—…—l{k