Trailing-Edge
-
PDP-10 Archives
-
decuslib10-02
-
43,50263/fasbol.rnd
There are 2 other files named fasbol.rnd in the archive. Click here to see a list.
00050 .TITLE ^^FASBOL MANUAL\\
00100 .PAPER SIZE 58,70
00150 .SPACING 1
00200 .RIGHT MARGIN 70
00250 .TAB STOPS 5,8,10,63
00300 .FILL
00350 .JUSTIFY
00400 .SKIP 3
00450 .CENTRE
00500 ^^FASBOL II\\
00550 .SKIP2
00600 .CENTRE
00650 ^^A SNOBOL4 COMPILER FOR THE PDP-10\\
00700 .SKIP 1
00750 .CENTRE
00800 ^PAUL ^JOSEPH ^SANTOS, ^JR.
00850 .SKIP 1
00900 .CENTRE
00950 ^DEPARTMENT OF ^ELECTRICAL ^ENGINEERING AND ^COMPUTER ^SCIENCES
01000 .CENTRE
01050 AND THE ^ELECTRONICS ^RESEARCH ^LABORATORY
01100 .CENTRE
01150 ^UNIVERSITY OF ^CALIFORNIA, ^BERKELEY, ^CALIFORNIA 94720
01200 .SKIP 3
01250 .CENTRE
01300 ^^ABSTRACT\\
01350 .SKIP 2
01400 .INDENT 5
01450 ^THE ^^FASBOL II\\ COMPILER SYSTEM REPRESENTS A NEW
01500 APPROACH TO THE PROCESSING AND EXECUTION OF PROGRAMS
01550 WRITTEN IN THE ^^SNOBOL\\4 LANGUAGE.
01600 ^IN CONTRAST TO THE EXISTING INTERPRETIVE AND SEMI-INTERPRETIVE
01650 SYTEMS, THE ^^FASBOL\\ COMPILER PRODUCES
01700 INDEPENDENT, ASSEMBLY-LANGUAGE PROGRAMS. ^THESE
01750 PROGRAMS, WHEN ASSEMBLED, AND USING A SMALL RUN-TIME
01800 LIBRARY, EXECUTE MUCH FASTER THAN UNDER OTHER ^^SNOBOL4\\
01850 SYSTEMS.
01900 .SKIP 1
01950 .INDENT 5
02000 ^WHILE BEING ALMOST TOTALLY COMPATIBLE WITH ^^SNOBOL\\4,
02050 ^VERSION 3, ^^FASBOL\\ OFFERS THE SAME ADVANTAGES AS
02100 OTHER COMPILER SYSTEMS, SUCH AS:
02150 .INDENT 5
02200 .SKIP 1
02250
02300 1. ^UP TO TWO ORDERS OF MAGNITUDE DECREASE IN EXECUTION
02350 TIMES OVER INTERPRETIVE PROCESSING FOR MOST PROBLEMS.
02400 .INDENT 5
02450 .SKIP 1
02500 2. ^MUCH SMALLER STORAGE REQUIREMENTS AT EXECUTION
02550 TIME THAN IN-CORE SYSTEMS, PERMITTING EITHER SMALL
02600 PARTITIONS OR LARGE PROGRAMS.
02650 .INDENT 5
02700 .SKIP 1
02750 3. ^CAPABILITY OF INDEPENDENT COMPILATION OF DIFFERENT
02800 PROGRAM SEGMENTS, SIMPLIFYING PROGRAM STRUCTURE AND
02850 DEBUGGING.
02900 .INDENT 5
02950 .SKIP 1
03000 4. ^CAPABILITY OF INTERFACING WITH ^^FORTRAN\\ AND
03050 ^^MACRO\\ PROGRAMS, PROVIDING ANY DIVISION OF LABOR
03100 REQUIRED BY THE NATURE OF A PROBLEM.
03150 .INDENT 5
03200 .SKIP 1
03250 5. ^MEASUREMENT AND RUNTIME PARAMETER FACILITIES TO
03300 AID IN OPTIMIZING EXECUTION TIME AND/OR STORAGE
03350 UTILIZATION.
03400 .FOOTNOTE 5
03450 .SKIP 2
03500 .CENTRE
03550 - - - - - - - - - -
03600 ^RESEARCH SUPPORTED IN PART BY THE ^NATIONAL ^SCIENCE ^FOUNDATION,
03650 ^GRANT ^G^J-821.
03700 !
03750 .PAGE
03800 .SKIP3
03850 .CENTRE
03900 ^^TABLE OF CONTENTS\\
03950 .SKIP2
04000 .NOFILL
04050 ^CHAPTER ^PAGE
04100 .SKIP2
04150 .TAB STOPS 4,9,16,65
04200 1. ^INTRODUCTION 3
04250 .SKIP 1
04300 2. ^LANGUAGE ^DESCRIPTION 4
04350 2.1 ^GENERAL ^LANGUAGE ^FEATURES 4
04400 2.1.1 ^^SNOBOL\\4 FEATURES NOT IMPLEMENTED 4
04450 2.1.2 ^^SNOBOL\\4 FEATURES IMPLEMENTED DIFFERENTLY 5
04500 2.1.3 ^ADDITIONS TO ^^SNOBOL\\4 6
04550 2.2 ^DECLARATIONS 6
04600 2.2.1 ^^PURGE\\ AND ^^UNPURGE\\ 7
04650 2.2.2 ^^GLOBAL\\, ^^ENTRY\\, AND ^^EXTERNAL\\ 8
04700 2.2.3 ^TYPE DECLARATIONS 8
04750 2.2.4 ^OPTIONS 9
04800 2.2.5 ^OTHER DECLARATIONS 9
04850 2.3 ^CONTROL 10
04900 2.4 ^PREDEFINED PRIMITIVES 11
04950 2.4.1 ^PATTERN PRIMITIVES 11
05000 2.4.2 ^EXPRESSION PRIMITIVES 11
05050 2.4.3 ^^FORTRAN\\ PRIMITIVES 15
05100 2.5 ^KEYWORDS 15
05150 .SKIP1
05200 3. ^^FASBOL II\\ ^PROGRAMMING 17
05250 3.1 ^USING THE COMPILER AND RUNTIME LIBRARY 17
05300 3.2 ^PROGRAMMING TECHNIQUES 18
05350 3.2.1 ^DEDICATED EXPRESSIONS 18
05400 3.2.2 ^USE OF UNARY &? AND &. OPERATORS 19
05450 3.2.3 ^PATTERN MATCHING 21
05500 3.2.4 ^TIMING AND STORAGE MANAGEMENT 22
05550 3.2.5 ^^FORTRAN\\ INTERFACE 23
05600 .SKIP 1
05650 ^APPENDICES
05700 .SKIP 1
05750 ^^APPENDIX\\ 1 - ^SYNTAX FOR ^^FASBOL II\\ 26
05800 .SKIP 1
05850 ^^APPENDIX\\ 2 - ^PREDEFINED ^SYMBOLS 30
05900 .SKIP 1
05950 ^^APPENDIX\\ 3 - ^RUNTIME ^ERRORS 31
06000 .SKIP 1
06050 ^^REFERENCES\\ 32
06100
06150 .PAGE
06200 .FILL
06250 .JUSTIFY
06300 .SKIP2
06350 .CENTRE
06400 ^^CHAPTER 1\\
06450 .SKIP 1
06500 1. ^&^INTRODUCTION\&
06550 .SKIP 1
06600 .INDENT 5
06650 ^THE FIRST ^^FASBOL\\ [1] WAS A SIMILAR SYSTEM DESIGNED AND
06700 WRITTEN FOR THE ^^UNIVAC\\ 1108 UNDER THE ^^EXEC II\\ OPERATING
06750 SYSTEM, AND OPERATIONAL AS OF ^
06800 OCTOBER 1971. ^^FASBOL II\\, THE
06850 ^^PDP\\-10 SYSTEM , IS AN ENHANCED VERSION WHICH IS IN ADDITION
06900 COMPATIBLE WITH ^VERSION 3 OF ^^SNOBOL\\4. ^IT IS PRESUMED
06950 THAT THE READER IS FAMILIAR WITH ^^SNOBOL\\4, ^VERSION 3 AS DESCRIBED
07000 BY THE SECOND EDITION (1971) OF THE ^PRENTICE-^HALL PUBLICATION [2].
07050 ^USING [2] AS A BASE DESCRIPTION OF ^^SNOBOL\\4, THE FOLLOWING
07100 CHAPTERS EXPLAIN ANY DIFFERENCES AND ADDITIONS PRESENT IN ^^FASBOL II\\,
07150 AS WELL AS DESCRIBE HOW TO USE IT TO COMPILE AND RUN PROGRAMS.
07200 .SKIP 1
07250 .INDENT 5
07300 ^THE ^^FASBOL II\\ COMPILER IS ITSELF WRITTEN IN ^^FASBOL\\ AND IS
07350 LIKE ^^FORTRAN\\ AND ^^MACRO\\ IN THAT IT ACCEPTS SPECIFICATIONS
07400 FOR SOURCE, LISTING, AND OBJECT FILES (THE OBJECT IS A ^^MACRO\\
07450 PROGRAM WHICH MUST BE ASSEMBLED).
07500 ^THE REASON FOR WRITING THE COMPILER IN ^^FASBOL \\ WAS FOR
07550 SPEED OF IMPLEMENTATION, AUTOMATIC CHECKOUT OF THE RUN-TIME LIBRARY,
07600 AND EASE OF MODIFICATION.
07650 ^IF AFTER SOME USE THE COMPILER SHOULD PROVE TO BE UNSATISFACTORY
07700 IN TERMS OF CORE UTILIZATION OR EXECUTION SPEED, THE ^^MACRO\\
07750 STAGE CAN BE HAND-TAILORED, USING THE MEASUREMENT TECHNIQUES
07800 AVAILABLE IN ^^FASBOL\\, INTO A MORE EFFICIENT PROGRAM. ^A FURTHER
07850 ENHANCEMENT WOULD BE THE DIRECT PRODUCTION OF RELOCATABLE CODE
07900 BY A ONE-PASS COMPILER WRITTEN IN EITHER ^^FASBOL\\ OR ^^MACRO\\.
07950 .SKIP 1
08000 .INDENT 5
08050 ^THE ^^FASBOL II\\ RUN-TIME LIBRARY IS WRITTEN IN ^^MACRO\\, SINCE
08100 ITS EFFICIENCY IS PARAMOUNT, AND IS SEARCHED IN LIBRARY MODE,
08150 AFTER LOADING ALL ^^FASBOL\\ PROGRAMS, IN ORDER TO SATISFY PROGRAM
08200 REFERENCES TO PREDEFINED PRIMITIVES AND SYSTEM ROUTINES. ^SECTIONS
08250 OF THE ^^FORTRAN\\ LIBRARY MAY ALSO BE LOADED, PROVIDED THEY DO NOT
08300 COMPETE WITH ^^FASBOL\\ FOR ^^UUO\\'S AND TRAPS.
08350 .SKIP 1
08400 .INDENT 5
08450 ^INTERNAL DOCUMENTATION OF THE OPERATION OF THE RUN-TIME SYSTEM IS
08500 AVAILABLE AS A SEPARATE DOCUMENT.
08550 .SKIP 1
08600 .INDENT 5
08650 ^USE OF THE MALE GENDER IN THIRD-PERSON REFERENCES IN THIS MANUAL
08700 IN NO WAY IMPLIES THAT ^^FASBOL\\ IS NOT USEFUL FOR FEMALE PERSONS;
08750 THE AUTHOR IS SIMPLY NOT AWARE OF ANY EASY WAY TO WRITE IN NEUTER.
08800 .PAGE
08850 .SKIP 2
08900 .CENTRE
08950 ^^CHAPTER \\ 2
09000 .SKIP 1
09050 2. ^&^LANGUAGE ^DESCRIPTION\&
09100 .SKIP 1
09150 .INDENT 5
09200 ^THE SYNTAX FOR ^^FASBOL II\\ IS GIVEN IN ^APPENDIX 1. ^IN ADDITION
09250 TO THE DETAILED CHANGES MENTIONED BELOW, THIS SYNTAX DIFFERS FROM
09300 THAT GIVEN IN [2] ONLY IN THAT IT IS MORE RESTRICTIVE OF COMPILE-TIME
09350 SYNTAX. ^FOR EXAMPLE, SINCE ^^FASBOL II\\ DOES NOT PERMIT REDEFINITION
09400 OF OPERATORS, THE EXPRESSION
09450 .SKIP 2
09500 .NOFILL
09550 ( ^^A . B ) + ( C . D\\ )
09600 .SKIP 2
09650 .FILL
09700 .JUSTIFY
09750 IS FLAGGED AS A COMPILATION SYNTAX ERROR, WHEREAS THE INTERPRETER
09800 (I.E. THE SYSTEM DESCRIBED IN [2]) WOULD ACCEPT IT AND THEN PRODUCE
09850 AN "ILLEGAL TYPE" ERROR MESSAGE DURING EXECUTION. ^MOST ^^SNOBOL\\4
09900 PROGRAMS SHOULD RUN "AS IS" UNDER ^^FASBOL II\\; ^SECTIONS 2.1.1
09950 AND 2.1.2 DESCRIBE EXACTLY ALL FEATURES THAT MAY CAUSE INCOMPATIBILITY,
10000 AND THE REMAINING SECTIONS DEAL WITH ENHANCEMENTS .
10050 .SKIP 1
10100 2.1 ^&^GENERAL LANGUAGE FEATURES\&
10150 .SKIP 1
10200 .INDENT 5
10250 ^THE FOLLOWING THREE SECTIONS DISCUSS, RESPECTIVELY , FEATURES OF
10300 ^^SNOBOL\\4 NOT IMPLEMENTED IN ^^FASBOL II\\, FEATURES OF ^^SNOBOL\\4
10350 IMPLEMENTED DIFFERENTLY IN ^^FASBOL II\\, AND ADDITIONAL FEATURES
10400 AVAILABLE IN ^^FASBOL II\\ AND DESCRIBED MORE COMPLETELY IN SECTIONS
10450 2.2, 2.3, 2.4, AND 2.5.
10500 .SKIP 1
10550 2.1.1 ^&^^SNOBOL\\4 FEATURES NOT IMPLEMENTED\&
10600 .INDENT 5
10650 .SKIP 1
10700 ^THE PREDEFINED PRIMITIVES ^^EVAL\\ AND ^^CODE\\, THE DATATYPES ^^CODE\\
10750 AND ^^EXPRESSION\\, AND DIRECT GOTOS (AS USED WITH ^^CODE\\) ARE
10800 NOT IMPLEMENTED. ^THEY IMPLY A RUN-TIME COMPILATION CAPABILITY WHICH
10850 IS NOT AVAILABLE IN THE ^^FASBOL\\ LIBRARY AT THIS TIME.
10900 .SKIP 1
10950 .INDENT 5
11000 ^THE REDEFINITION OF OPERATORS VIA ^^OPSYN\\, OR THE REDEFINITION
11050 OF PREDEFINED PRIMITIVE PATTERN VARIABLES (E.G. ^^ARB\\) OR
11100 FUNCTIONS (E.G. ^^SPAN\\) IS NOT PERMITTED IN ^^FASBOL\\, WHICH
11150 CONSIDERS ALL THESE ITEMS AS A STRUCTURAL PART OF THE LANGUAGE ESSENTIAL
11200 TO GENERATING EFFICIENT CODE. ^FOR THIS REASON, THE KEYWORDS
11250 ^^_&ARB\, _&BAL\, _&FAIL\, _&FENCE\, _&REM\\ AND _&^^SUCCEED\\
11300 ARE NOT NEEDED AND THEREFORE NOT IMPLEMENTED. ^ALSO, ^^_&CODE\\
11350 HAS NO MEANING FOR THE ^^PDP\\-10, AND IS NOT AVAILABLE EITHER.
11400 .SKIP 1
11450 .INDENT 5
11500 ^THE ^^SNOBOL\\4 TRACING CAPABILITY IS NOT IMPLEMENTED IN ^^FASBOL\\
11550 AT THIS TIME. ^HOWEVER, THE _&^^STNTRACE\\ KEYWORD (SEE SECTION 2.5)
11600 PROVIDES SOME TRACING CAPABILITY.
11650
11700 .SKIP 1
11750 .INDENT 5
11800 ^ALTHOUGH ^^QUICKSCAN\\ MODE FOR PATTERN MATCHING IS IMPLEMENTED IN ^^FASBOL\\, TWO
11850 FEATURES OF THIS MODE, AVAILABLE IN ^^SNOBOL\\4, ARE NOT
11900 IMPLEMENTED. ^THEY ARE A)CONTINUAL COMPARISON OF THE
11950 NUMBER OF CHARACTERS REMAINING IN THE SUBJECT STRING AGAINST THE
12000 NUMBER OF CHARACTERS REQUIRED BY NON-STRING-VALUED PATTERNS, AND
12050 B) ASSUMPTION THAT UNEVALUATED EXPRESSIONS MUST MATCH AT LEAST ONE
12100 CHARACTER. ^THIS IMPLIES THAT SOME MATCHES MAY LAST A LITTLE
12150 LONGER AND PERHAPS HAVE A FEW MORE SIDE-EFFECTS (E.G. VIA $),
12200 AND THAT LEFT-RECURSIVE PATTERN DEFINITIONS WILL LOOP INDEFINITELY
12250 (SEE ^SECTION 3.2.3).
12300 .SKIP 1
12350 2.1.2 ^&^^SNOBOL\\4 FEATURES IMPLEMENTED DIFFERENTLY\&
12400 .SKIP 1
12450 .INDENT 5
12500 ^THE ^^FASBOL\\ ^I/^O STRUCTURE IS TIME-SHARING ORIENTED AND
12550 DOES NOT USE ^^FORTRAN\\ ^I/^O, SO THAT IT DIFFERS SOMEWHAT FROM
12600 THE ^^SNOBOL\\4 ^I/^O. ^BOTH INPUT AND OUTPUT CAN BE EITHER IN LINE
12650 OR CHARACTER MODE. ^LINE MODE IS SIMILAR TO ^^SNOBOL\\4 ^I/^O, WITH
12700 INPUT RECORDS BEING TERMINATED JUST PRIOR TO A CARRIAGE RETURN,
12750 LINE FEED SEQUENCE, AND WITH THIS SEQUENCE BEING ADDED TO OUTPUT
12800 RECORDS. ^TRAILING BLANKS SELDOM OCCUR ON INPUT, AND SO THE
12850 _&^^TRIM\\ KEYWORD IS NOT IMPLEMENTED (BUT THE ^^TRIM\\ FUNCTION IS).
12900 ^CHARACTER MODE GETS ONE CHARACTER (INCLUDING A CARRIAGE RETURN OR LINEFEED)
12950 ON INPUT, AND OUTPUTS A STRING WITHOUT APPENDING A CARRIAGE
13000 RETURN, LINEFEED SEQUENCE TO IT. ^^INPUT\, INPUTC\, OUTPUT\\
13050 AND ^^OUTPUTC\\ HAVE PREDEFINED ASSOCIATIONS (SEE 2.4.2, ^I/^O
13100 PRIMITIVES) CORRESPONDING TO LINE AND CHARACTER MODE TELETYPE INPUT
13150 AND OUTPUT, RESPECTIVELY. ^^PUNCH\\ DOES NOT HAVE A PREDEFINED
13200 ASSOCIATION. ^THERE ARE ADDITIONAL PREDEFINED PRIMITIVES FOR
13250 DEVICE AND FILE SELECTION, ETC., DISCUSSED IN ^SECTION 2.4.2.
13300 .SKIP 1
13350 ^CHANGES IN PROGRAM SYNTAX ARE AS FOLLOWS:
13400 .INDENT 5
13450 .SKIP 1
13500 A) ^COMPILER GENERATED STATEMENT NUMBERS ARE ALWAYS ON THE LEFT.
13550 .INDENT 5
13600 .SKIP 1
13650 B) ^SOURCE LINES ARE ALWAYS TRUNCATED AFTER 72 CHARACTERS.
13700 .INDENT 5
13750 .SKIP 1
13800 C) ^THE CHARACTER CODES AND EXTENDED SYNTAX ARE LIKE THE ^S/360
13850 VERSION, EXCEPT THE CHARACTER ! (EXCLAMATION POINT) REPLACES
13900 | (VERTICAL STROKE) AND _\ (BACK SLASH) REPLACES _\ (NOT SIGN).
13950 .INDENT 5
14000 .SKIP 1
14050 D) ^BINARY $ AND . (IMMEDIATE AND CONDITIONAL PATTERN ASSIGNMENT)
14100 HAVE LOWER PRECEDENCE THAN THE BINARY ARITHMETIC OPERATORS, BUT HIGHER
14150 PRECEDENCE THAN CONCATENATION. ^THUS, THE EXPRESSION
14200 .SKIP 2
14250 .NOFILL
14300 ^^X A\\ + ^B $ ^C
14350 .SKIP 2
14400 IS TAKEN TO MEAN
14450 .SKIP 2
14500 ^X ((^A + ^B) $ ^C)
14550 .SKIP 2
14600 .FILL
14650 .JUSTIFY
14700 .INDENT 5
14750 ^IN ^^SNOBOL\\4, $ AND . HAVE THE HIGHEST PRECEDENCE OF ALL BINARY
14800 OPERATORS, AND WOULD GIVE THE MEANING
14850 .SKIP 2
14900 .NOFILL
14950 ^X (^A + (^B $ ^C))
15000 .SKIP 2
15050 .FILL
15100 .JUSTIFY
15150 TO THE ABOVE EXPRESSION.
15200 .SKIP 1
15250 ^CHANGES IN PROGRAM SEMANTICS AND OPERATION ARE AS FOLLOWS:
15300 .INDENT 5
15350 .SKIP 1
15400 A) ^THE BINARY . (NAME) OPERATOR ALWAYS RETURNS A VALUE OF TYPE
15450 ^^NAME \(SNOBOL\\4 SOMETIMES RETURNS A ^^STRING\\). ^INDIRECTION
15500 (UNARY $) APPLIED TO A VALUE OF TYPE ^^NAME\\ RETURNS THE SAME AS VALUE.
15550 ^NAMES OF ^^TABLE \\ ENTRIES ARE PERMITTED.
15600 .INDENT 5
15650 .SKIP 1
15700 B) ^SOME PREDEFINED PRIMITIVE FUNCTIONS OPERATE DIFFERENTLY
15750 THAN IN ^^SNOBOL\\4 (SEE ^SECTION 2.4.2).
15800 .INDENT 5
15850 .SKIP 1
15900 C) _&^^MAXLNGTH\\ IS INITIALLY SET TO 262143 (IN ^^ SNOBOL\\4, THE
15950 VALUE IS 5000). ^THIS VALUE IS ALSO THE ABSOLUTE UPPER LIMIT ON STRING
16000 SIZE.
16050 .INDENT 5
16100 .SKIP 1
16150 D) ^IF _&^^ABEND\\ IS NONZERO AT PROGRAM TERMINATION, AN ABNORMAL
16200 (^^EXIT \\ 1,) EXIT TO THE SYSTEM IS TAKEN.
16250 .INDENT 5
16300 .SKIP 1
16350 E) ^PRIMITIVE FUNCTIONS MAY BE CALLED WITH EITHER TOO FEW OR TOO
16400 MANY ARGUMENTS, EVEN VIA ^^OPSYN\\ OR ^^APPLY\\.
16450 .SKIP 1
16500 2.1.3 ^&^ADDITIONS TO ^^SNOBOL\\4\&
16550 .SKIP 1
16600 .INDENT 5
16650 ^DECLARATIONS ARE PROVIDED IN ^^FASBOL\\ FOR THE ENHANCEMENT OF
16700 PROGRAMS. ^NO DECLARATIONS ARE EVER REQUIRED, BUT IF THEY ARE
16750 USED THEY MUST ALL PRECEDE THE FIRST EXECUTABLE STATEMENT IN A
16800 PROGRAM.
16850 ^DECLARATIONS ARE DESCRIBED IN ^SECTION 2.2.
16900 .SKIP 1
16950 .INDENT 5
17000 ^ADDITIONAL CONTROL CARDS AND COMPILATION FEATURES ARE AVAILABLE,
17050 DISCUSSED IN ^SECTION 2.3, AND ADDITIONAL PREDEFINED PRIMITIVE
17100 FUNCTIONS AND KEYWORDS ARE DESCRIBED RESPECTIVELY IN ^SECTION 2.4
17150 AND 2.5.
17200 .SKIP 1
17250 ^ADDITIONS TO PROGRAM SYNTAX ARE AS FOLLOWS:
17300 .INDENT 5
17350 .SKIP 1
17400 A) ^QUOTED STRINGS MAY BE CONTINUED ONTO A NEW LINE, WITH THE
17450 CONTINUATION CHARACTER REMOVED FROM THE LITERAL.
17500 .INDENT 5
17550 .SKIP 1
17600 B) ^SINGLE AND DOUBLE QUOTES MAY BE INCLUDED IN A LITERAL THAT
17650 IS BRACKETED BY THE SAME, BY USE OF THE CONSTRUCTION '' TO STAND FOR
17700 ' AND "" TO STAND FOR " INSIDE OF LITERALS BRACKETED BY ' AND ",
17750 RESPECTIVELY.
17800 .INDENT 5
17850 .SKIP 1
17900 C) ^COMMENT AND CONTROL LINES (I.E. STARTING WITH * OR -) MAY
17950 START INSIDE A LINE IMAGE (I.E. AFTER A ;), AND CONSUME
18000 THE REMAINDER OF THE LINE IMAGE.
18050 .INDENT 5
18100 .SKIP 1
18150 D) ^THE RUN-TIME SYNTAX FOR ^^DEFINE\\ AND ^^DATA\\ PROTOTYPES
18200 HAS BEEN LOOSENED TO CONFORM WITH THE REST OF ^^FASBOL\\ SYNTAX
18250 BY PERMITTING BLANKS AND TABS AFTER &( (OPEN PARENTHESIS),
18300 AROUND &, (COMMA), AND BEFORE &) (CLOSE
18350 PARENTHESIS).
18400 .SKIP 1
18450 2.2 ^&^DECLARATIONS\&^
18500 .SKIP 1
18550 .INDENT5
18600 ^^FASBOL\\ DECLARATIONS HAVE TWO PRIMARY PURPOSES. ^ONE PURPOSE
18650 IS TO OPTIMIZE A PROGRAM IN SPACE AND/OR TIME. ^THE SECOND
18700 PURPOSE IS TO ALLOW INTER-PROGRAM LINKAGE AND COMMUNICATION. ^THE
18750 GENERAL FORM OF A DECLARATION IS A CALL ON THE PSEUDOFUNCTION ^^DECLARE\\,
18800 WITH TWO OR THREE ARGUMENTS, THE FIRST OF WHICH IS ALWAYS A STRING
18850 LITERAL IDENTIFYING THE TYPE OF DECLARATION,
18900
18950 AND THE REMAINING ARGUMENTS SPECIFYING THE PARAMETERS OR PROGRAM
19000 SYMBOLS UPON WHICH THE DECLARATION HAS EFFECT. ^AS HAS BEEN NOTED,
19050 ALL DECLARATIONS MUST PRECEDE THE FIRST EXECUTABLE STATEMENT; THIS
19100 ALSO IMPLIES NO DECLARATION LINE MAY CONTAIN A LABEL. ^^A FASBOL\\
19150 PROGRAM WITH DECLARATIONS CAN BE MADE OTHERWISE COMPATIBLE WITH A
19200 ^^SNOBOL\\4 INTERPRETER BY INSERTING THE STATEMENT
19250 .SKIP 2
19300 .NOFILL
19350 ^^DEFINE\\('^^DECLARE\\()', '^^RETURN\\')
19400 .SKIP 2
19450 .FILL
19500 .JUSTIFY
19550 AT THE BEGINNING OF THE PROGRAM.
19600 .SKIP 1
19650 2.2.1 ^&^^PURGE\\ AND ^^UNPURGE\\\&
19700 .SKIP 1
19750 .INDENT 5
19800 ^NORMALLY, A ^^FASBOL\\ APPLICATION WILL INVOLVE A MAIN PROGRAM
19850 AND SEVERAL INDEPENDENTLY COMPILED SUBROUTINES. ^DURING EXECUTION, THE
19900 RUN-TIME SYSTEM MAINTAINS A RUN-TIME SYMBOL TABLE FOR EACH SEPARATELY
19950 COMPILED PROGRAM, AS WELL AS A GLOBAL SYMBOL TABLE. ^IN
20000 THE ABSENCE OF DECLARATIONS TO THE CONTRARY, ALL EXPLICITLY
20050 MENTIONED VARIABLES, LABELS, AND FUNCTIONS ARE PUT INTO THE
20100 LOCAL SYMBOL TABLE FOR THAT PROGRAM. ^THUS,
20150 PROGRAM ^X AND PROGRAM ^Y MAY BOTH HAVE LABELS ^^LAB\\ TO WHICH THEY
20200 PERFORM INDIRECT GOTOS. ^THE GLOBAL SYMBOL TABLE CONTAINS SUCH
20250 GLOBAL SYMBOLS AS ^^OUTPUT\\ AND ^^RETURN\\, AND ANY NEW SYMBOLS
20300 THAT ARISE DURING EXECUTION OF ANY OF THE PROGRAMS. ^A SYMBOL LOOKUP
20350 IN PROGRAM ^X FIRST SEARCHES THE LOCAL SYMBOL TABLE FOR PROGRAM ^X,
20400 THEN THE GLOBAL SYMBOL TABLE, AND THEN, IF STILL NOT FOUND, CREATES
20450 A NEW ENTRY IN THE GLOBAL SYMBOL TABLE. ^THUS A LOCAL SYMBOL
20500 TABLE NEVER GROWS BEYOND THE SIZE DETERMINED FOR IT AT COMPILATION
20550 TIME.
20600 .SKIP 1
20650 .INDENT 5
20700 ^THE PURPOSE OF THE ^^PURGE\\.^^VARIABLE\, PURGE\.LABEL\, \A\N\D
20750 PURGE\.FUNCTION\\ DECLARATIONS IS TO ELIMINATE SYMBOLS FROM THE LOCAL
20800 SYMBOL TABLE AND THUS CONSERVE SPACE. ^THIS CAN BE SAFELY DONE FOR
20850 LABELS PROVIDED THAT THE LABEL IS NEVER REFERENCED INDIRECTLY ($ GOTO),
20900 OR EXPLICITLY AND/OR IMPLICITLY IN A ^^DEFINE\\ CALL. ^A
20950 SIMILAR CRITERION APPLIES TO SAFELY ELIMINATING VARIABLES, ONLY THE
21000 NUMBER OF CASES TO WATCH FOR IS GREATER; ANY SITUATION THAT
21050 REQUIRES AN ASSOCIATION BETWEEN THE STRING REPRESENTING THE VARIABLE
21100 NAME, AND THE ACTUAL LOCATION ASSIGNED TO THAT VARIABLE, IS SUCH
21150 A CASE. ^FOR EXAMPLE, THE STATEMENT
21200 .SKIP 2
21250 .NOFILL
21300 ^^INPUT\\('^^VARB',0,60)\\
21350 .SKIP 2
21400 .FILL
21450 .JUSTIFY
21500 IMPLIES THAT THE VARIABLE ^^VARB\\, IF IT IS MENTIONED EXPLICITLY
21550 IN THE PROGRAM AND THUS ASSIGNED A LOCATION, MUST BE IN
21600 THE RUN-TIME SYMBOL TABLE. ^AN EXPLICIT REFERENCE TO ^^VARB\\
21650 WOULD BE, FOR EXAMPLE,
21700 .SKIP 2
21750 .NOFILL
21800 ^^TTYLIN\\ = ^^VARB\\
21850 .SKIP 2
21900 .FILL
21950 .JUSTIFY
22000 ^ON THE OTHER HAND, A VARIABLE THAT IS NEVER REFERENCED EXPLICITLY
22050 NEED NOT BE IN THE LOCAL SYMBOL TABLE, BUT THE FIRST SYMBOL
22100 LOOKUP FOR IT WILL CREATE AN ENTRY FOR IT IN THE GLOBAL SYMBOL TABLE.
22150 ^IN THE CASE OF FUNCTIONS, THE ONLY SYMBOLS THAT CAN BE SAFELY
22200 PURGED ARE THE ONES CORRESPONDING TO PREDEFINED PRIMITIVES, SINCE
22250 ALL OTHERS ARE NEEDED TO BE ABLE TO DEFINE THE USER FUNCTIONS, VIA
22300 ^^DEFINE\\ OR OTHERWISE.
22350 .SKIP 1
22400 .INDENT 5
22450 ^WHEN THERE APPEAR TO BE MORE SYMBOLS OF A GIVEN TYPE TO BE PURGED
22500 THAN LEFT IN THE SYMBOL TABLE, THE SECOND ARGUMENT TO THE DECLARATION
22550 CAN BE THE PSEUDOVARIABLE ^^ALL\\; THEN, THE ^^UNPURGE\.VARIABLE\,
22600 UNPURGE\.LABEL\\ OR ^^UNPURGE\.FUNCTION\\ DECLARATIONS CAN BE USED
22650 TO PLACE SPECIFIC SYMBOLS INTO THE SYMBOL TABLE.
22700 .SKIP 1
22750 2.2.2 ^&^^GLOBAL, ENTRY\\, AND ^^EXTERNAL\\\&
22800 .SKIP 1
22850 .INDENT 5
22900 ^THESE DECLARATIONS PERMIT INTERPROGRAM COMMUNICATION ON AN INDIRECT
22950 (I.E. SYMBOL LOOKUP) AND/OR DIRECT (I.E. LOADER LINKING) BASIS.
23000 ^THE ^^GLOBAL\.LABEL\, GLOBAL\.VARIABLE\, \A\N\D GLOBAL\.FUNCTION\\
23050 DECLARATIONS OVERRIDE
23100 ^^PURGE\/UNPURGE\\ AND CAUSE THE SPECIFIED SYMBOLS TO BE PLACED IN
23150 THE GLOBAL SYMBOL TABLE INSTEAD OF THE LOCAL ONE. ^ONLY ONE SUBPROGRAM
23200 MAY GLOBALIZE A PARTICULAR SYMBOL, SINCE THE IMPLICATION IS THAT THE
23250 VARIABLE, LABEL, OR FUNCTION BELONGS TO THAT PROGRAM. ^ANY OTHER
23300 PROGRAM THAT DOES NOT HAVE A SIMILAR SYMBOL IN ITS LOCAL SYMBOL
23350 TABLE WILL THEN BE ABLE TO REFERENCE THE GLOBAL SYMBOL.
23400 .SKIP 1
23450 .INDENT 5
23500 ^WHILE ^^GLOBAL\\ PROVIDES FOR INTERPROGRAM COMMUNICATION
23550 VIA THE SYMBOL TABLE, THE ^^ENTRY\/EXTERNAL\\ DECLARATIONS PROVIDE
23600 FOR MORE DIRECT INTERPROGRAM COMMUNICATION BY USING THE LINKING LOADER
23650 TO CONNECT EXTERNAL REFERENCES. ^THE ^^ENTRY\.VARIABLE\, ENTRY\.LABEL\,
23700 \A\N\D ENTRY\.FUNCTION\\ DECLARATIONS MAKE THE SPECIFIED LOCAL ENTITIES
23750 ACCESSIBLE TO EXTERNAL PROGRAMS. ^THE SECOND AND THIRD ARGUMENTS TO THE
23800 ^^ENTRY\.FUNCTION\\ DECLARATION ARE LIKE THE ARGUMENTS TO
23850 ^^DEFINE\\, AND THE FUNCTION IS AUTOMATICALLY ^^DEFINED\\ THE FIRST
23900 TIME IT IS CALLED, SO NO EXTRA ^^DEFINE\\
23950 IS NECESSARY. ^THE
24000 ^^ENTRY\.FORTRAN\.FUNCTION\\ DECLARATION IS SIMILAR TO ^^ENTRY\.FUNCTION\\
24050 EXCEPT THAT THE COMPILER ASSUMES THE ENTRY WILL BE CALLED BY A
24100 ^^FORTRAN\\ PROGRAM. ^ANY COMBINATION OF ^^FASBOL\, FORTRAN\\,
24150 AND ^^MACRO\\ PROGRAMS IS PERMITTED, PROVIDED THE MAIN PROGRAM IS ^^
24200 FASBOL\\, AND CERTAIN RESTRICTIONS ON ^^FORTRAN\\ CODE (SEE ^SECTION
24250 3.2.5) ARE OBSERVED.
24300 .SKIP 1
24350 .INDENT 5
24400 ^THE ^^EXTERNAL\.VARIABLE\, EXTERNAL\.LABEL\, EXTERNAL\.FUNCTION\\,
24450 AND ^^EXTERNAL\.FORTRAN\.FUNCTION\\ DECLARATIONS ARE THE CONVERSE
24500 OF THE ^^ENTRY\\ DECLARATIONS, AND IMPLY THAT THE SPECIFIED ENTITIES
24550 BE OUTSIDE THE PROGRAM. ^THE ^^EXTERNAL\.FORTRAN\.FUNCTION\\
24600 DECLARATION HAS A SPECIAL FORM FOR ITS PARAMETER LIST (SECOND ARGUMENT)
24650 WHERE THE NUMBER OF ARGUMENTS EXPECTED BY EACH FUNCTION IS GIVEN IN
24700 PARENTHESIS. ^THE FUNCTION VALUE TYPE IS EITHER DECLARED IMPLICITLY
24750 (FIRST CHARACTER = ^I,^J,^K,^L,^M,^N, MEANS INTEGER,
24800 OTHERWISE REAL), OR EXPLICITLY BY APPENDING =^^INTEGER\\ OR
24850 =^^REAL\\ TO THE FUNCTION VALUE, BEFORE THE ARGUMENT SPECIFICATION.
24900 .SKIP 1
24950 2.2.3 ^&^TYPE DECLARATIONS\&
25000 .SKIP 1
25050 .INDENT 5
25100 ^NORMALLY, ^^FASBOL\\ VARIABLES MAY CONTAIN DATA OF ANY TYPE,
25150 REFERRED TO HERE AS ^&DESCRIPTOR\& ^&MODE\& ^&VARIABLES\&. ^SOMETIMES IT IS
25200 KNOWN IN ADVANCE THAT CERTAIN VARIABLES WILL ALWAYS
25250 TAKE ON VALUES THAT ARE INTEGERS OR REALS; IN THIS CASE IT BECOMES
25300 ADVANTAGEOUS TO DECLARE THEM ^^INTEGER\\ OR ^^REAL\\. ^IN ADDITION
25350 TO THE EXECUTION SPEED ADVANTAGES (SEE ^SECTION 3.2.1), THEY CAN
25400 BE PASSED TO ^^FORTRAN\\ DIRECTLY IN FUNCTION CALLS. ^ALSO, THE
25450 ONLY WAY TO PASS A STRING (OTHER THAN A LITERAL) TO ^^FORTRAN\\
25500 IS TO USE A VARIABLE DECLARED TO BE ^^STRING\\, WHICH IS THE ONLY
25550 REAL USE FOR THAT DECLARATION; A FIXED AMOUNT OF STORAGE IS
25600 ALLOCATED FOR THE VARIABLE BASED ON THE MAX CHARACTER COUNT GIVEN
25650 IN PARENTHESIS AFTER EACH NAME IN THE PARAMETER LIST (SECOND ARGUMENT).
25700 ^THE ONLY RESTRICTIONS ON THESE VARIABLES, REFERRED TO HERE AS ^&DEDICATED\&
25750 ^&MODE\& ^&VARIABLES\&, IS THAT THEY MAY NOT HAVE ^I/^O ASSOCIATIONS.
25800 ^ALL KEYWORDS (EXCEPT FOR ^^_&RTNTYPE\\ AND ^^_&ALPHABET\\) ARE
25850 TREATED AS DEDICATED INTEGERS.
25900 .SKIP 1
25950 2.2.4 ^&^OPTIONS\&
26000 .SKIP 1
26050 .INDENT 5
26100 ^THE ^^OPTION\\ DECLARATION SERVES TO SPECIFY VARIOUS COMPILATION
26150 OPTIONS. ^THE ^^HASHSIZE\\=N OPTION, IGNORED IN ALL BUT THE
26200 MAIN PROGRAM, IS USED TO CAUSE A LARGER OR SMALLER THAN
26250 NORMAL HASH BUCKET TABLE TO BE ALLOCATED FOR USE BY THE RUN-TIME
26300 SYMBOL TABLE. ^THE NUMBER N SHOULD BE A PRIME AND REPRESENTS THE NUMBER
26350 OF BUCKETS IN A LINKED HASH TABLE; THE STANDARD VALUE IS 127. ^THIS
26400 BUCKET TABLE IS AT THE CENTER OF ALL SYMBOL LOOKUPS IN THE
26450 RUNTIME SYSTEM, INCLUDING ^^TABLE\\ REFERENCES, SO THAT THERE
26500 IS A DISTINCT TRADEOFF BETWEEN THE SPARSITY OF THE TABLE
26550 AND THE TIME REQUIRED FOR A LOOKUP.
26600 .SKIP 1
26650 .INDENT 5
26700 ^THE ^^NO\.STNO\\ OPTION CAUSES
26750 THE COMPILER TO ELIMINATE THE NORMAL BOOKKEEPING ON ^^_&STNO\, _&STCOUNT\\,
26800 ETC. THAT OCCURS EACH TIME A STATEMENT IS ENTERED, AND IS HELPFUL
26850 TO SPEED UP SLIGHTLY THE EXECUTION OF DEBUGGED PROGRAMS.
26900 .SKIP 1
26950 .INDENT 5
27000 ^THE
27050 ^^TIMER\\ OPTION, WHICH IS INCOMPATIBLE WITH ^^NO\.STNO\\
27100 IN THE SAME PROGRAM, ADDS TO THE NORMAL BOOKKEEPING A
27150 VALUABLE STATEMENT TIMING FEATURE (SEE ^SECTION 3.2.4). ^THE
27200 TIMING STATISTICS ON EACH PROGRAM BEING TIMED ARE PRINTED OUT AT
27250 THE END OF EXECUTION, AND INTERMEDIATE TIMING STATISTICS CAN BE
27300 PRINTED OUT DURING EXECUTION BY USING THE PRIMITIVE ^^EXTIME\\
27350 (SEE ^SECTION 2.4.2).
27400 .SKIP 1
27450 2.2.5 ^&^OTHER DECLARATIONS\&
27500 .SKIP 1
27550 .INDENT 5
27600 ^THE ^^SNOBOL\.MAIN\\ AND ^^SNOBOL\.SUBPROGRAM\\ DECLARATIONS
27650 INDICATE WHETHER THE PROGRAM IS A MAIN PROGRAM OR A SUBPROGRAM,
27700 AND GIVES IT A NAME (I.E. ^^TITLE\\ IN ^^MACRO\\). ^IN THE ABSENCE
27750 OF EITHER DECLARATION,
27800 .SKIP 2
27850 .NOFILL
27900 ^^DECLARE\(\'SNOBOL\.MAIN\'\, \'\.MAIN\\.')
27950 .SKIP 2
28000 .FILL
28050 .JUSTIFY
28100 IS ASSUMED.
28150 .SKIP1
28200 .INDENT 5
28250 ^THE ^^RENAME\\ DECLARATION IS USED PRIMARILY TO
28300 RENAME PREDEFINED SYMBOLS (SEE ^APPENDIX 2) THAT WOULD OTHERWISE CONFLICT
28350 WITH A GIVEN USER'S. ^FOR EXAMPLE, IF A USER WISHED TO HAVE A
28400 VARIABLE CALLED ^^ARB\\, OR HIS OWN ^^IDENT\\ FUNCTION
28450 WHILE RETAINING THE PRIMITIVE ALSO, HE SHOULD RENAME THEM SOME
28500 OTHER NAMES. ^ON THE OTHER HAND, IF A USER WANTS TO RE-DEFINE
28550 ^^IDENT\\, FOR EXAMPLE, NO ^^RENAME\\ SHOULD BE USED, AND ^^IDENT\\
28600 WILL BECOME REDEFINED WHEN HIS OWN ^^DEFINE\\ IS EXECUTED.
28650 .SKIP 1
28700 .INDENT 5
28750 ^ALTHOUGH USUALLY THE ORDER IN WHICH DECLARATIONS OCCUR IS NOT
28800 IMPORTANT, ALL ^^PURGE\.X\,
28850 ALL\\ DECLARATIONS SHOULD PRECEDE OTHERS WHICH ALSO REFER TO
28900 ENTITIES DESIRED TO BE PURGED. ^FOR EXAMPLE, THE SEQUENCE
28950 .SKIP 2
29000 .NOFILL
29050 ^^DECLARE\('ENTRY\.VARIABLE\'\, \'A\,B\,C\'\)
29100 .SKIP 1
29150 ^^DECLARE\(\'PURGE\.VARIABLE\'\, ALL\)\\
29200 .SKIP 2
29250 .FILL
29300 .JUSTIFY
29350 WILL CAUSE THE VARIABLES ^A, ^B AND ^C TO BE MISSED AND INCLUDED
29400 IN THE SYMBOL TABLE, SINCE THE PURGE FLAG ONLY HAS EFFECT ON NEW
29450 SYMBOLS.
29500 .SKIP 1
29550 .INDENT 5
29600 ^IT SHOULD ALSO BE NOTED THAT WHEREAS THE SYNTAX OF VARIABLE AND
29650 FUNCTION NAME LISTS USES A COMMA AS A SEPARATOR, LABEL LISTS
29700 ARE SEPARATED BY BLANKS. ^THE REASON FOR THIS IS THAT THE SYNATX
29750 FOR LABELS INCLUDES COMMAS, BUT A BLANK IS A VALID LABEL TERMINATOR.
29800 ^ALSO, ALL QUOTED STRINGS IN DECLARATIONS ARE DELIMITED BY
29850 SINGLE QUOTES. ^A SINGLE QUOTE MAY BE ENTERED INSIDE SUCH A STRING
29900 (FOR EXAMPLE, IN A LABEL) BY USING THE '' CONVENTION MENTIONED IN
29950 ^SECTION 2.1.3.
30000 .SKIP 1
30050 2.3 ^&^CONTROL\&
30100 .SKIP 1
30150 .INDENT 5
30200 ^IN ^^FASBOL\\ THERE IS AN EXPANDED REPERTOIRE OF CONTROL CARDS
30250 FOR CONTROLLING LISTING, CROSS-REFERENCING, AND FAILURE PROTECTION.
30300 ^IN THE FOLLOWING LIST, THE FIRST OF A PAIR CONTROLLING A SWITCH
30350 IS THE INITIAL MODE.
30400 .SKIP 2
30450 .LEFT MARGIN 20
30500 .INDENT -20
30550 ^^LIST,#UNLIST\\########TURNS PROGRAM LISTING ON,OFF.
30600 .SKIP 1
30650 .INDENT -20
30700 ^^NOCODE,#CODE\\########TURNS OBJECT LISTING OFF, ON (THE GENERATION
30750 OF OBJECT CODE CAN BE INHIBITED BY NOT SPECIFYING
30800 AN OBJECT).
30850 .SKIP 1
30900 .INDENT -20
30950 ^^EJECT\\###############CAUSES A PAGE EJECT (FORM FEED).
31000 .SKIP 1
31050 .INDENT -20
31100 ^^SPACE\\#N#############SPACES N LINES (OR 1 LINE IF N IS ABSENT).
31150 .SKIP 1
31200 .INDENT -20
31250 ^^NOCROSS,#CROSREF\\####TURNS SYMBOL CROSS-REFERENCING OFF, ON. ^THIS
31300 CAN BE DONE FOR A WHOLE PROGRAM OR SELECTIVELY FOR
31350 PARTS OF IT.
31400 .SKIP 1
31450 .INDENT -20
31500 ^^FAIL,#NOFAIL*\\#######TURNS OFF A COMPILER FEATURE THAT TRAPS
31550 .FOOTNOTE 6
31600 .SKIP 1
31650 .CENTER
31700 - - - - - - - - - - -
31750 *^CREDIT FOR THIS IDEA GOES TO THE AUTHORS OF ^^SPITBOL\\ [3],
31800 WHO ALSO INSPIRED THE INCLUSION OF ^^DUPL\\, ^^LPAD\\, ^^RPAD\\, AND ^^REVERS\\.
31850 !
31900 UNEXPECTED STATEMENT FAILURES. ^WHEN THE FEATURE IS
31950 ON (^^NOFAIL\\), ANY STATEMENT WITHIN ITS SCOPE THAT
32000 DOES NOT HAVE A CONDITIONAL ^^GOTO\\, AND WHICH FAILS,
32050 WILL CAUSE AN ERROR EXIT. ^AN UNCONDITIONAL ^^GOTO\\ IS
32100 EQUIVALENT TO NONE AT ALL, AND WILL BE TRAPPED IF THE
32150 STATEMENT FAILS.
32200 .SKIP 1
32250 .LEFT MARGIN 0
32300 2.4 ^&^PREDEFINED PRIMITIVES\&
32350 .SKIP 1
32400 .INDENT 5
32450 ^IN THE FOLLOWING SECTIONS, ONLY THOSE PRIMITIVES WHICH DIFFER FROM
32500 ^^SNOBOL\\4 OR ARE NEW IN ^^FASBOL\\ WILL BE DISCUSSED. ^APPENDIX
32550 2 HAS A COMPLETE LIST OF PRIMITIVES AVAILABLE IN ^^FASBOL\\.
32600 .SKIP 1
32650 2.4.1 ^&^PATTERN PRIMITIVES\&
32700 .SKIP 1
32750 .INDENT 5
32800 ^THREE NEW PRIMITIVES IN THE ^^SPAN\/BREAK\\ CLASS HAVE BEEN ADDED;
32850 THESE ARE STRUCTURAL, LIKE THE OTHER PATTERN PRIMITIVES, AND CANNOT BE
32900 REDEFINED.
32950 .SKIP 2
33000 .LEFT MARGIN 20
33050 .INDENT -20
33100 ^^NSPAN\\(CLASS)########IS LIKE ^^SPAN\\, BUT MAY MATCH THE NULL STRING.
33150 .SKIP 1
33200 .INDENT -20
33250 ^^BREAKQ\\(CLASS)#######IS LIKE ^^BREAK\\, BUT DOES NOT LOOK FOR BREAK
33300 CHARACTERS INSIDE OF SUBSTRINGS DELIMITED BY
33350 SINGLE (') OR DOUBLE (") QUOTES.
33400 .SKIP 1
33450 .INDENT -20
33500 ^^BREAKX\\(CLASS)#######IS LIKE ^^BREAK\\, BUT HAS ALTERNATIVES THAT
33550 EXTEND THE MATCH UP TO EACH SUCCEEDING BREAK
33600 CHARACTER. ^OPERATES LIKE
33650 .SKIP 1
33700 .LEFT MARGIN 0
33750 .NOFILL
33800 ^^BREAK\\(CLASS) ^^ARBNO\(LEN\\(1) ^^BREAK\\(CLASS)).
33850 .SKIP 2
33900 2.4.2 ^&^EXPRESSION PRIMITIVES\&
33950 .SKIP 1
34000 .INDENT 5
34050 .FILL
34100 .JUSTIFY
34150 ^A NUMBER OF ^^SNOBOL\\4 PRIMITIVES WORK SOMEWHAT DIFFERENTLY IN
34200 ^^FASBOL\\, AND NEW PRIMITIVES HAVE BEEN ADDED FOR ^I/^O, STRING
34250 MANIPULATION, AND COMMUNICATION WITH THE RUN-TIME SYSTEM.
34300 .TAB STOPS 6
34350 .LEFT MARGIN 6
34400 .SKIP 1
34450 .INDENT -6
34500 ^^COLLECT\\(N)###FORCES A GARBAGE COLLECTION, RETURNS THE TOTAL
34550 NUMBER OF WORDS COLLECTED, AND FAILS IF NO BLOCK OF SIZE
34600 N OR LARGER IS AVAILABLE.
34650 .SKIP 1
34700 .INDENT -6
34750 ^^CONVERT\\(TABLE,#'^^ARRAY\\') AND ^^CONVERT\\(ARRAY,#'^^TABLE\\')
34800 ARE IMPLEMENTED DIFFERENTLY, BY REMOVING THE ABOVE FACILITIES
34850 FROM ^^CONVERT\\ AND PUTTING THEM IN ^^ARRAY\\ AND ^^TABLE\\.
34900 ^SEE BELOW.
34950 .SKIP 1
35000 .INDENT -6
35050 ^^ARRAY\\(TABLE)###CONVERTS A ^^TABLE\\ DATATYPE TO AN ^^ARRAY\\
35100 AS DESCRIBED IN [2], PP.122. ^AN EMPTY ^^TABLE\\ CAUSES ^^ARRAY\\
35150 TO FAIL.
35200 .SKIP 1
35250 .INDENT -6
35300 ^^TABLE\\(ARRAY)###CONVERTS CERTAIN TYPES OF ^^ARRAY\\ DATATYPES
35350 TO A ^^TABLE\\ AS DESCRIBED IN [2], PG. 122. ^THE ^^TABLE\\
35400 DATATYPE IS DIFFERENT FROM ALL OTHERS IN THAT, ONCE
35450 IT HAS BEEN CREATED, IT EXISTS INDEPENDENTLY FROM ITS
35500 USE IN THE PROGRAM. ^THUS, TO RECLAIM THE STORAGE, IT MUST
35550 BE EXPLICITLY DELETED BY ^^TABLE\\(TABLE). ^ONCE A TABLE
35600 HAS BEEN DELETED, FURTHER REFERENCES TO IT ARE ILLEGAL.
35650 .SKIP 1
35700 .INDENT -6
35750 ^^APPLY\\(FUN, ARGS)###WILL ACCEPT EITHER MORE OR FEWER ARGUMENTS
35800 THAN REQUIRED BY THE FUNCTION; IT WILL REJECT EXTRA ONES OR
35850 FILL IN MISSING ARGUMENTS WITH NULL VALUES.
35900 .SKIP 1
35950 .INDENT -6
36000 ^^OPEN\\(DEVICE, CHAN)###OPENS AN ^I/^O DEVICE ON A SOFTWARE CHANNEL,
36050 ASSIGNS BUFFERS AND RETURNS THE CHANNEL NUMBER.
36100 .SKIP 1
36150 .NOFILL
36200 ^IF CHAN < 0 OR > 15, ILLEGAL ^I/^O UNIT ERROR.
36250 ^IF CHAN = 0, AN UNUSED CHANNEL IS ASSIGNED; IF CHANNEL
36300 ###TABLE IS FULL (> 15 CHANNELS), ERROR.
36350 ^IF CHAN IS ALREADY IN USE, ILLEGAL ^I/^O UNIT ERROR.
36400 ^IF DEVICE IS NOT A STRING OF THE FORM:
36450 ###^&DEVNAM\& [&([^&OUTBUF\&] [&,[^&INBUF\&] ]&)]
36500 ###IT IS A BAD PROTOTYPE OR ILLEGAL ARG ERROR.
36550 ^IF ^&DEVNAM\& IS NOT RECOGNIZED, OR IS NOT A FILE STRUCTURE
36600 ###AND IS ALREADY ASSIGNED TO A CHANNEL, ILLEGAL ^I/^O UNIT.
36650 ^IF &( [^&OUTBUF\&] [&,[^&INBUF\&] ]&) IS MISSING, ^&(2,2)\& IS ASSUMED.
36700 ###^IF EITHER ^&OUTBUF\& AND/OR ^&INBUF\& IS MISSING, 0
36750 ###IS ASSUMED FOR THE MISSING VALUE.
36800 ^IF THE DEVICE ALLOWS ONLY INPUT (OR OUTPUT), THE OTHER
36850 ###BUFFER PARAMETER IS IGNORED.
36900 .SKIP 1
36950 ^EXAMPLES:
37000 .SKIP 2
37050 ###^^OPEN\\('^^DTA\\3(,4)', 5)
37100 ###^^OUTPUT\\('^^DUMP\\', ^^OPEN\\('^^MTA0'), 1000)
37150 .SKIP 2
37200 .INDENT -6
37250 ^^RELEASE\\(CHAN)###RELEASES THE SOFTWARE CHANNEL AND ALL ASSOCIATIONS
37300 TO IT, RETURNS ALL BUFFERS TO FREE STORAGE, AND RETURNS
37350 A NULL VALUE.
37400 .SKIP 1
37450 ^IF CHAN < 0 OR > 15, ILLEGAL ^I/^O UNIT ERROR.
37500 ^IF CHAN = 0, RELEASE ALL CHANNELS IN USE.
37550 ^IF CHANNEL NOT IN USE, IGNORE AND RETURN.
37600 .SKIP 1
37650 .INDENT -6
37700 ^^LOOKUP\\(FILE, CHAN)###OPENS FILE FOR INPUT(READING) ON SOFTWARE
37750 CHANNEL, RETURNS CHANNEL.
37800 .SKIP 1
37850 .INDENT -6
37900 ^^ENTER\\(FILE, CHAN)###OPENS FILE FOR OUTPUT (WRITING) ON SOFTWARE
37950 CHANNEL, RETURNS CHANNEL.
38000 .SKIP 1
38050 ^IF CHAN < 0 OR > 15, ILLEGAL ^I/^O UNIT ERROR.
38100 ^IF CHAN = 0, A PRELIMINARY ^^OPEN\\('^^DSK\\') IS PERFORMED,
38150 ###THE NEW CHANNEL RETURNED.
38200 ^IF FILE IS NOT OF THE FORM
38250 ###^&FILNAM\& [&. &E&X&T]
38300 , A BAD PROTOTYPE ERROR.
38350 ^IF FILE IS NOT FOUND, OR IF CHANNEL IS NOT OPEN FOR
38400 ###OPERATION, ILLEGAL ^I/^O UNIT ERROR.
38450 ^IF INPUT(^^LOOKUP\\) OR OUTPUT(^^ENTER\\) SIDE OF CHANNEL
38500 ###ALREADY SELECTS A FILE, THE OLD FILE IS CLOSED.
38550 .SKIP 1
38600 .INDENT -6
38650 ^^CLOSE\\(CHAN, INHIB, OUTHIB)###CLOSES THE INPUT AND/OR OUTPUT
38700 SIDE OF THE SOFTWARE CHANNEL, RETURNS NULL.
38750 .SKIP 1
38800 ^IF OUTHIB IS NON-NULL, THE OUTPUT SIDE IS NOT CLOSED.
38850 ^IF INHIB IS NON-NULL, THE INPUT SIDE IS NOT CLOSED.
38900 ^IF CHAN < 1 OR > 15, ILLEGAL ^I/^O UNIT ERROR.
38950 ^IF CHANNEL IS NOT IN USE, IGNORE AND RETURN.
39000 .SKIP 1
39050 .INDENT -6
39100 ^^INPUT\\ (VAR, CHAN, LEN)
39150 .INDENT -6
39200 ^^OUTPUT\\(VAR, CHAN, LEN)###CREATE AN INPUT(OUTPUT) ASSOCIATION
39250 BETWEEN THE VARIABLE VAR AND SOFTWARE CHANNEL CHAN, WITH
39300 LINE/CHARACTER MODE AND ASSOCIATION LENGTH SPECIFIED BY
39350 LEN, AND RETURN NULL.
39400 .SKIP 1
39450 ^IF LEN > 0, LINE MODE.
39500 ^IF LEN = 0, LINE MODE WITH DEFAULT LENGTH (72).
39550 ^IF LEN < 0 OR NOT INTEGER, CHARACTER MODE.
39600 ^IF CHAN > 15, ILLEGAL ^I/^O UNIT.
39650 ^IF CHAN > 0 USE CHANNEL TABLE TO DETERMINE ^I/^O DEVICE.
39700
39750 ^IF CHAN = 0 USE ^T^T^Y ^I/^O.
39800 ^IF CHAN < 0 OR NOT ^^INTEGER\\, DISCONNECT ASSOCIATION BUT DO
39850 ###NOT ^^DETACH\\ IT.
39900 ^IF THE INPUT (OUTPUT) SIDE OF THE CHANNEL HAS NOT BEEN
39950 ###OPENED, ILLEGAL ^I/^O UNIT ERROR.
40000 ^IF VAR IS NOT A STRING, ILLEGAL ARG.
40050 ^IF AN ASSOCIATION FOR VAR ALREADY EXISTS, IT IS CHANGED.
40100 ^IF VARIABLE IS DEDICATED, ILLEGAL ARG.
40150 .SKIP 1
40200 ^EXAMPLES:
40250 .SKIP 1
40300 .SKIP 2
40350 ###^^INPUT('SOURCE',LOOKUP('SRCELT.SNO'),80)\\
40400 .SKIP 1
40450 ###^^OUTPUT('TYPEOUT.CHARS',0,-1)\\
40500 .SKIP 2
40550 ^THE INITIAL ^I/^O CONFIGURATION IS EQUIVALENT TO:
40600 .SKIP 2
40650 ###^^INPUT('INPUT')\\
40700 .SKIP 1
40750 ###^^INPUT('INPUTC',0,-1)\\
40800 .SKIP 1
40850 ###^^OUTPUT('OUTPUT')\\
40900 .SKIP 1
40950 ###^^OUTPUT('OUTPUTC',0,-1)\\
41000 .SKIP 2
41050 .FILL
41100 .JUSTIFY
41150 ^DURING EXECUTION, ALL SYSTEM MESSAGES ARE OUTPUT VIA
41200 THE VARIABLES ^^OUTPUT\\ AND ^^OUTPUTC\\ (WHICH SHOULD ALWAYS
41250 BOTH BE ASSOCIATED TO THE SAME CHANNEL). ^IN ORDER TO SWITCH
41300 SYSTEM OUTPUT TO THE PRINTER, FOR EXAMPLE,
41350 .SKIP 2
41400 ###^^LPT = OPEN('LPT')\\
41450 .SKIP 1
41500 ###^^OUTPUT('OUTPUT',LPT,132)\\
41550 .SKIP 1
41600 ###^^OUTPUT('OUTPUTC',LPT,-1)\\
41650 .SKIP 2
41700 ^CHANNEL 0 IS NEVER ASSIGNED, BUT WHEN USED IN ^^INPUT\\
41750 AND ^^OUTPUT\\ ASSOCIATIONS IMPLIES THE USER ^^TTY\\ AND
41800 ^^TTCALL\\ OPERATION. ^ON INPUT, LINE MODE READS UP TO (BUT
41850 NOT INCLUDING) THE NEXT CARRIAGE RETURN, LINE FEED
41900 (^^CR,LF\\) SEQUENCE, AND THEN THESE ARE DISCARDED. ^CHARACTER
41950 MODE READS ONLY ONE CHARACTER (INCLUDING ^C^R OR ^L^F). ^LINE MODE
42000 DISCARDS ANY CHARACTERS BEYOND THE ASSOCIATION LENGTH. ^AN
42050 ^^EOF\\ CAUSES FAILURE IN EITHER MODE, BUT CANNOT OCCUR ON SOME
42100 DEVICES (SUCH AS THE USER ^^TTY\\).
42150 .SKIP 1
42200 ^ON OUTPUT, LINE MODE WRITES OUT THE STRING VALUE WITH A
42250 ^^CR, LF\\ APPENDED, WHEREAS CHARACTER MODE DOES NOT APPEND THE
42300 ^^CR, LF\\. ^IN LINE MODE, IF THE STRING LENGTH IS GREATER THAN
42350 THE ASSOCIATION LENGTH, EXTRA ^^CR\\, ^L^F CHARACTERS ARE
42400 INSERTED EVERY ASSOCIATION LENGTH SUBSTRING.
42450 .SKIP 1
42500 .INDENT -6
42550 ^^DETACH\\(VAR)###DISCONNECTS INPUT AND OUTPUT ASSOCIATIONS FOR THE
42600 VARIABLE AND DETACHES IT FROM ^I/^O PROCESSING, RETURNS NULL.
42650 .SKIP 1
42700 ^IF THE VARIABLE HAD NO ASSOCIATION, IGNORE AND RETURN.
42750 .SKIP 1
42800 .INDENT -6
42850 ^^SUBSTR\\(STRING, LEN, POS)###RETURNS THE SUBSTRING OF STRING STARTING
42900 AT POS OF LENGTH LEN, AND FAILS IF LEN < 0, POS < 0, OR POS +
42950 LEN > ^^SIZE\\(STRING). ^THE POSITION CONVENTION IS THE SAME AS
43000 THAT FOR PATTERNS, AND THE OPERATION IS SIMILAR (BUT
43050 FASTER AND LESS SPACE-CONSUMING) TO:
43100 .SKIP 2
43150 ###STRING ^^TAB\\(POS) ^^LEN\\(LEN) . ^^SUBSTR\\
43200 .SKIP 2
43250 .INDENT -6
43300 ^^INSERT\\(SUBSTRING, STRING, LEN, POS)###RETURNS THE STRING FORMED BY
43350 SUBSTITUTING FOR THE ONE SPECIFIED BY THE LAST 3 ARGUMENTS
43400 INTO STRING, FAILING UNDER THE SAME CONDITIONS AS:
43450 .SKIP 2
43500 ###STRING ^^TAB\\(POS) . ^^PART\\1 ^^LEN\\(LEN) ^^REM\\ . ^^PART2\\
43550 .SKIP 1
43600 ###^^INSERT = PART\\1 SUBSTRING ^^PART\\2
43650 .SKIP 2
43700 .INDENT -6
43750 ^^LPAD\\(STRING, LEN, PADCHR)###RETURNS THE STRING FORMED BY PADDING
43800 STRING ON THE LEFT WITH PADCHR CHARACTERS TO A LENGTH OF LEN.
43850 ^IF STRING IS ALREADY TOO LONG, IT IS RETURNED UNCHANGED; IF
43900 PADCHR HAS MORE THAN ONE CHARACTER, ONLY THE FIRST IS USED. ^IF
43950 THE THIRD ARGUMENT IS NULL, BLANKS ARE USED.
44000 .SKIP 1
44050 .INDENT -6
44100 ^^RPAD\\(STRING, LEN, PADCHR)###IS LIKE ^^LPAD\\, BUT PADS TO THE RIGHT.
44150 .SKIP 1
44200 .INDENT -6
44250 ^^REVERS\\(STRING)###RETURNS THE STRING FORMED BY REVERSING THE ORDER OF
44300 THE CHARACTERS OF ITS ARGUMENT.
44350 .SKIP 1
44400 .INDENT -6
44450 ^^EXTIME\\(PROGNAME)###CAUSES THE RUNTIME SYSTEM TO OUTPUT CURRENT
44500 TIMING STATISTICS FOR THE PROGRAM PROGNAME AND RETURNS NULL,
44550 OR FAILS IF THE PROGRAM IS NOT BEING TIMED.
44600 .SKIP 1
44650 .INDENT -6
44700 ^^REAL\\(X)###IS LIKE ^^INTEGER\\ FOR REALS.
44750 .SKIP 1
44800 .INDENT -6
44850 ^^EJECT()\\###CAUSES A PAGE EJECT (FORM FEED) TO BE ASSIGNED TO ^^OUTPUTC\\.
44900 .SKIP 1
44950 .INDENT -6
45000 ^^DAYTIM\\()###RETURNS AN 11-CHARACTER STRING REPRESENTING THE TIME
45050 OF DAY (SINCE MIDNIGHT), AS
45100 .SKIP 2
45150 ###^^HH:MM:SS.HH\\
45200 .SKIP 2
45250 MEANING HOURS, MINUTES, AND SECONDS TO THE NEAREST HUNDRETH.
45300 .SKIP 1
45350 .LEFT MARGIN 0
45400 2.4.3 ^&^^FORTRAN\\ PRIMITIVES\&
45450 .SKIP 1
45500 .INDENT 5
45550 ^THESE ARE PREDEFINED ^^EXTERNAL.FORTRAN\\ FUNCTIONS THAT, EXCEPT
45600 FOR ^^FREEZE\\, MERELY PERFORM SOME SIMPLE ARITHMETIC TASK AND HAVE
45650 INTEGER VALUES.
45700 .SKIP 1
45750 .LEFT MARGIN 6
45800 .INDENT -6
45850 ^^FREEZE\\()###CAN BE CALLED TO FREEZE THE STATE OF THE ^^FASBOL\\
45900 EXECUTION FOR RESUMPTION AT SOME FUTURE DATE. ^WHEN ^^FREEZE\\
45950 IS CALLED, IT EXITS TO THE MONITOR; THE JOB MAY BE ^^SAVED\\,
46000 AND WHEN RUN AGAIN, IT WILL START OFF BY RETURNING FROM THE
46050 CALL TO ^^FREEZE\\. ^THIS IS PARTICULARLY USEFUL FOR SOME
46100 APPLICATIONS THAT PERFORM A CONSIDERABLE AMOUNT OF
46150 INITIALIZATION AND WISH TO BE ABLE TO START AFTER THAT
46200 POINT ON A REPEATED BASIS.
46250 ^NO ^I/^O DEVICES (OTHER THAN THE CONSOLE ^^TTY\\) MAY BE OPEN
46300 AT THE TIME OF THE ^^FREEZE\\ AND THE CALL SHOULD BE MADE FROM
46350 FUNCTION LEVEL 0 IF ANY TIMING IS ACTIVE.
46400 .SKIP 1
46450 .INDENT -6
46500 ^^ILT\\(INT, INT) OR ^I^L^T(REAL, REAL)
46550 .BREAK
46600 .INDENT -6
46650 [ALSO ^^ILE, IEQ, INE, IGE, IGT\\]###^LIKE ^L^T, ETC. EXCEPT MORE
46700 EFFICIENT FOR DEDICATED VARIABLES OR EXPRESSIONS.
46750 .SKIP 1
46800 .INDENT -6
46850 ^^AND\\(INT, INT)
46900 .BREAK
46950 .INDENT -6
47000 [ALSO ^^OR, XOR, RSHIFT, LSHIFT, REMDR\\]###PERFORM THE SPECIFIED
47050 ARITHMETIC OR LOGICAL OPERATION ON THEIR INTEGER ARGUMENTS
47100 AND RETURN THE VALUE (LOGICAL ^A^N^D; INCLUSIVE ^O^R;
47150 EXCLUSIVE ^O^R; LOGICAL RIGHT AND LEFT SHIFT OF FIRST BY SECOND
47200 ARGUMENT; REMAINDER OF INTEGER DIVISION OF FIRST BY SECOND
47250 ARGUMENT).
47300 .SKIP 1
47350 .INDENT -6
47400 ^^NOT\\(INT)###RETURNS ONE'S COMPLEMENT OF ITS ARGUMENT.
47450 .SKIP 1
47500 .INDENT -6
47550 2.5 ^&^KEYWORDS\&
47600 .SKIP 1
47650 .INDENT 5
47700 .INDENT -6
47750 ^THREE NEW KEYWORDS, ALL UNPROTECTED, HAVE BEEN ADDED IN ^^FASBOL\\.
47800 .SKIP 1
47850 .INDENT -6
47900 _&^^STNTRACE\\###IS INITIALLY 0, BUT IF ASSIGNED A NONZERO VALUE IT
47950 CAUSES A TRACE OUTPUT FOR EACH STATEMENT, GIVING
48000 STATEMENT NUMBER, PROGRAM NAME, AND TIME. ^THIS SLOWS DOWN
48050 EXECUTION CONSIDERABLY, SO IT IS BEST TO TURN IT ON AS
48100 CLOSE TO THE SUSPECTED BUG AS POSSIBLE. ^PROGRAMS COMPILED
48150 UNDER THE ^^NO.STNO\\ OPTION WILL IGNORE THE VALUE OF _&^^STNTRACE\\,
48200 HOWEVER, SO ANOTHER APPROACH IS TO RUN WITH ALL BUT THE
48250 SUSPECT PROGRAM UNDER ^^NO.STNO,\\ WITH _&^^STNTRACE\\
48300 ON ALL THE TIME.
48350 .SKIP 1
48400 .INDENT -6
48450 _&^^DENSITY\\###IS INITIALLY 75, AND REPRESENTS THE DESIRED DENSITY OF FREE
48500 STORAGE IMMEDIATELY FOLLOWING A GARBAGE COLLECTION. ^FOR EXAMPLE,
48550 _&^^DENSITY\\ = 75 MEANS THAT THE FREE STORAGE SYSTEM WILL
48600 TRY TO MAINTAIN AT LEAST A 1:4 RATIO BETWEEN AVAILABLE AND
48650 TOTAL STORAGE IMMEDIATELY FOLLOWING A GARBAGE COLLECTION, AND
48700 WILL EXPAND TOTAL STORAGE AS FAR AS NECESSARY OR POSSIBLE
48750 IN ORDER TO TRY TO MAINTAIN THIS RATIO. ^SEE ^SECTION 3.2.4.
48800 .SKIP 1
48850 .INDENT -6
48900 _&^^SLOWFRAG\\###IS INITIALLY 0, BUT IF ASSIGNED A NONZERO VALUE IT
48950 SERVES TO SWITCH IN A HEURISTIC IN THE FREE STORAGE MECHANISM
49000 THAT SLOWS DOWN THE RATE OF FRAGMENTATION OF BLOCKS AT THE
49050 EXPENSE OF SOME WASTED STORAGE. ^SEE ^SECTION 3.2.4.
49100 .PAGE
49150 .LEFT MARGIN 0
49200 .SKIP 2
49250 .CENTRE
49300 ^^CHAPTER\\ 3
49350 .SKIP 1
49400 3. ^&^^FASBOL II P\\ROGRAMMING\&
49450 .SKIP 1
49500 .INDENT 5
49550 ^USING ^^FASBOL\\ INVOLVES TWO SEPARATE STAGES, AS IN ^^FORTRAN\\:
49600 COMPILATION AND EXECUTION. ^THE FIRST REQUIRES THE COMPILER, AN
49650 ABSOLUTE PROGRAM NAMED ^^FASBOL.SAV\\ (OR ^^FASBOL.DMP\\,
49700 DEPENDING ON THE OPERATING SYSTEM). ^EXECUTION OF COMPILED (AND THEN
49750 ASSEMBLED) PROGRAMS REQUIRES A LIBRARY SEARCH, DURING LOADING, OF THE
49800 ^^FASBOL\\ LIBRARY; THIS IS A COLLECTION OF RELOCATABLE PROGRAMS
49850 NAMED ^^FASLIB.REL\\. ^THE RELATIVE ACCESIBILITY OF THESE PROGRAMS WILL
49900 DEPEND ON THE INSTALLATION. ^THE COMPILER REQUIRES A MINIMUM OF 35^K
49950 TO RUN, AND REQUIRES MORE CORE IN PROPORTION TO THE PROGRAM BEING
50000 COMPILED.
50050 ^IF 50^K IS AVAILABLE TO THE COMPILER THEN IT CAN COMPILE A
50100 PROGRAM OF ABOUT 400 STATEMENTS. ^SUPPRESSING THE LISTING AND
50150 CROSSREFERENCE CAN SAVE A LITTLE STORAGE.
50200 ^THE CORE REQUIREMENTS FOR EXECUTION OF USER PROGRAMS DEPENDS
50250 ON THE SIZE OF THE COMPILED PROGRAMS PLUS AT MOST 5^K
50300 (IF EVERY SINGLE FACILITY IN THE LIBRARY IS USED) FOR THE LIBRARY.
50350 .SKIP 1
50400 3.1 ^&^USING THE COMPILER AND RUNTIME LIBRARY\&
50450 .SKIP 1
50500 .INDENT 5
50550 ^TO COMPILE A ^^FASBOL\\ PROGRAM, TYPE
50600 .SKIP 1
50650 &.^^RUN FASBOL\\ N
50700 .SKIP 1
50750 WHERE THE ^^CORE\\ ARGUMENT (N) IS OPTIONAL. ^IT IS BEST TO
50800 GIVE THE COMPILER AN AMOUNT OF CORE COMMENSURATE WITH THE SIZE OF
50850 PROGRAM BEING COMPILED: THIS WILL INCREASE COMPILATION SPEED BY MINIMIZING
50900 GARBAGE COLLECTIONS, SINCE THE COMPILER WILL EXPAND CORE ON ITS OWN
50950 ONLY WHEN IT ABSOLUTELY HAS TO.
51000 .SKIP 1
51050 .INDENT 5
51100 ^THE COMPILER WILL RESPOND WITH
51150 .SKIP 1
51200 &*
51250 .SKIP 1
51300 , TO WHICH THE USER IS EXPECTED TO RESPOND WITH A SET OF FILE
51350 SPECIFICATIONS OF THE FORM
51400 .SKIP 1
51450 &*MACFIL,LSTFIL=SRCFIL
51500 .SKIP 1
51550 .INDENT 5
51600 ^EACH FILE SPECIFICATION IS OF THE STANDARD FORM, AS WOULD BE GIVEN
51650 TO ^^MACRO\\, FOR INSTANCE. ^THE ^^MACRO \\ OUTPUT FILE, MACFIL, IS
51700 GIVEN A DEFAULT EXTENSION OF ^^MAC\\ IF NOT SPECIFIED. ^LSTFIL IS THE
51750 LISTING FILE, AND BOTH MACFIL AND LSTFIL ARE OPTIONAL. ^THE SOURCE
51800 FILE, SRCFIL, IS GIVEN A DEFAULT EXTENSION OF ^S^N^O IF NOT SPECIFIED.
51850 ^ONLY ONE SOURCE FILE IS PERMITTED.
51900 .SKIP 1
51950 ^EXAMPLES:
52000 .SKIP 1
52050 &*^^DTA3:SAMPLE,LPT:=SAMPLE
52100 .BREAK
52150 &*,TAPE,LST=MTA0:
52200 .BREAK
52250 &*NEW.NEW,=TEST.NEW\\
52300 .SKIP 1
52350 .INDENT 5
52400 ^ONCE THE COMPILER PRODUCES THE ^^MACRO\\ OUTPUT FILE, IT MUST
52450 BE ASSEMBLED USING ^^MACRO\\-10:
52500 .SKIP 1
52550 &.^^COMPILE\\ MACFIL
52600 .SKIP 1
52650 .INDENT 5
52700 ^THE ^^MACRO\\ FILE CAN BE DELETED AFTER ASSEMBLY, AS IT WILL BE
52750 OF LITTLE INTEREST TO MOST USERS; IT IS MAINLY A SHORTCUT FOR THE
52800 COMPILER TO AVOID HAVING TO GENERATE RELOCATABLE CODE. ^ON THE OTHER
52850 HAND, THOSE INDIVIDUALS WHO UNDERSTAND THE WORKINGS OF THE RUN-TIME
52900 SYSTEM MAY WISH TO HAND-TAILOR THESE INTERMEDIATE PROGRAMS TO SUIT
52950 THEIR OWN NEEDS; ^&^CAVEAT ^EMPTOR.\&
53000 .SKIP 1
53050 .INDENT 5
53100 ^TO PREPARE ANY COLLECTION OF ^^FASBOL\\ AND OTHER PROGRAMS FOR
53150 EXECUTION, THE COMMAND LIST SHOULD BE TERMINATED WITH A LIBRARY
53200 SEARCH OF ^^FASLIB\\, FOR EXAMPLE:
53250 .SKIP 1
53300 &.^^LOAD\\ FIL1,FIL2, . . . ,FILN,^^FASLIB\\/^L^I^B
53350 .SKIP 1
53400 ^IT IS IMPORTANT THAT ^^FASLIB\\ BE SEARCHED ONLY ONCE,
53450 AFTER ALL ^^FASBOL\\ PROGRAMS HAVE BEEN LOADED, SINCE IT IS VERY
53500 CAREFULLY SEQUENCED TO PROVIDE DUMMY VERSIONS OF ELEMENTS THAT
53550 ARE SOMEHOW REFERENCED, BUT NOT REALLY NEEDED. ^THE AUTOMATIC
53600 SEARCH OF THE ^^FORTRAN\\ LIBRARY SHOULD TAKE PLACE AFTER SEARCHING
53650 ^^FASLIB\\, SINCE ^^FASLIB\\ MAY REQUIRE SOME ^^FORTRAN\\ ROUTINES.
53700 .SKIP 1
53750 .INDENT 5
53800 ^WHILE ^^FASBOL\\ MAY CALL OR MAY BE CALLED BY ^^FORTRAN\\ OR USER
53850 ^^MACRO\\ PROGRAMS, THE MAIN PROGRAM MUST BE A ^^FASBOL\\ PROGRAM.
53900 ^FURTHERMORE, THE ^^FASBOL\\ RUNTIME SYSTEM ENABLES TRAPS AND
53950 USES USER ^U^U^O'S 1 THROUGH 10, SO IT IS INCOMPATIBLE
54000 WITH THE ^^FORTRAN\\ RUNTIME SYSTEM. ^WHAT THIS MEANS IS THAT
54050 ^^FORTRAN\\ PROGRAMS USED WITHIN A ^^FASBOL\\ EXECUTION MUST NOT
54100 DO ANY ^I/^O OR OTHERWISE CAUSE ^^FORSE\\. TO BE LOADED. ^^FASBOL\\ DOES
54150 PROVIDE AN INFINITE STACK (ALL ^^FASBOL\\ STACKS ARE INFINITE, UP TO
54200 USER CORE LIMITS) IN REGISTER 17, HOWEVER, SO A BROAD CLASS OF
54250 ^^FORTRAN\\ USER PROGRAMS AND LIBRARY ROUTINES ARE PERMISSIBLE.
54300 .SKIP 1
54350 .INDENT 5
54400 ^UNLESS CHANGED BY THE USER'S PROGRAM, ALL SYSTEM OUTPUT DURING
54450 EXECUTION IS SENT TO THE USER'S CONSOLE; UPON EITHER ERROR OR NORMAL
54500 TERMINATION OF EXECUTION, THE APPROPRIATE MESSAGES AND STATISTICS
54550 WILL BE PRINTED OUT, AND CONTROL RETURNED TO THE MONITOR. ^THE ERROR
54600 NUMBERS ARE DESCRIBED IN ^APPENDIX 3.
54650 .SKIP 1
54700 3.2 ^&^PROGRAMMING TECHNIQUES\&
54750 .SKIP 1
54800 .INDENT 5
54850 ^BECAUSE OF THE BASIC DIFFERENCES BETWEEN INTERPRETIVE AND COMPILER
54900 SYSTEMS, AND THE ADDITIONAL FEATURES AVAILABLE IN ^^FASBOL\\, SOME
54950 PROGRAMMING TECHNIQUES BESIDES THOSE DISCUSSED IN [2], ^CH. 11, ARE
55000 DESCRIBED HERE. ^AN INTERESTED USER MAY WISH TO GET A LISTING OF THE
55050 COMPILER ITSELF TO SEE EXAMPLES OF SOME OF THESE TECHNIQUES.
55100 .SKIP 1
55150 3.2.1 ^&^DEDICATED EXPRESSIONS\&
55200 .SKIP 1
55250 .INDENT 5
55300 ^DEDICATED EXPRESSIONS IN ^^FASBOL\\ ARE THOSE THAT ARE KNOWN,
55350 BECAUSE OF SOME COMPONENT, TO HAVE A NUMERICAL VALUE OF A
55400 PREDETERMINED TYPE. ^AT ONE EXTREME IS THE TOTALLY DEDICATED STATEMENT
55450 THAT INVOLVES NOTHING BUT DECLARED DEDICATED VARIABLES, CONSTANTS, AND
55500 PERHAPS ^^FORTRAN\\ CALLS.
55550 ^FOR EXAMPLE, IF ^I WERE DECLARED ^^INTEGER\\, THE STATEMENT
55600 .SKIP 1
55650 .INDENT 7
55700 ^I = 2*^I+10
55750 .SKIP 1
55800 WOULD BE TOTALLY DEDICATED, AND COMPILE INTO
55850 .SKIP 1
55900 .INDENT 7
55950 ^^MOVE\\####1,^I
56000 .INDENT 7
56050 ^^IMULI\\###1,2
56100 .INDENT 7
56150 ^^ADDI\\####1,10
56200 .INDENT 7
56250 ^^MOVEM\\###1,^I
56300 .SKIP 1
56350 ^EVEN IF AN EXPRESSION IS MIXED, WITH BOTH DEDICATED AND DESCRIPTOR-MODE
56400 SUBEXPRESSIONS, IN-LINE ARITHMETIC CODE IS COMPILED FOR AS MUCH
56450 OF THE EXPRESSION AS IS POSSIBLE TO COMMIT A SPECIFIC TYPE OF VALUE
56500 (I.E. ^^INTERGER\\ OR ^^REAL\\) AT COMPILE TIME. ^IT IS THEREFORE TO THE
56550 USER'S ADVANTAGE TO DECLARE AS MANY VARIABLES AS HE PERCEIVES
56600 WILL BE DEDICATED IN USE TO BE OF THAT DEDICATED TYPE. ^NOT ONLY WILL
56650 THE PROGRAM RUN FASTER, IT MAY EVEN USE LESS CORE. ^IN A SITUATION
56700 WHERE ALL ENTITIES ARE DESCRIPTOR MODE, EVEN ARITHMETIC OPERATORS
56750 HAVE TO CHECK THE TYPE OF, AND POSSIBLY CONVERT EACH ARGUMENT.
56800 .SKIP 1
56850 .INDENT 5
56900 ^IN THIS CONNECTION IT SHOULD ALSO BE NOTED THAT THE PREDEFINED
56950 ^^FORTRAN\\ PRIMITIVES ^^ILT, ILE, IEQ, INE, IGE, IGT\\ HAVE BEEN
57000 PROVIDED IN ORDER TO DO A MUCH MORE EFFICIENT JOB THAN ^^LT, ...,
57050 GT\\ WHEN THE ARGUMENTS ARE DEDICATED. ^FOR EXAMPLE, IF
57100 ^R AND ^S ARE ^^REAL\\, THE TEST
57150 .SKIP 1
57200 .INDENT 7
57250 ^^ILT(R,S)\\
57300 .SKIP 1
57350 TAKES UP SEVERAL FEWER WORDS AND RUNS ABOUT 100 TIMES FASTER THAN
57400 THE TEST
57450 .SKIP 1
57500 .INDENT 7
57550 ^^LT(R,S)\\
57600 .SKIP 1
57650 .INDENT 5
57700 ^^FASBOL\\ PERMITS MIXED MODE (^^INTEGER\\ AND ^^REAL\\) ARITHMETIC, THE
57750 GENERAL RULE BEING THAT THE RESULT OF AN OPERATION IS ^^INTEGER\\
57800 ONLY IF BOTH SIDES ARE INTEGER; FURTHERMORE, AN ARITHMETIC OPERATION
57850 INVOLVING DEDICATED AND DESCRIPTOR MODE VALUES ALWAYS HAS A DEDICATED
57900 RESULT. ^A VALUE BEING COMBINED WITH A STRONGER MODE IS FIRST
57950 CONVERTED, AND THEN THE OPERATION IS PERFORMED IN THAT MODE; FOR
58000 EXAMPLE, IF ^I IS ^^INTEGER\\ BUT ^D HAS NOT BEEN DECLARED
58050 DEDICATED,
58100 .SKIP 1
58150 .INDENT 7
58200 ^I + ^D
58250 .SKIP 1
58300 IMPLIES THE VALUE OF ^D WILL FIRST BE CONVERTED TO AN INTEGER,
58350 AND THEN ADDED TO ^I. ^THE ONLY EXCEPTION TO THIS RULE
58400 IS THE ** (EXPONENTIATION) OPERATOR WHICH PERMITS A ^^REAL\\ RAISED
58450 TO AN ^^INTEGER\\ POWER.
58500 .SKIP 1
58550 .INDENT 5
58600 ^FINALLY IT SHOULD BE NOTED THAT WHEREAS THE RANGE OF VALUES OF
58650 DEDICATED VARIABLES IS THE SAME AS IN ^^FORTRAN\\, DESCRIPTOR MODE
58700 INTEGERS HAVE A RANGE TWO POWERS OF 2 LESS IN MAGNITUDE, AND
58750 DESCRIPTOR MODE REALS HAVE TWO FEWER BITS OF PRECISION IN THE MANTISSA.
58800 ^THE REASON FOR THIS IS THAT THE TWO BITS ARE NEEDED FOR THE DESCRIPTOR
58850 TYPE.
58900 .SKIP 1
58950 3.2.2 ^&^USE OF THE UNARY &? AND &. OPERATORS\&
59000 .SKIP 1
59050 .INDENT 5
59100 ^UNARY ? (INTERROGATION) IS USEFUL TO INDICATE TO THE COMPILER THAT
59150 AN EXPRESSION IS EVALUATED FOR ITS EFFECT, RATHER THAN VALUE. ^FOR
59200 EXAMPLE, A FREQUENT OCCURENCE IN ^^SNOBOL\\ PROGRAMS IS THE
59250 CONCATENATION OF NULL-VALUED FUNCTIONS FOR THEIR SEQUENTIAL EFFECTS
59300 AND/OR SUCCEED/FAIL POTENTIAL. ^IF THE COMPILER KNOWS THAT AN ELEMENT
59350 HAS A NULL VALUE, IT DOES NOT GENERATE CODE TO INCLUDE IT IN THE
59400 CONCATENATION. ^THEREFORE IT IS EFFICIENT TO PRECEDE PREDICATES
59450 AND OTHER NULL-VALUED ELEMENTS IN A CONCATENATION WITH THE ? OPERATOR.
59500 ^THIS TECHNIQUE IS ESPECIALLY VALUABLE WHEN COMBINING PREDICATES
59550 AND DEDICATED ARITHMETIC, AS IN
59600 .SKIP 1
59650 .INDENT 7
59700 ^I = ?^^IDENT(A, B) ?IGT(I, 25) I\\ + 1
59750 .SKIP 1
59800 , SINCE CONCATENATION IS AVOIDED ENTIRELY AND THE DEDICATED ARITHMETIC
59850 IS PERFORMED AFTER THE EXECUTION OF THE PREDICATES WITHOUT ANY NEED FOR
59900 CONVERSION BETWEEN DEDICATED AND DESCRIPTOR VALUES.
59950 .SKIP 1
60000 .INDENT 5
60050 ^ANOTHER FREQUENT OCCURENCE IN ^^SNOBOL\\ PROGRAMS IS THE REPETITIVE
60100 ACCESS OF THE SAME INDIRECT VARIABLE, ARRAY ELEMENT, OR FIELD OF A
60150 PROGRAMMER-DEFINED DATATYPE. ^EACH OF THESE ACCESSES, WHETHER TO
60200 RETRIEVE OR STORE A VALUE, INVOLVE SOME OVERHEAD WHICH IS REPEATED
60250 FOR EACH ACCESS. ^FOR EXAMPLE, IN THE STATEMENTS
60300 .SKIP 1
60350 .INDENT 7
60400 $^X = $^X + 1
60450 .SKIP 1
60500 , THE VARIABLE REPRESENTED BY THE STRING VALUE OF ^^X \\ IS LOOKED
60550 UP IN THE SYMBOL TABLE TWICE, THE FIRST TIME TO RETRIEVE
60600 ITS VALUE, THE SECOND TIME TO STORE INTO IT. ^THE UNARY . (NAME) OPERATOR
60650 CAN BE USED TO SAVE THE RESULT OF ONE LOOKUP BY CREATING A ^^NAME\\
60700 DATATYPE, AND THEN THE ^^NAME\\ CAN BE USED IN AN INDIRECT REFERENCE WHEREVER
60750 THE ORIGINAL EXPRESSION WAS USED. ^INSTEAD OF THE ABOVE STATEMENT
60800 A MORE EFFICIENT SEQUENCE WOULD BE
60850 .SKIP 1
60900 .INDENT 7
60950 ^Z# = .$^X
61000 .INDENT 7
61050 $^Z = $^Z + 1
61100 .SKIP 1
61150 , WHERE ^Z CONTAINS THE ^^NAME\\ OF THE VARIABLE POINTED TO BY ^X.
61200 ^THE SAME CONSIDERATIONS APPLY TO ARRAY REFERENCES AND FIELD REFERENCES
61250 AS APPLY TO INDIRECTION; IT IS EFFICIENT TO SAVE THE ^^NAME\\ OF THE
61300 VARIABLE REFERENCED IF IT WILL BE USED MORE THAN ONCE IN CLOSE
61350 SUCCESSION. ^FOR EXAMPLE, THE STATEMENTS
61400 .SKIP 1
61450 .INDENT 7
61500 ^A<25>##### = ^F(^A<25>)
61550 .INDENT 7
61600 ^^NEXT(LIST) = ^^NODE(VAL, NEXT(LIST))\\
61650 .SKIP 1
61700 WOULD BE MORE EFFICIENT IF CODED AS
61750 .SKIP 1
61800 .INDENT 7
61850 ^Z# = .^A<25>
61900 .INDENT 7
61950 $^Z = ^F($^Z)
62000 .INDENT 7
62050 ^Z# = .^^NEXT(LIST)\\
62100 .INDENT 7
62150 $^Z = ^^NODE(VAL, $Z)\\
62200 .SKIP 1
62250 ^IT SHOULD BE NOTED THAT ^^TABLE\\ REFERENCES, AND THE SYMBOL
62300 LOOKUP INVOLVED MAKES IT EVEN MORE EFFICIENT TO SAVE THE ^^NAME\\.
62350 ^THE ^^NAME\\ OF AN ARRAY OR ^^TABLE\\ ELEMENT, OR OF A FIELD OF
62400 A PROGRAMMER-DEFINED DATATYPE, IS ONLY VALID AS LONG AS THAT ARRAY
62450 TABLE OR DATATYPE EXIST; ATTEMPTS TO RETRIEVE OR STORE USING THE
62500 ^^NAME\\ AFTERWARDS WILL HAVE UNPREDICTABLE RESULTS. ^ALSO, THE
62550 ^^NAME\\ OF A VARIABLE EVALUATED BEFORE THAT VARIABLE ACQUIRES AN
62600 ^I/^O ASSOCIATION, DOES NOT REFLECT THAT ASSOCIATION.
62650 .SKIP 1
62700 3.2.3 ^&^PATTERN MATCHING\&
62750 .SKIP 1
62800 .INDENT 5
62850 ^FREQUENTLY A PROGRAMMER WISHES TO WRITE A DEGENERATE-TYPE
62900 STATEMENT CONSISTING OF A CONCATENATION OF ELEMENTS EXECUTED FOR THEIR
62950 EFFECT, AS IN
63000 .SKIP 1
63050 .INDENT 7
63100 ^^F(A) F(B) F(C) F(D)\\
63150 .SKIP 1
63200 ^THIS SYNTAX, HOWEVER, IS PARSED AS A PATTERN MATCH, AND,
63250 THOUGH HAVING THE SAME EFFECT AS INTENDED (PROVIDING THE MATCH IS
63300 SUCCESSFUL), IS LESS EFFICIENT IN BOTH SPACE AND TIME. ^THE ORIGINAL
63350 INTENT CAN BEST BE ACHIEVED BY ENCLOSING THE CONCATENATION IN
63400 PARANTHESIS, AND IN THIS CASE, USING THE ? OPERATOR
63450 .SKIP 1
63500 .INDENT 7
63550 (?^^F(A) ?F(B) ?F(C) ?F(D))\\
63600 .SKIP 1
63650 ,WHICH WILL SUPPRESS STRING CONCATENATION.
63700 .SKIP 1
63750 .INDENT 5
63800 ^ONE PARTICULARLY UNIQUE FEATURE OF ^^FASBOL\\ IS THAT EXPLICIT PATTERN
63850 EXPRESSIONS, I.E., THOSE INVOLVING THE PATTERN OPERATORS AND/OR PRIMITIVES,
63900 ARE COMPILED AS RE-ENTRANT SUBROUTINES, RATHER THAN CONSTRUCTED
63950 AT RUN-TIME INTO INTERMEDIATE-LANGUAGE STRUCTURES. ^THE SIGNIFICANCE OF THIS
64000 TO THE PROGRAMMER, ASIDE FROM THE INCREASE IN EXECUTION SPEED, IS THE
64050 THERE IS LESS OF A NEED TO PRE-ASSIGN SUBPATTERNS THAT WILL APPEAR
64100 IN PATTERN MATCHES LATER ON; IN FACT, AN UNNECESSARY PRE-ASSIGNMENT
64150 WILL BE SLIGHTLY LESS EFFICIENT BECAUSE THE PATTERN MATCH WILL HAVE
64200 TO RECURSE ONE LEVEL DEEPER THAN OTHERWISE DURING EXECUTION. ^THE WAY
64250 TO DETERMINE THE NEED FOR
64300 PRE-ASSIGNMENT IS TO NOTE HOW MUCH EVALUATION IS ACTUALLY REQUIRED
64350 IN A SUBPATTERN; IF LITTLE OR NONE IS REQUIRED, IT CAN JUST AS
64400 EFFICIENTLY BE INCLUDED IN THE BODY OF THE MATCH. ^OF COURSE, IF A
64450 SUBPATTERN IS LARGE AND/OR USED IN SEVERAL MATCHES, THE PROGRAMMER MAY
64500 WISH TO PRE-ASSIGN IT ANYWAY FOR CONVENIENCE SAKE. ^PATTERN EVALUATION
64550 INVOLVES ONLY THE ELEMENTS OF THE PATTERN, NOT THE STRUCTURE ITSELF.
64600 ^LITERALS AND OTHER CONSTANT VALUES DO NOT REQUIRE EVALUATION, SO
64650 THE PATTERN
64700 .SKIP 1
64750 .INDENT 7
64800 ^^TAB(7) (SPAN('XYZ') ! BREAK(';')) $ SYM ';??'\\
64850 .SKIP 1
64900 REQUIRES NO EVALUATION AT ALL. ^A GENERALLY APPLICABLE RULE FOR ALL
64950 ^^FASBOL\\ PROGRAMMING IS THAT IT IS MORE EFFICIENT TO USE, WHEREVER
65000 POSSIBLE, LITERALS INSTEAD OF VARIABLES WITH CONSTANT VALUE.
65050 ^SIMPLE VARIABLES APPEARING IN A PATTERN REQUIRE LITTLE EVALUATION
65100 (ONLY A DETERMINATION IF THEY HAVE A STRING OR PATTERN VALUE), AND
65150 EVEN CHARACTER CLASS PRIMITIVES (I.E. ^^SPAN, BREAK, \\ETC.)
65200 REQUIRE LITTLE EVALUATION, IF THEIR ARGUMENT IS NON-LITERAL, PROVIDED
65250 THE ARGUMENT IS A VARIABLE WITH A CONSTANT VALUE. ^EXAMPLES OF PATTERN ELEMENTS
65300 REQUIRING MORE EXTENSIVE EVALUATION ARE (NON-PATTERN PRIMITIVE)
65350 FUNCTION CALLS, NON-PATTERN EXPRESSIONS REQUIRING CONSIDERABLE
65400 EVALUATION IN THEIR OWN RIGHT, AND CHARACTER-CLASS PRIMITIVES
65450 WHOSE ARGUMENTS ARE OTHER THAN LITERALS OR SIMPLE VARIABLES. ^AN
65500 EXAMPLE OF THE LATTER CASE WOULD BE
65550 .SKIP 1
65600 .INDENT7
65650 ^^ANY('XYZ' OTHER)\\
65700 .SKIP 1
65750 ; EVEN IF THE VALUE OF ^^OTHER\\ REMAINS CONSTANT, THE CONCATENATION
65800 PRODUCES A NEW STRING EACH TIME, WHICH PREVENTS ^^ANY\\ FROM IMMEDIATELY
65850 USING THE BREAK TABLE IT HAS GENERATED ON THE LAST EXECUTION OF
65900 THAT CALL. ^IT HAS BEEN ASSUMED IN ALL THIS DISCUSSION OF PATTERN
65950 EVALUATION THAT THE VALUE OF THE PATTERN ELEMENT WOULD NOT
66000 CHANGE VALUE BETWEEN THE TIME OF ASSIGNMENT OF THE SUBPATTERN AND
66050 ITS USE IN A MATCH. ^SHOULD THIS NOT BE THE CASE, OF COURSE, THE
66100 ALTERNATIVE OF INCLUDING THE SUBPATTERN IN THE MATCH DOES NOT EXIST.
66150 .SKIP 1
66200 .INDENT 5
66250 ^EVEN WHEN INTEGER CONSTANTS CANNOT BE USED, IT IS STILL HELPFUL
66300 TO USE DEDICATED INTEGER VARIABLES OR EXPRESSIONS IN PATTERNS, IF
66350 POSSIBLE. ^DEDICATED INTEGER EXPRESSIONS ARE IDEALLY SUITABLE AS
66400 ARGUMENTS TO THE POSITIONAL PATTERN PRIMITIVES (I.E. ^^POS, LEN,\\ ETC.),
66450 AND INTEGER VARIABLES ARE IDEALLY SUITABLE AS OBJECTS OF THE CURSOR
66500 ASSIGNMENT OPERATOR (@). ^FOR EXAMPLE, SUPPOSE ONE WISHES
66550 TO TAKE A STRING COMPOSED OF SENTENCES SEPARATED BY SEMICOLONS (AND
66600 TERMINATED BY A SEMICOLON) AND OUTPUT THE SENTENCES ON SEPARATE LINES.
66650 ^A SINGLE PATTERN MATCH TO DO THIS WOULD BE
66700 .SKIP 1
66750 (^P IS ^^INTEGER\\):
66800 .SKIP 1
66850 .INDENT 7
66900 ^^STRING @P SUCCEED TAB(*P) BREAK(';') $ OUTPUT LEN(1)\\
66950 .SKIP 1
67000 +######@^P ^^RPOS(O)\\
67050 .SKIP 1
67100 ^NOTE THAT THE PATTERN REQUIRES NO EVALUATION.
67150 .SKIP 1
67200 .INDENT 5
67250 ^SINCE ^^FASBOL\\ DOES NOT EMPLOY THE ^^QUICKSCAN\\ HEURISTIC OF ASSUMING
67300 AT LEAST ONE CHARACTER FOR UNEVALUATED EXPRESSIONS, LEFT-RECURSIVE
67350 PATTERNS WILL LOOP INDEFINITELY AT EXECUTION TIME, AS THEY WOULD
67400 IN ^^SNOBOL\\4 UNDER ^^FULLSCAN\\. ^USUALLY A SET OF PATTERNS INVOLVING
67450 LEFT RECURSION CAN BE RE-WRITTEN TO ELIMINATE IT. ^TO TAKE A SIMPLE
67500 EXAMPLE, THE PATTERN
67550 .SKIP 1
67600 .INDENT 7
67650 ^P = *^P '^Z' ! '^Y'
67700 .SKIP 1
67750 , WHICH MATCHES STRINGS OF THE FORM '^Y', '^Y^Z', '^Y^Z^Z', '^^YZZZ\\', ETC.,
67800 COULD BE RE-WRITTEN AS THE PAIR OF PATTERNS
67850 .SKIP 1
67900 .INDENT 7
67950 ^P1 = '^Z' *^P1 ! ''
68000 .INDENT 7
68050 ^P# = '^Y' ^P1
68100 .SKIP 1
68150 3.2.4 ^&^TIMING AND STORAGE MANAGEMENT\&
68200 .SKIP 1
68250 .INDENT 5
68300 ^THE ^^TIMER \\OPTION PERMITS THE PROGRAMMER TO MONITOR THE OPERATION
68350 OF ANY (OR ALL) SEPARATELY COMPILED PROGRAMS, AND PROVIDE FEEDBACK ON WHERE
68400 THE TIME IS BEING SPENT. ^INITIAL PROGAMMING OF SOME PROBLEM CAN BE
68450 DONE RAPIDLY WITH NOT MUCH ATTENTION BEING PAID TO OPTIMIZATION.
68500 ^IT IS USUALLY THE CASE THAT SOME SMALL SECTIONS OF A PROGRAM ACCOUNT
68550 FOR A LARGE PERCENTAGE OF THE EXECUTION TIME; THESE ARE
68600 IDENTIFIED USING THE ^^TIMER\\ OPTION. ^THE PROGRAMMER'S TIME IS THEN
68650 SPENT MOST EFFICIENTLY OPTIMIZING THE CRITICAL AREAS AND IGNORING
68700 THE REST. ^OF COURSE, AFTER A SERIES OF OPTIMIZATIONS, A NEW
68750 BOTTLENECK WILL DEVELOP; THE PROCESS CAN THEN BE ITERATED UNTIL
68800 THE LAW OF DIMINISHING RETURNS TAKES HOLD. ^FINALLY, THE ^^TIMER\\
68850 DECLARATIONS CAN BE REMOVED AND THE PROGRAMS RUN IN PRODUCTION MODE.
68900 .SKIP 1
68950 .INDENT 5
69000 ^THE PROGRAMMER HAS A LARGE DEGREE OF CONTROL OVER STORAGE
69050 MANAGEMENT IN ^^FASBOL\\, WHICH IN TURN MEANS CONTROL OVER THE
69100 SPACE/TIME TRADEOFF THAT EXISTS DUE TO THE DYNAMIC STORAGE ALLOCATION
69150 SYSTEM (FREE STORAGE). ^TO BEGIN WITH, REQUESTS FROM THE FREE STORAGE
69200 SYSTEM PRIOR TO THE FIRST GARBAGE COLLECTION (REGENERATION OF
69250 DYNAMIC STORAGE) HAVE VERY LITTLE OVERHEAD COMPARED TO ONES
69300 SUBSEQUENT TO THE FIRST GARBAGE COLLECTION. ^UNLESS THERE ARE
69350 GOOD REASONS FOR THE CONTRARY, THE USER SHOULD CAPITALIZE ON
69400 THIS BY STARTING HIS EXECUTION WITH APPROXIMATELY THE AMOUNT OF CORE
69450 HE EXPECTS WILL EVENTUALLY BE REQUIRED - PAST EXPERIENCE WITH THE
69500 PROGRAM IS THE BEST GUIDE. ^THUS THE NUMBER OF GARBAGE COLLECTIONS WILL BE
69550 REDUCED TO A MINIMUM, AND INITIAL EXECUTION SPEEDED UP. ^IN THE
69600 ABSENCE OF A CORE SPECIFICATION, THE PROGRAM WILL BEGIN WITH THE
69650 MINIMUM REQUIRED FOR LOADING, AND WILL EXPAND CORE AS IT BECOMES
69700 NECESSARY, BUT UNDERGOING MORE GARBAGE COLLECTIONS.
69750 .SKIP 1
69800 .INDENT 5
69850 ^THE _&^^DENSITY\\ KEYWORD IS ALSO USEFUL IN CONTROLLING THE SPACE/TIME
69900 TRADEOFF. _&^^DENSITY\\ MAY BE SET DYNAMICALLY TO ANY VALUE BETWEEN
69950 1 AND 100; IMMEDIATELY FOLLOWING A GARBAGE COLLECTION, THE DYNAMIC
70000 STORAGE ALLOCATION MECHANISM ATTEMPTS TO SATISFY THIS VALUE,
70050 INTERPRETED AS THE PERCENTAGE OF TOTAL STORAGE ALLOCATED THAT IS IN USE
70100 AT THAT TIME. ^NOTHING IS DONE UNLESS THE ACTUAL RATIO IS GREATER
70150 THAN THE DESIRED ONE, IN WHICH CASE CORE IS EXPANDED TO SATISFY THE
70200 DESIRED RATIO, OR UNTIL USER CORE LIMITS ARE REACHED. ^FOR EXAMPLE
70250 A USER WHO SETS _&^^DENSITY\\ TO 99 IS SAYING HE WISHES TO KEEP HIS
70300 CORE SIZE TO A MINIMUM, AND IS WILLING TO PAY A (RATHER LARGE)
70350 PREMIUM IN REPEATED GARBAGE COLLECTIONS. ^ON THE OTHER HAND, A USER WHO
70400 SETS _&^^DENSITY\\ TO 1 IS ASKING FOR ALL THE CORE HE CAN GET, IN ORDER
70450 THAT HIS PROGRAM EXECUTE AS RAPIDLY AS POSSIBLE. ^IT IS ALSO PERFECTLY FEASIBLE
70500 TO USE A STRATEGY WHERE _&^^DENSITY\\ IS SET TO DIFFERENT VALUES
70550 AT DIFFERENT TIMES DURING EXECUTION. ^THE INITIAL VALUE OF
70600 _&^^DENSITY\\ IS 75, WHICH REPRESENTS A GENERAL-PURPOSE COMPROMISE.
70650 .SKIP 1
70700 .INDENT 5
70750 ^IF A USER'S APPLICATION WILL OCCASIONALLY REQUIRE LARGE CONTIGUOUS
70800 BLOCKS OF STORAGE, HE MAY GIVE HIMSELF 100% INSURANCE BY RESERVING
70850 DUMMY ARRAYS OF THE APPROPRIATE SIZE AT THE VERY BEGINNING OF HIS
70900 PROGRAM. ^AN ALTERNATIVE IS TO TURN ON THE KEYWORD _&^^SLOWFRAG\\,
70950 WHICH ACTIVATES A HEURISTIC WHICH TENDS TO SLOW DOWN THE FRAGMENTATION
71000 OF LARGE BLOCKS AT THE EXPENSE OF SOME WASTED STORAGE. ^WHILE
71050 NOT 100% GUARANTEED, IT WILL GIVE THE DESIRED EFFECT IN MOST CASES,
71100 MINIMIZING THE SITUATION WHERE A LARGE BLOCK IS CALLED FOR, AND
71150 THOUGH ENOUGH TOTAL STORAGE IS AVAILABLE, NO CONTIGUOUS
71200 AREA IS LARGE ENOUGH TO SATISFY THE REQUEST.
71250 .SKIP 1
71300 .INDENT 5
71350 ^FINALLY, THE ^^COLLECT\\ PRIMITIVE MAY BE INVOKED AT APPROPRIATE
71400 TIMES, BOTH TO FORCE A REGENERATION AND ALSO MEASURE THE
71450 AMOUNT OF STORAGE THAT IS AVAILABLE.
71500 .SKIP 1
71550 3.2.5 ^&^^FORTRAN\\ INTERFACE\&
71600 .SKIP 1
71650 .INDENT 5
71700 ^EXTERNAL ^^FORTRAN\\ SUBROUTINES, WHETHER USER-WRITTEN OR FROM
71750 THE ^^FORTRAN\\ LIBRARY MUST BE DECLARED, INCLUDING THE NUMBER OF ARGUMENTS
71800 EXPECTED. ^A FUNCTION CALL TO THE EXTERNAL SUBROUTINE MAY HAVE ANY
71850 EXPRESSION (EXCEPT PATTERNS) AS ARGUMENTS, BUT ALL BUT A FEW RECOGNIZED
71900 EXPRESSIONS ARE ASSUMED TO EVALUATE TO INTEGERS AND WILL CAUSE AN ERROR
71950 EXIT IF NOT. ^DEDICATED INTEGER AND REAL VARIABLES ARE PASSED
72000 DIRECTLY TO THE SUBROUTINE, AS THEY WOULD IN A CALL FROM A ^^FORTRAN\\
72050 PROGRAM. ^ALSO, DEDICATED INTEGER AND REAL EXPRESSIONS ARE EVALUATED,
72100 THE VALUE IS SAVED IN A TEMPORARY LOCATION, AND THIS LOCATION PASSED TO
72150 THE ^^FORTRAN\\ ROUTINE. ^FINALLY, DEDICATED STRING VARIABLES AND LITERALS
72200 ARE PASSED TO ^^FORTRAN \\AS A VECTOR, THE FIRST WORD OF WHICH IS
72250 POINTED TO BY THE CALLING SEQUENCE, AND THE ^^FORTRAN\\ ROUTINE MAY
72300 INTERPRET IT AS ONE-DIMENSIONAL ARRAY OF ^^ASCII\\ CHARACTERS PACKED
72350 FIVE TO A WORD. ^IN ADDITION TO RETURNING AN INTEGER OR REAL VALUE, THE
72400 FUNCTION MAY MODIFY THE VALUE OF ANY DEDICATED INTEGER, REAL, OR STRING
72450 VARIABLE THAT IS PASSED TO IT. ^IN THE LAST CASE, NOT ONLY MAY THE
72500 CHARACTERS BE MODIFIED, BUT THE CHARACTER COUNT MAY BE CHANGED BY STORING
72550 IT IN THE RIGHT HALF OF THE WORD IMMEDIATELY PRECEDING THE
72600 FIRST WORD OF THE STRING (ARRAY(^0)). ^FOR EXAMPLE, SUPPOSE A ^^FASBOL\\
72650 PROGRAM CONTAINS THE DECLARATIONS
72700 .SKIP 1
72750 .INDENT 7
72800 ^^DECLARE('INTEGER' , 'I')
72850 .INDENT 7
72900 DECLARE('REAL' , 'R')
72950 .INDENT 7
73000 DECLARE('STRING' , 'S(15)')
73050 .INDENT 7
73100 DECLARE('EXTERNAL.FORTRAN.FUNCTION' , 'GETDAT(3)')\\
73150 .SKIP 1
73200 AND THE ^^FORTRAN \\FUNCTION ^^GETDAT\\ IS DEFINED AS
73250 .SKIP 1
73300 .INDENT 7
73350 .TAB STOPS 30
73400 ^^FUNCTION GETDAT(INDEX,ISTR,IDAT)
73450 .INDENT 7
73500 COMMON IDATA(1000, 4)
73550 .INDENT 7
73600 EQUIVALENCE (RDATA, IDATA)
73650 .INDENT 7
73700 DIMENSION ISTR(3), RDATA(1000, 4)
73750 .INDENT 7
73800 ISTR(1) = IDATA(INDEX, 1)
73850 .INDENT 7
73900 ISTR(2) = IDATA(INDEX, 2)
73950 .INDENT 7
74000 ISTR(0) = (ISTR(0) /2**18)*2**18+10
74050 .INDENT 7
74100 IDAT = IDATA(INDEX, 3)
74150 .INDENT 7
74200 GETDAT = RDATA(INDEX, 4)
74250 .INDENT 7
74300 RETURN
74350 .INDENT 7
74400 END\\
74450 .SKIP 1
74500 , THEN A TYPICAL USE OF ^^GETDAT\\ WITHIN THE ^^FASBOL\\ PROGRAM
74550 MIGHT BE
74600 .SKIP 1
74650 .INDENT 7
74700 ^R = ^^GETDAT\\(2, ^S, ^I)
74750 .SKIP 1
74800 ,WHICH WOULD HAVE THE EFFECT OF SETTING ^I TO SOME INTEGER VALUE, ^R TO
74850 SOME REAL VALUE, AND ^S TO A 10-CHARACTER STRING.
74900 .SKIP 1
74950 .INDENT 5
75000 ^ENTRIES THAT ARE EXPECTED FROM ^^FORTRAN\\ MUST BE DECLARED WITH THE
75050 ^^ENTRY.FORTRAN.FUNCTION\\ DECLARATION. ^THIS WORKS LIKE ^^ENTRY.FUNCTION\\
75100 IN THAT AN AUTOMATIC ^^DEFINE\\ IS PERFORMED ON THE FIRST CALL. ^VALID ACTUAL
75150 ARGUMENTS IN THE ^^FORTRAN\\ CALL TO ^^FASBOL\\ CAN BE
75200 INTEGERS, REALS, AND ^HOLLERITH ARRAYS (AS DESCRIBED
75250 ABOVE, DENOTED BY THE CODES 0,2, AND 5 IN THE CALLING SEQUENCE.
75300 ^UPON ENTERING ^^FASBOL\\, THE ACTUAL ARGUMENTS ARE COPIED, AND
75350 CONVERTED IF NECESSARY, INTO THE FORMAL ARGUMENTS, WHICH ARE
75400 DEDICATED OR DESCRIPTOR MODE ^^FASBOL\\ VARIABLES. ^THE RIGHT HALF OF THE
75450 WORD IMMEDIATELY PRECEDING THE FIRST WORD OF A ^HOLLERITH ARRAY IS
75500 CONSIDERED TO BE THE CHARACTER COUNT, AND MAY BE MODIFIED BY ^^FASBOL\\
75550 IF THE STRING ARGUMENT IS MODIFIED. ^UPON RETURN TO ^^FORTRAN\\
75600 (VIA ^^RETURN\\), THE FUNCTION VALUE IS DETERMINED BY DEDICATED OR
75650 DESCRIPTOR VALUE IN THE VARIABLE CORRESPONDING TO THE FUNCTION NAME,
75700 BUT MUST BE INTEGER OR REAL. ^THE FORMAL ARGUMENT VALUES ARE COPIED BACK
75750 (AND RE-CONVERTED, IF NECESSARY) INTO THE ACTUAL ARGUMENTS IN THE ^^FORTRAN\\
75800 CALLING SEQUENCE, THUS PROVIDING A MEANS OF PASSING BACK ADDITIONAL
75850 VALUES, BESIDES THE FUNCTION VALUE, TO ^^FORTRAN\\.
75900 .SKIP 1
75950 .INDENT 5
76000 ^IT SHOULD BE
76050 NOTED THAT ^^FORTRAN\\ IS NOT RECURSIVE, AND THEREFORE ANY RECURSIVE
76100 COMBINATION OF ^^FASBOL\\ AND ^^FORTRAN\\ CALLS WILL NOT WORK. ^EVEN
76150 WHEN A SERIES OF CALLS IS NOT RECURSIVE, CARE MUST BE TAKEN NOT TO
76200 RE-ENTER A ^^FASBOL\\ ROUTINE WHICH HAS A ^^FORTRAN\\ CALL PENDING,
76250 BECAUSE THE ^^FASBOL\\ ROUTINE USES THE SAME TEMPORARY STORAGE
76300 LOCATIONS FOR ALL ^^FORTRAN\\ CALLS, INCLUDING THE PREDEFINED PRIMITIVES
76350 ^^IGT\\, ETC.
76400 .SKIP 1
76450 .INDENT 5
76500 ^IN WRITING ^^FORTRAN\\ PROGRAMS TO BE USED WITH ^^FASBOL\\ PROGRAMS,
76550 CARE SHOULD BE TAKEN NOT TO PERFORM ANY ^I/^O, OR USE ANY OTHER
76600 ^^FORTRAN\\ FACILITY THAT REQUIRES THE ^^FORTRAN\\ RUNTIME SYSTEM
76650 (^^FORSE.)\\ TO BE LOADED.
76700 .SKIP 1
76750 .INDENT 5
76800 ^^FORTRAN\\ SUBROUTINES MUST BE COMPILED WITH THE ^F40 COMPILER,
76850 NOT WITH ^^FORTRAN\\-10.
76900 .PAGE
76950 .SKIP 2
77000 .CENTRE
77050 ^^APPENDIX\\ 1
77100 .SKIP 1
77150 .INDENT 15
77200 ^SYNTAX FOR ^^FASBOL II\\
77250 .SKIP 1
77300 ^&^EXPLANATION OF SYNTAX NOTATION\&
77350 .SKIP 1
77400 1. ^ALL TERMINAL SYMBOLS ARE UNDERLINED, THE REMAINDER OF THE SYNTAX
77450 CONSISTING OF NON-TERMINALS AND SYNTAX PUNCTUATION.
77500 .SKIP 1
77550 2. ^THE ::= OPERATOR INDICATES EQUIVALENCE.
77600 .SKIP 1
77650 3. ^THE | OPERATOR INDICATES A SERIES OF ALTERNATIVES.
77700 .SKIP 1
77750 4. ^THE BLANKS BETWEEN CONSECUTIVE ELEMENTS INDICATE CONCATENATION.
77800 .SKIP 1
77850 5. ^THE _\ OPERATOR INDICATES THE SPECIFIC RULING OUT OF THE
77900 IMMEDIATELY FOLLOWING ELEMENT AS A PRECONDITION FOR FURTHER
77950 CONCATENATION.
78000 .SKIP 1
78050 6. ^THE ... OPERATOR INDICATES THE INDEFINITE REPETITION OF THE
78100 IMMEDIATELY PRECEDING ELEMENT.
78150 .SKIP 1
78200 7. ^THE < > BRACKETS SERVE TO GROUP EXPRESSIONS INTO A SINGLE ELEMENT.
78250 .SKIP 1
78300 8. ^THE [ ] BRACKETS INDICATE THE OPTIONAL OCCURENCE OF THE
78350 EXPRESSION CONTAINED WITHIN BRACKETS, AND ALSO SERVE TO GROUP THE
78400 EXPRESSION INTO A SINGLE ELEMENT.
78450 .SKIP 1
78500 9. ^THE ORDER OF PRECEDENCE FOR THE OPERATORS, FROM HIGHEST TO LOWEST,
78550 IS: _\ ... (BLANKS) | ::=.
78600 .PAGE
78650 ^&^SYNTAX\&
78700 .SKIP 1
78750 .NOFILL
78800 PROGRAM::= [DECLARATION | COMMENT]... [EXECUTE.BODY] END.STATEMENT
78850 DECLARATION::= BL ^&^^DECLARE\\(\& [BL] DECLARATION.TYPE [BL] &) EOS
78900 COMMENT::= &* [CHAR]... EOL | &- [BL] CONTROL.TYPE [BL] EOL
78950 EXECUTE.BODY::= STATEMENT [STATEMENT]...
79000 END.STATEMENT::= ^&^^END\&\\ [BL LABEL] EOS
79050 BL:= <^&BLANK\& | ^&TAB\&> [BL] | EOL <&+ | &.> [BL]
79100 EOS::= [BL] <&; | EOL>
79150 EOL::= ^&CARRIAGE.RETURN\& ^&LINEFEED\& [^&FORMFEED\&]...
79200 STATEMENT::= COMMENT | [LABEL.FIELD] [STATEMENT.BODY] [GOTO.FIELD] EOS
79250 LABEL.FIELD::= _\<&^E&^N&^D BL> LABEL
79300 GOTO.FIELD::= BL &: [BL] <GOTO | &^S GOTO [BL] [&^F GOTO] | &^F GOTO [BL]
79350 .BREAK
79400 [&^S GOTO]>
79450 GOTO::= &( [BL] <IDENTIFIER | &$ STRING.PRIMARY> [BL] &)
79500 STATEMENT.BODY::= DEGENERATE | ASSIGNMENT | MATCH | REPLACEMENT
79550 DEGENERATE::= BL STRING.PRIMARY
79600 ASSIGNMENT::= BL VARIABLE EQUALS [BL EXPRESSION]
79650 MATCH::= BL STRING.PRIMARY BL PATTERN.EXPRESSION
79700 REPLACEMENT::= BL VARIABLE BL PATTERN.EXPRESSION EQUALS [BL
79750 STRING.EXPRESSION]
79800 EQUALS::= BL <&= | &__>
79850 VARIABLE::= _\PATTERN.IDENTIFIER IDENTIFIER | &_& UNPROTECTED.KEYWORD
79900 | STRING.VARIABLE
79950 EXPRESSION::= STRING.EXPRESSION | _\<STRING.PRIMARY
80000 [BL STRING.PRIMARY]... > PATTERN.EXPRESSION
80050 PATTERN.EXPRESSION::= CONJUNCTION [BL &! BL CONJUNCTION]...
80100 CONJUNCTION::= PATTERN.TERM [BL PATTERN.TERM]...
80150 PATTERN.TERM::= PATTERN.PRIMARY [<BL &. BL | BL &$ BL>
80200 PATTERN.VARIABLE]...
80250 PATTERN.PRIMARY::= PATTERN.IDENTIFIER | PATTERN.PRIMITIVE | &@
80300 PATTERN.VARIABLE | [&*] STRING.PRIMARY | SUM | &( [BL]
80350 PATTERN.EXPRESSION [BL] &)
80400 PATTERN.VARIABLE::= [&*] VARIABLE
80450 STRING.EXPRESSION::= SUM [BL SUM]...
80500 SUM::= TERM [<BL &+ BL | BL &- BL> TERM]...
80550 TERM::= FACTOR [<BL &* BL | BL &/ BL> FACTOR]...
80600 FACTOR::= STRING.PRIMARY [BL <&*&* | &_^> BL STRING.PRIMARY]...
80650 STRING.PRIMARY::= _\PATTERN.IDENTIFIER IDENTIFIER | LITERAL | &_&
80700 < UNPROTECTED.KEYWORD | PROTECTED.KEYWORD> | STRING.VARIABLE |
80750 <&? | &_\ | &- | &+> STRING.PRIMARY | &. VARIABLE | &(
80800 [BL] STRING.EXPRESSION [BL] &)
80850 LITERAL::= INTEGER.LITERAL | REAL.LITERAL | STRING.LITERAL
80900 STRING.VARIABLE::= &$ STRING.PRIMARY | ARRAY.ELEMENT |
80950 PROCEDURE.CALL
81000 PROCEDURE.CALL::= _\PATTERN.PRIMITIVE < IDENTIFIER &( [BL]
81050 [PARAMETER.LIST] [BL] &)>
81100 ARRAY.ELEMENT::= _\PATTERN.IDENTIFIER IDENTIFIER <&< | &[> [BL]
81150 [PARAMETER.LIST] [BL] <&> | &]>
81200 PARAMETER.LIST::= EXPRESSION [PC EXPRESSION]...
81250 PC::= [BL] &, [BL]
81300 IDENTIFIER::= LETTER [LETTER | DIGIT | &. | &-]...
81350 LABEL::= _\<^&BLANK\& | &T&A&B | &; | &+ | &- | &. | &*> CHAR [_\^&<BLANK\&
81400 | &T&A&B | &;> CHAR]...
81450 INTEGER.LITERAL::= DIGIT [DIGIT]...
81500 REAL.LITERAL::= DIGIT [DIGIT]... &. [DIGIT]...
81550 STRING.LITERAL::= &' [_\<&' _\&'> <&'&' | CONT.CHAR>]... &' | &" [_\<&" _\&">
81600 <&"&" | CONT.CHAR>]... &"
81650 CONT.CHAR::= CHAR [EOL <&+ | &.>]...
81700 LETTER::= ^^&A | &B | &C | &D | &E | &F | &G | &H | &I | &J |
81750 &K | &L | &M | &N | &O | &P | &Q | &R | &S | &T | &U |
81800 &V | &W | &X | &Y | &Z\\ | &a | &b | &c | &d | &e | &f |
81850 &g | &h | &i | &j | &k | &l | &m | &n | &o | &p | &q |
81900 &r | &s | &t | &u | &v | &w | &x | &y | &z
81950 DIGIT::= &0 | &1 | &2 | &3 | &4 | &5 | &6 | &7 | &8 | &9
82000 CHAR::= ^&ANY.PRINTING.CHARACTER\&
82050 PROTECTED.KEYWORD::= ^^^&STFCOUNT\& | ^&LASTNO\& | ^&STNO\& |
82100 ^&FNCLEVEL\& | ^&STCOUNT\& | ^&ERRTYPE\& | ^&RTNTYPE\& | ^&ALPHABET\\\&
82150 UNPROTECTED.KEYWORD::= ^^^&ABEND\& | ^&ANCHOR\& | ^&FULLSCAN\& |
82200 ^&STNTRACE\& | ^&MAXLNGTH\& | ^&STLIMIT\& | ^&ERRLIMIT\& |
82250 ^&DENSITY\& | ^&INPUT\& | ^&OUTPUT\& | ^&DUMP\& | ^&SLOWFRAG\&\\
82300 PATTERN.IDENTIFIER::= ^^^&FAIL\& | ^&FENCE\& | ^&ABORT\& | ^&ARB\& |
82350 ^&BAL\& | ^&SUCCEED\& | ^&REM\&\\
82400 PATTERN.PRIMITIVE::= <^^^&LEN\& | &T&A&B | ^&RTAB\& | &P&O&S | ^&RPOS\& |
82450 ^&SPAN\& | ^&NSPAN\& | ^&BREAK\& | ^&BREAKX\& | &A&N&Y |
82500 ^&NOTANY\&\\> &( [BL] <STRING.EXPRESSION | &* STRING.PRIMARY>
82550 [BL] &) | ^&^^ARBNO\&\\&( [BL] PATTERN.EXPRESSION [BL] &)
82600 CONTROL.TYPE::= ^^^&LIST\& | ^&UNLIST\& | ^&NOCODE\& | ^&CODE\& |
82650 ^&EJECT\& | ^&SPACE\&\\ [BL INTEGER.LITERAL] | ^^^&NOCROSS\& |
82700 ^&CROSREF\& | ^&FAIL\& | ^&NOFAIL\&\\
82750 DECLARATION.TYPE::=
82800 .LEFT MARGIN 8
82850 ^^^&'OPTION'\\\& PC <'^^^&NO.STNO'\& | ^&'TIMER'\& | ^&'HASHSIZE=\&\\
82900 INTEGER.LITERAL &'> |
82950 ^^^&'SNOBOL.MAIN'\&\\ PC &' IDENTIFIER &' |
83000 ^^^&'SNOBOL.SUBPROGRAM'\&\\ PC &' IDENTIFIER &' |
83050 ^^^&'PURGE.VARIABLE'\\\& PC <&^A&^L&^L | &' IDENTIFIER.LIST &'> |
83100 ^^^&'UNPURGE.VARIABLE'\\\& PC &' IDENTIFIER.LIST &' |
83150 ^^^&'PURGE.LABEL'\\\& PC <&^A&^L&^L | &' LABEL.LIST &'> |
83200 ^^^&'UNPURGE.LABEL'\\\& PC &' LABEL.LIST &' |
83250 ^^^&'PURGE.FUNCTION'\\\& PC <&^A&^L&^L | &' IDENTIFIER.LIST &'> |
83300 ^^^&'UNPURGE.FUNCTION'\\\& PC &' IDENTIFIER.LIST &' |
83350 ^^^&'STRING'\\\& PC &' STRING.SPECIFIER.LIST &' |
83400 ^^^&'INTEGER'\\\& PC &' IDENTIFIER.LIST &' |
83450 ^^^&'REAL'\\\& PC &' IDENTIFIER LIST &' |
83500 ^^^&'RENAME'\\\& PC &' IDENTIFIER &' PC &' IDENTIFIER &' |
83550 ^^^&'GLOBAL.VARIABLE'\\\& PC &' IDENTIFIER.LIST &' |
83600 ^^^&'GLOBAL.LABEL'\\\& PC &' LABEL.LIST &' |
83650 ^^^&'GLOBAL.FUNCTION'\\\& PC &' IDENTIFIER.LIST &' |
83700 ^^^&'EXTERNAL.VARIABLE'\\\& PC &' RESTRICTED.IDENTIFIER.LIST &' |
83750 ^^^&'ENTRY.VARIABLE'\\\& PC &' RESTRICTED.IDENTIFIER.LIST &' |
83800 ^^^&'EXTERNAL.LABEL'\\\& PC &' RESTRICTED.LABEL.LIST &' |
83850 ^^^&'ENTRY.LABEL'\\\& PC &' RESTRICTED.LABEL.LIST &' |
83900 ^^^&'EXTERNAL.FUNCTION'\\\& PC &' RESTRICTED.IDENTIFIER.LIST &' |
83950 ^^^&'ENTRY.FUNCTION'\\\& PC &' RESTRICTED.IDENTIFIER &( [BL]
84000 [IDENTIFIER.LIST [BL] &) [[BL] IDENTIFIER.LIST] &' [PC
84050 &' LABEL &'] |
84100 ^^^&'EXTERNAL.FORTRAN.FUNCTION'\\\& PC &' FORTRAN.IDENTIFIER.LIST &' |
84150 ^^^&'ENTRY.FORTRAN.FUNCTION'\\\& PC &' RESTRICTED.IDENTIFIER &( [BL]
84200 [IDENTIFIER.LIST] [BL] &)&' [PC &' LABEL &']
84250 .LEFT MARGIN 0
84300 IDENTIFIER.LIST::= IDENTIFIER [PC IDENTIFIER]...
84350 LABEL.LIST::= LABEL [BL LABEL]...
84400 STRING.SPECIFIER.LIST::= STRING.SPECIFIER [PC STRING.SPECIFIER]...
84450 STRING.SPECIFIER::= IDENTIFIER &( INTEGER.LITERAL &)
84500 RESTRICTED.IDENTIFIER.LIST::= RESTRICTED.IDENTIFIER
84550 [PC RESTRICTED.IDENTIFIER]...
84600 RESTRICTED.LABEL.LIST::= RESTRICTED.IDENTIFIER
84650 [BL RESTRICTED.IDENTIFIER]...
84700 FORTRAN.IDENTIFIER.LIST::= FORTRAN.IDENTIFIER
84750 [PC FORTRAN.IDENTIFIER]...
84800 FORTRAN.IDENTIFIER::= IDENTIFIER [&= <^^^&INTEGER\& | ^&REAL\\\&>]
84850 &( INTEGER.LITERAL &)
84900 RESTRICTED.IDENTIFIER::= LETTER [LND [LND [LND [LND [LND ]]]]]
84950 LND::= LETTER | DIGIT | &.
85000 .PAGE
85050 .SKIP 2
85100 .CENTRE
85150 ^^APPENDIX\\ 2
85200 .SKIP 1
85250 ^&^PREDEFINED ^SYMBOLS\&
85300 .SKIP 1
85350 1. ^^GLOBAL\\ AND ^^EXTERNAL\\ VARIABLES
85400 ^^INPUT INPUTC OUTPUT OUTPUTC\\
85450 .SKIP 1
85500 2. ^^GLOBAL\\ AND ^^EXTERNAL\\ LABELS
85550 ^^END FRETURN NRETURN RETURN\\
85600
85650 .SKIP 1
85700 .FILL
85750 .JUSTIFY
85800 3. ^^EXTERNAL.FORTRAN \\FUNCTIONS (ALL INTEGER VALUED) ^^AND(2)
85850 FREEZE(0) IEQ(2) IGE(2) IGT(2) ILE(2) ILT(2) INE(2) LSHIFT(2) NOT(1)
85900 OR(2) REMDR(2) RSHIFT(2) XOR(2)\\
85950 .SKIP 1
86000 .NOFILL
86050 4. ^PRIMITIVE PATTERN VARIABLES
86100 ^^ABORT ARB BAL FAIL FENCE REM SUCCEED\\
86150 .SKIP 1
86200 5. ^PRIMITIVE PATTERN FUNCTIONS
86250 ^^ANY ARBNO BREAK BREAKQ BREAKX LEN NOTANY NSPAN POS RPOS RTAB SPAN TAB\\
86300 .SKIP 1
86350 6. ^PREDEFINED PRIMITIVE FUNCTIONS
86400 .FILL
86450 .JUSTIFY
86500 ^^APPLY ARRAY CLOSE COLLECT CONVERT COPY DATA DATATYPE DATE DAYTIM
86550 DEFINE DETACH DIFFER DUPL EJECT ENTER EQ EXTIME GE GT IDENT
86600 INPUT INSERT INTEGER ITEM LE LGT LOOKUP LPAD LT NE OPEN OPSYN
86650 OUTPUT PROTOTYPE REAL RELEASE REPLACE REVERS RPAD SIZE SUBSTR TABLE
86700 TIME TRIM\\
86750
86800 .PAGE
86850 .SKIP 2
86900 .CENTRE
86950 ^^APPENDIX\\ 3
87000 .SKIP 1
87050 ^&^RUNTIME ^ERRORS\&
87100 .SKIP 1
87150 .CENTRE
87200 ^CONDITIONALLY ^FATAL
87250 .SKIP 1
87300 .NOFILL
87350 1. ^ILLEGAL ^DATA ^TYPE
87400 2. ^ERROR IN ^ARITHMETIC ^OPERATION
87450 3. ^ERRONEOUS ^ARRAY OR ^TABLE ^REFERENCE
87500 4. ^NULL ^STRING IN ^ILLEGAL ^CONTEXT
87550 5. ^UNDEFINED ^FUNCTION OR ^OPERATION
87600 6. ^ERRONEOUS ^PROTOTYPE
87650 7. ^DEDICATED ^STRING ^OVERFLOW
87700 8. ^VARIABLE ^NOT ^PRESENT ^WHERE ^REQUIRED
87750 9. ^REAL TO ^STRING ^CONVERSION ^OVERFLOW
87800 10. ^ILLEGAL ^ARGUMENT TO ^PRIMITIVE ^FUNCTION
87850 11. ^READING ^ERROR
87900 12. ^ILLEGAL ^I/^O ^UNIT
87950 13. ^LIMIT ON ^DEFINED ^DATATYPES OR ^TABLES ^EXCEEDED
88000 14. ^NEGATIVE ^NUMBER IN ^ILLEGAL ^CONTEXT
88050 15. ^STRING ^OVERFLOW
88100 .SKIP 1
88150 .CENTRE
88200 ^UNCONDITIONALLY ^FATAL
88250 .SKIP 1
88300 17. ^ERROR IN ^^FASBOL\\ ^SYSTEM
88350 18. ^RETURN FROM ^ZERO ^LEVEL
88400 19. ^FAILURE ^DURING ^GOTO ^EVALUATION
88450 20. ^INSUFFICIENT ^STORAGE TO ^CONTINUE
88500 21. ^ILLEGAL ^MEMORY ^REFERENCE
88550 22. ^LIMIT ON ^STATEMENT ^EXECUTION ^EXCEEDED
88600 23. ^OBJECT ^EXCEEDS ^SIZE ^LIMIT
88650 24. ^UNDEFINED OR ^ERRONEOUS ^GOTO
88700 25. [UNUSED]
88750 26. [UNUSED]
88800 27. ^WRITING ^ERROR
88850 28. ^EXECUTION OF ^STATEMENT WITH ^COMPILATION ^ERROR
88900 29. ^FAILURE ^UNDER ^^NOFAIL\\
88950 30. ^DIVIDE ^CHECK
89000 31. ^ARITHMETIC ^OVERFLOW
89050 .PAGE
89100 .FILL
89150 .JUSTIFY
89200 .SKIP 2
89250 .CENTRE
89300 ^^REFERENCES\\
89350 .SKIP 1
89400 1. ^SANTOS, ^P. ^J., "^^FASBOL, A SNOBOL\\4 ^COMPILER", ^PH.^D ^THESIS,
89450 ^UNIVERSITY OF ^CALIFORNIA, ^BERKELEY, ALSO ^MEMORANDUM ^NO. ^^ERL-M314,\\
89500 ^ELECTRONICS ^RESEARCH ^LABORATORY, ^UNIVERSITY OF ^CALIFORNIA, ^BERKELEY,
89550 ^DECEMBER 1971.
89600 .SKIP 1
89650 2. ^GRISWOLD, ^R. ^E., ^POAGE, ^J. ^F., AND ^POLONSKY, ^I. ^P.,
89700 ^&^THE ^^SNOBOL\\4 ^PROGRAMMING ^LANGUAGE\&, ^PRENTICE-^HALL (1971)
89750 (^SECOND ^EDITION).
89800 .SKIP 1
89850 3. ^DEWAR, ^B. ^K., AND ^BELCHER, ^K., "^^SPITBOL\\",
89900 ^^^&SIGPLAN N\\OTICES OF THE ^A^C^M\&, 4, &1&1 (1969), PP. 33-35.