Giter Site home page Giter Site logo

fsource's Introduction

fsource - Fortran static analysis tool

Tests PyPI

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 fsource

In 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
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.