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)
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "compare-grammars"
}
}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) |