Is there a free diff utility that can compare two C++ files using their ASTs instead of the text?
What I was thinking of is something like:
[Asked by one of the other answerers to post the name of a commercial tool.]
Semantic Designs' SmartDifferencer tool will parse C++, and compute a difference based on ASTs; layout formatting simply doesn't matter. The parser is a full C++11 parser. It can parse most source files without expanding most preprocessor directives as long as they are "structured"; C++ preprocessor usage isn't usually as abusive as it is in C.
There are versions of the SmartDifferencer for other languages.
[Disclosure: I'm the CTO at Semantic Designs]
I can think of two alternative solutions to your problem:
Discuss a coding style that will be used as a group and stick to it. You may have to find compromises between the team members' differing personal coding styles.
If you are using source control, add hooks which remove all formatting on a commit and customize the code formatting on checkout. This takes some works but allows team members to use their own formatting style. Of course, this doesn't solve differing opinions in variable naming and other non-formatting code style elements.
There are tools like MOSS (http://theory.stanford.edu/~aiken/moss/) which might be of help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With