C/C++ Comment Extractor : Help!!

2002-05-16 Thread cooldude

Hi Perl Gurus,
  I'm trying to Implement a comment extractor from C/C++ Source
files. Before trying to re-invent the wheel., Is there such a tool
already?! My basic purpose is to generate documentation out of the
existing comments.
 If there isn't such a tool, can you give me some skeletal
overview of how the code looks like., (Being a newbie... I'm poor in
regexes., and I think (?) , this can be pretty easy with regexps).
Thanks for your help.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: C/C++ Comment Extractor : Help!!

2002-05-16 Thread Nikola Janceski

Heheheh... My company has actually just completed such a project for
generating help docs from the C/C++ comments in our code which accompany our
regular help docs. Hehheh... the funny part is that it took about a year to
develop to conform to the various comments. Our clients can even use it to
generated docs for any extensions they develop, (but that costs more money
to have our API).

Have fun developing it.. I don't know the schematics of how it works since I
didn't work on the project. I just know it take about 4 hours to run on our
entire source tree, parsing thousands of files with perl might sound more
fun than it really is.

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2002 11:49 AM
> To: [EMAIL PROTECTED]
> Subject: C/C++ Comment Extractor : Help!!
> 
> 
> Hi Perl Gurus,
>   I'm trying to Implement a comment extractor from 
> C/C++ Source
> files. Before trying to re-invent the wheel., Is there such a tool
> already?! My basic purpose is to generate documentation out of the
> existing comments.
>  If there isn't such a tool, can you give me some skeletal
> overview of how the code looks like., (Being a newbie... I'm poor in
> regexes., and I think (?) , this can be pretty easy with regexps).
> Thanks for your help.
> 
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: C/C++ Comment Extractor : Help!!

2002-05-16 Thread Michael Lamertz

On Thu, May 16, 2002 at 09:18:49PM +0530, [EMAIL PROTECTED] wrote:
> Hi Perl Gurus,
>   I'm trying to Implement a comment extractor from C/C++ Source
> files. 



> (Being a newbie... I'm poor in
> regexes., and I think (?) , this can be pretty easy with regexps).

Actually no, it's not easy.

C++ comments (//...) are no problem since they end at EOL, but the
others (/* ... */) are plain evil, especially with compiler flags for
allowing nested comments.

Look for Text::Balance, that should get you started.

-- 
   If we fail, we will lose the war.

Michael Lamertz|  +49 221 445420 / +49 171 6900 310
Nordstr. 49|   [EMAIL PROTECTED]
50733 Cologne  | http://www.lamertz.net
Germany|   http://www.perl-ronin.de 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: C/C++ Comment Extractor : Help!!

2002-05-16 Thread Jeff 'japhy' Pinyan

On May 16, [EMAIL PROTECTED] said:

>  I'm trying to Implement a comment extractor from C/C++ Source
>files. Before trying to re-invent the wheel., Is there such a tool
>already?! My basic purpose is to generate documentation out of the
>existing comments.
> If there isn't such a tool, can you give me some skeletal
>overview of how the code looks like., (Being a newbie... I'm poor in
>regexes., and I think (?) , this can be pretty easy with regexps).
>Thanks for your help.

You should have checked the Perl FAQ.  There is a solution in the
documentation:

  perldoc -q comment

  Found in /usr/local/lib/perl5/5.00502/pod/perlfaq6.pod
  How do I use a regular expression to strip C style comments from a file?

-- 
Jeff "japhy" Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
 what does y/// stand for?   why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]