-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
41 lines (27 loc) · 1.29 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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:
* [1] Fine-grained and Accurate Source Code Differencing
* [2] 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