Skip to content

Releases: akoerner/FortranAS

Release 66

19 Jan 12:35
5b632da
Compare
Choose a tag to compare
Merge pull request #5 from akoerner/dev

Dev

Release 65

19 Jan 12:34
Compare
Choose a tag to compare
v65

fixed java version check in fortranas launcher

Release 64

19 Jan 12:28
Compare
Choose a tag to compare
v64

updated workflow

FortranAS Release v1.0

19 Jan 10:54
c5ea5a1
Compare
Choose a tag to compare

FortranAS Release v1.0

FortranAS

FortranAS is an Antlr4 🔗 powered
FORTRAN parsing and code clone detection tool. FortranAS leverages
grammars-v4 🔗 to
generate parsers and lexers and supports any FORTRAN version with
available corresponding grammars.

Prerequisites

  • Install JRE 19+
  • Install GraphViz (for DOT conversion)
  • Install unifdef command line tool
  • Install python3
  • Install meld for clone pair diffing

Usage

  1. Copy FORTRAN source code to ./source and optionally strip preprocessor directives using tools/unifdef.sh
  2. Run FortranAS:
./fortranas --output-directory output \
            --input-source-code-directory source \
            --print-fortran-files \
            --parse-fortran-files \
            --calculate-code-clones
  1. Generate clone pairs:
python3 code_clone_analysis/generate_clone_pairs.py
  1. Explore clone pairs using preferred diffing tool by diffing
    ./output/clones/references and ./output/clones/candidates.
    Optionally, use the clone explorer script provided by FortranAS:
export DIFFTOOL=meld
bash tools/explore

Non-standard Language Features

The Antlr4 grammars cannot parse FORTRAN source code that uses non-standard language
features such as preprocessor directives. In order to process
these files with FortranAS the preprocessor directives must be removed.
There is no perfect way to do this. FortranAS provides a shell script that
uses the command line tool unifdef in the
tools directory called unifdef.sh. This shell script will strip all
preprocessor directives from the FORTRAN source code in the ./source directory.
To run it place FORTRAN ./source and run the provide script:

bash tools/unifdef.sh