Commit Graph

55 Commits

Author SHA1 Message Date
Neil Brown
4d692c8897 Fixed the occam and Rain parsers to work with the new channel-ends
For now, I have fixed the occam parser so that it allows 1 or more direction specifiers after channel names.  So c?? is valid, and should end up being equivalent to c?, but this may need altering later.
2009-01-20 17:28:57 +00:00
Neil Brown
0e7a6c5b98 Added a NameSource field for NameDef that indicates where a name comes from 2008-11-25 17:36:42 +00:00
Neil Brown
192ccd4e2c Extended the type unification for Rain to support type-checking things that are being poisoned (which could be either end of a channel) 2008-09-12 14:40:04 +00:00
Neil Brown
4c263dba7e Added support for poison to the lexer and parser (and associated tests) 2008-09-12 14:39:57 +00:00
Neil Brown
41ff60cb78 Removed the Rep constructor from Structured and instead added a Rep constructor to SpecType
This way, all replicators are declared like other names, and their scope is considered replicated.  This simplifies the code a little.

Fixes #55
2008-06-04 17:00:43 +00:00
Adam Sampson
cf79f9c284 Get rid of the nasty ghost names hack.
Rather than prefixing the names, there's now a set of ghost names in
CompState.

Fixes #66.
2008-06-02 10:58:26 +00:00
Adam Sampson
36e7353ee7 Take NameType out of NameDef.
NameType is only really needed in the parser, so this takes it out of
NameDef, meaning that later passes defining names no longer need to
set an arbitrary NameType for them. The parser gets slightly more
complicated (because some productions now have to return a SpecType
and a NameType too), but lots of other code gets simpler.

The code that removed free names was the only thing outside the parser
using NameType, and it now makes a more sensible decision based on the
SpecType. Since unscoped names previously didn't have a SpecType at
all, I've added an Unscoped constructor to it and arranged matters
such that unscoped names now get a proper entry in csNames.

Fixes #61.
2008-06-02 10:13:14 +00:00
Neil Brown
d623c82b3b Removed some of the bad uses of findMeta (where no meta tag would be found) from the Rain parser 2008-05-30 16:39:58 +00:00
Neil Brown
d044b51335 Renamed ndType to ndSpecType, as per Trac ticket #59 2008-05-21 13:38:51 +00:00
Neil Brown
f0a90a3024 Removed "run" from the Rain syntax, and adopted the occam approach instead 2008-03-25 17:32:54 +00:00
Neil Brown
ec5baf4e97 Stopped the Rain parser using any as a placeholder, and switched to using the unknown types 2008-05-18 11:34:05 +00:00
Neil Brown
6758cd7da3 Changed the list concatenation operator to be ++ in Rain 2008-05-18 10:30:17 +00:00
Neil Brown
ab0301a342 Made the Rain parser actually record an unknown (to-be-inferred) type for numeric literals 2008-05-17 14:24:45 +00:00
Neil Brown
7d65db43c0 Changed TestHarness to support Rain test files as well as occam 2008-05-17 13:13:52 +00:00
Neil Brown
3daf82d318 Merged Alternative and AlternativeCond into a single Alternative item that always has a pre-condition 2008-04-03 14:52: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
Neil Brown
c37e183879 Added support for a not-equals operator in Rain 2008-03-24 23:44:40 +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
78c2160eb4 Fixed the type of a function name to avoid confusing the pass to remove free names later on 2008-03-23 00:11:11 +00:00
Neil Brown
e767e33190 Added support for some intrinsic (time-related) functions in Rain 2008-03-22 18:58:10 +00:00
Neil Brown
710abd7019 Added support for function calls to the Rain parser 2008-03-22 17:49:21 +00:00
Neil Brown
025eebf61d Added support for giving ranges an explicit type in Rain 2008-03-21 21:10:47 +00:00
Neil Brown
2189a6c28a Added support for list literals to the Rain parser 2008-03-21 20:03:47 +00:00
Neil Brown
33b04e7646 Tidied up a few unused functions and module imports 2008-03-21 15:16:36 +00:00
Neil Brown
b496912c51 Fixed conflicts with Adam's dimension changes 2008-03-19 17:49:32 +00:00
Neil Brown
05866457e4 Fixed the type of a range to at least be a list 2008-03-19 17:34:12 +00:00
Neil Brown
45c2619307 Changed the rain parser to use ListLiteral for strings 2008-03-19 15:59:23 +00:00
Neil Brown
a930e17f89 Adjusted the parsers to store a type with array constructors (Rain will infer it later, so it uses Any) 2008-03-19 13:22:35 +00:00
Neil Brown
95fd6321d1 Added support for parsing list types in Rain 2008-03-18 11:53:57 +00:00
Adam Sampson
b1416bb0cf Change A.Dimension to take an Expression, not an Int.
This touches an awful lot of code, but cgtest07/17 (arrays and retyping) pass.

This is useful because there are going to be places in the future where we'll
want to represent dimensions that are known at runtime but not at compile time
-- for example, mobile allocations, or dynamically-sized arrays. It simplifies
the code in a number of places.

However, we do now need to be careful that expressions containing variables do
not leak into the State, since they won't be affected by later passes.

Two caveats (marked as FIXMEs in the source):

- Retypes checking in the occam parser is disabled, since the plan is to move
  it out to a pass anyway.
- There's some (now very obvious) duplication, particularly in the backend, of
  bits of code that construct expressions for the total size of an array
  (either in bytes or elements); this should be moved to a couple of helper
  functions that everything can use.
2008-03-18 16:45:38 +00:00
Neil Brown
ba75f5b06c Removed the initialiser expression on the Declaration item in the AST 2008-03-09 00:23:13 +00:00
Neil Brown
74838bcb80 Fixed functions to work again in the Rain parser, according to the new tests 2008-02-25 17:18:28 +00:00
Neil Brown
1fd85fbe51 Added the -fwarn-missing-signatures option and added all missing type signatures for non-test modules (and most for test modules too) 2008-02-05 23:06:03 +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
741a01de5a Removed various tab characters and replaced them with spaces 2008-01-26 19:38:24 +00:00
Neil Brown
25f2efb94c Changed the existing Rain code (and tests) to use the new List type rather than the Array type 2007-10-25 10:13:17 +00:00
Neil Brown
6b95827cab Added an optional initialiser-expression to Declaration in the AST, and changed the rest of the code accordingly 2007-10-24 23:50:00 +00:00
Neil Brown
e582f5e508 Changed the terminator in Rain source files from A.Main to A.Several (with an empty list), and updated the tests accordingly 2007-10-17 13:42:13 +00:00
Neil Brown
1c858e112c Changed the occam and Rain parsers to return a Structured rather than a Process (which will simplify the generated ASTs) 2007-10-17 13:21:17 +00:00
Neil Brown
38c409d378 Added the -fwarn-unused-imports compiler option to warn about unused imports, and then set about pruning and ordering (mostly in my code) the import lists for all the modules 2007-09-27 13:13:46 +00:00
Neil Brown
d79de5a936 Rain: implemented parsing of wait guards 2007-09-26 23:34:55 +00:00
Neil Brown
5af96110c7 Rain: implemented the parsing of wait statements 2007-09-26 23:00:58 +00:00
Neil Brown
db4f05932b Fixed a conflict between the old time-related patches and the new alt patches 2007-09-26 21:39:16 +00:00
Neil Brown
769dc3c79a Rain: changed the if, while and each loops to require a block as their body, rather than just a statement. 2007-09-26 18:03:42 +00:00
Neil Brown
68c468fbea Rain: added the parsing of else (skip) guards in alts 2007-09-26 19:56:22 +00:00
Neil Brown
205b090cef Rain: implemented the parsing of alt statements 2007-09-26 19:40:04 +00:00
Neil Brown
1f298a8ff6 Rain: added parsing support for time 2007-09-19 12:04:11 +00:00
Neil Brown
ebf3040367 Rain: tidied up ParseRain a little 2007-09-19 12:03:24 +00:00
Neil Brown
a4453fe3c3 Rain: changed parse errors to report using dieP (with a Meta position) instead of just dieIO 2007-09-17 11:18:38 +00:00
Neil Brown
d92e042159 Moved the functions for converting between Meta and SourcePos (from Parsec) into a common ParseUtils module 2007-09-17 11:15:17 +00:00