/* roco cat example This copies the input to the output 3 coroutines call each other successively */ /*forward declare some coroutines to allow them to call each other*/ co output; co endcondition; co input { cin [0] yi endcondition } co endcondition { /*if the character has ascii value 10 (newline), then stop*/ eq [1] [0] 10 if [1] ac yi output } co output { cout [0] yi input } ca input ac