[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: NetBSD GSoC wcc(1)
On Fri, Mar 28, 2008 at 01:01:19PM +0100, Martin Husemann wrote:
> > You would need at least part of a cpp(1) implementation in order to
> > process #include files and remove comments while still counting lines
> > accurately. This is more than a tiny parser, although it is not all
> > that hard.
> I would just run cpp(1) and do all further work on it's output.
If you do that you won't get accurate counts of large cpp macros.
Since the point of the project is to get more accurate counts than you
can easily get with ordinary wc... that doesn't seem desirable.
Also, that way it's not a very interesting project.
Obviously writing a whole cpp implementation isn't feasible, but I
think it's adequate to just handle #includes. I *have* occasionally
seen code in the wild that does
#define HEADER "header.h"
but only very rarely.
David A. Holland
Main Index |
Thread Index |