4 ms·
A good general method for comparing ASTs is Tree Edit Distance. I have an implementation in python https://github.com/timtadh/zhang-shasha https://github.com/ti
by timtadh 10y ago
A good general method for comparing ASTs is Tree Edit Distance. I have an implementation in python https://github.com/timtadh/zhang-shasha https://github.com/timtadh/zhang-shasha . If computing the exact distance is too slow you can use an approximate algorithm https://github.com/timtadh/pygram https://github.com/timtadh/pygram .