|
|
|
|
|
00001 // This file has been modified on-the-fly with an input filter 00002 // to change it from Perl syntax to C++ strictly for the purposes 00003 // of faking out Doxygen. Modifications include: 00004 00005 // - changing local() definitions to C++ #define statements. 00006 // - commenting out undef statements. 00007 // - changing $globe'... variable names to $globe_... 00008 // - changing sub statements to look like C++ functions. 00009 // - changing # comments to C++ comments. 00010 // - ... 00011 00012 // If you see other strangeness in the HTML version of the Perl file, 00013 // it comes from getting it to look more C++ like. 00014 00015 00016 // #!/usr/#define/bin/perl 00017 00018 ///////////////////////////////////////////////////////////////////////////////// 00019 //// 00020 /** @file 00021 ** @brief Used when Doxygenating C/C++ code files. 00022 ** 00023 ** This is a tool to change the Doxygen comment style from C-style comments 00024 ** to comments with slash-slash-bang. The reason is that influential members of the coding 00025 ** convention group decided that they liked more C++ style comments and 00026 ** did not want to have mixed comment styles. Hence, our coding conventions 00027 ** specify this style. 00028 ** 00029 ** This tool changes existing C style comments to this slash-slash-bang comments. 00030 ** 00031 ** @note Input filters need to be used to change those slash-slash-bang comments into 00032 ** the other style, because the other style works better in Doxygen. 00033 ** If the engineers want to see one style comments in the code that they own, 00034 ** more power to them. The filters will get it back to what Doxygen likes better. 00035 ** 00036 ** I suspect that this tool will not actually be used much despite the coding 00037 ** conventions. Existing comment styles are grandfathered in. Also, new 00038 ** development tools like TogetherSoft produce more JavaDoc like files and 00039 ** prefer those comments. Hence, another suspicion is that our coding conventions 00040 ** will flop back to the C-style JavaDoc comments making this tool 00041 ** never used. 00042 ** 00043 ** @param Input source file. 00044 ** @return Output is file with changes. 00045 ** 00046 ** @ingroup tp_tools tp_dox 00047 ** 00048 ** @author Glenn C. Maxey 00049 **/ 00050 // // 00051 //// $Id: dox_comment_chg.pl,v 1.6 2002/04/06 01:55:09 gmaxe Exp $ 00052 //// 00053 //// 2002 Created by Voyant Technologies, Inc., Westminster, Colorado, USA. 00054 //// 00055 //// Permission to use, copy, modify, and distribute this software and its 00056 //// documentation under the terms of the GNU General Public License is hereby 00057 //// granted. No representations are made about the suitability of this software 00058 //// for any purpose. It is provided "as is" without express or implied warranty. 00059 //// See the GNU General Public License (http://www.gnu.org/copyleft/gpl.html) 00060 //// for more details. 00061 //// 00062 //// Documents produced by this script are derivative works derived from the 00063 //// input used in their production; they are not affected by this license. 00064 //// 00065 //// $Log: dox_comment_chg.pl,v $ 00066 //// Revision 1.6 2002/04/06 01:55:09 gmaxe 00067 //// New files and new general constructs for handling tags. Uses globals better. 00068 //// The html_look* files are designed to handle spider tracing of html systems. 00069 //// 00070 //// Revision 1.5 2002/01/16 19:49:07 gmaxe 00071 //// Removed much of revision history in comments. 00072 //// 00073 //// 00074 ///////////////////////////////////////////////////////////////////////////////// 00075 00076 BEGIN { 00077 #define $comment_count 0 // count if you're in the comments somewhere. 00078 } 00079 00080 NEW_LINE: while (<>) { 00081 00082 // ######## 00083 // Begin replacement of /** ... **/ comments with //! comments 00084 // // This purposely does not do NEW_LINE or printing. 00085 // ######## 00086 if (/^\/[\*]*\//) { 00087 $_ =~ s/[\*]/\//g; 00088 } 00089 if (/^[\s]*\/\*\*/) { 00090 $comment_count = 1; 00091 $_ =~ s/[\s]*\/\*\*/\/\/\!/; 00092 } elsif (/[\s]*\*\*\//) { 00093 $comment_count = 0; 00094 $_ =~ s/[\s]*\*\*\//\/\/\!/; 00095 } elsif (/[\s]*\*\*/) { 00096 $comment_count++; 00097 $_ =~ s/[\s]*\*\*/\/\/\!/; 00098 } 00099 00100 00101 // ######## End Comment style change. 00102 00103 // ######## 00104 // Default Fall through 00105 // ######## 00106 // print $_; 00107 00108 } 00109 00110 00111 00112 00113 00114 00115 00116
|
|
|
Open-Source tools compliments of Voyant Technologies, Inc. and Glenn C. Maxey.
01/13/2003
TP Tools v2-00-0a
# tpt-perl-hcr-02