Do port output too
This commit is contained in:
parent
7c9036ac9b
commit
9fd0ea58a1
|
@ -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
36
fco2/testcases/inout.occ
Normal 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
|
||||
:
|
Loading…
Reference in New Issue
Block a user