Do port output too

This commit is contained in:
Adam Sampson 2007-04-05 01:21:16 +00:00
parent 7c9036ac9b
commit 9fd0ea58a1
2 changed files with 43 additions and 1 deletions

View File

@ -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

36
fco2/testcases/inout.occ Normal file
View File

@ -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
: