Skip to content

uchchwhash/fortran-linter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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.

Automated testing

Run make test from the root folder.

Documentation

HTML documentation can be generated by running make -C docs html from the root folder (requires Sphinx).

Prior art

Fortran grammar

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.

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 implementation.

parsec

He Tao’s implementation of Parsec.

pysec

Another approach with some interesting ideas.

About

A linter for Fortran 77 using Parsec-like parsing combinators in Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published