190 van Wijngaarden, etal.composed of a procedure-yielding-FORMAT-NEST-routine.text whoseunit U is a new unit akin {1.1.3.2.k} to the meek-FORMAT-ENCLOSEDclauseof P, together with the environ necessary for U in E.10.3.4.10. General patterns10.3.4.10.1. Syntaxa) NEST general pattern{A341c} : NEST insertion{A341d},letter g{94a} symbol, NEST width specification{b} option.b) NEST width specification{a} : brief begin{94f} token,meek integral NEST unit{32d},NEST after specification{e} option, brief end{94f} token,pragment{92a} sequence option.c) NEST after specification{b} :and also{94f} token, meek integral NEST unit{32d},NEST exponent specification{d} option.d) NEST exponent specification{c} ..and also{94f} token, meek integral NEST unit{32d}.{Examples:a) g • g (-18, 12, -3) b) -18, 12, -3c) ,12,-3 d) ,-3}{aa) A value Y is output using a picture P whose pattern Q was yieldedby a general-pattern G as follows:• P is staticized;• the insertion of Q is performed;If Q is not parametrized (i.e., G contains no width-specification),then Y is output using put;otherwise, if the mode of V is specified by Lint or L real,then• if Q contains one (two, three) parameter(s), Y is converted to astring using whole (fixed, float);• the string is written using put;otherwise,• the event routine corresponding to on value error is called;• if this returns false, V is output using put, and undefined is called;• the insertion of P is performed.bb) A value is input to a name N using a picture P whose pattern is a'general' pattern as follows:• P is staticized;• (any parameters are ignored and) the value is input to N using get.}10.3.4.10.2. SemanticsThe yield, in an environ E, of a NEST-general-pattern P is a structuredvalue whose mode is 'GPATTERN' and whose fields, taken in order, are• {i} the yield of the insertion of P;ALGOL <strong>68</strong> Revised Report 191• {spec} a multiple value W whose mode is 'row of procedure yieldingintegral', having a descriptor ((1, n)), where n is the number ofconstituent meek-integral-units of the width-specification-option of P,and n elements determined as follows:For i = 1 ..... n,• the i-th element of W is a routine, whose mode is 'procedure "yielding integral', composed of a procedure.yieiding.integral-NESTroutine-textwhose unit U is a new unit akin {1.1.3.2.k} to the i-th ofthose meek-integral-units, together with the environ necessary for Uin E.10.3.5. Formatted transputa) mode format = struct (flex [1 : O} piece F);mode ~ piece = struct (int cp ¢ pointer to current collection ¢,count ¢ number of times piece is to be repeated ¢,bp ¢ back pointer ¢,flex [ 1 : 0 ] collection c) ;mode .~ collection = union (picture, collitem) ;mode .~ collitem = struct (insertion il,proc int rep ¢ replicator ¢,int p ¢ pointer to another piece ¢, insertion i2) ;mode .~ insertion = flex [1 : O] struct (proc int rep ¢ replicator ¢,union (string, char) sa) ;mode .~ picture =struct (union (pattern, cpattern, fpattern, gpattern, void)p, insertion i) ;mode .~ pattern = struct (int type ¢ of pattern ¢,flex [1 : O} frame frames);mode .~ frame = struct (insertion i,proc int rep ¢ replicator ¢,bool supp ¢ true if suppressed ¢,char marker) ;mode .~ cpattern = struct (insertion i,int type ¢ boolean or integral ¢,flex [ 1 : 0 ] insertion c) ;mode .~ fpattern = struct (insertion i, proc format pf) ;mode ~ gpattern = struct (insertion i, flex [1 : O] proc int spec) ;b)proc .~ get next picture = (ref file f, bool read, ref picture picture) void :beginbool picture found := false, format ended:= false;while - picture founddo ifforp off= 0 thenif format endedthen undefinedelif - (format mended off) (f)then ref int (forp off) := 1;cpof(Fofformatoff) [1] := 1;
192/van Wijngaarden, et al.ALGOL <strong>68</strong> Revised Report193count of (F of format of f) [ 1 ] : = 1else format ended : = truetlelseref int forp = forp off;ref flex [ ] piece aleph = F of format off;case (c of aleph [forp ]) [ cp of aleph [forp ] ] in(collitem cl):([1 : upb (il of c/)] sinsert si;bp of aleph [p of cl] := forp; forp := skip;(staticize insertion (il of cl, si),count of aleph [p of cl ] : = rep of cl);(aleph : ~ : For format of fl undefined);(read l get insertion (f, si) I put insertion (f, si));cp of aleph [p of cl ] := O;forp : = p of cl) ,(picture pict): (picture found : = true; picture : = pict)esac;while(forp ~ O Icp of aleph [forp ] = upb c of aleph [forp ] l faIse)do it (count of aleph [forp ] -: = 1) 1then (staticize insertion (ins [1 |, sins |I ]),staticize insertion (ins [2 : J, sins [2 : J))fi;mode .~ shame = struct (flex [ 1 : 0 ] sinsert si, int rep, bool supp,char marker) ;proc ~ staticize frames =([ ] frame frames, ref [ ] shame s frames) void :¢ calls collaterally all the replicators in 'frames'¢if upb frames = 1then[1 : upb (i of frames [1 ])] sinsert si;(staticize insertion (i of frames [1 ], si),rep of sframes [1] := rep of frames [1]);si of sframes [1 ] := si;supp of sframes [1 ] := supp of frames [1 ],¢marker of sframes [1 ] := marker of frames [i ]eIif upb frames > 1then (staticize frames (frames [ 1 ], sframes [1 ]),staticize frames (frames [2 : ], sframes [2 : ]))fl;proc 9put insertion = (ref file f, [ ] sinsert si) void :begin set write mood (f);for k to upb sidocase sa of si [k] in(char a): alignment (f, rep of si [k], a, false),(string s):to rep of si [k]dofor i to upb sdo check pos (f); put char (f, s [ i ]) ododesacodend;
- 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 88 and 89: 174J)K)L)M)N)O)P)a)b)c)d)e)van Wijn
- 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 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