OpenFortranProject / ofp-sdf

SDF grammar for Fortran 2008 with constructors for AST

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ofp-sdf

SDF grammar and tests for Fortran 2008.

Directories

fortran/experimental - sandbox to explore Fortran SDF grammar productions fortran/syntax - complete syntax specification for Fortran 2008

tests/ - directories for testing Fortran parser tests/rule-tests - tests of the original Fortran 2003 syntax rules tests/rule-f08-tests - tests of 2008 rule additions and modifications

Steps to use OFP:

  1. Edit $(OFP_HOME)/make.inc so that your paths to the stratego tools to reflect your installation
  2. cd $(OFP_HOME)/fortran/syntax; make
  3. cd $(OFP_HOME)/fortran/trans; make

You can then test the parser on the file, testfile.f90, by:

cd $(OFP_HOME)/fortran/trans
make check                      # this produces a Fortran Abstract Syntax Tree (AST) as an ATerm
make unparse                    # this unparses the Fortran AST

About

SDF grammar for Fortran 2008 with constructors for AST

License:Other


Languages

Language:C++ 50.2%Language:C 38.0%Language:Fortran 8.5%Language:Pascal 1.7%Language:Makefile 1.6%Language:Assembly 0.0%Language:Shell 0.0%Language:Forth 0.0%