I need to I make a program which the main objective is to extract the comments on source code in order to see if the programmers did cumply with one of the principles of development of my company! The principle of commented code, for a better understanding of it, for later upgrading or bugs fixing!
In order to do that i must be capable of extracting the comments of any type of source code(PERL, JAVA, PL/SQL, ProC, C++, etc)!! I have tested a Module(Regexp http://search.cpan.org/author/ABIGAIL/Regexp-Common-2.113/lib/Regexp/Common/comment.pm) that is a very nice and helpfull tool for this kind of work!! But the problem is that the regexes donīt preview all the cases!
And this module catches all the above examples!!#This is a comment print "# This is not a comment"; qw/ # Neither is this/ @array= ('#', "or this"); ?#array #or this
Or/* This is a comment*/ /*This is also a comment */
Other idea is to have the following structure:/** This is * a * comment for javadoc! **/
Where the source file is the file to be analyzed, the ParserPl.pl is the file where are the regexes to match the comments and the program.pl is the file to process the results of the parsing...> program.pl source.pl ParserPl.pl
My question is if you have any sugestion to do this kind of program??ex: > program.pl source.c ParserC.pl > program.pl source.java ParserJava.pl > etc...
2003-06-21 edit ybiC: <code> and evidently intended <p> tags In reply to Extracting Comments
by nofernandes
For:
Use:
& & < < > > [ [ ] ]