Neil Brown
f69030df34
Changed the names of generated tock files to have ".tock" before the extension
...
This helps avoid collisions with pre-existing files, especially .inc files (but also .c and .h)
2009-04-02 15:40:39 +00:00
Neil Brown
8153cfc659
Added code for full compilation mode to include the relevant C files from occam #USE directives, and link to the relevant object files
2009-04-01 18:32:39 +00:00
Neil Brown
db9b8e9d91
Changed where we generate the .inc file from being in the backend, to being a pass just after type-checking
...
We need to generate the externals after we've inferred channel directions, but before we do further work (like adding _sizes parameters and so on).
2009-04-01 16:54:07 +00:00
Neil Brown
abce001bab
Added a command line option to indicate that there is no main PROC
2009-04-01 15:29:22 +00:00
Neil Brown
219bfd9ce1
Modified the C backend so that it will put the forward declarations into a header file and include that
2009-04-01 14:35:47 +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
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
5ffea3f78e
Added a lex mode to Tock that shows how a program was lexed
2009-03-24 18:18:55 +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
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
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
a455676fa9
Added all the necessary command-line options for enabling and disabling warnings in the Main module
2008-11-20 13:26:45 +00:00
Neil Brown
0746219984
Added support for recording terminator nodes (as well as root nodes) while building the flow graph
2008-05-30 17:15:52 +00:00
Neil Brown
90986ea97b
Added a backend that prints out the AST as source (rather than dumping the raw AST)
2008-05-17 22:20:38 +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
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
463ddc636b
Changed the running of the PassM monad to use the new mechanism
2008-03-10 15:19:50 +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
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
273aeead4e
Added the code to guess the frontend based on the file extension (.occ/.rain)
2008-03-21 14:46:28 +00:00
Neil Brown
c778ff0031
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
a123981a74
Changed the running of the PassM monad to use the new mechanism
2008-03-10 15:19:50 +00:00
Neil Brown
ba9ac70d7c
Changed the C and C++ backends to write directly to the output file, to save building up the strings in memory
2008-03-08 14:10:05 +00:00
Neil Brown
edefe7be9f
Added a progress message just before the backend is entered
2008-03-06 15:23:31 +00:00
Adam Sampson
aff90d8d45
Some initial shuffling to get Tock working with the new CIF.
...
This changes the TLP code to use CCSP's stand-alone mode, and gets rid of the
old KRoC wrapper stuff. It also changes occam_stop everywhere in order to pass
the number of arguments (since ExternalCallN needs that now), and cleans up the
interaction with the C++ backend a bit.
2008-03-05 16:21:20 +00:00
Adam Sampson
168628576d
Rework how temporary files are named.
...
The temporary files used during compilation are now just the output name with
an appropriate extension added (so when compiling to cgtest02, it'll produce
cgtest02.cpp, etc.). This is what GCC and KRoC do; it keeps the temp files with
the binaries that were produced from them, and avoids having to pick a sensible
directory to put randomly-named temp files in.
2008-02-29 22:53:45 +00:00
Adam Sampson
d048a0ef71
Clean up Main.hs.
...
This particular file was badly in need of some love, being some of the first
code I wrote on Tock, and thus being a mix of my early style, my late style,
and Neil's style. I've cleaned it up quite a bit, fixing whitespace damage and
dodgy indentation, and making sure lists are alphabetised.
2008-02-29 22:06:37 +00:00
Neil Brown
4a0d199406
Fixed the keep temporaries thing so that it still keeps them when the compilation succeeds, not just when it dies
2008-02-27 19:58:32 +00:00
Neil Brown
eef0ac53e0
Added a flag to the compiler to tell let it to not delete the temporary files it used
2008-02-27 18:23:22 +00:00
Neil Brown
062cd0415a
Added a simple (-h/--help) option for printing the Tock help
2008-02-24 12:15:39 +00:00
Neil Brown
6d9534f9b9
Made running the properties configurable by a --sanity-check command-line option
2008-02-24 12:15:02 +00:00
Neil Brown
859a6286ac
Added functions to PassList that build a dependency graph from a list of properties (based on their pre- and post- properties) and use it to return an ordered pass list
2008-02-19 09:43:16 +00:00
Neil Brown
cd6e2175f2
Added a new "dump AST" pass
2008-02-14 12:45:11 +00:00
Neil Brown
f17ff5071c
Added a Warn monad for warnings, and incorporated a WriterT monad into the PassM stack to support the Warn monad, then changed all the rest of the code accordingly, including adding a Warn instance for the GenParser parser that hides it in the state
2008-02-08 13:22:23 +00:00
Neil Brown
445d45752d
Fixed the mode for printing out the flow-graph
2008-02-05 22:36:37 +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
e94826c64e
Added a function to GraphLabelFuncs for labelling replicators
2008-01-30 12:43:28 +00:00
Neil Brown
6a979f3cb1
Added a command-line option for turning on the usage checking
2008-01-29 22:50:51 +00:00
Neil Brown
12b1617fec
Added a new labelling function to FlowGraph for labelling the arguments of functions/processes
2008-01-29 20:05:38 +00:00
Neil Brown
5567d8cee0
Changed FlowGraph to keep a record of all the root nodes in the tree and return them in a list
2008-01-29 12:46:14 +00:00
Neil Brown
edc3a7e910
Removed the die function (that has no source position) and as far as possible replaced all its uses with dieP and a valid position
2008-01-28 17:21:13 +00:00
Neil Brown
5988684c00
Moved the Pass list from Main to its own module (PassList) and included the usage-checking pass (when the appropriate option is turned on)
2008-01-16 03:26:20 +00:00
Douglas Warren
7b9789da59
Changed the parse mode to pretty-print the AST by default
2007-11-14 16:26:19 +00:00
Neil Brown
181f7638c4
Changed Main to reflect the changes to the flow-graph builder
2007-11-10 19:10:25 +00:00
Neil Brown
cbc6a70b30
Changed the control-flow graph generation to use the proposed function dictionary, and add the scope-out nodes
2007-10-28 18:26:09 +00:00
Neil Brown
cde83c83ae
Added the capability of outputting graphviz scripts representing control-flow graphs
2007-10-28 12:11:27 +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
4935a04aa4
Added the simplifyComms pass to the shared pass list for the compiler, and removed the corresponding code in the C backend that the pass replaces
2007-10-11 00:14:27 +00:00