8

What open source (preferably gem-based) parser-generator options do I have in Ruby?

I've used (flex&bison)|(lex&yacc) from C in the past, and I'm comfortable with BNF-style specifications.

I've heard of treetop, but it looks a bit alien and verbose compared to yacc...

Purpose: I want to convert my text markup language to a BNF and generate the parsing code.

Dafydd Rees
  • 6,941
  • 3
  • 39
  • 48

3 Answers3

4

Have you looked at rex and racc, the gem versions of lex and yacc?

Ross Attrill
  • 2,594
  • 1
  • 22
  • 31
mckeed
  • 9,719
  • 2
  • 37
  • 41
3

There's also parslet if you want a PEG-based processor

pinkboi
  • 259
  • 2
  • 9
1

Citrus is an option - similar but not identical to Treetop in its grammar.

Ross Attrill
  • 2,594
  • 1
  • 22
  • 31