Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mwallerb/fsource
Fortran static analysis tool written in pure Python
https://github.com/mwallerb/fsource
fortran2008 fortran77 lexer parser static-analysis
Last synced: 22 days ago
JSON representation
Fortran static analysis tool written in pure Python
- Host: GitHub
- URL: https://github.com/mwallerb/fsource
- Owner: mwallerb
- License: other
- Created: 2018-07-14T23:30:24.000Z (over 6 years ago)
- Default Branch: mainline
- Last Pushed: 2022-07-05T05:26:21.000Z (over 2 years ago)
- Last Synced: 2024-10-01T09:27:10.947Z (about 1 month ago)
- Topics: fortran2008, fortran77, lexer, parser, static-analysis
- Language: Python
- Homepage:
- Size: 3.21 MB
- Stars: 21
- Watchers: 5
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
fsource - Fortran static analysis tool
======================================
[![Tests]](https://travis-ci.org/mwallerb/fsource)
[![PyPI]](https://pypi.python.org/pypi/fsource)fsource is a collection of tools allowing you to parse Fortran 77 through
Fortran 2008 programs. It is written in pure Python and has no external
dependencies.You install fsource via pip (you may want to append `--user` flag to install
it just for you or `--prefix=/install/path` to choose the installation location):$ pip install fsource
You can also simply download the [source], since there are no external dependencies.
$ git clone github.com/mwallerb/fsource
$ cd fsourceIn this case you should run `bin/fsource` instead of `fsource`, which augments the
python path with the downloaded source files.Command line interface
----------------------
fsource currently features a [command line interface]:- a [parser], which takes a Fortran file and outputs an abstract syntax tree
(for the definitions) allowing you to extract modules, subprograms, derived
types, parameters, etc.:$ fsource parse FILE.f90
- a [wrapper], which builds on the Fortran parser to extract module variables,
types and subroutines which can be interfaced with C and generates header
files for them:$ fsource wrap FILE.f90
- a [line splicer] and a [lexer], low-level tools which split a Fortran file
into a set of logical lines and tokens, respectively. This allows you to
set up your parsing infrastructure on top of fsource:$ fsource splice FILE.f90
$ fsource lex FILE.f90[source]: https://github.com/mwallerb/fsource
[command line interface]: doc/cli.md
[line splicer]: doc/splicer.md
[lexer]: doc/lexer.md
[parser]: doc/parser.md
[wrapper]: doc/wrapper.md[Tests]: https://travis-ci.org/mwallerb/fsource.svg?branch=master
[PyPI]: https://img.shields.io/pypi/v/fsource.svg?style=flat