Trailing-Edge
-
PDP-10 Archives
-
decuslib10-06
-
43,50417/pascal.pas
There are no other files named pascal.pas in the archive.
00010 (*$T-,S1300,R16*)
00020 (********************************************************************************
00030 *
00040 * DECSYSTEM-10 PASCAL COMPILER
00050 * ****************************
00060 *
00070 * (C) COPYRIGHT H.-H. NAGEL
00080 * INSTITUT FUER INFORMATIK
00090 * DER UNIVERSITAET HAMBURG
00100 * SCHLUETERSTRASSE 70
00110 * 2000 HAMBURG-13
00120 * GERMANY
00130 * 1976
00140 *
00150 * MAR-73 SYNTAX ANALYSIS INCLUDING ERROR HANDLING,
00160 * CHECKS BASED ON DECLARATIONS AND ADDRESS-
00170 * AND CODE-GENERATION FOR A HYPOTHETICAL
00180 * STACK COMPUTER BY URS AMMAN
00190 *
00200 * FACHGRUPPE COMPUTER-WISSENSCHAFTEN
00210 * EIDG. TECHNISCHE HOCHSCHULE
00220 * CH-8006 ZUERICH
00230 *
00240 * DEC-73 CODE-GENERATION FOR DECSYSTEM-10
00250 * BY C.O. GROSSE-LINDEMANN, F.W. LORENZ,
00260 * H.H. NAGEL AND P.J. STIRL /1/
00270 *
00280 * JUL-74 IMPLEMENTATION OF NEW FEATURES BY STUDENTS
00290 * DURING A PRACTICAL PROGRAMMING COURSE /2/
00300 *
00310 * DEC-74 MODIFICATIONS TO GENERATE RELOCATABLE
00320 * LINK-10 OBJECT-CODE BY E. KISICKI
00330 *
00340 * DEC-74 DEBUG SYSTEM /5/
00350 * BY P. PUTFARKEN
00360 *
00370 * APR-76 POST-MORTEM DUMP FACILITY /6/
00380 * BY B. NEBEL AND B. PRETSCHNER
00390 *
00400 * AUG-76 IMPROVEMENTS AND ADAPTATION TO STANDARD-PASCAL
00410 * AND CDC 6000-3.4. PASCAL AS PRESENTED IN
00420 * "PASCAL - USER MANUAL AND REPORT" /3,4,7/
00430 * BY E.KISICKI
00440 *
00450 * NOV-76 FORMAL PROCEDURE/FUNCTION PARAMETERS
00460 * AND CORRECTION OF ERRORS
00470 * BY H. LINDE
00480 *
00490 * INSTITUT FUER INFORMATIK
00500 * SCHLUETERSTRASSE 70
00510 * D-2000 HAMBURG 13
00520 *
00530 * /1/ F.W. LORENZ, P.J. STIRL
00540 * UEBERTRAGUNG EINES PASCAL-COMPILERS AUF DAS DECSYSTEM-10
00550 * DIPLOMARBEIT, IFI, HH, 74
00560 *
00570 * C.O. GROSSE-LINDEMANN, H.H. NAGEL
00580 * POSTLUDE TO A PASCAL-COMPILER BOOTSTRAP
00590 * BERICHT NR. 11, IFI, HH, 74
00600 *
00610 * C.O. GROSSE-LINDEMANN
00620 * WEITERFUEHRENDE ARBEITEN AM PASCAL-COMPILER ZUR
00630 * STEIGERUNG DER BENUTZERFREUNDLICHKEIT
00640 * DIPLOMARBEIT, IFI, HH, 75
00650 *
00660 * /2/ ERWEITERUNG VON SPRACHDEFINITION, COMPILER UND LAUFZEIT-
00670 * UNTERSTUETZUNG BEI PASCAL/ ERGEBNISSE EINES PRAKTIKUMS
00680 * IM INFORMATIK GRUNDSTUDIUM
00690 * STUD. BEITRAEGE BEARBEITET VON H.H. NAGEL
00700 * MITTEILUNGEN NR. 16, IFI, HH, 75
00710 *
00720 * /3/ H.H. NAGEL
00730 * PASCAL FOR DECSYSTEM-10/ EXPERIENCES AND FURTHER PLANS
00740 * MITTEILUNGEN NR. 21, IFI, HH, NOV-75
00750 *
00760 * /4/ KATHLEEN JENSEN, NIKLAUS WIRTH
00770 * PASCAL USER MANUAL AND REPORT
00780 * LECTURE NOTES IN COMPUTER SCIENCE VOL 18
00790 * SPRINGER-VERLAG BERLIN-HEIDELBERG-NEW YORK
00800 *
00810 * /5/ P. PUTFARKEN
00820 * TESTHILFEN FUER PASCAL PROGRAMME
00830 * DIPLOMARBEIT, IFI, HH, 76
00840 *
00850 * /6/ B. NEBEL, B. PRETSCHNER
00860 * ERWEITERUNG DES DECSYSTEM-10 PASCAL COMPILERS UM
00870 * EINE MOEGLICHKEIT ZUR ERZEUGUNG EINES POST-MORTEM DUMP
00880 * MITTEILUNGEN NR. 34 , IFI, HH, JUN-76
00890 *
00900 * /7/ E. KISICKI, H.H. NAGEL
00910 * PASCAL FOR THE DECSYSTEM-10
00920 * MITTEILUNGEN NR. , IFI, HH, NOV-76
00930 *
00940 ********************************************************************************)
00950
00960
00970
00980
00990 (********************************************************************************
01000 *
01010 * HINTS TO INTERPRET ABBREVIATIONS
01020 *
01030 * BRACK : BRACKET "[ ]" IX : INDEX
01040 * C : CURRENT L : LOCAL
01050 * C : COUNTER L : LEFT
01060 * CST : CONSTANT PARENT : "( )"
01070 * CTP : IDENTIFIER POINTER P/PTR : POINTER
01080 * EL : ELEMENT P/PROC : PROCEDURE
01090 * F : FORMAL R : RIGHT
01100 * F : FIRST S : STRING
01110 * F : FILE SY : SYMBOL
01120 * F/FUNC : FUNCTION V : VARIABLE
01130 * G : GLOBAL V : VALUE
01140 * ID : IDENTIFIER BP : BYTEPOINTER
01150 * REL : RELATIVE REL : RELOCATION
01160 *
01170 ********************************************************************************)
01180
01190
01200
01210
01220 (********************************************************************************
01230 *
01240 * FILES NECESSARY TO IMPLEMENT THE PASCAL COMPILER
01250 *
01260 * SOURCE-CODE
01270 *
01280 * PASCAL.PAS : PASCAL
01290 *
01300 * LIBPAS.PAS : CCL (OPTION, GETOPTION, GETFILENAME, GETPARAMETER)
01310 * DDT (DEBUG)
01320 * STATUS (GETSTATUS)
01330 * READ (READIRANGE, READCRANGE, READRRANGE, READSCALAR,
01340 * READISET, READCSET, READDSET)
01350 * WRITE (WRTSCALAR, WRTISET, WRTDSET,WRTCSET)
01360 * UNDEFINED (UNDEFINED)
01370 *
01380 * LIBMAC.MAC : MACRO RUNTIME SUPPORT
01390 *
01400 * CROSS.PAS : CROSS REFERENCE WITHOUT CODE-GENERATION
01410 *
01420 *
01430 * OBJECT-CODE
01440 *
01450 * PASLIB.REL : SEARCH LIBRARY CONTAINING LIBPAS.REL
01460 * AND LIBMAC.REL
01470 *
01480 *
01490 * EXECUTABLE-CODE
01500 *
01510 * PASCAL.LOW : PASCAL LOW-SEGMENT
01520 * PASCAL.SHR : PASCAL SHARED HIGH-SEGMENT
01530 * CROSS.LOW : CROSS LOW-SEGMENT
01540 * CROSS.SHR : CROSS SHARED HIGH-SEGMENT
01550 *
01560 *
01570 * INFORMATION AND MAINTENANCE
01580 *
01590 * PASCAL.DOC : A GUIDE FOR THE DECSYSTEM-10 PASCAL DIALECT
01600 *
01610 *******************************************************************************)
01620
01630
01640
01650
01660 (*******************************************************************************
01670 *
01680 * HOW TO GENERATE A NEW PASCAL COMPILER
01690 *
01700 * 1) CHANGES TO THE RUNTIME-SUPPORT
01710 *
01720 * LET LIBPAS.PAS AND LIBMAC.MAC BE YOUR MODIFIED RUNTIME SUPPORT
01730 *
01740 * .COMPILE LIBMAC.MAC/LIST
01750 * ...
01760 * .COMPILE LIBPAS.PAS(EXTERN/NOCHECK)/LIST
01770 * PASCAL: LIBPAS [CCL: OPTION, ... ]
01780 * ...
01790 * PASCAL: LIBPAS [DEBUG: DEBUG]
01800 * ...
01810 * EXIT
01820 * .RENAME PASLIB.OLD=PASLIB.REL
01830 * .R FUDGE2
01840 * *PASLIB=LIBPAS,LIBMAC/A$
01850 * *PASLIB=PASLIB/X$
01860 * *^C
01870 *
01880 *
01890 * 2) CHANGES TO THE COMPILER
01900 *
01910 * LET PASCAL.PAS BE YOUR NEW COMPILER SOURCE
01920 * (DO NOT FORGET TO CHANGE THE "HEADER" AND CHECK FOR THE CORRECT
01930 * FILE DESCRIPTIONS FOR PASLIB AND CROSS IN INITPROCEDURE
01940 * "SEARCH LIBRARIES")
01950 *
01960 * .EXECUTE P1=PASCAL(NOCHECK/CODESIZE:1300/RUNCORE:16)
01970 * PASCAL: P1 [PASCAL]
01980 * 0 ERROR(S) DETECTED
01990 * ...
02000 * LINK: LOADING
02010 * [...P1 EXECUTION]
02020 * OBJECT= P2.REL/CODESIZE:1300/RUNCORE:16/NOCHECK/EXECUTE/CREF
02030 * LIST= <CR>
02040 * SOURCE= PASCAL.PAS
02050 * PASCAL: P2 [PASCAL]
02060 * 0 ERROR(S) DETECTED
02070 * ...
02080 * CROSS: P2
02090 * NO ERROR IN BLOCKSTRUCTURE
02100 * LINK: LOADING
02110 * [...P2 EXECUTION]
02120 * OBJECT= P3.REL/CODESIZE:1300/RUNCORE:16/NOCHECK
02130 * LIST= <CR>
02140 * SOURCE= PASCAL.PAS
02150 * PASCAL: P3 [PASCAL]
02160 * 0 ERROR(S) DETECTED
02170 * ...
02180 * EXIT
02190 * .R FILCOM
02200 * *TTY:=P2.REL,P3.REL
02210 * NO DIFFERENCES ENCOUNTERED
02220 * *^C
02230 * .DELETE P1.*,P3.*
02240 * .RENAME PASCAL.*=P2.*
02250 * .RENAME PASCAL.OLD=PASCAL.PAS
02260 * .RENAME PASCAL.PAS=PASCAL.NEW
02270 * .PRINT PASCAL.CRL
02280 * .LOAD PASCAL/MAP
02290 * .SSAVE PASCAL
02300 *
02310 *
02320 * 3) CHANGES TO CROSS
02330 *
02340 * .LOAD CROSS(NOCHECK)/LIST/COMPILE
02350 * ...
02360 * EXIT
02370 * .SSAVE CROSS
02380 *
02390 ********************************************************************************)
02400
02410
02420 (*******************************************************************************
02430 *
02440 * KNOWN BUGS AND RESTRICTIONS
02450 *
02460 * 1) IF THE DEVICE-PARAMETER FOR RESET/REWRITE IS NOT
02470 * DEFAULTED, NEW BUFFERS ARE ALLOCATED WITHOUT REGARD
02480 * TO THE FACT THAT THE NEW DEVICE COULD BE THE SAME AS THE
02490 * THE OLD DEVICE.
02500 *
02510 * 2) COMPARISON OF VARIABLES OF TYPE PACKED RECORD OR
02520 * PACKED ARRAY MAY CAUSE TROUBLE IF THESE VARIABLES APPEAR
02530 * IN A VARIANT PART OR WERE ASSIGNED FROM A VARIANT PART
02540 *
02550 * 3) TOO LARGE ARRAY DIMENSIONS (F.E. MININT..MAXINT) CAUSE
02560 * ARITHMETIC OVERFLOW INSTEAD OF AN APPROPRIATE ERROR
02570 * MESSAGE
02580 *
02590 * 4) ARRAYS OF FILE AND RECORDS WITH FILES AS COMPONENTS
02600 * ARE NOT IMPLEMENTED
02610 *
02620 * 5) SEGMENTED FILES ARE NOT IMPLEMENTED
02630 *
02640 * 6) CALL OF EXTERNAL COBOL OR ALGOL PROCEDURES IS
02650 * NOT IMPLEMENTED
02660 *
02670 *
02680 ********************************************************************************)
02690
02700
02710
02720
02730 PROGRAM PASCAL;
02740
02750 LABEL
02760 0;
02770
02780 CONST
02790
02800 (* NIL = 377777B; *)
02810 (* ALFALENGTH = 10; *)
02820 (* MININT = 400000000000B; *)
02830 (* MAXINT = 377777777777B; *)
02840 (* MAXREAL = 1.7014118432E+38; *)
02850 (* SMALLREAL= 1.4693680107E-39; *)
02860
02870 HEADER = 'PASCAL VERSION FROM 30-DEC-76';
02880
02890 (*COMPILER PARAMETERS:*)
02900 (**********************)
02910
02920 DISPLIMIT = 20; (* MAXIMUM DECLARATION-SCOPE NESTING *)
02930 MAX_FILE = 12; (* MAXIMUM NUMBER OF USER-DECLARED FILES *)
02940 MAX_CHANNEL = 15; (* HIGHEST DATA-CHANNEL ASSIGNED TO A FILE *)
02950 MAXLEVEL = 10; (* MAXIMUM PROC/FUNC LEVEL *)
02960 STRGLGTH = 120; (* MAXIMUM LENGTH FOR STRING-CONSTANT *)
02970 SIZEOFFILEBLOCK = 21; (* SIZE OF FILE CONTROL-BLOCK *)
02980 CIXMAX = 1000; (* STANDARD SIZE OF CODE-ARRAY *)
02990 MAXERR = 4; (* MAXIMUM OF ERRORS IN 1 SOURCE-LINE *)
03000 LABMAX = 9999; (* MAXIMUM VALUE OF A PROGRAM LABEL *)
03010 BITMAX = 36; (* NR. OF BITS OF 1 DECSYSTEM-10 MACHINE-WORD *)
03020 HWCSTMAX = 377777B; (* MAXIMUM POS. INTEGER IN HALFWORD *)
03030 ENTRYMAX = 20; (* MAXIMUM ENTRIES INTO EXTERN PROGRAM *)
03040 EXTPFMAX = 20; (* MAXIMUM OF EXTERN STANDARD PROC/FUNC *)
03050 STDMAX = 36; (* NR. OF STANDARD NAMES *)
03060 RSWMAX = 42; (* NR. OF RESERVED WORDS *)
03070 RSWMAXP1 = 43; (* RESERVED WORDS PLUS 1 *)
03080 STDCHCNTMAX = 132; (* MAXIMUM OF CHARS IN SOURCE-LINE *)
03090 BASEMAX = 71; (* MAXIMUM VALUE OF A SET ELEMENT *)
03100 OFFSET = 40B; (* USED FOR SETS OF CHARACTERS *)
03110 BUFFER_SIZE = 200B; (* DECSYSTEM-10 DISK-BUFFER SIZE *)
03120 TAGFMAX = 5; (* MAX. NR. OF VARIANTS ALLOWED IN CALL OF "NEW" *)
03130 JUMP_MAX = 50; (* MAX. NR. OF LABEL DECLARATIONS *)
03140
03150 REG0 = 0; (* WORKREGISTER *)
03160 REG1 = 1; (* WORKREGISTER (USED FOR ARRAY-BYTEPOINTERS) *)
03170 REGIN = 1; (* TO INITIALIZE REGC *)
03180 STDPARREGCMAX = 6; (* HIGHEST REGISTER USED FOR PARAMETERS *)
03190 WITHIN = 12; (* FIRST REGISTER FOR WITH-STACK *)
03200 NEWREG = 13; (* LAST PLACE OF NEW-STACK *)
03210 BASIS = 14; (* ADDR OF CURRENT ACTIVATION-REC, STATIC AND DYNAMIC LINK *)
03220 TOPP = 15; (* FIRST FREE WORD IN DATA-STACK *)
03230
03240 JBREL = 44B; (* LOCATION OF (0,HIGHEST LEGAL LOW-SEG ADDRESS) *)
03250 JBSA = 120B; (* LOCATION OF (1ST UNUSED LOW-SEG ADDRESS,START-ADDRESS OF PROGRAM) *)
03260 JBFF = 121B; (* LOCATION OF (0,POINTER BEHIND LAST FILE-BUFFER) *)
03270 JBAPR = 125B; (* LOCATION OF (0,PC AFTER PROGRAM ERROR) *)
03280 JBDDT = 74B; (* LOCATION OF (LAST PASDDT-ADDR, PASDDT-ADDR + 2) *)
03290
03300 TTY_SIXBIT = 646471B; (* SIXBIT REPR. FOR 'TTY ' *)
03310 DSK_SIXBIT = 446353B; (* SIXBIT REPR. FOR 'DSK ' *)
03320 ASCII_MODE = 0; (* (SYSTEM-) FLAGS FOR ASCII-MODE *)
03330 BINARY_MODE = 14B; (* (SYSTEM-) FLAGS FOR BINARY-MODE *)
03340 TEXT_FILE = 0; (* (PASCAL-) FLAGS FOR "PACKED FILE OF (SUBRANGE OF) CHAR" = "TEXT" *)
03350 DATA_FILE = 1; (* (PASCAL-) FLAGS FOR OTHER FILES *)
03360
03370 DEBUG_SAVE = 0B; (* ADDR OF DEBUG-SYSTEM STACK *)
03380 DEBUG_STOP = 1B; (* PUSHJ INTO DEBUG ON "STOP" *)
03390 DEBUG_PAGEHEAD = 2B; (* START OF "STOP"-CHAIN *)
03400 DEBUG_STACKBOTTOM = 3B; (* 1ST WORD OF PROGRAM-STACK *)
03410 DEBUG_INITIALIZATION = 6B; (* PUSHJ INTO DEBUG-INITIALIZATION *)
03420 DEBUG_PROGRAMNAME = 7B; (* ADDR OF ADDR OF PROGRAMNAME *)
03430
03440 SYSTEM_LOW_START = 140B; (* LOC 0B..137B CONTAIN SYSTEM-INFO. *)
03450 SYSTEM_HIGH_START = 400010B; (* LOC 400000B..400007B CONTAIN SYSTEM-INFO. *)
03460
03470 LOW_START = 10B; (* LOC 0B..7B RESERVED FOR DEBUG-PROGR. *)
03480 HIGH_START = 400000B; (* START OF EXECUTABLE CODE *)
03490 MAXADDR = 777777B; (* HIGHEST LEGAL ADDRESS *)
03500
03510 ITEM_1 = 1; (* LINK ITEM 1: CODE *)
03520 ITEM_2 = 2; (* LINK ITEM 2: SYMBOLS *)
03530 ITEM_3 = 3; (* LINK ITEM 3: HIGHSEG *)
03540 ITEM_4 = 4; (* LINK ITEM 4: ENTRIES *)
03550 ITEM_5 = 5; (* LINK ITEM 5: LOW-/ HIGHSEGMENT BREAK *)
03560 ITEM_6 = 6; (* LINK ITEM 6: PROGRAM NAME *)
03570 ITEM_7 = 7; (* LINK ITEM 7: START ADDRESS *)
03580 ITEM_10 = 10B; (* LINK ITEM 10: INTERNAL REQUESTS *)
03590 ITEM_17 = 17B; (* LINK ITEM 17: LINK LIBRARIES *)
03600
03610 ENTRY_SYMBOL = 0; (* ENTRY SYMBOL FLAG *)
03620 GLOBAL_SYMBOL = 1; (* GLOBAL SYMBOL FLAG *)
03630 LOCAL_SYMBOL = 2; (* LOCAL SYMBOL FLAG *)
03640 SIXBIT_SYMBOL = 6; (* SIXBIT SYMBOL FLAG *)
03650 EXTERN_SYMBOL = 14B; (* EXTERN SYMBOL FLAG *)
03660
03670
03680 TYPE
03690
03700 (* INTEGER = MININT..MAXINT *)
03710 (* REAL = -MAXREAL..MAXREAL *)
03720 (* CHAR = ' '..'_' *)
03730 (* ASCII = NUL..DEL *)
03740 (* BOOLEAN = (FALSE,TRUE) *)
03750 (* TEXT = PACKED FILE OF CHAR *)
03760 (* ALFA = PACKED ARRAY[1..ALFALENGTH] OF CHAR *)
03770
03780 (*DESCRIBING:*)
03790 (*************)
03800
03810
03820 (*BASIC SYMBOLS*)
03830 (***************)
03840
03850 SYMBOL = (IDENT,INTCONST,REALCONST,STRINGCONST,NOTSY,MULOP,ADDOP,RELOP,
03860 LPARENT,RPARENT,LBRACK,RBRACK,COMMA,SEMICOLON,PERIOD,ARROW,
03870 COLON,BECOMES,LABELSY,CONSTSY,TYPESY,VARSY,FUNCTIONSY,
03880 PROCEDURESY,PACKEDSY,SETSY,ARRAYSY,RECORDSY,FILESY,FORWARDSY,
03890 BEGINSY,IFSY,CASESY,REPEATSY,WHILESY,FORSY,WITHSY,LOOPSY,
03900 GOTOSY,EXITSY,ENDSY,ELSESY,UNTILSY,OFSY,DOSY,TOSY,DOWNTOSY,
03910 EXTERNSY,PASCALSY,FORTRANSY,PROGRAMSY,
03920 THENSY,OTHERSY,INITPROCSY,SEGMENTSY,OTHERSSY);
03930
03940 OPERATOR = (NOOP,MUL,RDIV,ANDOP,IDIV,IMOD,PLUS,MINUS,OROP,
03950 LTOP,LEOP,GEOP,GTOP,NEOP,EQOP,INOP);
03960
03970 SETOFSYS = SET OF SYMBOL;
03980
03990 (*BASIC RANGE DEFINITIONS*)
04000 (*************************)
04010
04020 LEVRANGE = 0..MAXLEVEL;
04030 KEYRANGE = 0..77B;
04040 FILEFORMRANGE = 0..77B;
04050 FILEMODERANGE = 0..77B;
04060 ADDRRANGE = 0..MAXADDR;
04070 INSTRANGE = 0..677B;
04080 RADIXRANGE = 0..37777777777B;
04090 FLAGRANGE = 0..17B;
04100 BITRANGE = 0..BITMAX;
04110 ACRANGE = 0..15;
04120 IBRANGE = 0..1;
04130 CODERANGE = 0..HWCSTMAX;
04140 BITS5 = 0..37B;
04150 BITS6 = 0..77B;
04160 BITS7 = 0..177B;
04170 BITS12 = 0..7777B;
04180 BITS18 = 0..777777B;
04190 SETRANGE = 0..BASEMAX;
04200 JUMP_RANGE = 1..JUMP_MAX;
04210
04220 (*CONSTANTS*)
04230 (***********)
04240
04250 BPOINTER = PACKED RECORD
04260 SBITS,PBITS: BITRANGE;
04270 IBIT,DUMMYBIT: IBRANGE;
04280 IREG: ACRANGE;
04290 RELADDR: ADDRRANGE
04300 END;
04310
04320 CSTCLASS = (INT,REEL,PSET,STRD,STRG,BPTR);
04330
04340 CSP = ^ CONSTNT;
04350 CONSTNT = RECORD
04360 SELFCSP: CSP; NOCODE: BOOLEAN;
04370 CASE CCLASS: CSTCLASS OF
04380 INT : (INTVAL: INTEGER;
04390 INTVAL1:INTEGER (*TO ACCESS SECOND WORD OF PVAL*) );
04400 REEL: (RVAL: REAL);
04410 PSET: (PVAL: SET OF SETRANGE);
04420 STRD,
04430 STRG: (SLGTH: 0..STRGLGTH;
04440 SVAL: PACKED ARRAY [1..STRGLGTH] OF CHAR);
04450 BPTR: (BYTE: BPOINTER)
04460 END;
04470
04480 VALU = RECORD
04490 CASE INTEGER OF
04500 1: (IVAL: INTEGER);
04510 2: (VALP: CSP);
04520 3: (BYTE: BPOINTER)
04530 END;
04540
04550 (*DATA STRUCTURES*)
04560 (*****************)
04570
04580 STRUCTFORM = (SCALAR,SUBRANGE,POINTER,POWER,ARRAYS,RECORDS,FILES,TAGFWITHID,TAGFWITHOUTID,VARIANT);
04590 DECLKIND = (STANDARD,DECLARED);
04600
04610 STP = ^STRUCTURE;
04620 CTP = ^IDENTIFIER;
04630 STRUCTURE = PACKED RECORD
04640 SELFSTP: STP; SIZE: ADDRRANGE;
04650 NOCODE: BOOLEAN; BITSIZE: BITRANGE;
04660 CASE FORM: STRUCTFORM OF
04670 SCALAR: (CASE SCALKIND: DECLKIND OF
04680 DECLARED: (DB0: BITS6; FCONST: CTP;
04690 VECTORADDR, VECTORCHAIN: ADDRRANGE;
04700 DIMENSION: INTEGER; NEXTSCALAR: STP;
04710 REQUEST: BOOLEAN; TLEV: LEVRANGE));
04720 SUBRANGE: (DB1: BITS7; RANGETYPE: STP; VMIN, VMAX: VALU);
04730 POINTER: (DB2: BITS7; ELTYPE: STP);
04740 POWER: (DB3: BITS7; ELSET: STP);
04750 ARRAYS: (ARRAYPF: BOOLEAN; DB4: BITS6; ARRAYBPADDR: ADDRRANGE;
04760 AELTYPE, INXTYPE: STP);
04770 RECORDS: (RECORDPF: BOOLEAN; DB5: BITS6;
04780 FSTFLD: CTP; RECVAR: STP);
04790 FILES: (DB6: BITS6; FILEPF: BOOLEAN; FILTYPE: STP;
04800 FILE_FORM: FILEFORMRANGE; FILE_MODE: FILEMODERANGE);
04810 TAGFWITHID,
04820 TAGFWITHOUTID: (DB7: BITS7; FSTVAR: STP;
04830 CASE BOOLEAN OF
04840 TRUE : (TAGFIELDP: CTP);
04850 FALSE: (TAGFIELDTYPE: STP));
04860 VARIANT: (DB9: BITS7; NXTVAR, SUBVAR: STP; FIRSTFIELD: CTP; VARVAL: VALU)
04870 END;
04880
04890 BTP = ^BYTEPOINT;
04900 BYTEPOINT = PACKED RECORD
04910 LAST: BTP;
04920 ARRAYSP: STP;
04930 BITSIZE: BITRANGE
04940 END;
04950
04960 GTP = ^GLOBPTR;
04970 GLOBPTR = RECORD
04980 NEXTGLOBPTR: GTP ;
04990 FIRSTGLOB,
05000 LASTGLOB : ADDRRANGE ;
05010 FCIX : CODERANGE
05020 END ;
05030
05040 FTP = ^FILBLCK;
05050 FILBLCK = PACKED RECORD
05060 NEXTFTP : FTP ;
05070 FILEIDENT : CTP
05080 END ;
05090
05100 PTP = ^PROGRAMPARAMETER;
05110 PROGRAMPARAMETER = PACKED RECORD
05120 NEXTPTP: PTP;
05130 FILEIDPTR: CTP;
05140 FILEID: ALFA;
05150 INPUTFILE: BOOLEAN
05160 END;
05170
05180 (*NAMES*)
05190 (*******)
05200
05210 SCALARFORM = (INTEGERFORM,CHARFORM,REALFORM,BOOLFORM,DECLAREDFORM);
05220 IDCLASS = (TYPES,KONST,VARS,FIELD,PROC,FUNC,LABELS);
05230 SETOFIDS = SET OF IDCLASS;
05240 IDKIND = (ACTUAL,FORMAL);
05250 PACKKIND = (NOTPACK,PACKK,HWORDR,HWORDL);
05260
05270 IDENTIFIER = PACKED RECORD
05280 NAME: ALFA;
05290 LLINK, RLINK: CTP;
05300 IDTYPE: STP; NEXT: CTP;
05310 SELFCTP: CTP; NOCODE: BOOLEAN;
05320 CASE KLASS: IDCLASS OF
05330 KONST: (VALUES: VALU);
05340 VARS: (VKIND: IDKIND;
05350 VLEV: LEVRANGE;
05360 CHANNEL: ACRANGE;
05370 VDUMMY1: BITS5;
05380 VDUMMY2: BITS18;
05390 VADDR: ADDRRANGE);
05400 FIELD: (CASE PACKF: PACKKIND OF
05410 NOTPACK,
05420 HWORDL,
05430 HWORDR: (HDUMMY: BITS12; FLDADDR: ADDRRANGE);
05440 PACKK: (PDUMMY: BITS12; FLDBYTE: BPOINTER));
05450 PROC,
05460 FUNC: (CASE PFDECKIND: DECLKIND OF
05470 STANDARD: (KEY: KEYRANGE);
05480 DECLARED: (PFLEV: LEVRANGE;
05490 PARLISTSIZE,PFADDR: ADDRRANGE;
05500 HIGHEST_REGISTER: ACRANGE;
05510 CASE PFKIND: IDKIND OF
05520 ACTUAL: (FORWDECL: BOOLEAN;
05530 EXTERNDECL: BOOLEAN;
05540 ACTIVATED: BOOLEAN;
05550 PFCHAIN:CTP;
05560 LANGUAGE: SYMBOL;
05570 TESTFWDPTR: CTP;
05580 EXTERNALNAME: ALFA;
05590 LINKCHAIN: PACKED ARRAY[LEVRANGE] OF ADDRRANGE);
05600 FORMAL: (FPARAM:CTP)));
05610 LABELS:(SCOPE: LEVRANGE;
05620 JUMP_INDEX: 0..JUMP_MAX;
05630 EXIT_JUMP: BOOLEAN;
05640 GOTO_CHAIN: ADDRRANGE;
05650 LABEL_ADDRESS: ADDRRANGE)
05660 END;
05670
05680
05690 DISPRANGE = 0..DISPLIMIT;
05700
05710 WHERE = (BLCK (* ID IS VARIABLE ID*)
05720 ,CREC (* ID IS FIELD ID OF RECORD WITH CONSTANT ADDRESS*)
05730 ,VREC (* ID IS FIELD ID OF RECORD WITH VARIABLE ADDRESS*)
05740 );
05750
05760 (*RELOCATION*)
05770 (************)
05780
05790 CODEREFS = (NOREF,CONSTREF,EXTERNREF,FORWARDREF,GOTOREF,POINTREF,NOINSTR,SAVEREF,DEBUGREF);
05800
05810 RELBYTE = (NO,RIGHT,LEFT,BOTH);
05820
05830 RELWORD = PACKED ARRAY[0..17] OF RELBYTE;
05840
05850 SUPPORTS = ( STACKOVERFLOW, ERRORINASSIGNMENT, INDEXERROR, OVERFLOW, INPUTERROR,
05860 ERRORINSET, NOCOREAVAILABLE,
05870 ALLOCATE, FREE,
05880 EXITPROGRAM, RUNPROGRAM, READPGMPARAMETER,
05890 RESETFILE, REWRITEFILE, OPENTTY, FORTRANRESET, FORTRANEXIT, CLOSEFILE,
05900 GETCHARACTER, GETFILE, GETLINE, PUTFILE, PUTLINE, PUTPAGE, PUTBUFFER,
05910 INITIALIZEDEBUG, ENTERDEBUG, LOADDEBUG,
05920 CONVERTINTEGERTOREAL,
05930 ASCIITIME, ASCIIDATE,
05940 READREAL, READINTEGER, READCHARACTER, READSTRING, READPACKEDSTRING,
05950 WRITECHARACTER, WRITEDEFCHARACTER,
05960 WRITESTRING, WRITEDEFSTRING,
05970 WRITEPACKEDSTRING, WRITEDEFPACKEDSTRING,
05980 WRITEBOOLEAN, WRITEDEFBOOLEAN,
05990 WRITEREAL, WRITEDEF1REAL, WRITEDEF2REAL,
06000 WRITEINTEGER, WRITEDEFINTEGER,
06010 WRITEHEXADECIMAL, WRITEDEFHEXADECIMAL,
06020 WRITEOCTAL, WRITEDEFOCTAL,
06030 READIRANGE, READCRANGE, READRRANGE,
06040 READSCALAR,
06050 READISET, READCSET, READDSET,
06060 WRTSCALAR,
06070 WRTISET, WRTCSET, WRTDSET);
06080
06090 (*EXPRESSIONS*)
06100 (*************)
06110
06120 ATTRKIND = (CST,VARBL,EXPR);
06130
06140 ATTR = RECORD
06150 TYPTR: STP;
06160 CASE KIND: ATTRKIND OF
06170 CST: (CVAL: VALU);
06180 VARBL: (PACKFG: PACKKIND;
06190 INDEXR: ACRANGE;
06200 INDBIT: IBRANGE;
06210 VLEVEL: LEVRANGE;
06220 BPADDR,DPLMT: ADDRRANGE;
06230 VRELBYTE: RELBYTE;
06240 SUBKIND: STP;
06250 VCLASS: IDCLASS;
06260 VBYTE: BPOINTER);
06270 EXPR: (REG:ACRANGE)
06280 END;
06290
06300 TESTP = ^ TESTPOINTER;
06310 TESTPOINTER = PACKED RECORD
06320 ELT1,ELT2: STP;
06330 LASTTESTP: TESTP
06340 END;
06350
06360
06370 (*OTHER TYPES:*)
06380 (**************)
06390
06400 WRITE_FORM = (WRITE_ENTRY,WRITE_NAME,WRITE_HISEG,WRITE_GLOBALS,WRITE_CODE,WRITE_INTERNALS,WRITE_LIBRARY,
06410 WRITE_DEBUG,WRITE_FILEBLOCKS,WRITE_SYMBOLS,WRITE_START,WRITE_END);
06420
06430 NAMEKIND = (STDCONST,STDFILE,STDPROC,STDFUNC,DECLPROC,DECLFUNC);
06440
06450 BTPKIND = (UNUSED,REQUESTED,CALCULATED,USED);
06460
06470 ETP = ^ ERRORWITHTEXT;
06480 ERRORWITHTEXT = PACKED RECORD
06490 NUMBER: INTEGER;
06500 NEXT: ETP;
06510 STRING: ALFA
06520 END;
06530
06540 KSP = ^ KONSTREC;
06550 KONSTREC = PACKED RECORD
06560 ADDR, KADDR: ADDRRANGE;
06570 CONSTPTR: CSP;
06580 NEXTKONST: KSP;
06590 DOUBLE_CHAIN: BOOLEAN
06600 END;
06610
06620 PDP10INSTR = PACKED RECORD
06630 INSTR : INSTRANGE ;
06640 AC : ACRANGE;
06650 INDBIT : IBRANGE;
06660 INXREG : ACRANGE;
06670 ADDRESS : ADDRRANGE
06680 END ;
06690
06700 CHANGE_FORM=(INTCST,PDP10CODE,REALCST,STRCST,SIXBITCST,HALFWD,PDP10BP,RADIX) ;
06710
06720 CHARWORD = PACKED ARRAY[1..5] OF CHAR;
06730
06740 HALFS = PACKED RECORD
06750 LEFTHALF: ADDRRANGE;
06760 RIGHTHALF: ADDRRANGE
06770 END;
06780
06790 CODEPOINTER = ^CODEARRAY;
06800 CODEARRAY = RECORD
06810 CASE CHANGE_FORM OF
06820 PDP10CODE: (INSTRUCTION: ARRAY[CODERANGE] OF PDP10INSTR);
06830 INTCST: (WORD: ARRAY[CODERANGE] OF INTEGER);
06840 HALFWD: (HALFWORD: ARRAY[CODERANGE] OF HALFS)
06850 END;
06860
06870 RELPOINTER = ^RELARRAY;
06880 RELARRAY = PACKED ARRAY[CODERANGE] OF RELBYTE;
06890
06900 REFPOINTER = ^REFARRAY;
06910 REFARRAY = PACKED ARRAY[CODERANGE] OF CODEREFS;
06920
06930 BUFFERPOINTER = ^COMMANDBUFFER;
06940 COMMANDBUFFER = PACKED ARRAY[0..BUFFER_SIZE] OF ASCII;
06950
06960 PAGEELEM = PACKED RECORD
06970 WORD1: PDP10INSTR;
06980 LHALF: ADDRRANGE; RHALF: ADDRRANGE
06990 END;
07000
07010
07020 DEBENTRY = RECORD
07030 LASTPAGEELEM: PAGEELEM;
07040 GLOBALIDTREE: ADDRRANGE;
07050 STANDARDIDTREE: ADDRRANGE;
07060 INTPOINT: STP;
07070 REALPOINT: STP;
07080 BOOLPOINT: STP;
07090 CHARPOINT: STP
07100 END;
07110
07120 NLK = ^NEWLINKS;
07130
07140 NEWLINKS = PACKED RECORD
07150 REFTYPE : STP;
07160 REFADR : ADDRRANGE;
07170 NEXT : NLK;
07180 END;
07190
07200 (*------------------------------------------------------------------------------*)
07210
07220
07230 VAR
07240 (*VALUES RETURNED BY SOURCE PROGRAM SCANNER INSYMBOL:*)
07250 (*****************************************************)
07260
07270 SY: SYMBOL; (*LAST SYMBOL*)
07280 OP: OPERATOR; (*CLASSIFICATION OF LAST SYMBOL*)
07290 VAL: VALU; (*VALUE OF LAST CONSTANT*)
07300 LGTH: INTEGER; (*LENGTH OF LAST STRING CONSTANT*)
07310 ID: ALFA; (*LAST IDENTIFIER (POSSIBLY TRUNCATED)
07320 OR LAST INTEGER CONST (FOR LABEL PROCESSING)*)
07330 CH: CHAR; (*LAST CHARACTER*)
07340
07350
07360 (*COUNTERS:*)
07370 (***********)
07380
07390 I: INTEGER;
07400 ENTRIES: INTEGER;
07410 SUPPORT_INDEX: SUPPORTS;
07420 LANGUAGE_INDEX: SYMBOL;
07430 CHCNTMAX: 0..STDCHCNTMAX;
07440 CHCNT: 0..STDCHCNTMAX; (*CHARACTER COUNTER*)
07450 CODEEND, (*FIRST LOCATION NOT USED FOR INSTRUCTIONS*)
07460 LCMAIN,
07470 LC,IC: ADDRRANGE; (*DATA LOCATION AND INSTRUCTION COUNTER*)
07480 PROGRAM_COUNT: INTEGER;
07490
07500 (*SWITCHES:*)
07510 (***********)
07520
07530 DP, (*DECLARATION PART*)
07540 RESET_POSSIBLE, (*TO IGNORE SWITCHES WHICH MUST NOT BE RESET*)
07550 SEARCH_ERROR, (*TO ALLOW FORWARD REFERENCES IN POINTER TYPE
07560 DECLARATION BY SUPPRESSING ERROR MESSAGE*)
07570 EXTERNAL, (*IF TRUE, ALL LEVEL-1 PROC/FUNC MAY BE
07580 DECLARED AS "EXTERN" BY OTHER PROGRAMS*)
07590 TTYREAD, (*TO INHIBIT TTYOPEN ('*'-PROMPTING) IF NO TTY-INPUT REQUESTED*)
07600 DEBUG, (*ENABLE DEBUGGING*)
07610 DEBUG_SWITCH, (*TO GENERATE DEBUG INFORMATION*)
07620 LIST_CODE, (*LIST MACRO CODE*)
07630 LPTFILE, (*TO INHIBIT GENERATION OF LIST-FILE*)
07640 INITGLOBALS, (*INITIALIZE GLOBAL VARIABLES*)
07650 LOADNOPTR, (*IF TRUE, NO POINTERVARIABLE SHALL BE LOADED*)
07660 FORTRAN_ENVIROMENT,
07670 LOAD_AND_GO,
07680 CROSS_REFERENCE,
07690 FIRST_SYMBOL,
07700 RUNTIME_CHECK: BOOLEAN; (*IF TRUE, PERFORM RUNTIME-TESTS*)
07710
07720
07730 (*POINTERS:*)
07740 (***********)
07750
07760 SEXTERNPFPTR,
07770 LOCALPFPTR, EXTERNPFPTR: CTP; (*PTRS TO LOCAL/EXTERNAL PROC/FUNC-CHAIN*)
07780 PARMPTR: PTP; (*PTR TO PROGRAMPARM.-CHAIN*)
07790 STDFILEPTR: ARRAY[1..4] OF CTP; (*PTRS TO STD-FILES*)
07800 ALFAPTR,PACKC9PTR,
07810 PACKC5PTR,ASCIIPTR,
07820 PACKC6PTR,PACKC8PTR,
07830 INTPTR,REALPTR,CHARPTR,
07840 BOOLPTR,NILPTR,TEXTPTR: STP; (*POINTERS TO ENTRIES OF STANDARD IDS*)
07850 SDECLSCALPTR,
07860 DECLSCALPTR: STP; (*PTR TO CHAIN OF DECLARED SCALARS*)
07870 UTYPPTR,UCSTPTR,UVARPTR,
07880 UFLDPTR,UPRCPTR,UFCTPTR, (*POINTERS TO ENTRIES FOR UNDECLARED IDS*)
07890 FORWARD_POINTER_TYPE: CTP; (*HEAD OF CHAIN OF FORW DECL TYPE IDS*)
07900 ERRMPTR, ERRMPTR1: ETP; (*TO CHAIN ERRORS WITH TEXT*)
07910 LAST_LABEL: CTP; (*TOP OF LABEL CHAIN*)
07920 SLASTBTP,
07930 LASTBTP: BTP; (*HEAD OF BYTEPOINTERTABLE*)
07940 SFILEPTR,
07950 FILEPTR: FTP;
07960 FIRSTKONST: KSP;
07970 ANYFILEPTR: STP; (*TO ALLOW FILES OF "ANY" TYPE AS
07980 VAR PARAMETERS IN STAND. PROC/FUNC*)
07990 FGLOBPTR,CGLOBPTR : GTP ; (*POINTER TO FIRST AND CURRENT GLOBAL INITIALISATION RECORD*)
08000 GLOBTESTP : TESTP ; (*POINTER TO LAST PAIR OF POINTERTYPES*)
08010 GLOBNEWLINK : NLK ; (*POINTER TO NEW-LINKS*)
08020
08030 (*BOOKKEEPING OF DECLARATION LEVELS:*)
08040 (************************************)
08050
08060 LEVEL: LEVRANGE; (*CURRENT STATIC LEVEL*)
08070 DISX, (*LEVEL OF LAST ID SEARCHED BY SEARCHID*)
08080 TOP: DISPRANGE; (*TOP OF DISPLAY*)
08090
08100 DISPLAY: ARRAY[DISPRANGE] OF
08110 PACKED RECORD
08120 FNAME: CTP;
08130 CASE OCCUR: WHERE OF
08140 CREC: (CLEV: LEVRANGE;
08150 CINDR: ACRANGE;
08160 CINDB: IBRANGE;
08170 CRELBYTE: RELBYTE;
08180 CDSPL,
08190 CLC : ADDRRANGE)
08200 END;
08210
08220
08230 (*ERROR MESSAGES:*)
08240 (*****************)
08250
08260 ERROR_FLAG: BOOLEAN; (*TRUE IF SYNTACTIC ERRORS DETECTED*)
08270 ERROR_IN_HEADING: BOOLEAN;
08280 ERRINX: 0..MAXERR ; (*NR OF ERRORS IN CURRENT SOURCE LINE*)
08290 ERRORCOUNT: INTEGER; (*TOTAL NR OF ERRORS DETECTED IN PROGRAM*)
08300 ERROR_EXIT: BOOLEAN; (*TO ENABLE EXIT DURING COMPILATION*)
08310 OVERRUN: BOOLEAN;
08320 ERRLIST:
08330 ARRAY [1..MAXERR] OF
08340 PACKED RECORD
08350 ARW: 1..MAXERR;
08360 POS: 1..STDCHCNTMAX;
08370 NMR: 1..600;
08380 TIC: CHAR
08390 END;
08400
08410 ERRMESS15 : ARRAY [1..24] OF PACKED ARRAY [1..15] OF CHAR;
08420 ERRMESS20 : ARRAY [1..15] OF PACKED ARRAY [1..20] OF CHAR;
08430 ERRMESS25 : ARRAY [1..18] OF PACKED ARRAY [1..25] OF CHAR;
08440 ERRMESS30 : ARRAY [1..20] OF PACKED ARRAY [1..30] OF CHAR;
08450 ERRMESS35 : ARRAY [1..17] OF PACKED ARRAY [1..35] OF CHAR;
08460 ERRMESS40 : ARRAY [1..11] OF PACKED ARRAY [1..40] OF CHAR;
08470 ERRMESS45 : ARRAY [1..18] OF PACKED ARRAY [1..45] OF CHAR;
08480 ERRMESS50 : ARRAY [1..10] OF PACKED ARRAY [1..50] OF CHAR;
08490 ERRMESS55 : ARRAY [1.. 6] OF PACKED ARRAY [1..55] OF CHAR;
08500 ERRORINLINE,
08510 FOLLOWERROR : BOOLEAN;
08520 ERRLINE,
08530 BUFFER: ARRAY [1..STDCHCNTMAX] OF CHAR;
08540 PAGECNT,
08550 LINECNT: INTEGER;
08560 LINENR: PACKED ARRAY [1..5] OF CHAR;
08570
08580
08590 (*EXPRESSION COMPILATION:*)
08600 (*************************)
08610
08620 GATTR: ATTR; (*DESCRIBES THE EXPR CURRENTLY COMPILED*)
08630 AOS: (B0,B1,B2,B3,AOSINSTR,SOSINSTR); (*TESTS CONDITION FOR AOS/SOS-INSTRUCTION*)
08640 LEFTSIDE: ATTR; (*LEFT SIDE OF ASSIGNMENT*)
08650
08660 (*COMPILATION OF PACKED STRUCTURES:*)
08670 (***********************************)
08680
08690 ARRAYBPS: ARRAY[1:18] OF
08700 RECORD
08710 ABYTE: BPOINTER; BYTEMAX: BITRANGE;
08720 ADDRESS: ADDRRANGE;
08730 STATE: BTPKIND
08740 END;
08750
08760
08770
08780 (*DEBUG-SYSTEM:*)
08790 (***************)
08800
08810 LASTSTOP: ADDRRANGE; (*LAST BREAKPOINT*)
08820 LASTLINE, (*LINENUMBER FOR BREAKPOINTS*)
08830 LINEDIFF, (*DIFFERENCE BETWEEN ^ AND LINECNT*)
08840 LASTPAGE:INTEGER; (*LAST PAGE THAT CONTAINS A STOP*)
08850 PAGEHEADADR, (*OVERGIVE TO DEBUG.PAS*)
08860 LASTPAGER: ADDRRANGE; (*POINTS AT LAST PAGERECORD*)
08870 PAGER: PAGEELEM; (*ACTUAL PAGERECORD*)
08880 DEBENTRY_SIZE: INTEGER; (*DEBENTRY LENGTH *)
08890 DEBUGENTRY: DEBENTRY;
08900 IDRECSIZE: ARRAY[IDCLASS] OF INTEGER;
08910 STRECSIZE: ARRAY[STRUCTFORM] OF INTEGER;
08920
08930
08940
08950 (*STRUCTURED CONSTANTS:*)
08960 (***********************)
08970
08980 LETTERSORDIGITS,LETTERS,DIGITS,LETTERSDIGITSORLEFTARROW,HEXADIGITS: SET OF CHAR;
08990 CONSTBEGSYS,SIMPTYPEBEGSYS,TYPEBEGSYS,BLOCKBEGSYS,SELECTSYS,FACBEGSYS,
09000 LANGUAGESYS,STATBEGSYS,TYPEDELS: SETOFSYS;
09010 RW: ARRAY [1..RSWMAX] OF ALFA;
09020 FRW: ARRAY [1..11(*ALFALENGTH+1*)] OF 1..RSWMAXP1;
09030 RSY: ARRAY [1..RSWMAX] OF SYMBOL;
09040 SSY: ARRAY [' '..'_'] OF SYMBOL;
09050 ROP: ARRAY [1..RSWMAX] OF OPERATOR;
09060 SOP: ARRAY [' '..'_'] OF OPERATOR;
09070 NA: ARRAY[NAMEKIND] OF ARRAY[1..STDMAX] OF ALFA;
09080 NAMAX: ARRAY[NAMEKIND] OF INTEGER;
09090 EXTNA: ARRAY[DECLPROC..DECLFUNC] OF ARRAY[1..EXTPFMAX] OF ALFA;
09100 EXTLANGUAGE: ARRAY[DECLPROC..DECLFUNC] OF ARRAY[1..EXTPFMAX] OF SYMBOL;
09110 MNEMONICS : ARRAY[1..45] OF PACKED ARRAY[1..60] OF CHAR ;
09120 SHOWIBIT : ARRAY[IBRANGE] OF CHAR;
09130 SHOWRELO : ARRAY[BOOLEAN] OF CHAR;
09140 SHOWREF : ARRAY[CODEREFS] OF CHAR;
09150 WRITE_SUPPORT, READ_SUPPORT: ARRAY[SCALARFORM,SCALAR..POWER] OF SUPPORTS;
09160
09170 (*LABEL PROCESSING:*)
09180 (*******************)
09190
09200 JUMPER: 0..JUMP_MAX;
09210 JUMP_TABLE: PACKED ARRAY[JUMP_RANGE] OF ADDRRANGE;
09220 JUMP_ADDRESS: ADDRRANGE;
09230
09240 (*OTHER VARIABLES:*)
09250 (********************)
09260
09270 RELOCATION_BLOCK: PACKED RECORD
09280 CASE INTEGER OF
09290 1: (COMPONENT: ARRAY[1..20] OF INTEGER);
09300 2: (ITEM: ADDRRANGE; COUNT: ADDRRANGE;
09310 RELOCATOR: RELWORD;
09320 CODE: ARRAY[0..17] OF INTEGER)
09330 END;
09340
09350 RUNTIME_SUPPORT: RECORD
09360 NAME: ARRAY[SUPPORTS] OF ALFA;
09370 LINK: PACKED ARRAY[SUPPORTS] OF ADDRRANGE
09380 END;
09390
09400 CODE_ARRAY: CODEPOINTER;
09410
09420 CODE_REFERENCE: REFPOINTER;
09430
09440 COMMAND_BUFFER: BUFFERPOINTER;
09450
09460 CODE_RELOCATION: RELPOINTER;
09470
09480 CHANGE : PACKED RECORD
09490 CASE CHANGE_FORM OF
09500 INTCST :(WKONST: INTEGER);
09510 PDP10CODE:(WINSTR: PDP10INSTR);
09520 REALCST :(WREAL: REAL);
09530 STRCST :(WSTRING: CHARWORD);
09540 SIXBITCST:(WSIXBIT: PACKED ARRAY[1..6] OF 0..77B);
09550 HALFWD :(WLEFTHALF: ADDRRANGE ; WRIGHTHALF : ADDRRANGE);
09560 PDP10BP :(WBYTE: BPOINTER);
09570 RADIX :(FLAG: FLAGRANGE; SYMBOL: RADIXRANGE)
09580 END;
09590
09600
09610 REGC, (*TOP OF REGISTERSTACK*)
09620 REGCMAX: ACRANGE; (*MAXIMUM OF REGISTERS FOR EXPRESSION STACK*)
09630 CIX, (*CODE-ARRAY INDEX*)
09640 STACKSIZE1, STACKSIZE2, (*TO INSERT LCMAX IN PROCEDURE/FUNCTION ENTRY CODE*)
09650 PFSTART: INTEGER; (*START OF NORMAL ENTRYCODE OF EACH FUNC. OR PROC.*)
09660 LCMAX: ADDRRANGE; LCP: CTP;
09670 TEMPCORE, SOURCE, LIST, TTYIN : TEXT;
09680 OBJECT: FILE OF INTEGER;
09690 WITHIX: INTEGER; (*TOP OF WITH-REG STACK*)
09700 HIGHEST_CODE, (*HIGH SEG. BREAK*)
09710 MAIN_START, (*START OF BODY OF MAIN*)
09720 IDTREE, (*POINTER TO THE IDENTIFIER-TREE*)
09730 NAME_ADDRESS, (*ADDR OF PROGRAM-NAME(ALFA-STRING)*)
09740 START_ADDRESS: ADDRRANGE; (*STARTADDRESS*)
09750 LPARMPTR, BACKWPARMPTR: PTP;
09760 DAY, TIMEOFDAY, PROGRAMNAME: ALFA;
09770 ENTRY: ARRAY[0..ENTRYMAX] OF ALFA;
09780 LIST_FILE, SOURCE_FILE, OBJECT_FILE: PACKED ARRAY[1..9] OF CHAR;
09790 RTIME: ARRAY[0..3] OF INTEGER;
09800 CORE: ARRAY[1..2] OF INTEGER;
09810 START_CHANNEL, CODE_SIZE, RUNCORE, PARREGCMAX: INTEGER;
09820 ENTRY_DONE: BOOLEAN;
09830
09840 CROSS_DEVICE: PACKED ARRAY[1..6] OF CHAR;
09850 CROSS_PPN, CROSS_CORE: INTEGER;
09860
09870 LIBRARY_INDEX: INTEGER;
09880 LIBRARY_ORDER: PACKED ARRAY[1..4] OF SYMBOL;
09890 LIBRARY: ARRAY[PASCALSY..FORTRANSY] OF RECORD
09900 CHAINED, CALLED: BOOLEAN;
09910 NAME: ALFA;
09920 PROJNR: ADDRRANGE;
09930 PROGNR: ADDRRANGE;
09940 DEVICE: ALFA
09950 END;
09960
09970 (*------------------------------------------------------------------------------*)
09980
09990 INITPROCEDURE (* MNEMONICS *) ;
10000 BEGIN
10010
10020 MNEMONICS[ 1] := '***001***002***003***004***005***006***007***010***011***012' ;
10030 MNEMONICS[ 2] := '***013***014***015***016***017***020***021***022***023***024' ;
10040 MNEMONICS[ 3] := '***025***026***027***030***031***032***033***034***035***036' ;
10050 MNEMONICS[ 4] := '***037CALL INIT ***042***043***044***045***046CALLI OPEN ' ;
10060 MNEMONICS[ 5] := 'TTCALL***052***053***054RENAMEIN OUT SETSTSSTATO STATUS' ;
10070 MNEMONICS[ 6] := 'STATZ INBUF OUTBUFINPUT OUTPUTCLOSE RELEASMTAPE UGETF USETI ' ;
10080 MNEMONICS[ 7] := 'USETO LOOKUPENTER UJEN ***101***102***103***104***105***106' ;
10090 MNEMONICS[ 8] := '***107***110***111***112***113***114***115***116***117***120' ;
10100 MNEMONICS[ 9] := '***121***122***123***124***125***126***127UFA DFN FSC ' ;
10110 MNEMONICS[10] := 'IBP ILDB LDB IDPB DPB FAD FADL FADM FADB FADR ' ;
10120 MNEMONICS[11] := 'FADRI FADRM FADRB FSB FSBL FSBM FSBB FSBR FSBRI FSBRM ' ;
10130 MNEMONICS[12] := 'FSBRB FMP FMPL FMPM FMPB FMPR FMPRI FMPRM FMPRB FDV ' ;
10140 MNEMONICS[13] := 'FDVL FDVM FDVB FDVR FDVRI FDVRM FDVRB MOVE MOVEI MOVEM ' ;
10150 MNEMONICS[14] := 'MOVES MOVS MOVSI MOVSM MOVSS MOVN MOVNI MOVNM MOVNS MOVM ' ;
10160 MNEMONICS[15] := 'MOVMI MOVMM MOVMS IMUL IMULI IMULM IMULB MUL MULI MULM ' ;
10170 MNEMONICS[16] := 'MULB IDIV IDIVI IDIVM IDIVB DIV DIVI DIVM DIVB ASH ' ;
10180 MNEMONICS[17] := 'ROT LSH JFFO ASHC ROTC LSHC ***247EXCH BLT AOBJP ' ;
10190 MNEMONICS[18] := 'AOBJN JRST JFCL XCT ***257PUSHJ PUSH POP POPJ JSR ' ;
10200 MNEMONICS[19] := 'JSP JSA JRA ADD ADDI ADDM ADDB SUB SUBI SUBM ' ;
10210 MNEMONICS[20] := 'SUBB CAI CAIL CAIE CAILE CAIA CAIGE CAIN CAIG CAM ' ;
10220 MNEMONICS[21] := 'CAML CAME CAMLE CAMA CAMGE CAMN CAMG JUMP JUMPL JUMPE ' ;
10230 MNEMONICS[22] := 'JUMPLEJUMPA JUMPGEJUMPN JUMPG SKIP SKIPL SKIPE SKIPLESKIPA ' ;
10240 MNEMONICS[23] := 'SKIPGESKIPN SKIPG AOJ AOJL AOJE AOJLE AOJA AOJGE AOJN ' ;
10250 MNEMONICS[24] := 'AOJG AOS AOSL AOSE AOSLE AOSA AOSGE AOSN AOSG SOJ ' ;
10260 MNEMONICS[25] := 'SOJL SOJE SOJLE SOJA SOJGE SOJN SOJG SOS SOSL SOSE ' ;
10270 MNEMONICS[26] := 'SOSLE SOSA SOSGE SOSN SOSG SETZ SETZI SETZM SETZB AND ' ;
10280 MNEMONICS[27] := 'ANDI ANDM ANDB ANDCA ANDCAIANDCAMANDCABSETM SETMI SETMM ' ;
10290 MNEMONICS[28] := 'SETMB ANDCM ANDCMIANDCMMANDCMBSETA SETAI SETAM SETAB XOR ' ;
10300 MNEMONICS[29] := 'XORI XORM XORB IOR IORI IORM IORB ANDCB ANDCBIANDCBM' ;
10310 MNEMONICS[30] := 'ANDCBBEQV EQVI EQVM EQVB SETCA SETCAISETCAMSETCABORCA ' ;
10320 MNEMONICS[31] := 'ORCAI ORCAM ORCAB SETCM SETCMISETCMMSETCMBORCM ORCMI ORCMM ' ;
10330 MNEMONICS[32] := 'ORCMB ORCB ORCBI ORCBM ORCBB SETO SETOI SETOM SETOB HLL ' ;
10340 MNEMONICS[33] := 'HLLI HLLM HLLS HRL HRLI HRLM HRLS HLLZ HLLZI HLLZM ' ;
10350 MNEMONICS[34] := 'HLLZS HRLZ HRLZI HRLZM HRLZS HLLO HLLOI HLLOM HLLOS HRLO ' ;
10360 MNEMONICS[35] := 'HRLOI HRLOM HRLOS HLLE HLLEI HLLEM HLLES HRLE HRLEI HRLEM ' ;
10370 MNEMONICS[36] := 'HRLES HRR HRRI HRRM HRRS HLR HLRI HLRM HLRS HRRZ ' ;
10380 MNEMONICS[37] := 'HRRZI HRRZM HRRZS HLRZ HLRZI HLRZM HLRZS HRRO HRROI HRROM ' ;
10390 MNEMONICS[38] := 'HRROS HLRO HLROI HLROM HLROS HRRE HRREI HRREM HRRES HLRE ' ;
10400 MNEMONICS[39] := 'HLREI HLREM HLRES TRN TLN TRNE TLNE TRNA TLNA TRNN ' ;
10410 MNEMONICS[40] := 'TLNN TDN TSN TDNE TSNE TDNA TSNA TDNN TSNN TRZ ' ;
10420 MNEMONICS[41] := 'TLZ TRZE TLZE TRZA TLZA TRZN TLZN TDZ TSZ TDZE ' ;
10430 MNEMONICS[42] := 'TSZE TDZA TSZA TDZN TSZN TRC TLC TRCE TLZE TRCA ' ;
10440 MNEMONICS[43] := 'TLCA TRCN TLCN TDC TSC TDCE TSCE TDCA TSCA TDCN ' ;
10450 MNEMONICS[44] := 'TSCN TRO TLO TROE TLOE TROA TLOA TRON TLON TDO ' ;
10460 MNEMONICS[45] := 'TSO TDOE TSOE TDOA TSOA TDON TSON ***700 ' ;
10470
10480 SHOWIBIT[0] := ' '; SHOWIBIT[1] := '@';
10490
10500 SHOWRELO[FALSE] := ' '; SHOWRELO[TRUE] := '''';
10510
10520 SHOWREF[NOREF] := ' '; SHOWREF[CONSTREF] := 'C';
10530 SHOWREF[EXTERNREF] := 'E'; SHOWREF[NOINSTR] := ' ';
10540 SHOWREF[FORWARDREF] := 'F'; SHOWREF[GOTOREF] := 'G';
10550 SHOWREF[POINTREF] := 'P'; SHOWREF[SAVEREF] := 'S';
10560 SHOWREF[DEBUGREF] := 'D';
10570
10580 END (* MNEMONICS *) ;
10590
10600 INITPROCEDURE (*SEARCH LIBRARIES*) ;
10610 BEGIN
10620
10630 (* INSERT (???) DEVICE, PROJNR, PROGNR AND CORE FOR PASLIB AND CROSS *)
10640
10650 LIBRARY[PASCALSY].CHAINED := FALSE;
10660 LIBRARY[FORTRANSY].CHAINED := FALSE;
10670 LIBRARY[PASCALSY].CALLED := FALSE;
10680 LIBRARY[FORTRANSY].CALLED := FALSE;
10690 LIBRARY[PASCALSY].NAME := 'PASLIB ';
10700 LIBRARY[FORTRANSY].NAME := 'FORLIB ';
10710 LIBRARY[PASCALSY].DEVICE := 'NEW ';
10720 LIBRARY[FORTRANSY].DEVICE := 'SYS ';
10730 LIBRARY[PASCALSY].PROJNR := 0;
10740 LIBRARY[FORTRANSY].PROJNR := 0;
10750 LIBRARY[PASCALSY].PROGNR := 0;
10760 LIBRARY[FORTRANSY].PROGNR := 0;
10770
10780 CROSS_DEVICE := 'NEW ';
10790 CROSS_PPN := 0;
10800 CROSS_CORE := 50; (* ??? *)
10810
10820 END (*SEARCH LIBRARIES*) ;
10830
10840 INITPROCEDURE (*STANDARD NAMES*) ;
10850 BEGIN
10860
10870 NA[STDFILE, 1] := 'INPUT '; NA[STDFILE, 2] := 'OUTPUT '; NA[STDFILE, 3] := 'TTY ';
10880 NA[STDFILE, 4] := 'TTYOUTPUT ';
10890
10900 NA[STDPROC, 1] := 'GET '; NA[STDPROC, 2] := 'GETLN '; NA[STDPROC, 3] := 'PUT ';
10910 NA[STDPROC, 4] := 'PUTLN '; NA[STDPROC, 5] := 'RESET '; NA[STDPROC, 6] := 'REWRITE ';
10920 NA[STDPROC, 7] := 'READ '; NA[STDPROC, 8] := 'READLN '; NA[STDPROC, 9] := 'BREAK ';
10930 NA[STDPROC,10] := 'WRITE '; NA[STDPROC,11] := 'WRITELN '; NA[STDPROC,12] := 'PACK ';
10940 NA[STDPROC,13] := 'UNPACK '; NA[STDPROC,14] := 'NEW '; NA[STDPROC,15] := '$$$1 ';
10950 NA[STDPROC,16] := '$$$2 '; NA[STDPROC,17] := 'GETLINENR '; NA[STDPROC,18] := '$$$3 ';
10960 NA[STDPROC,19] := 'PAGE '; NA[STDPROC,20] := 'PROTECTION'; NA[STDPROC,21] := 'CALL ';
10970 NA[STDPROC,22] := 'DATE '; NA[STDPROC,23] := 'TIME '; NA[STDPROC,24] := 'DISPOSE ';
10980 NA[STDPROC,25] := 'HALT '; NA[STDPROC,26] := 'GETSEG '; NA[STDPROC,27] := 'PUTSEG ';
10990 NA[STDPROC,28] := 'MESSAGE '; NA[STDPROC,29] := 'LINELIMIT ';
11000
11010 NA[STDFUNC, 1] := 'REALTIME '; NA[STDFUNC, 2] := 'ABS '; NA[STDFUNC, 3] := 'SQR ';
11020 NA[STDFUNC, 4] := '$$$4 '; NA[STDFUNC, 5] := 'ODD '; NA[STDFUNC, 6] := 'ORD ';
11030 NA[STDFUNC, 7] := 'CHR '; NA[STDFUNC, 8] := 'PRED '; NA[STDFUNC, 9] := 'SUCC ';
11040 NA[STDFUNC,10] := 'EOF '; NA[STDFUNC,11] := 'EOLN '; NA[STDFUNC,12] := 'CLOCK ';
11050 NA[STDFUNC,13] := 'CARD '; NA[STDFUNC,14] := '$$$5 '; NA[STDFUNC,15] := 'LOWERBOUND';
11060 NA[STDFUNC,16] := 'UPPERBOUND'; NA[STDFUNC,17] := 'EOS '; NA[STDFUNC,18] := '$$$6 ';
11070 NA[STDFUNC,19] := 'MIN '; NA[STDFUNC,20] := 'MAX '; NA[STDFUNC,21] := 'FIRST ';
11080 NA[STDFUNC,22] := 'LAST ';
11090
11100 NA[DECLFUNC, 1] := 'COS '; NA[DECLFUNC, 2] := 'EXP '; NA[DECLFUNC, 3] := 'SQRT ';
11110 NA[DECLFUNC, 4] := 'LN '; NA[DECLFUNC, 5] := 'ARCTAN '; NA[DECLFUNC, 6] := 'LOG ';
11120 NA[DECLFUNC, 7] := 'SIND '; NA[DECLFUNC, 8] := 'COSD '; NA[DECLFUNC, 9] := 'SINH ';
11130 NA[DECLFUNC,10] := 'COSH '; NA[DECLFUNC,11] := 'TANH '; NA[DECLFUNC,12] := 'ARCSIN ';
11140 NA[DECLFUNC,13] := 'ARCCOS '; NA[DECLFUNC,14] := 'RANDOM '; NA[DECLFUNC,15] := 'SIN ';
11150 NA[DECLFUNC,16] := 'ROUND '; NA[DECLFUNC,17] := 'EXPO '; NA[DECLFUNC,18] := 'OPTION ';
11160 NA[DECLFUNC,19] := '$$$7 '; NA[DECLFUNC,20] := 'TRUNC ';
11170
11180 NA[STDCONST, 1] := 'FALSE '; NA[STDCONST, 2] := 'TRUE '; NA[STDCONST, 3] := 'NUL ';
11190 NA[STDCONST, 4] := 'SOH '; NA[STDCONST, 5] := 'STX '; NA[STDCONST, 6] := 'ETX ';
11200 NA[STDCONST, 7] := 'EOT '; NA[STDCONST, 8] := 'ENQ '; NA[STDCONST, 9] := 'ACK ';
11210 NA[STDCONST,10] := 'BEL '; NA[STDCONST,11] := 'BS '; NA[STDCONST,12] := 'HT ';
11220 NA[STDCONST,13] := 'LF '; NA[STDCONST,14] := 'VT '; NA[STDCONST,15] := 'FF ';
11230 NA[STDCONST,16] := 'CR '; NA[STDCONST,17] := 'SO '; NA[STDCONST,18] := 'SI ';
11240 NA[STDCONST,19] := 'DLE '; NA[STDCONST,20] := 'DC1 '; NA[STDCONST,21] := 'DC2 ';
11250 NA[STDCONST,22] := 'DC3 '; NA[STDCONST,23] := 'DC4 '; NA[STDCONST,24] := 'NAK ';
11260 NA[STDCONST,25] := 'SYN '; NA[STDCONST,26] := 'ETB '; NA[STDCONST,27] := 'CAN ';
11270 NA[STDCONST,28] := 'EM '; NA[STDCONST,29] := 'SUB '; NA[STDCONST,30] := 'ESC ';
11280 NA[STDCONST,31] := 'FS '; NA[STDCONST,32] := 'GS '; NA[STDCONST,33] := 'RS ';
11290 NA[STDCONST,34] := 'US '; NA[STDCONST,35] := 'SP '; NA[STDCONST,36] := 'DEL ';
11300
11310 NA[DECLPROC, 1] := 'GETFILENAM'; NA[DECLPROC, 2] := 'GETOPTION '; NA[DECLPROC, 3] := 'GETSTATUS ';
11320
11330 NAMAX[STDFILE] := 4; NAMAX[STDPROC] := 29; NAMAX[STDFUNC] := 22;
11340 NAMAX[DECLFUNC] := 20; NAMAX[DECLPROC] := 3; NAMAX[STDCONST] := 36;
11350
11360 END (*STANDARD NAMES*) ;
11370
11380 INITPROCEDURE (*EXTERNAL PROCEDURE/FUNCTION NAMES*);
11390 BEGIN
11400
11410 EXTNA[DECLFUNC, 1] := 'COS '; EXTLANGUAGE[DECLFUNC, 1] := FORTRANSY;
11420 EXTNA[DECLFUNC, 2] := 'EXP '; EXTLANGUAGE[DECLFUNC, 2] := FORTRANSY;
11430 EXTNA[DECLFUNC, 3] := 'SQRT '; EXTLANGUAGE[DECLFUNC, 3] := FORTRANSY;
11440 EXTNA[DECLFUNC, 4] := 'ALOG '; EXTLANGUAGE[DECLFUNC, 4] := FORTRANSY;
11450 EXTNA[DECLFUNC, 5] := 'ATAN '; EXTLANGUAGE[DECLFUNC, 5] := FORTRANSY;
11460 EXTNA[DECLFUNC, 6] := 'ALOG10 '; EXTLANGUAGE[DECLFUNC, 6] := FORTRANSY;
11470 EXTNA[DECLFUNC, 7] := 'SIND '; EXTLANGUAGE[DECLFUNC, 7] := FORTRANSY;
11480 EXTNA[DECLFUNC, 8] := 'COSD '; EXTLANGUAGE[DECLFUNC, 8] := FORTRANSY;
11490 EXTNA[DECLFUNC, 9] := 'SINH '; EXTLANGUAGE[DECLFUNC, 9] := FORTRANSY;
11500 EXTNA[DECLFUNC,10] := 'COSH '; EXTLANGUAGE[DECLFUNC,10] := FORTRANSY;
11510 EXTNA[DECLFUNC,11] := 'TANH '; EXTLANGUAGE[DECLFUNC,11] := FORTRANSY;
11520 EXTNA[DECLFUNC,12] := 'ASIN '; EXTLANGUAGE[DECLFUNC,12] := FORTRANSY;
11530 EXTNA[DECLFUNC,13] := 'ACOS '; EXTLANGUAGE[DECLFUNC,13] := FORTRANSY;
11540 EXTNA[DECLFUNC,14] := 'RAN '; EXTLANGUAGE[DECLFUNC,14] := FORTRANSY;
11550 EXTNA[DECLFUNC,15] := 'SIN '; EXTLANGUAGE[DECLFUNC,15] := FORTRANSY;
11560 EXTNA[DECLFUNC,16] := 'ROUND '; EXTLANGUAGE[DECLFUNC,16] := PASCALSY;
11570 EXTNA[DECLFUNC,17] := 'EXPO '; EXTLANGUAGE[DECLFUNC,17] := PASCALSY;
11580 EXTNA[DECLFUNC,18] := 'OPTION '; EXTLANGUAGE[DECLFUNC,18] := PASCALSY;
11590 EXTNA[DECLFUNC,19] := 'UNDEFI '; EXTLANGUAGE[DECLFUNC,19] := PASCALSY;
11600 EXTNA[DECLFUNC,20] := 'TRUNC '; EXTLANGUAGE[DECLFUNC,20] := PASCALSY;
11610
11620 EXTNA[DECLPROC, 1] := 'GETFIL '; EXTLANGUAGE[DECLPROC, 1] := PASCALSY;
11630 EXTNA[DECLPROC, 2] := 'GETOPT '; EXTLANGUAGE[DECLPROC, 2] := PASCALSY;
11640 EXTNA[DECLPROC, 3] := 'GETSTA '; EXTLANGUAGE[DECLPROC, 3] := PASCALSY;
11650
11660 END (*EXTERNAL PROCUDURE/FUNCTION NAMES*);
11670
11680 INITPROCEDURE (*RUNTIME-, DEBUG-SUPPORT NAMES*) ;
11690 BEGIN
11700
11710 RUNTIME_SUPPORT.NAME[STACKOVERFLOW] := 'CORERR ';
11720 RUNTIME_SUPPORT.NAME[OVERFLOW] := 'OVERF. ';
11730 RUNTIME_SUPPORT.NAME[ALLOCATE] := 'NEW ';
11740 RUNTIME_SUPPORT.NAME[EXITPROGRAM] := 'END ';
11750 RUNTIME_SUPPORT.NAME[GETLINE] := 'GETLN ';
11760 RUNTIME_SUPPORT.NAME[GETFILE] := 'GET ';
11770 RUNTIME_SUPPORT.NAME[PUTLINE] := 'PUTLN ';
11780 RUNTIME_SUPPORT.NAME[PUTFILE] := 'PUT ';
11790 RUNTIME_SUPPORT.NAME[RESETFILE] := 'RESETF ';
11800 RUNTIME_SUPPORT.NAME[REWRITEFILE] := 'REWRIT ';
11810 RUNTIME_SUPPORT.NAME[WRITEOCTAL] := 'WRTOCT ';
11820 RUNTIME_SUPPORT.NAME[WRITEHEXADECIMAL] := 'WRTHEX ';
11830 RUNTIME_SUPPORT.NAME[WRITEINTEGER] := 'WRTINT ';
11840 RUNTIME_SUPPORT.NAME[LOADDEBUG] := 'DEBUG ';
11850 RUNTIME_SUPPORT.NAME[WRITECHARACTER] := 'WRITEC ';
11860 RUNTIME_SUPPORT.NAME[WRITEREAL] := 'WRTREA ';
11870 RUNTIME_SUPPORT.NAME[WRITEBOOLEAN] := 'WRTBOL ';
11880 RUNTIME_SUPPORT.NAME[WRITESTRING] := 'WRTUST ';
11890 RUNTIME_SUPPORT.NAME[WRITEPACKEDSTRING] := 'WRTPST ';
11900 RUNTIME_SUPPORT.NAME[READINTEGER] := 'READI ';
11910 RUNTIME_SUPPORT.NAME[READCHARACTER] := 'READC ';
11920 RUNTIME_SUPPORT.NAME[READREAL] := 'READR ';
11930 RUNTIME_SUPPORT.NAME[CONVERTINTEGERTOREAL] := 'INTREA ';
11940 RUNTIME_SUPPORT.NAME[PUTBUFFER] := 'PUTBUF ';
11950 RUNTIME_SUPPORT.NAME[OPENTTY] := 'TTYOPN ';
11960 RUNTIME_SUPPORT.NAME[INITIALIZEDEBUG] := 'INDEB. ';
11970 RUNTIME_SUPPORT.NAME[ENTERDEBUG] := 'EXDEB. ';
11980 RUNTIME_SUPPORT.NAME[GETCHARACTER] := 'GETCH ';
11990 RUNTIME_SUPPORT.NAME[PUTPAGE] := 'PUTPG ';
12000 RUNTIME_SUPPORT.NAME[INDEXERROR] := 'INXERR ';
12010 RUNTIME_SUPPORT.NAME[ERRORINASSIGNMENT] := 'SRERR ';
12020 RUNTIME_SUPPORT.NAME[RUNPROGRAM] := 'RUNPGM ';
12030 RUNTIME_SUPPORT.NAME[READPGMPARAMETER] := 'GETPAR ';
12040 RUNTIME_SUPPORT.NAME[READSTRING] := 'READS ';
12050 RUNTIME_SUPPORT.NAME[READPACKEDSTRING] := 'READPS ';
12060 RUNTIME_SUPPORT.NAME[ASCIIDATE] := 'DATE. ';
12070 RUNTIME_SUPPORT.NAME[ASCIITIME] := 'TIME. ';
12080 RUNTIME_SUPPORT.NAME[FREE] := 'FREE ';
12090 RUNTIME_SUPPORT.NAME[READIRANGE] := 'READIR ';
12100 RUNTIME_SUPPORT.NAME[READCRANGE] := 'READCR ';
12110 RUNTIME_SUPPORT.NAME[READRRANGE] := 'READRR ';
12120 RUNTIME_SUPPORT.NAME[READISET] := 'READIS ';
12130 RUNTIME_SUPPORT.NAME[READCSET] := 'READCS ';
12140 RUNTIME_SUPPORT.NAME[READDSET] := 'READDS ';
12150 RUNTIME_SUPPORT.NAME[READSCALAR] := 'READSC ';
12160 RUNTIME_SUPPORT.NAME[WRTISET] := 'WRTISE ';
12170 RUNTIME_SUPPORT.NAME[WRTCSET] := 'WRTCSE ';
12180 RUNTIME_SUPPORT.NAME[WRTDSET] := 'WRTDSE ';
12190 RUNTIME_SUPPORT.NAME[WRTSCALAR] := 'WRTSCA ';
12200 RUNTIME_SUPPORT.NAME[WRITEDEFINTEGER] := 'WRTIN1 ';
12210 RUNTIME_SUPPORT.NAME[WRITEDEFOCTAL] := 'WRTOC1 ';
12220 RUNTIME_SUPPORT.NAME[WRITEDEFHEXADECIMAL] := 'WRTHX1 ';
12230 RUNTIME_SUPPORT.NAME[WRITEDEFBOOLEAN] := 'WRTBO1 ';
12240 RUNTIME_SUPPORT.NAME[WRITEDEF1REAL] := 'WRTRE1 ';
12250 RUNTIME_SUPPORT.NAME[WRITEDEFCHARACTER] := 'WRITC1 ';
12260 RUNTIME_SUPPORT.NAME[WRITEDEFSTRING] := 'WRTUS1 ';
12270 RUNTIME_SUPPORT.NAME[WRITEDEFPACKEDSTRING] := 'WRTPS1 ';
12280 RUNTIME_SUPPORT.NAME[WRITEDEF2REAL] := 'WRTRE2 ';
12290 RUNTIME_SUPPORT.NAME[FORTRANRESET] := 'RESET. ';
12300 RUNTIME_SUPPORT.NAME[FORTRANEXIT] := 'EXIT. ';
12310 RUNTIME_SUPPORT.NAME[CLOSEFILE] := 'CLSFIL ';
12320 RUNTIME_SUPPORT.NAME[INPUTERROR] := 'IPTERR ';
12330 RUNTIME_SUPPORT.NAME[ERRORINSET] := 'SETERR ';
12340 RUNTIME_SUPPORT.NAME[NOCOREAVAILABLE] := 'NOCORE ';
12350
12360 READ_SUPPORT[INTEGERFORM,SUBRANGE] := READIRANGE;
12370 READ_SUPPORT[INTEGERFORM,POWER] := READISET;
12380 READ_SUPPORT[INTEGERFORM,SCALAR] := READINTEGER;
12390
12400 READ_SUPPORT[REALFORM,SUBRANGE] := READRRANGE;
12410 READ_SUPPORT[REALFORM,SCALAR] := READREAL;
12420
12430 READ_SUPPORT[CHARFORM,SUBRANGE] := READCRANGE;
12440 READ_SUPPORT[CHARFORM,POWER] := READCSET;
12450 READ_SUPPORT[CHARFORM,SCALAR] := READCHARACTER;
12460
12470 READ_SUPPORT[DECLAREDFORM,SUBRANGE] := READSCALAR;
12480 READ_SUPPORT[DECLAREDFORM,POWER] := READDSET;
12490 READ_SUPPORT[DECLAREDFORM,SCALAR] := READSCALAR;
12500
12510 WRITE_SUPPORT[INTEGERFORM,POWER] := WRTISET;
12520 WRITE_SUPPORT[CHARFORM,POWER] := WRTCSET;
12530 WRITE_SUPPORT[DECLAREDFORM,POWER] := WRTDSET;
12540 WRITE_SUPPORT[DECLAREDFORM,SUBRANGE] := WRTSCALAR;
12550 WRITE_SUPPORT[DECLAREDFORM,SCALAR] := WRTSCALAR;
12560
12570 END (*RUNTIME-, DEBUG-SUPPORT NAMES*) ;
12580
12590 INITPROCEDURE (*INITSCALARS*) ;
12600 BEGIN
12610 PROGRAMNAME := ' ';
12620 SOURCE_FILE := ' '; OBJECT_FILE := ' ';
12630
12640 FORWARD_POINTER_TYPE := NIL; LASTBTP := NIL; FGLOBPTR := NIL ; FILEPTR := NIL ;
12650 LOCALPFPTR := NIL; EXTERNPFPTR := NIL; GLOBTESTP := NIL; LAST_LABEL := NIL;
12660 ERRMPTR := NIL; PARMPTR := NIL; DECLSCALPTR := NIL; BACKWPARMPTR := NIL;
12670 SDECLSCALPTR := NIL; SEXTERNPFPTR := NIL; SFILEPTR := NIL;
12680 SLASTBTP := NIL; GLOBNEWLINK := NIL;
12690
12700 LIST_CODE := FALSE; LOADNOPTR := TRUE; INITGLOBALS := FALSE ; RUNTIME_CHECK := TRUE;
12710 FOLLOWERROR := FALSE; ERRORINLINE := FALSE; RESET_POSSIBLE := TRUE; FIRST_SYMBOL := TRUE;
12720 DP := TRUE; SEARCH_ERROR := TRUE; ERROR_FLAG := FALSE ; EXTERNAL := FALSE; OVERRUN := FALSE;
12730 ENTRY_DONE := FALSE; DEBUG := FALSE; DEBUG_SWITCH := FALSE; LPTFILE := FALSE;
12740 ERROR_EXIT := FALSE; TTYREAD := FALSE; LOAD_AND_GO := FALSE; CROSS_REFERENCE := FALSE;
12750 FORTRAN_ENVIROMENT := FALSE;
12760
12770 IC := HIGH_START; (*START OF HIGHSEGMENT*)
12780 LC := LOW_START; (*START OF LOWSEGMENT AVAILABLE TO PROGRAM*)
12790 CHCNT := 0; LINECNT := 10; PAGECNT := 1; LASTLINE := -1; LASTPAGE := 0;
12800 AOS := B0; LIBRARY_INDEX := 0; ERRINX := 0; ERRORCOUNT := 0; ENTRIES := 0;
12810 DEBUGENTRY.STANDARDIDTREE := 0; DEBUGENTRY.GLOBALIDTREE := 0; START_CHANNEL := 0;
12820 PARREGCMAX := STDPARREGCMAX; CHCNTMAX := STDCHCNTMAX;
12830 CODE_SIZE := CIXMAX; RUNCORE := 0; JUMPER := 0; JUMP_ADDRESS := 0; PROGRAM_COUNT := 0
12840
12850 END (*INITSCALARS*) ;
12860
12870 INITPROCEDURE (*INITSETS*) ;
12880 BEGIN
12890
12900 DIGITS := ['0'..'9'];
12910 LETTERS := ['A'..'Z'];
12920 HEXADIGITS := ['0'..'9','A'..'F'];
12930 LETTERSORDIGITS := [ '0'..'9','A'..'Z'];
12940 LETTERSDIGITSORLEFTARROW := ['0'..'9','A'..'Z','_'];
12950 LANGUAGESYS := [FORTRANSY,PASCALSY];
12960 CONSTBEGSYS := [ADDOP,INTCONST,REALCONST,STRINGCONST,IDENT];
12970 SIMPTYPEBEGSYS := [ADDOP,INTCONST,REALCONST,STRINGCONST,IDENT,LPARENT] ;
12980 TYPEBEGSYS := [ADDOP,INTCONST,REALCONST,STRINGCONST,IDENT,LPARENT,ARROW,
12990 PACKEDSY,ARRAYSY,RECORDSY,SETSY,FILESY] ;
13000 TYPEDELS := [ARRAYSY,RECORDSY,SETSY,FILESY];
13010 BLOCKBEGSYS := [LABELSY,CONSTSY,TYPESY,VARSY,INITPROCSY,PROCEDURESY,FUNCTIONSY,BEGINSY];
13020 SELECTSYS := [ARROW,PERIOD,LBRACK];
13030 FACBEGSYS := [INTCONST,REALCONST,STRINGCONST,IDENT,LPARENT,LBRACK,NOTSY];
13040 STATBEGSYS := [BEGINSY,GOTOSY,IFSY,WHILESY,REPEATSY,LOOPSY,FORSY,WITHSY,CASESY]
13050
13060 END (*INITSETS*) ;
13070
13080 INITPROCEDURE (*RESERVED WORDS*) ;
13090 BEGIN
13100
13110 RW[ 1] := 'IF '; RW[ 2] := 'DO '; RW[ 3] := 'OF ';
13120 RW[ 4] := 'TO '; RW[ 5] := 'IN '; RW[ 6] := 'OR ';
13130 RW[ 7] := 'END '; RW[ 8] := 'FOR '; RW[ 9] := 'VAR ';
13140 RW[10] := 'DIV '; RW[11] := 'MOD '; RW[12] := 'SET ';
13150 RW[13] := 'AND '; RW[14] := 'NOT '; RW[15] := 'THEN ';
13160 RW[16] := 'ELSE '; RW[17] := 'WITH '; RW[18] := 'GOTO ';
13170 RW[19] := 'LOOP '; RW[20] := 'CASE '; RW[21] := 'TYPE ';
13180 RW[22] := 'FILE '; RW[23] := 'EXIT '; RW[24] := 'BEGIN ';
13190 RW[25] := 'UNTIL '; RW[26] := 'WHILE '; RW[27] := 'ARRAY ';
13200 RW[28] := 'CONST '; RW[29] := 'LABEL '; RW[30] := 'EXTERN ';
13210 RW[31] := 'RECORD '; RW[32] := 'DOWNTO '; RW[33] := 'PACKED ';
13220 RW[34] := 'OTHERS '; RW[35] := 'REPEAT '; RW[36] := 'FORTRAN ';
13230 RW[37] := 'FORWARD '; RW[38] := 'PROGRAM '; RW[39] := 'FUNCTION ';
13240 RW[40] := 'PROCEDURE '; RW[41] := 'SEGMENTED '; RW[42] := 'INITPROCED';
13250
13260 FRW[1] := 1; FRW[2] := 1; FRW[3] := 7; FRW[4] := 15; FRW[5] := 24;
13270 FRW[6] := 30; FRW[7] := 36; FRW[8] := 39; FRW[9] := 40; FRW[10] := 42;
13280 FRW[11] := 43
13290
13300 END (*RESERVED WORDS*) ;
13310
13320 INITPROCEDURE (*SYMBOLS*) ;
13330 BEGIN
13340
13350 RSY[1]:=IFSY; RSY[2]:=DOSY; RSY[3]:=OFSY;
13360 RSY[4]:=TOSY; RSY[8]:=FORSY; RSY[12]:=SETSY;
13370 RSY[5]:=RELOP; RSY[6]:=ADDOP; RSY[7]:=ENDSY;
13380 RSY[9]:=VARSY; RSY[10]:=MULOP; RSY[11]:=MULOP;
13390 RSY[13]:=MULOP; RSY[14]:=NOTSY; RSY[15]:=THENSY;
13400 RSY[16]:=ELSESY; RSY[17]:=WITHSY; RSY[18]:=GOTOSY;
13410 RSY[19]:=LOOPSY; RSY[20]:=CASESY; RSY[21]:=TYPESY;
13420 RSY[22]:=FILESY; RSY[23]:=EXITSY; RSY[24]:=BEGINSY;
13430 RSY[25]:=UNTILSY; RSY[26]:=WHILESY; RSY[27]:=ARRAYSY;
13440 RSY[28]:=CONSTSY; RSY[29]:=LABELSY; RSY[30]:=EXTERNSY;
13450 RSY[31]:=RECORDSY; RSY[32]:=DOWNTOSY; RSY[33]:=PACKEDSY;
13460 RSY[34]:=OTHERSSY; RSY[35]:=REPEATSY; RSY[36]:=FORTRANSY;
13470 RSY[37]:=FORWARDSY; RSY[38]:=PROGRAMSY; RSY[39]:=FUNCTIONSY;
13480 RSY[40]:=PROCEDURESY; RSY[41]:=SEGMENTSY; RSY[42]:=INITPROCSY;
13490
13500 SSY['A'] := OTHERSY; SSY['B'] := OTHERSY; SSY['C'] := OTHERSY;
13510 SSY['D'] := OTHERSY; SSY['E'] := OTHERSY; SSY['F'] := OTHERSY;
13520 SSY['G'] := OTHERSY; SSY['H'] := OTHERSY; SSY['I'] := OTHERSY;
13530 SSY['J'] := OTHERSY; SSY['K'] := OTHERSY; SSY['L'] := OTHERSY;
13540 SSY['M'] := OTHERSY; SSY['N'] := OTHERSY; SSY['O'] := OTHERSY;
13550 SSY['P'] := OTHERSY; SSY['Q'] := OTHERSY; SSY['R'] := OTHERSY;
13560 SSY['S'] := OTHERSY; SSY['T'] := OTHERSY; SSY['U'] := OTHERSY;
13570 SSY['V'] := OTHERSY; SSY['W'] := OTHERSY; SSY['X'] := OTHERSY;
13580 SSY['Y'] := OTHERSY; SSY['Z'] := OTHERSY; SSY['0'] := OTHERSY;
13590 SSY['1'] := OTHERSY; SSY['2'] := OTHERSY; SSY['3'] := OTHERSY;
13600 SSY['4'] := OTHERSY; SSY['5'] := OTHERSY; SSY['6'] := OTHERSY;
13610 SSY['7'] := OTHERSY; SSY['8'] := OTHERSY; SSY['9'] := OTHERSY;
13620 SSY['+'] := ADDOP; SSY['-'] := ADDOP; SSY['*'] := MULOP;
13630 SSY['/'] := MULOP; SSY['('] := LPARENT; SSY[')'] := RPARENT;
13640 SSY['$'] := OTHERSY; SSY['='] := RELOP; SSY[' '] := OTHERSY;
13650 SSY[','] := COMMA; SSY['.'] := PERIOD; SSY[''''] := OTHERSY;
13660 SSY['['] := LBRACK; SSY[']'] := RBRACK; SSY[':'] := COLON;
13670 SSY['#'] := OTHERSY; SSY['%'] := OTHERSY; SSY['!'] := OTHERSY;
13680 SSY['&'] := OTHERSY; SSY['^'] := ARROW; SSY['\'] := OTHERSY;
13690 SSY['<'] := RELOP; SSY['>'] := RELOP; SSY['@'] := OTHERSY;
13700 SSY['"'] := OTHERSY; SSY['?'] := OTHERSY; SSY[';'] := SEMICOLON;
13710 SSY['_'] := OTHERSY;
13720
13730 END (*SYMBOLS*) ;
13740
13750 INITPROCEDURE (*OPERATORS*) ;
13760 BEGIN
13770
13780 ROP[ 1] := NOOP; ROP[ 2] := NOOP; ROP[ 3] := NOOP; ROP[ 4] := NOOP;
13790 ROP[ 5] := INOP; ROP[ 6] := OROP; ROP[ 7] := NOOP; ROP[ 8] := NOOP;
13800 ROP[ 9] := NOOP; ROP[10] := IDIV; ROP[11] := IMOD; ROP[12] := NOOP;
13810 ROP[13] :=ANDOP; ROP[14] := NOOP; ROP[15] := NOOP; ROP[16] := NOOP;
13820 ROP[17] := NOOP; ROP[18] := NOOP; ROP[19] := NOOP; ROP[20] := NOOP;
13830 ROP[21] := NOOP; ROP[22] := NOOP; ROP[23] := NOOP; ROP[24] := NOOP;
13840 ROP[25] := NOOP; ROP[26] := NOOP; ROP[27] := NOOP; ROP[28] := NOOP;
13850 ROP[29] := NOOP; ROP[30] := NOOP; ROP[31] := NOOP; ROP[32] := NOOP;
13860 ROP[33] := NOOP; ROP[34] := NOOP; ROP[35] := NOOP; ROP[36] := NOOP;
13870 ROP[37] := NOOP; ROP[38] := NOOP; ROP[39] := NOOP; ROP[40] := NOOP;
13880 ROP[41] := NOOP; ROP[42] := NOOP;
13890
13900 SOP['+'] := PLUS; SOP['-'] := MINUS; SOP['*'] := MUL; SOP['/'] := RDIV;
13910 SOP['='] := EQOP; SOP['#'] := NOOP; SOP['!'] := NOOP; SOP['&'] := NOOP;
13920 SOP['<'] := LTOP; SOP['>'] := GTOP; SOP['@'] := NOOP; SOP['"'] := NOOP;
13930 SOP[' '] := NOOP; SOP['$'] := NOOP; SOP['%'] := NOOP; SOP['('] := NOOP;
13940 SOP[')'] := NOOP; SOP[','] := NOOP; SOP['.'] := NOOP; SOP['0'] := NOOP;
13950 SOP['1'] := NOOP; SOP['2'] := NOOP; SOP['3'] := NOOP; SOP['4'] := NOOP;
13960 SOP['5'] := NOOP; SOP['6'] := NOOP; SOP['7'] := NOOP; SOP['8'] := NOOP;
13970 SOP['9'] := NOOP; SOP[':'] := NOOP; SOP[';'] := NOOP; SOP['?'] := NOOP;
13980 SOP['A'] := NOOP; SOP['B'] := NOOP; SOP['C'] := NOOP; SOP['D'] := NOOP;
13990 SOP['E'] := NOOP; SOP['F'] := NOOP; SOP['G'] := NOOP; SOP['H'] := NOOP;
14000 SOP['I'] := NOOP; SOP['J'] := NOOP; SOP['K'] := NOOP; SOP['L'] := NOOP;
14010 SOP['M'] := NOOP; SOP['N'] := NOOP; SOP['O'] := NOOP; SOP['P'] := NOOP;
14020 SOP['Q'] := NOOP; SOP['R'] := NOOP; SOP['S'] := NOOP; SOP['T'] := NOOP;
14030 SOP['U'] := NOOP; SOP['V'] := NOOP; SOP['W'] := NOOP; SOP['X'] := NOOP;
14040 SOP['Y'] := NOOP; SOP['Z'] := NOOP; SOP['['] := NOOP; SOP['\'] := NOOP;
14050 SOP[']'] := NOOP; SOP['^'] := NOOP; SOP['_'] := NOOP; SOP[''''] := NOOP
14060
14070 END (*OPERATORS*) ;
14080
14090 INITPROCEDURE (*RECORD SIZES*);
14100 BEGIN
14110
14120 DEBENTRY_SIZE := 8;
14130
14140 IDRECSIZE[TYPES] := 5;
14150 IDRECSIZE[KONST] := 6;
14160 IDRECSIZE[VARS] := 6;
14170 IDRECSIZE[FIELD] := 6;
14180 IDRECSIZE[PROC] := 5;
14190 IDRECSIZE[FUNC] := 5;
14200 IDRECSIZE[LABELS] := 5;
14210 STRECSIZE[SCALAR] := 2;
14220 STRECSIZE[SUBRANGE] := 4;
14230 STRECSIZE[POINTER] := 2;
14240 STRECSIZE[POWER] := 2;
14250 STRECSIZE[ARRAYS] := 3;
14260 STRECSIZE[RECORDS] := 3;
14270 STRECSIZE[FILES] := 2;
14280 STRECSIZE[TAGFWITHID] := 3;
14290 STRECSIZE[TAGFWITHOUTID] := 2;
14300 STRECSIZE[VARIANT] := 4
14310
14320 END (*RECORD SIZES*);
14330
14340
14350 INITPROCEDURE (*ERROR MESSAGES*) ;
14360 BEGIN
14370
14380 ERRMESS15[ 1] := '":" EXPECTED ';
14390 ERRMESS15[ 2] := '")" EXPECTED ';
14400 ERRMESS15[ 3] := '"(" EXPECTED ';
14410 ERRMESS15[ 4] := '"[" EXPECTED ';
14420 ERRMESS15[ 5] := '"]" EXPECTED ';
14430 ERRMESS15[ 6] := '";" EXPECTED ';
14440 ERRMESS15[ 7] := '"=" EXPECTED ';
14450 ERRMESS15[ 8] := '"," EXPECTED ';
14460 ERRMESS15[ 9] := '":=" EXPECTED ';
14470 ERRMESS15[10] := '"OF" EXPECTED ';
14480 ERRMESS15[11] := '"DO" EXPECTED ';
14490 ERRMESS15[12] := '"IF" EXPECTED ';
14500 ERRMESS15[13] := '"END" EXPECTED ';
14510 ERRMESS15[14] := '"THEN" EXPECTED';
14520 ERRMESS15[15] := '"EXIT" EXPECTED';
14530 ERRMESS15[16] := 'ILLEGAL SYMBOL ';
14540 ERRMESS15[17] := 'NO SIGN ALLOWED';
14550 ERRMESS15[18] := 'NUMBER EXPECTED';
14560 ERRMESS15[19] := 'NOT IMPLEMENTED';
14570 ERRMESS15[20] := 'ERROR IN TYPE ';
14580 ERRMESS15[21] := 'COMPILER ERROR ';
14590 ERRMESS15[22] := 'DEVICE EXPECTED';
14600 ERRMESS15[23] := 'ERROR IN FACTOR';
14610 ERRMESS15[24] := 'TOO MANY DIGITS';
14620
14630 ERRMESS20[ 1] := '"BEGIN" EXPECTED ';
14640 ERRMESS20[ 2] := '"UNTIL" EXPECTED ';
14650 ERRMESS20[ 3] := 'ERROR IN OPTIONS ';
14660 ERRMESS20[ 4] := 'CONSTANT TOO LARGE ';
14670 ERRMESS20[ 5] := 'DIGIT MUST FOLLOW ';
14680 ERRMESS20[ 6] := 'EXPONENT TOO LARGE ';
14690 ERRMESS20[ 7] := 'CONSTANT EXPECTED ';
14700 ERRMESS20[ 8] := 'SIMPLE TYPE EXPECTED';
14710 ERRMESS20[ 9] := 'IDENTIFIER EXPECTED ';
14720 ERRMESS20[10] := 'REALTYPE NOT ALLOWED';
14730 ERRMESS20[11] := 'MULTIDEFINED LABEL ';
14740 ERRMESS20[12] := 'FILENAME EXPECTED ';
14750 ERRMESS20[13] := 'SET TYPE EXPECTED ';
14760 ERRMESS20[14] := 'UNDEFINED LABEL ';
14770 ERRMESS20[15] := 'UNDECLARED LABEL ';
14780
14790 ERRMESS25[ 1] := '"TO"/"DOWNTO" EXPECTED ';
14800 ERRMESS25[ 2] := '8 OR 9 IN OCTAL NUMBER ';
14810 ERRMESS25[ 3] := 'IDENTIFIER NOT DECLARED ';
14820 ERRMESS25[ 4] := 'FILE NOT ALLOWED HERE ';
14830 ERRMESS25[ 5] := 'INTEGER CONSTANT EXPECTED';
14840 ERRMESS25[ 6] := 'ERROR IN PARAMETERLIST ';
14850 ERRMESS25[ 7] := 'ALREADY FORWARD DECLARED ';
14860 ERRMESS25[ 8] := 'THIS FORMAT FOR REAL ONLY';
14870 ERRMESS25[ 9] := 'VARIANTTYPE MUST BE ARRAY';
14880 ERRMESS25[10] := 'TYPE CONFLICT OF OPERANDS';
14890 ERRMESS25[11] := 'MULTIDEFINED CASE LABEL ';
14900 ERRMESS25[12] := 'FOR INTEGER ONLY "O"/"H" ';
14910 ERRMESS25[13] := 'ARRAY INDEX OUT OF BOUNDS';
14920 ERRMESS25[14] := 'MISSING FILE DECLARATION ';
14930 ERRMESS25[15] := 'LABEL CONSTANT TOO GREAT ';
14940 ERRMESS25[16] := 'LABEL ALREADY DECLARED ';
14950 ERRMESS25[17] := 'END OF PROGRAM NOT FOUND ';
14960 ERRMESS25[18] := 'MORE THAN 72 SET ELEMENTS';
14970
14980 ERRMESS30[ 1] := 'STRING CONSTANT IS TOO LONG ';
14990 ERRMESS30[ 2] := 'IDENTIFIER ALREADY DECLARED ';
15000 ERRMESS30[ 3] := 'SUBRANGE BOUNDS MUST BE SCALAR';
15010 ERRMESS30[ 4] := 'INCOMPATIBLE SUBRANGE TYPES ';
15020 ERRMESS30[ 5] := 'INCOMPATIBLE WITH TAGFIELDTYPE';
15030 ERRMESS30[ 6] := 'INDEX TYPE MAY NOT BE INTEGER ';
15040 ERRMESS30[ 7] := 'TYPE OF VARIABLE IS NOT ARRAY ';
15050 ERRMESS30[ 8] := 'TYPE OF VARIABLE IS NOT RECORD';
15060 ERRMESS30[ 9] := 'NO SUCH FIELD IN THIS RECORD ';
15070 ERRMESS30[10] := 'EXPRESSION TOO COMPLICATED ';
15080 ERRMESS30[11] := 'ILLEGAL TYPE OF OPERAND(S) ';
15090 ERRMESS30[12] := 'TESTS ON EQUALITY ALLOWED ONLY';
15100 ERRMESS30[13] := 'STRICT INCLUSION NOT ALLOWED ';
15110 ERRMESS30[14] := 'FILE COMPARISON NOT ALLOWED ';
15120 ERRMESS30[15] := 'ILLEGAL TYPE OF EXPRESSION ';
15130 ERRMESS30[16] := 'VALUE OF CASE LABEL TOO LARGE ';
15140 ERRMESS30[17] := 'TOO MANY NESTED WITHSTATEMENTS';
15150 ERRMESS30[18] := 'INVALID OR NO PROGRAM HEADING ';
15160 ERRMESS30[19] := 'TOO MANY LABEL DECLARATIONS ';
15170 ERRMESS30[20] := 'INCOMPATIBLE FORMALPARAMETER ';
15180
15190 ERRMESS35[ 1] := 'STRING CONSTANT CONTAINS "<CR><LF>"';
15200 ERRMESS35[ 2] := 'LABEL NOT DECLARED ON THIS LEVEL ';
15210 ERRMESS35[ 3] := 'CALL NOT ALLOWED IN EXTERN PROGRAMS';
15220 ERRMESS35[ 4] := 'MORE THAN 12 FILES DECLARED BY USER';
15230 ERRMESS35[ 5] := 'FILE AS VALUE PARAMETER NOT ALLOWED';
15240 ERRMESS35[ 6] := 'TOO MUCH CODE: USE OPTION CODESIZE ';
15250 ERRMESS35[ 7] := 'NO PACKED STRUCTURE ALLOWED HERE ';
15260 ERRMESS35[ 8] := 'VARIANT MUST BELONG TO TAGFIELDTYPE';
15270 ERRMESS35[ 9] := 'TYPE OF OPERAND(S) MUST BE BOOLEAN ';
15280 ERRMESS35[10] := 'SET ELEMENT TYPES NOT COMPATIBLE ';
15290 ERRMESS35[11] := 'ASSIGNMENT TO FILES NOT ALLOWED ';
15300 ERRMESS35[12] := 'TOO MANY LABELS IN THIS PROCEDURE ';
15310 ERRMESS35[13] := 'INITPROCEDURE NOT ALLOWED HERE ';
15320 ERRMESS35[14] := 'CONTROL VARIABLE MAY NOT BE FORMAL ';
15330 ERRMESS35[15] := 'ILLEGAL TYPE OF FOR-CONTROLVARIABLE';
15340 ERRMESS35[16] := 'ONLY PACKED FILE OF CHAR ALLOWED ';
15350 ERRMESS35[17] := 'CONSTANT NOT IN BOUNDS OF SUBRANGE ';
15360
15370 ERRMESS40[ 1] := 'IDENTIFIER IS NOT OF APPROPRIATE CLASS ';
15380 ERRMESS40[ 2] := 'TAGFIELD TYPE MUST BE SCALAR OR SUBRANGE';
15390 ERRMESS40[ 3] := 'INDEX TYPE MUST BE SCALAR OR SUBRANGE ';
15400 ERRMESS40[ 4] := 'TOO MANY NESTED SCOPES OF IDENTIFIERS ';
15410 ERRMESS40[ 5] := 'POINTER FORWARD REFERENCE UNSATISFIED ';
15420 ERRMESS40[ 6] := 'PREVIOUS DECLARATION WAS NOT FORWARD ';
15430 ERRMESS40[ 7] := 'TYPE OF VARIABLE MUST BE FILE OR POINTER';
15440 ERRMESS40[ 8] := 'MISSING CORRESPONDING VARIANTDECLARATION';
15450 ERRMESS40[ 9] := 'MORE THAN 6 VARIANTS IN CALL OF "NEW" ';
15460 ERRMESS40[10] := 'MORE THAN FOUR ERRORS IN THIS SOURCELINE';
15470 ERRMESS40[11] := 'NO INITIALISATION ON RECORDS OR FILES ';
15480
15490 ERRMESS45[ 1] := 'LOW BOUND MAY NOT BE GREATER THAN HIGH BOUND ';
15500 ERRMESS45[ 2] := 'IDENTIFIER OR "CASE" EXPECTED IN FIELDLIST ';
15510 ERRMESS45[ 3] := 'TOO MANY NESTED PROCEDURES AND/OR FUNCTIONS ';
15520 ERRMESS45[ 4] := 'FILE DECLARATION IN PROCEDURES NOT ALLOWED ';
15530 ERRMESS45[ 5] := 'MISSING RESULT TYPE IN FUNCTION DECLARATION ';
15540 ERRMESS45[ 6] := 'ASSIGNMENT TO FORMAL FUNCTION IS NOT ALLOWED ';
15550 ERRMESS45[ 7] := 'INDEX TYPE IS NOT COMPATIBLE WITH DECLARATION';
15560 ERRMESS45[ 8] := 'ERROR IN TYPE OF STANDARD PROCEDURE PARAMETER';
15570 ERRMESS45[ 9] := 'ERROR IN TYPE OF STANDARD FUNCTION PARAMETER ';
15580 ERRMESS45[10] := 'REAL AND STRING TAGFIELDS NOT IMPLEMENTED ';
15590 ERRMESS45[11] := 'SET ELEMENT TYPE MUST BE SCALAR OR SUBRANGE ';
15600 ERRMESS45[12] := 'ONLY ASSIGNMENTS ALLOWED IN INITPROCEDURES ';
15610 ERRMESS45[13] := 'NO CONSTANT OR EXPRESSION FOR VAR ARGUMENT ';
15620 ERRMESS45[14] := 'EXTERN DECLARATION NOT ALLOWED IN PROCEDURES ';
15630 ERRMESS45[15] := 'BODY OF FORWARD DECLARED PROCEDURE MISSING ';
15640 ERRMESS45[16] := 'DOUBLE FILE SPECIFICATION IN PROGRAM HEADING ';
15650 ERRMESS45[17] := 'TOO MUCH CODE FOR DEBUG: TRY MORE "CODESIZE" ';
15660 ERRMESS45[18] := 'NO FORMAL-PROC/FUNC IN FORTRAN-SUBROUTINE ';
15670
15680 ERRMESS50[ 1] := 'TOO MANY FORWARD REFERENCES OF PROCEDURE ENTRIES ';
15690 ERRMESS50[ 2] := 'ASSIGNMENT TO STANDARD FUNCTION IS NOT ALLOWED ';
15700 ERRMESS50[ 3] := 'PARAMETER TYPE DOES NOT AGREE WITH DECLARATION ';
15710 ERRMESS50[ 4] := 'INITIALISATION ONLY BY ASSIGNMENT OF CONSTANTS ';
15720 ERRMESS50[ 5] := 'LABEL TYPE INCOMPATIBLE WITH SELECTING EXPRESSION ';
15730 ERRMESS50[ 6] := 'STATEMENT MUST END WITH ";","END","ELSE"OR"UNTIL" ';
15740 ERRMESS50[ 7] := 'NOT ALLOWED IN INITPROCEDURES (PACKED STRUCTURE?) ';
15750 ERRMESS50[ 8] := 'GOTO INTO MAIN PROGRAM NOT ALLOWED IF "EXTERN" ';
15760 ERRMESS50[ 9] := 'ASSIGNMENT TO FUNCTION NOT ALLOWED ON THIS LEVEL ';
15770 ERRMESS50[10] := 'NO STD- OR FORTRAN-PROC/FUNC AS ACTUAL-PROC/FUNC ';
15780
15790 ERRMESS55[ 1] := 'FUNCTION RESULT TYPE MUST BE SCALAR,SUBRANGE OR POINTER';
15800 ERRMESS55[ 2] := 'REPETITION OF RESULT TYPE NOT ALLOWED IF FORW. DECL. ';
15810 ERRMESS55[ 3] := 'REPETITION OF PARAMETER LIST NOT ALLOWED IF FORW. DECL.';
15820 ERRMESS55[ 4] := 'NUMBER OF PARAMETERS DOES NOT AGREE WITH DECLARATION ';
15830 ERRMESS55[ 5] := 'RESULT TYPE OF PARAMETER-FUNC DOES NOT AGREE WITH DECL.';
15840 ERRMESS55[ 6] := 'SELECTED EXPRESSION MUST HAVE TYPE OF CONTROL VARIABLE '
15850
15860 END (*ERROR MESSAGES*) ;
15870
15880 (*----------------------------------------------------------------------------*)
15890
15900 PROCEDURE INIT_COMPILE;
15910 BEGIN
15920
15930 PROGRAM_COUNT := PROGRAM_COUNT + 1;
15940
15950 PROGRAMNAME := ' ';
15960
15970 FORWARD_POINTER_TYPE := NIL; LASTBTP := NIL;
15980 FGLOBPTR := NIL; FILEPTR := SFILEPTR;
15990 LOCALPFPTR := NIL; DECLSCALPTR := SDECLSCALPTR;
16000 GLOBTESTP := NIL; LAST_LABEL := NIL;
16010 ERRMPTR := NIL; PARMPTR := NIL;
16020 BACKWPARMPTR := NIL; EXTERNPFPTR := SEXTERNPFPTR;
16030 LASTBTP := SLASTBTP;
16040
16050 LOADNOPTR := TRUE; INITGLOBALS := FALSE;
16060 FOLLOWERROR := FALSE; ERRORINLINE := FALSE;
16070 DP := TRUE; SEARCH_ERROR := TRUE;
16080 ERROR_FLAG := FALSE; OVERRUN := FALSE;
16090 ERROR_EXIT := FALSE; TTYREAD := FALSE;
16100 ENTRY_DONE := FALSE; FIRST_SYMBOL := TRUE;
16110 RESET_POSSIBLE := TRUE;
16120
16130 IC := HIGH_START; LC := LOW_START;
16140 LIBRARY_INDEX := 0; ERRINX := 0;
16150 ERRORCOUNT := 0; ENTRIES := 0;
16160 DEBUGENTRY.STANDARDIDTREE := 0; DEBUGENTRY.GLOBALIDTREE := 0;
16170 JUMPER := 0; JUMP_ADDRESS := 0;
16180 AOS := B0;
16190
16200 FOR I := 1 TO 18 DO ARRAYBPS[I].STATE := UNUSED;
16210 ARRAYBPS[7].STATE := REQUESTED;
16220
16230 RTIME[0] := CLOCK;
16240 FOR I := 1 TO STDCHCNTMAX DO ERRLINE[I] := ' ';
16250 FOR SUPPORT_INDEX := FIRST(SUPPORT_INDEX) TO LAST(SUPPORT_INDEX) DO
16260 RUNTIME_SUPPORT.LINK[SUPPORT_INDEX] := 0;
16270
16280 RELOCATION_BLOCK.COUNT := 0;
16290
16300 TOP := 1; LEVEL := 1;
16310 WITH DISPLAY[1] DO
16320 BEGIN
16330 FNAME := NIL; OCCUR := BLCK
16340 END;
16350 WHILE EXTERNPFPTR <> NIL DO
16360 WITH EXTERNPFPTR^ DO
16370 BEGIN
16380 LINKCHAIN[0] := 0; EXTERNPFPTR := PFCHAIN
16390 END;
16400 EXTERNPFPTR := SEXTERNPFPTR;
16410 WHILE DECLSCALPTR <> NIL DO
16420 WITH DECLSCALPTR^ DO
16430 BEGIN
16440 VECTORADDR := 0; VECTORCHAIN := 0;
16450 REQUEST := FALSE; DECLSCALPTR := NEXTSCALAR
16460 END;
16470 DECLSCALPTR := SDECLSCALPTR;
16480 WHILE LASTBTP <> NIL DO
16490 WITH LASTBTP^ DO
16500 BEGIN
16510 ARRAYSP^.ARRAYBPADDR := 0; LASTBTP := LAST
16520 END;
16530 LASTBTP := SLASTBTP
16540
16550 END (* INIT_COMPILE *);
16560
16570 PROCEDURE ERROR(FERRNR: INTEGER);
16580 VAR
16590 LPOS,LARW : INTEGER;
16600 BEGIN
16610 ERRORCOUNT := ERRORCOUNT + 1;
16620 IF NOT FOLLOWERROR
16630 THEN
16640 BEGIN
16650 ERROR_FLAG := TRUE ;
16660 IF ERRINX >= MAXERR
16670 THEN
16680 BEGIN
16690 ERRLIST[MAXERR].NMR := 410; ERRINX := MAXERR
16700 END
16710 ELSE
16720 BEGIN
16730 ERRINX := ERRINX + 1;
16740 WITH ERRLIST[ERRINX] DO
16750 BEGIN
16760 NMR := FERRNR; TIC := '^'
16770 END
16780 END;
16790 FOLLOWERROR := TRUE; ERRORINLINE := TRUE;
16800 IF (FERRNR <> 214) AND (FERRNR <> 356) AND (FERRNR <> 405) AND
16810 (FERRNR <> 465) AND (FERRNR <> 467) AND (FERRNR <> 264) AND
16820 (FERRNR <> 267)
16830 THEN
16840 IF EOLN(SOURCE)
16850 THEN ERRLINE [CHCNT] := '^'
16860 ELSE ERRLINE [CHCNT-1] := '^'
16870 ELSE ERRLIST[ERRINX].TIC := ' ';
16880 IF ERRINX > 1
16890 THEN WITH ERRLIST [ ERRINX-1] DO
16900 BEGIN
16910 LPOS := POS; LARW := ARW
16920 END;
16930 WITH ERRLIST [ERRINX] DO
16940 BEGIN
16950 POS := CHCNT;
16960 IF ERRINX = 1
16970 THEN ARW := 1
16980 ELSE
16990 IF LPOS = CHCNT
17000 THEN ARW := LARW
17010 ELSE ARW := LARW + 1
17020 END
17030 END
17040 END (*ERROR*) ;
17050
17060 PROCEDURE ENTERID(FCP: CTP);
17070 (*ENTER ID POINTED TO BY FCP INTO THE NAME-TABLE,
17080 WHICH ON EACH DECLARATION LEVEL IS ORGANISED AS
17090 AN UNBALANCED BINARY TREE*)
17100 VAR
17110 NEW_NAME: ALFA; LCP, LCP1: CTP; LLEFT: BOOLEAN;
17120 BEGIN
17130 LCP := DISPLAY[TOP].FNAME;
17140 IF LCP = NIL
17150 THEN DISPLAY[TOP].FNAME := FCP
17160 ELSE
17170 BEGIN
17180 NEW_NAME := FCP^.NAME;
17190 REPEAT
17200 LCP1 := LCP;
17210 IF LCP^.NAME <= NEW_NAME
17220 THEN
17230 BEGIN
17240 IF LCP^.NAME = NEW_NAME
17250 THEN (*NAME CONFLICT*)
17260 IF NEW_NAME[1] IN DIGITS
17270 THEN ERROR(266) (*MULTI-DECLARED LABEL*)
17280 ELSE ERROR(302) (*MULTI-DECLARED IDENTIFIER*) ;
17290 LCP := LCP^.RLINK; LLEFT := FALSE
17300 END
17310 ELSE
17320 BEGIN
17330 LCP := LCP^.LLINK; LLEFT := TRUE
17340 END
17350 UNTIL LCP = NIL;
17360 IF LLEFT
17370 THEN LCP1^.LLINK := FCP
17380 ELSE LCP1^.RLINK := FCP
17390 END;
17400 WITH FCP^ DO
17410 BEGIN
17420 LLINK := NIL; RLINK := NIL; SELFCTP := NIL
17430 END
17440 END (*ENTERID*) ;
17450
17460 PROCEDURE GET_DIRECTIVES;
17470
17480 (****************************************************************************************
17490 *
17500 * DECSYSTEM-10 CONCISE COMMAND LANGUAGE INTERFACE
17510 *
17520 * DEFINITIONS:
17530 *
17540 * <FILE SPECIFICATION> ::= <EMPTY> OR <FILENAME> OR
17550 * <DEVICE>:<FILENAME>.<EXTENSION>[<PROJECT>,<PROGRAMMER>]<<PROTECTION>>
17560 * (<SWITCH>/.../<SWITCH>)
17570 * /<SWITCH>.../<SWITCH>
17580 *
17590 * <PROGRAMNAME>, <DEVICE>, <FILENAME>, <EXTENSION> ::= <IDENTIFIER>
17600 * <PROJECT>, <PROGRAMMER>, <PROTECTION> ::= <UNSIGNED OCTAL NUMBER>
17610 * <SWITCH> ::= <IDENTIFIER> OR <IDENTIFIER>:<VALUE>
17620 * <VALUE> ::= <UNSIGNED DECIMAL NUMBER>
17630 *
17640 ****************************************************************************************)
17650
17660 TYPE
17670 ANYFILE = FILE OF INTEGER;
17680 PACK9 = PACKED ARRAY[1..9] OF CHAR;
17690 PACK6 = PACKED ARRAY[1..6] OF CHAR;
17700 PACK5 = PACKED ARRAY[1..5] OF CHAR;
17710 QUELLE_FORM = (TEMPFILE,COMMANDFILE,TELETYPEOUTPUT,TELETYPEINPUT,TELETYPE);
17720 DELIMITER = (BLANK,LPARENT,RPARENT,COMMA,POINT,SLASH,LESS,EQUAL,GREATER,RBRACK,LBRACK,COLON,EXCLAMATION,UNKNOWN);
17730 SWP = ^SWITCH_DESCRIPTOR;
17740 SWITCH_DESCRIPTOR = PACKED RECORD
17750 NAME: ALFA;
17760 LEFT, RIGHT: SWP;
17770 VALUE: INTEGER
17780 END;
17790
17800 VAR
17810 SOURCE_PROTECTION , SOURCE_UFD ,
17820 LIST_PROTECTION , LIST_UFD,
17830 OBJECT_PROTECTION , OBJECT_UFD : INTEGER ;
17840 SOURCE_DEVICE , LIST_DEVICE , OBJECT_DEVICE : PACK6 ;
17850 TMP_FILENAME, COM_FILENAME : PACK9;
17860 QUELLE: QUELLE_FORM;
17870 END_OF_FILENAME, DEFAULTED, ERROR : BOOLEAN;
17880 LASTCH: CHAR;
17890 CURRENT_SWITCH, NEW_SWITCH, SWITCH_TREE: SWP;
17900 DELIMITER1: ARRAY[' '..'/'] OF DELIMITER;
17910 DELIMITER2: ARRAY[':'..'>'] OF DELIMITER;
17920 DELIMITER3: ARRAY['['..']'] OF DELIMITER;
17930
17940 PROCEDURE STARTVALUES ;
17950 BEGIN
17960 QUELLE := TEMPFILE; ERROR := FALSE; DEFAULTED := TRUE; LASTCH := ' ';
17970 SWITCH_TREE := NIL; CURRENT_SWITCH := NIL;
17980 DELIMITER1[' '] := BLANK; DELIMITER1['!'] := EXCLAMATION;
17990 DELIMITER1['('] := LPARENT; DELIMITER1[')'] := RPARENT;
18000 DELIMITER1[','] := COMMA; DELIMITER1['.'] := POINT;
18010 DELIMITER1['/'] := SLASH;
18020 DELIMITER2[':'] := COLON; DELIMITER2['<'] := LESS;
18030 DELIMITER2['='] := EQUAL; DELIMITER2['>'] := GREATER;
18040 DELIMITER3['['] := LBRACK; DELIMITER3[']'] := RBRACK;
18050 END;
18060
18070 PROCEDURE ENTER(FNAME: ALFA; FVALUE: INTEGER);
18080
18090 PROCEDURE ENTER_SWITCH(FTREE: SWP);
18100 BEGIN
18110 WITH FTREE^ DO
18120 IF NEW_SWITCH^.NAME <> NAME
18130 THEN
18140 IF NEW_SWITCH^.NAME < NAME
18150 THEN
18160 IF LEFT = NIL
18170 THEN LEFT := NEW_SWITCH
18180 ELSE ENTER_SWITCH(LEFT)
18190 ELSE
18200 IF RIGHT = NIL
18210 THEN RIGHT := NEW_SWITCH
18220 ELSE ENTER_SWITCH(RIGHT)
18230 END (* ENTER_SWITCH *);
18240
18250 BEGIN (* ENTER *)
18260 NEW(NEW_SWITCH);
18270 WITH NEW_SWITCH^ DO
18280 BEGIN
18290 NAME := FNAME; VALUE := FVALUE;
18300 LEFT := NIL ; RIGHT := NIL
18310 END;
18320 IF SWITCH_TREE = NIL
18330 THEN SWITCH_TREE := NEW_SWITCH
18340 ELSE ENTER_SWITCH(SWITCH_TREE)
18350 END (* ENTER *);
18360
18370 (**********************************************************************
18380 *
18390 * FUNCTION OPTION
18400 *
18410 * - TEST IF <SWITCH> "SWITCHNAME" HAS BEEN
18420 * SPECIFIED IN THE DECSYSTEM-10 COMMAND-STRING
18430 * INTERPRETED BY PREVIOUS GETPARAMETER-/GETFILENAME-CALLS.
18440 *
18450 **********************************************************************)
18460
18470 FUNCTION OPTION(SWITCHNAME: ALFA): BOOLEAN;
18480
18490 FUNCTION FIND_SWITCH( FTREE: SWP): BOOLEAN;
18500 BEGIN
18510 IF FTREE <> NIL
18520 THEN
18530 WITH FTREE^ DO
18540 IF SWITCHNAME = NAME
18550 THEN
18560 BEGIN
18570 FIND_SWITCH := TRUE; CURRENT_SWITCH := FTREE
18580 END
18590 ELSE
18600 IF SWITCHNAME < NAME
18610 THEN
18620 FIND_SWITCH := FIND_SWITCH(LEFT)
18630 ELSE
18640 FIND_SWITCH := FIND_SWITCH(RIGHT)
18650 ELSE FIND_SWITCH := FALSE
18660 END (* FIND_SWITCH *);
18670
18680 BEGIN (*OPTION*)
18690 IF SWITCH_TREE = NIL
18700 THEN
18710 OPTION := FALSE
18720 ELSE
18730 OPTION := FIND_SWITCH(SWITCH_TREE)
18740 END (*OPTION*);
18750
18760 (**********************************************************************
18770 *
18780 * PROCEDURE GETOPTION
18790 *
18800 * - ASSIGN <VALUE> OF "SWITCHNAME" TO "SWITCHVALUE".
18810 *
18820 **********************************************************************)
18830
18840 PROCEDURE GETOPTION(SWITCHNAME: ALFA; VAR SWITCHVALUE: INTEGER);
18850 BEGIN
18860 IF OPTION(SWITCHNAME)
18870 THEN
18880 WITH CURRENT_SWITCH^ DO
18890 SWITCHVALUE := VALUE
18900 ELSE
18910 SWITCHVALUE := 0
18920 END (* GETOPTION *);
18930
18940 FUNCTION PICTURE(FCH: CHAR): DELIMITER;
18950 BEGIN
18960 IF FCH IN [' ','!','(',')',',','.','/',':','<','=','>','[',']']
18970 THEN
18980 IF FCH <= '/'
18990 THEN PICTURE := DELIMITER1[FCH]
19000 ELSE
19010 IF FCH <= '>'
19020 THEN PICTURE := DELIMITER2[FCH]
19030 ELSE PICTURE := DELIMITER3[FCH]
19040 ELSE PICTURE := UNKNOWN;
19050 END (* PICTURE *);
19060
19070 (**********************************************************************
19080 *
19090 * PROCEDURE GETFILENAME
19100 *
19110 * - READ DECSYSTEM-10 <FILE SPECIFICATION> FROM
19120 * "SOURCEFILE".
19130 *
19140 **********************************************************************)
19150
19160 PROCEDURE GETFILENAME(VAR SOURCEFILE: TEXT;
19170 VAR FILENAME: PACK9;
19180 VAR PROTECTION,UFD: INTEGER;
19190 VAR DEVICE: PACK6;
19200 FILEVARIABLE: ALFA);
19210 VAR
19220 BUFFER: ALFA;
19230 I, J, K, IMAX, OCVAL, SOURCE_PROT, SOURCE_PPN: INTEGER;
19240 SOURCE_FIL: PACKED ARRAY[1..9] OF CHAR;
19250 SOURCE_DEV: PACKED ARRAY[1..6] OF CHAR;
19260 CH,STATUS: CHAR;
19270 NEW_STATUS: BOOLEAN;
19280
19290 PROCEDURE RE_INITIALIZE;
19300 BEGIN
19310 I := 0; BUFFER := ' '; OCVAL := 0;
19320 NEW_STATUS := FALSE;
19330 END (* RE_INITIALIZE *);
19340
19350 PROCEDURE INITIALIZE;
19360 BEGIN
19370 FILENAME := ' '; DEVICE := 'DSK '; STATUS := ' '; IMAX := 6;
19380 CH := ' '; UFD := 0; PROTECTION := 0; ERROR := FALSE; END_OF_FILENAME := FALSE;
19390 RE_INITIALIZE; DEFAULTED := TRUE
19400 END (* INITIALIZE *);
19410
19420 PROCEDURE READCHAR;
19430 BEGIN
19440 I := I + 1;
19450 IF I > IMAX
19460 THEN ERROR := TRUE
19470 ELSE BUFFER[I] := CH
19480 END (*READCHAR*) ;
19490
19500 PROCEDURE READOCTAL;
19510 BEGIN
19520 IF CH IN ['0'..'7']
19530 THEN
19540 BEGIN
19550 OCVAL := OCVAL * 10B + ORD(CH) - ORD('0')
19560 END
19570 ELSE ERROR := TRUE
19580 END (*READOCTAL*) ;
19590
19600 PROCEDURE READDECIMAL;
19610 BEGIN
19620 IF CH IN ['0'..'9']
19630 THEN
19640 BEGIN
19650 OCVAL := OCVAL * 10 + ORD(CH) - ORD('0')
19660 END
19670 ELSE ERROR := TRUE
19680 END (*READDECIMAL*) ;
19690
19700 PROCEDURE SETSTATUS;
19710 BEGIN
19720 IF CH <> ' '
19730 THEN
19740 BEGIN
19750 CASE PICTURE(CH) OF
19760 COLON :
19770 ERROR := STATUS <> ' ';
19780 POINT :
19790 ERROR := NOT (STATUS IN [' ',':']);
19800 LBRACK :
19810 ERROR := NOT (STATUS IN [' ',':','.']);
19820 LESS :
19830 ERROR := NOT (STATUS IN [' ',':','.',']']);
19840 COMMA :
19850 ERROR := STATUS <> '[';
19860 RBRACK :
19870 ERROR := STATUS <> ',';
19880 GREATER :
19890 ERROR := STATUS <> '<';
19900 SLASH :
19910 ERROR := NOT (STATUS IN [' ',':','.',']','>',')']);
19920 LPARENT :
19930 ERROR := NOT (STATUS IN [' ',':','.',']','>']);
19940 RPARENT :
19950 ERROR := STATUS <> '(';
19960 OTHERS :
19970 ERROR := TRUE
19980 END;
19990 IF NOT ERROR
20000 THEN
20010 BEGIN
20020 NEW_STATUS := TRUE; STATUS := CH
20030 END
20040 END
20050 END (*SETSTATUS*) ;
20060
20070 PROCEDURE READSWITCH;
20080 VAR
20090 READ_VALUE, END_OF_SWITCH: BOOLEAN;
20100 BEGIN
20110 IF NOT EOLN(SOURCEFILE)
20120 THEN
20130 BEGIN
20140 REPEAT
20150 IMAX := ALFALENGTH;
20160 RE_INITIALIZE;
20170 READ_VALUE := FALSE;
20180 END_OF_SWITCH := FALSE;
20190 LOOP
20200 IF EOLN(SOURCEFILE)
20210 THEN
20220 BEGIN
20230 END_OF_SWITCH := TRUE; CH := ' '
20240 END
20250 ELSE READ(SOURCEFILE,CH);
20260 LASTCH := CH
20270 EXIT IF NOT (CH IN ['0'..'9',':','A'..'Z',' ']) OR END_OF_SWITCH;
20280 IF CH <> ' '
20290 THEN
20300 IF READ_VALUE
20310 THEN READDECIMAL
20320 ELSE
20330 IF CH = ':'
20340 THEN READ_VALUE := TRUE
20350 ELSE READCHAR
20360 END;
20370 IF I > 0
20380 THEN ENTER(BUFFER,OCVAL)
20390 UNTIL NOT (CH IN ['/','!',',']) OR ((CH = ',') AND (STATUS <> '(')) OR END_OF_SWITCH;
20400 IF CH IN [',','=']
20410 THEN
20420 BEGIN
20430 END_OF_FILENAME := TRUE; CH := ' '
20440 END;
20450 SETSTATUS
20460 END
20470 END (* READSWITCH *);
20480
20490
20500 PROCEDURE OPERAND;
20510
20520 PROCEDURE NEXTCH;
20530 BEGIN
20540 IF EOLN(SOURCEFILE)
20550 THEN
20560 BEGIN
20570 END_OF_FILENAME := TRUE; CH := ' '
20580 END
20590 ELSE READ(SOURCEFILE,CH);
20600 LASTCH := CH;
20610 IF END_OF_FILENAME OR ((CH=',') AND (STATUS<>'[')) OR (CH='=')
20620 THEN
20630 BEGIN
20640 END_OF_FILENAME := TRUE;
20650 CASE PICTURE(STATUS) OF
20660 BLANK:
20670 CH := '.';
20680 COLON:
20690 CH := '.';
20700 POINT:
20710 CH := '[';
20720 RPARENT,
20730 SLASH,
20740 GREATER,
20750 RBRACK:
20760 BEGIN
20770 CH := ' '; STATUS := ' '
20780 END;
20790 OTHERS:
20800 BEGIN
20810 ERROR := TRUE; CH := ' '
20820 END
20830 END
20840 END
20850 END (*NEXTCH*) ;
20860
20870 BEGIN
20880 (*OPERAND*)
20890 REPEAT
20900 NEXTCH;
20910 IF CH IN ['A'..'Z','0'..'9']
20920 THEN
20930 IF STATUS IN ['[',',','<']
20940 THEN READOCTAL
20950 ELSE READCHAR
20960 ELSE SETSTATUS
20970 UNTIL NEW_STATUS OR ERROR OR END_OF_FILENAME
20980 END (*OPERAND*) ;
20990
21000 PROCEDURE ASSIGNFILENAMEOREXTENSION;
21010 BEGIN
21020 IF I > 0
21030 THEN
21040 IF (FILENAME[1] = ' ') OR ((FILENAME[7] = ' ') AND (IMAX = 3))
21050 THEN
21060 BEGIN
21070 IF IMAX = 3
21080 THEN K := 6
21090 ELSE K := 0;
21100 FOR J := 1 TO IMAX DO FILENAME[K+J] := BUFFER[J];
21110 END
21120 END;
21130
21140 BEGIN
21150 (*GETFILENAME*)
21160 INITIALIZE;
21170 IF NOT EOF(SOURCEFILE)
21180 THEN
21190 IF NOT EOLN(SOURCEFILE)
21200 THEN
21210 REPEAT
21220 OPERAND;
21230 IF NOT ERROR
21240 THEN
21250 BEGIN
21260 CASE PICTURE(STATUS) OF
21270 COLON:
21280 IF I > 0
21290 THEN
21300 BEGIN
21310 DEVICE := ' ' ;
21320 FOR J := 1 TO I DO DEVICE[J] := BUFFER[J];
21330 END ;
21340 POINT:
21350 BEGIN
21360 ASSIGNFILENAMEOREXTENSION; IMAX := 3
21370 END;
21380 LESS,
21390 LBRACK:
21400 ASSIGNFILENAMEOREXTENSION;
21410 LPARENT,
21420 SLASH:
21430 BEGIN
21440 ASSIGNFILENAMEOREXTENSION; READSWITCH
21450 END;
21460 COMMA :
21470 UFD := OCVAL * 1000000B;
21480 RBRACK :
21490 UFD := UFD + OCVAL;
21500 GREATER :
21510 PROTECTION := OCVAL
21520 END;
21530 RE_INITIALIZE; DEFAULTED := FALSE
21540 END
21550 UNTIL ERROR OR END_OF_FILENAME;
21560 DEFAULTED := FILENAME[1] = ' ';
21570 IF NOT DEFAULTED
21580 THEN
21590 IF NOT ERROR AND EOLN(SOURCEFILE) AND (PRED(QUELLE) <= COMMANDFILE) AND NOT EOF(SOURCEFILE)
21600 THEN
21610 BEGIN
21620 READLN(SOURCEFILE); STATUS := ' '; CH := ' '; READSWITCH
21630 END;
21640 END (*GETFILENAME*);
21650
21660 (**********************************************************************
21670 *
21680 * PROCEDURE GETPARAMETER
21690 *
21700 * - READ A DECSYSTEM-10 <FILE SPECIFICATION> FROM EITHER
21710 *
21720 * * A TEMPCORE-FILE NAMED <1ST 3 CHARS. OF PROGRAMNAME>.TMP,
21730 * CREATED BY DECSYSTEM-10 COMPIL-CLASS COMMANDS OR USER, OR
21740 *
21750 * * A COMMAND-FILE NAMED <1ST 6 CHARS. OF PROGRAMNAME>.CMD,
21760 * CREATED BY USER, OR
21770 *
21780 * * TTY
21790 *
21800 * ALL FILES HAVE TO BE "TEXT"-FILES.
21810 *
21820 * TEMPCORE-FILES CAN BE ACCESSED AND CREATED AUTOMATICALLY
21830 * BY PASCAL PROGRAMS IF THE FILENAME IS SPECIFIED AS
21840 * 'XXX TMP' AND DEVICE IS 'DSK ', WHERE XXX ARE
21850 * THE 1ST 3 CHARACTERS OF THE <PROGRAMNAME>. IF THE TEMPCORE-FILE
21860 * CANNOT BE FOUND/CREATED THE DISK-FILE 'NNNXXXTMP' IS
21870 * SEARCHED/CREATED, WHERE NNN IS THE JOB-NUMBER.
21880 *
21890 * THE INPUT FORMAT IS FOR
21900 *
21910 * * TEMPCORE- AND COMMAND-FILES:
21920 *
21930 * <FILE SPECIFICATION>,...,<FILE SPECIFICATION><CR><LF>
21940 * <SWITCH>!...<SWITCH>!<CR><LF>
21950 *
21960 * THE SECOND LINE (USED BY COMPIL-CLASS COMMANDS) IS OPTIONAL
21970 *
21980 * * TTY:
21990 *
22000 * <FILE SPECIFICATION><CR><LF>
22010 *
22020 ***********************************************************************)
22030
22040
22050 PROCEDURE INITIALIZE;
22060 BEGIN
22070 IF QUELLE <> TELETYPE
22080 THEN
22090 BEGIN
22100 CASE QUELLE OF
22110 TEMPFILE:
22120 BEGIN
22130 COM_FILENAME := 'PASCALCMD';
22140 TMP_FILENAME := 'PAS TMP';
22150 RESET(TTYIN,TMP_FILENAME,0,0,'DSK ')
22160 END;
22170 COMMANDFILE:
22180 RESET(TTYIN,COM_FILENAME);
22190 TELETYPEOUTPUT:
22200 REWRITE(TTY,'TTYOUTPUT');
22210 TELETYPEINPUT:
22220 RESET(TTYIN,'TTY ',0,0,'TTY ')
22230 END;
22240 QUELLE := SUCC(QUELLE);
22250 IF EOF(TTYIN) AND NOT (QUELLE IN [TELETYPEINPUT,TELETYPE])
22260 THEN INITIALIZE;
22270 END
22280 END (* INITIALIZE *);
22290
22300 PROCEDURE GETPARAMETER(VAR FILENAME: PACK9;
22310 VAR PROTECTION,UFD: INTEGER;
22320 VAR DEVICE: PACK6;
22330 FILEIDENT: ALFA);
22340
22350 VAR
22360 I : 1..3 ;
22370 FILE_EXTENSION : PACKED ARRAY [ 1..3 ] OF CHAR ;
22380
22390 BEGIN (*GETPARAMETER*)
22400 LOOP
22410 IF QUELLE IN [TELETYPE,TELETYPEINPUT]
22420 THEN
22430 BEGIN
22440 WRITE(TTY,FILEIDENT,'= ');BREAK(TTY);
22450 IF QUELLE = TELETYPEINPUT
22460 THEN INITIALIZE
22470 ELSE READLN(TTYIN)
22480 END;
22490 GETFILENAME(TTYIN,FILENAME,PROTECTION,UFD,DEVICE,FILEIDENT);
22500 IF DEVICE = 'LPT '
22510 THEN ENTER('LPT ',0) ;
22520 IF (PRED(QUELLE) <= COMMANDFILE) AND (FILENAME[7] = ' ') AND NOT DEFAULTED
22530 THEN
22540 BEGIN
22550 IF FILEIDENT = 'SOURCE '
22560 THEN FILE_EXTENSION := 'PAS'
22570 ELSE
22580 IF FILEIDENT = 'LIST '
22590 THEN FILE_EXTENSION := 'LST'
22600 ELSE FILE_EXTENSION := 'REL' ;
22610 FOR I := 1 TO 3 DO FILENAME[6+I] := FILE_EXTENSION[I] ;
22620 END ;
22630 EXIT IF NOT ( ERROR OR (FILEIDENT = 'SOURCE ') AND (DEVICE = 'LPT ') ) ;
22640 IF QUELLE <> TELETYPE
22650 THEN
22660 BEGIN
22670 QUELLE := TELETYPEOUTPUT; INITIALIZE
22680 END;
22690 WRITELN(TTY,'%? SYNTAX ERROR: REENTER') ; BREAK(TTY) ;
22700 END (* LOOP *) ;
22710 END (*GETPARAMETER*) ;
22720
22730 BEGIN (*GET_DIRECTIVES*)
22740 STARTVALUES ; INITIALIZE ;
22750 GETPARAMETER(OBJECT_FILE,OBJECT_PROTECTION,OBJECT_UFD,OBJECT_DEVICE,'OBJECT ');
22760 GETPARAMETER(LIST_FILE,LIST_PROTECTION,LIST_UFD,LIST_DEVICE,'LIST ');
22770 GETPARAMETER(SOURCE_FILE,SOURCE_PROTECTION,SOURCE_UFD,SOURCE_DEVICE,'SOURCE ');
22780 LOOP
22790 IF SOURCE_FILE = ' '
22800 THEN RESET(SOURCE,'SOURCE ',0,0,'DSK ')
22810 ELSE RESET(SOURCE,SOURCE_FILE,SOURCE_PROTECTION,SOURCE_UFD,SOURCE_DEVICE) ;
22820 EXIT IF NOT EOF(SOURCE) ;
22830 WRITE(TTY,'%? NO ACCESS TO ') ;
22840 IF SOURCE_FILE = ' '
22850 THEN WRITE(TTY,'SOURCE')
22860 ELSE WRITE(TTY,SOURCE_FILE:6,'.',SOURCE_FILE[7],SOURCE_FILE[8],SOURCE_FILE[9]);
22870 WRITELN(TTY,' OR NOT FOUND: REENTER') ; BREAK(TTY) ;
22880 GETPARAMETER(SOURCE_FILE,SOURCE_PROTECTION,SOURCE_UFD,SOURCE_DEVICE,'SOURCE ') ;
22890 END (* LOOP FOR SOURCE_FILE *) ;
22900
22910 REWRITE(OBJECT,OBJECT_FILE,OBJECT_PROTECTION,OBJECT_UFD,OBJECT_DEVICE) ;
22920
22930 CROSS_REFERENCE := OPTION('CREF ') OR OPTION('C ') ;
22940
22950 LIST_CODE := OPTION('CODE ');
22960
22970 LPTFILE := NOT OPTION('NOLIST ') AND ( OPTION('LPT ') OR
22980 OPTION('LIST ') OR
22990 (LIST_FILE <> ' ') OR
23000 LIST_CODE ) ;
23010
23020 IF LPTFILE
23030 THEN REWRITE(LIST,LIST_FILE,LIST_PROTECTION,LIST_UFD,LIST_DEVICE) ;
23040
23050 DEBUG := OPTION('DEBUG ');
23060 DEBUG_SWITCH := DEBUG;
23070
23080 RUNTIME_CHECK := NOT OPTION('NOCHECK ');
23090
23100 FORTRAN_ENVIROMENT := OPTION('FORTIO ');
23110
23120 EXTERNAL := OPTION('EXTERN ');
23130
23140 LOAD_AND_GO := (OPTION('EXECUTE ') OR OPTION('LINK ')) AND NOT EXTERNAL;;
23150
23160 IF OPTION('CARD ')
23170 THEN CHCNTMAX := 72;
23180
23190 IF OPTION('FILE ')
23200 THEN
23210 BEGIN
23220 GETOPTION('FILE ',I);
23230 IF I IN [1..MAX_FILE]
23240 THEN START_CHANNEL := I + NAMAX[STDFILE] - 2
23250 END;
23260
23270 IF OPTION('CODESIZE ')
23280 THEN GETOPTION('CODESIZE ',CODE_SIZE);
23290
23300 IF OPTION('REGISTER ')
23310 THEN
23320 BEGIN
23330 GETOPTION('REGISTER ',I);
23340 IF I IN [REGIN..WITHIN]
23350 THEN PARREGCMAX := I
23360 END;
23370
23380 IF OPTION('RUNCORE ')
23390 THEN GETOPTION('RUNCORE ',RUNCORE);
23400
23410 RESET(TEMPCORE,'LNK TMP');
23420 IF NOT EOF(TEMPCORE)
23430 THEN
23440 BEGIN
23450 NEW(COMMAND_BUFFER:BUFFER_SIZE);
23460 COMMAND_BUFFER^[0] := ' '; I := 1;
23470 WHILE NOT EOF(TEMPCORE) AND (I < BUFFER_SIZE) DO
23480 BEGIN
23490 IF EOLN(TEMPCORE)
23500 THEN
23510 BEGIN
23520 READLN(TEMPCORE);
23530 COMMAND_BUFFER^[I] := CR;
23540 COMMAND_BUFFER^[I+1] := LF; I := I + 2
23550 END
23560 ELSE
23570 BEGIN
23580 READ(TEMPCORE,CH);
23590 COMMAND_BUFFER^[I] := CH;
23600 IF (COMMAND_BUFFER^[I-1] = '/') AND (CH = 'D')
23610 THEN
23620 BEGIN
23630 DEBUG := TRUE; DEBUG_SWITCH := TRUE; I := I - 1
23640 END
23650 ELSE I := I + 1
23660 END
23670 END;
23680 REWRITE(TEMPCORE,'LNK TMP');
23690 WRITE(TEMPCORE,COMMAND_BUFFER^:I);
23700 DISPOSE(COMMAND_BUFFER:BUFFER_SIZE)
23710 END
23720 ELSE
23730 BEGIN
23740 IF LOAD_AND_GO
23750 THEN
23760 BEGIN
23770 REWRITE(TEMPCORE,'LNK TMP');
23780 WRITE(TEMPCORE,'DSK:',OBJECT_FILE:6,' /G ');
23790 IF OPTION('EXECUTE ')
23800 THEN WRITE(TEMPCORE,'/E')
23810 END
23820 END;
23830 END (*GET_DIRECTIVES*) ;
23840
23850
23860
23870 PROCEDURE COMPILE;
23880
23890 LABEL
23900 111;
23910
23920 VAR
23930 ESCAPE: BOOLEAN;
23940
23950 PROCEDURE NEWPAGER;
23960 BEGIN
23970 WITH PAGER, WORD1 DO
23980 BEGIN
23990 AC := PAGECNT DIV 16;
24000 INXREG := PAGECNT MOD 16; ADDRESS := LASTPAGER;
24010 LHALF := LASTLINE; RHALF := LASTSTOP;
24020 LASTLINE := -1
24030 END
24040 END;
24050
24060 PROCEDURE WRITEBUFFER;
24070 BEGIN
24080 IF LIST_CODE
24090 THEN
24100 BEGIN
24110 WRITELN(LIST,BUFFER:CHCNT); FOR CHCNT := 1 TO 17 DO BUFFER[CHCNT] := ' '; CHCNT := 17
24120 END
24130 END;
24140
24150 PROCEDURE GETNEXTLINE;
24160 BEGIN
24170 LOOP
24180 GETLINENR(SOURCE,LINENR)
24190 EXIT IF (LINENR <> ' ') OR EOF(SOURCE);
24200 IF DEBUG AND (LASTLINE > -1)
24210 THEN NEWPAGER;
24220 PAGECNT := PAGECNT + 1;
24230 IF LPTFILE
24240 THEN
24250 BEGIN
24260 PAGE(LIST); WRITELN(LIST,'PAGE ',PAGECNT:3); WRITELN(LIST)
24270 END;
24280 READLN(SOURCE) (*TO OVERREAD SECOND <LF> IN PAGE MARK*)
24290 END;
24300 IF LIST_CODE
24310 THEN
24320 BEGIN
24330 IF DP
24340 THEN WRITE(LIST,LC:6:O,SHOWRELO[(LC >= LOW_START) AND (LEVEL <= 1)])
24350 ELSE WRITE(LIST,IC:6:O,'''');
24360 WRITE(LIST,' ':2)
24370 END;
24380 IF LPTFILE
24390 THEN
24400 BEGIN
24410 IF LINENR='-----'
24420 THEN WRITE(LIST,LINECNT:5)
24430 ELSE WRITE(LIST,LINENR) ;
24440 WRITE(LIST,' ':3)
24450 END
24460 END (*GETNEXTLINE*);
24470
24480 PROCEDURE ENDOFLINE;
24490 VAR
24500 I,K: INTEGER;
24510 BEGIN
24520 IF CHCNT > CHCNTMAX
24530 THEN CHCNT := CHCNTMAX;
24540 IF LPTFILE
24550 THEN WRITELN(LIST,BUFFER:CHCNT);
24560 IF ERRORINLINE
24570 THEN (*OUTPUT ERROR MESSAGES*)
24580 BEGIN
24590 IF ERROR_IN_HEADING
24600 THEN WRITELN(TTY);
24610 ERROR_IN_HEADING := FALSE;
24620 IF LIST_CODE
24630 THEN K := 11
24640 ELSE K := 2;
24650 IF LPTFILE
24660 THEN WRITE(LIST,' ':K,'***** '); LIST_CODE := FALSE;
24670 IF LINENR = '-----'
24680 THEN WRITE(TTY,LINECNT:5)
24690 ELSE WRITE(TTY,LINENR);
24700 WRITELN(TTY,' ':3,BUFFER:CHCNT); WRITE(TTY,'P*',PAGECNT:3,'** ');
24710 IF LPTFILE
24720 THEN WRITELN(LIST,ERRLINE : CHCNT); WRITELN(TTY,ERRLINE : CHCNT);
24730 FOR K := 1 TO ERRINX DO
24740 WITH ERRLIST[K] DO
24750 BEGIN
24760 IF LPTFILE
24770 THEN WRITE(LIST,' ':15,ARW:1,'.',TIC,': '); WRITE(TTY,ARW:1,'.',TIC,': ');
24780 IF ERRMPTR <> NIL
24790 THEN
24800 BEGIN
24810 ERRMPTR1 := ERRMPTR;
24820 REPEAT
24830 WITH ERRMPTR1^ DO
24840 IF NMR = NUMBER
24850 THEN
24860 BEGIN
24870 IF LPTFILE
24880 THEN WRITE(LIST,STRING:10,' - ');WRITE(TTY,STRING:10,' - ');
24890 NUMBER := 0; ERRMPTR1 := NIL
24900 END
24910 ELSE ERRMPTR1 := NEXT
24920 UNTIL ERRMPTR1 = NIL
24930 END;
24940 I := NMR MOD 50;
24950 CASE NMR DIV 50 OF
24960 3:
24970 BEGIN
24980 IF LPTFILE
24990 THEN WRITE(LIST,ERRMESS15[I]); WRITE(TTY,ERRMESS15[I])
25000 END;
25010 4:
25020 BEGIN
25030 IF LPTFILE
25040 THEN WRITE(LIST,ERRMESS20[I]); WRITE(TTY,ERRMESS20[I])
25050 END;
25060 5:
25070 BEGIN
25080 IF LPTFILE
25090 THEN WRITE(LIST,ERRMESS25[I]); WRITE(TTY,ERRMESS25[I])
25100 END;
25110 6:
25120 BEGIN
25130 IF LPTFILE
25140 THEN WRITE(LIST,ERRMESS30[I]); WRITE(TTY,ERRMESS30[I])
25150 END;
25160 7:
25170 BEGIN
25180 IF LPTFILE
25190 THEN WRITE(LIST,ERRMESS35[I]); WRITE(TTY,ERRMESS35[I])
25200 END;
25210 8:
25220 BEGIN
25230 IF LPTFILE
25240 THEN WRITE(LIST,ERRMESS40[I]); WRITE(TTY,ERRMESS40[I])
25250 END;
25260 9:
25270 BEGIN
25280 IF LPTFILE
25290 THEN WRITE(LIST,ERRMESS45[I]); WRITE(TTY,ERRMESS45[I])
25300 END;
25310 10:
25320 BEGIN
25330 IF LPTFILE
25340 THEN WRITE(LIST,ERRMESS50[I]); WRITE(TTY,ERRMESS50[I])
25350 END;
25360 11:
25370 BEGIN
25380 IF LPTFILE
25390 THEN WRITE(LIST,ERRMESS55[I]); WRITE(TTY,ERRMESS55[I])
25400 END
25410 END;
25420 IF LPTFILE
25430 THEN WRITELN(LIST); WRITELN(TTY)
25440 END;
25450 BREAK(TTY); ERRINX := 0; ERRORINLINE := FALSE;
25460 FOR I := 1 TO CHCNT DO ERRLINE [I] := ' ';
25470 ERRMPTR := NIL
25480 END;
25490 READLN(SOURCE);
25500 LINECNT := LINECNT + 10; CHCNT := 0;
25510
25520 IF ERROR_EXIT
25530 THEN
25540 IF FIRST_SYMBOL
25550 THEN GOTO 0
25560 ELSE GOTO 111
25570 ELSE
25580 BEGIN
25590 IF NOT EOF(SOURCE)
25600 THEN GETNEXTLINE
25610 ELSE
25620 BEGIN
25630 IF NOT FIRST_SYMBOL
25640 THEN ERROR(267);
25650 ERROR_EXIT := TRUE;
25660 ENDOFLINE
25670 END
25680 END
25690
25700 END (*ENDOFLINE*) ;
25710
25720 PROCEDURE ERROR_WITH_TEXT ( FERRNR: INTEGER; FTEXT: ALFA ) ;
25730 BEGIN
25740 ERROR(FERRNR); NEW(ERRMPTR1);
25750 WITH ERRMPTR1^ DO
25760 BEGIN
25770 NUMBER := FERRNR; STRING := FTEXT;
25780 NEXT := ERRMPTR
25790 END;
25800 ERRMPTR := ERRMPTR1
25810 END (*ERROR WITH TEXT*) ;
25820
25830 PROCEDURE INSYMBOL;
25840
25850 (*READ NEXT BASIC SYMBOL OF SOURCE PROGRAM AND RETURN ITS
25860 DESCRIPTION IN THE GLOBAL VARIABLES SY, OP, ID, VAL AND LGTH*)
25870
25880 LABEL
25890 222;
25900
25910 CONST
25920 MAXDIGITS = 12;
25930 MAX8 = 37777777777B;
25940 TEST8 = 40000000000B;
25950 MAX10 = 3435973836; (* MAXINT = 2 ** 35 - 1 = 34.359.738.367 *)
25960 MAX16 = 17777777777B;
25970 TEST16 = 20000000000B;
25980 MAXEXP2 = 127; (* MAXREAL = 777.777.777B * 2 ** 100 *)
25990 LOG_OF_2 = 0.30102999806;
26000
26010 VAR
26020 I, K, SCALE, EXPONENT, IVAL: INTEGER;
26030 RVAL, R, FAC: REAL;
26040 STRINGTOOLONG, SIGN: BOOLEAN;
26050 DIGIT: ARRAY [1..MAXDIGITS] OF 0..9;
26060 STRING: ARRAY [1..STRGLGTH] OF CHAR;
26070 LVP: CSP;
26080
26090 PROCEDURE NEXTCH;
26100 BEGIN
26110 IF EOLN(SOURCE)
26120 THEN CH := ' '
26130 ELSE
26140 BEGIN
26150 CH := SOURCE^; GET(SOURCE);
26160 CHCNT := CHCNT + 1;
26170 IF CHCNT <= CHCNTMAX
26180 THEN BUFFER[CHCNT] := CH
26190 ELSE
26200 IF CHCNTMAX = 72
26210 THEN NEXTCH
26220 END
26230 END;
26240
26250 PROCEDURE SKIPCOMMENT;
26260 VAR
26270 COMMENTEND: BOOLEAN;
26280
26290 PROCEDURE OPTIONS;
26300 VAR
26310 LCH : CHAR;
26320 LSWITCH : BOOLEAN;
26330 LVALUE : INTEGER;
26340 BEGIN
26350 REPEAT
26360 LVALUE := 0; LSWITCH := FALSE;
26370 NEXTCH; LCH := CH;
26380 IF NOT (CH IN ['\','*'])
26390 THEN NEXTCH;
26400 IF CH IN (['+','-'] + DIGITS)
26410 THEN
26420 BEGIN
26430 IF CH IN ['+','-']
26440 THEN
26450 BEGIN
26460 LSWITCH := CH = '+'; NEXTCH
26470 END
26480 ELSE
26490 REPEAT
26500 LVALUE := LVALUE * 10 + (ORD(CH)-ORD('0'));
26510 NEXTCH
26520 UNTIL NOT (CH IN DIGITS);
26530 IF NOT RESET_POSSIBLE AND (LCH IN ['S','R','X','F','I','U','E'])
26540 THEN ERROR(203)
26550 ELSE
26560 CASE LCH OF
26570 'L':
26580 LIST_CODE := LSWITCH AND LPTFILE;
26590 'U':
26600 CHCNTMAX := 72;
26610 'T':
26620 RUNTIME_CHECK := LSWITCH;
26630 'E':
26640 IF PROGRAM_COUNT > 1
26650 THEN ERROR(203)
26660 ELSE EXTERNAL := LSWITCH;
26670 'D','P':
26680 IF RESET_POSSIBLE
26690 THEN
26700 BEGIN
26710 DEBUG := LSWITCH;
26720 DEBUG_SWITCH := LSWITCH
26730 END
26740 ELSE
26750 IF DEBUG
26760 THEN DEBUG_SWITCH := LSWITCH
26770 ELSE ERROR(203);
26780 'F':
26790 IF LVALUE IN [1..MAX_FILE]
26800 THEN START_CHANNEL := LVALUE + NAMAX[STDFILE] - 2
26810 ELSE ERROR(203);
26820 'R':
26830 RUNCORE := LVALUE;
26840 'X':
26850 IF LVALUE IN [REGIN..WITHIN]
26860 THEN PARREGCMAX := LVALUE
26870 ELSE ERROR(203);
26880 'S':
26890 CODE_SIZE := LVALUE;
26900 'I':
26910 FORTRAN_ENVIROMENT := LSWITCH;
26920 OTHERS:
26930 IF LCH = 'B'
26940 THEN ERROR(169)
26950 ELSE ERROR(203)
26960 END
26970 END
26980 ELSE ERROR(203);
26990 IF EOLN(SOURCE)
27000 THEN ENDOFLINE
27010 UNTIL CH <> ','
27020 END (*OPTIONS*) ;
27030
27040 BEGIN (*SKIPCOMMENT*)
27050 COMMENTEND := FALSE; NEXTCH;
27060 IF CH = '$'
27070 THEN OPTIONS;
27080 LOOP
27090 WHILE CH = '*' DO
27100 BEGIN
27110 NEXTCH;
27120 COMMENTEND := CH = ')'
27130 END
27140 EXIT IF (CH='\') OR COMMENTEND;
27150 IF EOLN(SOURCE)
27160 THEN ENDOFLINE;
27170 NEXTCH
27180 END (*LOOP*);
27190 NEXTCH
27200 END (*SKIPCOMMENT*);
27210
27220 BEGIN
27230 (*INSYMBOL*)
27240 WHILE CH = ' ' DO
27250 BEGIN
27260 IF EOLN(SOURCE)
27270 THEN ENDOFLINE;
27280 NEXTCH
27290 END;
27300 CASE CH OF
27310 '%':
27320 BEGIN
27330 SKIPCOMMENT; INSYMBOL
27340 END;
27350 '(':
27360 BEGIN
27370 NEXTCH;
27380 IF CH = '*'
27390 THEN
27400 BEGIN
27410 SKIPCOMMENT; INSYMBOL
27420 END
27430 ELSE
27440 BEGIN
27450 SY := LPARENT; OP := NOOP
27460 END
27470 END;
27480 'A','B','C','D','E','F','G','H','I','J','K','L','M',
27490 'N','O','P','Q','R','S','T','U','V','W','X','Y',
27500 'Z':
27510 BEGIN
27520 K := 0 ; ID := ' ';
27530 REPEAT
27540 IF K < ALFALENGTH
27550 THEN
27560 BEGIN
27570 K := K + 1; ID[K] := CH
27580 END ;
27590 NEXTCH
27600 UNTIL NOT (CH IN LETTERSDIGITSORLEFTARROW);
27610 FOR I := FRW[K] TO FRW[K+1] - 1 DO
27620 IF RW[I] = ID
27630 THEN
27640 BEGIN
27650 SY := RSY[I];
27660 OP := ROP[I];
27670 IF (SY = INITPROCSY) AND NOT DP
27680 THEN ERROR(363);
27690 GOTO 222
27700 END;
27710 SY := IDENT; OP := NOOP;
27720 222:
27730 END;
27740 '0','1','2','3','4','5','6','7','8',
27750 '9':
27760 BEGIN
27770 SY := INTCONST; OP := NOOP;
27780 ID := ' ';
27790 I := 0;
27800 REPEAT
27810 I := I + 1;
27820
27830 (* THE DIGITS OF AN "INTCONST" ARE STORED AS "IDENT" TOO. THIS ALLOWES
27840 TO ENTER "LABELS" LIKE ALL OTHER IDENTIFIERS INTO THE BINARY-
27850 (IDENTIFIER-)TREE VIA "ENTERID" AND LOCATE THEM VIA
27860 "SEARCHID". SO "LABELS" ARE "KNOWN" AS CONSTANTS, TYPES OR
27870 VARIABLES IN THE BLOCK THEY HAVE BEEN DECLARED IN.
27880 IT IS ALSO POSSIBLE TO "EXIT" FROM A BLOCK, JUMPING TO A LABEL
27890 WHICH IS DECLARED ON A LOWER LEVEL *)
27900
27910 IF I <= ALFALENGTH
27920 THEN ID[I] := CH;
27930
27940 IF I <= MAXDIGITS
27950 THEN DIGIT[I] := ORD(CH) - ORD('0')
27960 ELSE ERROR(174) ;
27970 NEXTCH
27980 UNTIL NOT (CH IN DIGITS);
27990
28000 IVAL := 0;
28010
28020 IF CH = 'B'
28030 THEN
28040 BEGIN
28050 FOR K := 1 TO I DO
28060 IF IVAL <= MAX8
28070 THEN
28080 BEGIN
28090 IF DIGIT[K] IN [8,9]
28100 THEN ERROR(252);
28110 IVAL := 8*IVAL + DIGIT[K]
28120 END
28130 ELSE
28140 IF (IVAL = TEST8) AND (DIGIT[12] = 0)
28150 THEN IVAL := -MAXINT - 1
28160 ELSE
28170 BEGIN
28180 ERROR(204); IVAL := 0
28190 END;
28200 VAL.IVAL := IVAL;
28210 NEXTCH
28220 END
28230 ELSE
28240 BEGIN
28250 FOR K := 1 TO I DO
28260 IF IVAL <= MAX10
28270 THEN
28280 IF (IVAL = MAX10) AND (DIGIT[K] > 7)
28290 THEN
28300 BEGIN
28310 ERROR(204); IVAL := 0
28320 END
28330 ELSE IVAL := 10*IVAL + DIGIT[K]
28340 ELSE
28350 BEGIN
28360 ERROR(204); IVAL := 0
28370 END;
28380
28390 SCALE := 0;
28400
28410 IF CH = '.'
28420 THEN
28430 BEGIN
28440 NEXTCH;
28450 IF CH = '.'
28460 THEN CH := ':'
28470 ELSE
28480 BEGIN
28490 RVAL := IVAL; SY := REALCONST;
28500 IF NOT (CH IN DIGITS)
28510 THEN ERROR(205)
28520 ELSE
28530 REPEAT
28540 RVAL := 10.0*RVAL + (ORD(CH) - ORD('0'));
28550 SCALE := SCALE - 1; NEXTCH
28560 UNTIL NOT (CH IN DIGITS)
28570 END
28580 END;
28590
28600 IF CH = 'E'
28610 THEN
28620 BEGIN
28630 IF SCALE = 0
28640 THEN
28650 BEGIN
28660 RVAL := IVAL; SY := REALCONST
28670 END;
28680 NEXTCH;
28690 SIGN := CH='-';
28700 IF (CH='+') OR SIGN
28710 THEN NEXTCH;
28720 EXPONENT := 0;
28730 IF NOT (CH IN DIGITS)
28740 THEN ERROR(205)
28750 ELSE
28760 REPEAT
28770 EXPONENT := 10 * EXPONENT + ORD(CH) - ORD('0');
28780 NEXTCH
28790 UNTIL NOT (CH IN DIGITS);
28800
28810 IF SIGN
28820 THEN SCALE := SCALE - EXPONENT
28830 ELSE SCALE := SCALE + EXPONENT;
28840
28850 IF ABS(ROUND(SCALE/LOG_OF_2 + EXPO(RVAL))) >= MAXEXP2
28860 THEN
28870 BEGIN
28880 ERROR(206); SCALE := 0
28890 END
28900 END;
28910
28920 IF SCALE <> 0
28930 THEN
28940 BEGIN
28950 IF SCALE < 0
28960 THEN
28970 BEGIN
28980 SCALE := ABS(SCALE); FAC := 0.1
28990 END
29000 ELSE FAC := 10.0;
29010 R := 1.0;
29020
29030 LOOP
29040
29050 IF ODD(SCALE)
29060 THEN R := R * FAC;
29070 SCALE := SCALE DIV 2
29080 EXIT IF SCALE = 0;
29090 FAC := SQR(FAC)
29100 END;
29110
29120 RVAL := RVAL * R (* RVAL := RVAL * 10 ** SCALE *)
29130 END;
29140
29150 IF SY = INTCONST
29160 THEN VAL.IVAL := IVAL
29170 ELSE
29180 BEGIN
29190 NEW(LVP,REEL);
29200 LVP^.RVAL := RVAL; VAL.VALP := LVP
29210 END
29220 END
29230 END;
29240 '"':
29250 BEGIN
29260 SY := INTCONST; OP := NOOP; IVAL := 0;
29270 NEXTCH;
29280 WHILE (CH IN HEXADIGITS) AND (IVAL >= 0) DO
29290 BEGIN
29300 IF IVAL <= MAX16
29310 THEN
29320 IF CH IN DIGITS
29330 THEN IVAL := 16*IVAL + (ORD(CH) - ORD('0'))
29340 ELSE IVAL := 16*IVAL + (ORD(CH) - 67B)
29350 ELSE
29360 IF (IVAL = TEST16) AND (CH = '0')
29370 THEN IVAL := -MAXINT - 1
29380 ELSE
29390 BEGIN
29400 ERROR(174); IVAL := 0
29410 END;
29420 NEXTCH
29430 END;
29440 WHILE CH IN HEXADIGITS DO NEXTCH;
29450 VAL.IVAL := IVAL
29460 END;
29470 '''':
29480 BEGIN
29490 LGTH := 0; SY := STRINGCONST; OP := NOOP; STRINGTOOLONG := FALSE;
29500 REPEAT
29510 REPEAT
29520 NEXTCH;
29530 IF LGTH <= STRGLGTH
29540 THEN
29550 BEGIN
29560 LGTH := LGTH + 1;
29570 IF LGTH <= STRGLGTH
29580 THEN STRING[LGTH] := CH
29590 END
29600 ELSE STRINGTOOLONG := TRUE
29610 UNTIL EOLN(SOURCE) OR (CH = '''');
29620 IF STRINGTOOLONG
29630 THEN ERROR(301);
29640 IF CH <> ''''
29650 THEN ERROR(351)
29660 ELSE NEXTCH
29670 UNTIL CH <> '''';
29680 LGTH := LGTH - 1;
29690 IF LGTH = 1
29700 THEN VAL.IVAL := ORD(STRING[1])
29710 ELSE
29720 BEGIN
29730 NEW(LVP,STRG:LGTH);
29740 WITH LVP^ DO
29750 BEGIN
29760 SLGTH := LGTH;
29770 PACK(STRING,1,SVAL,1,LGTH)
29780 END;
29790 VAL.VALP := LVP
29800 END
29810 END;
29820 ':':
29830 BEGIN
29840 OP := NOOP; NEXTCH;
29850 IF CH = '='
29860 THEN
29870 BEGIN
29880 SY := BECOMES; NEXTCH
29890 END
29900 ELSE SY := COLON
29910 END;
29920 '.':
29930 BEGIN
29940 OP := NOOP; NEXTCH;
29950 IF CH = '.'
29960 THEN
29970 BEGIN
29980 SY := COLON; NEXTCH
29990 END
30000 ELSE SY := PERIOD
30010 END;
30020 '<','>':
30030 BEGIN
30040 SY := RELOP; OP := SOP[CH]; NEXTCH;
30050 IF (OP=LTOP) AND (CH='>')
30060 THEN
30070 BEGIN
30080 OP := NEOP; NEXTCH
30090 END
30100 ELSE
30110 IF CH = '='
30120 THEN
30130 BEGIN
30140 IF OP = LTOP
30150 THEN OP := LEOP
30160 ELSE OP := GEOP;
30170 NEXTCH
30180 END
30190 END;
30200 OTHERS:
30210 BEGIN
30220 SY := SSY[CH]; OP := SOP[CH];
30230 NEXTCH
30240 END
30250 END (*CASE*);
30260 FIRST_SYMBOL := FALSE
30270 END (*INSYMBOL*) ;
30280
30290 PROCEDURE SEARCHSECTION(FCP: CTP; VAR FCP1: CTP);
30300
30310 (*TO FIND RECORD FIELDS AND FORWARD DECLARED PROCEDURE ID'S
30320 --> PROCEDURE PROCEDUREDECLARATION
30330 --> PROCEDURE SELECTOR*)
30340
30350 LABEL
30360 333;
30370
30380 BEGIN
30390 WHILE FCP <> NIL DO
30400 WITH FCP^ DO
30410 BEGIN
30420 IF NAME = ID
30430 THEN GOTO 333;
30440 IF NAME < ID
30450 THEN FCP := RLINK
30460 ELSE FCP := LLINK
30470 END;
30480 333:
30490 FCP1 := FCP
30500 END (*SEARCHSECTION*) ;
30510
30520 PROCEDURE SEARCHID(FIDCLS: SETOFIDS; VAR FCP: CTP);
30530
30540 LABEL
30550 444;
30560
30570 VAR
30580 LCP: CTP;
30590 BEGIN
30600 FOR DISX := TOP DOWNTO 0 DO
30610 BEGIN
30620 LCP := DISPLAY[DISX].FNAME;
30630 WHILE LCP <> NIL DO
30640 WITH LCP^ DO
30650 IF NAME = ID
30660 THEN
30670 IF KLASS IN FIDCLS
30680 THEN GOTO 444
30690 ELSE
30700 BEGIN
30710 IF SEARCH_ERROR
30720 THEN ERROR(401);
30730 LCP := RLINK
30740 END
30750 ELSE
30760 IF NAME < ID
30770 THEN LCP := RLINK
30780 ELSE LCP := LLINK
30790 END;
30800
30810 (*SEARCH NOT SUCCSESSFUL; SUPPRESS ERROR MESSAGE IN CASE
30820 OF FORWARD REFERENCED TYPE ID IN POINTER TYPE DEFINITION
30830 --> PROCEDURE SIMPLETYPE*)
30840
30850 IF SEARCH_ERROR
30860 THEN
30870 BEGIN
30880 IF ID[1] IN DIGITS
30890 THEN ERROR(215) (*UNDECLARED LABEL*)
30900 ELSE ERROR(253) (*UNDECLARED IDENTIFIER*);
30910
30920 (*TO AVOID RETURNING NIL, REFERENCE AN ENTRY
30930 FOR AN UNDECLARED ID OF APPROPRIATE CLASS
30940 --> PROCEDURE ENTERUNDECL*)
30950
30960 IF TYPES IN FIDCLS
30970 THEN LCP := UTYPPTR
30980 ELSE
30990 IF VARS IN FIDCLS
31000 THEN LCP := UVARPTR
31010 ELSE
31020 IF FIELD IN FIDCLS
31030 THEN LCP := UFLDPTR
31040 ELSE
31050 IF KONST IN FIDCLS
31060 THEN LCP := UCSTPTR
31070 ELSE
31080 IF PROC IN FIDCLS
31090 THEN LCP := UPRCPTR
31100 ELSE LCP := UFCTPTR
31110 END;
31120 444:
31130 FCP := LCP
31140 END (*SEARCHID*) ;
31150
31160
31170 PROCEDURE SKIPIFERR(FSYINSYS:SETOFSYS; FERRNR:INTEGER; FSKIPSYS: SETOFSYS);
31180 VAR
31190 I,OLDCHCNT,OLDLINECNT : INTEGER;
31200 BEGIN
31210 IF NOT (SY IN FSYINSYS)
31220 THEN
31230 BEGIN
31240 ERROR(FERRNR);
31250 OLDLINECNT := LINECNT; OLDCHCNT := CHCNT;
31260 WHILE NOT (SY IN FSKIPSYS + FSYINSYS) DO
31270 BEGIN
31280 (*SKIP INPUT STRING UNTIL RELEVANT SYMBOL FOUND*)
31290 IF OLDLINECNT <> LINECNT
31300 THEN OLDCHCNT := 1;
31310 FOR I := OLDCHCNT TO CHCNT-1 DO
31320 IF I <= CHCNTMAX
31330 THEN ERRLINE [I] := '*';
31340 OLDCHCNT := CHCNT; OLDLINECNT := LINECNT; ERRORINLINE := TRUE;
31350 INSYMBOL
31360 END
31370 END;
31380 FOLLOWERROR := FALSE
31390 END;
31400
31410 PROCEDURE IFERRSKIP(FERRNR: INTEGER; FSYS: SETOFSYS);
31420 BEGIN
31430 SKIPIFERR(FSYS,FERRNR,FSYS)
31440 END;
31450
31460 PROCEDURE ERRANDSKIP(FERRNR: INTEGER; FSYS: SETOFSYS);
31470 BEGIN
31480 SKIPIFERR([ ],FERRNR,FSYS)
31490 END;
31500
31510 PROCEDURE BLOCK(FPROCP: CTP; FSYS,LEAVEBLOCKSYS: SETOFSYS);
31520
31530 TYPE
31540 MARKER = ^INTEGER;
31550
31560 VAR
31570 LSY: SYMBOL; CURRENT_JUMP: 0..JUMP_MAX;
31580 TESTPACKED: BOOLEAN;
31590 LCPAR: ADDRRANGE;
31600 HEAPMARK, GLOBMARK: MARKER;
31610 FORWARD_PROCEDURES : CTP;
31620
31630 PROCEDURE CONSTANT(FSYS: SETOFSYS; VAR FSP: STP; VAR FVALU: VALU);
31640 VAR
31650 LSP, LSP1: STP;
31660 LCP: CTP;
31670 SIGN: (NONE,POS,NEG);
31680 BEGIN
31690 LSP := NIL; FVALU.IVAL := 0;
31700 SKIPIFERR(CONSTBEGSYS,207,FSYS);
31710 IF SY IN CONSTBEGSYS
31720 THEN
31730 BEGIN
31740 IF SY = STRINGCONST
31750 THEN
31760 BEGIN
31770 IF LGTH = 1
31780 THEN LSP := ASCIIPTR
31790 ELSE
31800 IF LGTH = ALFALENGTH
31810 THEN LSP := ALFAPTR
31820 ELSE
31830 BEGIN
31840 NEW(LSP,ARRAYS); NEW(LSP1,SUBRANGE);
31850 WITH LSP^ DO
31860 BEGIN
31870 SELFSTP := NIL; AELTYPE := ASCIIPTR; INXTYPE := LSP1;
31880 SIZE := (LGTH+4) DIV 5; ARRAYPF := TRUE;
31890 BITSIZE := BITMAX
31900 END;
31910 WITH LSP1^ DO
31920 BEGIN
31930 SELFSTP := NIL; SIZE := 1; BITSIZE := BITMAX;
31940 VMIN.IVAL := 1; VMAX.IVAL := LGTH; RANGETYPE := INTPTR
31950 END
31960 END;
31970 FVALU := VAL; INSYMBOL
31980 END
31990 ELSE
32000 BEGIN
32010 SIGN := NONE;
32020 IF (SY = ADDOP) AND (OP IN [PLUS,MINUS])
32030 THEN
32040 BEGIN
32050 IF OP = PLUS
32060 THEN SIGN := POS
32070 ELSE SIGN := NEG;
32080 INSYMBOL
32090 END;
32100 IF SY = IDENT
32110 THEN
32120 BEGIN
32130 SEARCHID([KONST],LCP);
32140 WITH LCP^ DO
32150 BEGIN
32160 LSP := IDTYPE; FVALU := VALUES
32170 END;
32180 IF SIGN <> NONE
32190 THEN
32200 IF LSP = INTPTR
32210 THEN
32220 BEGIN
32230 IF SIGN = NEG
32240 THEN FVALU.IVAL := -FVALU.IVAL
32250 END
32260 ELSE
32270 IF LSP = REALPTR
32280 THEN
32290 BEGIN
32300 IF SIGN = NEG
32310 THEN
32320 FVALU.VALP^.RVAL := -FVALU.VALP^.RVAL
32330 END
32340 ELSE ERROR(167);
32350 INSYMBOL
32360 END
32370 ELSE
32380 IF SY = INTCONST
32390 THEN
32400 BEGIN
32410 IF SIGN = NEG
32420 THEN VAL.IVAL := -VAL.IVAL;
32430 LSP := INTPTR; FVALU := VAL; INSYMBOL
32440 END
32450 ELSE
32460 IF SY = REALCONST
32470 THEN
32480 BEGIN
32490 IF SIGN = NEG
32500 THEN VAL.VALP^.RVAL := -VAL.VALP^.RVAL;
32510 LSP := REALPTR; FVALU := VAL; INSYMBOL
32520 END
32530 ELSE ERRANDSKIP(168,FSYS)
32540 END;
32550 IFERRSKIP(166,FSYS)
32560 END;
32570 FSP := LSP
32580 END (*CONSTANT*) ;
32590
32600 PROCEDURE GETBOUNDS(FSP: STP; VAR FMIN, FMAX: INTEGER); FORWARD;
32610
32620 FUNCTION COMPTYPES(FSP1,FSP2: STP) : BOOLEAN;
32630 (*DECIDE WHETHER STRUCTURES POINTED AT BY FSP1 AND FSP2 ARE COMPATIBLE*)
32640 VAR
32650 NXT1,NXT2: CTP; COMP: BOOLEAN; LMIN,LMAX,I: INTEGER;
32660 LTESTP1,LTESTP2: TESTP;
32670 BEGIN
32680 IF FSP1 = FSP2
32690 THEN COMPTYPES := TRUE
32700 ELSE
32710 IF (FSP1 <> NIL) AND (FSP2 <> NIL)
32720 THEN
32730 IF FSP1^.FORM = FSP2^.FORM
32740 THEN
32750 CASE FSP1^.FORM OF
32760 SCALAR:
32770 COMPTYPES := FALSE;
32780
32790 (* IDENTICAL SCALARS DECLARED ON DIFFERENT LEVELS ARE
32800 NOT RECOGNIZED TO BE COMPATIBLE*)
32810
32820 SUBRANGE:
32830 COMPTYPES := COMPTYPES(FSP1^.RANGETYPE,FSP2^.RANGETYPE);
32840 POINTER:
32850 BEGIN
32860 COMP := FALSE; LTESTP1 := GLOBTESTP; LTESTP2 := GLOBTESTP;
32870 WHILE LTESTP1 <> NIL DO
32880 WITH LTESTP1^ DO
32890 BEGIN
32900 IF (ELT1 = FSP1^.ELTYPE) AND (ELT2 = FSP2^.ELTYPE)
32910 THEN COMP := TRUE;
32920 LTESTP1 := LASTTESTP
32930 END;
32940 IF NOT COMP
32950 THEN
32960 BEGIN
32970 NEW(LTESTP1);
32980 WITH LTESTP1^ DO
32990 BEGIN
33000 ELT1 := FSP1^.ELTYPE;
33010 ELT2 := FSP2^.ELTYPE;
33020 LASTTESTP := GLOBTESTP
33030 END;
33040 GLOBTESTP := LTESTP1; COMP := COMPTYPES(FSP1^.ELTYPE,FSP2^.ELTYPE)
33050 END;
33060 COMPTYPES := COMP; GLOBTESTP := LTESTP2
33070 END;
33080 POWER:
33090 COMPTYPES := COMPTYPES(FSP1^.ELSET,FSP2^.ELSET);
33100 ARRAYS:
33110 BEGIN
33120 GETBOUNDS(FSP1^.INXTYPE,LMIN,LMAX);
33130 I := LMAX-LMIN;
33140 GETBOUNDS(FSP2^.INXTYPE,LMIN,LMAX);
33150 COMPTYPES := COMPTYPES(FSP1^.AELTYPE,FSP2^.AELTYPE)
33160 AND (FSP1^.ARRAYPF = FSP2^.ARRAYPF) AND ( I = LMAX - LMIN ) ;
33170 END;
33180 RECORDS:
33190 BEGIN
33200 NXT1 := FSP1^.FSTFLD; NXT2 := FSP2^.FSTFLD; COMP := TRUE;
33210 WHILE (NXT1 <> NIL) AND (NXT2 <> NIL) DO
33220 BEGIN
33230 COMP := COMPTYPES(NXT1^.IDTYPE,NXT2^.IDTYPE) AND COMP;
33240 NXT1 := NXT1^.NEXT; NXT2 := NXT2^.NEXT
33250 END;
33260 COMPTYPES := COMP AND (NXT1 = NIL) AND (NXT2 = NIL)
33270 AND (FSP1^.RECVAR = NIL) AND (FSP2^.RECVAR = NIL)
33280 END;
33290
33300 (*IDENTICAL RECORDS ARE RECOGNIZED TO BE COMPATIBLE
33310 IF NO VARIANTS OCCUR*)
33320
33330 FILES:
33340 COMPTYPES := COMPTYPES(FSP1^.FILTYPE,FSP2^.FILTYPE)
33350 END (*CASE*)
33360 ELSE (*FSP1^.FORM <> FSP2^.FORM*)
33370 IF FSP1^.FORM = SUBRANGE
33380 THEN COMPTYPES := COMPTYPES(FSP1^.RANGETYPE,FSP2)
33390 ELSE
33400 IF FSP2^.FORM = SUBRANGE
33410 THEN COMPTYPES := COMPTYPES(FSP1,FSP2^.RANGETYPE)
33420 ELSE COMPTYPES := FALSE
33430 ELSE COMPTYPES := TRUE
33440 END (*COMPTYPES*) ;
33450
33460 PROCEDURE GETBOUNDS;
33470
33480 (*GET INTERNAL BOUNDS OF SUBRANGE OR SCALAR TYPE*)
33490
33500 BEGIN
33510 FMIN := 0; FMAX := 0;
33520 IF FSP <> NIL
33530 THEN
33540 IF FSP = INTPTR
33550 THEN
33560 BEGIN (* TYPE INTEGER = MININT..MAXINT *)
33570 FMIN := -MAXINT - 1;
33580 FMAX := MAXINT
33590 END
33600 ELSE
33610 IF (FSP^.FORM <= SUBRANGE) AND NOT COMPTYPES(REALPTR,FSP)
33620 THEN
33630 WITH FSP^ DO
33640 IF FORM = SUBRANGE
33650 THEN
33660 BEGIN
33670 FMIN := VMIN.IVAL;
33680 FMAX := VMAX.IVAL
33690 END
33700 ELSE
33710 IF FSP = ASCIIPTR
33720 THEN
33730 BEGIN (* TYPE ASCII = NUL..DEL *)
33740 FMIN := ORD(NUL);
33750 FMAX := ORD(DEL)
33760 END
33770 ELSE
33780 IF FCONST <> NIL
33790 THEN FMAX := FCONST^.VALUES.IVAL
33800 ELSE FMAX := 0
33810 END (*GETBOUNDS*) ;
33820
33830 FUNCTION STRING(FSP: STP) : BOOLEAN;
33840 BEGIN
33850 STRING := FALSE;
33860 IF FSP <> NIL
33870 THEN
33880 IF FSP^.FORM = ARRAYS
33890 THEN STRING := COMPTYPES(FSP^.AELTYPE,ASCIIPTR)
33900 END (*STRING*) ;
33910
33920 PROCEDURE TYP(FSYS: SETOFSYS; VAR FSP: STP; VAR FSIZE: ADDRRANGE;
33930 VAR FBITSIZE: BITRANGE);
33940 VAR
33950 LSP,LSP1,LSP2: STP; OLDTOP: DISPRANGE; LCP: CTP;
33960 LSIZE,DISPL: ADDRRANGE; I,LMIN,LMAX: INTEGER;
33970 PACKFLAG: BOOLEAN; LBITSIZE: BITRANGE;
33980 LBTP: BTP; BITCOUNT:INTEGER; BYTES: BITRANGE;
33990
34000 FUNCTION LOG2(FVAL: INTEGER): BITRANGE;
34010 VAR
34020 E: BITRANGE; H: INTEGER;
34030 BEGIN
34040 E := 0; H := 1;
34050 REPEAT
34060 E := E + 1; H := H * 2
34070 UNTIL FVAL <= H;
34080 LOG2 := E
34090 END (*LOG2*);
34100
34110 PROCEDURE SIMPLETYPE(FSYS: SETOFSYS; VAR FSP: STP; VAR FSIZE: ADDRRANGE;
34120 VAR FBITSIZE: BITRANGE);
34130 VAR
34140 LSP,LSP1: STP; LCP,LCP1: CTP; TTOP: DISPRANGE;
34150 LCNT: INTEGER; LVALU: VALU; LBITSIZE: BITRANGE;
34160 BEGIN
34170 FSIZE := 1;
34180 SKIPIFERR(SIMPTYPEBEGSYS,208,FSYS);
34190 IF SY IN SIMPTYPEBEGSYS
34200 THEN
34210 BEGIN (* DECLARED SCALARS *)
34220 IF SY = LPARENT
34230 THEN
34240 BEGIN
34250 TTOP := TOP;
34260 WHILE DISPLAY[TOP].OCCUR <> BLCK DO TOP := TOP - 1;
34270 NEW(LSP,SCALAR,DECLARED);
34280 LCP1 := NIL; LCNT := 0;
34290 REPEAT
34300 INSYMBOL;
34310 IF SY = IDENT
34320 THEN
34330 BEGIN
34340 NEW(LCP,KONST);
34350 WITH LCP^ DO
34360 BEGIN
34370 NAME := ID; IDTYPE := LSP; NEXT := LCP1;
34380 VALUES.IVAL := LCNT
34390 END;
34400 ENTERID(LCP);
34410 LCNT := LCNT + 1;
34420 LCP1 := LCP; INSYMBOL
34430 END
34440 ELSE ERROR(209);
34450 IFERRSKIP(166,FSYS + [COMMA,RPARENT])
34460 UNTIL SY <> COMMA;
34470 TOP := TTOP;
34480 WITH LSP^ DO
34490 BEGIN
34500 SELFSTP := NIL; FCONST := LCP1; SIZE := 1; BITSIZE := LOG2(LCNT);
34510
34520 (*ADDITIONAL INFORMATION NEEDED TO STORE IDENTS OF DECLARED
34530 SCALARS USED BY READ AND WRITE*)
34540
34550 VECTORCHAIN := 0; DIMENSION := LCNT - 1; REQUEST := FALSE;
34560 NEXTSCALAR := DECLSCALPTR; DECLSCALPTR := LSP;
34570 VECTORADDR := 0; TLEV := LEVEL
34580 END;
34590 IF SY = RPARENT
34600 THEN INSYMBOL
34610 ELSE ERROR(152)
34620 END (* SY = LPARENT *)
34630 ELSE
34640 BEGIN (* DEFINED CONSTANTS *)
34650 IF SY = IDENT
34660 THEN
34670 BEGIN
34680 SEARCHID([TYPES,KONST],LCP);
34690 INSYMBOL;
34700 IF LCP^.KLASS = KONST
34710 THEN
34720 BEGIN
34730 NEW(LSP,SUBRANGE);
34740 WITH LSP^, LCP^ DO
34750 BEGIN
34760 SELFSTP := NIL; RANGETYPE := IDTYPE;
34770 IF STRING(RANGETYPE)
34780 THEN
34790 BEGIN
34800 ERROR(303); RANGETYPE := NIL
34810 END;
34820 VMIN := VALUES; SIZE := 1
34830 END;
34840 IF SY = COLON
34850 THEN INSYMBOL
34860 ELSE ERROR(151);
34870 CONSTANT(FSYS,LSP1,LVALU);
34880 WITH LSP^ DO
34890 BEGIN
34900 VMAX := LVALU;
34910 IF (VMIN.IVAL < 0) OR (RANGETYPE = REALPTR)
34920 THEN BITSIZE := BITMAX
34930 ELSE
34940 IF VMAX.IVAL = MAXINT
34950 THEN BITSIZE := BITMAX
34960 ELSE BITSIZE := LOG2(VMAX.IVAL + 1);
34970 IF NOT COMPTYPES(RANGETYPE,LSP1)
34980 THEN ERROR(304)
34990 END
35000 END
35010 ELSE
35020 BEGIN
35030 LSP := LCP^.IDTYPE;
35040 IF LSP <> NIL
35050 THEN FSIZE := LSP^.SIZE
35060 END
35070 END (*SY = IDENT*)
35080 ELSE (* SELF-DEFINING CONSTANTS *)
35090 BEGIN
35100 NEW(LSP,SUBRANGE);
35110 CONSTANT(FSYS + [COLON],LSP1,LVALU);
35120 IF STRING(LSP1)
35130 THEN
35140 BEGIN
35150 ERROR(303); LSP1 := NIL
35160 END;
35170 WITH LSP^ DO
35180 BEGIN
35190 RANGETYPE := LSP1; VMIN := LVALU; SIZE := 1
35200 END;
35210 IF SY = COLON
35220 THEN INSYMBOL
35230 ELSE ERROR(151);
35240 CONSTANT(FSYS,LSP1,LVALU);
35250 WITH LSP^ DO
35260 BEGIN
35270 SELFSTP := NIL; VMAX := LVALU;
35280 IF (VMIN.IVAL < 0) OR (RANGETYPE = REALPTR)
35290 THEN BITSIZE := BITMAX
35300 ELSE
35310 IF VMAX.IVAL = MAXINT
35320 THEN BITSIZE := BITMAX
35330 ELSE BITSIZE := LOG2(VMAX.IVAL + 1);
35340 IF NOT COMPTYPES(RANGETYPE,LSP1)
35350 THEN ERROR(304)
35360 END
35370 END;
35380 IF LSP <> NIL
35390 THEN WITH LSP^ DO
35400 IF FORM = SUBRANGE
35410 THEN
35420 IF RANGETYPE <> NIL
35430 THEN
35440 IF RANGETYPE = REALPTR
35450 THEN
35460 BEGIN
35470 IF VMIN.VALP^.RVAL > VMAX.VALP^.RVAL
35480 THEN ERROR(451)
35490 END
35500 ELSE
35510 IF VMIN.IVAL > VMAX.IVAL
35520 THEN ERROR(451)
35530 END;
35540 FSP := LSP;
35550 IF LSP<>NIL
35560 THEN FBITSIZE := LSP^.BITSIZE
35570 ELSE FBITSIZE := 0;
35580 IFERRSKIP(166,FSYS)
35590 END
35600 ELSE
35610 BEGIN
35620 FSP := NIL; FBITSIZE := 0
35630 END
35640 END (*SIMPLETYPE*) ;
35650
35660 PROCEDURE FIELDLIST(FSYS: SETOFSYS; VAR FRECVAR: STP; VAR FFIRSTFIELD: CTP);
35670
35680 LABEL
35690 555,5551;
35700
35710 VAR
35720 LCP,LCP1,NXT,NXT1: CTP; LSP,LSP1,LSP2,LSP3,LSP4,TAGSP: STP;
35730 MINSIZE,MAXSIZE,LSIZE: ADDRRANGE; LVALU: VALU;
35740 LBITSIZE: BITRANGE;
35750 LBTP: BTP; MINBITCOUNT:INTEGER;
35760 LID : ALFA ;
35770
35780 PROCEDURE RECSECTION( VAR FCP: CTP; FSP: STP );
35790 BEGIN
35800 IF NOT PACKFLAG OR (LSIZE > 1) OR (LBITSIZE = 36)
35810 THEN
35820 BEGIN
35830 IF BITCOUNT > 0
35840 THEN
35850 BEGIN
35860 DISPL := DISPL + 1; BITCOUNT := 0
35870 END;
35880 WITH FCP^ DO
35890 BEGIN
35900 IDTYPE := FSP; FLDADDR := DISPL;
35910 PACKF := NOTPACK; FCP := NEXT;
35920 DISPL := DISPL + LSIZE
35930 END
35940 END
35950 ELSE (*PACKED RECORDS*)
35960
35970 BEGIN
35980 BITCOUNT := BITCOUNT + LBITSIZE;
35990 IF BITCOUNT>BITMAX
36000 THEN
36010 BEGIN
36020 DISPL := DISPL + 1;
36030 BITCOUNT := LBITSIZE
36040 END;
36050 IF (LBITSIZE = 18) AND (BITCOUNT IN [18,36])
36060 THEN
36070 BEGIN
36080 WITH FCP^ DO
36090 BEGIN
36100 IDTYPE := FSP;
36110 FLDADDR := DISPL;
36120 IF BITCOUNT = 18
36130 THEN PACKF := HWORDL
36140 ELSE PACKF := HWORDR;
36150 FCP := NEXT
36160 END
36170 END
36180 ELSE
36190 WITH FCP^, FLDBYTE DO
36200 BEGIN
36210 SBITS := LBITSIZE;
36220 PBITS := BITMAX - BITCOUNT;
36230 RELADDR := DISPL;
36240 DUMMYBIT := 0;
36250 IBIT := 0;
36260 IDTYPE := FSP;
36270 PACKF := PACKK;
36280 FCP := NEXT
36290 END
36300 END
36310 END (* RECSECTION *) ;
36320
36330 BEGIN
36340 NXT1 := NIL; LSP := NIL;
36350 SKIPIFERR([IDENT,CASESY],452,FSYS);
36360 WHILE SY = IDENT DO
36370 BEGIN
36380 NXT := NXT1;
36390 LOOP
36400 IF SY = IDENT
36410 THEN
36420 BEGIN
36430 NEW(LCP,FIELD);
36440 WITH LCP^ DO
36450 BEGIN
36460 NAME := ID; IDTYPE := NIL; NEXT := NXT
36470 END;
36480 NXT := LCP;
36490 ENTERID(LCP);
36500 INSYMBOL
36510 END
36520 ELSE ERROR(209);
36530 SKIPIFERR([COMMA,COLON],166,FSYS + [SEMICOLON,CASESY])
36540 EXIT IF SY <> COMMA ;
36550 INSYMBOL
36560 END;
36570 IF SY = COLON
36580 THEN INSYMBOL
36590 ELSE ERROR(151);
36600 TYP(FSYS + [CASESY,SEMICOLON],LSP,LSIZE,LBITSIZE);
36610 IF LSP <> NIL
36620 THEN
36630 IF LSP^.FORM = FILES
36640 THEN ERROR(254);
36650
36660 (* RESERVE SPACE FOR ONE RECORD SECTION *)
36670
36680 WHILE NXT <> NXT1 DO
36690 RECSECTION(NXT,LSP);
36700
36710 NXT1 := LCP;
36720 IF SY = SEMICOLON
36730 THEN
36740 BEGIN
36750 INSYMBOL;
36760 SKIPIFERR([IDENT,ENDSY,CASESY],452,FSYS)
36770 END
36780 ELSE SKIPIFERR([ENDSY,RPARENT],156,FSYS)
36790 END (*WHILE*);
36800 NXT := NIL;
36810 WHILE NXT1 <> NIL DO
36820 WITH NXT1^ DO
36830 BEGIN
36840 LCP := NEXT; NEXT := NXT; NXT := NXT1; NXT1 := LCP
36850 END;
36860 FFIRSTFIELD := NXT;
36870 IF SY = CASESY
36880 THEN
36890 BEGIN
36900 LCP:=NIL; (*POSSIBILITY OF NO TAGFIELD IDENTIFIER*)
36910 INSYMBOL;
36920 IF SY = IDENT
36930 THEN
36940 BEGIN
36950 LID := ID ;
36960 INSYMBOL ;
36970 IF (SY<>COLON) AND (SY<>OFSY)
36980 THEN
36990 BEGIN
37000 ERROR(151) ;
37010 ERRANDSKIP(160,FSYS + [LPARENT])
37020 END
37030 ELSE
37040 BEGIN
37050 IF SY = COLON
37060 THEN
37070 BEGIN
37080 NEW(LSP,TAGFWITHID);
37090 NEW(LCP,FIELD) ;
37100 WITH LCP^ DO
37110 BEGIN
37120 NAME := LID ; IDTYPE := NIL ; NEXT := NIL
37130 END ;
37140 ENTERID(LCP) ;
37150 INSYMBOL ;
37160 IF SY <> IDENT
37170 THEN
37180 BEGIN
37190 ERRANDSKIP(209,FSYS + [LPARENT]) ; GOTO 555
37200 END
37210 ELSE
37220 BEGIN
37230 LID := ID ;
37240 INSYMBOL ;
37250 IF SY <> OFSY
37260 THEN
37270 BEGIN
37280 ERRANDSKIP(160,FSYS + [LPARENT]) ; GOTO 555
37290 END
37300 END
37310 END
37320 ELSE NEW(LSP,TAGFWITHOUTID) ;
37330 WITH LSP^ DO
37340 BEGIN
37350 SIZE:= 0 ; SELFSTP := NIL ;
37360 FSTVAR := NIL;
37370 IF FORM=TAGFWITHID
37380 THEN TAGFIELDP:=NIL
37390 ELSE TAGFIELDTYPE := NIL
37400 END;
37410 FRECVAR := LSP;
37420 ID := LID ;
37430 SEARCHID([TYPES],LCP1) ;
37440 TAGSP := LCP1^.IDTYPE;
37450 IF TAGSP <> NIL
37460 THEN
37470 IF (TAGSP^.FORM <= SUBRANGE) OR STRING(TAGSP)
37480 THEN
37490 BEGIN
37500 IF COMPTYPES(REALPTR,TAGSP)
37510 THEN ERROR(210)
37520 ELSE
37530 IF STRING(TAGSP)
37540 THEN ERROR(169);
37550 WITH LSP^ DO
37560 BEGIN
37570 BITSIZE := TAGSP^.BITSIZE;
37580 IF FORM = TAGFWITHID
37590 THEN TAGFIELDP := LCP
37600 ELSE TAGFIELDTYPE := TAGSP
37610 END;
37620 IF LCP <> NIL
37630 THEN
37640 BEGIN
37650 LBITSIZE :=TAGSP^.BITSIZE;
37660 LSIZE := TAGSP^.SIZE;
37670 RECSECTION(LCP,TAGSP); (*RESERVES SPACE FOR THE TAGFIELD *)
37680 IF BITCOUNT > 0
37690 THEN LSP^.SIZE := DISPL + 1
37700 ELSE LSP^.SIZE := DISPL
37710 END
37720 END
37730 ELSE ERROR(402);
37740 INSYMBOL
37750 END
37760 END
37770 ELSE ERRANDSKIP(209,FSYS + [LPARENT]) ;
37780 555:
37790 LSP1 := NIL; MINSIZE := DISPL; MAXSIZE := DISPL; MINBITCOUNT:=BITCOUNT;
37800 LOOP
37810 LSP2 := NIL;
37820 LOOP
37830 CONSTANT(FSYS + [COMMA,COLON,LPARENT],LSP3,LVALU);
37840 IF NOT COMPTYPES(TAGSP,LSP3)
37850 THEN ERROR(305);
37860 NEW(LSP3,VARIANT);
37870 WITH LSP3^ DO
37880 BEGIN
37890 NXTVAR := LSP1; SUBVAR := LSP2; VARVAL := LVALU;
37900 BITSIZE := LSP^.BITSIZE; SELFSTP := NIL
37910 END;
37920 LSP1 := LSP3; LSP2 := LSP3
37930 EXIT IF SY <> COMMA;
37940 INSYMBOL
37950 END;
37960 IF SY = COLON
37970 THEN INSYMBOL
37980 ELSE ERROR(151);
37990 IF SY = LPARENT
38000 THEN INSYMBOL
38010 ELSE ERROR(153);
38020 FIELDLIST(FSYS + [RPARENT,SEMICOLON],LSP2,LCP);
38030 IF BITCOUNT > 0
38040 THEN
38050 BEGIN
38060 DISPL := DISPL + 1 ; BITCOUNT := 0
38070 END ;
38080 IF DISPL > MAXSIZE
38090 THEN MAXSIZE := DISPL;
38100 WHILE LSP3 <> NIL DO
38110 BEGIN
38120 LSP4 := LSP3^.SUBVAR; LSP3^.SUBVAR := LSP2; LSP3^.FIRSTFIELD := LCP;
38130 LSP3^.SIZE := DISPL ;
38140 LSP3 := LSP4
38150 END;
38160 IF SY = RPARENT
38170 THEN
38180 BEGIN
38190 INSYMBOL;
38200 IFERRSKIP(166,FSYS + [SEMICOLON])
38210 END
38220 ELSE ERROR(152)
38230 EXIT IF SY <> SEMICOLON;
38240 INSYMBOL;
38250 IF SY = ENDSY
38260 THEN GOTO 5551;
38270 DISPL := MINSIZE;
38280 BITCOUNT:=MINBITCOUNT
38290 END;
38300 5551:
38310 DISPL := MAXSIZE;
38320 LSP^.FSTVAR := LSP1
38330 END (*IF SY = CASESY*)
38340 ELSE
38350 IF LSP <> NIL
38360 THEN
38370 IF LSP^.FORM = ARRAYS
38380 THEN FRECVAR := LSP
38390 ELSE FRECVAR := NIL
38400 END (*FIELDLIST*) ;
38410
38420 BEGIN
38430 (*TYP*)
38440 SKIPIFERR(TYPEBEGSYS,170,FSYS);
38450 IF SY IN TYPEBEGSYS
38460 THEN
38470 BEGIN
38480 IF SY IN SIMPTYPEBEGSYS
38490 THEN SIMPLETYPE(FSYS,FSP,FSIZE,FBITSIZE)
38500 ELSE
38510 IF SY = ARROW
38520 THEN
38530 BEGIN
38540 NEW(LSP,POINTER); FSP := LSP;
38550 LBITSIZE := 18;
38560 WITH LSP^ DO
38570 BEGIN
38580 SELFSTP := NIL; ELTYPE := NIL; SIZE := 1; BITSIZE := LBITSIZE
38590 END;
38600 INSYMBOL;
38610 IF SY = IDENT
38620 THEN
38630 BEGIN
38640 SEARCH_ERROR := FALSE;
38650 SEARCHID([TYPES],LCP);
38660 SEARCH_ERROR := TRUE;
38670 IF LCP = NIL
38680 THEN (*FORWARD REFERENCED TYPE ID*)
38690 BEGIN
38700 NEW(LCP,TYPES);
38710 WITH LCP^ DO
38720 BEGIN
38730 NAME := ID; IDTYPE := LSP;
38740 NEXT := FORWARD_POINTER_TYPE
38750 END;
38760 FORWARD_POINTER_TYPE := LCP
38770 END
38780 ELSE
38790 BEGIN
38800 IF LCP^.IDTYPE <> NIL
38810 THEN
38820 IF LCP^.IDTYPE^.FORM = FILES
38830 THEN ERROR(254)
38840 ELSE LSP^.ELTYPE := LCP^.IDTYPE
38850 END;
38860 INSYMBOL;
38870 FBITSIZE:=18
38880 END
38890 ELSE ERROR(209)
38900 END
38910 ELSE
38920 BEGIN
38930 IF SY = SEGMENTSY
38940 THEN
38950 BEGIN
38960 INSYMBOL;
38970 SKIPIFERR(TYPEDELS + [PACKEDSY],170,FSYS)
38980 END;
38990 IF SY = PACKEDSY
39000 THEN
39010 BEGIN
39020 INSYMBOL;
39030 SKIPIFERR(TYPEDELS,170,FSYS);
39040 PACKFLAG := TRUE
39050 END
39060 ELSE PACKFLAG := FALSE;
39070 CASE SY OF
39080 ARRAYSY:
39090 BEGIN
39100 INSYMBOL;
39110 IF SY = LBRACK
39120 THEN INSYMBOL
39130 ELSE ERROR(154);
39140 LSP1 := NIL;
39150 LOOP
39160 NEW(LSP,ARRAYS);
39170 WITH LSP^ DO
39180 BEGIN
39190 AELTYPE := LSP1; INXTYPE := NIL; SELFSTP := NIL;
39200 ARRAYPF := PACKFLAG; SIZE := 1
39210 END;
39220 LSP1 := LSP;
39230 SIMPLETYPE(FSYS + [COMMA,RBRACK,OFSY],LSP2,LSIZE,LBITSIZE);
39240
39250 IF LSP2 <> NIL
39260 THEN
39270 IF LSP2^.FORM <= SUBRANGE
39280 THEN
39290 BEGIN
39300 IF LSP2 = REALPTR
39310 THEN
39320 BEGIN
39330 ERROR(210); LSP2 := NIL
39340 END
39350 ELSE
39360 IF LSP2 = INTPTR
39370 THEN
39380 BEGIN
39390 ERROR(306); LSP2 := NIL
39400 END;
39410 LSP^.INXTYPE := LSP2
39420 END
39430 ELSE
39440 BEGIN
39450 ERROR(403); LSP2 := NIL
39460 END
39470 EXIT IF SY <> COMMA;
39480 INSYMBOL
39490 END;
39500 IF SY = RBRACK
39510 THEN INSYMBOL
39520 ELSE ERROR(155);
39530 IF SY = OFSY
39540 THEN INSYMBOL
39550 ELSE ERROR(160);
39560 TYP(FSYS,LSP,LSIZE,LBITSIZE);
39570 IF LSP <> NIL
39580 THEN
39590 IF LSP^.FORM = FILES
39600 THEN ERROR(169) ;
39610 REPEAT
39620 WITH LSP1^ DO
39630 BEGIN
39640 LSP2 := AELTYPE; AELTYPE := LSP;
39650 IF INXTYPE <> NIL
39660 THEN
39670 BEGIN
39680 GETBOUNDS(INXTYPE,LMIN,LMAX);
39690 I := LMAX - LMIN + 1;
39700 IF ARRAYPF AND (LBITSIZE<=18)
39710 THEN
39720 BEGIN
39730 BYTES := BITMAX DIV LBITSIZE;
39740 WITH ARRAYBPS[LBITSIZE] DO
39750 IF STATE = USED
39760 THEN ARRAYBPADDR := ADDRESS
39770 ELSE
39780 BEGIN
39790 NEW(LBTP);
39800 WITH LBTP^ DO
39810 BEGIN
39820 LAST := LASTBTP; BITSIZE := LBITSIZE;
39830 BYTEMAX := BYTES + 1 (*ONE MORE BYTEPOINTER USED FOR INCREMENT-OPERATIONS*) ;
39840 ARRAYSP := LSP1
39850 END;
39860 LASTBTP := LBTP;
39870 IF STATE = UNUSED
39880 THEN
39890 BEGIN
39900 STATE := REQUESTED;
39910 WITH ABYTE DO
39920 BEGIN
39930 SBITS := LBITSIZE;
39940 PBITS := BITMAX; DUMMYBIT := 0;
39950 IBIT := 0; IREG := REG1; RELADDR := 0
39960 END
39970 END
39980 END;
39990 LSIZE := (I+BYTES-1) DIV (BYTES)
40000 END