From 45a8fa0b8867d387d9c7d480bc308431b2c1ea37 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 30 Jan 2008 13:50:53 +0000 Subject: [PATCH] Added handling of sequential replicators when building the flow graph --- common/FlowGraph.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/common/FlowGraph.hs b/common/FlowGraph.hs index a7464f9..c54e219 100644 --- a/common/FlowGraph.hs +++ b/common/FlowGraph.hs @@ -62,7 +62,7 @@ import Utils data EdgeLabel = ESeq | EStartPar Int | EEndPar Int deriving (Show, Eq, Ord) --If is (previous condition) (final node) -data OuterType = None | Seq | Par | Case (Node,Node) | If Node Node +data OuterType = None | Seq | Par | Case (Node,Node) | If Node Node deriving (Show) -- | A type used to build up tree-modifying functions. When given an inner modification function, -- it returns a modification function for the whole tree. The functions are monadic, to @@ -317,7 +317,15 @@ buildFlowGraph funcs s addEdge ESeq n s addEdge ESeq e n' return (n,n') - -- TODO replicator + buildStructured outer (A.Rep m rep str) route + = do case outer of + Seq -> do n <- addNode' m labelReplicator rep (AlterReplicator $ route23 route A.Rep) + (s,e) <- buildStructured outer str (route33 route A.Rep) + addEdge ESeq n s + addEdge ESeq e n + return (n,n) + _ -> throwError $ "Cannot have replicators inside context: " ++ show outer + buildStructured _ s _ = do n <- addDummyNode (findMeta s) return (n,n)