list-rules
Fetch all rules from an ANTLR4 grammar, optionally filtered by lexer or parser type. Returns an alphabetized list with rule definitions, types, and line numbers.
Instructions
List all rules in an ANTLR4 grammar with optional filtering.
When to use: Get a quick overview of all rules, or filter to see only lexer or parser rules.
Example usage: filter_type: "lexer" // Shows only lexer rules (uppercase) filter_type: "parser" // Shows only parser rules (lowercase) filter_type: "all" // Shows all rules (default)
Returns: Alphabetically sorted list of rules with:
Rule names
Rule types (lexer/parser)
Complete definitions
Line numbers
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from_file | No | Optional: path to a grammar file to read | |
| filter_type | No | Filter rules by type (default: all) | |
| grammar_content | No | The content of the ANTLR4 grammar file |