Code Monkey home page Code Monkey logo

pyloco-task-fparser's Introduction

'fparser' task version 0.1.0

'fparser' task wraps fparser Python Fortran parser package to work with other Pyloco tasks. Especially, this task uses the second version of fparser, 'fparser2', of the package to parse down to expression level.

Installation

Before installing 'fparser' task, please make sure that 'pyloco' is installed. Run the following command if you need to install 'pyloco'.

>>> pip install pyloco

Or, if 'pyloco' is already installed, upgrade 'pyloco' with the following command

>>> pip install -U pyloco

To install 'fparser' task, run the following 'pyloco' command.

>>> pyloco install fparser

Command-line syntax

usage: pyloco fparser [-h] [-o OUTPUT] [--general-arguments] data

a wrapper task for fparser Python Fortran parser package

positional arguments:
data File to parse
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
 Save AST as Python pickle file
--general-arguments
 Task-common arguments. Use --verbose to see a list of general arguments
forward output variables:
data Output Abstract Syntax Tree

Example

Following example read 'my.f90' Fortran source file and displays Abstract Syntax Tree (AST) of the file on screen.

An example Fortran source file of 'my.f90'.

program test
    integer, parameter :: x = 1, y = 2
    print *, x, "+", y, "=", x+y
end program

An example pyloco command to parse 'my.f90'.

>>> pyloco fparser my.f90 -- print
PROGRAM test
  INTEGER, PARAMETER :: x = 1, y = 2
  PRINT *, x, "+", y, "=", x + y
END PROGRAM test

pyloco-task-fparser's People

Contributors

grnydawn avatar

Stargazers

Typical Engineer avatar

Watchers

James Cloos avatar Dan Urist avatar  avatar

Forkers

grnydawn

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.