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.

186van Wijngaarden, et al./ALGOL <strong>68</strong> Revised Report 18710.3.4.6. String patterns10.3.4.6.1. Syntaxa) NEST string pattern{A341c} :NEST character frame{A341k} sequence.b) character marker{A341k} : letter a{94a} symbol.{Example:a) p "table of"x lOa }{For the semantics of string-patterns see 10.3.4.1.2.e.}{aa) The modes which are output (input) compatible with a "string"pattern are those specified by char and [ ] char (by ref char, raf [ ] charand ref string).bb) A value V is converted to a string using a "string' pattern P asfollows:• if necessary, Y is rowed to a string;• if the length of the string Y is equal to the length of the string controlledby P, then V is supplied; otherwise, the conversion is unsuccessful.cc) A string S is converted to a character or a string suitable for aname N, using a 'string' pattern, as follows:Case A: The mode of N is specified by ref char:• if S does not consist of one character, the conversion isunsuccessful; otherwise, that character is supplied;Case B: The mode of N is specified by rof [ ] char:• if the length of S is not equal to the number of characters referredto by N, the conversion is unsuccessful; otherwise, S is supplied;Case C: The mode of N is specified by rat string:• S is supplied.}10.3.4.7. Bits patterns10.3.4.7.1. Syntaxa)b)c){Examples:NEST bits pattern{A341c} :NEST RADIX frame{b}, NEST integral mouid{A342b}.NEST RADIX frame{a} : NEST insertion{A341d}, RADIX{82d,e,f,g},unsuppressible suppression{A3411}, radix marker{c}.radix marker{b} : letter r{94a} symbol.a) 2r6d26sd b) 2r }{For the semantics of bits-patterns see 10.3.4.1.2.e.}{aa) The modes which are output (input) compatiblepattern are those specified by L bits (refL bits).with a'bits'bb) A value V is converted to a string using a 'bits' pattern P asfollows:• the integer I corresponding to V is determined, using the operator abs(10.2.3.8.i) ;If the "r" frame of P was yielded by a radix-two- (-four-, -eight-, -sixteen-)-frame,then ! is converted to a string, controlled by the integral mould of P,containing a binary (quaternary, octal, hexadecimal) representation ofI (cf. 10.3.4.2.1.bb):• if I cannot be represented by such a string, the conversion isunsuccessful.cc) A string S is converted to a bits value suitable for a name N,using a 'bits' pattern P, as follows:• if the "r" frame of P was yielded by a radix-two- (-four-, -eight-,-sixteen-) -frame, then the integer I for which S contains a binary(quaternary, octal, hexadecimal) representation is determined;• the bits value B corresponding to I is determined, using the operatorbin (10.2.3.8.j) ;• if the width of B is greater than that of the value to which N refers, theconversion is unsuccessful.}10.3.4.8. Choice patterns10.3.4.8.1. Syntaxa) NEST integral choice pattern{A341c} : NEST insertion{A341d},letter c{94a} symbol, NEST praglit{c} list brief pack,pragment{92a} sequence option.b) NEST boolean choice pattern{A341c} :NEST insertion{A341d}, boolean marker{A344b},brief begin{94f} token, NEST praglit{c}, and also{94f} token,NEST praglit{c}, brief end{94f} token,pragment{92a} sequence option.c) NEST praglit{a,b} : pragment{92a} sequence option,NEST literal{A341i}.{Examples:a) 120k c ("mon", "tues", "wednes", "thurs", "fri", "satur", "sun")b) b ("", "error")c) "mon" }{aa) A value Y is output using a picture P whose pattern Q was yieldedby an integral-choice-pattern C as follows:• the insertion of O is staticized (10.3.4.1.l.dd) and performed(10.3.4.1.l.ee) ;If the mode of V is specified by int, if Y > 0, and if the number ofconstituent literals in the praglit-list-pack of C is at least V,

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

Saved successfully!

Ooh no, something went wrong!