{"id":19804088,"url":"https://github.com/camfort/fortran-src","last_synced_at":"2025-05-08T21:05:25.828Z","repository":{"id":37493660,"uuid":"49175249","full_name":"camfort/fortran-src","owner":"camfort","description":"Fortran parsing and static analysis infrastructure","archived":false,"fork":false,"pushed_at":"2023-11-17T11:33:00.000Z","size":2137,"stargazers_count":44,"open_issues_count":56,"forks_count":19,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-05-01T13:37:20.787Z","etag":null,"topics":["automated-refactoring","fortran","haskell","parser","static-analysis"],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/fortran-src","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/camfort.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-01-07T02:20:23.000Z","updated_at":"2024-02-24T18:00:25.000Z","dependencies_parsed_at":"2024-01-01T14:09:57.561Z","dependency_job_id":"9a2ee479-5c6f-4db8-85c8-10e8a1429c78","html_url":"https://github.com/camfort/fortran-src","commit_stats":{"total_commits":1143,"total_committers":17,"mean_commits":67.23529411764706,"dds":0.6675415573053368,"last_synced_commit":"94248231fd0eedf1fffb46582a3687e85ecaa58a"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camfort%2Ffortran-src","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camfort%2Ffortran-src/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camfort%2Ffortran-src/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camfort%2Ffortran-src/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/camfort","download_url":"https://codeload.github.com/camfort/fortran-src/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231481048,"owners_count":18383151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automated-refactoring","fortran","haskell","parser","static-analysis"],"created_at":"2024-11-12T08:02:53.174Z","updated_at":"2025-05-08T21:05:25.815Z","avatar_url":"https://github.com/camfort.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fortran-src\n![CI status badge](https://github.com/camfort/fortran-src/actions/workflows/ci.yml/badge.svg)\n\nProvides lexing/parsing and early static analyses of Fortran code. The following\nFortran standards are covered:\n\n  * FORTRAN 66 (ANSI X3.9-1966)\n  * FORTRAN 77 (ANSI X3.9-1978 / ISO 1539:1980)\n  * Fortran 90 (ISO/IEC 1539:1991)\n  * Fortran 95 (ISO/IEC 1539-1:1997\n  * Fortran 2003 (partial)\n\nParsing is configurable, and you can select the Fortran standard to target,\nincluding special extended modes for nonstandard FORTRAN 77.\n\nIncludes data flow and basic block analysis, a renamer, and type analysis.\n\nThis package primarily exports a Haskell library, but also builds an executable\nthat can be used for testing and debugging. For example usage, see the\n[CamFort](https://github.com/camfort/camfort) project, which uses fortran-src as\nits front end.\n\n## Obtaining\nWe provide [prebuilt binaries](https://github.com/camfort/fortran-src/releases)\nfor Windows, Mac and Linux.\n\n## Usage\nAdd `fortran-src` as a dependency in your Haskell project. We're on\n[Hackage](https://hackage.haskell.org/package/fortran-src) and also on\n[Stackage](https://www.stackage.org/package/fortran-src).\n\n### Command-line tool\nYou can also invoke `fortran-src` on the command line.\n\nFor features that output graphs, the intended usage is to pipe it into the\ncommand `dot -Tpdf` and redirect that into a PDF file. The `dot` command is part\nof the [GraphViz project](https://www.graphviz.org/), please see their manual\nfor the many other options that can be explored for visualisation purposes.\n\n```\nUsage: fortran-src [OPTION...] \u003cfile\u003e\n                          --version                        show fortran-src version\n  -v VERSION, -F VERSION  --fortranVersion=VERSION         Fortran version to use, format: Fortran[66/77/77Legacy/77Extended/90]\n  -a ACTION               --action=ACTION                  choose the action, possible values: lex|parse\n  -t                      --typecheck                      parse and run typechecker\n  -R                      --rename                         parse and rename variables\n  -B                      --bblocks                        analyse basic blocks\n  -S                      --supergraph                     analyse super graph of basic blocks\n  -r                      --reprint                        Parse and output using pretty printer\n                          --split-long                     when using pretty printer, split long lines via continuations\n                          --dot                            output graphs in GraphViz DOT format\n                          --dump-mod-file                  dump the information contained within mod files\n  -C[CPP-OPTS]            --cpp[=CPP-OPTS]                 run the C Pre Processor on the Fortran files first\n  -I DIR                  --include-dir=DIR                directory to search for precompiled 'mod files'\n  -c                      --summarise, --compile-mod       build an .fsmod file from the input\n  -o FILE                 --output-file=FILE               name of output file (e.g. name of generated fsmod file)\n                          --make-mods, --make              determine dependency order of modules and automatically build .fsmod files\n                          --show-make-graph                dump a graph showing the build structure of modules\n                          --show-make-list                 dump a list of files in build dependency order (topological sort from the dependency graph)\n                          --show-block-numbers[=LINE-NUM]  Show the corresponding AST-block identifier number next to every line of code.\n                          --show-flows-to=AST-BLOCK-ID     dump a graph showing flows-to information from the given AST-block ID; prefix with 's' for supergraph\n                          --show-flows-from=AST-BLOCK-ID   dump a graph showing flows-from information from the given AST-block ID; prefix with 's' for supergraph\n```\n\nIf you do not pass a `--fortranVersion` flag, the version will be guessed from\nthe file name:\n\n  * Files ending in `*.f` are parsed with extended FORTRAN 77 syntax.\n  * Files ending in `*.f90` are parsed with Fortran 90 syntax (and respectively\n    for `*.f2003`/`*.f03`, `*.f2008`/`*.f08`).\n  * Unknown extensions are parsed like `*.f` files.\n\n## Building\nYou will need the GMP library plus header files: on many platforms, this will be\nvia the package `libgmp-dev`.\n\nHaskell library dependencies are listed in `package.yaml`. fortran-src supports\nbuilding with Stack or Cabal.\n\nfortran-src supports **GHC 9.0 through GHC 9.4**. We regularly test at least the\nminimum and maximum supported GHCs. Releases prior to/newer than those may have\nissues. We welcome fixes that would let us support a wider range of compilers.\n\nYou will likely need **at least 3 GiBs of memory** to build fortran-src.\n\nFor installing GHC and build tools, we strongly recommend\n[ghcup](https://www.haskell.org/ghcup/).\n\nWhen **latest recommended** is used, it means the latest version of the tool\nthat ghcup tags with `recommended`. This sometimes lags behind the\n`latest`-tagged version. With ghcup installed, run `ghcup list` for a better\nunderstanding.\n\nFollowing are general guides for any OS that provides the relevant tools. If you\nhave trouble, consider checking the CI workflow files in `.github/workflows`.\n\n### Stack\nWe support the latest recommended version of Stack (as of 2021-09-17, Stack\n2.7). Generally, any Stack 2.x should work.  *(Stack 1.x may work with minor\nalternations -- you may have to download the resolver manually.)*\n\n```\nstack build\n```\n\nFor an interactive shell:\n\n```\nstack build\nstack ghci\n```\n\nNote that running `stack ghci` before running `stack build` won't work properly,\ndue to `stack ghci` not running build tools like Alex and Happy. So parser\nmodules will not be built, and you'll receive an error after building the other\nmodules. You can cheat a bit and run `stack build` until you see `Building\nlibrary for [...]` (= preprocessing has finished), then hit `\u003cCtrl-C\u003e` to stop\nthe build and run `stack ghci` as usual.\n\n### Cabal\nWe support the latest recommended version of Cabal (as of 2021-09-17, Cabal 3.4)\n\n```\ncabal build\n```\n\n### Testing\nUnit tests are stored in `test`. Run with `stack test` or `cabal test`.\n\n## Usage\n### As a dependency\nfortran-src is available on Hackage and Stackage, so for Cabal or Stack projects\nyou should only need to add `fortran-src` to your project dependencies.\n\nIf you need a specific version of fortran-src in a Stack setup, you can stuff a\nHackage reference into `stack.yaml` using `extra-deps`, like:\n\n```yaml\nresolver: ...\n...\n\nextra-deps:\n- ...\n- fortran-src-$VERSION\n```\n\n### As a CLI tool\nIf you have Cabal properly configured, you should be able install fortran-src\nfrom Hackage:\n\n```\ncabal install fortran-src\n```\n\nWe provide prebuilt binaries for some platforms: see the\n[Releases](https://github.com/camfort/fortran-src/releases) tab.\n\nOtherwise, you can build from source and use convenience commands like `cabal\nrun`, `stack run`. See [#Building](#building) for details.\n\n## Contributing\nWe welcome bug reports, fixes and feature proposals. Add an issue or create a\npull request on the GitHub repository.\n\n## Support\nYou may be able to find maintainers on the [Libera.Chat](https://libera.chat/)\nIRC network. Check in #fortran-src and #camfort . Otherwise, you could get into\ncontact with one of the team on the [CamFort team\npage](https://camfort.github.io/team.html) -- or create an issue describing your\nproblem and we'll have a look.\n\n### For maintainers\nSee `doc/maintainers.md` in\n[camfort/camfort](https://github.com/camfort/camfort).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamfort%2Ffortran-src","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamfort%2Ffortran-src","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamfort%2Ffortran-src/lists"}