The following is a valid µOCCAM program that performs I/O. This tests your handling of pipes and parallel processes. A process reads from stdin, sends it to another process (through a channel called pipe) and this process then outputs it to stdout. It also tries its best to confuse your compiler to test your scoping.
CHAN pipe: PAR INT a: INT b: SEQ b:=99 pipe ? b stdout ! b INT a: SEQ stdin ? a pipe ! a
When provided with this input:
it should generate the following output: