Commit Graph

33 Commits

Author SHA1 Message Date
Neil Brown
bd5e6759a2 Rain: changed the parser to convert ?c into a A.DirectedVariable instead of a cast 2007-08-30 18:01:43 +00:00
Neil Brown
baf28ce47c Rain: added a parse test for declaring an instance of a user-defined type 2007-08-24 17:09:33 +00:00
Neil Brown
0fdcdcf4a1 Rain: added tests for parsing channel-end casts 2007-08-24 16:56:29 +00:00
Adam Sampson
64f0e1f4cb Monadic - and MINUS are not the same operator.
Neil spotted this while using MonadicSubtr in the Rain frontend -- -(MOSTNEG
INT) should fail, MINUS (MOSTNEG INT) shouldn't. This adds a MonadicMinus.
2007-08-23 22:17:15 +00:00
Neil Brown
54ba4c3315 Rain: added tests for parsing process calls 2007-08-23 21:20:55 +00:00
Neil Brown
bf2ea2feac Rain: tidying up some of the parse tests 2007-08-23 21:07:59 +00:00
Neil Brown
7e96da4922 Rain: fixed the parsing of channel types 2007-08-23 20:52:15 +00:00
Neil Brown
ab918eb9ab Rain: changed the top-level parser to be able to parse multiple processes in a file 2007-08-23 20:42:21 +00:00
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
bb77f3fb91 Rain: added tests for literals, including very large integers 2007-08-23 15:51:08 +00:00
Neil Brown
9b0419acbc Rain: added tests for input statements 2007-08-23 15:17:55 +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
1bc92b0b37 Rain: added tests for parsing variable declarations 2007-08-23 11:37:47 +00:00
Neil Brown
262913fabd Rain: added parsing of output statements 2007-08-22 10:21:20 +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
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
2c26a8eab8 Rain: wrote some tests for parsing channel-end types 2007-08-21 10:47:52 +00:00
Neil Brown
66eddfa672 Rain: added some tests for parsing data types 2007-08-20 22:39:58 +00:00
Neil Brown
eee8ce2492 Rain: Corrected the parse tests for the top level declaration 2007-08-20 21:54:46 +00:00
Neil Brown
391890faa7 Moved TreeUtil.Pattern to its own module (Pattern), which allowed me to show the pshowPattern function to be part of the PrettyShow.pshow function 2007-08-20 21:01:06 +00:00
Neil Brown
34c61702de Rain: added a new test for testing the parsing of top-level declarations 2007-08-20 18:44:11 +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
5ee2303dc7 Moved some functions into TestUtil from RainParseTest 2007-08-16 12:17:49 +00:00
Neil Brown
d574ec8e3d Added ForEach to the replicator possibilities in the AST, and tested parsing Rain seqeach and pareach loops 2007-08-13 16:05:17 +00:00
Neil Brown
d2022defb0 Changed the Rain parser to use the CompState of the occam parser 2007-08-07 18:43:20 +00:00
Neil Brown
bed325beea Parallel Usage Checker and Test Rearrangement
This patch is a bit large, being as it encompasses two major changes:

1. The addition of the first version of a parallel usage checker.  The usage checker uses the generics library (like
   the other passes) to work out if the parallel usage rules are broken.  It mainly consists of:
     a) a function used to determine which variables are written to/read from in given bits of code, and 
     b) a function that applies a) across the members of any par construct in the file, and checks that
        the expected usage rules hold
   The parallel usage checker is in an early stage, but I think the design is sensible - at least for doing the variable
   and array usage.  The channel usage checker will require some slightly different functionality, and
   I am not considering the abbreviation checker yet.
2. As a consquence of adding a second test file (UsageCheckTest) alongside the first (RainParseTest), I have 
   created a TestMain class that is intended to run all tests for all parts of Tock.  I have also extracted some
   useful helper functions (for creating the expected results of tests) into a file named TestUtil.  I've also
   modified the Makefil accordingly.
   
There are a few other minor changes to RainParse/RainParseTest that are also included in the patch as separating them
would have been tricky.
2007-07-30 22:04:30 +00:00
Neil Brown
f997b823dc Rain: Parser and Parser-Test framework
Initial commit of the beginnings of a Rain parser (still using the original occam AST) and its test framework, using HUnit
2007-07-27 15:11:52 +00:00