Commit Graph

2466 Commits

Author SHA1 Message Date
Neil Brown
bf365ee41a Fixed the pass that turns array constructors into replicated loops so that it handles nested array constructors and inner-procthens properly
cgtest80 now compiles and passes
2009-02-02 18:27:38 +00:00
Neil Brown
4b3090b66a Fixed the fixConstructorTypes pass to work properly and put it back into the pass list (having removed it earlier today) 2009-02-02 18:27:04 +00:00
Neil Brown
1cde2bd959 Added a few useful error messages in the C backend 2009-02-02 18:26:12 +00:00
Neil Brown
96934c871d Changed the transformation of array constructors so that it also pulls out all the specs that were pulled up to be just inside them 2009-02-02 17:36:14 +00:00
Neil Brown
ebf8ae2d83 Added a pull up context just inside the replicators for array constructors 2009-02-02 17:35:46 +00:00
Neil Brown
51acf8abb5 Made sure to change the abbreviation for VAL array things that are now being assigned to via a loop as initialisation 2009-02-02 17:34:44 +00:00
Neil Brown
88d6136dcf Stopped the expansion of inner array literals into subscripted elements
This expansion was causing a big blow-up in the code, as things like:

VAL [2][1]INT as IS [[0,1]]

were getting transformed into:

VAL [2]INT n0 IS [0,1]:
VAL [2]INT n1 IS [0,1]:
VAL [2]INT n2 IS [n0[0], n1[1]]:
VAL [2][1]INT as IS [n2]:

Or something similar -- the inner arrays were pulled up into multiple definitions that were then subscripted, because the first pull-up did this:

VAL [2]INT n2 IS [[0,1][0], [0,1][1]]:

and then the inner arrays got pulled up again, separately.  The change hasn't immediately broken anything, but I haven't fully tested it yet
2009-02-02 17:30:39 +00:00
Neil Brown
40b9a8b76b Fixed the generated PROCs for copying records not having their definition recorded 2009-02-02 17:23:28 +00:00
Neil Brown
460ee36247 Fixed the pulling up of array constructors into initialisers
Previously, this was only pulling up constructors that contained single elements, and not constructors that contained multiple elements
2009-02-02 16:17:00 +00:00
Neil Brown
1591940996 Removed the fixConstructorTypes pass for now
This pass was responsible for screwing up the types of all arrays after type inference, and the compiler seems to work fine without it
2009-02-02 16:07:47 +00:00
Neil Brown
cbeeef486e Fixed the C backend putting too many braces in array literals, and removed some old comments 2009-02-01 22:27:43 +00:00
Neil Brown
80a3eba49a Had the first attempt at correcting the occam passes to work with the new array literals 2009-02-01 21:54:51 +00:00
Neil Brown
7d185fd72a Adjusted the Rain passes to cope with the new array literals 2009-02-01 21:54:32 +00:00
Neil Brown
46394b8c34 Fixed the occam and Rain parsers to work with the new system for array literals 2009-02-01 21:54:02 +00:00
Neil Brown
3458a9197a Adjusted the backends and transformations module to match the new array literal changes 2009-02-01 21:53:17 +00:00
Neil Brown
8de2dbca88 Adjusted the modules in common to match the new array constructor change 2009-02-01 21:52:13 +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
4f83187549 Fixed up all the tests in light of the new recursive procs 2009-01-29 00:56:32 +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
10e6b4ce02 Updated all the tests to work with the new recursive functions 2009-01-29 00:34:12 +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
3e8273f4f6 Adjusted the C backend to work with the new step count 2009-01-28 23:51:19 +00:00
Neil Brown
2c6f624ea3 Changed the occam type-checker and the Rain stuff to be okay with the new step count 2009-01-28 23:47:36 +00:00
Neil Brown
6d7f456791 Changed the occam parser to accept STEP in replicators 2009-01-28 23:47:00 +00:00
Neil Brown
e1056dd0c9 Changed the lexer to accept the STEP reserved word 2009-01-28 23:46:36 +00:00
Neil Brown
6693a8b8b9 Changed things in the transformations directory in light of the new step count 2009-01-28 23:46:04 +00:00
Neil Brown
594d7ef242 Tweaked various code in the common and checks directory to work with the new step count in the For replicator 2009-01-28 23:43:16 +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
49ea4f053e Fixed the occam parser to allow comments after pragmas on the same line
One of the more recent cgtests has a comment after a pragma
2009-01-28 23:40:14 +00:00
Neil Brown
a4f0e85c72 Fixed a bug involving abbreviation of arrays of channels into arrays of channel-ends in the C++ backend
The array for the channel-ends was not being allocated storage, so the array (a pointer to some random location) was being written to and causing a seg-fault
2009-01-28 23:16:31 +00:00
Neil Brown
6ff8e3b163 Fixed a bug where records were being recorded with the wrong name type in the occam parser 2009-01-28 22:11:23 +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
6e0b56c7f6 Added some preprocessor stuff to help stop Tock trampling over various defines 2009-01-27 17:04:18 +00:00
Neil Brown
d4f1ac2797 Added nearly all the remaining intrinsic functions (all the *TOSTRING and STRINGTO*, except for floating-point types) 2009-01-27 17:00:28 +00:00
Neil Brown
592ed1d4ef Added a line to fix an autoconf warning and added -lm to the link options (for the math libraries) 2009-01-27 16:59:35 +00:00
Neil Brown
f4f08e09aa Fixed the RAN/DRAN intrinsic 2009-01-27 13:50:42 +00:00
Neil Brown
9b1368ffe7 Implemented all but one (RAN) of the intrinsic functions in appendix N by mapping them directly to the C versions 2009-01-27 13:38:00 +00:00
Neil Brown
63d558df20 Fixed some GCC warnings resulting from not passing the printf format through to all the necessary support functions 2009-01-27 13:03:26 +00:00
Neil Brown
dbc75ef0b1 Added a pass that helps stop some GCC warnings about literals equivalent to INT_MIN and similar 2009-01-27 13:00:08 +00:00
Neil Brown
addcefdab2 Stopped GCC warning about unused variables
We detect real unused variables from the occam program ourselves, but we don't want GCC warnings for all the unused _sizes variables and so on
2009-01-27 12:56:32 +00:00
Neil Brown
d1e0ec07c4 Finished off the last of the floating point intrinsics (from appendices K and M)
cgtest19 now passes all its tests
2009-01-27 12:21:18 +00:00
Neil Brown
08f862685c Implemented several of the remaining floating-point intrinsics 2009-01-27 12:04:30 +00:00
Neil Brown
2fc545d09d Implemented REAL32OP and REAL64OP 2009-01-26 19:02:19 +00:00
Neil Brown
20e24b807f Cleared up some signed/unsigned warnings in the latest intrinsics 2009-01-26 19:01:56 +00:00
Neil Brown
41946716f0 Implemented ASHIFTRIGHT (straightforward) and ASHIFTLEFT (amazingly hard) and tested them 2009-01-26 18:57:50 +00:00
Neil Brown
ec9efd378f Corrected some warnings about unsigned constants in the C++ support headers 2009-01-26 18:55:07 +00:00
Neil Brown
e0e0b46052 Implemented SHIFTLEFT and SHIFTRIGHT 2009-01-26 18:11:15 +00:00
Neil Brown
8df1bc80f9 Implemented LONGDIV (passes the cgtests, but I'm not 100% confident in it) 2009-01-26 18:03:27 +00:00
Neil Brown
4a12999989 Implemented LONGPROD, in a slightly long-winded way 2009-01-26 17:57:45 +00:00
Neil Brown
df66042a99 Corrected a problem with LONGADD and implemented both LONGSUB and LONGDIFF 2009-01-26 15:46:37 +00:00