ack/lang/occam/test/aatob.ocm
1987-02-25 17:14:10 +00:00

26 lines
337 B
Plaintext

def otherwise=true:
proc xxtoy(chan in, out, value x, y)=
var c:
seq
c:= not EOF
while c<>EOF
seq
in ? c
if
c=x
seq
in ? c
if
c=x
out ! y
otherwise
out ! x; c
otherwise
out ! c
:
chan link:
par
xxtoy(input, link, 'a', 'b')
xxtoy(link, output, 'b', 'c')