174J)K)L)M)N)O)P)a)b)c)d)e)van Wijngaarden, et al.FPATTERN :: structured with INSERTION field letter iprocedure yielding FIVMAT field letter p letter f mode.GPATTERN :: structured with INSERTION field letter irow of procedure yielding integral fieldletter s letter p letter e letter c mode.FIVMAT ::mui definition of structured withrow of structured with integral field letter c letter pintegral field letter c letter o letter u letter n letter tintegral field letter b letter prow of union ofstructured withunion of PATTERN CPATTERNstructured with INSERTION field letter iprocedure yielding mui application fieldletter p letter fmodeGPATTERN voidmode field letter pINSERTION field letter imodeCOLLITEMmode field letter cmode field letter alephmode.{'FIVMAT' is equivalent (2.1.1.2.a) to 'FORMAl".}MARK :: sign ; point ; exponent ; complex ; boolean.COMARK :: zero ; digit ; character.UNSUPPRESSETY :: unsuppressible ; EMPTY.TYPE :: integral ; real ; boolean ; complex ; string ; bits ;integral choice ; boolean choice ; format ; general.FORMAT NEST format text{5D} : formatter{94f} token,NEST collection{b} list, formatter{94f} token.NEST collection{a,b} :pragment{92a} sequence option, NEST picture{c} ;pragment{92a} sequence option, NEST insertion{d},NEST replicator{g}, NEST collection{b} list brief pack,pragment{92a} sequence option, NEST insertion{d}.NEST picture{b} : NEST TYPE pattern{A342a,A343a,A344a,A345a,A346a,A347a,A348a,b,A349a,A34Aa} option,NEST insertion{d}.NEST insertion{b,c,j,k,A347b,A348a,b,A349a,A34Aa} :NEST literal{i} option, NEST alignment{e} sequence option.NEST alignment{d} :NEST replicator{g}, alignment code{f}, NEST literal{i} option.g)h)J)k)m)n)o){Examples:ALGOL <strong>68</strong> Revised Report 175alignment code{e} : letter k{94a} symbol ; letter x{94a} symbol ;letter y{94a} symbol ; letter 1{94a} symbol ; letter p{94a} symbol ;letter q{94a} symbol.NEST replieator{b,e,i,k} : NEST unsuppressible replicator{h} option.NEST unsuppressible replicator{g,i} : fixed point numcral{811b} ;letter n{94a} symbol,meek integral NEST ENCLOSED clause{31a,34a,-},pragment{92a} sequence option.NEST UNSUPPRESSETY literal{d,e,i,A348c} :NEST UNSUPPRESSETY replicator{g,h},strong row of character NEST denoter{a0a} coercee{61a},NEST unsuppressible literal{i} option.NEST UNSUPPRESSETY MARK frame{A342c,A343b,c,A344a,A345a} :NEST insertion{d}, UNSUPPRESSETY suppression{l},MARK marker{A342e,A343d,e,A344b,A345b}.NEST UNSUPPRESSETY COMARK frame{A342b,c,A346a} :NEST insertion{d}, NEST replicator{g},UNSUPPRESSETY suppression{l},COMARK marker{A342d,f,A346b}.UNSUPPRESSETY suppression{j,k,A347b} :where {UNSUPPRESSETY) is {unsuppressible), EMPTY ;where (UNSUPPRESSETY) is {EMPTY),letter s{94a} symbol option."frame : NEST UNSUPPRESSETY MARK frame{j} ;NEST UNSUPPRESSETY COMARK frame{k} ;NEST RADIX frame{A347b}.*marker : MARK marker{A342e,A343d,e,A344b,A345b} ;COMARK marker{A342d,f,A346b} ; radix marker{A347c}.pattern : NEST TYPE pattern{A342a,A343a,A344a,A345a,A346a,A347a,A348a,b,A349a,A34Aa}.a) $ p "table of"x iOa,l n (lim - 1) ("x=" 12z+d 2x,+.12de+2d 3q" +j×"3"._" si +.l Ode+2d l) p $b) p "table of"x lOa • l n (lim - 1) ("x=" 12z+d 2x,+. 12de+2d 3q"+jx"3"." si +. lOde+2d l) pc) 120k c ("mon", "tues", "wednes", "thurs", "fri", " satur", "sun")"day"d) p "table of"xe) p "table of"h) 10 • n(lim-1)i) "+j×"3"."j) sik) "x=" 12z1) s}
176 van Wijngaarden, etal.[The positions where pragments (9.2.1.a) may occur in format-texts arerestricted. In general (as elsewhere in the language}, a pragment may notoccur between two DIGIT- or LETTER-symbols.}[aa) For formatted output, putf (10.3.5.1.a) and printf (or writer)(10.5.l.f) may be used and, for formatted input, getf (10.3.5.2.a) and readf(10.5.1.g). Each element in the data list (cf. 10.3.3) is either a format to beassociated with the file or a value to be transput {thus a format may beincluded in the data list immediately before the values to be transputusing that format).bb) During a call of putf or getf, transput proceeds as follows:For each element of the data list, considered in turn,If it is a format,then it is made to be the current format of the file by associate format(10.3.5.k) ;otherwise, the element is straightened (10.3.2.3.c) and each element ofthe resulting multiple value is output (hh) or input (if) using thenext "picture" (cc, gg) from the current format.cc) A "picture" is the yield of a picture. It is composed of a "pattern"of some specific 'TYPE' (according to the syntax of the TYPE-pattern ofthat picture), followed by an "insertion" (ee). Patterns, apart from'choice', 'format' and "general" patterns, are composed of "frames",possibly "suppressed", each of which has an insertion, a "replicator" (dd),and a "marker" to indicate whether it is a "d", "z", "i" etc. frame. Theframes of each pattern may be grouped into "sign moulds", "integralmoulds", etc., according to the syntax of the corresponding pattern.dd) A "replicator" is a routine, returning an integer, constructed froma replicator (10.3.4.1.2.c). For example, the replicator 10 gives rise to aroutine composed from int: 10; moreover, n(lim-1) is a "dynamic"replicator and gives rise to int: (lim-1). Note that the scope of areplicator restricts the scope of any format containing it, and thus it maybe necessary to take a local copy of a file before associating a format withit (see, e.g., 11.13}. A replicator which returns a negative value is treatedas if it had returned zero Ck" alignments apart).When a picture is "staticized", all of its replicators and other routines(including those contained in its insertions) are called collaterally. Astaticized pattern may be said to "control" a string, and there is then acorrespondence between the frames of that pattern, taken in order, andthe characters of the string. Each frame controls n consecutive charactersof the string, where n is 0 for an "r" frame and, otherwise, is the integerreturned by the replicator of the frame (which is always 1 for a "+", .....,".", "e", "i" or "b" frame). Each controlled character must be one of alimited set appropriate to that frame.ALGOL <strong>68</strong> Revised Report 177ee) An "insertion", which is the yield of an insertion (10.3.4.1.2.d), is asequence of replicated "alignments" and strings; an insertion containingno alignments is termed a "literal". An insertion is "performed" byperforming its alignments (ff) and on output (input) writing ("expecting"(11)) each character of its replicated strings (a string is replicated byrepeating it the number of times returned by its replicator).ff) An "alignment" is the character yielded by an alignment-code(10.3.4.1.2.d). An alignment which has been replicated n times isperformed as follows:• "k" causes set char number to be called, with n as its secondparameter;• "x" causes space to be called n times;• "y" causes backspace to be called n times;• "l" causes newline to be called n times;• "p" causes newpage to be called n times;• "q" on output (input) causes the character blank to be written(expected) n times.gg) A format may consist of a sequence of pictures, each of which isselected in turn by get next picture (10.3.5.b). In addition, a set of picturesmay be grouped together to form a replicated "collection" (which maycontain further such collections). When the last picture in a collection hasbeen selected, its first picture is selected again, and so on until the wholecollection has been repeated n times, where n is the integer returned byits replicator. A collection may be provided with two insertions, the first tobe performed before the collection, the second afterwards.A format may also invoke other formats by means of 'format" patterns(10.3.4.9.1).When a format has been exhausted, the event routine corresponding toon format end is called; if this returns false, the format is repeated;otherwise, if the event routine has failed to provide a new format,undefined is called.hh) A value V is output, using a picture P, as follows:If the pattern Q of P is a "choice" or "general' pattern,then Y is output using P (see 10.3.4.8.1.aa,dd, 10.3.4.10.1.aa);otherwise, Y is output as follows:• P is staticized;If the mode of V is "output compatible" with Q (see the separatesection dealing with each type of pattern),then• Y is converted into a string controlled (dd) by 0 (see theappropriate section) ;If the mode is not output compatible, or if the conversion isunsuccessful,
- Page 2 and 3:
van Wijngaarden, et al.1.1.4.2. Par
- Page 4:
Acknowledgements{Habent sua fata li
- Page 8 and 9:
14 van Wijngaarden, et al.0.3.4. Mo
- Page 10 and 11:
. . . . . . . 4 " ' 0 . . . . . . .
- Page 12 and 13:
22 van Wijngaarden, et al.• let P
- Page 14 and 15:
26 van Wijngaarden, et al.{Since so
- Page 16 and 17:
30 van Wijngaarden, et aLloperandfo
- Page 18 and 19:
34 van Wijngaarden, et al.j) WHETHE
- Page 20 and 21:
38 van Wijngaarden, et al.A protono
- Page 22 and 23:
42 van Wijngaarden, et al.d) If N i
- Page 24 and 25:
46 van Wijngaarden, et al.c) {There
- Page 26 and 27:
50 van Wijngaarden, et al.c) The ph
- Page 28 and 29:
54 van Wijngaarden, et al.3.1.1. Sy
- Page 30 and 31:
58 van Wijngaarden, et al.where (RO
- Page 32 and 33:
62 van Wijngaarden, et al.1) SOlD N
- Page 34 and 35:
66 van Wijngaarden, et al.ALGOL 68
- Page 36 and 37:
70 van Wijngaarden, et el.For each
- Page 38 and 39: 74 van Wijngaarden, et al.If 'MODE"
- Page 40 and 41: 78 J van Wijngaarden, et al.C) SECO
- Page 42 and 43: 82 van Wijngaarden, et al.ALGOL 68
- Page 44 and 45: 86 van Wijngaarden. et al.ALGOL 68
- Page 46 and 47: 90 van Wijngaarden, et al.5.4.4.1.
- Page 48 and 49: 94van Wijngaarden, et al.ALGOL 68 R
- Page 50 and 51: 98 van Wijngaarden, et al.Assignati
- Page 52 and 53: 102 van Wijngaarden, et at.{A nest,
- Page 54 and 55: 106 van Wijngaarden, et al.'HEAD's
- Page 56 and 57: 110 van Wijngaarden, et al.ALGOL 68
- Page 58 and 59: 114van Wijngaarden, et al.ALGOL 68
- Page 60 and 61: 118 van Wijngaarden, et al.ALGOL 68
- Page 62 and 63: 122 van Wijngaarden, et al.style ii
- Page 64 and 65: 126 van Wijngaarden, et al.b) The c
- Page 66 and 67: 130van Wijngaarden, et al.ALGOL 68
- Page 68 and 69: 134van Wijngaarden, et al.ALGOL 68
- Page 70 and 71: 138d)e)f)g)h)i)J)k)1)m)n)van Wijnga
- Page 72 and 73: 142 van Wijngaarden, et al.physics
- Page 74 and 75: 146 van Wijngaarden, et al.gg) On s
- Page 76 and 77: 150van Wijngaarden, et al.ALGOL 68
- Page 78 and 79: 154/van Wijngaarden, et al.ALGOL 68
- Page 80 and 81: 158 van Wijngaarden, et el.fi;ref p
- Page 82 and 83: 162van Wijngaarden, et al.ALGOL 68
- Page 84 and 85: 166van Wijngaarden, et al.ALGOL 68
- Page 86 and 87: 170/van Wijngaarden, etal.ALGOL 68
- Page 90 and 91: 178/van Wijngaarden, et al.ALGOL 68
- Page 92 and 93: 182 van Wijngaarden, et al.• let
- Page 94 and 95: 186van Wijngaarden, et al./ALGOL 68
- Page 96 and 97: 190 van Wijngaarden, etal.composed
- Page 98 and 99: 194h)i)J)van Wijngaa(rden, et al.pr
- Page 100 and 101: 198 van Wijngaarden, et al.¢ strin
- Page 102 and 103: 202tvan Wijngaarden, et al.ALGOL 68
- Page 104 and 105: 206 van Wijngaa~den. et al.10.3.6.1
- Page 106 and 107: 210 van Wijngaarden, et al.!ALGOL 6
- Page 108 and 109: 214 van Wijngaarden, et al.inoperat
- Page 110 and 111: 218fvan Wijngaarden, et al.¢ move
- Page 112 and 113: 222 van Wijngaarden, etaL{overflow}
- Page 114 and 115: 226 van Wijngaarden, et al.ALGOL 68
- Page 116 and 117: 230max int 10.2.1.cmax real 10.2.l.
- Page 118 and 119: 234 van Wijngaarden, et al.ALGOL 68