OpenFortranProject / open-fortran-parser

Open Fortran Parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open Fortran Parser (OFP)

version 0.8.7

Contents

The Open Fortran Parser (OFP) project provides a Fortran 2008 compliant parser and associated tools. These tools provide a Java and C API for actions that are called when parser rules are completed. These actions allow a parser consumer to build a custom Abstract Syntax Tree (AST).

If you need access to a complete source-to-source Fortran compiler infrastructure incorporating OFP, please consider using ROSE.

The OFP parser is based on an ANTLR 3 grammar and ANTLR version 3.5.2 tools are used to generate the Fortran parser (written in Java). The C action interfaces are currently provided by JNI.

  • Still a little sparse. Action interfaces are defined by the Java file
  • Set your java CLASSPATH to include the ANTLR jar files and OpenFortranParser-0.8.7.jar. If you use the bash shell, you can set the CLASSPATH with something like (assuming files are installed in /usr/local):
  export CLASSPATH=/usr/local/antlr/lib/antlr-3.5.2-complete.jar:/usr/local/ofp/lib/OpenFortranParser-0.8.7.jar
  • Run the parser with the command
  java fortran.ofp.FrontEnd [--verbose] filename
  • The public is free to clone the most recent copy of the OFP git repository repository and experiment with the tools. To submit changes, please fork the repository, branch on your fork, and submit a pull request

src

  • Java and C source files for the project.

build

  • Build directory.

tests

  • Fortran test files for the parser.

About

Open Fortran Parser


Languages

Language:GAP 38.8%Language:C 23.3%Language:Java 18.0%Language:Fortran 10.4%Language:G-code 3.6%Language:C++ 2.9%Language:Makefile 1.4%Language:Shell 0.9%Language:Perl 0.4%Language:M4 0.3%Language:Forth 0.0%