10.07.2015 Views

Algol 68 - ACM Digital Library

Algol 68 - ACM Digital Library

Algol 68 - ACM Digital Library

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

180 van Wijngaarden, et al.10.3.4.1.2. Semantics{A format is brought into being by means of a format-text. A format isbest regarded as a tree, with a collection at each node and a picture ateach tip. In order to avoid violation of the scope restrictions, each node ofthis tree is, in this Report, packed into a value of mode "PIECE'. A formatis composed of a row of such pieces and the pieces contain pointers toeach other in the form of indices selecting from that row. An implementerwill doubtless store the tree in a more efficient manner. This is possiblebecause the field.selector of a format is hidden from the user in order thathe may not break it open.Although a format-text may contain ENCLOSED-clauses (in replicatorsand format-patterns) or units (in general-patterns), these are notelaborated at this stage but are, rather, turned into routines forsubsequent calling as and when they are encountered during formattedtransput. Indeed, the elaboration of a format-text does not result in anyactions of any significance to the user.}a) The yield of a format-text F, in an environ E, is a structured valuewhose only field is a multiple value W, whose mode is "row of PIECE',composed of a descriptor ((1, n)) and n elements determined as follows:• a counter i is set to 1;• F is "transformed" {b} in E into W, using i.b) A format-text or a collection-list-pack C is "transformed" in anenviron E into a multiple value W whose mode is "row of PIECE', using acounter i, as follows:• the element of W selected by (i) is a structured value, whose mode is'PIECE' and whose fields, taken in order, are• {cp} undefined;• {count} undefined;• {bp} undefined;• {c} a multiple value V, whose mode is "row of COLLECTION', havinga descriptor ((1, m)), where m is the number of constituent collectionsof C, and elements determined as follows:For j = 1 ..... m, letting C. be the j-th constituent collection of C,ICase A: The direct descendents of C. include a picture P:J• the constituent pattern T, if any, and the insertion I of P areelaborated collaterally;• the j-th element of V is a structured value, whose mode is'PICTURE' and whose fields, taken in order, are• [p} the yield of T, if any, {e, 10.3.4.8.2, 10.3.4.9.2, 10.3.4.10.2}and, otherwise, empty;• (i} the yield of ! {d};/ALGOL <strong>68</strong> Revised Report 181Case B: The direct descendents of C. include a first insertion I1, aJreplicator REP, a collection-list-pack P and a second insertion 12:• i is increased by 1;• I1, REP and 12 are elaborated collaterally;• the j-th element of Y is a structured value whose mode is'COLLITEM' and whose fields, taken in order, are• {il} the yield of I1 {d};• {rep} the yield of REP {c};• (Pli;• (i2] the yield of 12;• P is transformed in E into W, using i.c) The yield, in an environ E, of a NEST-UNSUPPRESSETY-replicatorR {10.3.4.1.l.g,h} is a routine whose mode is 'procedure yielding integral',composed of a proeedure-yielding-integrai-NEST-routine-text whose unit isU, together with the environ necessary {7.2.2.c} for U in E, where U isdetermined as follows:Case A: R contains a meek-integral-ENCLOSED-clause G:• O is a new unit akin {1.1.3.2.k} to C;Case B: R contains a fixed-point-numeral D, but no ENCLOSED-clause:• U is a new unit akin to D;Case C: R is invisible:• U is a new unit akin to a fixed.point-numeral which has an intrinsicvalue {8.1.1.2} of 1.d) The yield of an insertion I {10.3.4.1.1.d} is a multiple value Wwhose mode is 'INSERTION', determined as follows:* let U 1 ..... U n be the constituent UNSUPPRESSETY-replieators of I,and let A i, i = 1 ..... n, be the denoter-coercee or alignment-code{immediately} following U.;• let R 1, .... R and O 1 ... D be the {collateral} yields of U 1, On ' ' n .... nand A 1 ..... A n, where the yield of an alignment-code is the {characterwhich is the} intrinsic value {8.1.4.2.b} of its LETTER-symbol;• the descriptor of W is ((1, n)):• the element of W selected by (i), i = 1 ..... n, is a structured value {ofthe mode specified by struct .(proc lnt rep, union (string, char) sa)} whosefields, taken in order, are• {rep} R.;I• {sa} D..Ie) The yield of an integral-, real-, boolean-, complex-, string: or bitspatternP {10.3.4.2.1.a, 10.3.4.3.1.a ..... t0.3.4.7.l.a} is a structured value Wwhose mode is 'PATTERN', determined as follows:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!