Newsgroups: comp.sys.transputer
From: djb1@ukc.ac.uk (Dave Beckett)
Subject: Re: OCCAM Compiler Directives
Organization: Computing Laboratory, University of Kent at Canterbury
Date: Mon, 16 May 94 10:04:09 GMT
Message-ID: <296@parsley.ukc.ac.uk>

>>>>> About "Re: OCCAM Compiler Directives", Bob said:
Bob> You could have used the C pre-processor, cpp, if OCCAM didn't
Bob> have its own set of directives prefixed by `#'. So, failing
Bob> that, there is an OCCAM pre-processor called PREOCC that will do
Bob> want you want. It recognises the #ifdef stuff, but doesn't get
Bob> phased by OCCAM syntax like #USE. There is probably a copy on
Bob> Hensa, look out for postings from Dave Beckett at UKC for ftp
Bob> details etc.

PREOCC is part of the occam2 toolset compiler and is used in part of
the compilation system to make the compiler libraries.  It is created
during the compiler build process, requiring the tcoff and arg
libraries to be built first.  Once built it looks like this:

parsley 43$ ./preocc
preocc : Simple pre-processor
SUN Version 4.800, Apr 19 1994
(c) Copyright Inmos Limited.

Usage: preocc <filename> {-option}

Options:

   O{filename}	specify an output file.
   ZI{env var}	specify search path.
   D{define}	specify define variable.
   Z		debug mode.

and seems to cope with #ifndef/#ifdef/#endif/#else directives.

I've compiled a sun4 binary of it and put in

  ftp://unix.hensa.ac.uk/parallel/occam/compilers/inmos/oc/preocc-bin-sun4.gz

  (4993 bytes)

But you can compile it yourself from the sources of the who compiler,
from:

  ftp://unix.hensa.ac.uk/parallel/occam/compilers/inmos/oc/oc-src.tar.gz

  (1520636 bytes)

All you need to do is edit the 'build' script to just build the two
libraries arg and tcoff and then compile preocc.

Dave

