ack/lang/occam/test/aatob.ocm

26 lines
337 B
Plaintext
Raw Normal View History

1987-02-25 17:14:10 +00:00
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')