Built for Lrama-style BNF

Catch grammar mistakes before your parser does.

Collie lints and formats .y files, catching undefined symbols, recursion trouble, ambiguous precedence, and the quiet mistakes hiding between productions.

gem install collie
parser.y 2 issues found
1 %token NUMBER PLUS
2 %%
3
4 expr:
5     NUMBER
6   | expr PLUS term
7   ;

errorUndefinedSymbol6:15

Symbol term is not defined as a token or rule.

warningAmbiguousPrecedence6:10

Operator PLUS has no precedence declaration.

20built-in rules

5configuration profiles

4report formats

3.2+Ruby support

One tool for the grammar before the code.

Use the same rules locally, in your editor workflow, and in CI. Collie keeps the feedback close to the file that caused it.

Lint what matters

Find duplicate tokens, undefined symbols, unreachable rules, circular references, and style drift with focused, configurable checks.

collie lint grammars/

Format without debate

Normalize indentation, alternatives, tokens, and blank lines. Check formatting in CI or preview a diff before changing a file.

collie fmt --diff parser.y

Report where you work

Choose readable terminal output, JSON, GitHub annotations, or SARIF for code scanning—without maintaining separate rule sets.

collie lint --format sarif parser.y

No setup required

Bring a grammar.
Leave with a cleaner one.

Open the browser playground to lint, format, and auto-correct a grammar immediately. Ruby runs locally through WebAssembly, so your source never leaves the browser.

Open the browser playground

Your grammar is source code.
Treat it like source code.

Install Collie, run it on a .y file, and make parser feedback useful before the build breaks.

Get started on GitHub