Commit Graph

41 Commits

Author SHA1 Message Date
Neil Brown
fa1e9a6a08 Rearranged FlowGraph and fixed the tests
Previously, most of the flow-graph building functions were inside the where clause of buildFlowGraph.  They have been moved to the top-level (with only a few small changes to make this possible - the main one being to store the labelling functions in a reader monad, which only required changing a couple of lines) and used by an additional buildFlowGraphP function, that is now used by the tests to make them work simply.  None of the new top-level functions except buildFlowGraphP are exported from FlowGraph.
2008-02-05 22:04:49 +00:00
Neil Brown
acd57d74de Changed the A.Structured type to be parameterised
This patch is actually an amalgam of multiple (already large) patches.  Those patches conflicted (parameterised Structured vs. changes to usage checking and FlowGraph) and encountered a nasty bug in darcs 1 involving exponential time (see http://wiki.darcs.net/DarcsWiki/ConflictsFAQ for more details).  Reasoning that half an hour (of 100% CPU use) was too long to apply patches, I opted to re-record the parameterised Structured changes as this new large patch.  Here are the commit messages originally used for the patches (which, as mentioned, were already large patches):

A gigantic patch switching all the non-test modules over to using parameterised A.Structured
Changed the FlowGraph module again to handle any sort of Structured you want to pass to it (mainly for testing)
A further gigantic patch changing all the tests to work with the new parameterised Structured
Fixed a nasty bug involving functions being named incorrectly inside transformInputCase
Added a hand-written instance of Data for Structured that allows us to use ext1M properly
Fixed a few warnings in the code
2008-02-05 19:40:27 +00:00
Neil Brown
1d9d47312a Implemented handling of replicators inside PARs in the control flow-graph building 2008-02-01 14:45:02 +00:00
Neil Brown
cb9aa03612 Fixed a nasty problem involving mixing the Meta tags while building the flow-graph, and added a comment about it 2008-02-01 14:34:17 +00:00
Neil Brown
30e890ef02 Corrected the bug involving replicated SEQs that are empty 2008-02-01 11:45:21 +00:00
Neil Brown
c663109378 Corrected how CASE options are handled in the flow-graph, and adjusted the accompanying tests 2008-02-01 11:34:03 +00:00
Neil Brown
0a22ebf34b Fixed up a couple of lines to properly handle the difference between Left False and Left True when building the flow-graph 2008-02-01 11:09:23 +00:00
Neil Brown
f8844edcb0 Corrected getNextParEdgeId in the flow-graph building to also actually increment the id ready for the next call 2008-02-01 11:08:53 +00:00
Neil Brown
83e04b92d4 Corrected the order the nodes are folded to match reality (rather than unintentionally reversing them) 2008-02-01 10:52:16 +00:00
Neil Brown
0672730894 Changed the way PARs are built up in the flow-graph, but haven't yet fixed the tests 2008-02-01 10:39:17 +00:00
Neil Brown
0dc94f9a32 Renamed the members of the OuterType data-type to be a little more distinctive 2008-01-30 19:58:20 +00:00
Neil Brown
45a8fa0b88 Added handling of sequential replicators when building the flow graph 2008-01-30 13:50:53 +00:00
Neil Brown
e94826c64e Added a function to GraphLabelFuncs for labelling replicators 2008-01-30 12:43:28 +00:00
Neil Brown
12b1617fec Added a new labelling function to FlowGraph for labelling the arguments of functions/processes 2008-01-29 20:05:38 +00:00
Neil Brown
5567d8cee0 Changed FlowGraph to keep a record of all the root nodes in the tree and return them in a list 2008-01-29 12:46:14 +00:00
Neil Brown
78a29de1d4 Added a couple of notes about replicators 2008-01-28 17:36:43 +00:00
Neil Brown
bc3ad29fed Added code to build the flow graph for procs and functions in specifications 2008-01-26 18:54:40 +00:00
Neil Brown
9dfa1611e0 Added various 4 and 5 parameter versions of the routing functions for building AST-modifying functions 2008-01-26 18:49:36 +00:00
Neil Brown
d2b427c268 Added some comments to the FlowGraph module 2008-01-25 15:58:32 +00:00
Neil Brown
26dd2fa5c4 Renamed the TestUtil and TreeUtil modules to TestUtils and TreeUtils, to be consistent with the Utils module 2007-12-13 19:05:29 +00:00
Neil Brown
905e110e86 Added a function to FlowGraph for joining two sets of graph labelling functions together 2007-12-10 15:45:06 +00:00
Neil Brown
089091d59b Added a safety check when building the flow graph 2007-11-10 23:18:01 +00:00
Neil Brown
19ba2a321c Fixed another misplaced Meta tag problem, this time with Specification 2007-11-10 21:13:16 +00:00
Neil Brown
2c33e1e499 Fixed some meta-tag confusion with the While statement when building a flowgraph 2007-11-10 20:28:12 +00:00
Neil Brown
53826fb405 Changed the flow-graph builder to allow the monad for AlterAST to be different from the monad for GraphLabelFuncs (they always were separate internally anyway) 2007-11-10 19:07:43 +00:00
Neil Brown
7168799784 Fixed the use of the wrong meta tag in the handling of A.Choice when building the FlowGraph, which was confusing the QuickCheck tests 2007-11-10 18:31:16 +00:00
Neil Brown
2141a7d6f2 Added AlterAST to FlowGraph's export list 2007-11-09 17:45:19 +00:00
Neil Brown
bacc3115e9 Added various general helper functions to the Utils module 2007-11-09 01:18:42 +00:00
Neil Brown
08a8f80722 Changed the types and implementation of the buildFlowGraph function to add the new ASTModifier functions.
This patch is very large, because it contains all the required changes.  Buried in there is a change in how Options are processed in Case statements; they are no longer shoe-horned into ExpressionLists, but rather create a Node for each Expression and chain them together.
2007-11-07 13:22:56 +00:00
Neil Brown
9ca3cf0f86 Changed the node type in the control flow graph to add a modification function, and adjusted the types of the other graph types accordingly 2007-11-07 13:17:15 +00:00
Neil Brown
13cf7df8bf Added functions for helping to decompose the AST and map functions over it 2007-11-07 11:26:07 +00:00
Neil Brown
cbc6a70b30 Changed the control-flow graph generation to use the proposed function dictionary, and add the scope-out nodes 2007-10-28 18:26:09 +00:00
Neil Brown
adafbd2cc4 Added support (and tests) for if statements in the control-flow graph generation 2007-10-28 17:24:26 +00:00
Neil Brown
49228150cf Refactored a couple of clauses in the building of the control-flow graph 2007-10-28 17:04:45 +00:00
Neil Brown
5c4bf74a75 Added support (and tests) for case statements in the control-flow graph 2007-10-28 16:31:15 +00:00
Neil Brown
bd14ed56ba Changed the edge-labelling scheme in the control-flow graph to have beginpar/endpar nodes with matching ids 2007-10-28 14:55:43 +00:00
Neil Brown
b6d525fbb8 Added tests for while loops in the control-flow graph 2007-10-28 12:39:26 +00:00
Neil Brown
25f13e6c6f Added more tests for the control-flow graph, for Specs in Structured items 2007-10-28 11:38:04 +00:00
Neil Brown
cf17814b98 Changed the types involved in the control-flow graph so that I can customise the Show implementation 2007-10-28 11:35:51 +00:00
Neil Brown
9b1cd56050 Changed the identifiers/values on graph nodes in the control-flow graph to be produced monadically, and altered the tests accordingly 2007-10-27 23:59:33 +00:00
Neil Brown
f0c552663b Added the initial implementation of a module (and tests) for generating a control-flow graph from an AST
This implementation needs to be changed; it currently uses Meta as a primary key for nodes, but that isn't valid.
2007-10-27 21:18:55 +00:00