Removed Wait, GetTime and AlternativeWait (the old Rain time items) from the AST
This commit is contained in:
parent
8fe152bf98
commit
ceafd77c1e
|
@ -89,10 +89,6 @@ testGetVarProc = TestList (map doTest tests)
|
||||||
,(200,[tvB],[tvA],[],a_eq_not_b)
|
,(200,[tvB],[tvA],[],a_eq_not_b)
|
||||||
,(201,[tvC,tvD],[tvA],[],a_eq_c_plus_d)
|
,(201,[tvC,tvD],[tvA],[],a_eq_c_plus_d)
|
||||||
|
|
||||||
-- Test time statements:
|
|
||||||
,(300,[],[tvB],[],A.GetTime emptyMeta vB)
|
|
||||||
,(301,[tvA],[],[],A.Wait emptyMeta A.WaitFor $ A.ExprVariable emptyMeta vA)
|
|
||||||
|
|
||||||
-- Test simple outputs:
|
-- Test simple outputs:
|
||||||
,(400,[tvA],[],[tvC],A.Output emptyMeta vC [A.OutExpression emptyMeta $ A.ExprVariable emptyMeta vA])
|
,(400,[tvA],[],[tvC],A.Output emptyMeta vC [A.OutExpression emptyMeta $ A.ExprVariable emptyMeta vA])
|
||||||
,(401,[tvA,tvB],[],[tvC],A.Output emptyMeta vC $ map ((A.OutExpression emptyMeta) . (A.ExprVariable emptyMeta)) [vA,vB])
|
,(401,[tvA,tvB],[],[tvC],A.Output emptyMeta vC $ map ((A.OutExpression emptyMeta) . (A.ExprVariable emptyMeta)) [vA,vB])
|
||||||
|
|
|
@ -126,8 +126,6 @@ getVarProc (A.Assign _ vars expList)
|
||||||
(mapUnionVars processVarW vars)
|
(mapUnionVars processVarW vars)
|
||||||
--All variables read on the RHS:
|
--All variables read on the RHS:
|
||||||
(getVarExpList expList)
|
(getVarExpList expList)
|
||||||
getVarProc (A.GetTime _ v) = processVarW v
|
|
||||||
getVarProc (A.Wait _ _ e) = getVarExp e
|
|
||||||
getVarProc (A.Output _ chanVar outItems) = (processVarUsed chanVar) `unionVars` (mapUnionVars getVarOutputItem outItems)
|
getVarProc (A.Output _ chanVar outItems) = (processVarUsed chanVar) `unionVars` (mapUnionVars getVarOutputItem outItems)
|
||||||
where
|
where
|
||||||
getVarOutputItem :: A.OutputItem -> Vars
|
getVarOutputItem :: A.OutputItem -> Vars
|
||||||
|
|
11
data/AST.hs
11
data/AST.hs
|
@ -357,13 +357,6 @@ data Replicator =
|
||||||
data Choice = Choice Meta Expression Process
|
data Choice = Choice Meta Expression Process
|
||||||
deriving (Show, Eq, Typeable, Data)
|
deriving (Show, Eq, Typeable, Data)
|
||||||
|
|
||||||
-- | A mode of waiting -- either for a specified duration, or until a specified
|
|
||||||
-- time.
|
|
||||||
data WaitMode =
|
|
||||||
WaitFor
|
|
||||||
| WaitUntil
|
|
||||||
deriving (Show, Eq, Ord, Typeable, Data)
|
|
||||||
|
|
||||||
-- | A guard in an @ALT@.
|
-- | A guard in an @ALT@.
|
||||||
data Alternative =
|
data Alternative =
|
||||||
-- | A plain guard.
|
-- | A plain guard.
|
||||||
|
@ -377,8 +370,6 @@ data Alternative =
|
||||||
-- | A @SKIP@ guard (one that is always ready).
|
-- | A @SKIP@ guard (one that is always ready).
|
||||||
-- The 'Expression' is the pre-condition.
|
-- The 'Expression' is the pre-condition.
|
||||||
| AlternativeSkip Meta Expression Process
|
| AlternativeSkip Meta Expression Process
|
||||||
-- | A @wait for@\/@until@ guard.
|
|
||||||
| AlternativeWait Meta WaitMode Expression Process
|
|
||||||
deriving (Show, Eq, Typeable, Data)
|
deriving (Show, Eq, Typeable, Data)
|
||||||
|
|
||||||
-- | An option in a @CASE@ process.
|
-- | An option in a @CASE@ process.
|
||||||
|
@ -557,8 +548,6 @@ data Process =
|
||||||
| Input Meta Variable InputMode
|
| Input Meta Variable InputMode
|
||||||
| Output Meta Variable [OutputItem]
|
| Output Meta Variable [OutputItem]
|
||||||
| OutputCase Meta Variable Name [OutputItem]
|
| OutputCase Meta Variable Name [OutputItem]
|
||||||
| GetTime Meta Variable
|
|
||||||
| Wait Meta WaitMode Expression
|
|
||||||
-- | Clears the given mobile variable; if the variable is currently NULL,
|
-- | Clears the given mobile variable; if the variable is currently NULL,
|
||||||
-- destroy the contents and make it NULL. If it is already NULL, do nothing.
|
-- destroy the contents and make it NULL. If it is already NULL, do nothing.
|
||||||
| ClearMobile Meta Variable
|
| ClearMobile Meta Variable
|
||||||
|
|
|
@ -536,7 +536,6 @@ buildOnlyAlternative route alt
|
||||||
(A.Alternative m _ _ p) -> (m,p, route44 route A.Alternative)
|
(A.Alternative m _ _ p) -> (m,p, route44 route A.Alternative)
|
||||||
(A.AlternativeCond m _ _ _ p) -> (m,p, route55 route A.AlternativeCond)
|
(A.AlternativeCond m _ _ _ p) -> (m,p, route55 route A.AlternativeCond)
|
||||||
(A.AlternativeSkip m _ p) -> (m,p, route33 route A.AlternativeSkip)
|
(A.AlternativeSkip m _ p) -> (m,p, route33 route A.AlternativeSkip)
|
||||||
(A.AlternativeWait m _ _ p) -> (m,p, route44 route A.AlternativeWait)
|
|
||||||
guardNode <- addNode' m labelAlternative alt (AlterAlternative route)
|
guardNode <- addNode' m labelAlternative alt (AlterAlternative route)
|
||||||
(bodyNodeStart, bodyNodeEnd) <- buildProcess p r
|
(bodyNodeStart, bodyNodeEnd) <- buildProcess p r
|
||||||
addEdge ESeq guardNode bodyNodeStart
|
addEdge ESeq guardNode bodyNodeStart
|
||||||
|
|
|
@ -688,8 +688,6 @@ genProcess n = nextIdT >>* makeMeta' >>= \m -> (flip oneofLS) n
|
||||||
,(1,comb1 (A.If emptyMeta) . genStructured genChoice')
|
,(1,comb1 (A.If emptyMeta) . genStructured genChoice')
|
||||||
,(2,comb2 (A.Case emptyMeta) genExpression . genStructured genOption' . sub1)
|
,(2,comb2 (A.Case emptyMeta) genExpression . genStructured genOption' . sub1)
|
||||||
,(2,const $ genElem3 A.Assign m (comb0 [variable "x"]) genExpressionList)
|
,(2,const $ genElem3 A.Assign m (comb0 [variable "x"]) genExpressionList)
|
||||||
,(1,const $ genElem2 A.GetTime m (comb0 $ variable "x"))
|
|
||||||
,(1,const $ genElem3 A.Wait m (comb0 A.WaitFor) genExpression)
|
|
||||||
,(2,comb1 (A.Alt emptyMeta True) . genStructured genAlternative' . sub1)
|
,(2,comb1 (A.Alt emptyMeta True) . genStructured genAlternative' . sub1)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user