MEGMS logo - go to the home page
  1. Home

    1. About Us

    2. Services

    3. MEGS_Log

    4. CoalLog tools

    5. Fortran Tools

      1. FF08Depends

      2. FF08Diff

      3. FF08FixedFormForEver

      4. FF08Obfuscate

      5. Internal test utilities

      6. aniso_varying_string

      7. Direct2D API bindings

      8. Fortran shared pointers

    6. Contact Us

  2. Site map

"Let's model me a mine"

M.E.G.M.S.


Mining & Exploration Geological Modelling Services

Previous topic Parent topic Home topic Next topic

FF08Diff

FF08Diff is a command line tool for obtaining the semantic difference (difference in meaning, rather than appearance) between two sets of Fortran 2008 source files.

The tool itself is written in Fortran 2003. A zip archive of the latest source release (revision 2384 from 2016-08-24), available under an Apache 2.0 licence, can be found at www.megms.com.au/download/FF08Diff.zip.

How to use

The command line has the following syntax:

FF08Diff [options] source-file-specs... [--right source-file-specs...]

Command line options:

-? or --help
Display command line and program usage help, then exit.
--version
Display program version information, then exit.
-l or --left
Source file specifications following this option (or before the first --right option) up until the next --right option are taken to be in the left set of source files.
-r or --right
Source file specifications following this option up until the next --left option are taken to be in the left set of source files.
--list[:] file
Specify a list file - each record from the given file will be added (in addition to any source file specifications provided on the command line) to the list of source file specifications for the prevailing set (as indicated by --left and --right) to be processed. May be specified multiple times.
--show-warnings
Show warnings generated during the processing of each file. Warnings typically relate to violations of the syntax rules and constraints of the language standard.
@response-file
Nominates a response file with additional arguments and options. Each argument or option in a response file place should be in its own record. Options and arguments in response files are expanded as they are encountered into the total set of options and arguments for the program. Multiple response files may be specified, and response files may reference other response files, but a response file reference may not be recursive.

source-file-specs is a list of the names of the Fortran source files to parse.

If neither --left or --right is specified, then there must only be two source-file-specs that each evaluate to a single source filename, the first filename becomes the left source set and the second filename becomes the right file set. Alternatively, there can be two --list options - the first specifies the files for the left set, the second for the right set.

Source files with an extension (part of the filename following the last dot) of for or f are taken to be fixed source form files. Source files with an extension of f90, f95, f03 or f08 are taken to be free source form. Other extensions result in an error. The comparison with the file extension is not case sensitive.

Differencing is not sensitive to:

As the differencing looks at the semantics of the source code, it requires the source code to be Fortran 2008 standard conforming, to the degree sufficient for the program to understand the intended semantics. This particularly includes structural aspects of the source, such as matching beginning and end statements for any constructs.

Differences are reported to the console. Errors encountered during differencing are reported to the error unit.

Each difference is typically reported using three records (lines):

STOP codes (which may also be the program's exit code):

0, or no code
Differencing completed successfully and no differences were detected.
1
Differencing completed successfully and semantic differences were detected.
2
Differencing analysis commenced, but with errors. (I know what you want me to do, but I couldn't do it.)
3
There was a problem with the command line arguments. (I haven't got a clue what you want to do.)

Examples

Compare two source files.

FF08Diff left.f90 right.f90

Compare two sets of files, with the left set specified by a list file and the right set explicitly listed.

FF08Diff --list: left-list-file.txt --right file1.f90 file2.f90

Building from source

The source code should be compilable by a Fortran 2003 compiler.

Intel Visual Fortran 15.0 was the compiler used for development. With that compiler, the /standard-semantics switch (or its equivalent on non-Windows platforms) is required.

The file compile-order.txt in the source archive specifies the order in which the included source files may be compiled.

Note that gfortran current trunk (at the time of writing r238060) cannot be used due to PR 44265, PR 71796 and PR 71807.

Feedback

Questions, queries and quibbles can be sent to ff08@megms.com.au.