hf77_filter(1) hf77_filter(1)
NAME
voshf77, f66hf77, fixoctal - VOS Fortran to Hf77 Fortran
translators
SYNOPSIS
voshf77
f66hf77
fixoctal
DESCRIPTION
voshf77 is a shell script (utilizing awk) for converting a
number of VOS Fortran extensions and architectural entities
to the appropriate hf77 supported syntax. VOS Fortran is
the Fortran dialect accepted by Harris' Fortran 77 compilers
on H-series computer systems.
f66hf77 is a shell script (utilizing awk) for converting
certain Fortran 66 constructs into appropriate Fortran 77
syntax.
fixoctal is a shell script (utilizing tr and awk) for con-
verting old style VOS Fortran octal constants into one of
the forms hf77 will accept.
Each script reads Fortran source from stdin and writes the
translated source to stdout.
voshf77 will convert the following VOS Fortran features :
$ADD into an INCLUDE statement. By default, the
VOS areaname is converted into a UNIX pathname
by removing the asterisk and VOS qualifier,
and converting the remainder to lower case.
The user can control this by editing a local
copy of the awk script.
SPECIAL COMMON
statements into comments. There is no SPECIAL
COMMON (nor any need for it) on CX machines.
Inline Directives
into comments. Note that inline assembly
sequences will be commented out and a warning
diagnostic written to the terminal after the
script completes.
END$ statements into END statements. The remainder
Page 1 CX/UX Fortran Reference
hf77_filter(1) hf77_filter(1)
of the input data is ignored.
JOBCNTRL commands appearing as the first portion of a
file are skipped.
*3 and *6
as a size specifier for INTEGER and LOGICAL
datatypes into *4 or *2 (user selectable).
*6 and *9 and *12
as a size specifier for the REAL datatype into
*4 or *8 (user selectable). In addition, a
size specifier on a DOUBLE PRECISION variable
can be discarded, or the DOUBLE PRECISION
declaration can be replaced by a REAL declara-
tion.
The user can customize the conversions mentioned above
by copying the awk script into her own local directory,
editing the script to set certain awk variables, and
executing the changed script. The initial portion of
the awk script is well marked and easy to find and
modify. The commands needed to do this are :
cat /usr/bin/voshf77 >voshf77
vi voshf77
(user makes appropriate changes to the
script)
./voshf77 <vossource.f >hf77source.f
diff vossource.f hf77source.f
Of course, any available editor may be used instead of
vi.
f66hf77 will convert the following Fortran 66 features to
an hf77 compatible form :
PARAMETER statements
Some Fortran 66 compilers accepted a PARAMETER
statement of the form "PARAMETER A=1, B=2". Note
that there are no parenthesis in the statement.
Fortran 77 requires parenthesis around the list,
i.e. "PARAMETER (A=1, B=2)". f66hf77 changes
the blank immediately after the PARAMETER keyword
to a "(", and adds a continuation line with a sol-
itary ")" after the last line of the PARAMETER
Page 2 CX/UX Fortran Reference
hf77_filter(1) hf77_filter(1)
statement.
fixoctal will convert octal constants of the form '123 into
the form '123'O. The user of this script is cautioned to
carefully review the changes made by this script for
correctness. This transformation is impossible to perform
correctly in all possible circumstances. The script itself,
/usr/bin/fixoctal, contains a list of assumptions and
suggestions. A knowledgeable awk user will be able to adapt
the script to his individual circumstances. In most cases;
however, it is expected that 95+% of the changes made will
be correct, and the remainder can most easily be corrected
by hand.
EXAMPLES
voshf77 < vos_fortran_source > hf77_source
f66hf77 < fortran66_source > hf77_source
fixoctal < fortran66_source > hf77_source
FILES
/usr/bin/voshf77 awk script to convert VOS For-
tran to hf77 source
/usr/bin/f66hf77 awk script to convert Fortran 66
source to hf77 source
/usr/bin/fixoctal script to convert old VOS style octal
constants
SEE ALSO
CX/UX Hf77 Fortran Reference Manual.
hf77(1)
DIAGNOSTICS
There are no diagnostics. Source code passed into these
translators is assumed to be correct Fortran.
WARNING
Since these scripts modify the source code in a relatively
simpleminded manner, the user is advised to diff the input
and output files to verify the correctness of the changes
made.
voshf77 does not correctly handle files with imbedded tab
characters. Note that VOS Fortran programs do not have
tabs, and this script should be used before any tabs are
inserted. Tabs are not required by but are allowed in hf77.
BUGS
Currently, f66hf77 does not correctly handle the different
semantics of the PARAMETER statement in its conversion. In
Page 3 CX/UX Fortran Reference
hf77_filter(1) hf77_filter(1)
Fortran 66, the variables in the PARAMETER statement are
typed (INTEGER, REAL, ...) based on the type of the initial-
izer value, while in hf77 the variables are typed the same
as any other variable.
fixoctal uses a simple minded heuristic to distinguish
between octal constants and character strings. This heuris-
tic may not always work correctly. Also, Hollerith fields
are not recognized, so the appearance of an apparent octal
constant within a Hollerith item will be changed.
Page 4 CX/UX Fortran Reference