fortran-linter is a utility program to analyze Fortran 77 legacy code. We sure have a lot of those lying around.
MIT
From the root folder, run
python -m linter.fortran analyze sample.f
for an analysis of label and variable usage in a sample legacy source file.
See documentation for a list of other tasks linter.fortran
can perform.
Run make test
from the root folder.
HTML documentation can be generated by running make -C docs html
from the root
folder (requires Sphinx).
I found an EBNF (Extended Backus–Naur form) of the Fortran 77 grammar here. So far it seems to comply well with the official standard.
This approach of parser construction combines parsers for sub-expressions into a parser for expressions containing them with a set of gluing operations. This implementation takes inspirations from:
The original Haskell implementation.
He Tao’s implementation of Parsec.
Another approach with some interesting ideas.