Commit Graph

26 Commits

Author SHA1 Message Date
Neil Brown
5a7e6976d1 Added a typename decorator to a template type to keep the C++ compiler happy 2008-01-29 21:39:04 +00:00
Neil Brown
46f054ff98 Put back an include directive for boost tuples that must have been accidentally removed 2008-01-29 21:38:42 +00:00
Neil Brown
7433e49d49 Added support for List types to the C and C++ backend, in genType at least 2007-10-27 11:24:24 +00:00
Neil Brown
05293f75c1 Fixed an error in the C++CSP support file where arrays with the first dimension being free would not have their size recalculated 2007-10-14 11:08:30 +00:00
Neil Brown
c19ae03116 Added a pass that changes all C++CSP channels to be of type tockSendableArrayOfBytes, so that the channels can be retyped into each other 2007-10-14 10:28:43 +00:00
Neil Brown
053f91bc59 Fixed a horrible error in the C++ support header file that was preventing byte-channels from working 2007-10-14 00:32:59 +00:00
Neil Brown
b4d34d1bc7 Made the C++ array stop if there is a problem with a retyping 2007-10-13 17:01:39 +00:00
Neil Brown
a98ff8cad0 Removed the horrible tockBool type, now that we are no longer using vectors to store C++ arrays 2007-10-13 15:40:39 +00:00
Neil Brown
90799499d8 Changed a constructor of tockArrayView in the C++CSP support header, so that retyping conversions are more distinct from same-type constructors 2007-10-13 12:50:01 +00:00
Neil Brown
a1baa16d9e Made some fixes in the support header files, and changed functions to fix issues with const-ness in C++ 2007-10-11 01:30:49 +00:00
Neil Brown
3a959d69f4 Added inline modifiers to some of the short functions in the C++CSP support header file 2007-10-11 00:51:55 +00:00
Neil Brown
8d0b5fbe1a Added a helper function for receiving an array of bytes, and changed the C++CSP backend and tests to use the function 2007-10-11 00:51:07 +00:00
Neil Brown
1694f524fd Fixed a couple of mistakes in the C++CSP support header file 2007-10-11 00:40:41 +00:00
Neil Brown
cc2040679b Changed the C and C++ backends to pass the input tests 2007-10-10 20:46:23 +00:00
Neil Brown
5b10466e68 Fixed the channel arrays (and abbreviations thereof) to have the correct types (correcting an earlier mistake), and added helper functions to the support headers for easy initialisation of the arrays 2007-10-07 23:03:15 +00:00
Neil Brown
9af1ec78bb Fixed all the tests for sending items in C++, and made the tests pass 2007-10-06 23:05:03 +00:00
Neil Brown
3b20d18937 Added tests for the genOutput and genOutputCase functions, corrected the C++ code, and added some helper functions to the C++ support header 2007-10-06 17:05:49 +00:00
Neil Brown
e68e80ddda Added a new type to the C++ header, tockSendableArrayOfBytes, ready for dealing with protocols and counted arrays properly. Also removed the tockAny type.
The tests for genType on channels of ANY, protocols, and counted arrays have also been changed accordingly.
2007-10-05 16:59:14 +00:00
Neil Brown
79530aaf8b Removed an unused function from tockArrayView in the C++ header file 2007-10-04 00:16:14 +00:00
Adam Sampson
c8d5a4ff40 Add licensing information.
The compiler itself is under the GPLv2+; the support code that gets built into
user programs is under the LGPLv2+. This matches the existing practice for the
KRoC project.

(As with Occade, I've used the new GPLv3-style license header in the source
files, though, since that avoids having to update the FSF's postal address.)
2007-08-18 20:42:11 +00:00
Neil Brown
0eadc2302c Added mostneg and mostpos for my custom bool type, to get cgtest05 to compile 2007-08-06 22:42:50 +00:00
Neil Brown
00a617150e Improved time handling by using helper function 2007-08-06 22:36:23 +00:00
Neil Brown
498e00c584 Fixed a bug that stopped arrays with a single dimension (that was also unknown) from having their sizes calculated in tockArrayView. cgtest09 now all passes 2007-07-31 22:04:31 +00:00
Neil Brown
7d7f66c626 Fixed a bug in the array indexing that was causing heap corruption 2007-07-31 21:58:34 +00:00
Neil Brown
a52d115060 Changed arrays to use vector/tockArrayView
Previously the arrays used the Blitz++ library, but this was not totally satisfactory.  I have therefore resorted (after looking at many different
libraries) to using std::vector (which could perhaps be boost::array instead) coupled with a roll-my-own "array view" class (tockArrayView) that
easily allows all the functionality that we need from arrays (slicing, indexing, copying, unknown dimensions,retyping,reshaping).  I have also
had to introduce a nasty little wrapper class tockBool, because vector<bool> is a specialisation that totally breaks things.  If I do move to
boost::array, I will be able to remove tockBool.
2007-07-31 21:19:52 +00:00
Neil Brown
935d69d544 C++CSP Backend Added
C++CSP backend has been added.  It consists of a support header file and one new Haskell module: GenerateCPPCSP

The module is largely based on GenerateC, changed as needed.  
There is a large section at the bottom of the file with verbatim copy-and-paste from GenerateC,
due to wanting the same functionality, but for calls to use my C++CSP generation not the C generation -- 
hence I cannot simply import those functions.

The backend can generate code for cgtests 0 through 16 (incl) that will compile as valid C++.  The majority of the
tests pass when run (some do segfault, admittedly).  However some arrays still need more testing/work, particularly:
- timers
- array slices
- retyping

The tock_support_cppcsp.h header makes use of tock_support.h, but I had to add a few #ifnders to the latter
file so that I can use it with C++CSP and block out some of the CIF stuff.
2007-07-26 21:11:01 +00:00