-- file: WeaveXref.mesa
-- Pascal-to-Mesa translator output, translated at September 23, 1986 1:27:38 pm PDT


DIRECTORY
  PascalBasic,
  PascalWizardFiles,
  WeaveProcs,
  WeaveVars;

WeaveXref: PROGRAM IMPORTS PascalWizardFiles, WeaveProcs, WeaveVars EXPORTS WeaveProcs = PUBLIC
BEGIN OPEN PascalBasic, PascalWizardFiles, WeaveProcs, WeaveVars;
 NewXref: PROCEDURE[P: NamePointer] = 
BEGIN 
 Q:XrefNumber;M, N:SixteenBits;
 {IF(( INT[Ilk↑[P]]>3)OR ( INT[ByteStart↑[P]]+1=ByteStart↑[P+2]))AND (XrefSwitch=0
) THEN  GOTO Label10;M←ModuleCount+XrefSwitch;XrefSwitch←0;Q←Xref↑[P];
IF  INT[Q]>0  THEN BEGIN N←Xmem↑[Q].NumField;
IF(N=M)OR (N= INT[M]+10240) THEN  GOTO Label10  ELSE IF M= INT[N]+10240  THEN BEGIN Xmem↑[Q].
NumField←M; GOTO Label10; END; END;
IF XrefPtr=MaxRefs  THEN BEGIN PascalWriteLn[file: @TermOut];
{PascalWriteLongString[file: @TermOut, item: "! Sorry, "]; PascalWriteLongString[file: @TermOut, item: "cross reference"]; PascalWriteLongString[file: @TermOut, item: " capacity exceeded"]};
Error[];History←3;JumpOut[]; END  ELSE BEGIN XrefPtr←XrefPtr+1;
Xmem↑[XrefPtr].NumField←M; END;Xmem↑[XrefPtr].XlinkField←Q;
Xref↑[P]←XrefPtr;EXITS Label10 => NULL}; END;--:51----52:
 NewModXref: PROCEDURE[P: NamePointer] = 
BEGIN Q, R:XrefNumber;
 Q←Xref↑[P];R←0;
IF  INT[Q]>0  THEN BEGIN IF ModXrefSwitch=0  THEN WHILE 
 INT[Xmem↑[Q].NumField]>=10240 DO BEGIN R←Q;Q←Xmem↑[Q].XlinkField;
 END  ENDLOOP  ELSE IF  INT[Xmem↑[Q].NumField]>=10240  THEN BEGIN R←Q;
Q←Xmem↑[Q].XlinkField; END; END;
IF XrefPtr=MaxRefs  THEN BEGIN PascalWriteLn[file: @TermOut];
{PascalWriteLongString[file: @TermOut, item: "! Sorry, "]; PascalWriteLongString[file: @TermOut, item: "cross reference"]; PascalWriteLongString[file: @TermOut, item: " capacity exceeded"]};
Error[];History←3;JumpOut[]; END  ELSE BEGIN XrefPtr←XrefPtr+1;
Xmem↑[XrefPtr].NumField←ModuleCount+ModXrefSwitch; END;
Xmem↑[XrefPtr].XlinkField←Q;ModXrefSwitch←0;
IF R=0  THEN Xref↑[P]←XrefPtr  ELSE Xmem↑[R].XlinkField←XrefPtr; END;

END.