tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ Using date as a file name

Using n ▻

SED PROBLEM

In article <UnFo4.1555$68.32828@typhoon.nyroc.rr.com>,  <yo@not.com> wrote:
>basically i am trying to remove all C/C++ comments from my source files
>the // is no problem however the /* comment */ is giving me troubles
>here is my code

This was discussed *the* *day* *before* you posted your article, in a
thread entitled "remove whitespace and comments".

If you read that thread, you will find partial solutions in Perl and
sed.  Neither deals correctly with strings that contain `/*' or `*/'.

A question that I didn't raise last time round: why do you want to do
this?  Do you have an application which understands all of the rest
of C syntax, except comments?  Or is it some kind of source shrouding
scheme?  In the latter case I refer you to http://www.opensource.org/
for arguments in favour of releasing your full source.

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: SED PROBLEM
Date: 11 Feb 2000 10:37:34 -0000
Message-ID: <880oq4$i2a$1@ltpcg.star.le.ac.uk>
References: <UnFo4.1555$68.32828@typhoon.nyroc.rr.com>

△ comp.unix.shell △

◅ Using date as a file name

Using n ▻