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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

194h)i)J)van Wijngaa(rden, et al.proc .~ get insertion = (ref file f, [ ] sinsert si) void :begin set read mood (f);for k to upb sidocase sa of si [k] in(char a): alignment (f, rep of si [k], a, true),(string s):(char c;to rep of si [k]dofor i to upb sdo check pos (f); get char (f, c);(c~s[i]I (" (char error mended off)(f, c:= s [i])l undefined);set read mood (f))odotVodend;esacproc .~ alignment = (ref file f, int r, char a, bool read) void :if a = "x" then to r do space (f) odelif a = "y" then to r do backspace (f) odelif a = "l" then to r do newline (f) odelif a = "p" then to r do newpage (f) odcilia = "k" then set char number (f, r)elif a = "q"then to rdoif readthen char c; check pos (f); get char (f, c);(c ~ blankI (" (char error mended off) (f, c : = blank)I undefined); set read mood (f))else check pos (f); put char (f, blank)fiodfl;proc .~ do fpattern = (rat file f, fpattern fpattern, bool read) void :begin format pf;[1 : upb (i of fpattern) ] sinserl si;(staticize insertion (i of fpattern, si),pf : = pf of fpattern);(read l get insertion (f, si) I put insertion (f, si));k)ALGOL <strong>68</strong> Revised Report 195ref int forp = forp of f;ref flex [ ] piece aleph = F of format off;int m = upb aleph, n = upb (F of pf);[1 : m + n ] plece c; c[1: m] :=aleph;c[m+ l : m+n] :=Fofpf;aleph := c; bp of aleph [m + 1 ] := forp;forp : = m + l ; cp of aleph [forp ] :=0;count of aleph [forp ] := 1;for i from m + l to m + ndofor j to upb c of aleph [i]docase (c of aleph [ i ]) [j ] in(collitem cl):(c of aleph [ i]) [j] :=collitom (il of cl, rep of cl, p of cl + m, i2 of cl)esacododend;proc .~ associate format = (rat file f, formal format) void :beginformat off :=c a newly created name which is made to refer to the yieldof an actual-format-declarer and whose scope is equal tothe scope of the value yielded by 'format' c:= format;forp off := heap int : = 1;cpof(Fofformatoff) [1] := 1;count of (F of format of f) [ 1 ] : = 1;bpof (F of format off) [1 ] := 0end;10.3.5.1. Formatted outputa) proc putt = (rot file f, [ ] union (outtype, format) x) void :if opened off thenfor k to upb xdo case set write mood (f); set char mood (f); x [k] in(format format): associate format (f, format),(ou,ype at):begin intj : = O;plcture picture, [ ] simplout y = straightout at;while (j +: = I)

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

Saved successfully!

Ooh no, something went wrong!