Commit Graph

1542 Commits

Author SHA1 Message Date
Adam Sampson
17702401fa Rewrite AnalyseAsm's parser.
It now just uses "words" and regular pattern matches rather than regular
expressions. The resulting code is quite a bit simpler, and goes much faster.

I've added some unit tests for it too.
2008-04-05 22:05:17 +00:00
Neil Brown
4ef1ff7196 Changed to a state monad for warnings, and added a runPassM function to remove duplicate code for running passes 2008-04-03 12:21:59 +00:00
Neil Brown
f7f01a3333 Added some rules to cgtests.mk for profiling compilation of the cgtests and automatically generating PNGs of the profiles 2008-04-03 11:25:30 +00:00
Neil Brown
cba72045d7 Added a missing base case for transformActualVariable, when a subscripted variable is passed to a procedure 2008-04-03 11:24:47 +00:00
Neil Brown
463ddc636b Changed the running of the PassM monad to use the new mechanism 2008-03-10 15:19:50 +00:00
Neil Brown
20843f70a4 Corrected all the tests to use the new PassM monad 2008-03-10 17:07:48 +00:00
Neil Brown
d66fb79796 Fixed some unused module import warnings, now that PassM is not build of monad transformers 2008-03-10 17:19:45 +00:00
Neil Brown
078b94ff8f Defined a custom monad for PassM rather than using the monad transformers in a stack 2008-03-10 15:18:31 +00:00
Adam Sampson
bd9c4dae98 Go back to passing the value to the type-contains function.
This'll make the modification to look at constructors cleaner.
2008-04-02 16:11:13 +00:00
Adam Sampson
f515b5ce55 Change "find" to "targets", for clarity. 2008-04-02 15:16:47 +00:00
Adam Sampson
d9df114909 Rework gmapMFor so it takes a list of type keys.
This means we only need one gmapMFor function, and we do fewer calls to
typeKey, but we have to make typeKey available for use where it's called.
2008-04-02 15:09:07 +00:00
Adam Sampson
aeb2ebd9f4 Fix Haddock. 2008-04-01 13:22:30 +00:00
Adam Sampson
17da4db956 Make genActual(s) use the correct abbreviation mode. 2008-04-01 13:16:23 +00:00
Adam Sampson
7d9110a9b0 Remove "Data t =>" qualifications from transformation types.
This is solely because GHC 6.6 doesn't like them (it complains about the type
variable already being in scope -- which it is, but there's nothing I can do
about that!). This doesn't lose any safety; if you try to write a
transformation for something that's not Data you'll find out when you try to
pass it to one of the application functions.
2008-04-01 12:31:20 +00:00
Adam Sampson
7525138c96 Defined types for tree traversals, and moved them to their own file.
We now have three kinds of canned tree traversals, all of which are smart about
which types they're applied to: explicit-descent transformations,
implicit-descent transformations, and implicit-descent checks. I've only
provided depth-first application of the latter two, but we could do
breadth-first in the future if necessary.
2008-04-01 12:01:09 +00:00
Adam Sampson
40bf42e5ea Remove obsolete CGenCall instance. 2008-03-29 23:24:50 +00:00
Adam Sampson
d2bcd0cde5 Use IntMap.keysSet.
(Thanks to Neil for spotting this!)
2008-03-26 23:19:37 +00:00
Adam Sampson
3283b7db41 Remove the Type/AbbrevMode information from Actual*.
It's redundant, since you can always compute them from the variable, and it
makes the code that deals with actuals rather cleaner.

On the other hand, it slightly complicates some of the tests, because any names
you use in an Actual need to be defined...
2008-03-26 18:16:09 +00:00
Adam Sampson
b296706bea Update Rain typechecker to match isIntegerType change.
isIntegerType now recognises Time as an integral type, so the rules for Time
operations in the Rain typechecker needed updating.
2008-03-26 14:55:15 +00:00
Adam Sampson
2655b9b049 Fix a broken occam test (spotted by the new type checker). 2008-03-26 14:45:51 +00:00
Adam Sampson
b36068b815 Move retypes check into the SpecType checker, and update the pass list.
This completes the occam typechecker.
2008-03-26 14:39:12 +00:00
Adam Sampson
ef329e3ed0 Check SpecTypes. 2008-03-26 14:20:35 +00:00
Adam Sampson
c9cb7d2bf9 Check Proc calls. 2008-03-26 12:26:04 +00:00
Neil Brown
4e890a45d5 Reworked the way we record the C/C++ compiler flags for Tock to use
Previously, the files were auto-generated from the Makefile.am.  This patch changes to generate the flags using .in files, generated by the configure script.

The only problem with this is that the include directory for the Tock support files became difficult, because it depended on Tock's install prefix.  As a solution, I've added a pkg-config file for the Tock flags.  There might be some way to streamline the whole process once CCSP uses pkg-config, as then Tock, CCSP and C++CSP will all use pkg-config; it might be more flexible for Tock to run the pkg-config command every time it compiles, to avoid having to recompile Tock if you reinstall one of its C/C++ dependencies to a new directory.
2008-03-25 14:53:06 +00:00
Neil Brown
5e70e70d95 Added support for automatically inducing the output file from the input file for full compile mode (filename minus extension) 2008-03-25 11:46:10 +00:00
Neil Brown
0eadbd0b11 Added support for occam's flush (sending 255) and moved some of the unreachable flush commands in the C++ support headers 2008-03-25 11:37:02 +00:00
Neil Brown
2107960442 Added a couple of testcase programs for reading from the keyboard and echoing 2008-03-24 23:46:43 +00:00
Neil Brown
986a4acb2b Added support for a StreamReader (to support the input channel from stdin) to the C++CSP backend 2008-03-24 23:46:05 +00:00
Neil Brown
e8adfb51fa Moved the code for setting up the terminal into tock_support.h so that C++CSP can use it too 2008-03-24 23:45:31 +00:00
Neil Brown
c37e183879 Added support for a not-equals operator in Rain 2008-03-24 23:44:40 +00:00
Adam Sampson
b672900f46 Check Case, Alt, and all the trivial processes. 2008-03-25 17:27:33 +00:00
Adam Sampson
6861b22da6 Check timer operations. 2008-03-25 16:45:25 +00:00
Adam Sampson
d7e829b4c6 Check assignments. 2008-03-25 16:26:09 +00:00
Adam Sampson
b3e3308b3e Implement channel IO checks, and refactor OccamTypes (again). 2008-03-25 15:56:03 +00:00
Neil Brown
ceafd77c1e Removed Wait, GetTime and AlternativeWait (the old Rain time items) from the AST 2008-03-24 15:15:54 +00:00
Neil Brown
8fe152bf98 Merged the type-checking on time-related statements in Rain into the pass that checks types in communications 2008-03-24 15:15:28 +00:00
Neil Brown
bbdb429498 Changed transformWaitFor (and its tests) to transform the new InputTimerFor into InputTimerAfter 2008-03-24 15:09:05 +00:00
Neil Brown
2d0d6463d5 Removed the handling of the old Rain Wait/GetTime items from the backends 2008-03-24 15:08:05 +00:00
Neil Brown
eb50c010b2 Fixed the tests for parsing time-related stuff in Rain to match the recent changes 2008-03-24 14:27:46 +00:00
Neil Brown
cbbafffbd2 Changed Rain to use the new timer type rather than things like the GetTime statement 2008-03-24 13:50:14 +00:00
Neil Brown
c68aa42277 Added a sub-type to Timers, to support multiple types 2008-03-23 22:20:16 +00:00
Neil Brown
38aca16514 Fixed the commstime.rain testcase so that it now just about works (except for one disallowed cast) 2008-03-23 13:29:47 +00:00
Neil Brown
fc4cac736b Added the helper functions for adding and subtracting Times in C++CSP 2008-03-23 13:29:22 +00:00
Neil Brown
cc6dce5ead Tidied up the export/import lists for GenerateC and GenerateCPPCSP 2008-03-23 12:40:06 +00:00
Neil Brown
5abb775ae4 Added the time-related intrinsic functions for Rain to the C++ backend 2008-03-23 12:39:16 +00:00
Neil Brown
887a3ba98d Added helper functions for int8_t to tock_support.h (Rain needs these) 2008-03-23 12:18:18 +00:00
Neil Brown
74a5cf52a7 Stopped constants being assigned to in the type-checker for Rain 2008-03-23 12:15:00 +00:00
Neil Brown
b316a7d3f4 Added some tests for checking that constants can't be assigned to in Rain 2008-03-23 12:14:34 +00:00
Neil Brown
7830d82c51 Fixed the display of names in ShowCode for Rain 2008-03-23 12:13:55 +00:00
Neil Brown
1bf3f6f0f1 Fixed the type of a function name in buildExpr to fix the tests 2008-03-23 12:08:08 +00:00