Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Compute mappings between arbitrary trees.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Type||Name||Latest commit message||Commit time|
|Failed to load latest commit information.|
Outline: ast-diff is a tool that computes the difference between two trees. ast-diff can read trees from files or the standard input, in s-expression format. A clang-based tool to generate C/C++ s-expressions : https://github.com/balayette/clang-sexpression dispatch.py combines ast-diff and clang-sexpression and makes them easier to use. ast-diff uses the Gumtree algorithm to compute mappings from nodes of a tree to nodes of another tree. Usage: If you already have s-expressions that you want to compare: 42sh$ make 42sh$ ./ast-diff --diff test/while.sexp test/for.sexp If you want dispatch.py to handle everything. 42sh$ ./dispatch directory... [--jobs=N] [--glob='*.c'] [--ex-glob='excluded_file.c'] And create the webinterface: 42sh$ ./display.py Creates an out/index.html file Papers: Algorithm description: *  Fine-grained and Accurate Source Code Differencing *  Change Detection in Hierarchically Structured Information Use cases: * VulPecker: an automated vulnerability detection system based on code similarity analysis * Generating simpler AST edit scripts by considering copy-and-paste * Renaming and shifted code in structured merging: looking ahead for precision and performance Related: * A Feasibility Study of Using Automated Program Repair for Introductory Programming Assignments