for2html: the FORTRAN to HTML translator
Purpose
for2html is a PERL script that translates FORTRAN sources
into HTML pages.
for2html is particularly useful for analysing and documenting
large projects:
besides an 1:1 image of each source module,
it generates a project home page that lists all source modules
with all their SUBROUTINE, FUNCTION and BLOCK DATA sections.
It automatically generates backward links
to all calling sections.
All SUBROUTINE and FUNCTION calls, INCLUDEd files and BLOCK DATA sections
in the source code are provided with forward links to the invocated code.
Notes on FORTRAN input
for2html is not a syntax checker for FORTRAN -
the source code is supposed to be correct.
for2html does not attempt to translate clumsy,
old-style FORTRAN into something readable -
this should be better done by a for2for translator.
for2html is tested with FORTRAN 77
but should work for older FORTRAN dialects as well.
The following standard extensions to FORTRAN 77 are tacitely assumed:
- source lines are not restricted to 72 characters:
they start in column 7, but they may have arbitrary length,
- object names may have arbitrary length,
- in-line comments (starting with an exclamation mark) are recognised.
Sample output
To see typical for2html output,
visit a
project overview page
that gives access to the source code of the famous BLAS package
(from www.netlib.org).
Download and Configure
Just click here to download
the current version 1.3+ (release 1.3 of 22mar00 plus minor amendments).
After download, move for2html to a bin directory
(or to any other directory in your path, or ...)
and make it executable.
It may be necessary to change the first line to invoke your local Perl5.
Do not use perl -w: the warnings are unjustified.
Note: do not attempt to download for2html
from via the sourceforge project page:
the file release systems is currently not used for this project.
Usage
Command-line invocation:
for2html [-s[C][T]] [-d<dir>] [-t<title>]
[-u<URL>] source_files
Options:
-s[C][T] allows for the following style options:
-sC translate comparison operators like .gt. or
.and. into C-style > or &&.
-sT tries to handle TAB's. With TAB's the lay-out
becomes editor-dependent; therefore it is recommended to replace
them in the source.
-d<dir> directory into which the HTML files will be written.
By default equal to project title.
-t<title> project title.
By default taken from the PROGRAM statement,
provided the source_files contain just one.
-u<URL> back link to a project home page.
Bugs
In the following cases correct (even if not recommendable) FORTRAN code
is not translated correctly:
- Strings are not allowed to continue into continuation lines.
- In-line comments are not allowed to start in columns 2-5.
- The output formats nhtext and ''text''
are not recognised,
which leads to an error when text contains an apostrophe.
For the moment, I can only recommend to use the a format instead.
See also the
mailing list.
For further bug reports,
please quote in your e-mail
the error message and attach the Fortran source.
Related efforts
The free format of FORTRAN 90/95 is not supported by for2html.
For FORTRAN 90 documentation see
f90doc by Eric Demaire.
Author
for2html was written by
Joachim Wuttke
for documenting the data analysis package
Frida-1 (formerly Ida).
This
project is hosted by