-- file: WeaveProcs.mesa -- Pascal-to-Mesa translator output, translated at September 15, 1985 4:11:16 pm PDT DIRECTORY PascalBasic, PascalWizardFiles, WeaveVars; WeaveProcs: DEFINITIONS IMPORTS = BEGIN OPEN PascalBasic, PascalWizardFiles, WeaveVars; --:247----259: --TROUBLE←SHOOTING:BOOLEAN;DDT:SIXTEEN←BITS;DD:SIXTEEN←BITS; -- DEBUG←CYCLE:INTEGER;DEBUG←SKIPPED:INTEGER;TERM←IN:TEXT←FILE;----:259 --265:-- TtyRewrite: PROCEDURE[ F: LONG POINTER TO TextFile]; FileReset: PROCEDURE[ F: LONG POINTER TO TextFile,Ext: Alfa]; FileRewrite: PROCEDURE[ F: LONG POINTER TO TextFile,Ext: Alfa]; FileClose: PROCEDURE[ F: LONG POINTER TO TextFile]; FileGetPos: PROCEDURE[ F: LONG POINTER TO TextFile] RETURNS[FileGetPosResult: PascalInteger]; --:265----30: --PROCEDURE DEBUG←HELP;FORWARD;----:30----31:-- Error: PROCEDURE ; JumpOut: PROCEDURE; Initialize: PROCEDURE; OpenInput: PROCEDURE; InputLn: PROCEDURE[ F: LONG POINTER TO TextFile] RETURNS[InputLnResult: PascalBoolean]; PrintId: PROCEDURE[P: NamePointer]; NewXref: PROCEDURE[P: NamePointer]; NewModXref: PROCEDURE[P: NamePointer]; --:52----59:-- IdLookup: PROCEDURE[T: EightBits] RETURNS[IdLookupResult: NamePointer]; ModLookup: PROCEDURE[L: SixteenBits] RETURNS[ModLookupResult: NamePointer]; PrefixLookup: PROCEDURE[L: SixteenBits] RETURNS[PrefixLookupResult: NamePointer]; --:70----75:-- LinesDontMatch: PROCEDURE RETURNS[LinesDontMatchResult: PascalBoolean]; PrimeTheChangeBuffer: PROCEDURE; --80:-- CheckChange: PROCEDURE; ResetInput: PROCEDURE; GetLine: PROCEDURE ; ControlCode: PROCEDURE[C: AsciiCode] RETURNS[ControlCodeResult: EightBits] ; SkipLimbo: PROCEDURE; --:90----91:-- SkipTex: PROCEDURE RETURNS[SkipTexResult: EightBits]; SkipComment: PROCEDURE[Bal: EightBits] RETURNS[SkipCommentResult: EightBits]; GetNext: PROCEDURE RETURNS[GetNextResult: EightBits]; PascalXref: PROCEDURE; --113:-- OuterXref: PROCEDURE; --:113----120:-- ModCheck: PROCEDURE[P: NamePointer] ; FlushBuffer: PROCEDURE[B: EightBits,PerCent: PascalBoolean]; FinishLine: PROCEDURE; BreakOut: PROCEDURE ; OutMod: PROCEDURE[M: PascalInteger] ; OutName: PROCEDURE[P: NamePointer]; CopyLimbo: PROCEDURE; CopyTex: PROCEDURE RETURNS[CopyTexResult: EightBits] ; CopyComment: PROCEDURE[Bal: EightBits] RETURNS[CopyCommentResult: EightBits]; --141:----PROCEDURE PRINT←CAT(C:EIGHT←BITS); -- BEGIN CASE C OF 1:WRITE(TERM←OUT,'simp');2:WRITE(TERM←OUT,'math'); -- 3:WRITE(TERM←OUT,'intro');4:WRITE(TERM←OUT,'open'); -- 5:WRITE(TERM←OUT,'beginning');6:WRITE(TERM←OUT,'close'); -- 7:WRITE(TERM←OUT,'alpha');8:WRITE(TERM←OUT,'omega'); -- 9:WRITE(TERM←OUT,'semi');10:WRITE(TERM←OUT,'terminator'); -- 11:WRITE(TERM←OUT,'stmt');12:WRITE(TERM←OUT,'cond'); -- 13:WRITE(TERM←OUT,'clause');14:WRITE(TERM←OUT,'colon'); -- 15:WRITE(TERM←OUT,'exp');16:WRITE(TERM←OUT,'proc'); -- 17:WRITE(TERM←OUT,'casehead');18:WRITE(TERM←OUT,'recordhead'); -- 19:WRITE(TERM←OUT,'varhead');20:WRITE(TERM←OUT,'elsie'); -- 21:WRITE(TERM←OUT,'casey');22:WRITE(TERM←OUT,'module'); -- OTHERS:WRITE(TERM←OUT,'UNKNOWN')END;END;----:141----147: --PROCEDURE PRINT←TEXT(P:TEXT←POINTER);VAR J:0..MAX←TOKS;R:0..10239; -- BEGIN IF P>=TEXT←PTR THEN WRITE(TERM←OUT,'BAD')ELSE FOR J:=TOK←START[P] -- TO TOK←START[P+1]-1 DO BEGIN R:=TOK←MEM[J]MOD 10240; -- CASE TOK←MEM[J]DIV 10240 OF 1:BEGIN WRITE(TERM←OUT,'\\',XCHR[123]); -- PRINT←ID(R);WRITE(TERM←OUT,XCHR[125]);END; -- 2:BEGIN WRITE(TERM←OUT,'\&',XCHR[123]);PRINT←ID(R); -- WRITE(TERM←OUT,XCHR[125]);END;3:BEGIN WRITE(TERM←OUT,'<');PRINT←ID(R); -- WRITE(TERM←OUT,'>');END;4:WRITE(TERM←OUT,'[[',R:1,']]'); -- 5:WRITE(TERM←OUT,'|[[',R:1,']]|'); -- OTHERS:[148:]CASE R OF 131:WRITE(TERM←OUT,'\mathbin',XCHR[123]); -- 132:WRITE(TERM←OUT,'\mathrel',XCHR[123]); -- 133:WRITE(TERM←OUT,'\mathop',XCHR[123]);134:WRITE(TERM←OUT,'[ccancel]'); -- 135:WRITE(TERM←OUT,'[cancel]');136:WRITE(TERM←OUT,'[indent]'); -- 137:WRITE(TERM←OUT,'[outdent]');139:WRITE(TERM←OUT,'[backup]'); -- 138:WRITE(TERM←OUT,'[opt]');140:WRITE(TERM←OUT,'[break]'); -- 141:WRITE(TERM←OUT,'[force]');142:WRITE(TERM←OUT,'[fforce]'); -- 143:WRITE(TERM←OUT,'[quit]');OTHERS:WRITE(TERM←OUT,XCHR[R])END[:148]END; -- END;END;----:147----173:-- Red: PROCEDURE[J: SixteenBits,K: EightBits, C: EightBits,D: PascalInteger]; --175:-- Sq: PROCEDURE[J: SixteenBits,K: EightBits,C: EightBits,D: PascalInteger] ; --PROCEDURE PROD(N:EIGHT←BITS);VAR K:1..MAX←SCRAPS; -- BEGIN IF TRACING=2 THEN BEGIN BEGIN WRITELN(TERM←OUT); -- WRITE(TERM←OUT,N:1,':');END; -- FOR K:=SCRAP←BASE TO LO←PTR DO BEGIN IF K=PP THEN WRITE(TERM←OUT,'*') -- ELSE WRITE(TERM←OUT,' ');PRINT←CAT(CAT[K]);END; -- IF HI←PTR<=SCRAP←PTR THEN WRITE(TERM←OUT,'...');END;END;----:179----180: --151:-- FiveCases: PROCEDURE; AlphaCases: PROCEDURE; Translate: PROCEDURE RETURNS[TranslateResult: TextPointer]; --184:----196:-- AppComment: PROCEDURE; AppOctal: PROCEDURE ; AppHex: PROCEDURE ; EasyCases: PROCEDURE ; --193:-- SubCases: PROCEDURE[P: NamePointer] ; PascalParse: PROCEDURE ; --198:-- PascalTranslate: PROCEDURE RETURNS[PascalTranslateResult: TextPointer]; --:198----199:-- OuterParse: PROCEDURE; --205:-- PushLevel: PROCEDURE[P: TextPointer] ; GetOutput: PROCEDURE RETURNS[GetOutputResult: EightBits]; OutputPascal: PROCEDURE ; MakeOutput: PROCEDURE; FinishPascal: PROCEDURE; Footnote: PROCEDURE[Flag: SixteenBits]; Unbucket: PROCEDURE[D: EightBits]; --:250----257:-- ModPrint: PROCEDURE[P: NamePointer] ; PhaseI: PROCEDURE; PhaseIi: PROCEDURE ; PhaseIii: PROCEDURE ; Error9999: ERROR; END.