README.org
June 8, 2017 · View on GitHub
-
About fortran-linter is a utility program to analyze Fortran 77 legacy code. We sure have a lot of those lying around.
-
License MIT
-
Running the program From the root folder, run
#+BEGIN_SRC bash python -m linter.fortran analyze sample.f #+END_SRC
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.
-
Automated testing Run
make testfrom the root folder. -
Documentation HTML documentation can be generated by running
make -C docs htmlfrom the root folder (requires [[http://www.sphinx-doc.org/en/stable/][Sphinx]]). -
Prior art ** Fortran grammar I found an EBNF (Extended Backus–Naur form) of the Fortran 77 grammar [[http://www.faqs.org/qa/qa-9372.html][here]]. So far it seems to comply well with the official [[http://www.fortran.com/F77_std/rjcnf0001.html][standard]].
** Parser combinators 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: *** Parsec The original Haskell [[https://hackage.haskell.org/package/parsec][implementation]].
*** parsec He Tao's [[https://pypi.python.org/pypi/parsec][implementation]] of Parsec.
*** pysec Another [[http://www.valuedlessons.com/2008/02/pysec-monadic-combinatoric-parsing-in.html][approach]] with some interesting ideas.