gDiff is a tree-based 3-way diff/merge GUI tool for ANTLR v3 grammars. It can find and merge changes between two versions of an original base ANTLR grammar using information from the grammar's abstract syntax tree. Based on the diff results, gDiff can also do a 3-way merge to synchronize the changes in two version branches. Compared to a text-based diff algorithm, this tree-based one does better on fuzzy matching, pattern recognition, false-change reduction and version synchronization.
To run gSync, please put ANTLR runtime onto your classpath.
- Start the Diff tool using command:
$ java org.antlr.gsync.diff.Tool
- Double click the two panels to select proto and derived version of your grammar.
- Choose ignore options and execute diff.
- Start the Merge tool using command:
$ java org.antlr.gsync.Tool <proto.g> <derived.g> <revised.g>
- Check the merge tasks on the right-hand side to preview changes.