gSync - Grammar Diff and Merge Tool

Skip to end of metadata
Go to start of metadata

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

How to use

To run gSync, please put ANTLR runtime onto your classpath.

2-way Diff

  1. Start the Diff tool using command:
    $ java org.antlr.gsync.diff.Tool
  2. Double click the two panels to select proto and derived version of your grammar.
  3. Choose ignore options and execute diff.

3-way Merge

  1. Start the Merge tool using command:
    $ java org.antlr.gsync.Tool <proto.g> <derived.g> <revised.g>
  2. Check the merge tasks on the right-hand side to preview changes.

Download

gsync.jar

  1. Jan 08, 2009

    On Windows XP, I was able to run gSync from the command line with either of the two following commands after copying antlr-3.1.1.jar to a lib\ directory under the directory where gsync.jar is located.

      >java -cp C:\mypath\gsync.jar org.antlr.gsync.diff.Tool
      >java -cp C:\mypath\gsync.jar org.antlr.gsync.diff.Tool -f My_v2.g My_v1.g rao

    I was not able to run start by double-clicking on gsync.jar. The problem seems to be that the manifest.mf in gsync.jar has

      Main-Class: org.antlr.gsync.MergeController

    instead of

      Main-Class: org.antlr.gsync.diff.Tool