DoTransaction:
PUBLIC
PROC [parms:
POINTER
TO Transaction] ~ {
mapStreamId:
ARRAY
C.StreamId[$source..$log]
OF OldCompilerOps.StreamId ~ [
source~$source, object~$object, log~$log];
GetStream:
PROC [id:
C.StreamId]
RETURNS [Stream.Handle] ~ {
RETURN [parms.getStream[mapStreamId[id]]]};
MapBinding:
PROC [
formalId, formalType: Name,
defaultLocator: Strings.String,
binder: FileParms.BindingProc] ~ {
UnmappedBinder: OldFileParms.BindingProc ~ {
binder[MapActualId[actual]]};
parms.fileParms.Binding[formalId, formalType, defaultLocator, UnmappedBinder]};
MapAcquire:
PROC [id: Name, actual: ActualId]
RETURNS [SymbolSpace] ~ {
RETURN [MapSymbolSpace[parms.fileParms.Acquire[id, UnmapActualId[actual]]]]};
MapRelease: PROC [s: SymbolSpace] ~ {parms.fileParms.Release[UnmapSymbolSpace[s]]};
MapForget: PROC [id: FileParms.ActualId] ~ {parms.fileParms.Forget[UnmapActualId[id]]};
p:
C.Transaction ← [
op ~ IF parms.op = $replace THEN $replace ELSE $compile,
source ~ MapActualId[parms.source],
sourceStream ~ parms.sourceStream,
fileParms ~ [
Binding~MapBinding, Acquire~MapAcquire, Release~MapRelease, Forget~MapForget],
switches ~ parms.switches,
pattern ~ MapActualId[parms.pattern],
objectName ~ parms.objectName, objectFile ~ parms.objectFile,
debugPass ~ parms.debugPass,
objectVersion ~ TRASH,
interface ~ TRASH,
matched ~ TRASH,
sourceTokens ~ TRASH,
nErrors ~ TRASH, nWarnings ~ TRASH,
objectBytes ~ TRASH, objectFrameSize ~ TRASH, linkCount ~ TRASH,
bcdPages ~ TRASH, codePages ~ TRASH, symbolPages ~ TRASH,
getStream ~ GetStream,
startPass ~ parms.startPass];
C.DoTransaction[@p];
parms.objectVersion ← p.objectVersion;
parms.matched ← p.matched;
parms.sourceTokens ← p.sourceTokens;
parms.nErrors ← p.nErrors; parms.nWarnings ← p.nWarnings;
parms.objectBytes ← p.objectBytes;
parms.objectFrameSize ← p.objectFrameSize; parms.linkCount ← p.linkCount};
}.