Stay compatible
Use racc grammar files and the familiar do_parse and yyparse APIs.
A Pure Ruby LR parser generator
Turn racc-compatible or extended EBNF grammars into deterministic Ruby parsers, inspectable automata, and diagnostics that explain the conflict—not just its line number.
gem install ibex
rule
expr : expr '+' term
| term
term : term '*' NUMBER
| NUMBER
end
expr → • expr '+' termexpr → expr '+' • termexpr → expr '+' term •Grammar in. Ruby parser and reviewable states out.
Why Ibex
Generate the familiar Ruby interface when you need it. Open the machinery when the grammar needs investigation.
Use racc grammar files and the familiar do_parse and yyparse APIs.
Trace conflicts through states, lookaheads, resolutions, and bounded counterexamples.
Conflict diagnosticsCompare LALR(1), IELR(1), canonical LR(1), and SLR from the same grammar.
Algorithm guideValidate and compare versioned grammar, lexer, automaton, and diagnostic IR.
Architecture and IRFirst parser
gem install ibexibex -o calculator.rb calculator.yruby calculator.rbPrivate by design
The playground runs Ibex under ruby.wasm in a dedicated worker. It treats action bodies as source data, never executes them, and makes no server round-trip.
Open the playgroundAdopt with clear boundaries
Stable defaults, opt-in extensions, and research surfaces are documented separately.
Ibex is pre-1.0. The compatible baseline is available now.