Commit Graph

3 Commits

Author SHA1 Message Date
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
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