Home

Awesome

pfff

CircleCI

pfff is a set of tools and APIs to perform static analysis, code visualizations, code navigations, or style-preserving source-to-source transformations such as refactorings on source code. There is good support for Javascript, Python, C, Java, Go, and PHP. There is also preliminary support for other languages such as C++, Ruby, Rust, C#, Html, CSS, Erlang, Lisp, Haskell, Skip, and SQL. There is also very good support for OCaml code so that the framework can be used on the code of pfff itself.

For each languages there are mainly 2 libraries, for instance parsing_php.cma and analysis_php.cma, that you can embed in your own application if you need to process PHP code. See the demos/ directory for example of use of the pfff API. See also docs/manual/Parsing_xxx.pdf and docs/manual/Analyzis_xxx.pdf for more documentation on how to use or extend pfff.

pfff is also made of few tools:

A few pfff-related tools are now in their own repositories:

For more information, look at the pfff wiki here: http://github.com/facebook/pfff/wiki/Main as well as the docs/manual/ directory.

Usage for pfff

$ ./pfff -parse_php demos/foo.php

or

$ ./pfff -dump_php demos/foo.php

You can also look at ./pfff --help

Usage for pfff_db

$ ./pfff_db -lang ml -o /tmp/pfff.json ~/pfff

to analyze all the .ml and .mli files under ~/pfff and store metadata information (the database) in /tmp/pfff.json

More information

Look at the pfff wiki here: http://github.com/facebook/pfff/wiki/Main