-- file: TexScanImpl.mesa
-- Pascal-to-Mesa translator output, translated at September 27, 1985 10:21:37 am PDT


DIRECTORY
  PascalBasic,
  PascalWizardFiles,
  TexTypes,
  TexSysdep,
  TexSysdepInline,
  TexInteraction,
  TexBuildPage,
  TexMemory,
  TexSymbols,
  TexScan,
  TexOps,
  TexRest;

TexScanImpl: PROGRAM IMPORTS TexSysdepInline, TexInteraction, TexMemory, TexSymbols, TexScan EXPORTS TexScan = PUBLIC
BEGIN OPEN PascalBasic, PascalWizardFiles, TexTypes, TexSysdep, TexSysdepInline, TexInteraction, TexBuildPage, TexMemory, TexSymbols, TexScan, TexOps, TexRest;


JobName: StrNumber;
--:527----532:--
DviFile: ByteFile;


OutputFileName: StrNumber;
 ScanLeftBrace: PROCEDURE = 
BEGIN--404:
DO GetXToken[]; IF(CurCmd#10)AND (CurCmd#0)--:404-- THEN EXIT; ENDLOOP;
IF CurCmd#1  THEN BEGIN BEGIN IF Interaction=3  THEN NULL;PrintNl[134];
Print[518]; END;BEGIN HelpPtr←4;HelpLine↑[3]←519;HelpLine↑[2]←520;
HelpLine↑[1]←521;HelpLine↑[0]←522; END;BackError[];CurTok←379;
CurCmd←1;CurChr←123;AlignState←AlignState+1; END; END;--:403----405:
 ScanOptionalEquals: PROCEDURE = 
BEGIN--406:--DO GetXToken[];
 IF CurCmd#10--:406-- THEN EXIT; ENDLOOP;IF CurTok#3133  THEN BackInput[]; END;--:405
--407:-- ScanKeyword: PROCEDURE[S: StrNumber] RETURNS[ScanKeywordResult: PascalBoolean] = 
BEGIN 
 P:Halfword;Q:Halfword;K:PoolPointer; P←64987;Mem[P]↑.Hh.Rh←0;
K←StrStart↑[S];{WHILE  INT[K]<StrStart↑[S+1]DO BEGIN GetXToken[];
IF(CurCs=0)AND ((CurChr=StrPool↑[K])OR (CurChr=StrPool↑[K]-32)) THEN
BEGIN BEGIN Q←GetAvail[];Mem[P]↑.Hh.Rh←Q;Mem[Q]↑.Hh.Lh←CurTok;P←Q; END;
K←K+1; END  ELSE IF(CurCmd#10)OR (P#64987) THEN BEGIN BackInput[];
IF P#64987  THEN BeginTokenList[Mem[64987]↑.Hh.Rh,3];
ScanKeywordResult←FALSE; GOTO Label10; END; END ENDLOOP ;FlushList[Mem[64987]↑.Hh.Rh];
ScanKeywordResult←TRUE;EXITS Label10 => NULL}; END;--:407----408:-- MuError: PROCEDURE
 = 
BEGIN BEGIN IF Interaction=3  THEN NULL;PrintNl[134];Print[523]; END;
BEGIN HelpPtr←1;HelpLine↑[0]←524; END;Error[]; END;--:408----409:
--432:-- ScanSevenBitInt: PROCEDURE
 = 
BEGIN ScanInt[];
IF(CurVal<0)OR (CurVal>127) THEN BEGIN BEGIN IF Interaction=3  THEN NULL;
PrintNl[134];Print[546]; END;BEGIN HelpPtr←2;HelpLine↑[1]←547;
HelpLine↑[0]←548; END;IntError[CurVal];CurVal←0; END; END;--:432----433:
 ScanEightBitInt: PROCEDURE = 
BEGIN ScanInt[];
IF(CurVal<0)OR (CurVal>255) THEN BEGIN BEGIN IF Interaction=3  THEN NULL;
PrintNl[134];Print[549]; END;BEGIN HelpPtr←2;HelpLine↑[1]←550;
HelpLine↑[0]←548; END;IntError[CurVal];CurVal←0; END; END;--:433----434:
 ScanFourBitInt: PROCEDURE = 
BEGIN ScanInt[];
IF(CurVal<0)OR (CurVal>15) THEN BEGIN BEGIN IF Interaction=3  THEN NULL;
PrintNl[134];Print[551]; END;BEGIN HelpPtr←2;HelpLine↑[1]←552;
HelpLine↑[0]←548; END;IntError[CurVal];CurVal←0; END; END;--:434----435:
 ScanCharNum: PROCEDURE = 
BEGIN ScanInt[];
IF(CurVal<0)OR (CurVal>255) THEN BEGIN BEGIN IF Interaction=3  THEN NULL;
PrintNl[134];Print[546]; END;BEGIN HelpPtr←2;HelpLine↑[1]←553;
HelpLine↑[0]←548; END;IntError[CurVal];CurVal←0; END; END;--:435----436:
 ScanFifteenBitInt: PROCEDURE = 
BEGIN ScanInt[];
IF(CurVal<0)OR (CurVal>32767) THEN BEGIN BEGIN IF Interaction=3  THEN NULL;
PrintNl[134];Print[554]; END;BEGIN HelpPtr←2;HelpLine↑[1]←555;
HelpLine↑[0]←548; END;IntError[CurVal];CurVal←0; END; END;--:436----437:
 ScanTwentySevenBitInt: PROCEDURE = 
BEGIN ScanInt[];
IF(CurVal<0)OR (CurVal>134217727) THEN BEGIN BEGIN IF Interaction=3  THEN
 NULL;PrintNl[134];Print[556]; END;BEGIN HelpPtr←2;HelpLine↑[1]←557;
HelpLine↑[0]←548; END;IntError[CurVal];CurVal←0; END; END;--:437----577:
  ScanInt: PROCEDURE = 
BEGIN  Negative:PascalBoolean;M:PascalInteger;
D:SmallNumber;Vacuous:PascalBoolean;OkSoFar:PascalBoolean; Radix←0;
OkSoFar←TRUE;--441:--Negative←FALSE;DO--406:--DO GetXToken[];
 IF CurCmd#10--:406-- THEN EXIT; ENDLOOP;
IF CurTok=3117  THEN BEGIN Negative← NOT Negative;CurTok←3115; END;
 IF CurTok#3115--:441-- THEN EXIT; ENDLOOP;IF CurTok=3168  THEN--442:--BEGIN GetToken[];
IF  INT[CurTok]<4096  THEN BEGIN CurVal←CurChr;
IF  INT[CurCmd]<=2  THEN IF CurCmd=2  THEN AlignState←AlignState+1  ELSE
AlignState←AlignState-1;
 END  ELSE IF  INT[CurTok]<4225  THEN CurVal← INT[CurTok]-4097  ELSE CurVal←
 INT[CurTok]-4225;IF CurVal>127  THEN BEGIN BEGIN IF Interaction=3  THEN NULL;
PrintNl[134];Print[558]; END;BEGIN HelpPtr←2;HelpLine↑[1]←559;
HelpLine↑[0]←560; END;CurVal←48;BackError[]; END  ELSE--443:
BEGIN GetXToken[];IF CurCmd#10  THEN BackInput[]; END--:443--; END--:442
 ELSE IF( INT[CurCmd]>=67)AND ( INT[CurCmd]<=88) THEN ScanSomethingInternal[0,FALSE
] ELSE--444:--BEGIN 
 Radix←10;M←214748364;
IF CurTok=3111  THEN BEGIN Radix←8;M←268435456;GetXToken[];
 END  ELSE IF CurTok=3106  THEN BEGIN Radix←16;M←134217728;GetXToken[];
 END;Vacuous←TRUE;CurVal←0;--445:
{WHILE TRUE DO BEGIN IF( INT[CurTok]<3120+Radix)AND ( INT[CurTok]>=3120)AND ( INT[CurTok
]<=3129) THEN D← INT[CurTok]-3120  ELSE IF Radix=16  THEN IF( INT[CurTok]<=2886)AND (
 INT[CurTok]>=2881) THEN D← INT[CurTok]-2871  ELSE IF( INT[CurTok]<=3142)AND (
 INT[CurTok]>=3137) THEN D← INT[CurTok]-3127  ELSE  GOTO Label30  ELSE  GOTO Label30;Vacuous←FALSE;
IF(CurVal>=M)AND ((CurVal>M)OR ( INT[D]>7)OR (Radix#10)) THEN BEGIN IF
OkSoFar  THEN BEGIN BEGIN IF Interaction=3  THEN NULL;PrintNl[134];
Print[561]; END;BEGIN HelpPtr←2;HelpLine↑[1]←562;HelpLine↑[0]←563;
 END;Error[];CurVal←2147483647;OkSoFar←FALSE; END;
 END  ELSE CurVal←CurVal*Radix+D;GetXToken[]; END ENDLOOP ;EXITS Label30 => NULL};--:445--IF Vacuous  THEN--446:--BEGIN BEGIN IF Interaction=3  THEN NULL;PrintNl[134];
Print[525]; END;BEGIN HelpPtr←3;HelpLine↑[2]←526;HelpLine↑[1]←527;
HelpLine↑[0]←528; END;BackError[]; END--:446
 ELSE IF CurCmd#10  THEN BackInput[]; END--:444--;
IF Negative  THEN CurVal←-CurVal; END;--:440----448:

END.