#!/usr/bin/perl # # # Copyright (C) 1997-2005, R3vis Corporation. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA, or visit http://www.gnu.org/copyleft/lgpl.html. # # Original Contributor: # Wes Bethel, R3vis Corporation, Marin County, California # Additional Contributor(s): # # The OpenRM project is located at http://openrm.sourceforge.net/. # # # usage: source2html cSourceFname outputIndexHTMLFile outputHTMLfile # # purpose: # autogenerate HTML documentation from source files by extracting # author-supplied information (comments) from the file marked by # special tags. # # $Id: source2html.pl,v 1.3 2005/02/19 16:47:58 wes Exp $ # Version: $Name: OpenRM-1-6-0-RC5 $ # $Revision: 1.3 $ # $Log: source2html.pl,v $ # Revision 1.3 2005/02/19 16:47:58 wes # Distro sync and consolidation. # # Revision 1.2 2004/01/17 04:04:18 wes # Updated copyright line for 2004. # # Revision 1.1.1.1 2003/01/28 02:15:23 wes # Manual rebuild of rm150 repository. # # Revision 1.2 2000/04/20 16:15:59 wes # JDB modifications. # # Revision 1.1.1.1 2000/02/28 21:29:40 wes # OpenRM 1.2 Checkin # # Revision 1.1.1.1 2000/02/28 17:18:48 wes # Initial entry - pre-RM120 release, source base for OpenRM 1.2. # # # # usage: source2html cSourceFname cLibrary outputIndexHTMLFile outputHTMLfile # # purpose: # autogenerate HTML documentation from source files by extracting # author-supplied information (comments) from the file marked by # special tags. # # # documentation tags $nameTag="\@Name"; $docStartTag="\@dstart"; $docEndTag="\@dend"; $protoStartTag="\@pstart"; $protoEndTag="\@pend"; $argsStartTag="\@astart"; $argsEndTag="\@aend"; # variables $sourceLibrary = "empty"; $sourceFName = "empty"; $sourceFD = "empty"; $destFName = "empty"; $destIndexFD = "empty"; $destContentFD = "empty"; $destContentFName = "empty"; $destContentLink = "empty"; $currentRoutineName = "empty"; sub doLivesInString { # add source file location info print destContentFD "lib", $sourceLibrary, " library source file: ", $sourceFName, "
\n | \n
|---|
\n";
while (!($line =~ /\}/))
{
print destContentFD $line;
$line = ;
}
print destContentFD $line;
print destContentFD " \n";
doLivesInString();
print destContentFD "\n";
while (!($line =~ /$protoEndTag/i))
{
print destContentFD $line;
$line = ;
if (eof(sourceFD))
{
print "in routine ", $currentRoutineName, " the ", $protoEndTag, " appears to be missing\n";
die;
}
}
print destContentFD " \n";
}
sub
doArgs
{
#
# if we're here, then a line containing $argsStartTag was encountered.
# first, we read in the next line - that means that we throw away
# the line containing $argsEndTag.
#
$line = \n";
while (!($line =~ /$argsEndTag/i))
{
print destContentFD $line;
$line = ;
if (eof(sourceFD))
{
print "in routine ", $currentRoutineName, " the ", $argsEndTag, " appears to be missing\n";
die;
}
}
print destContentFD " \n";
}
sub
doDoc
{
#
# if we're here, then a line containing $docStartTag was encountered.
# first, we read in the next line - that means that we throw away
# the line containing $docStartTag.
#
my $inParagraph = 0;
my $wordCount = 0;
$line =