-- file: TexRest2Impl.mesa -- Pascal-to-Mesa translator output, translated at September 27, 1985 10:21:38 am PDT DIRECTORY PascalBasic, PascalWizardFiles, TexTypes, TexSysdep, TexSysdepInline, TexInit, TexInteraction, TexMemory, TexSymbols, TexScan, TexOps, TexParagraph, TexBuildPage, TexRest; TexRest2Impl: PROGRAM IMPORTS PascalBasic, PascalWizardFiles, TexTypes, TexSysdep, TexSysdepInline, TexInit, TexInteraction, TexMemory, TexSymbols, TexScan, TexOps, TexParagraph, TexBuildPage, TexRest EXPORTS TexRest = PUBLIC BEGIN OPEN PascalBasic, PascalWizardFiles, TexTypes, TexSysdep, TexSysdepInline, TexInit, TexInteraction, TexMemory, TexSymbols, TexScan, TexOps, TexParagraph, TexBuildPage, TexRest; GetRToken: PROCEDURE = BEGIN DO {--Label20:--DO GetToken[]; IF CurTok#2592 THEN EXIT; ENDLOOP; IF(CurCs=0)OR ( INT[CurCs]>2758) THEN BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[1037]; END;BEGIN HelpPtr←5;HelpLine↑[4]←1038; HelpLine↑[3]←1039;HelpLine↑[2]←1040;HelpLine↑[1]←1041; HelpLine↑[0]←1042; END;IF CurCs=0 THEN BackInput[];CurTok←6854; InsError[]; GOTO Label20; END;EXIT; EXITS Label20 => NULL} ENDLOOP; END;--:1215----1229:-- TrapZeroGlue: PROCEDURE = BEGIN IF(Mem[CurVal+1]↑.Int=0)AND (Mem[CurVal+2]↑.Int=0)AND (Mem[CurVal+3 ]↑.Int=0) THEN BEGIN Mem[0]↑.Hh.Rh←Mem[0]↑.Hh.Rh+1; DeleteGlueRef[CurVal];CurVal←0; END; END;--:1229----1236: DoRegisterCommand: PROCEDURE[A: SmallNumber] = BEGIN L, Q, R, S:Halfword;P:PascalInteger[0..3]; Q←CurCmd;--1237: {{BEGIN IF Q#88 THEN BEGIN GetXToken[]; IF( INT[CurCmd]>=72)AND ( INT[CurCmd]<=75) THEN BEGIN L←CurChr;P←CurCmd-72; GOTO Label40; END;IF CurCmd#88 THEN BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[544]; END;PrintCmdChr[CurCmd,CurChr];Print[545]; PrintCmdChr[Q,0];BEGIN HelpPtr←1;HelpLine↑[0]←1063; END;Error[]; GOTO Label10; END; END;P←CurChr;ScanEightBitInt[]; SELECT P FROM 0 =>L←CurVal+4817;1 =>L←CurVal+5221;2 =>L←CurVal+3044; 3 =>L←CurVal+3300; ENDCASE; END;EXITS Label40 => NULL};--:1237--IF Q=88 THEN ScanOptionalEquals [] ELSE IF ScanKeyword[1059] THEN NULL; ArithError←FALSE;IF INT[Q]<90 THEN--1238: IF INT[P]<2 THEN BEGIN IF P=0 THEN ScanInt [] ELSE ScanDimen[FALSE,FALSE,FALSE ];IF Q=89 THEN CurVal←CurVal+Eqtb↑[L].Int; END ELSE BEGIN ScanGlue[P]; IF Q=89 THEN--1239:--BEGIN Q←NewSpec[CurVal];R←Eqtb↑[L].Hh.Rh; DeleteGlueRef[CurVal];Mem[Q+1]↑.Int←Mem[Q+1]↑.Int+Mem[R+1]↑.Int; IF Mem[Q+2]↑.Int=0 THEN Mem[Q]↑.Hh.B0←0; IF Mem[Q]↑.Hh.B0=Mem[R]↑.Hh.B0 THEN Mem[Q+2]↑.Int←Mem[Q+2]↑.Int+Mem[R+2]↑. Int ELSE IF( INT[Mem[Q]↑.Hh.B0]<Mem[R]↑.Hh.B0)AND (Mem[R+2]↑.Int#0) THEN BEGIN Mem [Q+2]↑.Int←Mem[R+2]↑.Int;Mem[Q]↑.Hh.B0←Mem[R]↑.Hh.B0; END; IF Mem[Q+3]↑.Int=0 THEN Mem[Q]↑.Hh.B1←0; IF Mem[Q]↑.Hh.B1=Mem[R]↑.Hh.B1 THEN Mem[Q+3]↑.Int←Mem[Q+3]↑.Int+Mem[R+3]↑. Int ELSE IF( INT[Mem[Q]↑.Hh.B1]<Mem[R]↑.Hh.B1)AND (Mem[R+3]↑.Int#0) THEN BEGIN Mem [Q+3]↑.Int←Mem[R+3]↑.Int;Mem[Q]↑.Hh.B1←Mem[R]↑.Hh.B1; END;CurVal←Q; END--:1239--; END--:1238-- ELSE--1240:--BEGIN ScanInt[]; IF INT[P]<2 THEN IF Q=90 THEN CurVal←NxPlusY[Eqtb↑[L].Int,CurVal,0] ELSE CurVal←XOverN[Eqtb↑[L].Int,CurVal] ELSE BEGIN S←Eqtb↑[L].Hh.Rh; R←NewSpec[S]; IF Q=90 THEN BEGIN Mem[R+1]↑.Int←NxPlusY[Mem[S+1]↑.Int,CurVal,0]; Mem[R+2]↑.Int←NxPlusY[Mem[S+2]↑.Int,CurVal,0]; Mem[R+3]↑.Int←NxPlusY[Mem[S+3]↑.Int,CurVal,0]; END ELSE BEGIN Mem[R+1]↑.Int←XOverN[Mem[S+1]↑.Int,CurVal]; Mem[R+2]↑.Int←XOverN[Mem[S+2]↑.Int,CurVal]; Mem[R+3]↑.Int←XOverN[Mem[S+3]↑.Int,CurVal]; END;CurVal←R; END; END--:1240--;IF ArithError THEN BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[1060]; END;BEGIN HelpPtr←2;HelpLine↑[1]←1061; HelpLine↑[0]←1062; END;Error[]; GOTO Label10; END; IF INT[P]<2 THEN IF( INT[A]>=4) THEN GeqWordDefine[L,CurVal] ELSE EqWordDefine[L ,CurVal] ELSE BEGIN TrapZeroGlue[]; IF( INT[A]>=4) THEN GeqDefine[L,116,CurVal] ELSE EqDefine[L,116,CurVal]; END; EXITS Label10 => NULL}; END;--:1236----1243:-- AlterAux: PROCEDURE = BEGIN C:Halfword; IF CurChr#ABS[CurList.ModeField] THEN ReportIllegalCase [] ELSE BEGIN C←CurChr;ScanOptionalEquals[]; IF C=1 THEN BEGIN ScanDimen[FALSE,FALSE,FALSE]; CurList.AuxField←CurVal; END ELSE BEGIN ScanInt[]; IF(CurVal<=0)OR (CurVal>32767) THEN BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[1064]; END;BEGIN HelpPtr←1;HelpLine↑[0]←1065; END; IntError[CurVal]; END ELSE CurList.AuxField←CurVal; END; END; END; --:1243----1244:-- AlterPrevGraf: PROCEDURE = BEGIN P:PascalInteger[0..NestSize]; Nest↑[NestPtr]←CurList;P←NestPtr; WHILE ABS[Nest↑[P].ModeField]#1 DO P←P-1 ENDLOOP ;ScanOptionalEquals[]; ScanInt[];IF CurVal<0 THEN BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[807]; END;PrintEsc[393];BEGIN HelpPtr←1; HelpLine↑[0]←1066; END;IntError[CurVal]; END ELSE BEGIN Nest↑[P].PgField←CurVal;CurList←Nest↑[NestPtr]; END; END;--:1244----1245:-- AlterPageSoFar: PROCEDURE = BEGIN C:PascalInteger[0..7]; C←CurChr;ScanOptionalEquals[];ScanDimen[FALSE,FALSE,FALSE]; PageSoFar↑[C]←CurVal; END;--:1245----1246:-- AlterInteger: PROCEDURE = BEGIN C:PascalInteger[0..1]; C←CurChr;ScanOptionalEquals[];ScanInt[]; IF C=0 THEN DeadCycles←CurVal ELSE InsertPenalties←CurVal; END; --:1246----1247:-- AlterBoxDimen: PROCEDURE = BEGIN C:SmallNumber;B:EightBits; C←CurChr;ScanEightBitInt[];B←CurVal;ScanOptionalEquals[]; ScanDimen[FALSE,FALSE,FALSE]; IF Eqtb↑[3822+B].Hh.Rh#0 THEN Mem[ INT[Eqtb↑[3822+B].Hh.Rh]+C]↑.Int←CurVal; END;--:1247----1257:-- NewFont: PROCEDURE[A: SmallNumber] = BEGIN U:Halfword;S:Scaled;F:InternalFontNumber;T:StrNumber; OldSetting:PascalInteger[0..21]; IF JobName=0 THEN OpenLogFile[];GetRToken[]; U←CurCs; IF INT[U]>=258 THEN T←Hash↑[U].Rh ELSE IF INT[U]>=129 THEN IF U=257 THEN T←1070 ELSE T← INT[U]-129 ELSE BEGIN OldSetting←Selector;Selector←21;Print[1070]; Print[ INT[U]-1];Selector←OldSetting; BEGIN IF INT[PoolPtr+1]>PoolSize THEN Overflow[129,PoolSize-InitPoolPtr] ; END;T←MakeString[]; END; IF( INT[A]>=4) THEN GeqDefine[U,86,0] ELSE EqDefine[U,86,0]; ScanOptionalEquals[];ScanFileName[];--1258:--NameInProgress←TRUE; IF ScanKeyword[1071] THEN--1259:--BEGIN ScanDimen[FALSE,FALSE,FALSE]; S←CurVal; IF(S<=0)OR (S>=134217728) THEN BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[1073]; END;PrintScaled[S];Print[1074]; BEGIN HelpPtr←2;HelpLine↑[1]←1075;HelpLine↑[0]←1076; END;Error[]; S←10*65536; END; END--:1259-- ELSE IF ScanKeyword[1072] THEN BEGIN ScanInt[]; S←-CurVal; IF(CurVal<=0)OR (CurVal>32768) THEN BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[414]; END;BEGIN HelpPtr←1;HelpLine↑[0]←415; END; IntError[CurVal];S←-1000; END; END ELSE S←-1000; NameInProgress←FALSE--:1258--;--1260: {FOR i:INT IN [ INT[1 ].. INT[FontPtr ]] DO F ← i; IF StrEqStr[FontName↑[F],CurName]AND StrEqStr[FontArea↑[F],CurArea] THEN BEGIN IF S>0 THEN BEGIN IF S=FontSize↑[F] THEN GOTO Label50; END ELSE IF FontSize↑[F]=XnOverD[FontDsize↑[F],-S,1000] THEN GOTO Label50; END--:1260-- ENDLOOP;F←ReadFontInfo[U,CurName,CurArea,S];EXITS Label50 => NULL};Eqtb↑[U].Hh.Rh←F; Eqtb↑[2768+F]←Eqtb↑[U];Hash↑[2768+F].Rh←T; END;--:1257----1265: NewInteraction: PROCEDURE = BEGIN PrintLn[];Interaction←CurChr;--75: IF Interaction=0 THEN Selector←16 ELSE Selector←17--:75--; IF JobName#0 THEN Selector←Selector+2; END;--:1265 PrefixedCommand: PROCEDURE = BEGIN A:SmallNumber; F:InternalFontNumber;J:Halfword;K:PascalInteger[0..FontMemSize];P, Q:Halfword; N:PascalInteger;E:PascalBoolean; A←0; {WHILE CurCmd=92 DO BEGIN IF NOT PascalODD[ A /CurChr] THEN A← INT[A]+CurChr; --404:--DO GetXToken[]; IF(CurCmd#10)AND (CurCmd#0)--:404-- THEN EXIT; ENDLOOP; IF INT[CurCmd]<=69 THEN--1212:--BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[1032]; END;PrintCmdChr[CurCmd,CurChr]; PrintChar[39];BEGIN HelpPtr←1;HelpLine↑[0]←1033; END;BackError[]; GOTO Label10; END--:1212--; END ENDLOOP ;--1213: IF(CurCmd#96)AND ( PascalMODPower2Mask[A ,3]#0) THEN BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[544]; END;PrintEsc[1024];Print[1034]; PrintEsc[1025];Print[1035];PrintCmdChr[CurCmd,CurChr]; PrintChar[39];BEGIN HelpPtr←1;HelpLine↑[0]←1036; END;Error[]; END--:1213 ;--1214: IF Eqtb↑[4810].Int#0 THEN IF Eqtb↑[4810].Int<0 THEN BEGIN IF( INT[A]>=4) THEN A ←A-4; END ELSE BEGIN IF NOT ( INT[A]>=4) THEN A←A+4; END--:1214--; {SELECT CurCmd FROM--1217: 86 =>IF( INT[A]>=4) THEN GeqDefine[4078,119,CurChr] ELSE EqDefine[4078,119, CurChr];--:1217----1218: 96 =>BEGIN IF PascalODD[CurChr]AND NOT ( INT[A]>=4)AND (Eqtb↑[4810].Int>=0) THEN A←A+4; E←( INT[CurChr]>=2);GetRToken[];P←CurCs;Q←ScanToks[TRUE,E]; IF( INT[A]>=4) THEN GeqDefine[P,110+( PascalMODPower2Mask[A ,3]),DefRef] ELSE EqDefine[P,110+( PascalMODPower2Mask[A ,3]),DefRef]; END;--:1218----1221:--93 =>BEGIN N←CurChr;GetRToken[]; P←CurCs;IF N=0 THEN BEGIN DO GetToken[]; IF CurCmd#10 THEN EXIT; ENDLOOP; IF CurTok=3133 THEN BEGIN GetToken[];IF CurCmd=10 THEN GetToken[]; END; END ELSE BEGIN GetToken[];Q←CurTok;GetToken[];BackInput[];CurTok←Q; BackInput[]; END; IF INT[CurCmd]>=110 THEN Mem[CurChr]↑.Hh.Lh←Mem[CurChr]↑.Hh.Lh+1; IF( INT[A]>=4) THEN GeqDefine[P,CurCmd,CurChr] ELSE EqDefine[P,CurCmd, CurChr]; END;--:1221----1224:--94 =>BEGIN N←CurChr;GetRToken[];P←CurCs; IF( INT[A]>=4) THEN GeqDefine[P,0,256] ELSE EqDefine[P,0,256]; ScanOptionalEquals[];SELECT N FROM 0 =>BEGIN ScanCharNum[]; IF( INT[A]>=4) THEN GeqDefine[P,67,CurVal] ELSE EqDefine[P,67,CurVal]; END; 1 =>BEGIN ScanFifteenBitInt[]; IF( INT[A]>=4) THEN GeqDefine[P,68,CurVal] ELSE EqDefine[P,68,CurVal]; END; ENDCASE =>BEGIN ScanEightBitInt[]; SELECT N FROM 0 =>IF( INT[A]>=4) THEN GeqDefine[P,67,CurVal] ELSE EqDefine[P,67, CurVal]; 1 =>IF( INT[A]>=4) THEN GeqDefine[P,68,CurVal] ELSE EqDefine[P,68,CurVal]; 2 =>IF( INT[A]>=4) THEN GeqDefine[P,72,4817+CurVal] ELSE EqDefine[P,72, 4817+CurVal]; 3 =>IF( INT[A]>=4) THEN GeqDefine[P,73,5221+CurVal] ELSE EqDefine[P,73, 5221+CurVal]; 4 =>IF( INT[A]>=4) THEN GeqDefine[P,74,3044+CurVal] ELSE EqDefine[P,74, 3044+CurVal]; 5 =>IF( INT[A]>=4) THEN GeqDefine[P,75,3300+CurVal] ELSE EqDefine[P,75, 3300+CurVal]; 6 =>IF( INT[A]>=4) THEN GeqDefine[P,71,3566+CurVal] ELSE EqDefine[P,71, 3566+CurVal]; ENDCASE; END ; END;--:1224----1225:--95 =>BEGIN ScanInt[];N←CurVal; IF NOT ScanKeyword[700] THEN BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[926]; END;BEGIN HelpPtr←2;HelpLine↑[1]←1053; HelpLine↑[0]←1054; END;Error[]; END;GetRToken[];P←CurCs;ReadToks[N,P]; IF( INT[A]>=4) THEN GeqDefine[P,110,CurVal] ELSE EqDefine[P,110,CurVal]; END; --:1225----1226:--70,71 =>BEGIN Q←CurCs; IF CurCmd=70 THEN BEGIN ScanEightBitInt[];P←3566+CurVal; END ELSE P←CurChr;ScanOptionalEquals[];--404:--DO GetXToken[]; IF(CurCmd#10)AND (CurCmd#0)--:404-- THEN EXIT; ENDLOOP;IF CurCmd#1 THEN--1227: BEGIN IF CurCmd=70 THEN BEGIN ScanEightBitInt[];CurCmd←71; CurChr←3566+CurVal; END; IF CurCmd=71 THEN BEGIN Q←Eqtb↑[CurChr].Hh.Rh; IF Q=0 THEN IF( INT[A]>=4) THEN GeqDefine[P,100,0] ELSE EqDefine[P,100,0] ELSE BEGIN Mem[Q]↑.Hh.Lh←Mem[Q]↑.Hh.Lh+1; IF( INT[A]>=4) THEN GeqDefine[P,110,Q] ELSE EqDefine[P,110,Q]; END; GOTO Label30; END; END--:1227--;BackInput[];CurCs←Q;Q←ScanToks[FALSE,FALSE]; IF Mem[DefRef]↑.Hh.Rh=0 THEN BEGIN IF( INT[A]>=4) THEN GeqDefine[P,100,0] ELSE EqDefine[P,100,0];BEGIN Mem[DefRef]↑.Hh.Rh←Avail;Avail←DefRef; DynUsed←DynUsed-1; END; END ELSE BEGIN IF P=3557 THEN BEGIN Mem[Q]↑.Hh.Rh←GetAvail[]; Q←Mem[Q]↑.Hh.Rh;Mem[Q]↑.Hh.Lh←637;Q←GetAvail[];Mem[Q]↑.Hh.Lh←379; Mem[Q]↑.Hh.Rh←Mem[DefRef]↑.Hh.Rh;Mem[DefRef]↑.Hh.Rh←Q; END; IF( INT[A]>=4) THEN GeqDefine[P,110,DefRef] ELSE EqDefine[P,110,DefRef]; END; END;--:1226----1228:--72 =>BEGIN P←CurChr;ScanOptionalEquals[];ScanInt[]; IF( INT[A]>=4) THEN GeqWordDefine[P,CurVal] ELSE EqWordDefine[P,CurVal]; END;73 =>BEGIN P←CurChr;ScanOptionalEquals[]; ScanDimen[FALSE,FALSE,FALSE]; IF( INT[A]>=4) THEN GeqWordDefine[P,CurVal] ELSE EqWordDefine[P,CurVal]; END;74,75 =>BEGIN P←CurChr;N←CurCmd;ScanOptionalEquals[]; IF N=75 THEN ScanGlue[3] ELSE ScanGlue[2];TrapZeroGlue[]; IF( INT[A]>=4) THEN GeqDefine[P,116,CurVal] ELSE EqDefine[P,116,CurVal]; END; --:1228----1232:--84 =>BEGIN--1233: IF CurChr=4127 THEN N←15 ELSE IF CurChr=4639 THEN N←32768 ELSE IF CurChr=4511 THEN N←32767 ELSE IF CurChr=5073 THEN N←16777215 ELSE N ←127--:1233--;P←CurChr;ScanSevenBitInt[];P←P+CurVal; ScanOptionalEquals[];ScanInt[]; IF((CurVal<0)AND ( INT[P]<5073))OR (CurVal>N) THEN BEGIN BEGIN IF Interaction=3 THEN NULL;PrintNl[134];Print[1055]; END;PrintInt[CurVal]; IF INT[P]<5073 THEN Print[1056] ELSE Print[1057];PrintInt[N]; BEGIN HelpPtr←1;HelpLine↑[0]←1058; END;Error[];CurVal←0; END; IF INT[P]<4639 THEN IF( INT[A]>=4) THEN GeqDefine[P,119,CurVal] ELSE EqDefine[P, 119,CurVal] ELSE IF INT[P]<5073 THEN IF( INT[A]>=4) THEN GeqDefine[P,119,CurVal] ELSE EqDefine[P,119,CurVal] ELSE IF( INT[A]>=4) THEN GeqWordDefine[P,CurVal ] ELSE EqWordDefine[P,CurVal]; END;--:1232----1234:--85 =>BEGIN P←CurChr; ScanFourBitInt[];P←P+CurVal;ScanOptionalEquals[];ScanFontIdent[]; IF( INT[A]>=4) THEN GeqDefine[P,119,CurVal] ELSE EqDefine[P,119,CurVal]; END; --:1234----1235:--88,89,90,91 =>DoRegisterCommand[A];--:1235----1241: 97 =>BEGIN ScanEightBitInt[]; IF( INT[A]>=4) THEN SaveStack↑[SavePtr+0].Int←1073742080+CurVal ELSE SaveStack↑[SavePtr+0].Int←1073741824+CurVal;ScanOptionalEquals[]; ScanBox[]; END;--:1241----1242:--78 =>AlterAux[];79 =>AlterPrevGraf[]; 80 =>AlterPageSoFar[];81 =>AlterInteger[];82 =>AlterBoxDimen[];--:1242----1248: 83 =>BEGIN ScanOptionalEquals[];ScanInt[];N←CurVal; IF N<=0 THEN P←0 ELSE BEGIN P←GetNode[2*N+1];Mem[P]↑.Hh.Lh←N; FOR i:INT IN [ INT[1 ].. INT[N ]] DO J ← i; ScanDimen[FALSE,FALSE,FALSE]; Mem[P+ INT[2]*J-1]↑.Int←CurVal;ScanDimen[FALSE,FALSE,FALSE]; Mem[P+ INT[2]*J]↑.Int←CurVal; ENDLOOP; END; IF( INT[A]>=4) THEN GeqDefine[3556,117,P] ELSE EqDefine[3556,117,P]; END; --:1248----1252:--98 =>IF CurChr=1 THEN BEGIN NewPatterns[]; GOTO Label30; BEGIN IF Interaction=3 THEN NULL;PrintNl[134];Print[1067]; END;HelpPtr←0; Error[];DO GetToken[]; IF CurCmd=2 THEN EXIT; ENDLOOP; GOTO Label10; END ELSE BEGIN NewHyphExceptions[]; GOTO Label30; END;--:1252----1253: 76 =>BEGIN FindFontDimen[TRUE];K←CurVal;ScanOptionalEquals[]; ScanDimen[FALSE,FALSE,FALSE];FontInfo↑[K].Int←CurVal; END; 77 =>BEGIN N←CurChr;ScanFontIdent[];F←CurVal;ScanOptionalEquals[]; ScanInt[];IF N=0 THEN HyphenChar↑[F]←CurVal ELSE SkewChar↑[F]←CurVal; END;--:1253----1256:--87 =>NewFont[A];--:1256----1264:--99 =>NewInteraction[]; --:1264-- ENDCASE =>Confusion[1031];EXITS Label30 => NULL};--1269: IF AfterToken#0 THEN BEGIN CurTok←AfterToken;BackInput[]; AfterToken←0; END--:1269--;EXITS Label10 => NULL}; END;--:1211----1270:-- DoAssignments: PROCEDURE = BEGIN {WHILE TRUE DO BEGIN--404:--DO GetXToken[]; IF(CurCmd#10)AND (CurCmd#0)--:404-- THEN EXIT; ENDLOOP;IF INT[CurCmd]<=69 THEN GOTO Label10; PrefixedCommand[]; END ENDLOOP ;EXITS Label10 => NULL}; END;--:1270----1275:-- OpenOrCloseIn: PROCEDURE = BEGIN C:PascalInteger[0..1];N:PascalInteger[0..15]; C←CurChr;ScanFourBitInt[];N←CurVal; IF ReadOpen↑[N]#2 THEN BEGIN AClose[@ReadFile↑[N]];ReadOpen↑[N]←2; END; IF C#0 THEN BEGIN ScanOptionalEquals[];ScanFileName[]; IF CurExt=210 THEN CurExt←647; PackFileName[CurName,CurArea,CurExt]; IF AOpenIn[@ReadFile↑[N]] THEN ReadOpen↑[N]←1; END; END;--:1275----1279: IssueMessage: PROCEDURE = BEGIN OldSetting:PascalInteger[0..21];C:PascalInteger[0..1];S:StrNumber; C←CurChr;Mem[64988]↑.Hh.Rh←ScanToks[FALSE,TRUE]; OldSetting←Selector;Selector←21;TokenShow[DefRef]; Selector←OldSetting;FlushList[DefRef]; BEGIN IF INT[PoolPtr+1]>PoolSize THEN Overflow[129,PoolSize-InitPoolPtr] ; END;S←MakeString[];IF C=0 THEN--1280: BEGIN IF TermOffset+( INT[StrStart↑[S+1]]-StrStart↑[S])>MaxPrintLine-2 THEN PrintLn [] ELSE IF( INT[TermOffset]>0)OR ( INT[FileOffset]>0) THEN PrintChar[32]; Print[S];PascalTextBREAK[file: @TermOut]; END--:1280-- ELSE--1283: BEGIN BEGIN IF Interaction=3 THEN NULL;PrintNl[134];Print[S]; END; IF Eqtb↑[3565].Hh.Rh#0 THEN UseErrHelp←TRUE ELSE IF LongHelpSeen THEN BEGIN HelpPtr←1;HelpLine↑[0]←1083; END ELSE BEGIN IF INT[Interaction]<3 THEN LongHelpSeen←TRUE; BEGIN HelpPtr←4;HelpLine↑[3]←1084;HelpLine↑[2]←1085; HelpLine↑[1]←1086;HelpLine↑[0]←1087; END; END;Error[];UseErrHelp←FALSE; END--:1283--;BEGIN StrPtr←StrPtr-1;PoolPtr←StrStart↑[StrPtr]; END; END;--:1279----1288:-- ShiftCase: PROCEDURE = BEGIN B:Halfword;P:Halfword; T:Halfword;C:EightBits; B←CurChr;P←ScanToks[FALSE,FALSE]; P←Mem[DefRef]↑.Hh.Rh;WHILE P#0 DO BEGIN--1289:--T←Mem[P]↑.Hh.Lh; IF INT[T]<4225 THEN BEGIN IF INT[T]>=4096 THEN T← INT[T]-1;C← PascalMODPower2Mask[T ,255]; IF INT[C]<128 THEN IF Eqtb↑[ INT[B]+C].Hh.Rh#0 THEN T←256*( PascalDIVPower2[T ,8])+Eqtb↑[ INT[B]+C].Hh .Rh;IF INT[T]>=4096 THEN Mem[P]↑.Hh.Lh←T+1 ELSE Mem[P]↑.Hh.Lh←T; END--:1289--; P←Mem[P]↑.Hh.Rh; END ENDLOOP ;BeginTokenList[Mem[DefRef]↑.Hh.Rh,3]; BEGIN Mem[DefRef]↑.Hh.Rh←Avail;Avail←DefRef;DynUsed←DynUsed-1; END; END;--:1288----1293:-- ShowWhatever: PROCEDURE = BEGIN P:Halfword; {SELECT CurChr FROM 3 =>BEGIN BeginDiagnostic[];ShowActivities[]; END; 1 =>--1296:--BEGIN ScanEightBitInt[];BeginDiagnostic[];PrintNl[1105]; PrintInt[CurVal];PrintChar[61]; IF Eqtb↑[3822+CurVal].Hh.Rh=0 THEN Print[278] ELSE ShowBox[Eqtb↑[ 3822+CurVal].Hh.Rh]; END--:1296--;0 =>--1294:--BEGIN GetToken[];PrintNl[1099]; IF CurCs#0 THEN BEGIN SprintCs[CurCs];PrintChar[61]; END; PrintMeaning[]; GOTO Label50; END--:1294--; ENDCASE =>--1297:--BEGIN P←TheToks[]; PrintNl[1099];TokenShow[64997];FlushList[Mem[64997]↑.Hh.Rh]; GOTO Label50; END--:1297--;--1298:--EndDiagnostic[TRUE];BEGIN IF Interaction=3 THEN NULL; PrintNl[134];Print[1106]; END; IF Selector=19 THEN IF Eqtb↑[4796].Int<=0 THEN BEGIN Selector←17; Print[1107];Selector←19; END--:1298--; EXITS Label50 => NULL};IF INT[Interaction]<3 THEN BEGIN HelpPtr←0;ErrorCount←ErrorCount-1; END ELSE IF Eqtb↑[4796].Int>0 THEN BEGIN BEGIN HelpPtr←3; HelpLine↑[2]←1094;HelpLine↑[1]←1095;HelpLine↑[0]←1096; END; END ELSE BEGIN BEGIN HelpPtr←5;HelpLine↑[4]←1094;HelpLine↑[3]←1095; HelpLine↑[2]←1096;HelpLine↑[1]←1097;HelpLine↑[0]←1098; END; END;Error[]; END;--:1293----1302:-- GiveErrHelp: PROCEDURE = BEGIN TokenShow[Eqtb↑[3565].Hh.Rh]; END;--:1284----1303:----524: TheRealTex: PROCEDURE = BEGIN --1337: {ENABLE Error9999 => GOTO Label9999;{ENABLE Error9998 => GOTO Label9998;History←3;RewriteTermOut[@TermOut]; SetBackgroundPriority[];--14:--Bad←0; IF( INT[HalfErrorLine]<30)OR ( INT[HalfErrorLine]>ErrorLine-15) THEN Bad←1; IF INT[MaxPrintLine]<60 THEN Bad←2;IF PascalMODPower2Mask[DviBufSize ,7]#0 THEN Bad←3; IF INT[1100]>65000 THEN Bad←4;IF INT[2129]>2500 THEN Bad←5;--:14----111: IF(MemMin#0)OR (MemMax#65000) THEN Bad←10; IF( INT[MemMin]>0)OR ( INT[MemMax]<65000) THEN Bad←10; IF( INT[0]>0)OR ( INT[255]<127) THEN Bad←11;IF( INT[0]>0)OR ( INT[65515]<32767) THEN Bad←12; IF( INT[0]<0)OR ( INT[255]>65515) THEN Bad←13; IF( INT[MemMin]<0)OR ( INT[MemMax]>=65515) THEN Bad←14; IF( INT[0]<0)OR ( INT[FontMax]>255) THEN Bad←15;IF INT[FontMax]>256 THEN Bad←16; IF( INT[SaveSize]>65515)OR ( INT[MaxStrings]>65515) THEN Bad←17; IF INT[BufSize]>65515 THEN Bad←18;IF INT[255]<255 THEN Bad←19;--:111----290: IF INT[7121]>65515 THEN Bad←21;--:290----1249: IF INT[2]*65515<65000-MemMin THEN Bad←41;--:1249 IF Bad>0 THEN BEGIN RewriteTermOut[@TermOut]; {PascalWriteLongString[file: @TermOut, item: "Ouch---my internal constants have been"] ; PascalWriteLongString[file: @TermOut, item: " clobbered!---case "]; PascalWriteInteger[file: @TermOut, item: Bad, fieldMinLength: 1]}; ERROR Error9999; END;Initialize[]; IF StartLikeInitex THEN BEGIN IF NOT GetStringsStarted [] THEN ERROR Error9999;InitPrim[]; END;--55:--Selector←17;Tally←0;TermOffset←0; FileOffset←0;--:55----61: PascalWriteLongString[file: @TermOut, item: "This is TeX 1.3 for Cedar 6.0"]; IF FormatIdent=0 THEN {PascalWriteLongString[file: @TermOut, item: " (no format preloaded)"]; PascalWriteLn[file: @TermOut]} ELSE BEGIN Print[FormatIdent];PrintLn[]; END;--:61----528:--JobName←0; NameInProgress←FALSE;--:528----533:--OutputFileName←0;--:533--BEGIN--331:--BEGIN InputPtr←0;MaxInStack←0;InOpen←0; MaxBufStack←0;ParamPtr←0;MaxParamStack←0; FOR i:INT IN [ INT[0 ].. INT[BufSize ]] DO First ← i; Buffer↑[First]←0 ENDLOOP;ScannerStatus←0; WarningIndex←0;First←1;CurInput.StateField←33; CurInput.StartField←1;CurInput.IndexField←0;Line←0; CurInput.NameField←0;ForceEof←FALSE;AlignState←1000000; IF NOT InitTerminal [] THEN ERROR Error9999;CurInput.LimitField←Last; First←Last+1; END--:331--; IF(FormatIdent=0)OR (Buffer↑[CurInput.LocField]=38) THEN BEGIN IF FormatIdent#0 THEN Initialize[];IF NOT OpenFmtFile [] THEN ERROR Error9999; IF NOT LoadFmtFile [] THEN BEGIN WClose[@FmtFile]; ERROR Error9999; END; WClose[@FmtFile]; WHILE( INT[CurInput.LocField]<CurInput.LimitField)AND (Buffer↑[CurInput. LocField]=32)DO CurInput.LocField←CurInput.LocField+1 ENDLOOP ; END; IF(Eqtb↑[4815].Int<0)OR (Eqtb↑[4815].Int>127) THEN CurInput.LimitField← INT[CurInput.LimitField]-1 ELSE Buffer↑[CurInput.LimitField]←Eqtb↑[4815]. Int;FixDateAndTime[];--765:--MagicOffset← INT[StrStart↑[750]]-9*16--:765--; --75:--IF Interaction=0 THEN Selector←16 ELSE Selector←17--:75--; ReadProfileForDirectories[]; IF( INT[CurInput.LocField]<CurInput.LimitField)AND (Eqtb↑[4127+Buffer↑ [CurInput.LocField]].Hh.Rh#0) THEN StartInput[]; END--:1337--; InitStrPtr←StrPtr;InitPoolPtr←PoolPtr;History←0;MainControl[]; FinalCleanup[];EXITS Label9998 => NULL};CloseFilesAndTerminate[];EXITS Label9999 => NULL};SetNormalPriority[]; END; END.