-
Notifications
You must be signed in to change notification settings - Fork 0
/
algol.alg
6896 lines (6838 loc) · 204 KB
/
algol.alg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
@TRSTS/E Algol compiler V6.7.003 (11-Oct-1980)
% P D P - 1 1 A L G O L C O M P I L E R
%
% B A R R Y J A M E S F O L S O M
%
% 11 / 9 / 7 3
%
%
% R E V I S E D - G R E G O R Y D . H O S L E R
%
% VERSION 6.3 - ARRAY LINKS, TABS, OCTAL OUTPUT
%
% 1 5 - A U G - 7 4
%
%
% VERSION 6.4 - COMMAND STRING DECODER IN COMPILER.
% NEW IMPROVED SYMBOL TABLE.
%
% 2 7 - A U G - 7 4
%
%
% VERSION 6.5 - READ BECOMES OPTIONAL BOOLEAN FUNCTION
% RETURNING EOF INFORMATION.
% STRINGS TO BECOME 2 CHARACTERS/WORD.
% CASE & THRU STATEMENTS IMPLEMENTED.
% DIV & / OPERATORS FULLY IMPLEMENTED.
% ARRAYS TO BE DYNAMICALLY ALLOCATED WITH
% RE-MAPPING ALLOWED WHEN PASSED TO A
% PROCEDURE.
% POINTERS AND TRUTHSETS IMPLEMENTED.
% TOGETHER WITH SCAN AND REPLACE STMTS.
% FIRSTONE, ONES OPERATORS IMPLEMENTED.
% FOR STMT IMPLEMENTED AS SHOULD BE.
% FUNCTION REFS ALLOWED WITHOUT STORE.
% BOOLEAN ARRAYS SCANNED PROPERLY.
% VARIABLE REFS OF LOWER LEVELS ALLOWED.
% SEVERAL FILE ATTRIBUTES IMPLEMENTED.
% DEFINES CHANGED FOR THE BETTER
% DEFINES MAY NOW BE ARBITRARILY LONG.
% ALSO MAY HAVE DEFINES WITH UP TO 10
% PARAMETERS.
% LITERAL STRINGS NOT LIMITED TO 72 CHARS.
% INTEGER CONSTANTS CAN NOW BE QUOTED.
% CONCATENATION ADDED TO ARITHMETIC AND
% BOOLEAN EXPRESSIONS.
% FILE DECLARATIONS CHANGED FOR THE BETTER.
% (SEE FILEDEC).
% CONTEXT SENSITIVE RESERVED WORDS ADDED.
% ALL IN ALL ONE BIG MOTHER CHANGE FOR THE BETTER.
%
% 0 5 - S E P - 7 4
%
%
% VERSION: 6.6 - GENERAL CLEANUP
%
% REVISED: 2-SEP-77 BY: T. GRIEB
% MAKE IT WORK UNDER V6B
% CLEAN UP RTS
% CLEAN UP ALL ELSE
% MAKE IT SOME SORT OF STANDARD
%
%
% VERSION: 6.7 - IMPROVED REASONABLENESS
%
% REVISED: 31-JUL-80 BY: PAUL KONING
% MAKE IT RESEMBLE THE REST OF THE WORLD MORE
% (AT THE EXPENSE OF BURROUGHS ALGOL COMPATIBILITY)
% ADD CROSS-REFERENCE, IMPROVE LISTING FORMAT
BEGIN
DEFINE REVNO="67"#,
UPDATE="003"#;
@OMIT
C O M P I L E R U P D A T E S
6.5.001 ALGOL BASE COMPILER.
6.5.002 OMITTED LISTING FIXED.
6.5.003 INCLUDE AND CHAIN CONTROL CARDS FIXED.
6.5.004 PATCH TO LIST ERROR MESSAGES ON KB IF NO LIST FILE.
6.5.005 PATCH INVALID INDEX IN GETATTRIBUTE.
6.5.006 PATCH TO AVOID STRING TO INTEGER CONVERT ERROR
IN GETNEXT FOR INTEGER CONSTANTS.
PATCH TO PRINT OUT DOUBLE CHARACTER TOKENS IN ERROR.
6.5.007 OPTION SCANNER ADDED TO COMMAND STRING INTERPRETER.
6.5.008 PATCH TO GUARD AGAINST UPLEVEL ATTACHES TO POINTER
PARAMETERS BY VALUE.
PATCH TO FIX INVALID INDEX IN CASESTMT.
6.5.009 PATCH (AGAIN) TO FIX INVALID INDEX IN GETATTRIBUTE.
6.5.010 CHANGE DEFAULT ARRAY PARAMETERS TO INTEGER.
MAKE COMMAND STRING INTERPRETER BETTER AND SMALLER.
6.5.011 PATCH COMPOUNDTAIL SO THAT GO TO EOJ IF FINAL END
NOT FOLLOWED BY A PERIOD.
6.5.012 OPTIMIZE PURGEIT A LITTLE, TAKE 'CLOSE' OUT OF CLASS 3
RESERVED WORD LIST.
6.5.013 MNEMONIC FILE ATTRIBUTES IMPLEMENTED PROPERLY.
6.5.014 MAKE FORMS FROM INPUT FILE PRINT IN NICE PLACES IN
THE OUTPUT FILE.
6.5.015 MAKE THE SCANNER FASTER.
6.5.016 COMPOUND TAIL - FORCE EOF IF NOT ENOUGH ENDS.
(EVEN WITH A '.')
6.5.017 DEFAULT FILE TITLE TO BE THE INTERNAL FILE NAME.
6.5.018 BUILD DECLARATIONS OF NESTED BLOCKS NOT IN PROCEDURES
IN THE STACK.
6.5.019 SWITCHES OUT OF PRIMARY AND STMT.
ALLOW PARTIAL WORDS OF BUILD-IN FUNCTIONS.
6.5.020 A FEW CHANGES FOR RUNNING UNDER RSTS.
6.5.021 MORE CHANGES FOR RSTS.
6.5.022 CHANGE GETSPACE TO OUTPUT ADDITIONAL INFO.
6.5.023 CHANGE FILLSTMT AND PRODEC SEGMENT INFO OUTPUT.
6.7.001 Change word count to byte count in I/O statements
6.7.002 Add cross reference
6.7.003 Change code file recordsize to 512
A L G O L E R R O R M E S S A G E S
1 Declaration not followed by semicolon.
2 Identifier declared twice in same block.
3 Specification part identifier not in formal parameter part.
4 Nonidentifier in identifier list of declaration.
5 Procedure identifier not followed by '(' or ';'.
6 Formal parameter list not followed by ')'.
7 Formal parameter list not followed by ';'.
8 Value part contains identifier not in formal parameter list.
9 Value part not ended by ';'.
10 Missing or illegal specification part.
11 Illegal use of 'OWN'.
12 Illegal use of 'SAVE'.
13 Same external variables do not agree in type.
14 Illegal use of 'OWN','SAVE' or 'EXTERNAL'.
15 Array identifier not followed by '['.
16 Lower bound in array declaration not followed by ']'.
17 Bound pair in array declaration not followed by ']'.
18 Illegal lower bound designator in array specification.
19 Declarator illegally preceded by 'OWN','SAVE' or 'EXTERNAL'.
20 Not proper value for this file attribute.
21 Illegal re-use of initialization attribute.
22 Missing ')' in file declaration.
23 Number of nested blocks > 31.
24 Must be Boolean or integer identifier.
25 Number of parameters inconsistent with forward declaration.
26 Parameter type does not agree with forward declaration.
27 Value part inconsistent with forward declaration.
28 Undeclared identifier.
29 'BEGIN' expected in CASE statement.
30 Primary may not begin with this type quantity.
31 Missing '('.
32 Missing ')'.
33 Primary may not start with declarators.
34 Not Boolean exression.
35 No expression may begin with this type quantity.
36 Missing ':'.
37 Missing ','.
38 Missing or illegal constant.
39 Missing 'THEN'.
40 Missing '['.
41 Missing ']'.
42 Missing ';' or 'END'.
43 Missing 'END'.
44 Actual and formal parameters not same type.
45 Actual and formal arrays differ in number of dimensions.
46 Actual and formal parameters do not agree in number.
47 Missing 'UNTIL'.
48 Missing 'DO'.
49 Missing ':' after label.
50 Label not declared in this block.
51 Label has already occurred.
52 Equivalence operator expected.
53 Final 'END' not followed by period.
54 Function reference cannot occur on the left of an assignment.
55 Statement may not start with this type quanity.
56 Statement may not start with a declarator.
57 More than 1024 program reference cells required.
58 More than 2048 stack cells required for this procedure.
59 Improper index variable in 'FOR' statement.
60 Missing ':=' following index variable.
61 Missing 'UNTIL' or 'WHILE' in 'STEP' element.
62 Missing 'DO' in 'FOR' clause.
63 Missing 'ELSE'.
64 Declared label did not occur.
65 Declared forward procedure did not occur.
66 Segment too large (>2047 words).
67 Missing ':='.
68 Missing label.
69 Identifier following 'FILL' operator not array identifier.
70 Missing 'WITH' in 'FILL' statement.
71 Improper row designator.
72 Missing '(' in I/O statement.
73 Missing file identifier in I/O statement.
74 Missing ']' in file index part.
75 Missing '[' in array row designator.
76 Missing '*' in array row designator.
77 Missing ']' in array row designator.
78 Illegal character - ignored.
79 Constant table overflow - insert dummy 'GO TO' statement.
80 Too many characters in string.
81 Missing string identifier.
82 Recursive defines nested more than 7 deep.
83 Formal parameter not in specification part - defaulted to integer.
84 Missing or illegal based variable.
85 Missing 'BASED' in field declaration.
86 Missing or illegal reference in 'SAVE' funstion.
87 Missing or illegal reference in 'ADDR' function.
88 Missing or illegal reference in 'RELEASE' function.
89 Missing or illegal arrays in 'SWAP' statement.
90 Missing or illegal string in 'CHAIN' statement.
91 Symbol table overflow - that's it.
92 Too many parameters in procedure declaration.
93 Too many errors - compilation terminated.
94 No external procedures in separately compiled procedures.
95 Too many cases in case body.
96 Not proper file attribute.
97 Missing 'OF' in case expression or case statement.
98 Illegal use of 'LONG'.
99 Identifier expected.
100 Number of parameters define not same as in define declaration.
101 Define table overflow - compilation terminated.
102 Not pointer expression.
103 'BY' expected in REPLACE statement.
104 'DIGIT' or 'DIGITS' expected in arithmetic conversion.
105 'IN' or relational operator expected.
106 Truthset identifier expected.
107 'WHILE' or 'UNTIL' expected.
108 Pointer identifier expected.
109 Array not dimensioned same as in forward declaration.
110 Array not typed same as in forward declaration.
111 This construct is not implemented yet.
112 Label or switch not declared in same block or same procedure.
113 Not membership primary.
114 Relational operator expected.
115 'FOR' expected.
116 Must be arithmetic identifier or '(arithmetic expression)'
117 Must be pointer or string.
118 String expected.
119 '.TITLE' expected.
120 Cannot include from incude file. Include ignored.
121 Unexpected end of input. Compilation terminated.
122 Not enough contiguous diskspace. Compilation terminated.
123 Illegal file mnemonic.
@OMIT
DEFINE STACKSIZE=10239#, % SYMTAB CAN'T BE > 32768
MAXDEFINELEVEL=10#; % MAX LEVEL OF DEFINES TO BE EXPANDED IS
% ARBITRARY BUT FINITE (<=2**15-1)
INTEGER
ADDRESS, % ADDRESS OF DECLARED IDENTIFIER
% SET BY GETNEXT
ADDRESSF, % ADDRESS OF VARIABLE THAT IS BEING ENTERED
% INTO THE SYMBOL TABLE BY ENTRY
ADRS, % USED TO KEEP TRACK OF EACH BLOCKS PRT CELL
AMTLEFT, % AMOUNT OF DEFINE LEFT TO EXPAND
BEGINCTR, % KEEPS TRACK OF BEGIN END PAIRS
C, % COUNT OF THE NUMBER OF ENTRIES INTO THE
% A ARRAY WHICH CONTAINS THE SCANNED SYMBOL
% IN SYMBOL TABLE FORMAT
CLASS, % THIS VARIABLE CONTAINS THE CLASS NUMBER OF
% THE INFORMATION CURRENTLY UNDER SCRUTINY.
CLASSF, % CLASS TYPE OF VARIABLE THAT IS BEING ENTERED
% INTO THE SYMBOL TABLE BY ENTRY
CLEAN, % A POINTER INTO THE ARRAY CONST WHICH HOLDS
% CONSTANTS AND STRING CONSTANTS
DA, % KEEPS TRACK OF FAR INTO THE CODE FILE WE
% HAVE WRITTEN
DEFINDEX, % POINTER INTO ELBAT (DEFINE TABLE) OR SYMTABLE
% DEPENDING WHERE DEFINE IS AT,
DEFLEVEL, % LEVEL OF NESTED DEFINES THAT WE ARE
% CURRENTLY AT
EI, % KEEPS TRACK OF HOW MUCH HAS ACTUALLY
% BEEN PLACED IN THE EXTERNAL SYMBOL TABLE
ELBATI, % POINTER INTO THE DEFINE EXPANSION TABLE
ERRORCOUNT, % KEEPS TRACK OF THE NUMBER OF ERRORS
% ENCOUNTERED IN THE PROGRAM
I, % POINTER TO LAST WORD USED IN THE ARRAY
% STACK - CARE SHOULD BE USED BECAUSE I
% IS USED AS LOCAL IN SOME PROCEDURES
INF, % INF POINTS TO THE INFORMATION JUST
% ENTERED BY ENTRY INTO STACK
INFO, % A POINTER INTO STACK OF ANY ADDITIONAL
% INFORMATION CONCERNING THIS VARIABLE.
INREAL, % CONTAINS THE VALUE OF THE INTEGER CONSTANT
% JUST CONVERTED BY CONVERT.
INSYM, % POINTER TO LAST SYMBOL SCANNED BY GETNEXT
% THIS POINTS AT THE CHARACTERS OF THE SYMBOL
% NOT THE INFO WORDS
J, % TEMP VARIABLE - CAN BE USED BY ANYONE
% BE CAREFUL
L, % A POINTER INTO THE EDOC OR CODE ARRAY TO
% KEEP TRACK OF CODE EMITTED.
LASTCOL, % COL # OF LAST IDENTIFIER SCANNED
LENGTH, % LENGTH OF QUOTED STRING JUST PARSED BY QUOTE
LEVEL, % LEVEL KEEPS TRACK OF WHAT LEVEL WE ARE
% CURRENTLY COMPILING CODE FOR
LINECOUNT, % COUNTS THE NUMBER OF LINES SCANNED
LINSTR, % CONTAINS THE NUMBER OF CHARACTERS MOVED INTO
% THE STRING INSTR BY THE SCAN PROCEDURE.
LNCT, % KEEPS TRACK OF THE NUMBER OF LINES WRITTEN
% ON THE OUTPUT FILE SO WE CAN PAGE IT
MAXDATA, % KEEPS COUNT OF HOW MUCH ARRAY (OVERLAYABLE)
% HAS BEEN DECLARED THIS IS
% THE MAXIMUM OF ALL DECLARATIONS
% IT IS USED TO FIGURE CORE REQUIREMENTS
MAXI, % THE MAXIMUM INDEX INTO THE SYMBOL TABLE
% DURING THE COMPILATION
% SO WE CAN FOUND HOW HOW MUCH SYMBOL TABLE WAS
% ACTUALLY NEEDED FOR THE COMPILATION
MAXSEG, % USED TO OBTAIN THE MAX SEGMENT EMITTED
% THIS IS USED TO FIQURE CORE REQUIREMENT
PGCT, % HOLDS THE PAGE COUNT FOR PAGE HEADINGS
PINF, % POINTER TO LAST DECLARED PROCEDURE INFO
% USED TO COMMUNICATE BETWEEN BLOCK AND
% PRODEC
PLL, % PROGRAM LOW LINK - POINTS TO THE FIRST WORD OF
% THE PROGRAM DESCRIPTOR OF THE FIRST PROGRAM
% SEGMENT TO GET COMPILED. THE SECOND WORD OF
% THAT DESCRIPTOR THEN POINTS TO THE NEXT
% PROGRAM DESCRIPTOR IN A LINKED FASHION.
PROADDRESS, % THE ADDRESS OF THE PROCEDURE CURENNTLY BEGIN
% COMPILED
PRTMAX, % CONTAINS THE NUMBER OF PRT CELLS THAT WERE
% ASSIGNED BY THE COMPILER
SAVEIT, % THIS CONTAINS THE AMOUNT OF SAVE STORAGE
% THAT THE COMPILED PROGRAM NEEDS. THIS IS
% USED IN FIQURING CORE REQUIREMENT.
SRCLINE, % CURRENT SOURCE LINE NUMBER WITHIN PAGE
SGNO, % THE NUMBER OF THE SEGMENT WE ARE CURRENTLY
% COMPILING
SGAVL, % THE NEXT AVAILABEL SEGMENT NUMBER THAT
% CAN BE USED
SKAN, % CONTAINS TYPE OF TOKEN JUST SCANNED BY SCANNER
STACKCTR, % CONTAINS THE CURRENT STACK ASSIGNMENT CELL
% NUMBER
TIME1, % TIME IN MINUTES (CLOCK TIME) AT THE
% START OF COMPILATION
TOTSEG, % TOTAL AMOUNT OF OBJECT CODE PRODUCED
% BY THE COMPILER
VM, % CALULATES THE TOTAL MEMORY
% REQUIREMENT FOR A PROGRAM IF IT WOULD
% FIT INTO CORE AS A WHOLE
WCL, % PC OF WORKING CELL ALLOCATOR
WORKCELLCOUNT; % CONTAINS THE # OF WORK CELLS NEEDED IN A
% PARTICULAR BLOCK
BOOLEAN
ACTIONTOG, % SET TO TRUE BY WRITESTMT WHEN PASSING AN
% ACTION LABEL TO GOSTMT
ASTRISK, % SET TO TRUE FOR ':=*' TO SCAN THE '*'
% IN PRIMARY AND BOOPRIM
BOOLREADTOG, % WHEN TRUE INDICATES READ TO RETURN A BOOLEAN
% RESULT
DEBUGTOG, % IF SET TO TRUE PRODUCES A DEBUGGING LISTING
% ON THE OUTPUT TO HELP IN DEBUGGING
EIGHTYCOL, % SET TO TRUE IF ONLY EIGHTY COLUMN LISTING
% IS DESIRED. I.E. COLS 81 AND GREATER ARE
% TRUNCATED. (TABS COUNT AS SHOULD)
EPROC, % TRUE IF EXTERNAL PROCEDURES NEEDED
EOPTION, % IF SET TO TRUE MEANS THAT ONLY ERRORS ARE
% PRINTED ON THE OUTPUT
ERRORTOG, % USED BY THE ERROR ROUTINES TO SUPPRESS
% EXTRA ERROR MESSAGES. SET TO TRUE TO ALLOW
% ERROR MESSAGES.
EXPANDIT, % WHEN SET TO TRUE WE ARE ABOUT TO EXPAND A
% DEFINE
EXTENSION, % USED TO SIGNAL IF A FILE NAME HAS AN EXTENSION
EXTERNALTOG, % WHEN SET TO TRUE WE ARE SCANNING AN EXTERNAL
% DECLARATION WHICH IS HANDLED ALMOST
% IDENTICALLY TO A REGULAR DECLARATION
% EXTERNALS ARE HANDLED SUCH THAT THE SAME
% EXTRNAL DECLARATION IN TWO DISJOINT PROCEDURS
% ARE THE SAME - WE DO THIS BY MOVING ALL
% EXTERNAL DECLARATIONS OUT TO LEVEL 1 AND ENTRY
% TABKES CARE TO SEE THAT A LOCAL EXTERNAL
% VARIABLE IS THE SAME AS OTHER EXTERNALS WITH
% SAME NAME - THIS CHECK ALSO PREVENTS FROM
% ENTERING THE SAME SYMBOL ONTO THE SYMBOL
% TWICE
FORMOPTION, % PASS FORM FEEDS TO OUTPUT FILE
FUNCTION, % INDICATES WE ARE PARSING FUNCTION AS OPPOSED
% TO A MAIN PROGRAM
INCLUDETOG, % IF TRUE READ FROM INCLUDE FILE
INSYMTABLE, % IF SET TO TRUE THEN CURRENT DEFINE IS IN THE
% SYMBOLTABLE (STACK) ELSE IN THE DEFINETABLE
% (ELBAT)
LASTWASAGOGO, % SET TO TRUE IF LAST STMT SCANNED WAS A GOTO
LONGTOG, % WHEN SET TO TRUE WE ARE SCANNING A LONG
% DECLARATION. ONLY ONE DIMENSIONAL ARRAYS
% MAY BE DECLARED LONG. IF LONG THEN THEY ARE
% NOT SEGMENTED OTHERWISE THEY ARE SEGMENTED
% IN GROUPS OF 256 WORDS
LOCAL, % IF TRUE MEANS WERE ARE COMPILING DECLARATIONS
% THAT ARE LOCAL TO A PROCEDURE
NEWCARD, % IF TRUE WE HAVE A NEW CARD IMAGE IN 'CARD'
NOHEADING, % IF TRUE MEANS THAT THE HEADING HAS NOT BEEN
% WRITTEN YET
NOLISTFILE, % INDICATES THAT THERE IS NO LIST FILE IF
% SET TO TRUE
NOCODEFILE, % INDICATES THAT THERE IS NO CODE FILE TO BE
% GENERATED IF SET TO TRUE
OMITTOG, % TRUE TO INHIBIT SOURCE FROM BEING COMPILED
OWNTOG, % WHEN SET TO TRUE WE ARE SCANNING AN OWN
% DECLARATION
PARAMTOG, % IF SET TO TRUE. WE ARE SCANNING PARAMETERS
% IN ACTUALPARAPART
PRTTOG, % WHEN SET TO TRUE GIVES ALL PRT, SAT AND AIT
% ENTRIES THAT ARE MADE
PTRPRIM, % SET IN VARIABLE PRIOR TO CALL TO PEXP.
% WHEN SET TO TRUE INDICATES THAT WE HAVE JUST
% SCANNED A POINTER PRIMARY. FALSE INDICATES
% THAT WE JUST SCANNED A POINTER EXPRESSION.
QUOTING, % SET TO TRUE IF SCANNING A QUOTED STRING
RESERVED, % TRUE IF ID SCANNED IS A RESERVED WORD
% FALSE OTHERWISE
SAVETOG, % WHEN SET TO TRUE WE ARE SCANNING A SAVE
% DECLARATION. ARRAYS, STRING, AND PROCEDURES
% CAN BE DECLARED SAVED,
% THUS SPEEDING UP RUNNING
% OF SOME PROGRAMS. ONLY ONE-DIMENSONAL ARRAYS
% MAY BE SAVED, AND SAVED PROCEDURES ARE
% LOCKED INTO CORE BY CODE EMITTED IN
% THE OUTER BLOCK
STOPDEFINE, % WHEN SET TO TRUE STOPS THE EXPANSION OF
% DEFINES
STARTDEFINE, % WHEN SET TO TRUE INDICATES THAT WE ARE ABOUT
% TO START EXPANDING A DEFINE
SWITCHDECTOG, % SET TO TRUE WHEN IN SWITCHDEC, FALSE OTHERWISE
TOBEWRITTEN, % SET TO TRUE WHEN WE ARE TO WRITE OUT THE NEXT
% CARD
WRITEAFORM, % USED TO PRINT FORMS FROM INPUT IN NICE PLACES
% ON OUTPUT.
XREFOPT; % TRUE IF CROSS REFERENCE OPTION (/C) SELECTED
INTEGER ARRAY
A[0:15], % HOLDS THE LAST SCANNED IDENTIFIER IN SYMBOL
% TABLE FORMAT - THIS IS USED TO SPEED UP
% SYMBOL TABLE SEARCHES
ADRSR[0:63], % HOLDS THE RETURN ADDRESS FOR BLOCK EXITS
% SUCH THAT A NON-LOCAL BRANCH FROM BLOCK
% TO ANOTHER WILL WORK
ATTRIBUTEDHASH[0:110], % THIS HASH TABLE HOLDS THE CLASS 3,F
% RESERVED WORDS OF ALGOL
CARD[0:36], % THIS IS THE STRING USED BY THE SCANNER.
% THE INPUT MECHANISM UNPACKS AND PUTS ONE
% LINE AT A TIME IN THIS STRING
CARDEF[0:MAXDEFINELEVEL,0:51], % HOLDS CARD IMAGES
% & PERTINATE INFO AS WE SCAN DEFINES
CONST[0:2047], % THIS ARRAY HOLDS ALL CONSTANTS EXCEPT THOSE A
% LITERAL CALL CAN HANDLE. THE FIRST WORD
% ENTRY IS THE LOCATION OF THE CALL, THE SECOND
% WORD IS THE NUMBER OF CONSTANTS ENTERED,
% FOLLOWED BY THE CONSTANTS.
CSI[0:39], % USED BY COMPILER FOR THE COMMAND STRING
CTIME[0:5], % TIME VALUES AT START OF COMPILE
DATE[0:5], % HOLDS TODAYS DATE IN DD-MMM-YYYY FORM
EDOC[0:2047], % CODE IS EMITTED INTO THIS ARRAY BY THE
% EMIT ROUTINES
ELBAT[0:STACKSIZE],% HOLDS PARAMETERS OF DEFINES DURING
% EXPANSION
ESTACK[0:1000], % THE EXTERNAL SYMBOL TABLE - NOTE THAT
% THIS WON'T GET ALLOCATED UNTIL IT IS USED
HEADING[0:6], % HOLDS THE COMPILERS HEADING
INSTR[0:31], % EVERY ITEM SCANNED, I.E. SPECIAL CHARACTER,
% NUMBER,OR IDENTIFIER IS PLACED IN THIS STRING
% LEFT-JUSTIFIED WITH THE VALUE OF LINSTR SET
% TO THE NUMBER OF ITEMS MOVED INTO INSTR.
LEVELS[0:31], % PRT ADDRESS OF EACH LEVEL AS USED FOR
% NESTED LEVELS AND MARK-STACK CONTROL WORDS
LINEOUT[0:67], % OUTPUT STRING FOR THE LINE PRINTER (132 CHARS)
OP[0:131], % THIS STRING IS FILLED WITH THE MNEMONIC OP
% CODES DURING DEBUGGING
PERMDEC[0:7], % USED IN EVALUATING MEMBERSHIP EXPRESSIONS
% BY MEMBERSHIPEXP,MEMBERSHIPPRIMARY,
% AND TRUTHSETDEC
PRTA[0:1023]; % THIS ARRAY IS FILLED WITH ALL DESCRIPTORS
% POINTING TO ARRAYS AND PROGRAM SEGMENTS
% SPACE IS ALSO RESERVED FOR GLOBAL VARIABLES
SAVE INTEGER ARRAY
SAUSAGE[0:63], % THIS ARRAY IS THE HASH TABLE FOR THE
% RESERVED WORDS TO HELP SPEED UP THE
% SYMBOL TABLE LOOKUP SCHEME
SCRAMBLEDEGGS[0:63],% THIS ARRAY IS THE HASH TABLE TO POINT INTO
% THE STACK ARRAY.
SPECIAL[0:36]; % THIS ARRAY IS USED TO HOLD THE CLASS
% NUMBER OF ALL THE SPECIAL CHARATERS
INTEGER ARRAY
SEGNO[0:31], % CONTAINS CURRENT SEGMENT NUMBER FOR EACH LEVEL
SPACEOUT[0:32], % USED BY GETSPACE FOR OUTPUTTING PRT INFO
STACK[0:STACKSIZE],% THIS ARRAY CONTAINS LINK LISTS WHICH MAKE
% UP THE COMPILIER'S SYMBOL TABLE USING HASHING.
STR[0:39], % USED BY ERROR TO CONTAIN ERROR MESSAGE
% READ IN FROM DISK TO PRINTED ON
% OUTPUT LISTING.
TTIME[0:5], % TIME IN FORMAT HH:MM:SS ?M
TITLE2[0:31], % SUBTITLE FIELD (CURRENT PROCEDURE NAME)
TITLE1[0:39], % TITLE FIELD FROM PAGE HEADER
XREFTYPES[0:2]; % TYPES SELECTED FOR CROSS-REFERENCE
LABEL EOJ;
DEFINE
CONSTANTCLEAN=IF CLEAN NEQ 0 THEN CLEANIT#,
SEGSIZE=3"17777"#,
LOCALSPACE=3"30004"#,
BUMPL=L:=L+2#,
JUNK=6#,
FP =0#,
FS =1#,
O3(X) = X FOR 3 OCTAL DIGITS#,
O4(X) = X FOR 4 OCTAL DIGITS#,
O6(X) = X FOR 6 OCTAL DIGITS#,
SWAB(X) = (SHR(X,8)+SHL(X,8))#,
ZS(X,Y) = X FOR Y ZEROSUPPRESSED DIGITS#,
CODERECSIZE = 512#, % CODE RECSIZE IN BYTES
CODERECWORDS = 256#, % CODE RECSIZE IN WORDS
CODERECWORDS1 = 255#; % SAME, MINUS ONE
%
% THESE DEFINES ARE THE MNEMONICS FOR THE INTERPRETER OPERATORS.
%
DEFINE
ADD =0#, % ADD
AOC =1#, % ARRAY OPERAND CALL
ASD =2#, % ARRAY STORE DESTRUCTIVE
ASN =3#, % ARRAY STORE NON-DESTRUCTIVE
BRUN=4#, % BRANCH UNCONDITIONAL
BRTR=5#, % BRANCH TRUE
BRFL=6#, % BRANCH FALSE
ENTR=7#, % ENTER
CHS =8#, % CHANGE SIGN
COM =9#, % COMMUNICATE
DEL =10#, % DELETE TOP OF STACK
DIVR=11#, % DIVIDE
DUP =12#, % DUPLICATE
NE =13#, % B NOT EQL TO A
EQ =14#, % B EQUAL TO A
GE =15#, % B GREATER THAN OR EQUAL TO A
LS =16#, % B LESS THAN A
GT =17#, % B GREATER THEN A
LE =18#, % B LESS THAN OR EQUAL TO A
LOD =19#, % LOAD
LOR =20#, % LOGICAL OR
LND =21#, % LOGICAL AND
MKS =22#, % MARK THE STACK
REP =23#, % MOVE
MUL =24#, % MULTIPLY
LNG =25#, % LOGICAL NEGATE
REL =26#, % RELEASE
RTN =27#, % RETURN FROM SUBROUTINE
SAV =28#, % SAVE
SBR =29#, % SUBROUTINE CALL
SHLL=30#, % SHIFT LEFT
SHRR=31#, % SHIFT RIGHT
STD =32#, % STORE DESTRUCTIVE
STN =33#, % STORE NON-DESTRUCTIVE
SUB =34#, % SUBTRACT
XCH =35#, % EXCHANGE A AND B
SCN =36#, % MOVE CHARACTER
MD =37#, % MOD A AND B
ADC =38#, % ARRAY DESCRIPTOR CALL
FDI =39#, % FIELD ISOLATE
BPS =40#, % BUMP STACK POINTER
SWP =41#, % SWAP TWO ARRAYS
EXP =42#, % EXPONENT-INTEGERS ONLY
FID =43#, % FIELD ISOLATE DYNAMIC
RSDN=44#, % ROTATE STACK DOWN (IE TOS DOWN TO 4(SP))
RSUP=45#, % ROTATE STACK UP (IE 4(SP) UP TO TOS)
INOP=46#, % IN OPERATOR TESTS FOR IN-NESS OF TRUTHSET
OCX =47#, % OCCURS INDEX (FOR CASE INDEXING)
LODB=48#, % LOAD BYTE OPERATOR TO BE IMPLEMENTED
% WITH POINTERS
DIVT=49#, % DIVIDE TRUNCATED TO INTEGER
FISO=50#, % FIELD INSERT
FISD=51#, % FIELD INSERT DYNAMIC
FIND=52#, % FIND ADDRESS NOT ON SAME LEVEL OR IN PRT
ONESS=53#, % ONES OPERATOR, RETURNS THE # OF BITS THAT
% ARE ON
FONES=54#, % RETURNS THE LEFT MOST BIT # OF BIT THAT IS ON
B1D =55#, % BUILD 1 DIMENSIONAL ARRAY DESCRIPTOR
B2D =56#, % BUILD 2 DIMENSIONAL ARRAY DESCRIPTOR
DPL =57#, % DUPLICATE ARRAY ON TOS & LOAD
BLD =58#, % BUILD ARRAY DESCRIPTOR
PLOD=59#, % POINTER LOAD VALUE
PART=60#, % OBTAIN PARTIAL WORD PART
PSTN=61#, % POINTER STORE NON-DESTRUCT
PSTD=62#, % POINTER STORE DESTRUCT
CMP= 63#, % POINTER COMPARE
PLNK=64#; % POINTER LINK
%
% THESE DEFINES ARE THE SCANNER'S TOKEN CLASSES.
%
DEFINE
% UNKNOWNID = 0#,
PROCID = 1#,
BOOPROCID = 2#,
% REALPROCID = 3#,
INTPROCID = 4#,
BOOID = 5#,
REALID = 6#,
INTID = 7#,
ARRAYID = 8#,
% 9
STRINGID =10#,
ICONSTANT =11#,
% RCONSTANT =12#,
QUOTEOP =13#,
ATSIGN =14#,
TRUTH =15#,
FALSEV =16#,
LFTPAREN =17#,
ENDV =18#,
SEMICOLON =19#,
ELSEV =20#,
UNTILV =21#,
BEGINV =22#,
BOOLEANV =23#,
REALV =24#,
INTEGERV =25#,
OWNV =26#,
LONGV =26#,
SAVEV =26#,
EXTERNALV =26#,
LABELV =27#,
SWITCHV =28#,
ARRAYV =29#,
DEFINEV =30#,
FILEV =31#,
PROCEDUREV =32#,
POINTERV =33#,
TRUTHSETV =34#,
READV =35#,
WRITEV =36#,
FORV =37#,
WHILEV =38#,
DOV =39#,
IFV =40#,
GOV =41#,
FILLV =42#,
CASEV =43#,
REPLACEV =44#,
SCANV =45#,
THRUV =46#,
LABELID =47#,
% 48
INV =49#,
OUTV =50#,
IOV =51#,
MODV =52#,
DIVV =53#,
% 54
STEPV =55#,
TOV =56#,
THENV =57#,
ANDV =58#,
ORV =59#,
NOTV =60#,
FACTOP =61#,
NEQOP =62#,
EQLOP =63#,
GEQOP =64#,
LSSOP =65#,
GTROP =66#,
LEQOP =67#,
LFTBRKT =68#,
RTBRKT =69#,
COMMA =70#,
COLON =71#,
ADDOP =72#,
SUBOP =73#,
MULOP =74#,
DIVOP =75#,
AMPER =76#,
POUND =77#,
% 78
MAXSIZEV =79#,
DEFINEID =80#,
FORWARDV =81#,
WITHV =82#,
DOTOP =83#,
ASSIGNOP =84#,
RTPAREN =85#,
VALUEV =86#,
COMMENTV =87#,
SWITCHID =88#,
FILEID =89#,
FIELDV =90#,
FIELDID =91#,
BOOFIELDID =92#,
EXPOP =93#,
ATPOUNDV =95#,
FORMATV =96#, % SHOULD BE MOVED UP TO AFTER TRUTHSETV
LISTV =97#, % AFTER IMPLEMENTATION. DECLARATION AND
% STMT SHOULD BE CHANGED APPROPRIATELY.
OFV =98#,
TRUTHID =99#,
BINV =100#,
DISKV =101#,
TTYV =102#,
TEMPV =103#,
LPV =104#,
KINDV =105#,
TITLEV =106#,
OPENV =107#,
PRESENTV =108#,
PURGEV =109#,
MYUSEV =110#,
SIZEV =111#,
MAXRECV =112#,
CURRECV =113#,
%
% THESE THAT FOLLOW ARE THE REDEFINEABLE RESERVED WORDS
%
POLISHV =114#,
SIGNV =115#,
ONESV =116#,
TIMEV =117#,
DELTAV =118#,
SHLV =119#,
SHRV =120#,
SHIFTV =121#,
ABSV =122#,
MAXV =123#,
MINV =124#,
ADDRV =125#,
FONEV =126#,
COMPILTIMEV =127#,
LOCKV =128#,
RELEASEV =129#,
SWAPV =130#,
CHAINV =131#,
CLOSEV =132#,
BYV =133#,
BINARYV =134#,
OCTALV =135#,
HEXV =136#,
DECIMALV =137#,
WORDV =138#,
WORDSV =139#,
DIGITV =140#,
DIGITSV =141#,
% 142
% 143
ZEROSUPV =144#,
REDEFINABLE =114#,
CLASSMAX =145#;
POINTER P, % USED TO POINT INTO THE CARD ARRAY
Q, % TEMPORARY POINTER. POINTS INTO CSI.
PS:=POINTER(SPACEOUT); % USED TO PASS SYMBOL NAMES
% TO GETSPACE FOR PRINTING PRT INFO
%
%
TRUTHSET
OPS(FACTOP OR DIVOP OR MULOP OR DIVV OR MODV), % FOR TERM
SPACES(" " OR " "), % TABS OR SPACES TO BE IGNORED
TERMINATORS("%" OR 0); % NULLS OR "%" TERMINATE A CARD
%
% *********** F I L E D E C L A R A T I O N S ***********
%
FILE CARDIN(KIND=DISK,MAXRECSIZE=80),
CODE(KIND=BINARY,MAXRECSIZE=CODERECSIZE),
CREF(KIND=BINARY,MAXRECSIZE=32,TITLE="CREF.DAT"),
LINE,
INCLUDE(KIND=DISK,MAXRECSIZE=80),
ERRORF(KIND=BINARY,MAXRECSIZE=64,TITLE="SY:[1,211]ALGOL.ERR"),
TTY(KIND=TTY,MAXRECSIZE=80); % FILE FOR THE COMMAND STRING
%
% F O R W A R D D E C L A R A T I O N S
%
PROCEDURE CASEORIF(X);INTEGER X; FORWARD;
PROCEDURE AEXP; FORWARD;
PROCEDURE BEXP; FORWARD;
PROCEDURE PEXP; FORWARD;
PROCEDURE TERM(B); VALUE B; BOOLEAN B; FORWARD;
PROCEDURE ARITHSEC; FORWARD;
PROCEDURE PRIMARY; FORWARD;
INTEGER PROCEDURE BOOSEC; FORWARD;
INTEGER PROCEDURE BOOPRIM; FORWARD;
PROCEDURE BOOPTRPRIM(B); VALUE B; BOOLEAN B; FORWARD;
PROCEDURE MEMBERSHIPEXP; FORWARD;
PROCEDURE BLOK(FROM); VALUE FROM; INTEGER FROM; FORWARD;
PROCEDURE DECLARATION; FORWARD;
PROCEDURE ENTRY; FORWARD;
PROCEDURE ERROR (X); VALUE X; INTEGER X; FORWARD;
INTEGER PROCEDURE EXPRESS; FORWARD;
PROCEDURE FLAG(X); VALUE X; INTEGER X; FORWARD;
PROCEDURE MOVECODE; FORWARD;
PROCEDURE GOSTMT; FORWARD;
PROCEDURE WRITESTMT; FORWARD;
PROCEDURE SKIPSPACES; FORWARD;
INTEGER PROCEDURE NEXTCHAR; FORWARD;
PROCEDURE STMT; FORWARD;
BOOLEAN PROCEDURE FILENAMESCAN; FORWARD;
%
% RELATIVE ADDRESSING SCHEME:
%
% DECIMAL OCTAL WHERE
% ----------- ----------- -----
% 0- 8191 00000-17777 PRT
% 8192-12287 20000-27777 IPC
% 12288-14335 30000-33777 F+
% 14336-16383 34000-37777 F-
%
%
%
% THIS PROCEEDURE WRITE A LISTING LINE ADVANCING TO
% TOP OF PAGE IF NEEDED.
%
SAVE PROCEDURE WRITEALINE(X);
VALUE X;
INTEGER X;
BEGIN
INTEGER I;
LABEL EXIT;
IF EOPTION OR NOLISTFILE THEN GO EXIT;
IF NOT LNCT=100 THEN WRITE(LINE,X,LINEOUT);
IF LNCT:=LNCT+1 GTR 56 THEN
BEGIN
REPLACE LINEOUT BY 3"14",3"00";
WRITE(LINE[0],2,LINEOUT);
I:=REAL(PGCT:=*+1>9)+REAL(PGCT>99)+1;
IF EIGHTYCOL THEN
BEGIN REPLACE LINEOUT BY TITLE1 FOR 31-I," ",HEADING FOR 14,
" ",DATE FOR 11," ",TTIME FOR 11," Page ",ZS(PGCT,I);
WRITE(LINE,80,LINEOUT)
END ELSE
BEGIN REPLACE LINEOUT BY TITLE1 FOR 72," ",HEADING FOR 14,
" ",DATE FOR 11," ",TTIME FOR 11,
" " FOR 7-I,"Page ",ZS(PGCT,I);
WRITE(LINE,132,LINEOUT);
REPLACE POINTER(LINEOUT)+80 BY " " FOR 52
END;
WRITE(LINE,64,TITLE2);
WRITE(LINE,0,LINEOUT);
WRITEAFORM:=BOOLEAN(SRCLINE:=LNCT:=0)
END;
EXIT: END;
%
%
% THIS PROC RETURNS A DATE IN A NICE FORM
%
%
PROCEDURE CODETHEDAY(DA,MO,YR,HR,MN,P,O);
VALUE DA,MO,YR,HR,MN,O;
INTEGER DA,MO,YR,HR,MN,O;
POINTER P;
BEGIN
INTEGER I:=YR-1900,J:=MO-2,DAY;
ARRAY X[0:20];
POINTER PX;
BOOLEAN PM:=HR>12;
IF MO LSS 3
THEN BEGIN
J:=MO+10;
I:=*-1
END;
REPLACE P BY " " FOR 80;
DAY:=((J*26-2) DIV 10 + DA + I + I DIV 4) MOD 7;
IF HR>12 THEN HR:=*-12 ELSE IF HR=0 THEN HR:=12;
REPLACE X BY " " FOR 42;
REPLACE PX:X BY CASE DAY OF (
"Mon","Tues","Wednes","Thurs","Fri","Satur","Sun"),
"day ",CASE MO-1 OF(
"January","February","March","April","May","June",
"July","August","September","October","November",
"December"),ZS(DA,3-REAL(DA<10)),",",ZS(YR,5)," at",
ZS(HR,3-REAL(HR<10)),":",MN FOR 2 DIGITS,
IF PM THEN " P" ELSE " A","M.";
REPLACE P+((I:=(80-O-DELTA(X,PX))/2)+O) BY X FOR 42;
P:=*+I
END OF CODETHEDAY;
%
%
%
%
%
%
PROCEDURE DAYTIME;
BEGIN
INTEGER DA,MO,YR,HR,MN,SC;
POINTER P;
LINE.PRESENT:=FALSE; % PURGE OLD LISTING
IF XREFOPT THEN CREF.PRESENT:=FALSE; % AND OLD CREF IF APPLICABLE
REPLACE LINEOUT BY " " FOR 21,
"RSTS/E ALGOL compiler, version ",REVNO FOR 1,
".",SHR(REVNO,8) FOR 1,"." UPDATE " ";
REPLACE HEADING BY "ALGOL V",POINTER(LINEOUT)+52 FOR 7;
WRITEALINE(60);
P:=POINTER(LINEOUT);
CODETHEDAY(DA:=CTIME[3],MO:=CTIME[4],YR:=CTIME[5],
HR:=CTIME[2],MN:=CTIME[1],P,0);
SC:=CTIME[0];
WRITEALINE(0);
WRITEALINE(80);
WRITEALINE(0);
REPLACE DATE BY ZS(DA,2),"-",CASE MO OF (
"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec"),"-19",
YR FOR 2 DIGITS;
DA:=HR MOD 12; IF DA=0 THEN DA:=12;
REPLACE TTIME BY ZS(DA,2),":",MN FOR 2 DIGITS,":",
SC FOR 2 DIGITS," ",IF HR LEQ 11 THEN 8"A" ELSE
IF HR=12 AND MN=0 AND SC=0 THEN 8" " ELSE 8"P" FOR 1,"M";
REPLACE TITLE1 BY " " FOR 80;
REPLACE TITLE2 BY " " FOR 64;
P:=POINTER(LINEOUT);
CODETHEDAY(COMPILETIME(3),COMPILETIME(4),COMPILETIME(5),
COMPILETIME(2),COMPILETIME(1),P,18);
REPLACE P BY "Compiler compiled";
WRITEALINE(80);
WRITEALINE(0);
WRITEALINE(0);
NOHEADING:=FALSE;
LNCT:=6
END OF DAYTIME;
%
%
% THIS PROC SETS TOGGLES - THOSE STATEMENTS THAT BEGIN WITH
% THE @ SIGN ( @OMIT, @DEBUG)
%
PROCEDURE SETTOGGLES;
BEGIN
INTEGER T:=REAL(P+1,1);
IF T = "O" THEN OMITTOG:=NOT OMITTOG ELSE
IF T = "P" THEN PRTTOG:=NOT PRTTOG ELSE
IF T = "D" THEN DEBUGTOG:=NOT DEBUGTOG ELSE
IF T = "I" THEN
BEGIN
IF NOT INCLUDETOG THEN
BEGIN
INCLUDETOG:=TRUE;
REPLACE INCLUDE.TITLE BY P+2
END ELSE
FLAG(120)
END ELSE
IF T = "F" AND LNCT NEQ 0 THEN
BEGIN
LNCT:=100;
WRITEALINE(1)
END ELSE
IF T = "E" THEN IF NOT EOPTION:=NOT EOPTION THEN
IF NOHEADING THEN DAYTIME ELSE ELSE ELSE
IF T = "T" THEN
BEGIN
REPLACE TITLE1 BY " " FOR 80;
REPLACE TITLE1 BY P+2 WHILE NEQ 0
END ELSE
IF T = "C" THEN IF INCLUDETOG THEN
BEGIN
INCLUDE.OPEN:=FALSE;
REPLACE INCLUDE.TITLE BY P+2
END ELSE
BEGIN
CARDIN.OPEN:=FALSE;
REPLACE CARDIN.TITLE BY P+2
END
END OF SETTOGGLES;
% THIS PROCEDURE CROSS-REFERENCES THINGS
SAVE PROCEDURE CREFIT(T,B,F);
VALUE T,B,F;
INTEGER T,B,F;
BEGIN
INTEGER S; INTEGER ARRAY X[0:15];
SCAN XREFTYPES FOR 6 UNTIL EQL T;
IF NOT TOGGLE THEN % IF OPTION SELECTED
BEGIN REPLACE X BY " " FOR 16;
REPLACE X BY T FOR 1, INSTR FOR 15 WHILE NEQ 0;
S:=SEGNO[B];
X[8]:=SWAB(S);
X[9]:=SWAB(PGCT);
X[10]:=SWAB(SRCLINE);
X[11]:=B;
X[12]:=F;
WRITE(CREF,32,X) % WRITE CREF FILE RECORD
END
END OF CREFIT;
%
%
%
%
%
%
SAVE PROCEDURE WRITECARD;
BEGIN
INTEGER I,J,K,X;
OWN INTEGER PBC;
POINTER Q;
IF WRITEAFORM
THEN BEGIN
WRITEAFORM:=BOOLEAN(LNCT:=100);
WRITEALINE(1)
END;
IF OMITTOG THEN REPLACE Q:LINEOUT BY " Omitted "
ELSE REPLACE Q:LINEOUT BY ZS(SRCLINE:=*+1,2),
" ",O3(SGNO),":",O4(L);
IF PBC EQL BEGINCTR THEN REPLACE Q:Q BY " "
ELSE REPLACE Q:Q BY ZS(PBC:=BEGINCTR,2);
IF ERRORCOUNT EQL 0 THEN REPLACE Q:Q BY " "
ELSE REPLACE Q:Q BY ZS(ERRORCOUNT,2), " ";
REPLACE Q BY POINTER(CARD) FOR 72;
IF EIGHTYCOL % SHORT FORM?
THEN BEGIN % YES
K:=-1;
DO BEGIN
IF X:=REAL(POINTER(LINEOUT)+K:=*+1,1) EQL 3"11"
THEN I:=I DIV 8 * 8 + 8