Neil Brown
b830b27066
Added a couple more settings to CompState to set the locations of the (C and occam) header files (but not made them available via the command-line, just yet)
2009-04-01 14:34:13 +00:00
Neil Brown
2edf5cc43d
Fixed constant folding to resolve any user types involved
...
Due to awkward module dependencies, some functions had to be moved around to accommodate this change. Two from Types have gone to EvalLiterals, and two to CompState. Everything still compiles just as before though.
2009-03-31 16:11:00 +00:00
Neil Brown
dbf886996a
Removed various bits of old code relating to the old sizes mechanism
2009-03-31 10:50:04 +00:00
Neil Brown
904d19a6a5
Added a new VariableSizes constructor to Variable that will supplant SizeVariable and AllSizesVariable
2009-03-30 15:28:38 +00:00
Neil Brown
b86ffbbf3b
Added two new items to CompState, which will help to replace the _sizes suffix
2009-03-30 15:13:56 +00:00
Neil Brown
6e66cf7521
Added a command-line option to change how much stack the unknown functions are given
2009-03-26 22:49:38 +00:00
Neil Brown
eb99480484
Finished off the support for external C functions
2009-03-26 22:37:28 +00:00
Neil Brown
95d7144c7b
Added the ability to specify linker flags separately from C compilation flags
2009-03-26 22:36:13 +00:00
Neil Brown
09093cff12
Added the ability to print out HTML-highlighted lexed occam
...
This falls a bit outside the compiler's remit, but it will be the same code to print out the lexed occam without highlighting, which I plan to use for doing libraries with Tock in a bit.
2009-03-26 22:34:34 +00:00
Neil Brown
633a3dbbc5
Quickly added a command line option to allow you to specify flags to pass to the C/C++ compiler
2009-03-25 22:35:49 +00:00
Neil Brown
45b22472c3
Changed the rest of tock to reflect the changes to the Is constructor
2009-03-24 23:57:24 +00:00
Neil Brown
53f7378988
Merged IsClaimed, IsChannelArray and IsExpr into Is, which now takes an Actual
2009-03-24 23:56:53 +00:00
Neil Brown
5ffea3f78e
Added a lex mode to Tock that shows how a program was lexed
2009-03-24 18:18:55 +00:00
Neil Brown
19e0fb0573
Added an AllocChannelBundle constructor in ExpressionList for assignments that allocate the two ends of a mobile channel bundle
2009-03-23 18:58:50 +00:00
Neil Brown
41805aaacf
Changed the ChanEnd constructor to only keep information about its shared-ness, not about the whole channel
2009-03-23 18:40:28 +00:00
Neil Brown
1edabee2e7
Changed the AST claim element to be an abbreviation rather than a process
2009-03-23 15:52:19 +00:00
Neil Brown
5f9d0c6429
Added various keywords, AST elements and parser bits related to channel bundles, claim blocks and shared channels
2009-03-22 22:49:49 +00:00
Neil Brown
8492dc03d4
Introduced a ShareMode in the AST, and used it in the channel attributes (rather than Bool)
2009-03-22 22:29:39 +00:00
Neil Brown
03f1b2d115
Added a few more mobile things (DEFINED keyword, an intrinsic)
2009-03-20 20:53:51 +00:00
Neil Brown
1c0f4d17ca
Changed the RecordType item to support multiple attributes (including mobility)
2009-03-20 15:17:15 +00:00
Neil Brown
1343954c2f
Added an option to automatically run indent on C/C++ source before running GCC
...
This option is very handy when debugging the C/C++ output of Tock when GCC gives a compiler error.
2009-03-21 18:25:09 +00:00
Neil Brown
65550b705e
Added an AllSizesVariable item to the AST so that the backend inserts the right code for mobiles and non-mobiles
2009-03-20 11:31:14 +00:00
Neil Brown
65875f523f
Added mobile cloning rather than using dereferencing to copy mobiles
2009-03-19 16:47:31 +00:00
Neil Brown
b970b9df33
Added command line options for occam 2 mobility, and turned it off by default
2009-03-19 11:38:48 +00:00
Neil Brown
823592bd1d
Added some passes to mobilise non-mobile arrays
2009-02-27 17:12:08 +00:00
Neil Brown
81959bd76b
Added quick preliminary support for the PERMITALIASES pragma
2009-02-10 01:01:23 +00:00
Neil Brown
41cca68e4e
Simplified the Rain parser by reintroducing a RangeLiteral item that will get replaced by an early pass
2009-02-03 12:24:10 +00:00
Neil Brown
957699313f
Combined ArrayLiteral and ListLiteral into ArrayListLiteral, and dispensed with ArrayConstr in favour of having array literals as Structured Expression that can contain replicators
2009-02-01 21:50:39 +00:00
Neil Brown
8a28d765e7
Implemented recursive procs
...
This works fine in the C++ backend, not tested with the C backend yet
2009-01-29 00:43:24 +00:00
Neil Brown
7722e95dfd
Added support for recursive functions (not procs, yet)
...
At the moment, the information is only needed in the parser, which must define recursive names before parsing the body of the function. But in future, we should keep the information when the function becomes a proc, and then the C/C++ backends may need to use it (for example, when calculating stack space usage)
2009-01-29 00:27:11 +00:00
Neil Brown
a68c871329
Added an expression to represent a STEP count to the For replicator constructor in the AST
2009-01-28 23:42:31 +00:00
Neil Brown
52459e7557
Turned on usage checking by default
...
I think the Tock usage checking is now sufficiently advanced (it only rejects one or two parts of the cgtest at the moment) to turn it on by default
2009-01-28 17:34:34 +00:00
Neil Brown
1410e80fb1
Added support for intrinsic functions with multiple return values
...
Previously, such a function was an IntrinsicFunctionCall inside one expression of an ExpressionList, which the type-checker rejected. I've had to add a new constructor to ExpressionList, and I've quickly hacked together the line in the C backend to make it work -- but it does seem to work.
2009-01-23 18:58:52 +00:00
Neil Brown
541f7c1421
Turned the Chan type into a Chan type for full channels and a ChanEnd type for the directed ends
...
This is the first patch in the series of many that implement this change throughout Tock.
Fixes #70 .
2009-01-20 17:25:19 +00:00
Neil Brown
f612b99a49
Added a map of name attributes (ready for things like PRAGMA SHARED) to the CompState
...
This should possibly (and could in future) be combined into NameDef and the main csNames map
2009-01-19 15:10:05 +00:00
Neil Brown
0a98db5295
Changed pshow on CompState (which caused errors) to plain show, by adding a Show instance to CompState
2009-01-15 20:59:37 +00:00
Neil Brown
46a1cc311f
Moved a couple of fields related to Rain type checking out of CompState and into a temporary StateT monad for the appropriate pass
2008-12-02 20:59:26 +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
6cbdc0e13b
Finally merged the list of warnings into CompState rather than having its own StateT monad
2008-11-20 13:35:44 +00:00
Neil Brown
f88c671cf7
Added a set of enabled warnings to CompState
2008-11-20 13:17:05 +00:00
Neil Brown
0d486f108f
Added a value to indicate what type a warning is (to support future configurability) and streamlined the warning functions
2008-11-13 15:36:22 +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
00a719a451
Added a new InjectPoison process to the AST
2008-09-11 22:16:52 +00:00
Adam Sampson
23e1ba2eec
Remove an "in the future" comment that's been done.
2008-06-06 10:15:43 +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
6ee21f76c9
Initial work on supporting INITIAL and RESULT abbreviations.
...
This fixes the AST, parser and typechecker, and adds a pass to
transform Result back into Abbrev, but doesn't transform Initial yet.
(It actually works for trivial stuff anyway, but it won't do the right
thing for complex types or PROC parameters.)
It appears (to me) to make sense to support INITIAL/RESULT reshaping
and retyping too, so this does.
Refs #42 .
2008-06-02 20:41:37 +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
Adam Sampson
8b3eba594d
Add SubscriptCheck field to SubscriptFromFor etc.
...
This makes it possible to mark a slice as not needing runtime
checking, which is immediately useful for _sizes arrays.
This fixes cgtest03, which was previously failing to compile because
the _sizes array for one of the constants in it contained a runtime
check and thus wasn't itself constant. I've added a testcase file for
the relevant bit of code.
2008-05-26 17:36:26 +00:00
Adam Sampson
b413cf3dc2
Fix some broken Haddock.
2008-05-25 18:49:15 +00:00