-- file: MFOpsImpl5.mesa -- Pascal-to-Mesa translator output, translated at October 31, 1985 4:28:02 pm PST -- Pavel, October 31, 1985 5:07:15 pm PST DIRECTORY PascalBasic, PascalWizardFiles, MFTypes, MFRest, MFProcArray, MFExternals, MFInteraction, MFMath, MFMemory, MFSymbols, MFEdges, MFOctants, MFScreen, MFInput, MFFileNames, MFParsing, MFOps, MFTFM, MFGF, MFInit; MFOpsImpl5: PROGRAM IMPORTS PascalBasic, MFRest, PascalWizardFiles, MFProcArray, MFExternals, MFInteraction, MFMath, MFMemory, MFSymbols, MFEdges, MFOctants, MFScreen, MFInput, MFFileNames, MFParsing, MFOps, MFTFM, MFGF, MFInit EXPORTS MFOps = PUBLIC BEGIN OPEN MFRest, PascalBasic, PascalWizardFiles, MFTypes, MFProcArray, MFExternals, MFInteraction, MFMath, MFMemory, MFSymbols, MFEdges, MFOctants, MFScreen, MFInput, MFFileNames, MFParsing, MFOps, MFTFM, MFGF, MFInit; ScanWith: PROCEDURE RETURNS[ScanWithResult: PascalBoolean] = BEGIN T:SmallNumber;Result:PascalBoolean; T_CurMod;CurType_1;GetXNext[];ScanExpression[];Result_FALSE; IF CurType#T THEN--1054:--BEGIN DispErr[0,828];BEGIN HelpPtr_2; HelpLine^[1]_829;HelpLine^[0]_830; END;IF T=6 THEN HelpLine^[1]_831; PutGetFlushError[0]; END--:1054 ELSE IF CurType=6 THEN Result_TRUE ELSE--1055: BEGIN CurExp_RoundUnscaled[CurExp]; IF(ABS[CurExp]<4)AND (CurExp#0) THEN Result_TRUE ELSE BEGIN BEGIN IF Interaction=3 THEN NULL;PrintNl[133];Print[832]; END;BEGIN HelpPtr_1; HelpLine^[0]_830; END;PutGetFlushError[0]; END; END--:1055--; ScanWithResult_Result; END;--:1053----1056: TfmCheck: PROCEDURE[M: SmallNumber] RETURNS[TfmCheckResult: Scaled] = BEGIN IF ABS[Internal^[M]]>=134217728 THEN BEGIN BEGIN IF Interaction=3 THEN NULL;PrintNl[133];Print[866]; END;Print[IntName^[M]];Print[867]; BEGIN HelpPtr_1;HelpLine^[0]_868; END;PutGetError[]; IF Internal^[M]>0 THEN TfmCheckResult_134217727 ELSE TfmCheckResult_-134217727; END ELSE TfmCheckResult_Internal^[M]; END;--:1097-- DoShipOut: PROCEDURE = BEGIN C:PascalInteger; GetXNext[];VarFlag_80;ScanExpression[]; {IF CurType#20 THEN IF CurType=11 THEN CurEdges_CurExp ELSE BEGIN-- -- 1059:--BEGIN DispErr[0,836];BEGIN HelpPtr_4;HelpLine^[3]_837; HelpLine^[2]_838;HelpLine^[1]_839;HelpLine^[0]_835; END; PutGetFlushError[0]; END--:1059--; GOTO Label10; END ELSE BEGIN FindEdgesVar[CurExp];CurType_1; END; IF CurEdges#0 THEN BEGIN C_ PascalMODPower2Mask[RoundUnscaled[Internal^[18]],255]; IF C<0 THEN C_C+256;--1098:--IF CEc THEN Ec_C; CharExists^[C]_TRUE;GfDx^[C]_Internal^[24];GfDy^[C]_Internal^[25]; TfmWidth^[C]_TfmCheck[20];TfmHeight^[C]_TfmCheck[21]; TfmDepth^[C]_TfmCheck[22];TfmItalCorr^[C]_TfmCheck[23]--:1098--; IF Internal^[34]>=0 THEN ShipOut[C]; END;FlushCurExp[0];EXITS Label10 => NULL}; END;--:1069 --1070:-- DoDisplay: PROCEDURE = BEGIN E:Halfword; GetXNext[];VarFlag_73;ScanPrimary[];{IF CurType#20 THEN--1059: BEGIN DispErr[0,836];BEGIN HelpPtr_4;HelpLine^[3]_837; HelpLine^[2]_838;HelpLine^[1]_839;HelpLine^[0]_835; END; PutGetFlushError[0]; END--:1059-- ELSE BEGIN E_CurExp;CurType_1; GetXNext[];ScanExpression[];{IF CurType#16 THEN GOTO Label50; CurExp_RoundUnscaled[CurExp];{IF CurExp<0 THEN GOTO Label45; IF CurExp>15 THEN GOTO Label45;IF NOT WindowOpen^[CurExp] THEN GOTO Label45; FindEdgesVar[E];IF CurEdges#0 THEN DispEdges[CurExp]; GOTO Label10; EXITS Label45 => NULL};CurExp_CurExp*65536;EXITS Label50 => NULL};DispErr[0,850];BEGIN HelpPtr_1; HelpLine^[0]_851; END;PutGetFlushError[0];FlushTokenList[E]; END; EXITS Label10 => NULL}; END;--:1070----1071:-- GetPair: PROCEDURE[C: CommandCode] RETURNS[GetPairResult: PascalBoolean] = BEGIN P:Halfword;B:PascalBoolean; IF CurCmd#C THEN GetPairResult_FALSE ELSE BEGIN GetXNext[]; ScanExpression[]; IF NicePair[CurExp,CurType] THEN BEGIN P_Mem[CurExp+1]^.Int; CurX_Mem[ INT[P]+1]^.Int;CurY_Mem[ INT[P]+3]^.Int;B_TRUE; END ELSE B_FALSE; FlushCurExp[0];GetPairResult_B; END; END;--:1071----1072: DoOpenWindow: PROCEDURE = BEGIN K:PascalInteger;R0, C0, R1, C1:Scaled; GetXNext[];ScanExpression[];{{IF CurType#16 THEN GOTO Label45; K_RoundUnscaled[CurExp];IF K<0 THEN GOTO Label45;IF K>15 THEN GOTO Label45; IF NOT GetPair[70] THEN GOTO Label45;R0_CurX;C0_CurY; IF NOT GetPair[71] THEN GOTO Label45;R1_CurX;C1_CurY; IF NOT GetPair[72] THEN GOTO Label45; OpenAWindow[K,R0,C0,R1,C1,CurX,CurY]; GOTO Label10; EXITS Label45 => NULL};BEGIN IF Interaction=3 THEN NULL;PrintNl[133];Print[852]; END; BEGIN HelpPtr_2;HelpLine^[1]_853;HelpLine^[0]_854; END;PutGetError[]; EXITS Label10 => NULL}; END;--:1072----1073:-- DoCull: PROCEDURE = BEGIN E:Halfword; Keeping:PascalInteger[0..1];W, WIn, WOut:PascalInteger; W_1;GetXNext[];VarFlag_67; ScanPrimary[];{IF CurType#20 THEN--1059:--BEGIN DispErr[0,836]; BEGIN HelpPtr_4;HelpLine^[3]_837;HelpLine^[2]_838;HelpLine^[1]_839; HelpLine^[0]_835; END;PutGetFlushError[0]; END--:1059 ELSE BEGIN E_CurExp;CurType_1;Keeping_CurMod; {IF NOT GetPair[67] THEN GOTO Label45; WHILE(CurCmd=66)AND (CurMod=16)DO IF ScanWith [] THEN W_CurExp ENDLOOP ;--1074: IF CurX>CurY THEN GOTO Label45; IF Keeping=0 THEN BEGIN IF(CurX>0)OR (CurY<0) THEN GOTO Label45;WOut_W; WIn_0; END ELSE BEGIN IF(CurX<=0)AND (CurY>=0) THEN GOTO Label45;WOut_0; WIn_W; END--:1074--;FindEdgesVar[E]; IF CurEdges#0 THEN CullEdges[FloorUnscaled[CurX+65535], FloorUnscaled[CurY],WOut,WIn]; GOTO Label10; EXITS Label45 => NULL};BEGIN IF Interaction=3 THEN NULL;PrintNl[133];Print[855]; END; BEGIN HelpPtr_1;HelpLine^[0]_856; END;PutGetError[]; FlushTokenList[E]; END;EXITS Label10 => NULL}; END;--:1073----1081:-- DoMessage: PROCEDURE = BEGIN M:PascalInteger[0..2]; M_CurMod;GetXNext[];ScanExpression[]; IF CurType#4 THEN BEGIN DispErr[0,566];BEGIN HelpPtr_1; HelpLine^[0]_860; END;PutGetError[]; END ELSE SELECT M FROM 0 =>BEGIN PrintNl[157];SlowPrint[CurExp]; END; 1 =>--1085:--BEGIN BEGIN IF Interaction=3 THEN NULL;PrintNl[133];Print[157]; END; SlowPrint[CurExp]; IF ErrHelp#0 THEN UseErrHelp_TRUE ELSE IF LongHelpSeen THEN BEGIN HelpPtr_1;HelpLine^[0]_861; END ELSE BEGIN IF INT[Interaction]<3 THEN LongHelpSeen_TRUE; BEGIN HelpPtr_4;HelpLine^[3]_862;HelpLine^[2]_863;HelpLine^[1]_864; HelpLine^[0]_865; END; END;PutGetError[];UseErrHelp_FALSE; END--:1085--; 2 =>--1082: BEGIN IF ErrHelp#0 THEN BEGIN IF INT[StrRef^[ErrHelp]]<127 THEN IF INT[StrRef ^[ErrHelp]]>1 THEN StrRef^[ErrHelp]_StrRef^[ErrHelp]-1 ELSE FlushString[ErrHelp]; END; IF(StrStart^[CurExp+1]-StrStart^[CurExp])=0 THEN ErrHelp_0 ELSE BEGIN ErrHelp_CurExp; BEGIN IF INT[StrRef^[ErrHelp]]<127 THEN StrRef^[ErrHelp]_StrRef^[ErrHelp] +1; END; END; END--:1082--; ENDCASE;FlushCurExp[0]; END;--:1081----1102: GetCode: PROCEDURE RETURNS[GetCodeResult: EightBits] = BEGIN C:PascalInteger; GetXNext[]; ScanExpression[];{IF CurType=16 THEN BEGIN C_RoundUnscaled[CurExp]; IF C>=0 THEN IF C<256 THEN GOTO Label40; END ELSE IF CurType=4 THEN IF (StrStart^[CurExp+1]-StrStart^[CurExp])=1 THEN BEGIN C_StrPool^[StrStart^[CurExp]]; GOTO Label40; END; DispErr[0,874];BEGIN HelpPtr_2;HelpLine^[1]_875;HelpLine^[0]_876; END;PutGetFlushError[0];C_0;EXITS Label40 => NULL};GetCodeResult_C; END;--:1102----1103: SetTag: PROCEDURE[C: EightBits,T: SmallNumber,R: EightBits] = BEGIN IF CharTag^[C]=0 THEN BEGIN CharTag^[C]_T;CharRemainder^[C]_R; END ELSE--1104:--BEGIN BEGIN IF Interaction=3 THEN NULL;PrintNl[133]; Print[877]; END;IF( INT[C]>32)AND ( INT[C]<128) THEN Print[C] ELSE BEGIN Print[878]; PrintInt[C]; END;Print[879];SELECT CharTag^[C]FROM 1 =>Print[880]; 2 =>Print[881];3 =>Print[871]; ENDCASE;BEGIN HelpPtr_2;HelpLine^[1]_882; HelpLine^[0]_835; END;PutGetError[]; END--:1104--; END;--:1103----1105: DoTfmCommand: PROCEDURE = BEGIN C, Cc:EightBits;K:PascalInteger[0..256]; J:PascalInteger; SELECT CurMod FROM 0 =>--1106:--BEGIN C_GetCode[]; WHILE CurCmd=78 DO BEGIN Cc_GetCode[];SetTag[C,2,Cc];C_Cc; END ENDLOOP ; END--:1106--;1 =>--1107:--BEGIN DO {--Label22:--C_GetCode[];IF CurCmd=78 THEN--1110: BEGIN IF INT[Nl]>255 THEN BEGIN BEGIN IF Interaction=3 THEN NULL;PrintNl[133]; Print[892]; END;BEGIN HelpPtr_1;HelpLine^[0]_893; END;Error[]; END ELSE SetTag[C,1,Nl]; GOTO Label22; END--:1110--; IF CurCmd=76 THEN BEGIN--1111:--LigKern^[Nl].B1_C; LigKern^[Nl].B2_CurMod;LigKern^[Nl].B0_0; IF CurMod=0 THEN LigKern^[Nl].B3_GetCode [] ELSE BEGIN GetXNext[]; ScanExpression[];IF CurType#16 THEN BEGIN DispErr[0,894]; BEGIN HelpPtr_2;HelpLine^[1]_895;HelpLine^[0]_181; END; PutGetFlushError[0]; END;Kern^[Nk]_CurExp;K_0; WHILE Kern^[K]#CurExp DO K_K+1 ENDLOOP ; IF K=Nk THEN BEGIN IF Nk=256 THEN Overflow[891,256];Nk_Nk+1; END; LigKern^[Nl].B3_K; END--:1111--; IF Nl=LigTableSize THEN Overflow[887,LigTableSize];Nl_Nl+1; IF CurCmd=79 THEN GOTO Label22; END ELSE BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[133];Print[888]; END;BEGIN HelpPtr_1;HelpLine^[0]_889; END; BackError[]; END;IF INT[Nl]>0 THEN LigKern^[Nl-1].B0_128;EXIT; EXITS Label22 => NULL} ENDLOOP; END--:1107--;2 =>--1112: BEGIN IF Ne=256 THEN Overflow[871,256];C_GetCode[];SetTag[C,3,Ne]; IF CurCmd#78 THEN BEGIN MissingErr[58];BEGIN HelpPtr_1; HelpLine^[0]_896; END;BackError[]; END;Exten^[Ne].B0_GetCode[]; IF CurCmd#79 THEN BEGIN MissingErr[44];BEGIN HelpPtr_1; HelpLine^[0]_896; END;BackError[]; END;Exten^[Ne].B1_GetCode[]; IF CurCmd#79 THEN BEGIN MissingErr[44];BEGIN HelpPtr_1; HelpLine^[0]_896; END;BackError[]; END;Exten^[Ne].B2_GetCode[]; IF CurCmd#79 THEN BEGIN MissingErr[44];BEGIN HelpPtr_1; HelpLine^[0]_896; END;BackError[]; END;Exten^[Ne].B3_GetCode[];Ne_Ne+1; END--:1112--;3,4 =>BEGIN C_CurMod;GetXNext[];ScanExpression[]; IF(CurType#16)OR (CurExp<32768) THEN BEGIN DispErr[0,883]; BEGIN HelpPtr_2;HelpLine^[1]_884;HelpLine^[0]_885; END;PutGetError[]; END ELSE BEGIN J_RoundUnscaled[CurExp]; IF CurCmd#78 THEN BEGIN MissingErr[58];BEGIN HelpPtr_1; HelpLine^[0]_886; END;BackError[]; END;IF C=3 THEN--1113: DO IF J>HeaderSize THEN Overflow[872,HeaderSize]; HeaderByte^[J]_GetCode[];J_J+1; IF CurCmd#79--:1113-- THEN EXIT; ENDLOOP ELSE--1114: DO IF J>MaxFontDimen THEN Overflow[873,MaxFontDimen]; WHILE J>Np DO BEGIN Np_Np+1;Param^[Np]_0; END ENDLOOP ;GetXNext[]; ScanExpression[];IF CurType#16 THEN BEGIN DispErr[0,897]; BEGIN HelpPtr_1;HelpLine^[0]_181; END;PutGetFlushError[0]; END; Param^[J]_CurExp;J_J+1; IF CurCmd#79--:1114-- THEN EXIT; ENDLOOP; END; END; ENDCASE; END; --:1105----1176:-- DoSpecial: PROCEDURE = BEGIN M:SmallNumber; M_CurMod; GetXNext[];ScanExpression[]; IF Internal^[34]>=0 THEN IF CurType#M THEN--1177:--BEGIN DispErr[0,915]; BEGIN HelpPtr_1;HelpLine^[0]_916; END;PutGetError[]; END--:1177 ELSE BEGIN IF OutputFileName=0 THEN InitGf[]; IF M=4 THEN GfString[CurExp,0] ELSE BEGIN BEGIN GfBuf^[GfPtr]_243; GfPtr_GfPtr+1;IF GfPtr=GfLimit THEN GfSwap[]; END;GfFour[CurExp]; END; END;FlushCurExp[0]; END;--:1176----1185:-- StoreBaseFile: PROCEDURE = BEGIN K:PascalInteger;P, Q:Halfword;X:PascalInteger;W:FourQuarters;--1199: Selector_5;Print[926];Print[JobName];PrintChar[32]; PrintInt[ RoundUnscaled[Internal^[14]]MOD 100];PrintChar[46]; PrintInt[RoundUnscaled[Internal^[15]]];PrintChar[46]; PrintInt[RoundUnscaled[Internal^[16]]];PrintChar[41]; IF Interaction=0 THEN Selector_2 ELSE Selector_3; BEGIN IF INT[PoolPtr+1]>MaxPoolPtr THEN BEGIN IF INT[PoolPtr+1]>PoolSize THEN Overflow[129,PoolSize-InitPoolPtr];MaxPoolPtr_PoolPtr+1; END; END; BaseIdent_MakeString[];StrRef^[BaseIdent]_127;PackJobName[927]; WHILE NOT WOpenOut[@BaseFile]DO PromptFileName[928,927] ENDLOOP ; PrintNl[929];Print[WMakeNameString[@BaseFile]]; FlushString[StrPtr-1];PrintNl[BaseIdent]--:1199--;--1189: BEGIN BaseFile.element.Int_514717228;PascalPUT[file: @BaseFile.baseFile, length: SIZE[MemoryWord, 2], element: @BaseFile.element]; END; BEGIN BaseFile.element.Int_0;PascalPUT[file: @BaseFile.baseFile, length: SIZE[MemoryWord, 2], element: @BaseFile.element]; END;BEGIN BaseFile.element.Int_50000; PascalPUT[file: @BaseFile.baseFile, length: SIZE[MemoryWord, 2], element: @BaseFile.element]; END;BEGIN BaseFile.element.Int_2100;PascalPUT[file: @BaseFile.baseFile, length: SIZE[MemoryWord, 2], element: @BaseFile.element]; END; BEGIN BaseFile.element.Int_1777;PascalPUT[file: @BaseFile.baseFile, length: SIZE[MemoryWord, 2], element: @BaseFile.element]; END;BEGIN BaseFile.element.Int_6; PascalPUT[file: @BaseFile.baseFile, length: SIZE[MemoryWord, 2], element: @BaseFile.element]; END--:1189--;--1191:--BEGIN BaseFile.element.Int_PoolPtr; PascalPUT[file: @BaseFile.baseFile, length: SIZE[MemoryWord, 2], element: @BaseFile.element]; END;BEGIN BaseFile.element.Int_StrPtr;PascalPUT[file: @BaseFile.baseFile, length: SIZE[MemoryWord, 2], element: @BaseFile.element]; END; FOR i:INT IN [ INT[0 ].. INT[StrPtr ]] DO K _ i; BaseFile.element.Int_StrStart^[K]; PascalPUT[file: @BaseFile.baseFile, length: SIZE[MemoryWord, 2], element: @BaseFile.element]; ENDLOOP;K_0;WHILE K+443 THEN--989: BEGIN IF INT[CurCmd]<80 THEN BEGIN BEGIN IF Interaction=3 THEN NULL; PrintNl[133];Print[734]; END;PrintCmdMod[CurCmd,CurMod]; PrintChar[39];BEGIN HelpPtr_5;HelpLine^[4]_735;HelpLine^[3]_736; HelpLine^[2]_737;HelpLine^[1]_738;HelpLine^[0]_739; END;BackError[]; GetXNext[]; END; END--:989-- ELSE IF INT[CurCmd]>30 THEN--992:--BEGIN VarFlag_77; ScanExpression[]; IF INT[CurCmd]<81 THEN BEGIN IF CurCmd=51 THEN DoEquation [] ELSE IF CurCmd=77 THEN DoAssignment [] ELSE IF CurType=4 THEN--993: BEGIN IF Internal^[1]>0 THEN BEGIN PrintNl[157];SlowPrint[CurExp]; PascalTextBREAK[file: @TermOut]; END;IF Internal^[34]>0 THEN--1178: BEGIN IF OutputFileName=0 THEN InitGf[];GfString[917,CurExp]; END--:1178--; END--:993-- ELSE IF CurType#1 THEN BEGIN DispErr[0,744]; BEGIN HelpPtr_3;HelpLine^[2]_745;HelpLine^[1]_746;HelpLine^[0]_747; END;PutGetError[]; END;FlushCurExp[0];CurType_1; END; END--:992 ELSE--991:--BEGIN IF Internal^[7]>0 THEN ShowCmdMod[CurCmd,CurMod]; SELECT CurCmd FROM 30 =>DoTypeDeclaration[]; 16 =>IF CurMod>2 THEN MakeOpDef [] ELSE IF CurMod>0 THEN ScanDef[];--1019: 24 =>DoRandomSeed[];--:1019----1022:--23 =>BEGIN PrintLn[];Interaction_CurMod; --70:--IF Interaction=0 THEN Selector_0 ELSE Selector_1--:70--; IF JobName#0 THEN Selector_Selector+2;GetXNext[]; END;--:1022----1025: 21 =>DoProtection[];--:1025----1029:--27 =>DefDelims[];--:1029----1032: 12 =>DO GetSymbol[];SaveVariable[CurSym];GetXNext[]; IF CurCmd#79 THEN EXIT; ENDLOOP;13 =>DoInterim[];14 =>DoLet[];15 =>DoNewInternal[];--:1032 --1038:--22 =>DoShowWhatever[];--:1038----1057:--18 =>DoAddTo[];--:1057----1068: 17 =>DoShipOut[];11 =>DoDisplay[];28 =>DoOpenWindow[];19 =>DoCull[];--:1068----1075: 26 =>BEGIN GetSymbol[];StartSym_CurSym;GetXNext[]; END;--:1075----1080: 25 =>DoMessage[];--:1080----1099:--20 =>DoTfmCommand[];--:1099----1174: 29 =>DoSpecial[];--:1174-- ENDCASE;CurType_1; END--:991--;IF INT[CurCmd]<80 THEN--990: BEGIN BEGIN IF Interaction=3 THEN NULL;PrintNl[133];Print[740]; END; BEGIN HelpPtr_6;HelpLine^[5]_741;HelpLine^[4]_742;HelpLine^[3]_743; HelpLine^[2]_737;HelpLine^[1]_738;HelpLine^[0]_739; END;BackError[]; ScannerStatus_2;DO GetNext[];--742: IF CurCmd=39 THEN BEGIN IF INT[StrRef^[CurMod]]<127 THEN IF INT[StrRef^[CurMod ]]>1 THEN StrRef^[CurMod]_StrRef^[CurMod]-1 ELSE FlushString[CurMod] ; END--:742--; IF INT[CurCmd]>79 THEN EXIT; ENDLOOP;ScannerStatus_0; END--:990--;ErrorCount_0; END;--:988----1016:-- END.