diff --git a/fco2/Parse.hs b/fco2/Parse.hs index 8fa7f49..9d1fa98 100644 --- a/fco2/Parse.hs +++ b/fco2/Parse.hs @@ -910,13 +910,19 @@ variant -- FIXME: We'll be able to deal with this once state is added. output :: OccParser A.Process output + = channelOutput + <|> do { m <- md; p <- port; sBang; e <- expression; eol; return $ A.Output m p [A.OutExpression m e] } + "output" + +channelOutput :: OccParser A.Process +channelOutput = do m <- md c <- try channel sBang (try (do { sCASE; t <- tagName; sSemi; os <- sepBy1 outputItem sSemi; eol; return $ A.OutputCase m c t os }) <|> do { sCASE; t <- tagName; eol; return $ A.OutputCase m c t [] } <|> do { os <- sepBy1 outputItem sSemi; eol; return $ A.Output m c os }) - "output" + "channelOutput" outputItem :: OccParser A.OutputItem outputItem diff --git a/fco2/testcases/inout.occ b/fco2/testcases/inout.occ new file mode 100644 index 0000000..99bef04 --- /dev/null +++ b/fco2/testcases/inout.occ @@ -0,0 +1,36 @@ +PROTOCOL TWO IS INT; INT: +PROTOCOL SEVERAL + CASE + none + one; INT +: + +PROC foo () + CHAN OF INT c: + CHAN OF TWO cc: + CHAN OF SEVERAL ccc: + PORT OF INT p: + TIMER tim: + + INT x, y: + SEQ + c ? x + cc ? x; y + ccc ? CASE none + ccc ? CASE one; x + ccc ? CASE + none + SKIP + one; x + SKIP + tim ? x + tim ? AFTER x + p ? x + + c ! x + 1 + cc ! x + 1; y + 1 + -- FIXME: This is the bodged syntax + ccc ! CASE none + ccc ! CASE one; x + 1 + p ! x + 1 +: