Skip to content

GraminTurn grammar files into facts you can review.

Common, versioned Grammar IR and deterministic structural features for parser grammars — without executing semantic actions.

grammar.y
value
  : object
  | array
  | STRING
  | NUMBER
  ;

object
  : '{' members? '}'
  ;
deterministic features
7Rules
17Alternatives
6Recursive rules
0Unresolved symbols
semantic actions not executed
The path from source to review

Understand a grammar before you change it.

Gramin separates format-specific parsing from format-independent analysis, so the same contract powers exploration, review, CI, and custom tooling.

Grammar sourceFrontendGrammar IR v1FeaturesJSON · Markdown · SARIF
Why Gramin

Explore

Find large rules, recursion, unresolved symbols, unreachable rules, and the diagnostics that deserve attention.

Understand the analysis →

Automate

Use a baseline, regression policy, and SARIF output to bring structural review into GitHub Actions.

Add it to CI →

Build

Use the IR schema and external frontend protocol as a stable boundary for your own grammar tooling.

Connect a frontend →
Supported formats

Many syntaxes, one analysis boundary.

Support is intentionally format-aware. See the matrix for dialects, capabilities, and lossy cases before interpreting a result.

Format familyFrontend IDFilesMain strengthsImportant boundary
Yacc / Bison / Lramayacc-familySinglePrecedence, actions, named referencesRecovery can be lossy
BNF / EBNFbnfSingleGrouping, choice, repetitionFirst file only
ANTLR4antlr4Multi-fileParser/lexer grammar, EBNF, importsTarget code is lossy
MenhirmenhirSingleClassic rules, inline, parameterized symbolsSome attributes are unsupported
Peggy / PEG.jspeggySingleOrdered choice, predicates, scannerlessActions are not retained
Same language, different representation

Numbers need context.

The same JSON language can have different structural measurements when written in Yacc, ANTLR4, or Peggy. Gramin makes that context visible instead of hiding it behind one complexity score.

MetricClassYaccANTLR4Peggy
RulesA7510
AlternativesA171116
Reachable rulesA758
Recursive rulesB644
Nullable rulesB00N/A
Trust boundaries

Structure only. No execution.

Browser sandbox analysis stays local. Semantic actions and target code are never executed or retained as IR. Unsupported or lossy syntax is reported as diagnostics, and not-applicable metrics are not shown as fake zeroes.

Read the safety model
FAQ

What Gramin does — and does not do.

Does Gramin generate parsers?

No. It analyzes grammar structure; it does not generate a parser or prove language-level correctness.

Can I compare different grammar formats?

Yes, with context. Class A metrics are designed for cross-format comparison, while Class B and C metrics require capability or representation context.

Does the sandbox upload my grammar?

No. The browser sandbox runs the parser frontend and analyzer in a Web Worker without sending grammar contents to a server.

Can I send the LLM digest directly to an AI service?

The sandbox only creates a bounded, copyable digest. It does not call an LLM service or send your grammar anywhere.

Structural facts for parser grammars.