Neil Brown
fdff7b0d3c
Rain: Greatly expanded the tests for parsing expressions
2007-08-23 20:06:35 +00:00
Neil Brown
433c9d887d
Rain: fixed a test to expect Plus instead of Add
2007-08-23 18:45:36 +00:00
Neil Brown
e9d882f1ae
Rain: fixed the dataType parser to accept user-named types
2007-08-23 18:44:22 +00:00
Neil Brown
1d0426ac77
Rain: fixed the parsing to pass the new literal tests
2007-08-23 15:51:31 +00:00
Neil Brown
bb77f3fb91
Rain: added tests for literals, including very large integers
2007-08-23 15:51:08 +00:00
Neil Brown
e46bcefeb7
Rain: added parsing of input statements
2007-08-23 15:18:11 +00:00
Neil Brown
9b0419acbc
Rain: added tests for input statements
2007-08-23 15:17:55 +00:00
Neil Brown
9077367f6d
Rain: changed innerBlock to pass the tests
2007-08-23 14:59:45 +00:00
Neil Brown
f0d06b5219
Rain: added tests for the innerBlock parser
2007-08-23 14:59:27 +00:00
Neil Brown
5adbf7fcfc
Rain: changed the declaration parser to also return a Meta tag
2007-08-23 14:58:11 +00:00
Neil Brown
cab4ec2113
Rain: added parsing of variable declarations
2007-08-23 11:41:53 +00:00
Neil Brown
1bc92b0b37
Rain: added tests for parsing variable declarations
2007-08-23 11:37:47 +00:00
Neil Brown
23650da2ff
Fixed the findMain pass to use a proper nonce
2007-08-23 10:17:30 +00:00
Neil Brown
0913ab655c
Adjusted the tests for findMain to allow a nonce to be using during name mangling
2007-08-23 10:05:54 +00:00
Neil Brown
0c28f6255c
Added an initial crude implementation of name mangling for the main function
2007-08-22 22:40:50 +00:00
Neil Brown
1e06768c20
Added channel-end support to the C++CSP backend
...
I have added two helper functions, but since they are used in contexts that are already specific to C++CSP (i.e. the channel-ends have the ">>" and "<<" operators applied to them) I have not added them to the dictionary of functions.
This patch allows C++CSP to actually use the direction of channels to pass around channel-ends rather than channel pointers, just as C++CSP was designed for.
2007-08-22 22:27:04 +00:00
Neil Brown
63d18373b8
Changed tlpInterface to also return the direction of each channel, so that the (C++CSP) backend knows whether to pass it a whole channel, or just an end
2007-08-22 22:07:42 +00:00
Neil Brown
7c61208c93
Added a check to ensure that the channel parameters of the main function have the correct direction if they are specified
2007-08-22 21:49:33 +00:00
Adam Sampson
9efa008443
Add Set rules to PrettyShow.
...
As Neil pointed out, I'd already added some rules to PrettyShow to handle the
Maps in CompState; this does the same for the Sets, which means it's pshow-able
again.
2007-08-22 23:06:50 +00:00
Adam Sampson
36262fc55e
Rework the mechanism that GenerateC uses to get externs from AnalyseAsm.
...
Neil spotted that I'd broken the C++CSP backend with these changes, and I
wasn't very happy with what I'd done anyway, so this is take 2. Now there's a
separate pass that runs before GenerateC which builds a set of functions used
in PARs.
2007-08-22 22:26:26 +00:00
Adam Sampson
929745f05e
Tidy up how Main decides which passes to run.
...
Since the set of passes that runs now depends on several variables, there's now
an expression which builds a list of passes to run; this should be easier to
extend in the future.
2007-08-22 22:24:08 +00:00
Neil Brown
d90f0aa680
Rain: corrected the transformation of foreach loops to use ValAbbrev when looping over an expression
2007-08-22 17:03:47 +00:00
Neil Brown
9e8dd73149
Fixed the C++CSP backend by allowing it to override the tock_support.h header file with tock_support_cppcsp.h (the latter includes the former, but only after defining some preprocessor directives)
2007-08-22 16:10:47 +00:00
Neil Brown
d065338efe
Rain: Added to the resolving pass to make it pass all the tests
2007-08-22 15:54:34 +00:00
Neil Brown
1620528958
Rain: corrected the testUnique4 test to be as I intended
2007-08-22 15:54:05 +00:00
Neil Brown
412a746e25
Rain: added a test for recording and resolving process parameters
2007-08-22 15:20:40 +00:00
Neil Brown
a897712033
Rain: added a pass for finding and tagging the main function
2007-08-22 13:07:59 +00:00
Neil Brown
29f1aa0f2f
Rain: extended the resolving pass to include process declarations
2007-08-22 12:40:20 +00:00
Neil Brown
79678055bc
Rain: added a test for resolving/recording process names
2007-08-22 12:36:42 +00:00
Neil Brown
96145add21
Rain: combined two passes into one to allow them to work properly in future, and changed the tests accordingly
2007-08-22 12:24:12 +00:00
Neil Brown
9714385eba
Rain: added another test for a pass
2007-08-22 11:49:04 +00:00
Neil Brown
d681cd5d95
Rain: corrected the pass transforming the each loops so that it records the nonce names properly in the state
2007-08-22 11:12:57 +00:00
Neil Brown
289b1c79a7
Rain: corrected the tests checking the each-loop transformation to make sure that the nonce names are recorded properly
2007-08-22 11:12:35 +00:00
Neil Brown
914f4cbb2b
Rain: tweaked a few tests to use a specific integer type
2007-08-22 11:09:32 +00:00
Neil Brown
849a41fcdd
Where head is used (in this case on csMainLocals), protected it with a condition so that it gives a more useful error message than simply head: empty list
2007-08-22 11:07:56 +00:00
Neil Brown
017cb51bd8
Corrected what appeared to be a small bug in defineNonce
2007-08-22 10:55:57 +00:00
Neil Brown
262913fabd
Rain: added parsing of output statements
2007-08-22 10:21:20 +00:00
Neil Brown
a39d95add4
Rain: refactored the parser a little (drawing out the each loops)
2007-08-22 10:14:51 +00:00
Neil Brown
005066e3d4
Rain: correcting numbering on some of the parse tests
2007-08-22 10:14:05 +00:00
Neil Brown
ce84ae3db6
Rain: added parsing of all the integer types (along with associated tests)
2007-08-22 10:04:21 +00:00
Neil Brown
7e51ad1b1c
Started using the stopCaringPattern function to easily use assertPatternMatch (which pretty-prints its output) instead of assertEqual (which just uses Show)
2007-08-22 09:44:56 +00:00
Neil Brown
d514d40943
Changed the Rain parser to use the new LexRain tokens
...
This is similar (but not identical) to the change Adam was doing at the same type for occam.
I think the main difference is that rather than returning () from parsing a reserved word,
I return Meta so that you can easily write rules like:
do { m <- sSemiColon ; return $ A.Skip m}
The tests have also been updated to use the new parser, and fail on either a lexing or a
parsing error.
2007-08-22 09:41:08 +00:00
Neil Brown
b1469fa65b
Added LexRain, based heavily on (a slightly older version of) LexOccam
2007-08-22 09:37:27 +00:00
Neil Brown
1890b281fe
Rain: moved the resolution of int (to a 64-bit signed integer) out to a pass
2007-08-21 11:00:41 +00:00
Neil Brown
5b19a7658f
Rain: added support for parsing channel-end types
2007-08-21 10:53:07 +00:00
Neil Brown
2c26a8eab8
Rain: wrote some tests for parsing channel-end types
2007-08-21 10:47:52 +00:00
Neil Brown
a1ba7b3ef6
Added a useful function to TreeUtil that allows you to replace a given sub-pattern of a Pattern with the DontCare value
2007-08-21 18:32:25 +00:00
Neil Brown
16177f1153
Added better Eq implementation for Pattern, taking account of the poor Eq implementation of Constr
2007-08-21 18:31:39 +00:00
Adam Sampson
51ecf04a90
Move assignment simplification into a pass.
...
This is the code that expands array and record assignments out into multiple
assignments. Having it done as a pass means it can do a better job -- this
fixes some problems with cgtest56 where the old version of the code couldn't
handle record assignments from literals.
This is the first pass that's had to add a replicator to the tree, so this also
introduces a helper function for generating new replicator counters.
2007-08-22 19:55:52 +00:00
Adam Sampson
15a8f95647
Use show rather than pshow on CompState.
...
CompState now contains Sets and Maps, which aren't instances of Data and thus
break pshow. This could be fixed in the future by providing instance
definitions, assuming the GHC library maintainers don't beat us to it.
2007-08-22 19:18:26 +00:00