Commit Graph

14 Commits

Author SHA1 Message Date
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
5bf1ffa785 Made the preprocessor correct the path a #USEd file when it finds it on the search path while including it 2009-04-01 18:59:57 +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
8a36f6e96f Added support for parsing pragmas, for now just handling the SHARED pragma 2009-01-19 15:11:09 +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
Adam Sampson
ab416326ad Make Token a real data type.
Previously it was a tuple, which meant it couldn't have sensible
custom instances. Token and TokenType now have Show instances, so we
get more useful output when parsing fails.
2008-06-05 09:46:52 +00:00
Neil Brown
d02b771572 Tidied up the type of handleDirective to make it easier to use 2008-03-05 16:05:21 +00:00
Adam Sampson
a2a15cab64 Split include file expansion out into a separate pass.
The order of initial passes is now:
  lex -> preprocess -> structure -> expand-include -> parse
which means that #IFing out structurally-invalid code (like inline VALOF) now
works.  This also cleans up the preprocessor code a bit.
2008-02-29 15:01:19 +00:00
Adam Sampson
c8b6be34e1 Implement comparisons in preprocessor expressions.
This brings Tock's conditional compilation facilities up to par with occ21.
2008-02-29 00:23:49 +00:00
Adam Sampson
a5fd73130a Use Parsec to parse #DEFINE directives.
This is much neater, and I'll need most of the code to implement comparisons anyway.
2008-02-28 23:47:06 +00:00
Adam Sampson
8f2575819b Initial implementation of the occam-pi preprocessor.
This implements #DEFINE, #UNDEF, #IF, #ELSE and #ENDIF, macro expansion with
##, and TRUE, FALSE, AND, OR, NOT and DEFINED within #IF expressions, with the
same semantics as occ21.

The macro COMPILER.TOCK is always defined by default, so you can now say things
like "#IF NOT DEFINED (COMPILER.TOCK) ... #ENDIF".
2008-02-28 20:27:30 +00:00
Neil Brown
0706cb4d51 Rearranged PreprocessOccam a little so that you can now parse occam source directly from a String (as well as from a filename, as before) 2008-01-16 03:26:49 +00:00
Neil Brown
7d8f170b7d Added support for the #COMMENT directive to the occam parser 2007-10-15 17:12:53 +00:00
Neil Brown
2ff46a9041 Rearranged the Rain source files, renamed a couple of Rain files, and changed the Makefile accordingly. 2007-09-10 17:28:57 +00:00