gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] Conditional compilation & discussion?


From: Gaius Mulley
Subject: [Gm2] Conditional compilation & discussion?
Date: Sun, 10 Dec 2000 16:07:38 +0000

Hi,

I was wondering whether I could solicit opinion about conditional compilation.
and ask a series of questions:

  *  How vital is support for conditional compilation within GM2?

  *  How vital is it to support compilation & debugging of modules which are
     automatically generated?

My feeling is that GM2 does need a method of conditional compilation for
when you have to support several architectures or platforms. The
method I've used up until now is to have separate subdirectories for
each architecture/platform and set the search path accordingly.
Whilst this keeps the code 'pure Modula-2' it does cause duplication.

Regarding the second question I think it would be really useful to
have a switch which would enable the compiler to understand the real
source filename and line number for given input. This would allow
users to generate modules via other tools (parser generators being an
obvious example) but GM2 can give debugging information relating to
the parser input filename/line number etc, rather than the
automatically generated Modula-2 source.

The obvious solution for these points is to have an option to run the
C preprocessor on the implementation/module prior to invoking cc1gm2.
I'd stress that this option is by default _off_ :-) and if the compiler
should normally encounter any preprocessor directive it would issue a
syntax error.

Alternatively the switch could support the second point but not run the
C preprocessor - let the users do this if they so wish.

Clearly it's not PIM2/3/4 :-) and could probably be regarded as heresy
in the world of Modula-2. The current cvs contains a gm2 with an option
-Wcpp to run cpp, although this only will occur on the implementation
module, none of the imported definition modules are preprocessed.
The error handler is a little broken as a result and I'll try and fix this
asap.

regards,

Gaius




reply via email to

[Prev in Thread] Current Thread [Next in Thread]