|inteligent diff? email@example.com (Norman Hilton) (1997-06-13)|
|Re: intelligent diff? firstname.lastname@example.org (1997-06-15)|
|Re: intelligent diff? email@example.com (1997-06-24)|
|From:||firstname.lastname@example.org (Michael Spertus)|
|Date:||15 Jun 1997 22:37:01 -0400|
|Organization:||Dept. of Mathematics|
Norman Hilton <email@example.com> wrote:
>I have a yacc-based processor for the language, which builds
>trees and then walks them. I could imagine building trees for
>the old and new versions and then comparing. Does anyone
>have algorithms for telling whether nodes have been added
>or deleted when a difference occurs?
I haven't written this in code so tell me how it works out.
A tree can be regarded as a list in some order so we are diffing a
list. I prefer to say we are diffing a list of the top level members
then recursively calling diff within that.
First find all unique members. Matching unique members are the
same. For each matching unique member look at the surrounding members,
if they match they are the same. When you are done anything different
But dealing with trees when you declare members as matching run diff
on their children. In displaying results show the full tree
relationship of all differences.
Return to the
Search the comp.compilers archives again.