1 C Loglan82 Compiler&Interpreter
2 C Copyright (C) 1981-1993 Institute of Informatics, University of Warsaw
3 C Copyright (C) 1993, 1994 LITA, Pau
5 C This program is free software; you can redistribute it and/or modify
6 C it under the terms of the GNU General Public License as published by
7 C the Free Software Foundation; either version 2 of the License, or
8 C (at your option) any later version.
10 C This program is distributed in the hope that it will be useful,
11 C but WITHOUT ANY WARRANTY; without even the implied warranty of
12 C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 C GNU General Public License for more details. File: LICENSE.GNU
14 C ===============================================================
17 IMPLICIT INTEGER (A-Z)
19 C RECOGNIZES SYNTACTICAL UNIT - CREATES THE PROTOTYPE
20 C STACK(TOP+3) - ADDRESS OF THE CURRENT PROTOTYPE
21 C INITIALLY 1 FOR VIRTUAL, 0 OTHERWISE
22 C STACK(TOP+4) - UNIT NAME
23 C FOR A BLOCK - ITS PREFIX SEND FROM E8
24 C STACK(TOP+5) - PREFIX (IF ONE OCCURRED)
25 C STACK(TOP+6) - PROTOTYPE NUMBER
27 C----------------------------------------------------------------------
28 C PROTOTYPE - STRUCTURE:
31 C ----+------------------------
33 C ----+------------------------
34 C -3 ! INTERMEDIATE CODE BLOCK NUMBER
35 C ----+------------------------
36 C -2 ! INTERMEDIATE CODE WORD NUMBER IN A BLOCK
37 C ----+------------------------
38 C -1 ! 0 = NO ENUMERATION CONSTANTS
39 C ----+------------------------
41 C ----+------------------------
42 C +1 ! SL - NUMBER IN ISDICT
43 C ----+------------------------
45 C ----+------------------------
47 C ----+------------------------
49 C ----+------------------------
51 C ----+------------------------
52 C +6 ! THE LIST OF BLOCKS, FUNCTIONS AND PROCEDURES
53 C ----+------------------------
55 C ----+------------------------
57 C ----+------------------------
58 C +9 ! SOURCE TEXT LINE NUMBER
59 C ----+------------------------
60 C REMAINDER FOR FUNCTIONS, PROCEDURES AND CLASSES
61 C ----+------------------------
63 C ----+------------------------
64 C +11 ! FORMAL PARAMETER LIST
65 C ----+------------------------
66 C REMAINDER FOR FUNCTIONS REMAINDER FOR CLASSES
67 C ----+------------------------ ----+-----------------
68 C +12 ! NAME OF RESULT TYPE +12 ! HIDDEN LIST
69 C ----+------------------------ ----+-----------------
70 C +13 ! NUMBER OF ARRAYOF'S +13 ! CLOSE LIST
71 C ----+------------------------ ----+-----------------
75 C 2 - CLASS/COROUTINE/PROCESS
78 C 5 - "3" WITH ERRONEOUS PARAMETER LIST
85 C THE SYSTEM PREFIX IS AUGMENTED BY
86 C 2**13 - IF INSTRUCTIONS ARE PRESENT
87 C 2**14 - FOR SPECIFICATION TAKEN NONE
88 C 2**15 - FOR SPECIFICATION VIRTUAL
90 C LIST ITEM FOR TAKEN, CLOSE, HIDDEN:
93 C ---+--------------------------
94 C +1 ! OCCURRENCE LINE NUMBER IN THE SOURCE TEXT
95 C ---+--------------------------
97 C ---+--------------------------
99 C SUBMODULE LIST ITEM:
101 C 0 ! PROTOTYPE NUMBER IN THE DICTIONARY
102 C ---+--------------------------
103 C +1 ! THE NEXT ELEMENT
108 O S, ADRES, K, SCOMA, SDOT, SEMICOL,
109 1 SCOLON, SLEFT, SRIGHT, SBECOME, STAR, SRELAT,
110 2 SEOF, SIDENT, SCONST, SAND, SARRAY, SARROF,
111 3 SATTACH, SBEGIN, SBLOCK, SBOOL, SCALL, SCASE,
112 4 SCLASS, SCLOSE, SCONS, SCOPY, SCOROUT, SDETACH,
113 5 SDIM, SDO, SDOWN, SELSE, SEND, SESAC,
114 6 SEXIT, SEXTERN, SFI, SFOR, SFUNCT, SIF,
115 7 SINNER, SINPUT, SINT, SKILL, SLOCK, SNEW,
116 8 SNONE, SNOT, SOD, SOR, SORIF, SOTHER,
117 9 SOUTPUT, SPREF, SPRCD, SQUA, SREAD, SRESUME,
118 O SRETURN, STEP, STOP, STAKEN, STHEN, STHIS,
119 A STO, STYPE, SUNIT, SVAR, SVIRTUAL, SWAIT,
120 B SWHEN, SWHILE, SWRIT, SWRITLN, STRUE, SALL,
121 C WAND, WARRAY, WASSIGN, WASSCON, WATTACH, WBLOCK,
122 D WCALL, WCASE, WCASEL, WCOMA, WCNSTB, WCNSTC,
123 E WCNSTI, WCNSTN, WCNSTR, WCNST, WCOPY, WDETACH,
124 F WDOT, WDOWNTO, WEOF, WESAC, WFIN, WFIRST,
125 G WFOREND, WFORVAR, WFROM, WIDENT, WIFFALS, WIFTRUE
128 H WINNER, WINSTREND,WJUMP, WKILL, WLABEL, WLEFT,
129 I WLOCK, WLOW, WLSE, WNEW, WNEWARRAY,WNOT,
130 J WOPERAT, WOPT, WOR, WOTHER, WPREF, WPRIM,
131 K WQUA, WREAD, WRELAT, WRESUME, WRETURN, WRIGHT,
132 L WSTART, WSTEP, WSTOP, WTHIS, WTO, WAIT,
133 M WRITE, WRITELN, WBOUND, UNICAL,
135 O LMEM, LPMEM, IRECN, ISFIN, LPMSYS, LPML,
136 P LPMF, NRINT, NRRE, NRBOOL, NRCHAR, NRCOR,
137 Q NRPROC, NRTEXT, NRUNIV, NATTR, NRNONE, NBLSYS,
138 R NBLUS, NEMPTY, INSYS, LOCAL, OWN, OBJECT,
140 cdsw $ SCANER (3735),
142 Z TOP, IN, NEXT, STACK(500),
145 DIMENSION IPMEM(7890)
146 EQUIVALENCE (IPMEM(1),SCANER(1))
147 COMMON /BUFF/ INSTR(265),BUFOR(85),LP,LN,MAX,JNK(266)
148 C NOTE: FOR THE MAIN BLOCK THE ENTRY IS NON-STANDARD - IN=4 JUMP TO
153 C ORIGINAL GOTO-STATEMENT ***********************************************
154 C GOTO (1,200,300,400,0),IN ************************ 03.01.84
155 C CHANGED TO ***********************************************
156 GOTO (1,200,300,400,1),IN
157 C BECAUSE LABEL 0 IS UNDEFINED ***********************************************
162 C CHECK FOR THE MAIN BLOCK (I.E. IF IN = 5)
163 IF (IN.EQ.5) GOTO 1460
164 IF (S.EQ.SBLOCK) GOTO 15
166 IF (S.NE.SVIRTUAL) GOTO 3
169 3 IF (S.NE.SIDENT) GOTO 3010
176 3030 IF (S.NE.SCOLON) GOTO 3050
181 3080 IF (S.NE.SIDENT) GOTO 5
185 C RECOGNITION OF THE UNIT KIND
186 5 IF (S.EQ.SFUNCT) GOTO 10
187 IF (S.EQ.SPRCD) GOTO 12
188 IF (S.EQ.SCLASS) GOTO 14
189 IF (S.EQ.SCOROUT) GOTO 16
192 C IF NAME WAS PRESENT ASSUME PROCEDURE
193 IF (STACK(TOP+4).NE.0) GOTO 12
206 1460 IF (S.NE.SEMICOL) GOTO 1480
209 1480 IF (BTEST(C0M(2),14)) GOTO 2795
211 IF (STACK(TOP+1).EQ.10) CALL ERROR(119)
213 IF (LPMF.LT.LPML) CALL ERROR(199)
216 C A LOCAL USAGE OF VARIABLE NEXT
218 IPMEM(NEXT+2)=STACK(TOP+4)
219 C PREFIX SENT FROM E8
224 C THE PROTOTYPE IS ALREADY CREATED
226 IF (LPMF.LT.LPML) CALL ERROR(199)
227 IF (STACK(TOP+3).EQ.1)
228 * IPMEM(LPMF+14)=IBSET(IPMEM(LPMF+14),15)
229 C STARTING FROM THIS POINT STACK(TOP+3)
230 C INCLUDES PROTOTYPE ADDRESS
233 C A LOCAL USAGE OF VARIABLE NEXT
235 IPMEM(NEXT+10)=STACK(TOP+4)
236 IPMEM(NEXT+2)=STACK(TOP+5)
239 C ANALYSIS OF THE FORMAL PARAMETERS
241 IF (S.NE.SLEFT) GOTO 2050
242 CALL ADDPAR(STACK(TOP+3)+11,STACK(TOP+3))
243 IF (S.EQ.SRIGHT) CALL SCAN
244 2050 NEXT=STACK(TOP+3)
245 C NEXT LOCAL USAGE OF VARIABLE NEXT
246 C JUMP OUT IF NOT A FUNCTION
247 IF (IPMEM(NEXT).NE.4) GOTO 25
248 IF (S.NE.SCOLON) GOTO 2080
251 C COLON MISSING - ERROR
254 IF (S.NE.SARROF) GOTO 22
255 21 STACK(TOP+4)=STACK(TOP+4)+1
257 IF (S.EQ.SARROF) GOTO 21
259 22 IPMEM(NEXT+13)=STACK(TOP+4)
260 IF (S.EQ.SINT) IPMEM(NEXT+12)=ADRES*8
261 IF (S.EQ.SCOROUT) IPMEM(NEXT+12)=K
262 IF (S.EQ.SIDENT) IPMEM(NEXT+12)=ADRES
263 IF (IPMEM(NEXT+12).EQ.0) GOTO 2250
266 C TYPE MISSING - ERROR
268 25 IF (S.EQ.SEMICOL) GOTO 262
271 262 NRRE=STACK(TOP+6)
273 C PROTOTYPE ADDRESS IS PUT INTO THE DICTIONARY
276 C JUMP OUT FOR THE MAIN BLOCK
277 IF (IN.EQ.0) GOTO 275
278 IF (STACK(IN+1).EQ.13) GOTO 266
279 IF (STACK(IN+1).NE.11) GOTO 265
280 C AN E11 (SYNTACTIC UNIT) OR E13 (HANDLER) OBJECT BEING THE SYNTACTIC FATHER
281 C OF THE CURRENT OBJECT HAS BEEN FOUND WITHIN THE DL-CHAIN.
282 C E11 - MOVE PROTOTYPE ADDRESS TO STACK('PERTINENT' TOP + 3)
286 C E13 - MOVE PROTOTYPE ADDRESS TO STACK('PERTINENT' TOP + 4)
289 267 IPMEM(NEXT+1)=STACK(IN+6)
291 C UPDATE THE SUBMODULE LIST FOR THE FATHER
292 IF (LPMF.LT.LPML) CALL ERROR(199)
293 IF ((IPMEM(NEXT).EQ.2).OR.(IPMEM(NEXT).EQ.7)) NRRE=NRRE-1
294 IPMEM(LPMF+2)=IPMEM(NRRE)
296 IPMEM(LPMF+1)=STACK(TOP+6)
299 IF (S.NE.SBLOCK) GOTO 287
301 287 IF (S.NE.STAKEN) GOTO 35
303 IF (S.EQ.SEMICOL) GOTO 29
304 27 IF (S.NE.SIDENT) GOTO 2805
306 IF (LPMF.LT.LPML) CALL ERROR(199)
309 IPMEM(LPMF+3)=IPMEM(NEXT+7)
312 IF (S.NE.SCOMA) GOTO 28
315 C ADD THE SYSPP SYSTEM PREFIX
321 28 IF (S.EQ.SEMICOL) GOTO 30
324 29 IPMEM(NEXT+8)=IBSET(IPMEM(NEXT+8),14)
326 35 IF (S.EQ.SCLOSE) GOTO 350
332 C CALL E10 TO ANALYSE THE DECLARATION SEQUENCE
333 200 IF (S.EQ.SHANDL) GOTO 380
334 203 NEXT=STACK(TOP+3)
335 IF (S.EQ.SBEGIN) GOTO 210
336 IF (S.EQ.SEND) GOTO 212
338 IF (S.GT.24) GOTO 205
341 205 IF (S.EQ.SBECOME) GOTO 210
342 IF (IPMEM(NEXT-1).EQ.0) GOTO 209
343 C ENUMERATION CONSTANTS OCCURRED - END CODE
344 CALL OUTPUT(WFIRST,LN)
349 210 IPMEM(NEXT+8)=IBSET(IPMEM(NEXT+8),13)
350 212 CALL SLAD(4,11,3)
354 C CALL E9 TO ANALYSE THE INSTRUCTION SEQUENCE
355 C E9 FILLS UP WORDS -1,-2,-3 FOR THE PROTOTYPE WHOSE
356 C ADDRESS IS PASSED THROUGH STACK(TOP+3)
358 300 IF (TOP.EQ.1) GOTO 207
360 C IF IT WAS THE MAIN BLOCK JUMP OUT TO 207
365 C A LOCAL USAGE OF VARIABLE NEXT - IT INCLUDES THE PROTOTYPE ADDRESS.
366 C CHECK IF THE PARSED UNIT WAS A BLOCK. IF SO THEN JUMP OUT AND TERMINATE
367 C PARSING. OTHERWISE CHECK WHETHER "END" IS FOLLOWED BY AN IDENTIFIER
369 IF (IPMEM(NEXT).EQ.1) GOTO 207
370 IF (S.NE.SIDENT) GOTO 207
372 C "END" IS FOLLOWED BY AN IDENTIFIER. WE HAVE TO CHECK WHETHER
373 C IT MATCHES THE IDENTIFIER FROM THE PROTOTYPE.
376 IF (ADRES.EQ.IPMEM(NEXT)) GOTO 308
388 C LOOK FOR A REASONABLE SYMBOL
389 3485 IF (S.EQ.SBEGIN) GOTO 200
390 IF (S.EQ.SEND) GOTO 212
391 IF (S.EQ.SUNIT) GOTO 35
392 IF (S.EQ.SVAR) GOTO 35
393 IF (S.EQ.SCONS) GOTO 35
394 IF (S.EQ.SCLOSE) GOTO 350
395 IF (S.EQ.70) GOTO 207
396 IF (S.EQ.1) GOTO 3488
397 IF (S.LT.25) GOTO 200
400 350 NRRE=STACK(TOP+3)
401 IF ((IPMEM(NRRE).NE.2).AND.(IPMEM(NRRE).NE.7)) GOTO 3480
402 351 STACK(TOP+4)=ADRES
404 IF (S.NE.SCLOSE) GOTO 355
405 IF (ADRES.EQ.STACK(TOP+4)) CALL ERROR(120)
407 C HIDDEN OR PROTECTED ENCOUNTERED
408 355 IF (S.NE.SIDENT) GOTO 3470
410 IF (LPMF.LT.LPML) CALL ERROR(199)
413 NEXT=STACK(TOP+3)+STACK(TOP+4)+11
414 IPMEM(LPMF+3)=IPMEM(NEXT)
417 IF (S.EQ.SEMICOL) GOTO 30
418 IF (S.NE.SCOMA) GOTO 3460
421 C HIDDEN PROTECTED ENCOUNTERED
423 IF (S.NE.SIDENT) GOTO 3470
425 IF (LPMF.LT.LPML) CALL ERROR(199)
431 IPMEM(LPMF+3)=IPMEM(NEXT)
433 IPMEM(LPMF+6)=IPMEM(NEXT+1)
436 IF (S.EQ.SEMICOL) GOTO 30
437 IF (S.NE.SCOMA) GOTO 3460
439 C HANDLER ENCOUNTERED
440 380 NEXT=STACK(TOP+3)
441 C PROTOTYPE ADDRESS IS SAVED
442 IF (IPMEM(NEXT-1).NE.0) CALL MARK(STACK(TOP+4),STACK(TOP+5))
446 C CALL E13 TO ANALYSE THE HANDLER
447 400 NEXT=STACK(TOP+3)
448 IF (IPMEM(NEXT-1).NE.0) CALL FIND(STACK(TOP+4),STACK(TOP+5))
450 C SKIP THE SEQUENCE "END HANDLERS(;)"
452 IF (S.EQ.SHANDL) CALL SCAN
453 IF (S.EQ.SEMICOL) CALL SCAN
458 IMPLICIT INTEGER (A-Z)
460 C RECOGNIZES BOOLEAN EXPRESSIONS BUILT UP OF CONSTANTS
463 C STACK(TOP+3) - INCLUDES 1 WHEN "AND" IS TO BE WRITTEN
464 C STACK(TOP+4) - ........ 1 .... "OR" .. .. .. .......
465 C STACK(TOP+5) - ........ 1 .... "NOT" .. .. .. .......
466 C STACK(TOP+6) - INCLUDES RELATION CODE (SOMETIMES)
470 O S, ADRES, K, SCOMA, SDOT, SEMICOL,
471 1 SCOLON, SLEFT, SRIGHT, SBECOME, STAR, SRELAT,
472 2 SEOF, SIDENT, SCONST, SAND, SARRAY, SARROF,
473 3 SATTACH, SBEGIN, SBLOCK, SBOOL, SCALL, SCASE,
474 4 SCLASS, SCLOSE, SCONS, SCOPY, SCOROUT, SDETACH,
475 5 SDIM, SDO, SDOWN, SELSE, SEND, SESAC,
476 6 SEXIT, SEXTERN, SFI, SFOR, SFUNCT, SIF,
477 7 SINNER, SINPUT, SINT, SKILL, SLOCK, SNEW,
478 8 SNONE, SNOT, SOD, SOR, SORIF, SOTHER,
479 9 SOUTPUT, SPREF, SPRCD, SQUA, SREAD, SRESUME,
480 O SRETURN, STEP, STOP, STAKEN, STHEN, STHIS,
481 A STO, STYPE, SUNIT, SVAR, SVIRTUAL, SWAIT,
482 B SWHEN, SWHILE, SWRIT, SWRITLN, STRUE, SALL,
483 C WAND, WARRAY, WASSIGN, WASSCON, WATTACH, WBLOCK,
484 D WCALL, WCASE, WCASEL, WCOMA, WCNSTB, WCNSTC,
485 E WCNSTI, WCNSTN, WCNSTR, WCNST, WCOPY, WDETACH,
486 F WDOT, WDOWNTO, WEOF, WESAC, WFIN, WFIRST,
487 G WFOREND, WFORVAR, WFROM, WIDENT, WIFFALS, WIFTRUE
490 H WINNER, WINSTREND,WJUMP, WKILL, WLABEL, WLEFT,
491 I WLOCK, WLOW, WLSE, WNEW, WNEWARRAY,WNOT,
492 J WOPERAT, WOPT, WOR, WOTHER, WPREF, WPRIM,
493 K WQUA, WREAD, WRELAT, WRESUME, WRETURN, WRIGHT,
494 L WSTART, WSTEP, WSTOP, WTHIS, WTO, WAIT,
495 M WRITE, WRITELN, WBOUND, UNICAL,
497 O LMEM, LPMEM, IRECN, ISFIN, LPMSYS, LPML,
498 P LPMF, NRINT, NRRE, NRBOOL, NRCHAR, NRCOR,
499 Q NRPROC, NRTEXT, NRUNIV, NATTR, NRNONE, NBLSYS,
500 R NBLUS, NEMPTY, INSYS, LOCAL, OWN, OBJECT,
504 Z TOP, IN, NEXT, STACK(500),
511 80 IF (S.NE.SNOT) GOTO 100
516 100 IF (S.EQ.STRUE) GOTO 130
517 C THERE SHOULD BE AN IDENTIFIER
521 C CALL E7 - TO ANALYSE ARITHEXPRESSION
522 20 IF (S.NE.SRELAT) GOTO 200
523 C '=' OCCURRED (OR SOMETHING ALIKE)
524 C IT SHOULD BE STORED IN STACK (TOP+6)
525 115 STACK(TOP+6)=ADRES
530 C ARTITHEXPRESSION CALLED AGAIN
531 30 CALL OUTPUT(WOPERAT,STACK(TOP+6))
534 130 CALL OUTPUT(WCNSTB,-1)
535 CALL OUTPUT(1-ADRES,-1)
538 200 IF (STACK(TOP+5).EQ.0) GOTO 205
541 205 IF (STACK(TOP+3).EQ.0) GOTO 210
544 210 IF (S.NE.SAND) GOTO 220
548 220 IF (STACK(TOP+4).EQ.0) GOTO 230
551 230 IF (S.NE.SOR) GOTO 1000
560 IMPLICIT INTEGER (A-Z)
561 C RECOGNIZES HANDLER, BUILDS UP ITS PROTOTYPE
563 C STACK(TOP+3) - END-OF-CODE LABEL
564 C STACK(TOP+4) - HANDLER PROTOTYPE ADDRESS
565 C STACK(TOP+5) - INCLUDES 1 IF "OTHERS" OCCURRED
566 C STACK(TOP+6) - PROTOTYPE NUMBER
567 C THE FOLLOWING BLANK-COMMON VARIABLES ARE USED AS LOCAL ONES:
568 C NRCHAR - HEAD OF THE CREATED LIST OF NAMES
573 C----------------------------------------------------------------------
576 C ----+-------------------
578 C ----+-------------------
580 C ----+-------------------
581 C -3 ! SCRATCH FILE CODE RECORD NUMBER
582 C ----+-------------------
583 C -2 ! NUMBER OF WORD IN THE CODE RECORD
584 C ----+-------------------
586 C ----+-------------------
588 C ----+-------------------
589 C +1 ! SL - NUMBER IN ISDICT
590 C ----+-------------------
592 C ----+-------------------
594 C ----+-------------------
596 C ----+-------------------
598 C ----+-------------------
600 C ----+-------------------
602 C ----+-------------------
604 C ----+-------------------
605 C +9 ! SOURCE TEXT LINE NUMBER
606 C ----+-------------------
607 C +10 ! LIST OF NAMES
608 C ----+-------------------
612 C ----+-------------------
614 C ----+-------------------
615 C +1 ! NEXT ITEM POINTER
616 C ----+-------------------
618 C NOTE ! EMPTY LIST OF NAMES CORRESPONDS TO THE PROTOTYPE OF A HANDLER
621 COMMON /STREAM/ ERRFLG,LINE,IBUF2(265),BUF(7),ON,BUFOUT(256),
623 COMMON /BUFF/ INSTR(265),BUFOR(85),LP,LN,MAX,JNK(266)
626 O S, ADRES, K, SCOMA, SDOT, SEMICOL,
627 1 SCOLON, SLEFT, SRIGHT, SBECOME, STAR, SRELAT,
628 2 SEOF, SIDENT, SCONST, SAND, SARRAY, SARROF,
629 3 SATTACH, SBEGIN, SBLOCK, SBOOL, SCALL, SCASE,
630 4 SCLASS, SCLOSE, SCONS, SCOPY, SCOROUT, SDETACH,
631 5 SDIM, SDO, SDOWN, SELSE, SEND, SESAC,
632 6 SEXIT, SEXTERN, SFI, SFOR, SFUNCT, SIF,
633 7 SINNER, SINPUT, SINT, SKILL, SLOCK, SNEW,
634 8 SNONE, SNOT, SOD, SOR, SORIF, SOTHER,
635 9 SOUTPUT, SPREF, SPRCD, SQUA, SREAD, SRESUME,
636 O SRETURN, STEP, STOP, STAKEN, STHEN, STHIS,
637 A STO, STYPE, SUNIT, SVAR, SVIRTUAL, SWAIT,
638 B SWHEN, SWHILE, SWRIT, SWRITLN, STRUE, SALL,
639 C WAND, WARRAY, WASSIGN, WASSCON, WATTACH, WBLOCK,
640 D WCALL, WCASE, WCASEL, WCOMA, WCNSTB, WCNSTC,
641 E WCNSTI, WCNSTN, WCNSTR, WCNST, WCOPY, WDETACH,
642 F WDOT, WDOWNTO, WEOF, WESAC, WFIN, WFIRST,
643 G WFOREND, WFORVAR, WFROM, WIDENT, WIFFALS, WIFTRUE
646 H WINNER, WINSTREND,WJUMP, WKILL, WLABEL, WLEFT,
647 I WLOCK, WLOW, WLSE, WNEW, WNEWARRAY,WNOT,
648 J WOPERAT, WOPT, WOR, WOTHER, WPREF, WPRIM,
649 K WQUA, WREAD, WRELAT, WRESUME, WRETURN, WRIGHT,
650 L WSTART, WSTEP, WSTOP, WTHIS, WTO, WAIT,
651 M WRITE, WRITELN, WBOUND, UNICAL,
653 O LMEM, LPMEM, IRECN, ISFIN, LPMSYS, LPML,
654 P LPMF, NRINT, NRRE, NRBOOL, NRCHAR, NRCOR,
655 Q NRPROC, NRTEXT, NRUNIV, NATTR, NRNONE, NBLSYS,
656 R NBLUS, NEMPTY, INSYS, LOCAL, OWN, OBJECT,
660 Z TOP, IN, NEXT, STACK(500),
663 DIMENSION IPMEM(1000)
664 EQUIVALENCE (IPMEM(1),SCANER(1))
665 cdsw EQUIVALENCE (AUX,SCANER(3698))
666 EQUIVALENCE (AUX,SCANER(8698))
667 EQUIVALENCE (WSTART,WUNLOCK)
674 IF (S.EQ.SWHEN) GOTO 100
675 IF (S.EQ.SOTHRS) GOTO 200
679 C IS THERE AN IDENTIFIER?
681 IF (S.EQ.SIDENT) GOTO 110
686 IF (LPMF.LT.LPML) CALL ERROR(199)
687 C CREATE AN ENTRY TO THE NAME LIST
693 IF (S.EQ.SCOLON) GOTO 118
695 IF (S.EQ.SCOMA) GOTO 100
696 C NONE OF ABOVE - ERROR
701 IF (LPMF.LT.LPML) CALL ERROR(199)
702 C SLOT FOR THE PROTOTYPE AND HANDLER
703 C DESCRIPTION FOR THE SYNTACTIC FATHER
711 IPMEM(NRCOR+10)=NRCHAR
712 C UPDATE FATHER'S SUBMODULE LIST
714 IPMEM(NRCOR+ 1)=STACK(NRRE+6)
716 IPMEM(LPMF+1)=STACK(TOP+6)
717 IPMEM(LPMF+2)=IPMEM(NRBLUS+6)
718 IPMEM(NRBLUS+6)=LPMF+1
719 C PREPARE THE INTERMEDIATE CODE
720 IPMEM(NRCOR- 2)= POSIT
721 IPMEM(NRCOR- 3)= RECNR
722 CALL OUTPUT(WFIRST,LN)
730 C CALL E8 TO ANALYSE STATEMENT-LIST
732 20 CALL OUTPUT(WFIN,STACK(TOP+3))
735 IF (S.EQ.SWHEN) GOTO 100
736 IF (S.EQ.SOTHRS) GOTO 200
737 IF (S.EQ.SEND) GOTO 90
738 C WRONG END OF HANDLER
742 200 IF (STACK(TOP+5).NE.0) CALL ERROR(129)
745 IF (S.EQ.SCOLON) CALL SCAN
749 INTEGER FUNCTION EXYT(K,L)
750 IMPLICIT INTEGER (A-Z)
751 COMMON /BLANK/ com(9037), top, in, next, stack(500), reszta(3652)
753 C THIS FUNCTION RETURNS THE NUMBER OF THE PERTINENT LABEL
754 C DEPENDING ON THE VALUE OF THE SECOND PARAMETER, WE CHOOSE
755 C THE STARTING LOOP LABEL /FOR L = 0/ OR THE ENDING ONE /L=1/
761 2 IF (STACK(Z+1).EQ.8) GOTO 10
762 IF (STACK(Z+1).EQ.13) GOTO 3
763 IF (STACK(Z+1).NE.9) GOTO 1
765 C EXIT IS MADE TO THE END OF THE SYNTACTIC UNIT (E9)
768 3 IF (A.GT.1) CALL ERROR(110)
769 IF (L.EQ.0) CALL ERROR(138)
774 C DO . . . OD - TYPE LOOP DETECTED
776 10 IF (STACK(Z+2).EQ.13) GOTO 15
777 IF (STACK(Z+2).EQ.7) GOTO 15
778 IF (STACK(Z+2).NE.25) GOTO 1
781 C FOR... AND WHILE... ARE ALSO ADMITTED..
785 C JUMP OUT IF THE NUMBER OF LOOPS IS LESS THAN THE NUMBER OF
794 IMPLICIT INTEGER(A-Z)
795 COMMON /STREAM/ ERRFLG,LINE,IBUF2(265),BUF(7),ON,BUFOUT(256),
798 C MARKS THE CURRENT LOCATION OF THE SCRATCH FILE
799 C MEANING OF PARAMETERS (EXIT ONLY):
801 C B - POSITION (WORD NUMBER) IN THE RECORD
806 IF (RECNR.NE.NEXT-1) CALL SEEK(BUF,NEXT)
813 SUBROUTINE FIND (A,B)
814 IMPLICIT INTEGER (A-Z)
816 C THIS PROCEDURE RESETS THE POSITION OF THE SCRATCH FILE ACCORDING TO
817 C THE PARAMETERS: A - RECORD NUMBER
820 COMMON /STREAM/ ERRFLG,LINE,IBUF2(265),BUF(7),ON,BUFOUT(256),
832 IMPLICIT INTEGER(A-Z)
833 C WRITES TO THE INTERMEDIATE CODE INFORMATION ABOUT ALL OPTIONS
834 C (WORD C0M(2)) WITHOUT L-OPTION. CLEARS AUX.
835 COMMON /BLANK/ c0m(4), blank0(121), wopt, blank1(8873), aux
838 CALL OUTPUT(WOPT,I*(-1+2*IAND(1,ISHFT(C0M(2),2-I))))
845 IMPLICIT INTEGER (A-Z)
846 C WRITES TO THE INTERMEDIATE CODE INFORMATIONS ABOUT ALL OPTIONS FOR WHICH
847 C THE CORRESPONDING BITS IN WORD AUX ARE SET.
849 COMMON /BLANK/ C0M(4),BLANK0(121),WOPT,BLANK1(8873),AUX
854 X CALL OUTPUT(WOPT,I*(-1+2*IAND(1,ISHFT(C0M(2),2-I))))
860 SUBROUTINE OUTPUT(A,B)
861 IMPLICIT INTEGER (A-Z)
863 C WRITES INTERMEDIATE CODE TO THE SCRATCH FILE
865 COMMON /STREAM/ ERRFLG,LINE,IBUF2(265),BUF(7),ON,BUFOUT(256),
867 COMMON /BUFF/ INSTR(265),BUFOR(85),LP,LN,MAX,POSTR(265),STATUS
868 IF (B.NE.-1) GOTO 100
870 IF (POSIT.EQ.255) GOTO 50
876 IF (RECNR.NE.NEXT-1) CALL SEEK(BUF,NEXT)
880 100 IF (POSIT.LT.255) GOTO 150
885 IF (RECNR.NE.NEXT-1) CALL SEEK(BUF,NEXT)
893 IF (POSIT.EQ.256) GOTO 50
898 IMPLICIT INTEGER (A-Z)
899 COMMON /BLANK/ COM(278),
900 X LMEM , LPMEM , IRECN , ISFIN , LPMSYS, LPML , LPMF ,
901 X NRINT , NRRE , NRBOOL, NRCHR , NRCOR , NRPROC, NRTEXT,
902 X NRUNIV, NATTR , NRNONE, NBLSYS, NBLUS , NEMPTY, INSYS ,
903 X LOCAL , OWN , OBJECT,
905 LOGICAL INSYS, LOCAL, OWN
906 C IPMEM - MAIN MEMORY
907 C LPML - ADDRESS OF THE FIRST -
908 C LPMF - ADDRESS OF THE LAST - FREE WORD IN IPMEM
909 C ISFIN - TOP OF THE PROTOTYPE DICTIONARY STACK
910 C LPMEM - DIVISION POINT FOR IPMEM
911 COMMON /LISTING/ OUTSTR(265)
912 COMMON /BUFF/ INSTR(265),BUFOR(85),LP,LN,MAX,POSTR(265),STATUS
913 COMMON /STREAM/ ERRFLG,LINE,IBUF2(265),BUF(7),ON,BUFOUT(256),
916 CPS character auxc(4)
917 CPS equivalence (auxc(1), aux)
921 IPMEM(ISFIN-1)=LPMF-LPML+1
924 IF (IPMEM(NATTR).EQ.0) GOTO 10
925 cdsw IPMEM(ISFIN)=NATTR-3738
926 IPMEM(ISFIN)=NATTR-8738
930 IF (LPMF.EQ.LMEM) CALL ERROR(191)
932 C CHECK IF THE PROTOTYPE DICTIONARY INCLUDES ANY ADDRESS
933 C OR IF THE FIRST PROTOTYPE IS BUILT CORRECTLY
934 IF (IPMEM(LPMEM).EQ.0) CALL ERROR(191)
935 IF (IPMEM(NATTR).EQ.0) CALL ERROR(191)
936 cdsw CALL CLOSF(OUTSTR)
937 cdsw CALL CLOSF(INSTR)
938 CALL PUT(BUF,BUFOUT(1))
941 cdsw znacznik konca stringow
943 call ffwrite_ints( 15, -1, 1 )
947 call ffwrite_char(16, int2char(26))
948 C --- MPTBUF SEEMS NOT NECESSARY IN THE 'ONE-OVERLAY' VERSION
953 SUBROUTINE SLAD(NROFVAR,NR,MIEJSCE)
954 IMPLICIT INTEGER (A-Z)
955 COMMON /BLANK/ COM(9037), TOP, IN, NEXT, STACK(500), RESZTA(3652)
956 C PREPARES STACK FOR CALL OF ANOTHER PROCEDURE
958 C NROFVAR - NUMBER OF THE LOCAL VARIABLES ALLOCATED ON THE STACK
959 C NR - NUMBER OF THE CALLING PROCEDURE
960 C SLAD - NUMBER OF THE RETURN POINT
961 EQUIVALENCE(COM(282),ISFIN)
962 cdsw IF (TOP+3748.GT.ISFIN) CALL ERROR(198)
963 IF (TOP+8748.GT.ISFIN) CALL ERROR(198)
964 C CHECK IF THE STACK ISN'T TOO LONG
974 SUBROUTINE ADDPAR(LHEAD,MFIELD)
975 IMPLICIT INTEGER (A-Z)
977 C APPENDS PARAMETERS TO THE CREATED PROTOTYPE
978 C PARAMETERS: LHEAD - BEGINNING OF THE PARAMETER LIST
979 C MFIELD - ADDRESS OF THE PLACE TO BE CHANGED IN CASE OF
981 C MODIFICATION FUNCTION:
982 C CONVERT: [1..10] ------> [1,7,5,6,5,6,7,8,10,10]
983 C THE FOLLOWING BLANK-COMMON VARIABLES ARE USED:
984 C OBJECT - LAST ELEMENT ON THE PARAMETER LIST (LINK FIELD)
985 C KIND - A LOCAL VARIABLE
986 C NRRE - COUNTS NUMBER OF OCCURRENCES OF ARRAYOF'S
987 C NATTR - KEEPS THE RECOGNIZED TYPE
988 C NRCHR - A LOCAL VARIABLE (LOOP LIMIT)
990 C NRTEXT - SAVES THE VALUE OF VARIABLE OBJECT
991 C NRPROC - ADDRESS OF THE PLACE TO BE WVERWRITTEN
992 C NBLUS - ANALYSIS LEVEL 1 - PARAMETER LIST
993 C 2 - SIMPLIFIED LIST
994 C---------------------------------------------------------------------
995 C ITEM OF THE FORMAL PARAMETER LIST:
998 C ---+------------------
999 C -1 ! SOURCE TEXT LINE NUMBER
1000 C +--+------------------
1002 C +--+------------------
1003 C +3 ! NEXT ITEM INDEX
1004 C REMAINDER FOR VARIABLES FOR PROCEDURES AND FUNCTIONS
1005 C ---+------------------------------------------------------------
1006 C +4 ! TYPE NUMBER ! +4 ! FORMAL PARAMETER LIST
1007 C ---+-----------------------+------------------------------------
1008 C +5 ! ARRAYOF COUNT ! +5 ! TYPE NAME (KIND = FUNCTION)
1009 C ----+------------------------------------
1010 C +6 ! NUMBER OF ARRAYOF'S (KIND = FUNCTION)
1014 C 5 - PROCEDURE WITH ERRONEOUS PARAMETER LIST
1015 C 6 - FUNCTION " " " "
1017 C 8 - VARIABLE "INPUT"
1018 C 9 - VARIABLE "OUTPUT"
1019 C 10 - VARIABLE "INOUT"
1021 DIMENSION CONVERT(10)
1024 O S, ADRES, K, SCOMA, SDOT, SEMICOL,
1025 1 SCOLON, SLEFT, SRIGHT, SBECOME, STAR, SRELAT,
1026 2 SEOF, SIDENT, SCONST, SAND, SARRAY, SARROF,
1027 3 SATTACH, SBEGIN, SBLOCK, SBOOL, SCALL, SCASE,
1028 4 SCLASS, SCLOSE, SCONS, SCOPY, SCOROUT, SDETACH,
1029 5 SDIM, SDO, SDOWN, SELSE, SEND, SESAC,
1030 6 SEXIT, SEXTERN, SFI, SFOR, SFUNCT, SIF,
1031 7 SINNER, SINPUT, SINT, SKILL, SLOCK, SNEW,
1032 8 SNONE, SNOT, SOD, SOR, SORIF, SOTHER,
1033 9 SOUTPUT, SPREF, SPRCD, SQUA, SREAD, SRESUME,
1034 O SRETURN, STEP, STOP, STAKEN, STHEN, STHIS,
1035 A STO, STYPE, SUNIT, SVAR, SVIRTUAL, SWAIT,
1036 B SWHEN, SWHILE, SWRIT, SWRITLN, STRUE, SALL,
1037 C WAND, WARRAY, WASSIGN, WASSCON, WATTACH, WBLOCK,
1038 D WCALL, WCASE, WCASEL, WCOMA, WCNSTB, WCNSTC,
1039 E WCNSTI, WCNSTN, WCNSTR, WCNST, WCOPY, WDETACH,
1040 F WDOT, WDOWNTO, WEOF, WESAC, WFIN, WFIRST,
1041 G WFOREND, WFORVAR, WFROM, WIDENT, WIFFALS, WIFTRUE
1044 H WINNER, WINSTREND,WJUMP, WKILL, WLABEL, WLEFT,
1045 I WLOCK, WLOW, WLSE, WNEW, WNEWARRAY,WNOT,
1046 J WOPERAT, WOPT, WOR, WOTHER, WPREF, WPRIM,
1047 K WQUA, WREAD, WRELAT, WRESUME, WRETURN, WRIGHT,
1048 L WSTART, WSTEP, WSTOP, WTHIS, WTO, WAIT,
1049 M WRITE, WRITELN, WBOUND, UNICAL,
1051 O LMEM, LPMEM, IRECN, ISFIN, LPMSYS, LPML,
1052 P LPMF, NRINT, NRRE, NRBOOL, NRCHAR, NRCOR,
1053 Q NRPROC, NRTEXT, NRUNIV, NATTR, NRNONE, NBLSYS,
1054 R NBLUS, NEMPTY, INSYS, LOCAL, OWN, OBJECT,
1056 cdsw $ SCANER(3735),
1058 Z TOP, IN, NEXT, STACK(500),
1061 DIMENSION IPMEM(7890)
1062 EQUIVALENCE (IPMEM(1),SCANER(1))
1063 COMMON /BUFF/ INSTR(265),BUFOR(85),LP,LN,MAX,JNK(266)
1064 DATA CONVERT/1,7,5,6,5,6,7,8,10,10/
1069 11 IF (S.EQ.SINPUT) GOTO 100
1070 IF (S.EQ.SIDENT) GOTO 150
1071 IF (S.EQ.STYPE) GOTO 300
1072 IF (S.EQ.SFUNCT) GOTO 400
1073 IF (S.EQ.SPRCD) GOTO 500
1074 C NO KEYWORDS HAVE BEEN FOUND WHICH COULD PROPERLY START THE PARAMETER LIST
1075 C NOW WE SHOULD FIND A PERTINENT DELIMITER-SYMBOL TO CONTINUE ANALYSIS
1076 C THE PROTOTYPE IS ALSO TO BE CHANGED
1078 C LOCAL USAGE OF VARIABLES NRCHAR
1079 C AND NRCOR (CODE OPTIMIZATION)
1082 IPMEM(NRCHAR)=CONVERT(NRCOR)
1083 81 IF (S.LT.25) GOTO 90
1084 IF (S.EQ.SBECOME) GOTO 90
1085 IF (S.EQ.SRIGHT) GOTO (90,550),NBLUS
1086 IF (S.EQ.SEND) GOTO 90
1087 IF (S.EQ.SBEGIN) GOTO 90
1088 IF (S.EQ.SCONS) GOTO 90
1089 IF (S.EQ.SUNIT) GOTO 90
1090 IF (S.EQ.STAKEN) GOTO 90
1091 IF (S.EQ.SCLOSE) GOTO 90
1092 IF (S.EQ.SEOF) GOTO 90
1093 IF (S.EQ.SINPUT) GOTO 100
1094 IF (S.EQ.STYPE) GOTO 300
1095 IF (S.EQ.SFUNCT) GOTO (400,600),NBLUS
1096 IF (S.EQ.SPRCD) GOTO (500,700),NBLUS
1097 IF (S.EQ.SRELAT) GOTO 90
1098 IF (S.EQ.SAND) GOTO 90
1104 C KIND INCLUDES 8 - INPUT
1114 IF (J.GT.132) CALL ERROR(197)
1115 IF (S.EQ.SIDENT) GOTO 225
1117 C ERROR IN SPECIFICATION OF INPUT/OUTPUT-TYPE PARAMETERS
1118 C THE TYPE OF THE VARIABLES IS UNDEFINED
1125 IF (S.EQ.SCOMA) GOTO 220
1126 IF (S.EQ.SCOLON) GOTO 230
1131 IF (S.NE.SARROF) GOTO 250
1135 IF (S.EQ.SCOROUT) NATTR=K
1136 IF (S.EQ.SINT) NATTR=ADRES*8
1137 IF (S.EQ.SIDENT) NATTR=ADRES
1138 IF (NATTR.EQ.0) CALL ERROR(109)
1141 DO 260 J=NRCHAR,NRCOR
1143 IF (LPMF.LT.LPML) CALL ERROR(199)
1146 IPMEM(LPMF+3)=COM(J)
1147 IPMEM(OBJECT)=LPMF+1
1152 IF (NATTR.EQ.0) GOTO 80
1154 IF (S.EQ.SCOMA) GOTO 210
1155 IF (S.EQ.SEMICOL) GOTO (10,541),NBLUS
1156 IF (S.EQ.SRIGHT) GOTO (90,550),NBLUS
1160 IF (S.EQ.SIDENT) GOTO 310
1164 IF (LPMF.LT.LPML) CALL ERROR(199)
1168 IPMEM(OBJECT)=LPMF+1
1171 IF (S.EQ.SEMICOL) GOTO (10,541),NBLUS
1172 IF (S.EQ.SRIGHT) GOTO (90,550),NBLUS
1173 IF (S.EQ.SCOMA) GOTO 320
1177 IF (S.EQ.SIDENT) GOTO 310
1184 IF (S.EQ.SIDENT) GOTO 520
1187 520 LPMF=LPMF+2*KIND-15
1188 IF (LPMF.LT.LPML) CALL ERROR(199)
1192 IPMEM(OBJECT)=LPMF+1
1196 C THE POINTER TO THE CURRENT ELEMENT OF THE PARAMETER LIST IS SAVED
1197 IF (S.EQ.SLEFT) GOTO 540
1198 IF (KIND.EQ.4) GOTO 530
1199 IF (S.EQ.SEMICOL) GOTO 10
1200 IF (S.EQ.SRIGHT) RETURN
1204 IF (S.EQ.SCOLON) GOTO 531
1208 IF (S.NE.SARROF) GOTO 535
1212 IF (S.EQ.SCOROUT) NATTR=K
1213 IF (S.EQ.SINT) NATTR=ADRES*8
1214 IF (S.EQ.SIDENT) NATTR=ADRES
1215 IPMEM(NRPROC+6)=NATTR
1216 IPMEM(NRPROC+7)=NRRE
1217 IF (NATTR.EQ.0) GOTO 537
1222 538 IF (S.EQ.SRIGHT) RETURN
1223 IF (S.EQ.SEMICOL) GOTO 10
1230 IF (S.EQ.SINPUT) GOTO 100
1231 IF (S.EQ.SIDENT) GOTO 150
1232 IF (S.EQ.STYPE) GOTO 300
1233 IF (S.EQ.SFUNCT) GOTO 600
1234 IF (S.EQ.SPRCD) GOTO 700
1235 IF (S.EQ.SRIGHT) GOTO 550
1237 545 IF (IPMEM(NRPROC+1).LT.5) IPMEM(NRPROC+1)=IPMEM(NRPROC+1)+2
1238 C ERRONEOUS PARAMETER LIST. WE SHOULD FIND A SYMBOL WHICH WOULD
1239 C ALLOW FOR A FURTHER (REASONABLE) ANALYSIS OF THE SOURCE TEXT.
1240 C THE SEARCHING IS COMMON FOR BOTH PARAMETER LEVELS.
1245 IF (IPMEM(OBJECT-3).EQ.4) GOTO 530
1246 IF (S.EQ.SEMICOL) GOTO 10
1247 IF (S.EQ.SRIGHT) RETURN
1254 IF (S.EQ.SIDENT) GOTO 720
1258 IF (LPMF.LT.LPML) CALL ERROR(199)
1262 IPMEM(OBJECT)=LPMF+1
1265 IF (S.EQ.SRIGHT) GOTO 550
1266 IF (S.EQ.SEMICOL) GOTO 541
1271 SUBROUTINE ADDVAR(SKAD,ILE)
1272 IMPLICIT INTEGER (A-Z)
1274 C APPENDS THE LIST OF VARIABLES TO THE LIST IN THE PROTOTYPE
1275 C RECOGNIZES TYPES OF VARIABLES
1276 C STACK(TOP+3) - PROTOTYPE ADDRESS
1278 C ILE - LENGTH OF THE LIST OF VARIABLES
1279 C SKAD - BEGINNING OF THE LIST - VARIABLES ARE LOCATED IN CONSECUTIVE
1282 C--------------------------------------------------------------------
1283 C VARIABLE LIST ITEM:
1284 C 0 ! NAME OF THE VARIABLE
1285 C ---+------------------------
1286 C +1 ! DECLARATION LINE NUMBER IN THE SOURCE TEXT
1287 C ---+------------------------
1289 C ---+------------------------
1290 C +3 ! NUMBER OF ARRAYOF'S
1291 C ---+------------------------
1292 C +4 ! NEXT ITEM POINTER
1295 COMMON /BUFF/ INSTR(265),BUFOR(85),LP,LN,MAX,JNK(266)
1298 O S, ADRES, K, SCOMA, SDOT, SEMICOL,
1299 1 SCOLON, SLEFT, SRIGHT, SBECOME, STAR, SRELAT,
1300 2 SEOF, SIDENT, SCONST, SAND, SARRAY, SARROF,
1301 3 SATTACH, SBEGIN, SBLOCK, SBOOL, SCALL, SCASE,
1302 4 SCLASS, SCLOSE, SCONS, SCOPY, SCOROUT, SDETACH,
1303 5 SDIM, SDO, SDOWN, SELSE, SEND, SESAC,
1304 6 SEXIT, SEXTERN, SFI, SFOR, SFUNCT, SIF,
1305 7 SINNER, SINPUT, SINT, SKILL, SLOCK, SNEW,
1306 8 SNONE, SNOT, SOD, SOR, SORIF, SOTHER,
1307 9 SOUTPUT, SPREF, SPRCD, SQUA, SREAD, SRESUME,
1308 O SRETURN, STEP, STOP, STAKEN, STHEN, STHIS,
1309 A STO, STYPE, SUNIT, SVAR, SVIRTUAL, SWAIT,
1310 B SWHEN, SWHILE, SWRIT, SWRITLN, STRUE, SALL,
1311 C WAND, WARRAY, WASSIGN, WASSCON, WATTACH, WBLOCK,
1312 D WCALL, WCASE, WCASEL, WCOMA, WCNSTB, WCNSTC,
1313 E WCNSTI, WCNSTN, WCNSTR, WCNST, WCOPY, WDETACH,
1314 F WDOT, WDOWNTO, WEOF, WESAC, WFIN, WFIRST,
1315 G WFOREND, WFORVAR, WFROM, WIDENT, WIFFALS, WIFTRUE
1318 H WINNER, WINSTREND,WJUMP, WKILL, WLABEL, WLEFT,
1319 I WLOCK, WLOW, WLSE, WNEW, WNEWARRAY,WNOT,
1320 J WOPERAT, WOPT, WOR, WOTHER, WPREF, WPRIM,
1321 K WQUA, WREAD, WRELAT, WRESUME, WRETURN, WRIGHT,
1322 L WSTART, WSTEP, WSTOP, WTHIS, WTO, WAIT,
1323 M WRITE, WRITELN, WBOUND, UNICAL,
1325 O LMEM, LPMEM, IRECN, ISFIN, LPMSYS, LPML,
1326 P LPMF, NRINT, NRRE, NRBOOL, NRCHAR, NRCOR,
1327 Q NRPROC, NRTEXT, NRUNIV, NATTR, NRNONE, NBLSYS,
1328 R NBLUS, NEMPTY, INSYS, LOCAL, OWN, OBJECT,
1330 cdsw $ SCANER(3735),
1332 Z TOP, IN, NEXT, STACK(500),
1335 DIMENSION IPMEM(7890)
1336 EQUIVALENCE (SCANER(1),IPMEM(1))
1337 EQUIVALENCE (SOUTPUT,SEMAPH)
1339 C VARIABLE ARR COUNTS THE NUMBER OF ARRAYOF'S ENCOUNTERED
1341 IF (S.NE.SARROF) GOTO 2
1344 IF (S.EQ.SARROF) GOTO 1
1345 C TYPE OF THE VARIABLE IS RECOGNIZED
1346 2 IF (S.EQ.SINT) GOTO 10
1347 IF (S.EQ.SCOROUT) GOTO 8
1348 IF (S.EQ.SIDENT) GOTO 6
1349 IF (S.EQ.SEMAPH) GOTO 4
1350 C ERROR IN DECLARATION - UNIVERSAL TYPE (0) IS ASSUMED
1354 IF (ARR.EQ.0) GOTO 90
1361 C COROUTINE / PROCESS ARE TREATED AS IDENTIFIERS
1362 C VARIABLE K INCLUDES HASH TABLE ADDRESS
1366 C THE VARIABLE LIST IS COPIED INTO THE CREATED VARIABLE DESCRIPTIONS
1369 IF (LPMF.LT.LPML) CALL ERROR(199)
1370 C ERROR(199) - PARSER TABLE OVERFLOW
1371 IPMEM(LPMF+1)=SKAD(I)
1375 C THE NEW ELEMENT IS APPENDED TO THE VARIABLE LIST
1376 C NRRE - SCRATCH - BEGINNING OF THE LIST (TAKEN FROM THE PROTOTYPE)
1378 IPMEM(LPMF+5)=IPMEM(NRRE)
1386 IMPLICIT INTEGER (A-Z)
1387 COMMON /LISTING/ OUTSTR(265)
1388 COMMON /BUFF/ INSTR(265),BUFOR(85),LP,LN,MAX,POSTR(265),STATUS
1389 COMMON /STREAM/ ERRFLG,LINE,IBUF2(265),BUF(7),ON,BUFOUT(256),
1391 1 IF (BUFOR(1).EQ.2) GOTO 2
1395 cdsw CALL CLOSF(OUTSTR)
1396 cdsw CALL CLOSF(INSTR)
1402 IMPLICIT INTEGER (A-Z)
1403 C SETS UP THE OPTION WORD - C0M(2)
1404 CJF CALLED WHENEVER '(*[' IS ENCOUNTERED
1405 C CALLED WHENEVER '(*$' IS ENCOUNTERED
1406 CJF VARIABLE LP IS ASSUMED TO POINT TO THE FIRST CHARACTER FOLLOWING '['
1407 C VARIABLE LP IS ASSUMED TO POINT TO THE FIRST CHARACTER FOLLOWING '$'
1408 C IT IS ADVANCED BY OPTSET
1410 C MEANING OF THE PARTICULAR BITS IC C0M(2)
1412 C 0 - OPTION MEMBER-CONTROL ( 1 - ON, 0 - OFF ) M
1413 C 1 - OPTION OPTIMIZATION O
1414 C 2 - OPTION INDEX-CONTROL I
1415 C 3 - OPTION TYPE-CONTROL T
1416 C 4 - OPTION TRACE-CONTROL D
1417 C 5 - OPTION CASE-CONTROL (NOT USED IN THE L-COMPILER) C
1418 C 6 - OPTION FAST CASE " F
1420 C 13 - OPTION FOR T.SZCZEPANEK " S
1421 C 14 - OPTION PSEUDO-PARALLEL " P
1422 C 15 - OPTION LISTING L
1424 C NOTE: PARTICULAR BITS IN AUX (0-12) CORRESPOND TO THE CHANGES IN
1425 C C0M(2). THEY ARE SET UP WHEN THE CORRESPONDING OPTIONS ARE SELECTED
1427 C NOTE: THE NUMBERS OF OPTIONS WRITTEN TO THE INTERMEDIATE CODE RESULT
1428 C FROM ADDING 2 TO THE CORRESPONDING BIT NUMBERS.
1430 C WORDS C0M(3) AND C0M(4) ARE USED TO FORCE EXTERNAL SETTING OF OPTIONS.
1431 C EXTERNAL SETTING (VIA RESPONSE TO THE COMPILER PROMPT) TAKES PRECEDENCE.
1432 C OPTION 'P' (14) CAN BE SET ONLY EXTERNALLY.
1438 COMMON /STREAM/ ERRFLG,LINE,IBUF2(265),BUF(7),ON,BUFOUT(256),
1440 COMMON /BUFF/ INSTR(265),BUFOR(85),LP,LN,MAX,JNK(266)
1441 COMMON /BLANK/ C0M(4),BLANK(8995),AUX,BLANK1(4192)
1443 C RECOGNIZE THE OPTION
1444 cdsw ------------ changed to lower-case or upper case letters -----
1447 if(x.ne.ord(ichar('l'))) goto 100
1448 cdsw10 IF (BUFOR(LP).NE.ICHAR('L')) GOTO 100
1449 cdsw -------------------------------------------
1451 IF (BUFOR(LP+1).EQ.ICHAR('-')) GOTO 50
1452 IF (BUFOR(LP+1).EQ.ICHAR('+')) GOTO 30
1454 30 C0M(2)=IBSET(C0M(2),15)
1456 50 C0M(2)=IBCLR(C0M(2),15)
1457 C MASK UP THE OPTIONS WHICH HAVE BEEN DECLARED EXTERNALLY
1458 cdsw&bc 80 C0M(2)=IOR(C0M(3),IAND(C0M(4),C0M(2)))
1461 IF (BUFOR(LP+2).NE.ICHAR(',')) GOTO 9999
1464 cdsw ---------------- changed -------------
1465 100 if(x.ne.ord(ichar('m')))goto 200
1466 cdsw100 IF (BUFOR(LP).NE.ICHAR('M')) GOTO 200
1467 cdsw--------------------------------------------
1468 C 'M' RECOGNIZED - MEMBER-CONTROL
1469 IF (BUFOR(LP+1).EQ.ICHAR('-')) GOTO 150
1470 IF (BUFOR(LP+1).EQ.ICHAR('+')) GOTO 130
1472 130 C0M(2)=IBSET(C0M(2),0)
1474 150 C0M(2)=IBCLR(C0M(2),0)
1475 180 AUX=IBSET(AUX,0)
1476 IF (BUFOR(LP+2).NE.ICHAR(',')) GOTO 9999
1479 cdsw ---------------- changed ---------------
1480 200 if(x.ne.ord(ichar('o'))) go to 300
1481 cdsw200 IF (BUFOR(LP).NE.ICHAR('O')) GOTO 300
1482 cdsw -----------------------------------------
1483 C 'O' RECOGNIZED - OPTIMIZATION
1484 IF (BUFOR(LP+1).EQ.ICHAR('-')) GOTO 250
1485 IF (BUFOR(LP+1).EQ.ICHAR('+')) GOTO 230
1487 230 C0M(2)=IBSET(C0M(2),1)
1489 250 C0M(2)=IBCLR(C0M(2),1)
1490 280 AUX=IBSET(AUX,1)
1491 IF (BUFOR(LP+2).NE.ICHAR(',')) GOTO 9999
1494 cdsw ------------------- changed ---------
1495 300 if(x.ne.ord(ichar('i'))) go to 400
1496 cdsw300 IF (BUFOR(LP).NE.ICHAR('I')) GOTO 400
1497 cdsw ----------------------------------------
1498 C 'I' RECOGNIZED - INDEX-CONTROL
1499 IF (BUFOR(LP+1).EQ.ICHAR('-')) GOTO 350
1500 IF (BUFOR(LP+1).EQ.ICHAR('+')) GOTO 330
1502 330 C0M(2)=IBSET(C0M(2),2)
1504 350 C0M(2)=IBCLR(C0M(2),2)
1505 380 AUX=IBSET(AUX,2)
1506 IF (BUFOR(LP+2).NE.ICHAR(',')) GOTO 9999
1509 cdsw ------------ changed -----------------
1510 400 if(x.ne.ord(ichar('t'))) go to 500
1511 cdsw400 IF (BUFOR(LP).NE.ICHAR('T')) GOTO 500
1512 cdsw -------------------------------------
1513 C 'T' RECOGNIZED - TYPE-CONTROL
1514 IF (BUFOR(LP+1).EQ.ICHAR('-')) GOTO 450
1515 IF (BUFOR(LP+1).EQ.ICHAR('+')) GOTO 430
1517 430 C0M(2)=IBSET(C0M(2),3)
1519 450 C0M(2)=IBCLR(C0M(2),3)
1520 480 AUX=IBSET(AUX,3)
1521 IF (BUFOR(LP+2).NE.ICHAR(',')) GOTO 9999
1524 cdsw ------------- changed ----------------
1525 500 if(x.ne.ord(ichar('d'))) go to 600
1526 cdsw500 IF (BUFOR(LP).NE.ICHAR('D')) GOTO 600
1527 cdsw ---------------------------------------
1528 C 'D' RECOGNIZED - TRACE-CONTROL
1529 C0M(2)=IBCLR(C0M(2),4)
1530 IF (BUFOR(LP+1).EQ.ICHAR('-')) GOTO 550
1531 IF (BUFOR(LP+1).NE.ICHAR('+')) CALL ERROR(135)
1532 530 C0M(2)=IBSET(C0M(2),4)
1533 550 AUX=IBSET(AUX,4)
1534 IF (BUFOR(LP+2).NE.ICHAR(',')) GOTO 9999
1537 cdsw --------------- changed ----------------------
1538 600 if(x.ne.ord(ichar('c'))) go to 700
1539 cdsw600 IF (BUFOR(LP).NE.ICHAR('C')) GOTO 700
1540 cdsw ----------------------------------------------
1541 C 'C' RECOGNIZED - CASE-CONTROL
1542 C0M(2)=IBSET(C0M(2),5)
1543 IF (BUFOR(LP+1).EQ.ICHAR('-')) GOTO 630
1544 IF (BUFOR(LP+1).NE.ICHAR('+')) CALL ERROR(135)
1546 630 C0M(2)=IBCLR(C0M(2),5)
1547 650 AUX=IBSET(AUX,5)
1548 IF (BUFOR(LP+2).NE.ICHAR(',')) GOTO 9999
1551 cdsw --------- changed ------------------------
1552 700 if(x.ne.ord(ichar('f'))) go to 800
1553 cdsw700 IF (BUFOR(LP).NE.ICHAR('F')) GOTO 800
1554 cdsw -----------------------------------------
1555 C 'F' RECOGNIZED - FAST CASE
1556 C0M(2)=IBCLR(C0M(2),6)
1557 IF (BUFOR(LP+1).EQ.ICHAR('+')) GOTO 730
1558 IF (BUFOR(LP+1).NE.ICHAR('-')) CALL ERROR(135)
1560 730 C0M(2)=IBSET(C0M(2),6)
1561 750 AUX=IBSET(AUX,6)
1562 IF (BUFOR(LP+2).NE.ICHAR(',')) GOTO 9999
1566 C NO VALID OPTION HAS BEEN RECOGNIZED
1568 cdsw&bc 9999 C0M(2)=IOR(C0M(3),IAND(C0M(4),C0M(2)))