Skip to content
This repository

pfff is a set of tools and OCaml APIs to write static analysis, dynamic analysis, code visualizations, code navigations, or style-preserving source-to-source transformations such as refactorings on source code.

branch: master

[abstract interpreter] support containers

Summary:
Per title. Similar to D1268141 and D1262073. Since
our model for arrays already covers most of this,
just use that in general.

Also: some hardcoded support for copying operations.
This is pretty much explicitly wrong (copies the
reference, not the data), but it makes more unit
tests pass, so clearly the ends justify the means.

Also: this will end up treating `Set { 1, 2, 3}` as
if it is ordered.

Test Plan: Upcoming integration tests in a separate diff.

Reviewers: pad, julienv

Reviewed By: pad

CC: collingreene

Differential Revision: https://phabricator.fb.com/D1270354

Task ID: 4081629
latest commit 7382b4f806
phooji phooji authored
Octocat-spinner-32 .arc * .arc/default-relative-commit: April 12, 2012
Octocat-spinner-32 code_graph * h_program-lang/database_code.mli: simplify Class and Method, mv March 27, 2014
Octocat-spinner-32 code_map code_map: highlight searched entity April 07, 2014
Octocat-spinner-32 commons * commons/common2.mli: rename March 27, 2014
Octocat-spinner-32 data [cmf] update the way constants are handled in data/php_stdlib/ February 13, 2014
Octocat-spinner-32 demos CEs on commons/lib-json/ -> external/jsonwheel and also removed February 28, 2014
Octocat-spinner-32 docs * docs/manual/announce_pfff_ocaml_list.txt: November 26, 2013
Octocat-spinner-32 editors * editors/emacs/sgrep.el: August 14, 2013
Octocat-spinner-32 external * external/jsonwheel/Makefile: add .cmt March 03, 2014
Octocat-spinner-32 globals * globals/config_pfff.ml.in: bump version April 01, 2014
Octocat-spinner-32 graph_code * graph_code/graph_code.ml: todo April 04, 2014
Octocat-spinner-32 h_files-format push2 -> push February 19, 2014
Octocat-spinner-32 h_program-lang [stags] escape correctly / in vi generated TAGS file April 10, 2014
Octocat-spinner-32 h_program-visual * h_program-visual/main_program_visual.ml: delete March 06, 2014
Octocat-spinner-32 h_version-control CEs on commons/lib-json/ -> external/jsonwheel and also removed February 28, 2014
Octocat-spinner-32 h_visualization * h_visualization/Treemap.tex.nw: related work March 13, 2014
Octocat-spinner-32 lang_bytecode * h_program-lang/database_code.mli: simplify Class and Method, mv March 27, 2014
Octocat-spinner-32 lang_c * lang_cpp/parsing/ast_cpp.ml: get rid of FinalDef April 04, 2014
Octocat-spinner-32 lang_clang * lang_clang/analyze/graph_code_clang.ml: improve conf, add propagate… April 07, 2014
Octocat-spinner-32 lang_cmt * h_program-lang/database_code.mli: simplify Class and Method, mv March 27, 2014
Octocat-spinner-32 lang_cpp * lang_cpp/analyze/highlight_cpp.ml: add IMPORTANT: special comment April 08, 2014
Octocat-spinner-32 lang_csharp highlight_xxx: CEs March 12, 2014
Octocat-spinner-32 lang_css get rid of .cmt in install-findlib, they may not be there! March 12, 2014
Octocat-spinner-32 lang_erlang CEs on commons/lib-json/ -> external/jsonwheel and also removed February 28, 2014
Octocat-spinner-32 lang_haskell highlight_xxx: CEs March 12, 2014
Octocat-spinner-32 lang_html highlight_xxx: CEs March 12, 2014
Octocat-spinner-32 lang_java * lang_js/parsing/parse_js.ml: parse_string, dead but can be useful April 10, 2014
Octocat-spinner-32 lang_js [stags] escape correctly / in vi generated TAGS file April 10, 2014
Octocat-spinner-32 lang_lisp CEs on commons/lib-json/ -> external/jsonwheel and also removed February 28, 2014
Octocat-spinner-32 lang_ml highlight_xxx: CEs March 12, 2014
Octocat-spinner-32 lang_nw highlight_xxx: CEs March 12, 2014
Octocat-spinner-32 lang_objc CEs on commons/lib-json/ -> external/jsonwheel and also removed February 28, 2014
Octocat-spinner-32 lang_opa highlight_xxx: CEs March 12, 2014
Octocat-spinner-32 lang_php [abstract interpreter] support containers April 10, 2014
Octocat-spinner-32 lang_python CEs on commons/lib-json/ -> external/jsonwheel and also removed February 28, 2014
Octocat-spinner-32 lang_sql * lang_sql/parsing/grammar.txt: rename March 05, 2014
Octocat-spinner-32 lang_text CEs on commons/lib-json/ -> external/jsonwheel and also removed February 28, 2014
Octocat-spinner-32 lang_web CEs on commons/lib-json/ -> external/jsonwheel and also removed February 28, 2014
Octocat-spinner-32 matcher CEs rename March 27, 2014
Octocat-spinner-32 opa * opa/pfff_logger.opa: April 05, 2012
Octocat-spinner-32 scripts clean lang_js/ remove avik's code, remove NotParsedCorrectly, FinalDef March 07, 2014
Octocat-spinner-32 tests interface April 10, 2014
Octocat-spinner-32 web * main_codequery.ml: related work March 26, 2014
Octocat-spinner-32 .arcconfig * .arcconfig: new file May 05, 2011
Octocat-spinner-32 .gitignore Partially write "make stdlib" January 21, 2014
Octocat-spinner-32 .travis.yml * .travis.yml: first try July 25, 2013
Octocat-spinner-32 META * META: November 13, 2013
Octocat-spinner-32 Makefile * changes.txt: March 18, 2014
Octocat-spinner-32 Makefile.common make lang_bytecode/ optional in configure; also cleanup stuff March 04, 2014
Octocat-spinner-32 authors.txt * authors.txt: update August 09, 2013
Octocat-spinner-32 bugs.txt misc February 05, 2011
Octocat-spinner-32 changes.txt * changes.txt: April 08, 2014
Octocat-spinner-32 configure * configure: works again with 3.12 March 12, 2014
Octocat-spinner-32 copyright.txt * configure: new option --nocmt March 04, 2014
Octocat-spinner-32 credits.txt * credits.txt: update November 21, 2013
Octocat-spinner-32 env.csh initial import into fresh git repo. September 22, 2010
Octocat-spinner-32 env.sh * env.sh: newline March 12, 2014
Octocat-spinner-32 find_source.ml [pfff] optionally include hack (.hhi) files when searching for php files April 08, 2014
Octocat-spinner-32 find_source.mli factorize more skip_code stuff January 29, 2014
Octocat-spinner-32 install.txt * install.txt: November 13, 2013
Octocat-spinner-32 install_linux.txt * install_linux.txt: February 18, 2014
Octocat-spinner-32 install_macos.txt * install_macos.txt: copy information from opam labltk package November 16, 2013
Octocat-spinner-32 license.txt initial import into fresh git repo. September 22, 2010
Octocat-spinner-32 main.ml * lang_sql/parsing/grammar.txt: rename March 05, 2014
Octocat-spinner-32 main_codegraph.ml * main_scheck.ml: false positive checker March 27, 2014
Octocat-spinner-32 main_codemap.ml code_map: highlight searched entity April 07, 2014
Octocat-spinner-32 main_codequery.ml * main_codequery.ml: make it work ... April 02, 2014
Octocat-spinner-32 main_db.ml ++ -> @ February 19, 2014
Octocat-spinner-32 main_scheck.ml * main_scheck.ml: note March 27, 2014
Octocat-spinner-32 main_sgrep.ml CEs rename March 27, 2014
Octocat-spinner-32 main_spatch.ml * main_spatch.ml: more related work March 24, 2014
Octocat-spinner-32 main_stags.ml [pfff] optionally include hack (.hhi) files when searching for php files April 08, 2014
Octocat-spinner-32 main_test.ml * lang_cmt/parsing/Makefile: -dump_cmt works again March 12, 2014
Octocat-spinner-32 project.el * lang_php/parsing/lexer_php.mll: comment March 31, 2014
Octocat-spinner-32 readme.txt * README.md: deleted, and updated readme.txt, better to not have many March 04, 2014
Octocat-spinner-32 skip_list.txt * skip_list.txt: April 04, 2014
Octocat-spinner-32 syncweb.txt * syncweb.txt: October 10, 2013
Octocat-spinner-32 travis-ci.sh * travis-ci.sh: October 05, 2013
readme.txt
                              pfff

pfff is a set of tools and APIs to perform some static analysis, dynamic
analysis, code visualizations, code navigations, or style-preserving
source-to-source transformations such as refactorings on source code.
For now the effort is focused on PHP but there is preliminary support
for Javascript, C, C++, Java, and other languages. There is also
preliminary 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:
 - pfff, which allows to test the different parsers on a single file
 - scheck, a bug finder
 - stags, an Emacs tag generator
 - sgrep, a syntactical grep
 - spatch, a syntactical patch
 - codemap, which is a gtk and cairo based source code
   visualizer/navigator/searcher leveraging
   the information computed previously by pfff_db and codegraph.
 - codegraph, a package/module/class dependency visualizer
 - codequery, an interactive tool a la SQL to query information
   about the structure of a codebase using Prolog as the query engine
 - pfff_db, which does some global analysis on a set of source files and
   store the data in a marshalled form in a file somewhere (e.g. /tmp/db.json)

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

Usage for codemap:
------------------------

  $ ./codemap ~/pfff

This should launch a gtk-based GUI that allows you to visualize
source code and perform some code search.

Usage for codegraph:
------------------------

  $ ./codegraph -lang cmt -build ~/pfff

to generate a graph_code.marshall file in ~/pfff containing
all dependency information about the pfff codebase using the
typed bytecode .cmt files generated during the compilation of pfff.

  $ ./codegraph ~/pfff

This should launch a gtk-based GUI that allows you to visualize
source code dependencies.

More information
----------------------

Look at the pfff wiki here: http://github.com/facebook/pfff/wiki/Main
Something went wrong with that request. Please try again.