To overcome the deficiencies of FORTRAN compilers:
f2f [-?] # reminder of command syntax -D<newflags> [-i<IdentifierDictionaries>] # translates variable names [-j<IncludeSpecDictionaries>] # translates include file names [-r] # reverse use of dictionaries [-o<outfile>] # force outfile name [-u<oldflags>] # force infile flags [-a] # automatically renames outfiles using to the -i file <infile>Here is a description of the command flags:
Handles conditional compilation. It is best explained with a VMS-resident piece of code (xyz.for) valid for VMS:
*#infostat VMS_DEC ONLINE ... *#if MVS_IBM *... MVS code *#elif VMS_DEC ... VAX code ! <--- *#elif ULTRIX *... ultrix code *#elif AIX *... AIX code *#else *... you loose. *#endifThe first line (*#infostat) enables the flags VMS_DEC and ONLINE. Only the VMS_DEC branch contains valid code. Running
f2f -DAIX,UNIX xyz.foron VMS will result in a file xyz.f:
*#infostat AIX UNIX ... *#if MVS_IBM *... MVS code *#elif VMS_DEC *... VAX code *#elif ULTRIX *... ultrix code *#elif AIX ... AIX code ! <---- *#else *... you loose. *#endifready to be compiled on an AIX system. Note that the "valid" branches must be consistent with the enabled flags in the header line, otherwise f2f will produce garbage. If no flags are enabled in the source file, defaults are assumed depending on the system on which f2f actually runs:
The flag names are case insensitive.
Specifies a list of dictionary files (separated by commas) for variable name translations. The format of such an identifier dictionary is for example
e_get_raw egetraw e_anal e$anal ... ...All names in the left column will be translated into the ones in the right column. If a list of files is given, they are merged in the order in which they are specified.
Specifies a list of dictionary files (separated by commas) for include file translations. The format of such an include file dictionary is for example
'inc_ulib:*.inc' 'ulib/*.i' 'inc_flib:*.inc' 'flib/*.i' 'cern_inc:*.inc' 'cern/*.i'All names in the left column will be translated into the ones in the right column. To be in accordance with UNIX the INCLUDE file names specified in the Include Dictionary as well as in the source text are case sensitive. If a list of files is given, they are merged in the order in which they are specified.
The dictionaries specified with -i and -j are processed in reverse manner: the names in the right column are converted into the ones on the left hand side. This means that one can use the same files for both translation directions.
Name of the output file. The default outfile name equals the infile name, except for the file extension, with becomes
.fort, .incl for -DMVS_IBM .for, .inc for -DVMS_DEC .f, .i for everything else.
Normally not needed. You can use this option to "force" an initial flag value, e.g. to convert "raw" VMS_DEC sources on AIX. Use it with care ! You may corrupt your *#if branches.
Automatic rename. The output file name (without extension) is obtained from the input file name after lookup in the Identifier Dictionary List (-i).
Name of the input file. This must be a valid FORTRAN 77 source file. The following is disallowed:
Examples:
f2f -DAIX,UNIX -jflib_aix:flib.dictincl,ulib_aix:ulib.dictincl paw_fopi.forcreates an output file paw_fopi.f, which can be ftp'd to AIX and be compiled there.
f2f -DVMS_DEC,ONLINE -j$FLIBVMS/flib.dictincl,$ULIBVMS/ulib.dictincl -r paw_fopi.f
creates an output file paw_fopi.for, which can be ftp'd back to VMS and be compiled there.
fopi
Tue May 28 15:33:35 CST 1996