Re: Calculate percentages

From: Bill Vermillion (bv_at_wjv.com)
Date: 10/24/05


Date: Mon, 24 Oct 2005 21:25:00 GMT

In article <06fb01c5d8da$fd373110$6600000a@venti>,
Brian K. White <brian@aljex.com> wrote:
>
>----- Original Message -----
>From: "Jean-Pierre Radley" <jpr@jpr.com>
>Newsgroups: comp.unix.sco.misc
>To: <distro@jpr.com>
>Sent: Sunday, October 23, 2005 6:10 PM
>Subject: Re: Calculate percentages
>
>
>> Dion typed (on Sun, Oct 23, 2005 at 01:33:13PM -0700):
>> | I am a beginner in UNIX and I want to write a shell script calculating
>> | the proportion of one-line comments in any C++ program. Could anyone
>> | help me please? Thanks!
>>
>>
>> I daresay you haven't the least interest or purpose in knowing how many
>> comments in a program are one-liners.
>>
>> Occam's razor tells me that your instructor has asked you to write such a
>> script. Does your instructor approve of your getting help from us?
>> Would that affect your grade?
>
>Well, to be honest,
>
>There is a comment syntax for single lines that is valid in c++ that is not
>valid in c.
>And it would be both a simple "get report", and possibly legitimately
>useful, to find only those lines that would be invalid c syntax.

>But I won't divulge any more hint than I already have in case you
>are right, because it looks that way to me too. Besides, I've
>already seen his next post and someone apparently never figured
>out the kindergarden basic life lesson yet that you catch more
>flies with honey.

You can kill a lot more with Black Flag (TM). :-)

>Maybe he feels this makes me an jerk, but in the end, I know the
>answer, and he's dissuaded me from being generous with it. ;)

>I only wish Tony hadn't sabotaged our plot to keep him in the
>dark forever muhahahahaha.....

And there is a flag in the gcc compiler that warns when you have
a C syntax comment "start sequence", so that means you have to
inspect things visually to find the end of the comment section.

Bill

-- 
Bill Vermillion - bv @ wjv . com