ack/lang/a68s/aem/a68sin.p
1988-10-04 10:56:50 +00:00

803 lines
36 KiB
OpenEdge ABL

33000 (*+01() (*$P+,T-+) ()+01*)
33010 (*+25() (*$P+,T-+) ()+25*)
33020 (* COPYRIGHT 1983 C.H.LINDSEY, UNIVERSITY OF MANCHESTER *)
33030 (**)
33040 (**)
33050 (**)
33060 (*+83()
33070 (**)
33080 (**)
33090 PROCEDURE INITIALIZE;
33100 (*FUNCTION: COMPILER INITIALIZATION TO SET UP LEXEMES, PARSER,
33110 STANDARD-PRELUDE, ETC. ULTIMATELY, THE COMPILER WILL BE FROZEN
33120 AFTER THE CALL OF INITIALIZE, AND HOPEFULLY THIS PROCEDURE CAN
33130 THEN BE MADE TO VANISH AWAY.
33140 *)
33150 VAR I: INTEGER;
33160 OTCOUNT: INTEGER;
33170 (*+84()
33180 (*MDMS*)
33190 MDVINT, MDVLINT, MDVREAL, MDVLREAL, MDVCHAR, MDVBITS, MDVBYTES, MDVSTRNG, MDVBOOL,
33200 MDVCHAN, MDVCOVER, MDVVOID, MDVSKIP, MDVJUMP, MDVNIL,
33210 MDVOUT, MDVIN, MDVOUTB, MDVINB, MDVNUMBER,
33220 MDVROWS, MDVBNDS, MDVABSENT, MDVERROR (*, MDVPROC, MDVREF, MDVSTRUCT, MDVROW*): MDM;
33230 ()+84*)
33240 (*+81()
33250 (*LXMS - NONTERMINALS*)
33260 LXVACTPL, LXVACTRL,
33270 LXVBOUNDS, LXVBRINPT, LXVBRTHPT,
33280 LXVCSTICK,
33290 LXVDCLL,
33300 LXVFLDSPL, LXVFORDCL, LXVFORRLB,
33310 LXVIDEFL,
33320 LXVLABSQ,
33330 LXVMOIDDR,
33340 LXVNONRDR,
33350 LXVODEFL, LXVOPRAND,
33360 LXVPRIM, LXVPRMDRL,
33370 LXVRIDEFL, LXVRODEFL, LXVRSPEC, LXVRVDEFL,
33380 LXVTERT, LXVTRMSCL,
33390 LXVUNLC, LXVUNLP, LXVUNSR,
33400 LXVVDEFL,
33410 (*LXMS - TERMINALS*)
33420 LXVAGAIN, LXVAT,
33430 LXVBECOM, LXVBEGIN, LXVBOOLDEN, LXVBUS, LXVBY,
33440 LXVCASE, LXVCLOSE, LXVCOLON, LXVCOMMA, LXVCMMENT,
33450 LXVDO,
33460 LXVELIF, LXVELSE, LXVEND, LXVEQUAL, LXVERROR, LXVESAC, LXVEXIT,
33470 LXVFI, LXVFOR, LXVFROM,
33480 LXVGO, LXVGOTO,
33490 LXVHEAP,
33500 LXVIDTY, LXVIF, LXVIN,
33510 LXVLOC, LXVLONG,
33520 (*LXVMDIND,*) LXVMODE,
33530 LXVNIL,
33540 LXVOD, LXVOF, LXVOP, LXVOPEN, (*LXVOPR,*) LXVOTHDR, LXVOUSE, LXVOUT,
33550 LXVPRAGMAT, (*LXVPRDEN,*) LXVPRDR, LXVPRIO, LXVPROC,
33560 LXVREF,
33570 LXVSEMIC, LXVSHORT, LXVSKIP, LXVSTART, LXVSTICK, LXVSTOP, (*LXVSTRGDEN*) LXVSTRUCT, LXVSUB,
33580 (*LXVTAB,*) (*LXVTAG,*) LXVTHEN, LXVTO,
33590 LXVVOID,
33600 LXVWHILE: LXM;
33610 (*PLEXES - NONTERMINALS*)
33620 LEXACTPL, LEXACTRL,
33630 LEXBOUNDS, LEXBRINPT, (*LEXBRTHPT,*)
33640 LEXCSTICK,
33650 LEXDCLL,
33660 LEXFLDSPL, LEXFORDCL, LEXFORRLB,
33670 LEXIDEFL,
33680 LEXLABSQ,
33690 LEXMOIDDR,
33700 LEXNONRDR,
33710 LEXODEFL, LEXOPRAND,
33720 LEXPRIM, LEXPRMDRL,
33730 LEXRIDEFL, LEXRODEFL, LEXRSPEC, LEXRVDEFL,
33740 LEXTERT, LEXTRMSCL,
33750 LEXUNLC, LEXUNLP, LEXUNSR,
33760 LEXVDEFL,
33770 (*PLEXES - TERMINALS*)
33780 LEXAGAIN, LEXAT, LEXATB,
33790 LEXBECOM, (*LEXBEGIN,*) LEXBUSB, LEXBY,
33800 (*LEXCASE,*) LEXCLOSE, LEXCOLON, LEXCOMMA, LEXCO, LEXCO2, LEXCMMENT,
33810 LEXDIV, LEXDO, LEXDVAB,
33820 LEXELIF, LEXELSE, LEXEMPTY, LEXEND, LEXEQUAL, (*LEXERROR,*) LEXESAC, LEXEXIT,
33830 (*LEXFALSE,*) LEXFI, LEXFLEX, LEXFOR, LEXFROM,
33840 LEXGE, LEXGO, LEXGOTO, LEXGT,
33850 LEXHEAP,
33860 (*LEXIF,*) LEXIN, LEXIS, LEXISB, LEXISNT, LEXISNTB,
33870 LEXLE, LEXLOC, LEXLONG, LEXLT,
33880 LEXMDAB, LEXMINUS, LEXMNAB, LEXMOD, LEXMODE,
33890 LEXNE, LEXNIL,
33900 LEXOD, LEXOF, LEXOP, (*LEXOPEN,*) LEXOUSE, LEXOUT, LEXOVAB, LEXOVER,
33910 LEXPAR, LEXPLAB, LEXPLTO, LEXPLUS, LEXPLITM, LEXPR, LEXPRAGMAT, LEXPRIO, LEXPROC,
33920 LEXREF,
33930 LEXSEMA, LEXSEMIC, LEXSHORT, LEXSKIP, (*LEXSTART,*) LEXSTICK, (*LEXLSTOP, LEXSTOP,*) LEXSTRUCT, LEXSUBB,
33940 LEXTHEN, LEXTIMES, LEXTMAB, LEXTO, (*LEXTRUE,*)
33950 LEXUP1, LEXUP2, LEXUNION,
33960 LEXVOID (*, LEXWHILE*)
33970 : PLEX;
33980 ()+81*)
33990 PROCEDURE LXVVAL(VAR LXVVAR: LXM; IO: LXIOTYPE; CL0: CL0TYPE; CL1: CL1TYPE; CL2: CL2TYPE);
34000 VAR WORD: RECORD CASE SEVERAL OF
34010 (*-02() (*-05() 1:(LXV: LXM); 2:(INT: INTEGER) END; ()-05*) ()-02*)
34020 (*+02() 1:(LXV:LXM); 2:(INT,INT2,INT3: INTEGER); 3,4,5,6,7,8,9,10:() END; ()+02*)
34030 (*+05() 1:(LXV:LXM); 2:(INT,INT2: INTEGER); 3,4,5,6,7,8,9,10:() END; ()+05*)
34040 BEGIN WORD.INT := 0; (*TO ENSURE THAT PARTS OF WORD NOT OCCUPIED BY THE LXM ARE CLEAR*)
34050 (*+02() WORD.INT2 := 0; WORD.INT3 := 0; ()+02*)
34060 (*+05() WORD.INT2 := 0; ()+05*)
34070 WITH WORD.LXV DO
34080 BEGIN LXIO := IO; LXCLASS0 := CL0; LXCLASS1 := CL1; LXCLASS2 := CL2; LXPSTB := NIL END;
34090 LXVVAR := WORD.LXV
34100 END;
34110 (*+81()
34120 PROCEDURE LOCNDEX(VAR LEX: PLEX; LXV: LXM);
34130 BEGIN
34140 ENEW(LEX, LEX1SIZE);
34150 LEX^.LXV := LXV;
34160 LEX^.LXCOUNT := 0;
34170 END;
34180 ()+81*)
34190 (*+84()
34200 FUNCTION DEFPRC0(YIELD: MODE; CP: CODEPROC): MODE;
34210 BEGIN SRSEMP := -1; SRSUBP := 0; SUBSAVE;
34220 FINDPRC(YIELD,0,CP); DEFPRC0 := SRSTK[SRSEMP].MD
34230 END;
34240 FUNCTION DEFPRC1(P1, YIELD: MODE; CP: CODEPROC): MODE;
34250 BEGIN SRSEMP := -1; SRSUBP := 0; SUBSAVE;
34260 SRSEMP := SRSEMP+1; SRSTK[SRSEMP].MD := P1;
34270 FINDPRC(YIELD,1,CP); DEFPRC1 := SRSTK[SRSEMP].MD
34280 END;
34290 FUNCTION DEFPRC2(P1, P2, YIELD: MODE; CP: CODEPROC): MODE;
34300 BEGIN SRSEMP := -1; SRSUBP := 0; SUBSAVE;
34310 SRSEMP := SRSEMP+1; SRSTK[SRSEMP].MD := P1;
34320 SRSEMP := SRSEMP+1; SRSTK[SRSEMP].MD := P2;
34330 FINDPRC(YIELD,2,CP); DEFPRC2 := SRSTK[SRSEMP].MD
34340 END;
34350 ()+84*)
34360 (*+81()
34370 PROCEDURE DEFSYMB(VAR LEX: PLEX; TLXV: LXM; SYMB: ALFA);
34380 VAR I: INTEGER;
34390 BEGIN WITH CURRENTLEX DO
34400 BEGIN
34410 LXV := TLXV; LXTOKEN := TKSYMBOL;
34420 (*+11() S10 := SYMB; LXCOUNT := 1; ()+11*)
34430 (*-11() STASHLEX(SYMB); ()-11*)
34440 ENEW(LEX, LEX1SIZE+LXCOUNT*SZWORD);
34450 FOR I := 1 TO LEX1SIZE DIV SZWORD + LXCOUNT DO
34460 LEX^.LEXWORDS[I] := LEXWORDS[I];
34470 END
34480 END;
34490 (**)
34500 ()+81*)
34510 (**)
34520 PROCEDURE INTAB(VAR LEX: PLEX; TAG: ALFA; LXVV: LXM);
34530 VAR I: INTEGER;
34540 BEGIN WITH CURRENTLEX DO
34550 BEGIN
34560 LXV := LXVV; LXTOKEN := TKBOLD;
34570 (*+11() S10:=TAG; LXCOUNT:=1; ()+11*)
34580 (*-11() STASHLEX(TAG); ()-11*)
34590 END;
34600 LEX := HASHIN
34610 END;
34620 (*+84()
34630 FUNCTION DEFTAG(TAG: ALFA): PLEX;
34640 BEGIN WITH CURRENTLEX DO
34650 BEGIN
34660 LXV := LXVTAG; LXTOKEN := TKTAG;
34670 (*+11() S10:=TAG; LXCOUNT:=1; ()+11*)
34680 (*-11() STASHLEX(TAG); ()-11*)
34690 END;
34700 DEFTAG := HASHIN
34710 END;
34720 ()+84*)
34730 (*+81()
34740 FUNCTION DEFLTAG(TAG1, TAG2: ALFA): PLEX;
34750 BEGIN WITH CURRENTLEX DO
34760 BEGIN
34770 LXV := LXVTAG; LXTOKEN := TKTAG;
34780 (*+11() S20 := TAG2; S10 := TAG1; LXCOUNT := 2; ()+11*)
34790 (*-11() STASHLLEX(TAG1, TAG2); ()-11*)
34800 DEFLTAG := HASHIN;
34810 END
34820 END;
34830 PROCEDURE OTPAIR(OTCOUNT: OPCHTABBOUND; TCHAR: CHAR; TNEXT, TALT: OPCHTABBOUND; TLEX: PLEX);
34840 BEGIN WITH OPCHTABLE[OTCOUNT] DO
34850 BEGIN OTCHAR := TCHAR; OTNEXT := TNEXT; OTALT := TALT; OTLEX := TLEX;
34860 END
34870 END;
34880 PROCEDURE INITLEXES;
34890 BEGIN
34900 (*SET UP LXV VALUES - NONTERMINALS*)
34910 LXVVAL(LXVACTPL , LXIOACTPL , 0, 0, 00); (*ACTUAL PARAMETER LIST*)
34920 LXVVAL(LXVACTRL , LXIOACTRL , 0, 0, 00); (*ACTUAL ROWER LIST*)
34930 LXVVAL(LXVBOUNDS , LXIOBOUNDS , 0, 0, 00); (*BOUNDS*)
34940 LXVVAL(LXVBRINPT , LXIOBRINPT , 0, 0, 02); (*BRIEF IN PART*)
34950 LXVVAL(LXVBRTHPT , LXIOBRTHPT , 0, 0, 02); (*BRIEF THEN PART*)
34960 LXVVAL(LXVCSTICK , LXIOCSTICK , 0, 3, 09); (*STICK IN CASE-CLAUSE*)
34970 LXVVAL(LXVDCLL , LXIODCLL , 0, 0, 00); (*DECLARATION LIST*)
34980 LXVVAL(LXVFLDSPL , LXIOFLDSPL , 0, 0, 07); (*FIELD SPECIFICATION LIST*)
34990 LXVVAL(LXVFORDCL , LXIOFORDCL , 0, 0, 00); (*FORMAL DECLARATIVE LIST*)
35000 LXVVAL(LXVFORRLB , LXIOFORRLB , 0, 0, 00); (*FORMAL ROWER LIST BRACKET*)
35010 LXVVAL(LXVIDEFL , LXIOIDEFL , 0, 0, 00); (*IDENTITY DEFINITION LIST*)
35020 LXVVAL(LXVLABSQ , LXIOLABSQ , 0, 0, 00); (*LABEL SEQUENCE*)
35030 LXVVAL(LXVMOIDDR , LXIOMOIDDR , 0, 0, 00); (*MOID DECLARER*)
35040 LXVVAL(LXVNONRDR , LXIONONRDR , 0, 0, 00); (*NONROWED DECLARER*)
35050 LXVVAL(LXVODEFL , LXIOODEFL , 0, 0, 00); (*OPERATION DEFINITION LIST*)
35060 LXVVAL(LXVOPRAND , LXIOOPRAND , 0, 0, 00); (*OPERAND*)
35070 LXVVAL(LXVPRIM , LXIOPRIM , 0, 0, 00); (*PRIMARY*)
35080 LXVVAL(LXVPRMDRL , LXIOPRMDRL , 0, 0, 00); (*PARAMETER DECLARER LIST*)
35090 LXVVAL(LXVRIDEFL , LXIORIDEFL , 0, 0, 00); (*ROUTINE IDENTITY DEFINITION LIST*)
35100 LXVVAL(LXVRODEFL , LXIORODEFL , 0, 0, 00); (*ROUTINE OPERATION DEFINITION LIST*)
35110 LXVVAL(LXVRSPEC , LXIORSPEC , 0, 0, 00); (*ROUTINE SPECIFICATION*)
35120 LXVVAL(LXVRVDEFL , LXIORVDEFL , 0, 0, 00); (*ROUTINE VARIABLE DEFINITION LIST*)
35130 LXVVAL(LXVTERT , LXIOTERT , 0, 0, 00); (*TERTIARY*)
35140 LXVVAL(LXVTRMSCL , LXIOTRMSCL , 0, 0, 00); (*TRIMSCRIPT LIST*)
35150 LXVVAL(LXVUNLC , LXIOUNLC , 0, 0, 00); (*UNIT LIST PROPER IN COLLATERAL*)
35160 LXVVAL(LXVUNLP , LXIOUNLP , 0, 0, 00); (*UNIT LIST PROPER*)
35170 LXVVAL(LXVUNSR , LXIOUNSR , 0, 3, 00); (*UNIT SERIES*)
35180 LXVVAL(LXVVDEFL , LXIOVDEFL , 0, 0, 00); (*VARIABLE DEFINITION LIST*)
35190 (*SET UP LXV VALUES - TERMINALS*)
35200 LXVVAL(LXVAGAIN , LXIOAGAIN , 1, 3, 09);
35210 LXVVAL(LXVAT , LXIOAT , 1, 1, 05);
35220 LXVVAL(LXVBECOM , LXIOBECOM , 1, 0, 00);
35230 LXVVAL(LXVBEGIN , LXIOBEGIN , 0, 3, 02);
35240 LXVVAL(LXVBOOLDEN, LXIOBOOLDEN, 0, 0, 10);
35250 LXVBOOLDEN.LXPYPTR := 0;
35260 LXVVAL(LXVBUS , LXIOBUS , 1, 1, 00);
35270 LXVVAL(LXVBY , LXIOBY , 0, 0, 01);
35280 LXVVAL(LXVCASE , LXIOCASE , 0, 3, 02);
35290 LXVVAL(LXVCLOSE , LXIOCLOSE , 1, 1, 15);
35300 LXVVAL(LXVCOLON , LXIOCOLON , 1, 0, 05);
35310 LXVVAL(LXVCOMMA , LXIOCOMMA , 1, 1, 13);
35320 LXVVAL(LXVCMMENT , LXIOCMMENT , 0, 0, 00);
35330 LXVVAL(LXVDO , LXIODO , 0, 3, 01);
35340 LXVVAL(LXVELIF , LXIOELIF , 1, 3, 04);
35350 LXVVAL(LXVELSE , LXIOELSE , 1, 3, 04);
35360 LXVVAL(LXVEND , LXIOEND , 1, 0, 15);
35370 LXVVAL(LXVEQUAL , LXIOEQUAL , 0, 4, 00);
35380 LXVVAL(LXVERROR , LXIOERROR , 0, 0, 00);
35390 LXVVAL(LXVESAC , LXIOESAC , 1, 0, 15);
35400 LXVVAL(LXVEXIT , LXIOEXIT , 1, 0, 00);
35410 LXVVAL(LXVFI , LXIOFI , 1, 0, 15);
35420 LXVVAL(LXVFOR , LXIOFOR , 0, 0, 01);
35430 LXVVAL(LXVFROM , LXIOFROM , 0, 0, 01);
35440 LXVVAL(LXVGO , LXIOGO , 0, 0, 00);
35450 LXVVAL(LXVGOTO , LXIOGOTO , 0, 0, 00);
35460 LXVVAL(LXVHEAP , LXIOHEAP , 0, 0, 14);
35470 LXVVAL(LXVIDTY , LXIOIDTY , 1, 0, 00);
35480 LXVVAL(LXVIF , LXIOIF , 0, 3, 02);
35490 LXVVAL(LXVIN , LXIOIN , 1, 3, 00);
35500 LXVVAL(LXVLOC , LXIOLOC , 0, 0, 14);
35510 LXVVAL(LXVLONG , LXIOLONG , 0, 2, 00);
35520 LXVVAL(LXVMDIND , LXIOMDIND , 0, 2, 11);
35530 LXVVAL(LXVMODE , LXIOMODE , 0, 0, 00);
35540 LXVVAL(LXVNIL , LXIONIL , 0, 0, 00);
35550 LXVVAL(LXVOD , LXIOOD , 1, 0, 15);
35560 LXVVAL(LXVOF , LXIOOF , 1, 0, 00);
35570 LXVVAL(LXVOP , LXIOOP , 0, 0, 12);
35580 LXVVAL(LXVOPEN , LXIOOPEN , 0, 3, 06);
35590 LXVVAL(LXVOPR , LXIOOPR , 0, 4, 00);
35600 LXVVAL(LXVOTHDR , LXIOOTHDR , 0, 2, 08); (*DOESN'T SEEM TO BE USED ANYWHERE*)
35610 LXVVAL(LXVOUSE , LXIOOUSE , 1, 3, 03);
35620 LXVVAL(LXVOUT , LXIOOUT , 1, 3, 03);
35630 LXVVAL(LXVPRAGMAT, LXIOPRAGMAT, 0, 0, 00);
35640 LXVVAL(LXVPRDEN , LXIOPRDEN , 0, 0, 10);
35650 LXVPRDEN.LXPYPTR := 0;
35660 LXVVAL(LXVPRDR , LXIOPRDR , 0, 2, 08);
35670 LXVVAL(LXVPRIO , LXIOPRIO , 0, 0, 00);
35680 LXVVAL(LXVPROC , LXIOPROC , 0, 2, 12);
35690 LXVVAL(LXVREF , LXIOREF , 0, 2, 00);
35700 LXVVAL(LXVSEMIC , LXIOSEMIC , 1, 0, 13);
35710 LXVVAL(LXVSHORT , LXIOSHORT , 0, 2, 00);
35720 LXVVAL(LXVSKIP , LXIOSKIP , 0, 0, 00);
35730 LXVVAL(LXVSTART , LXIOSTART , 0, 0, 00);
35740 LXVVAL(LXVSTICK , LXIOSTICK , 1, 3, 09);
35750 LXVVAL(LXVSTOP , LXIOSTOP , 1, 0, 00);
35760 LXVVAL(LXVSTRGDEN, LXIOSTRGDEN, 0, 0, 10);
35770 LXVSTRGDEN.LXPYPTR := 0;
35780 LXVVAL(LXVSTRUCT , LXIOSTRUCT , 0, 2, 07);
35790 LXVVAL(LXVSUB , LXIOSUB , 0, 2, 06);
35800 LXVVAL(LXVTAB , LXIOTAB , 0, 4, 11);
35810 LXVVAL(LXVTAG , LXIOTAG , 0, 0, 00);
35820 LXVVAL(LXVTHEN , LXIOTHEN , 1, 3, 00);
35830 LXVVAL(LXVTO , LXIOTO , 0, 0, 01);
35840 LXVVAL(LXVVOID , LXIOVOID , 0, 0, 00);
35850 LXVVAL(LXVWHILE , LXIOWHILE , 0, 3, 01);
35860 (*SET UP LEX VALUES - NONTERMINALS*)
35870 LOCNDEX(LEXACTPL, LXVACTPL);
35880 LOCNDEX(LEXACTRL, LXVACTRL);
35890 LOCNDEX(LEXBOUNDS, LXVBOUNDS);
35900 LOCNDEX(LEXBRINPT, LXVBRINPT);
35910 LOCNDEX(LEXBRTHPT, LXVBRTHPT);
35920 LOCNDEX(LEXCSTICK, LXVCSTICK);
35930 LOCNDEX(LEXDCLL, LXVDCLL);
35940 LOCNDEX(LEXFLDSPL, LXVFLDSPL);
35950 LOCNDEX(LEXFORDCL, LXVFORDCL);
35960 LOCNDEX(LEXFORRLB, LXVFORRLB);
35970 LOCNDEX(LEXIDEFL, LXVIDEFL);
35980 LOCNDEX(LEXLABSQ, LXVLABSQ);
35990 LOCNDEX(LEXMOIDDR, LXVMOIDDR);
36000 LOCNDEX(LEXNONRDR, LXVNONRDR);
36010 LOCNDEX(LEXODEFL, LXVODEFL);
36020 LOCNDEX(LEXOPRAND, LXVOPRAND);
36030 LOCNDEX(LEXPRIM, LXVPRIM);
36040 LOCNDEX(LEXPRMDRL, LXVPRMDRL);
36050 LOCNDEX(LEXRIDEFL, LXVRIDEFL);
36060 LOCNDEX(LEXRODEFL, LXVRODEFL);
36070 LOCNDEX(LEXRSPEC, LXVRSPEC);
36080 LOCNDEX(LEXRVDEFL, LXVRVDEFL);
36090 LOCNDEX(LEXTERT, LXVTERT);
36100 LOCNDEX(LEXTRMSCL, LXVTRMSCL);
36110 LOCNDEX(LEXUNLC, LXVUNLC);
36120 LOCNDEX(LEXUNLP, LXVUNLP);
36130 LOCNDEX(LEXUNSR, LXVUNSR);
36140 LOCNDEX(LEXVDEFL, LXVVDEFL);
36150 (*SET UP LEX VALUES - BRIEF TERMINALS*)
36160 LOCNDEX(LEXAGAIN, LXVAGAIN);
36170 LOCNDEX(LEXAT, LXVAT);
36180 LOCNDEX(LEXBECOM, LXVBECOM);
36190 LOCNDEX(LEXBUSB, LXVBUS);
36200 LOCNDEX(LEXCLOSE, LXVCLOSE);
36210 LOCNDEX(LEXCOLON, LXVCOLON);
36220 LOCNDEX(LEXCOMMA, LXVCOMMA);
36230 DEFSYMB(LEXCO2, LXVCMMENT, '# ');
36240 DEFSYMB(LEXDIV, LXVOPR, '/ ');
36250 DEFSYMB(LEXDVAB, LXVOPR, '/:= ');
36260 DEFSYMB(LEXEQUAL, LXVEQUAL, '= ');
36270 LOCNDEX(LEXERROR, LXVERROR);
36280 DEFSYMB(LEXGE, LXVOPR, '>= ');
36290 DEFSYMB(LEXGT, LXVOPR, '> ');
36300 LOCNDEX(LEXIS, LXVIDTY);
36310 LEXIS^.LXV.LXP := 0;
36320 LOCNDEX(LEXISNT, LXVIDTY);
36330 LEXISNT^.LXV.LXP := 1;
36340 DEFSYMB(LEXLE, LXVOPR, '<= ');
36350 DEFSYMB(LEXLT, LXVOPR, '< ');
36360 DEFSYMB(LEXMDAB, LXVOPR, '%*:= ');
36370 DEFSYMB(LEXMINUS, LXVOPR, '- ');
36380 DEFSYMB(LEXMNAB, LXVOPR, '-:= ');
36390 DEFSYMB(LEXMOD, LXVOPR, '%* ');
36400 DEFSYMB(LEXNE, LXVOPR, '/= ');
36410 LOCNDEX(LEXOPEN, LXVOPEN);
36420 DEFSYMB(LEXOVAB, LXVOPR, '%:= ');
36430 DEFSYMB(LEXOVER, LXVOPR, '% ');
36440 DEFSYMB(LEXPLAB, LXVOPR, '+:= ');
36450 DEFSYMB(LEXPLTO, LXVOPR, '+=: ');
36460 DEFSYMB(LEXPLUS, LXVOPR, '+ ');
36470 DEFSYMB(LEXPLITM, LXVOPR, '+* ');
36480 (*LEXPR2 OMITTED*)
36490 LOCNDEX(LEXSEMIC, LXVSEMIC);
36500 LOCNDEX(LEXSTART, LXVSTART);
36510 LOCNDEX(LEXSTICK, LXVSTICK);
36520 LOCNDEX(LEXSTOP, LXVSTOP);
36530 LOCNDEX(LEXSUBB, LXVSUB);
36540 DEFSYMB(LEXTIMES, LXVOPR, '* ');
36550 DEFSYMB(LEXTMAB, LXVOPR, '*:= ');
36560 DEFSYMB(LEXUP1, LXVOPR, '^ ');
36570 DEFSYMB(LEXUP2, LXVOPR, '** ');
36580 END;
36590 (**)
36600 PROCEDURE MAKEPUSHTBL;
36610 (*SET UP PUSHTBL*)
36620 BEGIN
36630 PUSHTBL[LXIOACTPL] := LEXACTPL;
36640 PUSHTBL[LXIOACTRL] := LEXACTRL;
36650 PUSHTBL[LXIOBOUNDS] := LEXBOUNDS;
36660 PUSHTBL[LXIOBRINPT] := LEXBRINPT;
36670 PUSHTBL[LXIOBRTHPT] := LEXBRTHPT;
36680 PUSHTBL[LXIOCSTICK] := LEXCSTICK;
36690 PUSHTBL[LXIODCLL] := LEXDCLL;
36700 PUSHTBL[LXIOFLDSPL] := LEXFLDSPL;
36710 PUSHTBL[LXIOFORDCL] := LEXFORDCL;
36720 PUSHTBL[LXIOFORRLB] := LEXFORRLB;
36730 PUSHTBL[LXIOIDEFL] := LEXIDEFL;
36740 PUSHTBL[LXIOLABSQ] := LEXLABSQ;
36750 PUSHTBL[LXIOMOIDDR] := LEXMOIDDR;
36760 PUSHTBL[LXIONONRDR] := LEXNONRDR;
36770 PUSHTBL[LXIOODEFL] := LEXODEFL;
36780 PUSHTBL[LXIOOPRAND] := LEXOPRAND;
36790 PUSHTBL[LXIOPRIM] := LEXPRIM;
36800 PUSHTBL[LXIOPRMDRL] := LEXPRMDRL;
36810 PUSHTBL[LXIORIDEFL] := LEXRIDEFL;
36820 PUSHTBL[LXIORODEFL] := LEXRODEFL;
36830 PUSHTBL[LXIORSPEC] := LEXRSPEC;
36840 PUSHTBL[LXIORVDEFL] := LEXRVDEFL;
36850 PUSHTBL[LXIOTERT] := LEXTERT;
36860 PUSHTBL[LXIOTRMSCL] := LEXTRMSCL;
36870 PUSHTBL[LXIOUNLC] := LEXUNLC;
36880 PUSHTBL[LXIOUNLP] := LEXUNLP;
36890 PUSHTBL[LXIOUNSR] := LEXUNSR;
36900 PUSHTBL[LXIOVDEFL] := LEXVDEFL;
36910 END;
36920 PROCEDURE OTPAIRS;
36930 (*SET UP OPCHTABLE*)
36940 BEGIN
36950 (*THE INITIAL ENTRIES TO THIS TABLE (THE ONES LESS INDENTED) DEPEND UPON
36960 THE POSITION OF THE CHARACTER CONCERNED IN THE CHARACTER CODE*)
36970 (*+01() (*BUT ':' OCCUPIES THE POSITION OF '$'*) ()+01*)
36980 (*-01() (*BUT '[', ']' AND '^' OCCUPY THE POSITIONS OF '$', '&' AND ''''*) ()-01*)
36990 (*+01() (*CDC CODE*)
37000 OTPAIR( 0, '+', 37, 0, LEXPLUS);
37010 OTPAIR( 1, '-', 15, 0, LEXMINUS);
37020 OTPAIR( 2, '*', 45, 0, LEXTIMES);
37030 OTPAIR( 3, '/', 42, 0, LEXDIV);
37040 OTPAIR( 4, '(', 0, 0, LEXOPEN);
37050 OTPAIR( 5, ')', 0, 0, LEXCLOSE);
37060 OTPAIR( 6, ':', 27, 0, LEXCOLON);
37070 OTPAIR( 7, '=', 0, 0, LEXEQUAL);
37080 OTPAIR( 8, ':', 0, 0, LEXAGAIN);
37090 OTPAIR( 9, ',', 0, 0, LEXCOMMA);
37100 OTPAIR(10, '=', 0, 0, LEXLE);
37110 OTPAIR(11, '#', 0, 0, LEXCO2);
37120 OTPAIR(12, '[', 0, 0, LEXSUBB);
37130 OTPAIR(13, ']', 0, 0, LEXBUSB);
37140 OTPAIR(14, '%', 32, 0, LEXOVER);
37150 OTPAIR(15, ':', 16, 0, LEXERROR);
37160 OTPAIR(16, '=', 0, 0, LEXMNAB);
37170 (*-51()
37180 OTPAIR(17, '!', 8, 0, LEXSTICK);
37190 ()-51*)
37200 (*+51()
37210 OTPAIR(18, '&', 8, 0, LEXSTICK);
37220 OTPAIR(19, '''', 0, 0, LEXUP1);
37230 ()+51*)
37240 OTPAIR(20, '=', 0, 0, LEXTMAB);
37250 OTPAIR(21, '<', 10, 0, LEXLT);
37260 OTPAIR(22, '>', 24, 0, LEXGT);
37270 OTPAIR(23, '@', 0, 0, LEXAT);
37280 OTPAIR(24, '=', 0, 0, LEXGE);
37290 (*-51()
37300 OTPAIR(25, '^', 0, 0, LEXUP1);
37310 ()-51*)
37320 OTPAIR(26, ';', 0, 0, LEXSEMIC);
37330 OTPAIR(27, '=', 28, 29, LEXBECOM);
37340 OTPAIR(28, ':', 0, 0, LEXIS);
37350 OTPAIR(29, '/', 30, 0, LEXERROR);
37360 OTPAIR(30, '=', 31, 0, LEXERROR);
37370 OTPAIR(31, ':', 0, 0, LEXISNT);
37380 ()+01*)
37390 (*+25() (*CDC CODE*)
37400 OTPAIR( 0, '+', 37, 0, LEXPLUS);
37410 OTPAIR( 1, '-', 15, 0, LEXMINUS);
37420 OTPAIR( 2, '*', 45, 0, LEXTIMES);
37430 OTPAIR( 3, '/', 42, 0, LEXDIV);
37440 OTPAIR( 4, '(', 0, 0, LEXOPEN);
37450 OTPAIR( 5, ')', 0, 0, LEXCLOSE);
37460 OTPAIR( 6, ':', 27, 0, LEXCOLON);
37470 OTPAIR( 7, '=', 0, 0, LEXEQUAL);
37480 OTPAIR( 8, ':', 0, 0, LEXAGAIN);
37490 OTPAIR( 9, ',', 0, 0, LEXCOMMA);
37500 OTPAIR(10, '=', 0, 0, LEXLE);
37510 OTPAIR(11, '#', 0, 0, LEXCO2);
37520 OTPAIR(12, '[', 0, 0, LEXSUBB);
37530 OTPAIR(13, ']', 0, 0, LEXBUSB);
37540 OTPAIR(14, '%', 32, 0, LEXOVER);
37550 OTPAIR(15, ':', 16, 0, LEXERROR);
37560 OTPAIR(16, '=', 0, 0, LEXMNAB);
37570 (*-51()
37580 OTPAIR(17, '!', 8, 0, LEXSTICK);
37590 ()-51*)
37600 (*+51()
37610 OTPAIR(18, '&', 8, 0, LEXSTICK);
37620 OTPAIR(19, '''', 0, 0, LEXUP1);
37630 ()+51*)
37640 OTPAIR(20, '=', 0, 0, LEXTMAB);
37650 OTPAIR(21, '<', 10, 0, LEXLT);
37660 OTPAIR(22, '>', 24, 0, LEXGT);
37670 OTPAIR(23, '@', 0, 0, LEXAT);
37680 OTPAIR(24, '=', 0, 0, LEXGE);
37690 (*-51()
37700 OTPAIR(25, '^', 0, 0, LEXUP1);
37710 ()-51*)
37720 OTPAIR(26, ';', 0, 0, LEXSEMIC);
37730 OTPAIR(27, '=', 28, 29, LEXBECOM);
37740 OTPAIR(28, ':', 0, 0, LEXIS);
37750 OTPAIR(29, '/', 30, 0, LEXERROR);
37760 OTPAIR(30, '=', 31, 0, LEXERROR);
37770 OTPAIR(31, ':', 0, 0, LEXISNT);
37780 ()+25*)
37790 (*-01() (*ASCII*)
37800 (*-25()
37810 OTPAIR( 0, '!', 1, 0, LEXSTICK); (*!*)
37820 OTPAIR( 1, ':', 0, 0, LEXAGAIN); (*!:*)
37830 OTPAIR( 2, '#', 0, 0, LEXCO2 ); (*#*)
37840 OTPAIR( 3, '[', 0, 0, LEXSUBB ); (*[*)
37850 OTPAIR( 4, '\', 0, 0, LEXSTICK); (*STICK*)
37860 OTPAIR( 5, ']', 0, 0, LEXBUSB ); (*]*)
37870 OTPAIR( 6, '^', 0, 0, LEXUP1 ); (*^*)
37880 OTPAIR( 7, '(', 0, 0, LEXOPEN ); (*(*)
37890 OTPAIR( 8, ')', 0, 0, LEXCLOSE); (*)*)
37900 OTPAIR( 9, '*', 45, 0, LEXTIMES); (***)
37910 OTPAIR(10, '+', 37, 0, LEXPLUS ); (*+*)
37920 OTPAIR(11, ',', 0, 0, LEXCOMMA); (*,*)
37930 OTPAIR(12, '-', 21, 0, LEXMINUS); (*-*)
37940 OTPAIR(13, '=', 0, 0, LEXLE ); (*<=*)
37950 OTPAIR(14, '/', 42, 0, LEXDIV ); (* / *)
37960 OTPAIR(15, '=', 16, 17, LEXBECOM);(*:=*)
37970 OTPAIR(16, ':', 0, 0, LEXIS ); (*:=:*)
37980 OTPAIR(17, '/', 18, 0, LEXERROR);
37990 OTPAIR(18, '=', 19, 0, LEXERROR);
38000 OTPAIR(19, ':', 0, 0, LEXISNT ); (*:/=:*)
38010 OTPAIR(20, '=', 0, 0, LEXTMAB ); (**:=*)
38020 OTPAIR(21, ':', 22, 0, LEXERROR);
38030 OTPAIR(22, '=', 0, 0, LEXMNAB ); (*-:=*)
38040 OTPAIR(23, '%', 32, 0, LEXOVER ); (*%*)
38050 (*SPARE 24*)
38060 OTPAIR(25, ':', 15, 0, LEXCOLON); (*:*)
38070 OTPAIR(26, ';', 0, 0, LEXSEMIC); (*;*)
38080 OTPAIR(27, '<', 13, 0, LEXLT ); (*<*)
38090 OTPAIR(28, '=', 0, 0, LEXEQUAL); (*=*)
38100 OTPAIR(29, '>', 30, 0, LEXGT ); (*>*)
38110 OTPAIR(30, '=', 0, 0, LEXGE ); (*>=*)
38120 OTPAIR(31, '@', 0, 0, LEXAT ); (*@*)
38130 ()-25*)
38140 ()-01*)
38150 OTPAIR(32, '*', 33, 35, LEXMOD) ; (*%**)
38160 OTPAIR(33, ':', 34, 0, LEXERROR);
38170 OTPAIR(34, '=', 0, 0, LEXMDAB ); (*%*:=*)
38180 OTPAIR(35, ':', 36, 0, LEXERROR);
38190 OTPAIR(36, '=', 0, 0, LEXOVAB ); (*%:=*)
38200 OTPAIR(37, '=', 38, 39, LEXERROR);
38210 OTPAIR(38, ':', 0, 0, LEXPLTO ); (*+=:*)
38220 OTPAIR(39, ':', 40, 41, LEXERROR);
38230 OTPAIR(40, '=', 0, 0, LEXPLAB ); (*+:=*)
38240 OTPAIR(41, '*', 0, 0, LEXPLITM); (*+**)
38250 OTPAIR(42, '=', 0, 43, LEXNE ); (*/=*)
38260 OTPAIR(43, ':', 44, 0, LEXERROR);
38270 OTPAIR(44, '=', 0, 0, LEXDVAB ); (*/:=*)
38280 OTPAIR(45, '*', 0, 46, LEXUP2 ); (****)
38290 OTPAIR(46, ':', 20, 0, LEXERROR);
38300 END;
38310 PROCEDURE BOLDWORDS;
38320 BEGIN
38330 INTAB(LEXATB , 'AT ', LXVAT);
38340 INTAB(LEXBEGIN , 'BEGIN ', LXVBEGIN);
38350 INTAB(LEXBY , 'BY ', LXVBY);
38360 INTAB(LEXCASE , 'CASE ', LXVCASE);
38370 INTAB(LEXCO , 'CO ', LXVCMMENT);
38380 INTAB(LEXCMMENT, 'COMMENT ', LXVCMMENT);
38390 INTAB(LEXDO , 'DO ', LXVDO);
38400 INTAB(LEXELIF , 'ELIF ', LXVELIF);
38410 INTAB(LEXELSE , 'ELSE ', LXVELSE);
38420 INTAB(LEXEMPTY , 'EMPTY ', LXVERROR);
38430 INTAB(LEXEND , 'END ', LXVEND);
38440 INTAB(LEXESAC , 'ESAC ', LXVESAC);
38450 INTAB(LEXEXIT , 'EXIT ', LXVEXIT);
38460 INTAB(LEXFALSE , 'FALSE ', LXVBOOLDEN);
38470 INTAB(LEXFI , 'FI ', LXVFI);
38480 INTAB(LEXFLEX , 'FLEX ', LXVERROR);
38490 INTAB(LEXFOR , 'FOR ', LXVFOR);
38500 INTAB(LEXFROM , 'FROM ', LXVFROM);
38510 INTAB(LEXGO , 'GO ', LXVGO);
38520 INTAB(LEXGOTO , 'GOTO ', LXVGOTO);
38530 INTAB(LEXHEAP , 'HEAP ', LXVHEAP);
38540 INTAB(LEXIF , 'IF ', LXVIF);
38550 INTAB(LEXIN , 'IN ', LXVIN);
38560 INTAB(LEXISB , 'IS ', LXVIDTY);
38570 INTAB(LEXISNTB , 'ISNT ', LXVIDTY);
38580 INTAB(LEXLOC , 'LOC ', LXVLOC);
38590 INTAB(LEXLONG , 'LONG ', LXVLONG);
38600 INTAB(LEXMODE , 'MODE ', LXVMODE);
38610 INTAB(LEXNIL , 'NIL ', LXVNIL);
38620 INTAB(LEXOD , 'OD ', LXVOD);
38630 INTAB(LEXOF , 'OF ', LXVOF);
38640 INTAB(LEXOP , 'OP ', LXVOP);
38650 INTAB(LEXOUSE , 'OUSE ', LXVOUSE);
38660 INTAB(LEXOUT , 'OUT ', LXVOUT);
38670 INTAB(LEXPAR , 'PAR ', LXVERROR);
38680 INTAB(LEXPR , 'PR ', LXVPRAGMAT);
38690 INTAB(LEXPRAGMAT, 'PRAGMAT ', LXVPRAGMAT);
38700 INTAB(LEXPRIO , 'PRIO ', LXVPRIO);
38710 INTAB(LEXPROC , 'PROC ', LXVPROC);
38720 INTAB(LEXREF , 'REF ', LXVREF);
38730 INTAB(LEXSEMA , 'SEMA ', LXVERROR);
38740 INTAB(LEXSHORT , 'SHORT ', LXVSHORT);
38750 INTAB(LEXSKIP , 'SKIP ', LXVSKIP);
38760 INTAB(LEXSTRUCT , 'STRUCT ', LXVSTRUCT);
38770 INTAB(LEXTHEN , 'THEN ', LXVTHEN);
38780 INTAB(LEXTO , 'TO ', LXVTO);
38790 INTAB(LEXTRUE , 'TRUE ', LXVBOOLDEN);
38800 INTAB(LEXUNION , 'UNION ', LXVERROR);
38810 INTAB(LEXVOID , 'VOID ', LXVVOID);
38820 INTAB(LEXWHILE , 'WHILE ', LXVWHILE);
38830 END;
38840 ()+81*)
38850 (*+84()
38860 PROCEDURE INITMODES;
38870 CONST SIMPLE=FALSE; PILE=TRUE; UNDRESSED=FALSE; DRESSED=TRUE; IO=TRUE;
38880 NOIO=FALSE; O=FALSE; SCOPE=TRUE;
38890 VAR I: INTEGER;
38900 PRFB: MODE;
38910 PLX: PLEX; LXEM: LXM; LX: LXM;
38920 PROCEDURE MDVVAL(VAR V: MDM; ID: MDIDTYPE; PILE, DRESSED, IO, SCOPE: BOOLEAN; LENGTH: INTEGER);
38930 (*+02() (*-25() VAR CLEAR: RECORD CASE BOOLEAN OF
38940 TRUE: (V:MDM); FALSE: (A: ARRAY[1..MODE1SIZE] OF INTEGER) END
38950 I: INTEGER; ()-25*) ()+02*)
38960 BEGIN
38970 (*+02() (*-25() WITH CLEAR DO FOR I:= 1 TO MODE1SIZE DIV SZWORD DO A[I] := 0;
38980 V := CLEAR.V;
38990 ()-25*) ()+02*)
39000 WITH V DO
39010 BEGIN MDID := ID; MDLEN := LENGTH;
39020 MDDEPROC := FALSE; MDRECUR := FALSE;
39030 MDDRESSED := DRESSED; MDIO := IO; MDPILE := PILE; MDSCOPE := SCOPE; MDCNT := 0
39040 END
39050 END;
39060 PROCEDURE MDVAR(VAR V: MODE; MDV: MDM);
39070 BEGIN ENEW(V, MODE1SIZE); V^.MDV := MDV END;
39080 PROCEDURE MDIND(TAG: ALFA; M: MODE);
39090 VAR LEX: PLEX; STB: PSTB;
39100 BEGIN
39110 INTAB(LEX,TAG,LX);
39120 LEX^.LXV.LXPMD := M
39130 END;
39140 PROCEDURE PUTFIELD(M: MODE; L: PLEX);
39150 BEGIN
39152 SRSEMP := SRSEMP+2;
39154 SRSTK[SRSEMP-1].MD := M;
39156 SRSTK[SRSEMP].LEX := L ;
39158 END;
39160 (**)
39170 BEGIN
39180 REFL := NIL; ROWL := NIL; PROCL := NIL; PASCL := NIL; STRUCTL := NIL;
39190 MDVVAL(MDVINT , MDIDINT , SIMPLE, O , IO , O , SZINT);
39200 MDVVAL(MDVLINT , MDIDLINT , SIMPLE, UNDRESSED, IO , O , SZLONG);
39210 MDVVAL(MDVREAL , MDIDREAL , SIMPLE, O , IO , O , SZREAL);
39220 MDVVAL(MDVLREAL , MDIDLREAL , SIMPLE, UNDRESSED, IO , O , 2*SZREAL);
39230 MDVVAL(MDVCHAR , MDIDCHAR , SIMPLE, O , IO , O , SZWORD);
39240 MDVVAL(MDVBITS , MDIDBITS , SIMPLE, O , IO , O , SZINT);
39250 MDVVAL(MDVBYTES , MDIDBYTES , SIMPLE, O , IO ,O , SZINT);
39260 MDVVAL(MDVSTRNG , MDIDSTRNG , PILE , DRESSED , IO , O , SZADDR);
39270 MDVVAL(MDVBOOL , MDIDBOOL , SIMPLE, O , IO , O , SZWORD);
39280 MDVVAL(MDVCHAN , MDIDCHAN , SIMPLE, O , NOIO, O , SZPROC);
39290 MDVVAL(MDVCOVER , MDIDCOVER , PILE , DRESSED , NOIO, O , SZADDR);
39300 MDVVAL(MDVVOID , MDIDVOID , O , O , NOIO, O , 0);
39310 MDVVAL(MDVSKIP , MDIDSKIP , O , O , NOIO, O , 0);
39320 MDVVAL(MDVJUMP , MDIDJUMP , O , O , NOIO, O , 0);
39330 MDVVAL(MDVNIL , MDIDNIL , O , O , NOIO, O , 0);
39340 MDVVAL(MDVOUT , MDIDOUT , O , O , O , O , SZWORD+SZINT);
39350 MDVVAL(MDVIN , MDIDIN , O , O , O , SCOPE, 2*SZWORD+SZADDR);
39360 MDVVAL(MDVOUTB , MDIDOUTB , O , O , O , O , SZWORD+SZINT);
39370 MDVVAL(MDVINB , MDIDINB , O , O , O , SCOPE, SZWORD+SZADDR);
39380 MDVVAL(MDVNUMBER, MDIDNUMBER, O , O , O , O , SZWORD+SZINT);
39390 MDVVAL(MDVROWS , MDIDROWS , PILE , DRESSED , O , O , SZADDR);
39400 MDVVAL(MDVBNDS , MDIDBNDS , PILE , O , NOIO, O , SZADDR);
39410 MDVVAL(MDVABSENT, MDIDABSENT, SIMPLE, O , O , O , SZWORD);
39420 (*CAN BE USED TO MANUFACTURE UN-USER-FORGEABLE STRUCTURES*)
39430 MDVVAL(MDVERROR , MDIDERROR , SIMPLE, O , O , O , SZWORD);
39440 MDVVAL(MDVPROC , MDIDPROC , PILE , DRESSED , NOIO, SCOPE, SZADDR);
39450 MDVVAL(MDVREF , MDIDREF , PILE , DRESSED , NOIO, SCOPE, SZADDR);
39460 MDVVAL(MDVSTRUCT, MDIDSTRUCT, PILE , UNDRESSED, NOIO, SCOPE, 0);
39470 MDVVAL(MDVROW , MDIDROW , PILE , O , NOIO, SCOPE, 0);
39480 MDVVAL(MDVPASC , MDIDPASC , SIMPLE, O , NOIO, O , SZPROC);
39500 (*SET UP MD VALUES*)
39510 MDVAR(MDINT , MDVINT);
39520 MDVAR(MDLINT , MDVLINT);
39530 MDVAR(MDBITS , MDVBITS);
39540 MDVAR(MDBYTES , MDVBYTES);
39550 MDVAR(MDREAL , MDVREAL);
39560 MDVAR(MDLREAL , MDVLREAL);
39570 MDVAR(MDBOOL , MDVBOOL);
39580 MDVAR(MDCHAN , MDVCHAN);
39590 MDVAR(MDCHAR , MDVCHAR);
39600 MDVAR(MDSTRNG, MDVSTRNG);
39610 MDVAR(MDCOVER , MDVCOVER);
39620 MDVAR(MDVOID , MDVVOID);
39630 MDVAR(MDSKIP , MDVSKIP);
39640 MDVAR(MDJUMP , MDVJUMP);
39650 MDVAR(MDNIL , MDVNIL);
39660 MDVAR(MDOUT , MDVOUT);
39670 MDVAR(MDIN , MDVIN);
39680 MDVAR(MDOUTB , MDVOUTB);
39690 MDVAR(MDINB , MDVINB);
39700 MDVAR(MDNUMBER, MDVNUMBER);
39710 MDVAR(MDROWS , MDVROWS);
39720 MDVAR(MDBNDS , MDVBNDS);
39730 MDVAR(MDABSENT, MDVABSENT);
39740 MDVAR(MDROUT , MDVPROC);
39750 MDVAR(MDERROR , MDVERROR);
39760 INTAB(PLX,'GO ',LXEM);
39770 PLX^.LXV.LXPMD := MDJUMP;
39780 INTAB(PLX,'GOTO ',LXEM);
39790 PLX^.LXV.LXPMD := MDJUMP;
39800 INTAB(PLX,'IS ',LXEM);
39810 PLX^.LXV.LXP := 0;
39820 INTAB(PLX,'ISNT ',LXEM);
39830 PLX^.LXV.LXP := 1;
39840 INTAB(PLX,'NIL ',LXEM);
39850 PLX^.LXV.LXPMD := MDNIL;
39860 INTAB(PLX,'SKIP ',LXEM);
39870 PLX^.LXV.LXPMD := MDSKIP;
39880 INTAB(PLX,'VOID ',LXEM);
39890 PLX^.LXV.LXPMD := MDVOID;
39900 MDREFERROR := FINDREF(MDERROR);
39910 PRCBNDS := DEFPRC0(MDBNDS, PROC);
39920 PRCERROR := DEFPRC0(MDERROR, PROC);
39930 SRSEMP := -1; SRSUBP := 0; SUBSAVE;
39940 PUTFIELD(MDREAL, DEFTAG('RE '));
39950 PUTFIELD(MDREAL, DEFTAG('IM '));
39960 FINSTRUCT(2); MDCOMPL := SRSTK[SRSEMP].MD;
39970 (*MDLCOMPL OUGHT TO BE DONE ONE OF THESE DAYS, TOO*)
39980 MDFILE := NIL; (*BECAUSE IT IS TO BE A RECURSIVE MODE*)
39990 PRFB := DEFPRC1(FINDREF(MDFILE), MDBOOL, PROC);
40000 SRSEMP := -1; SRSUBP := 0; SUBSAVE;
40010 FOR I := 1 TO 4 DO
40020 PUTFIELD(PRFB, LEXALEPH);
40030 PUTFIELD(MDCOVER, LEXALEPH);
40040 FOR I := 1 TO SZTERM DIV SZINT DO
40050 PUTFIELD(MDINT, LEXALEPH);
40060 FINSTRUCT(5+SZTERM DIV SZINT); MDFILE := SRSTK[SRSEMP].MD;
40070 PRCVF := DEFPRC1(FINDREF(MDFILE), MDVOID, PROC);
40080 PASCVF := DEFPRC1(FINDREF(MDFILE), MDVOID, PASC);
40090 ROWBOOL := FINDROW(MDBOOL,1);
40100 ROWCHAR := FINDROW(MDCHAR,1);
40110 ROWIN := FINDROW(MDIN,1);
40120 ROWINB := FINDROW(MDINB,1);
40130 REFSTRNG := FINDREF(MDSTRNG);
40140 (*+54()
40150 SRSEMP := -1; SRSUBP := 0; SUBSAVE;
40160 PUTFIELD(MDINT, DEFTAG('ALEPH '));
40170 PUTFIELD(MDABSENT, LEXALEPH);
40180 FINSTRUCT(2); MDEXC := SRSTK[SRSEMP].MD;
40190 ()+54*)
40200 (*SET UP STANDARD-PRELUDE MODE-INDICATIONS*)
40210 LXVVAL(LX,LXIOPRDR,0,2,08);
40220 MDIND('INT ', MDINT);
40230 MDIND('BITS ', MDBITS);
40240 MDIND('BYTES ', MDBYTES);
40250 MDIND('REAL ', MDREAL);
40260 MDIND('BOOL ', MDBOOL);
40270 MDIND('CHANNEL ', MDCHAN);
40280 MDIND('CHAR ', MDCHAR);
40290 MDIND('STRING ', MDSTRNG);
40300 MDIND('FILE ', MDFILE);
40310 MDIND('COMPL ', MDCOMPL);
40320 (*+54() MDIND('EXCEPTION ', MDEXC); ()+54*)
40330 MODEID[MDIDINT]:=0;
40340 MODEID[MDIDLINT]:=1;
40350 MODEID[MDIDREAL]:=2;
40360 MODEID[MDIDLREAL]:=3;
40370 MODEID[MDIDCHAR]:=6;
40380 MODEID[MDIDBITS]:=9;
40390 MODEID[MDIDBYTES]:=10;
40400 MODEID[MDIDSTRNG]:=7;
40410 MODEID[MDIDBOOL]:=8;
40420 MODEID[MDIDCHAN]:=-1;
40430 MODEID[MDIDCOVER]:=-1;
40440 MODEID[MDIDVOID]:=-1;
40450 MODEID[MDIDSKIP]:=-1;
40460 MODEID[MDIDJUMP]:=-1;
40470 MODEID[MDIDNIL]:=-1;
40480 MODEID[MDIDOUT]:=-1;
40490 MODEID[MDIDIN]:=-1;
40500 MODEID[MDIDOUTB]:=-1;
40510 MODEID[MDIDINB]:=-1;
40520 MODEID[MDIDNUMBER]:=-1;
40530 MODEID[MDIDROWS]:=-1;
40540 MODEID[MDIDBNDS]:=-1;
40550 MODEID[MDIDABSENT]:=-1;
40560 MODEID[MDIDPROC]:=11;
40570 MODEID[MDIDREF]:=-1;
40580 MODEID[MDIDSTRUCT]:=12; (*BUT NOT COMPL*)
40590 MODEID[MDIDROW]:=13;
40600 MODEID[MDIDPASC]:=14;
40620 XMODES[XINT] := MDINT;
40630 XMODES[XLINT] := MDLINT;
40640 XMODES[XREAL] := MDREAL;
40650 XMODES[XLREAL] := MDLREAL;
40660 XMODES[XCOMPL] := MDCOMPL;
40670 (*+61()
40680 XMODES[XLCOMPL] := MDLCOMPL;
40690 ()+61*)
40700 XMODES[XCHAR] := MDCHAR;
40710 XMODES[XSTRNG] := MDSTRNG;
40720 XMODES[XBOOL] := MDBOOL;
40730 XMODES[XBITS] := MDBITS;
40740 XMODES[XBYTES] := MDBYTES;
40750 END;
40760 (**)
40770 ()+84*)
40780 (**)
40790 BEGIN (*INITIALIZE*)
40800 (*+81()
40810 INITLEXES;
40820 MAKEPUSHTBL;
40830 (**)
40840 OTPAIRS;
40850 FOR I := 0 TO HTSIZE DO
40860 HT[I] := NIL;
40870 INPRAGMENT := FALSE;
40880 ENEW(LEXALEPH, LEX1SIZE); WITH LEXALEPH^ DO
40890 BEGIN LXV:=LXVTAG; LXCOUNT:=0; LXTOKEN:=TKTAG END;
40900 BOLDWORDS;
40910 ()+81*)
40920 (*+84() INITMODES; ()+84*)
40930 (*+84()
40940 ENEW(LEXONE, SZADDR+SZINT+LEX1SIZE); WITH LEXONE^ DO
40950 BEGIN LXV:=LXVPRDEN; LXCOUNT:= (SZADDR+SZINT) DIV SZWORD; LXTOKEN:=TKDENOT; LXDENRP:=1; LXDENMD:=MDINT END;
40960 ()+84*)
40970 END;
40980 (**)
40990 ()+83*)