[comp.lang.ada] Dave Emery's proposal for Ada preprocessor

sdl@herbrand.Inference.Com (Daniel Lee) (12/13/89)

We are developing a commercial Ada-based tool (expert system tool in
particular) which has to run on multiple platforms possibly on
multiple compilers on the same hardware.  We found that the lack
of Ada tool similar to cpp makes it very hard to maintain portable Ada code
across multiple platforms, and yet Ada is designed for portability.

Currently, we are using cpp on a Sun to preprocess the master Ada
source with cpp macros embedded (e.g. #if, #endif, etc.).  Then, we preprocess
it using cpp.  First, we defined app as follows:

/lib/cpp $1 $2 $3 $4 $5 $6 $7 $8 $9 | grep -v "^#"

Then, we do the following:

app -DVERDIX foo.a.master > foo.a   or
app -DVMS foo.a.master > foo.ada

The problem with this is that foo.a.master is still not a compilable
Ada file and has to be preprocessed manually while its C equivalent
is a direct input to a C compiler.  I agree with Dave that if such
thing as cpp is added to Ada, it should be part of STANDARD Ada
so that only a single source file has to be maintained.

				Danile Lee
				Inference Corporation
				sdl@inference.com

arny@cbnewsl.ATT.COM (arny.b.engelson) (12/13/89)

In article <8912122030.AA05794@Herbrand.Inference.Com> sdl@herbrand.Inference.Com (Daniel Lee) writes:
>Currently, we are using cpp on a Sun to preprocess the master Ada
>source with cpp macros embedded (e.g. #if, #endif, etc.).  Then, we preprocess
>it using cpp.
>
>				Danile Lee
>				Inference Corporation
>				sdl@inference.com

You're not the only one doing this.  I have seen folks here also using the
C preprocessor to maintain Ada code for more than one target.  This is a
pretty good indication that we need a standard Ada preprocessor.  You can
argue for or against such a thing based on philosophical reasons, but if
experienced, competent programmers are going as far as using cpp, we really
ought to create a standard Ada preprocessor.

  -- Arny Engelson   att!wayback!arny

schwartz@dinl.uucp (Michael Schwartz) (12/14/89)

We have used RCS for this purpose; but I have to admit conditional
compilation would have aided in maintenance.
Michael

-- 
-----------------------
schwartz@pogo.den.mmc.com "Expect everything ... 
mschwartz@mmc.com                   and the unexpected never happens." 
ncar!dinl!schwartz                               --the phantom tollbooth

DISCLAIMER:  The opinions expressesed are not necessarily those of my 
	     employer or myself.