About gdiff
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.
Screenshots
3-way merge window (Ubuntu)
Wizard window for 2-way diff
2-way diff result (MacOSX)
How to use
- Download the gSync from the attachment in this page.
- If using Mac OS or Windows, you can double-click
gsync.jar
to run - For command line, change dir to the dist folder and type in:
No Format $ java -jar ./gdiff.jar
- If using Mac OS or Windows, you can double-click
- In the wizard window, open the grammar files and click the "diff" button.
skip the wizard
...
To run gSync, please put ANTLR runtime onto your classpath.
2-way Diff
- Start the Diff tool using command:
No Format $ java org.antlr.gsync.diff.Tool
...
For example:
...
- Double click the two panels to select proto and derived version of your grammar.
- Choose ignore options and execute diff.
3-way Merge
- Start the Merge tool using command:
No Format $ java org.antlr.gsync.
...
Tool
...
<proto.g> <derived.g> <revised.g>
- Check the merge tasks on the right-hand side to preview changes.