From: Thomas Demmer Newsgroups: comp.os.msdos.djgpp Subject: Re: Utility to strip comments from C/C++ source? Date: Fri, 20 Feb 1998 14:40:48 +0100 Organization: Lehrstuhl fuer Stroemungsmechanik Lines: 56 Message-ID: <34ED87E0.481C8881@LSTM.Ruhr-UNI-Bochum.De> References: <34ED0154 DOT 83D5B0C9 AT bethany DOT edu> <87lnv6wo4s DOT fsf AT hasn DOT dera DOT gov DOT uk> NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Ian Miller wrote: > > pneyz writes: > > > Is there a DJGPP utility to strip comments from files? I started coding > > one then realized someone's probably already done it and it would save > > me the trouble. > > > > If there isn't one, I'd like to submit the one I write (if I have to) to > > the next release. Does anyone think this would be a (semi-)useful > > utility? > > The C preprocessor already does this. Of course, it does a bunch of other > things too (expands macros and so on) but it's probably worth looking at. > I suspect you can control what it does with command line switches if you > run it by hand. That's what I thought of, too. But you'd have something like stdout turned into whatever, probably something you'll never recognize. Maybe you need something like #ifndef REMOVE_COMMENTS #include #endif and a cpp -DREMOVE_COMMENTS foo.c so the preprocesser doesn't see #define stdout what_ever Fingers crossed. > Does anyone know of a utility to add comments to source files. Now that > *would* be useful. :) There probably is an Emacs mode for that somewhere ;-) (I just couldn't resist) -- Ciao Tom ************************************************************* * Thomas Demmer * * Lehrstuhl fuer Stroemungsmechanik * * Ruhr-Uni-Bochum * * Universitaetsstr. 150 * * D-44780 Bochum * * Tel: +49 234 700 6434 * * Fax: +49 234 709 4162 * * http://www.lstm.ruhr-uni-bochum.de/~demmer * *************************************************************