Trailing-Edge
-
PDP-10 Archives
-
decus_20tap2_198111
-
decus/20-0035/algolw.doc
There are 2 other files named algolw.doc in the archive. Click here to see a list.
00100 FIRST A CAVEAT:
00200
00300 THIS SYSTEM IS PURELY EXPERIMENTAL! ALTHOUGH THE COMPILER AND
00400 RUNTIME SYSTEM HAVE BEEN FAIRLY WELL CHECKED OUT, THEY ARE NOT
00500 GUARANTEED TO WORK RELIABLY ACCORDING TO THEIR DESCRIPTION BELOW.
00600 THE COMPILER IS FAIRLY CRUDE AND INCOMPLETE SINCE IT WAS INTENDED
00700 PURELY AS A BOOTSTRAP TOOL. THE "PRODUCTION" COMPILER WAS TO HAVE
00800 BEEN WRITTEN IN ALGOLW. DUE TO TIME CONSTRAINTS AND SOME LACK OF
00900 INTEREST, THIS MAY NEVER BE DONE. IF SOMEONE WOULD LIKE TO WRITE
01000 THE "PRODUCTION" COMPILER, I WOULD BE WILLING TO WRITE UP SOME
01100 INTERNAL DOCUMENTATION ON THE REQUIREMENTS FOR PRODUCING CODE
01200 TO GO WITH THE RUNTIME PACKAGE.
01300
01400 MIKE GREEN, COMPUTING AND INFORMATION SCIENCES DEPARTMENT
01500 CASE WESTERN RESERVE UNIVERSITY, CLEVELAND, OHIO 44106
01600
01700
01800 INSTALLATION INSTRUCTIONS
01900 -------------------------
02000
02100 THE TAPE CONTAINS THE FOLLOWING FILES:
02200
02300 ALGOL1.MET
02400 ALGOL2.MET THESE 4 FILES ARE THE COMPILER SOURCE
02500 ALGOL3.MET
02600 ALGOL4.MET
02700
02800 META2.MAC COMPILER I/O AND UTILITY SUPPORT
02900
03000 META2C.MET SOURCE FOR COMPILER/COMPILER
03100
03200 META2C.REL REL FILE FOR COMPILER/COMPILER FOR *.MET
03300
03400 ALGLIB.MAC ALGOLW RUNTIME SYSTEM
03500
03600 SYNTAX.ALG SAMPLE PROGRAM (SIMPLE PRECEDENCE ANALYZER)
03700
03800 ALGOLW.DOC THIS DOCUMENTATION FILE
03900
04000 SAMPLE.INP INPUT FILE FOR SAMPLE PROGRAM
04100
04200
04300 TO BUILD A WORKING SYSTEM:
04400
04500 .RUN DTA1:META2.SAV
04600 .R MACRO
04700
04800 *META2_DTA1:META2.MAC
04900
05000 *^C
05100
05200 .R LOADER
05300
05400 *DTA1:META2C,META2/E$
05500
05600 *ALGOL1_DTA1:ALGOL1.MET
05700
05800 *ALGOL2_DTA1:ALGOL2.MET
05900
06000 *ALGOL3_DTA1:ALGOL3.MET
06100
06200 *ALGOL4_DTA1:ALGOL4.MET
06300
06400 *^C
06500
06600 .R MACRO
06700
06800 *ALGOL1_ALGOL1.MAC
06900
07000 *ALGOL2_ALGOL2.MAC
07100
07200 *ALGOL3_ALGOL3.MAC
07300
07400 *ALGOL4_ALGOL4.MAC
07500
07600 *ALGLIB_DTA1:ALGLIB.MAC
07700
07800 *^C
07900
08000 .R LOADER
08100
08200 *ALGOL1,ALGOL2,ALGOL3,ALGOL4,META2$
08300
08400 EXIT
08500 ^C
08600
08700 .SAVE ALGOLW
08800
08900
09000 TO COMPILE AND RUN THE SAMPLE PROGRAM:
09100
09200 .RUN ALGOLW
09300
09400 *SYNTAX_DTA1:SYNTAX.ALG
09500
09600 *^C
09700
09800 .R MACRO
09900
10000 *SYNTAX_SYNTAX.MAC
10100
10200 *^C
10300
10400 .R LOADER
10500
10600 *SYNTAX,ALGLIB/L$
10700
10800 EXIT
10900 ^C
11000
11100 .SSAVE SYNTAX
11200
11300 .RUN SYNTAX
11400 IN FILE: DTA1:SAMPLE.INP
11500 OUT FILE: LPT:
11600 0 PRECEDENCE VIOLATION(S)
11700 0 FUNCTION CONFLICT(S)
11800 ELAPSED TIME WAS 1 MINUTE(S) AND 39 SECOND(S)
11900 EXECUTION TIME WAS 0 MINUTE(S) AND 20 SECOND(S)
12000
12100 EXIT
12200 ^C
12300 .
12400
12500
12600 SOME NOTES ON THE OBJECT PROGRAMS PRODUCED AND ON THE
12700 COMPILER:
12800
12900 THE COMPILER WILL RUN UNDER CONTROL OF COMPIL WITH THE
13000 CONDITION THAT NO LISTING IS REQUESTED. THE COMPILER'S
13100 COMMAND STRING PROCESSOR ACCEPTS ONLY THE OUTPUT AND
13200 INPUT FIELDS. THE COMPILER IS NOT SHARABLE.
13300
13400 THE OBJECT PROGRAMS AND THE RUNTIME ROUTINES ARE COMPLETELY
13500 SHARABLE. ALSO, THE PROGRAMS PRODUCED MAY BE RUN AS CUSPS
13600 SINCE THE NORMAL AND ALTERNATE ENTRY POINTS ARE AVAILABLE
13700 AND THE PROGRAM CAN TELL WHERE IT WAS ENTERED WITH A BUILTIN
13800 FUNCTION.
13900
14000 RUNTIME ERRORS WILL PRODUCE A PROCEDURE TRACEBACK WITH ABSOLUTE
14100 ADDRESSES GIVEN. THE ERROR MESSAGE EDITOR CAN HANDLE LINE NUMBER
14200 TABLES BUT THE COMPILER CAN'T PRODUCE THEM. REENTERING A PROGRAM
14300 WILL PRODUCE AN ERROR MESSAGE AND A TRACEBACK. THIS IS USEFUL
14400 FOR FINDING OUT WHERE A PROGRAM IS CAUGHT IN AN INFINITE LOOP.
14500
14600
14700 A BRIEF LANGUAGE DESCRIPTION:
14800 -----------------------------
14900
15000 THE LANGUAGE ACCEPTED BY THIS SYSTEM IS A VARIANT OF ALGOLW
15100 CONSIDERABLY RESTRICTED IN BOTH DATA TYPES AND STATEMENT
15200 FLEXIBILITY.
15300
15400 ALLOWED DATA TYPES ARE:
15500
15600 INTEGER, STRING, BITS AND REFERENCE
15700
15800 ALLOWED DATA STRUCTURING TYPES ARE:
15900
16000 ONE AND TWO DIMENSIONAL ARRAYS AND RECORDS OF SCALAR TYPES.
16100 STRING AND BITS ARRAYS MUST HAVE A FIXED LENGTH SPECIFIED.
16200
16300 STRING AND BITS MAY BE FIXED LENGTH WITH THE LENGTH SPECIFIED BY
16400 A CONSTANT OR THEY MAY BE VARIABLE LENGTH.
16500
16600 PROCEDURES MAY NOT RETURN A VALUE AND THEIR ARGUMENTS ARE
16700 RESTRICTED TO BE CONSTANTS OR VARIABLE NAMES ONLY. ARGUMENTS
16800 MAY NOT BE EXPRESSIONS, SUBSTRINGS OR ELEMENTS OF ARRAYS.
16900 THEY MAY BE STRING NAMES, ARRAY NAMES OR OTHER VARIABLE NAMES.
17000 THEY MAY ALSO BE PROCEDURE NAMES.
17100
17200 EXPRESSIONS MAY NOT BE STRUCTURED, I.E. IF OR CASE EXPRESSIONS.
17300
17400 THERE ARE A FEW EXCEPTIONS TO THE RESTRICTIONS ON PROCEDURES.
17500 THERE IS A SET OF BUILTIN PROCEDURES FOR I/O AND MONITOR
17600 FUNCTIONS. SOME OF THESE RETURN VALUES AND THEIR ARGUMENTS
17700 MAY BE EXPRESSIONS. THEY ARE ACTUALLY COMPILED INLINE WHICH
17800 EXPLAINS THIS DIFFERENCE.
17900
18000 THE DISTINCTION BETWEEN FIXED AND VARIABLE LENGTH STRING AND
18100 BITS NEEDS SOME EXPLANATION. FIXED LENGTH STRINGS ARE ALLOCATED
18200 STORAGE UPON ENTRY TO THE BLOCK OR CREATION OF A RECORD CONTAINING
18300 THEM. AN ASSIGNMENT TO A FIXED LENGTH STRING RESULTS IN A
18400 COPY OPERATION FROM THE RESULT OF THE STRING EXPRESSION IN
18500 THE ASSIGNMENT. IF THE VALUE OF THE EXPRESSION IS SHORTER THAN
18600 THE STRING ON THE LEFT, THE STRING IS PADDED WITH BLANKS OR
18700 ZERO BITS IF IT IS A BITSTRING. IF THE VALUE IS TOO LONG, IT
18800 IS TRUNCATED ON THE RIGHT. VARIABLE LENGTH STRINGS ARE
18900 ACTUALLY ONLY POINTERS TO VALUES. THEY ARE INITIALLY NULL.
19000 WHEN ASSIGNED A VALUE, THEY ARE SET TO POINT TO THAT VALUE.
19100 ASSIGNING A VALUE TO A SUBSTRING OF A VARIABLE LENGTH STRING
19200 IS FRAUGHT WITH DANGER SINCE MORE THAN ONE POINTER MAY BE
19300 POINTING TO THE SAME STRING. IF YOU CHANGE PART OF A STRING,
19400 IT MAY BE PART OF SOME FIXED LENGTH STRING OR CONSTANT!
19500 THERE ARE TWO BUILTIN FUNCTIONS CALLED COPYSTRING AND COPYBITS
19600 THAT TAKE A STRING OR BITS ARGUMENT RESPECTIVELY AND RETURN A
19700 COPY OF THEIR ARGUMENT. THIS CAN BE ASSIGNED TO A VARIABLE LENGTH
19800 STRING AND CAN THEN BE MANIPULATED WITHOUT FEAR.
19900
20000 THE VARIOUS BUILTIN FUNCTIONS AND PROCEDURES ARE:
20100
20200 ERROR( <STRING> ); TYPES THE <STRING>, PROVIDES A PROCEDURE
20300 TRACEBACK AND TERMINATES EXECUTION
20400
20500 OPENIN( <INTEGER> , <STRING> );
20600 OPENOUT( <INTEGER> , <STRING> );
20700 OPENS AN INPUT OR OUTPUT CHANNEL RESPECTIVELY
20800 ON CHANNEL <INTEGER> USING <STRING> AS THE
20900 SOURCE OF THE FILE DESCRIPTOR OF THE FORM:
21000 DEV:FILE.EXT[PROJ,PROG]<PROT>(SWITCHES)
21100 #NO. OF BUFFERS *MODE ^ ?
21200 <PROT> IS THE PROTECTION USED WHEN CLOSING
21300 THE FILE. (SWITCHES) MAY CONTAIN THE
21400 CHARACTERS: ZABCWT258EOU ALL EXCEPT
21500 U ARE DEFINED AS FOR VARIOUS DEC CUSPS.
21600 U WILL MARK THE FILE TO BE UNLOADED WHEN
21700 IT IS CLOSED. #NO. OF BUFFERS IS THE
21800 NUMBER OF BUFFERS TO BE USED. EXAMPLE:
21900 #5 FOR FIVE BUFFERS. *MODE MAY BE ONE OF
22000 THE FOLLOWING: *S FOR STRING FILE, *L
22100 FOR STRING FILE WITH LINE NUMBERING
22200 OR *B FOR BITS FILE (BINARY).
22300 ^ INDICATES THAT THE FILE IS TO BE DELETED
22400 WHEN CLOSED AND ? INDICATES THAT THIS IS
22500 A CONDITIONAL OPEN - IT IS NOT AN ERROR
22600 FOR THE FILE NOT TO EXIST. IF ? IS NOT
22700 PRESENT, AN ERROR MESSAGE IS PRODUCED
22800 IF THE FILE DOESN'T EXIST ON INPUT.
22900 ALL FIELDS PAST THE FILE EXTENSION MAY
23000 OCCUR IN ANY ORDER. IF THE DEVICE NAME
23100 IS NOT PRESENT, DSK: IS ASSUMED. IF A
23200 DEVICE NAME IS PRESENT, THE FILE NAME
23300 AND EXTENSION NEED NOT BE PRESENT.
23400 <INTEGER> IS A MONITOR SOFTWARE CHANNEL
23500 NUMBER RANGING FROM 1 TO 15. CHANNEL 0
23600 IS ALWAYS OPEN FOR BOTH INPUT AND
23700 OUTPUT TO TTY: WITH LINE NUMBERING
23800 ALLOWED. THIS IS THE ONLY CHANNEL THAT
23900 MAY BE OPEN FOR BOTH INPUT AND OUTPUT
24000 AT THE SAME TIME.
24100
24200 CLOSE( <INTEGER> ); THIS CLOSES THE SPECIFIED CHANNEL.
24300 CHANNEL 0 MAY NOT BE CLOSED.
24400
24500 <INTEGER> := LENGTH( <STRING> );
24600 RETURNS THE LENGTH OF THE STRING.
24700
24800 <INTEGER> := LINENO( <INTEGER> );
24900 RETURNS THE LAST READ LINE NUMBER FOR
25000 THE CHANNEL GIVEN AS AN ARGUMENT.
25100 RETURNS -1 IF NO LINE NUMBERS HAVE
25200 BEEN READ.
25300
25400 <INTEGER> := DATE; RETURNS THE RESULT OF THE DATE UUO.
25500
25600 <INTEGER> := MSTIME; RETURNS THE RESULT OF THE MSTIME UUO.
25700
25800 <INTEGER> := RUNTIME; RETURNS THE RESULT OF THE RUNTIM UUO
25900 GIVING THE RUN TIME FOR THIS JOB.
26000
26100 <INTEGER> := JOBNO; RETURNS THE NUMBER OF THIS JOB.
26200
26300 <INTEGER> := PROJPROG; RETURNS THE RESULT OF THE GETPPN UUO.
26400
26500 OUTLINE( <INTEGER> , <INTEGER> );
26600 OUTPUTS THE VALUE OF THE SECOND
26700 ARGUMENT AS A LINE NUMBER ON THE
26800 CHANNEL GIVEN AS THE FIRST ARGUMENT.
26900
27000 <INTEGER> := STATUS( <INTEGER> );
27100 RETURNS ONE OF 25 ENTRIES IN A
27200 STATISTICS TABLE. THE ENTRIES ARE:
27300 1 RUNTIME AT END OF LAST CALL ON STORAGE ALLOCATOR
27400 2 RUNTIME AT END OF LAST GARBAGE COLLECTION
27500 3 ADDRESS OF FIRST WORD OF DYNAMIC STORAGE
27600 4 NUMBER OF TIMES STORAGE ALLOCATOR CALLED
27700 5 NUMBER OF TIMES GARBAGE COLLECTOR CALLED
27800 6 TOTAL MEMORY REQUESTED FROM ALLOCATOR
27900 7 LARGEST MEMORY REQUEST FROM ALLOCATOR
28000 8 WEIGHTED AVERAGE MEMORY REQUESTED FROM ALLOCATOR
28100 9 TOTAL RUNTIME BETWEEN ALLOCATOR CALLS
28200 10 LARGEST RUNTIME BETWEEN ALLOCATOR CALLS
28300 11 TOTAL RUNTIME SPENT IN ALLOCATOR
28400 12 LARGEST RUNTIME SPENT IN ALLOCATOR
28500 13 TOTAL MEMORY FREED BY GARBAGE COLLECTION
28600 14 LARGEST MEMORY FREED BY GARBAGE COLLECTION
28700 15 WEIGHTED AVERAGE MEMORY FREED BY COLLECTION
28800 16 TOTAL RUNTIME BETWEEN GARBAGE COLLECTOR CALLS
28900 17 LARGEST RUNTIME BETWEEN GARBAGE COLLECTOR CALLS
29000 18 TOTAL RUNTIME SPENT IN GARBAGE COLLECTOR
29100 19 LARGEST RUNTIME SPENT IN GARBAGE COLLECTOR
29200 20 MSTIME AT START OF RUN
29300 21 RUNTIME AT START OF RUN
29400 22 TOTAL MEMORY REQUESTED SINCE LAST COLLECTION
29500 23 LARGEST MEMORY REQUEST SINCE LAST COLLECTION
29600 24 WEIGHTED AVERAGE MEMORY REQUESTED SINCE LAST COLLECTION
29700 25 NUMBER OF TIMES ALLOCATOR CALLED SINCE LAST COLLECTION
29800
29900 THE WEIGHTED AVERAGE MENTIONED IS CALCULATED AS FOLLOWS:
30000 NEW AVERAGE := (OLD AVERAGE+NEW VALUE)/2;
30100
30200 OUTSTRING( <INTEGER> , <STRING> );
30300 OUTBITS( <INTEGER> , <BITS> );
30400 OUTPUTS THE STRING OR BITS VALUE
30500 TO THE SPECIFIED CHANNEL.
30600
30700 <STRING> := INSTRING( <INTEGER> , <INTEGER> );
30800 <BITS> := INBITS( <INTEGER> , <INTEGER> );
30900 INPUTS A STRING OR BITS VALUE FROM
31000 THE CHANNEL GIVEN BY THE FIRST
31100 ARGUMENT. THE SECOND ARGUMENT
31200 SPECIFIES A MAXIMUM LENGTH FOR THE
31300 INPUT. THE FUNCTION VALUE IS
31400 THE LENGTH OF THE INPUT.
31500
31600 <STRING> := BREAK( <INTEGER> );
31700 RETURNS THE LAST BREAK CHARACTER
31800 FOR THE SPECIFIED CHANNEL.
31900
32000 SETBREAK( <INTEGER> , <STRING> , <STRING> , <STRING> );
32100 THIS SETS THE BREAK CHARACTERS FOR
32200 THE CHANNEL SPECIFIED AS THE FIRST
32300 ARGUMENT. THE CHARACTERS IN THE
32400 FIRST STRING ARE TO BE COMPLETELY
32500 IGNORED. THE ONES IN THE SECOND
32600 AND THIRD STRINGS CAUSE A BREAK.
32700 THE CHARACTERS IN THE SECOND STRING ARE
32800 INCLUDED IN THE INPUT STRING WHILE THE
32900 ONES IN THE THIRD STRING ARE DISCARDED.
33000 THE REMAINING CHARACTERS NOT IN ANY OF
33100 THE THREE STRINGS ARE READ NORMALLY. ON
33200 CHANNEL 0, THE DEFAULT BREAK SETTINGS
33300 CAUSE LINEFEEDS TO BE IGNORED AND
33400 CARRIAGE RETURN, BELL, FORMFEED
33500 VERTICAL TAB AND ALTMODE CAUSE A BREAK
33600 AND ARE OTHERWISE IGNORED.
33700
33800 SLEEP( <INTEGER> ); THE JOB IS PUT TO SLEEP FOR THE
33900 SPECIFIED NUMBER OF SECONDS.
34000
34100 RUN( <STRING> ); THE FILE DESCRIBED IN THE STRING IS
34200 RUN WITH THE RUN UUO. THE STRING IS
34300 OF THE FORM:
34400 DEV:FILE.EXT[PROJ,PROG]@ENTRY=SIZEK?
34500 @ENTRY SPECIFIES THE ENTRY OFFSET IN
34600 OCTAL AS IN: @1 FOR THE CUSP ALTERNATE
34700 ENTRY POINT. =SIZEK SPECIFIES THE
34800 DEFAULT LOW SEGMENT SIZE IN 1024 WORD
34900 MULTIPLES AS IN: =5K FOR 6020 WORDS.
35000 THE K MAY BE IN LOWER CASE. ? INDICATES
35100 THAT THE RUN IS CONDITIONAL. IF THE
35200 RUN FAILS AND ? IS SPECIFIED, CONTROL
35300 IS RETURNED FOLLOWING THE CALL ON RUN.
35400 IF ? IS NOT SPECIFIED, AN ERROR MESSAGE
35500 IS PROVIDED AND THE RUN IS TERMINATED.
35600 THE SPECIFICATIONS AFTER THE EXTENSION
35700 MAY BE IN ANY ORDER AND THE USUAL
35800 DEFAULTS APPLY FOR DEV:FILE.EXT.
35900
36000 <BITS> := STRBIT( <STRING> );
36100 CONVERTS A STRING TO A BITS VALUE.
36200 EACH CHARACTER IS CONVERTED TO 7 BITS
36300 WITH THE MOST SIGNIFICANT BIT OF THE
36400 CHARACTER BEING THE FIRST BIT IN THE
36500 BITSTRING. THE CHARACTER CODE IS ASCII.
36600
36700 <BITS> := INTBIT( <INTEGER> , <INTEGER> );
36800 THE FIRST INTEGER VALUE IS CONVERTED
36900 INTO A BITSTRING OF LENGTH AS GIVEN
37000 BY THE SECOND VALUE. IF THE LENGTH
37100 IS > 36, THE BITS VALUE IS LEFT FILLED
37200 WITH #0. IF THE LENGTH IS < 36, THE
37300 LOW ORDER BITS OF THE INTEGER VALUE
37400 ARE USED.
37500
37600 <STRING> := BITSTR( <BITS> );
37700 THE BITSTRING IS CONVERTED INTO A
37800 CHARACTER STRING - 7 BITS PER BYTE.
37900 IF THE BITSTRING IS NOT A MULTIPLE
38000 OF 7 IN LENGTH, THE LAST BYTE IS
38100 PADDED ON THE RIGHT WITH ZERO BITS.
38200
38300 <INTEGER> := BITINT( <BITS> );
38400 THE BITSTRING IS CONVERTED TO A 36
38500 BIT INTEGER. THE BITS ARE RIGHT
38600 JUSTIFIED IN THE 36 BIT WORD AND
38700 ANY EXTRA HIGH ORDER BITS (IN EXCESS
38800 OF 36) MUST BE ZERO.
38900
39000 <STRING> := INTSTR( <INTEGER> , <INTEGER> );
39100 THE FIRST INTEGER VALUE IS EDITED
39200 INTO A STRING OF LENGTH AS GIVEN BY
39300 THE SECOND VALUE. THE ASCII EDITED
39400 VALUE IS RIGHT JUSTIFIED IN THE FIELD
39500 AND BLANK FILLED ON THE LEFT WITH A
39600 LEADING MINUS SIGN IF THE VALUE IS
39700 NEGATIVE.
39800
39900 <INTEGER> := STRINT( <STRING> );
40000 THE STRING IS ASSUMED TO CONTAIN
40100 A DECIMAL NUMBER AS A CHARACTER STRING
40200 WITH OPTIONAL LEADING BLANKS AND A
40300 LEADING MINUS SIGN IF NEGATIVE. THE
40400 NUMBER IS CONVERTED INTO BINARY AND
40500 RETURNED AS THE FUNCTION VALUE.
40600
40700 <STRING> := BLANKS( <INTEGER> );
40800 RETURNS A STRING OF LENGTH AS GIVEN
40900 BY THE INTEGER ARGUMENT. THE STRING
41000 IS INITIALIZED TO BLANKS.
41100
41200 <BITS> := ZEROES( <INTEGER> );
41300 RETURNS A BITSTRING OF LENGTH AS GIVEN
41400 BY THE INTEGER ARGUMENT. THE BITSTRING
41500 IS INITIALIZED TO ZEROES.
41600
41700 <STRING> := COPYSTRING( <STRING> );
41800 RETURNS A COPY OF ITS ARGUMENT.
41900
42000 <BITS> := COPYBITS( <BITS> );
42100 RETURNS A COPY OF ITS ARGUMENT.
42200
42300 <INTEGER> := ABS( <INTEGER> );
42400 RETURNS THE ABSOLUTE VALUE OF THE ARGUMENT
42500
42600 THE NEXT THREE FUNCTIONS RETURN A BOOLEAN VALUE AND ARE THE
42700 ONLY BOOLEAN QUANTITIES AVAILABLE EXCEPT FOR THE RESULT OF
42800 THE RELATIONAL OPERATORS.
42900
43000 ENTRY TRUE IF THE PROGRAM WAS ENTERED
43100 THROUGH THE ALTERNATE (CUSP) ENTRY.
43200
43300 ENDFILE( <INTEGER> ) TRUE IF AN ENDFILE CONDITION EXISTS
43400 FOR THE SPECIFIED CHANNEL.
43500
43600 OPEN( <INTEGER> ) TRUE IF THE SPECIFIED CHANNEL IS
43700 OPEN. USED NORMALLY AFTER A
43800 CONDITIONAL OPENINPUT.
43900
44000
44100 INFORMAL SYNTACTICAL DESCRIPTION
44200 --------------------------------
44300
44400 VARIABLE DECLARATIONS ARE OF THE FORM:
44500
44600 INTEGER <NAME> ;
44700
44800 INTEGER ARRAY <NAME> ( <EXPRESSION> :: <EXPRESSION> );
44900
45000 INTEGER ARRAY <NAME> ( <EXPR> :: <EXPR> , <EXPR> :: <EXPR> );
45100
45200 OTHER TYPES ARE:
45300
45400 STRING(*) FOR VARIABLE LENGTH STRINGS
45500
45600 STRING( <NUMBER> ) FOR FIXED LENGTH STRINGS
45700
45800 BITS(*) THE SAME FOR BIT STRINGS
45900
46000 BITS( <NUMBER> )
46100
46200 REFERENCE FOR REFERENCE VALUES (POINTERS)
46300
46400 REFERENCE( <NAME> , <NAME> ... )
46500 HERE, A LIST OF NAMES IN PARENTHESIS FOLLOWS
46600 THE WORD REFERENCE. THE NAMES WOULD NORMALLY
46700 BE THE NAMES OF RECORDS THAT THE REFERENCE
46800 CAN POINT TO. NO CHECKING IS DONE PRESENTLY.
46900
47000 A RECORD DECLARATION IS AS FOLLOWS:
47100
47200 RECORD <NAME>( <SCALAR DECLARATION> ; <SCALAR DECLARATION> ... );
47300
47400 NOTE THAT THE LAST (OR ONLY) DECLARATION IN THE RECORD HAS
47500 NO SEMICOLON AFTER IT.
47600
47700
47800 PROCEDURE DECLARATIONS CAN BE:
47900
48000 EXTERNAL PROCEDURE <NAME>;
48100
48200 EXTERNAL PROCEDURE <NAME>( <ARGUMENT> ; <ARGUMENT> ... );
48300
48400
48500 <ARGUMENT> MAY BE ANY SCALAR DECLARATION OR AN ARRAY DECLARATION
48600 WITH ASTERISKS SUBSTITUTED FOR 'BOUND PAIRS' LIKE:
48700
48800 INTEGER ARRAY A(*,*)
48900
49000 AN ARGUMENT MAY ALSO BE OF THE FORM: PROCEDURE <NAME>
49100
49200 THESE EXTERNAL PROCEDURE DECLARATIONS DEFINE EXTERNALLY SUPPLIED
49300 PROCEDURES. THEIR NAMES MUST BE UNIQUE WITHIN THE FIRST 6 CHARACTERS
49400 DUE TO MACRO AND LOADER LIMITATIONS.
49500
49600 AN INTERNAL PROCEDURE DECLARATION IS ESSENTIALLY THE SAME FORM:
49700
49800 PROCEDURE <NAME>; <STATEMENT>;
49900
50000 PROCEDURE <NAME>( <ARGUMENT> ; <ARGUMENT> ... ); <STATEMENT>;
50100
50200 AS IN RECORD DECLARATIONS, THE LAST (OR ONLY) <ARGUMENT> IS
50300 NOT FOLLOWED BY A SEMICOLON. THERE CAN BE AT MOST 8 ARGUMENTS
50350 TO A PROCEDURE.
50400
50500
50600 A PROGRAM THEN CONSISTS OF EITHER A BLOCK OR A PROCEDURE
50700 DECLARATION. A BLOCK IS CONSIDERED TO BE A COMPLETE PROGRAM
50800 WHILE A PROCEDURE DECLARATION IS ASSUMED TO BE AN EXTERNALLY
50900 DEFINED PROCEDURE. WE THEN HAVE EITHER:
51000
51100 BEGIN
51200 <DECLARATION> ; <DECLARATION> ; ...
51300 <STATEMENT> ; <STATEMENT> ; ...
51400 END.
51500
51600 OR:
51700
51800 PROCEDURE <NAME>( <ARGUMENT> ... );
51900 <STATEMENT> .
52000
52100 NOTE THAT THE END STATEMENT OF THE BLOCK AND THE STATEMENT
52200 IN THE PROCEDURE BODY ARE BOTH FOLLOWED BY A PERIOD. THIS
52300 MARKS THE END OF THE PROGRAM. ALSO, AN EXTERNALLY
52400 DEFINED PROCEDURE NEED NOT HAVE ANY ARGUMENTS.
52500
52600
52700 STATEMENTS MAY BE LABELLED AS: <LABEL>: <LABEL>: ...
52800 AND ARE OF THE FOLLOWING TYPES:
52900
53000 A BLOCK:
53100 BEGIN
53200 <DECLARATION> ; <DECLARATION>; ...
53300 <STATEMENT> ; <STATEMENT>; ...
53400 END
53500 OR:
53600 BEGIN
53700 <STATEMENT> ; <STATEMENT> ; ...
53800 END
53900
54000 A GO TO:
54100 GOTO <LABEL>
54200 OR:
54300 GO TO <LABEL>
54400
54500 A FOR STATEMENT:
54600 FOR <NAME> := <EXPR> STEP <EXPR> UNTIL <EXPR> DO
54700 <STATEMENT>
54800
54900 NOTE THAT THE CONTROL VARIABLE OF THE FOR LOOP IS DEFINED
55000 IMPLICITLY. IT MAY NOT BE DEFINED AT THE BEGINNING OF THE
55100 BLOCK AND NESTED FOR STATEMENTS MAY NOT USE THE SAME CONTROL
55200 VARIABLE NAME. THE CONTROL VARIABLE MAY NOT BE REFERENCED
55300 EXCEPT WITHIN THE SCOPE OF THE FOR LOOP. ALSO, THE THREE
55400 EXPRESSIONS ARE EVALUATED ONLY ONCE UPON ENTRY TO THE LOOP.
55500
55600 A WHILE STATEMENT:
55700 WHILE <BOOLEAN EXPR> DO <STATEMENT>
55800
55900 AN IF STATEMENT:
56000 IF <BOOLEAN EXPR> THEN <STATEMENT>
56100 OR:
56200 IF <BOOLEAN EXPR> THEN <STATEMENT>
56300 ELSE <STATEMENT>
56400
56500 A CASE STATEMENT:
56600 CASE <EXPR> OF BEGIN
56700 <STATEMENT 1>;
56800 <STATEMENT 2>;
56900 .
57000 .
57100 <STATEMENT N>
57200 END
57300 NOTE THAT NO SEMICOLON FOLLOWS THE LAST STATEMENT. IF THE
57400 VALUE OF THE EXPRESSION IS <= ZERO OR > THE NUMBER OF
57500 STATEMENTS IN THE RANGE OF THE CASE STATEMENT, THE CASE
57600 STATEMENT ACTS AS IF IT WERE IGNORED.
57700
57800 A COMMENT:
57900 COMMENT <ANY TEXT EXCEPT ;> ;
58000
58100 A COMMENT MAY OCCUR ANYWHERE A STATEMENT CAN OCCUR. IT ALSO
58200 CAN BE USED ANYWHERE A DECLARATION CAN BE USED LIKE IN
58300 A PROCEDURE DECLARATION OR A RECORD DECLARATION. NOTE THAT
58400 COMMENTS SHOULD NOT BE LONGER THAN A FEW LINES DUE TO A COMPILER
58500 LIMITATION. ALSO, WHEN THE SOURCE COMES FROM CARDS OR CARD IMAGE
58600 FILES, ANY TRAILING BLANKS SHOULD BE ELIMINATED. THEY RUN
58700 AFOUL OF THE SAME LIMITATION.
58800
58900
59000 CONSTANTS:
59100
59200 INTEGER CONSTANTS ARE IN THE USUAL FORM:
59300 <DIGIT>...
59400
59500 THE ONLY REFERENCE CONSTANT IS THE SYMBOL: NULL
59600
59700 STRING CONSTANTS ARE ENCLOSED IN QUOTES: " "
59800 A QUOTE IS REPRESENTED BY DOUBLE QUOTES: " "" "
59900 THE BACKSLASH CHARACTER IS ILLEGAL IN STRINGS: \
60000 LASTLY, A NULL STRING IS PERFECTLY LEGAL: ""
60100
60200 BITSTRINGS ARE GIVEN AS FOLLOWS: #001001001
60300 THE DIGITS MAY BE ONLY 0 OR 1.
60400
60500
60600 VARIABLES:
60700
60800 PARTS OF A RECORD ARE DENOTED AS:
60900 <RECORD FIELD NAME> ( <REFERENCE VALUE> )
61000
61100 ELEMENTS OF AN ARRAY ARE DENOTED AS:
61200 <ARRAY VARIABLE NAME> ( <EXPRESSION> , <EXPRESSION> )
61300 WITH POSSIBLY ONLY ONE EXPRESSION INSTEAD OF TWO.
61400
61500 THE SUBSTRING OF ANY STRING VALUE MAY BE TAKEN. THIS INCLUDES
61600 RECORD ELEMENTS, ARRAY ELEMENTS, SCALARS AND BUILTIN PROCEDURE
61700 VALUES. A SUBSTRING IS DESIGNATED AS FOLLOWS:
61800 <ELEMENT> ( <START EXPR> , <LENGTH EXPR> )
61900 THE FIRST EXPRESSION GIVES THE STARTING POSITION (BEGINNING AT 1)
62000 AND THE SECOND GIVES THE LENGTH OF THE SUBSTRING.
62100 SOME EXAMPLES ARE:
62200 A(5,3) B(REF)(4,1) C(3)(2,3)
62300
62400
62500 EXPRESSIONS THEN USE CONSTANTS AND VARIABLE VALUES WITH THE
62600 FOLLOWING OPERATORS:
62700
62800 INTEGER OPERATORS + - * DIV REM
62900
63000 RELATIONAL OPERATORS EQL NEQ LSS LEQ GTR GEQ IS
63100
63200 BOOLEAN OPERATORS OR AND NOT
63300
63400 STRING, BITS OPERATOR CAT
63500
63600 DIV GIVES THE QUOTIENT OF INTEGER DIVISION WHILE REM GIVES THE
63700 REMAINDER. THE RELATIONAL OPERATORS ARE = , NOT= , < , <= ,
63800 > AND >= RESPECTIVELY WITH 'IS' A SPECIAL OPERATOR BETWEEN
63900 A REFERENCE AND A RECORD NAME. 'A IS B' IS TRUE IF THE REFERENCE
64000 A POINTS TO A RECORD OF TYPE B. 'AND', 'OR' AND 'NOT' ARE THE
64100 USUAL BOOLEAN OPERATORS WITH THE RESTRICTION THAT PARENTHESIZED
64200 BOOLEAN EXPRESSIONS ARE NOT ALLOWED. LASTLY, 'CAT' IS THE STRING
64300 OR BITS CATENATION OPERATION. ITS VALUE IS A NEW STRING WHOSE
64400 LENGTH IS THE SUM OF THE LENGTHS OF THE TWO OPERANDS AND WHOSE
64500 CONTENT IS THE CATENATED VALUES OF THE TWO OPERANDS.
64600
64700
64800 THE LAST TYPE OF STATEMENT IS SIMPLY THE ASSIGNMENT
64900 STATEMENT. THE ASSIGNMENT OPERATOR IS := AND ASSIGNMENTS
65000 CAN BE MADE TO ANY SCALAR, ARRAY ELEMENT, RECORD ELEMENT OR
65100 PROCEDURE PARAMETER EXCEPT THAT AN ASSIGNMENT CAN NOT BE MADE
65200 TO A CONTROL VARIABLE OR TO A PROCEDURE PARAMETER WHOSE
65300 ACTUAL ARGUMENT IS A CONSTANT OR CONTROL VARIABLE.
65400
65500
65600 THAT'S ALL. GOOD LUCK!