compare-grammars
Compare two ANTLR4 grammars side-by-side to identify differences. Get common, unique, and modified rules plus statistical summaries for version updates or grammar merging.
Instructions
Compare two ANTLR4 grammars side-by-side to identify differences.
When to use: Understand changes between versions, merge grammars, or analyze variations.
Example usage: from_file1: "v1/MyGrammar.g4" from_file2: "v2/MyGrammar.g4"
Returns:
Common rules (unchanged)
Rules unique to grammar 1
Rules unique to grammar 2
Modified rules (exist in both but differ)
Statistical summary (counts, percentages)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from_file1 | No | Path to first grammar file (overrides grammar1_content) | |
| from_file2 | No | Path to second grammar file (overrides grammar2_content) | |
| grammar1_content | No | Content of the first grammar file (required if from_file1 not provided) | |
| grammar2_content | No | Content of the second grammar file (required if from_file2 not provided) |