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.

196 van Wijngaarden, et al.set write mood (f);[1 : upb (i of picture) ] sinsert sinsert;case p of picture in(pattern pattern):begin int rep, sfp : = 1;[1 : upb (frames of pattern)] shame sframes;(staticize frames (frames of pattern, s frames),staticize insertion (i of picture, sinsert));string s;op ? = (string s) bool :¢ true if the next marker is one of the elements of's' and false otherwise ¢if sfp > upb sframesthen falseelse shame sf = sframes [ sfp ];rep : = rep of sf;if char in string (marker of sf, Ioc int, s)then sfp +: = 1; trueelse falseflfl;op ? = (char c) bool : ? string (c);proc int pattern = (ref bool sign mould) int :tint I : = O;while ? "zuv" do (rep >_ 01 l +: = rep) od;sign mould := ? "+-";while ? "zd" do (rep >_0] l +:= rep) od; l);~ proc edit Lint = (LInt i) void :(bool sign mould; lnt l:= int pattern (sign mould);string t = subwhole (abs i, l);if char in string (errorchar, Ioc int, t) v l = 0v . sign mould ^ i < L 0then incomp : = trueelse t plusto s;(l - upb t) x "O" plusto s;(sign mould I (i < i, p I ..... I "+") plusto s)n)#;Tproc edit L real = (L real r) void :(intb := O, a := O, e := O, exp := O, Lrealy := abs r,bool sign1, string point : = "";b : = intpattern (sign1);(.9 "."1 a : = int pattern (Ioc bool); point : = ".'9;if .9 "e"then L standardize (y, b, a, exp);fl;ALGOL <strong>68</strong> Revised Reportedit int (exp);"10' plusto sstring t = sub fixed (y, b + a + (a ~ 01 1 10), a); Iif char in string (errorchar, Ioc int, t) v a + b = 0v . signl ^ r < L O .then incomp : = trueelse t [ : b ] + point + t [ b + 2: ] plusto s;(b + a + (a ~ 0 ] 11 0 ) - upb t) x "0" plusto s;(sign11 (r < L 01 ..... 1% ") plusto s)fl)~;proc edit L compl = (L compl z) void"(while - ? "i" do sfp +: = 1 od; edit L real (ira z);".L " plusto s; sfp := 1; edit L real (ra z))~;~proc edit L bits = (L bits lb, int radix) void"(Lint n : = abs lb; ? "r"; int I : = int pattern (Ioc bool);while dig char (S (n rood K radix)) plusto s;n +: = Kradix; n ~ L 0dO skip od;If upb s

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

Saved successfully!

Ooh no, something went wrong!