Skip to main content

Module bnf

Module bnf 

Source
Expand description

Intermediate representation for BNF/EBNF generation with optimization.

This module provides an AST for BNF expressions that can be built, optimized, and then formatted. This allows us to:

  • Simplify repetition patterns based on hidden elements
  • Detect and simplify enum-as-option patterns

Formatted output follows Wirth syntax notation — see the crate-level ## Design section for the exact notation and its citation.

Enums§

Expr
Intermediate representation of a BNF/EBNF expression. All instances are maintained in optimized form.