tock-mirror/common
Neil Brown f7e114f2fd Overhauled the Types module and ParseOccam to support the new system of operators-as-functions
The idea behind this is to parse unary/binary operators into function calls with 1/2 operands.  So the AST actually has a FunctionCall with the name "+".  Function names may now be quoted operators, and thus you can also have function declarations with names such as "+".  Resolving is *not* done in the parser for these function names, but rather every "+" is left as "+" (no matter what types it operates on, or what is in scope) by the parser (see later patches to InferTypes instead).

When parsing an occam source file, we automatically insert a bunch of PRAGMA TOCKEXTERNAL that define the default occam operators (e.g. + on INT) as external C functions (which they are!).  The naming scheme for these C functions is standardised, and must be used by functions such as mulExprs (which bases the function on the type of its operands) and the new versions mulExprsInt (which are pegged to INT).

The Types module also has some new functions for dealing with operator-functions.
2009-04-05 22:54:05 +00:00
..
CommonTest.hs Go back to passing the value to the type-contains function. 2008-04-02 16:11:13 +00:00
Errors.hs Added a set of enabled warnings to CompState 2008-11-20 13:17:05 +00:00
EvalConstants.hs Fixed the reading of floating point literals to work for negative numbers 2009-04-03 17:53:10 +00:00
EvalLiterals.hs Fixed the reading of floating point literals to work for negative numbers 2009-04-03 17:53:10 +00:00
GenericUtils.hs Changed FUNCTIONs and PROCs to have optional bodies, and put all the externals into the AST (without bodies) 2009-04-04 14:56:35 +00:00
Intrinsics.hs Added some code to the Intrinsics module to list all (currently only some) of the occam standard operators with the types they can operate on 2009-04-05 22:48:23 +00:00
OccamEDSL.hs Changed FUNCTIONs and PROCs to have optional bodies, and put all the externals into the AST (without bodies) 2009-04-04 14:56:35 +00:00
Pattern.hs 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
PrettyShow.hs Corrected a small warning in PrettyShow 2009-04-04 12:49:01 +00:00
ShowCode.hs Removed all the stuff from the ShowCode module that used to deal with operators 2009-04-05 22:38:00 +00:00
TestFramework.hs Moved all the testPass* functions into the TestMonad, using unsafePerformIO for running them inside QuickCheck 2008-03-05 16:06:14 +00:00
TestHarness.hs Modified the test harness so that it gives a meta tag on failure (in case we want it) 2009-02-10 21:33:53 +00:00
TestUtils.hs Changed FUNCTIONs and PROCs to have optional bodies, and put all the externals into the AST (without bodies) 2009-04-04 14:56:35 +00:00
TreeUtils.hs Added an augmented version of Adam's gmapMFor that uses the same generics techniques, but also gives a route to the node to the transformation function 2008-11-06 18:32:35 +00:00
Types.hs Overhauled the Types module and ParseOccam to support the new system of operators-as-functions 2009-04-05 22:54:05 +00:00
Utils.hs Updated the comments on the product* functions in the Utils module 2009-02-09 23:10:29 +00:00