Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What a Ruby parser would you suggest to parse Ruby sources?

Tags:

parsing

ruby

A parser I'm looking for should:

  • be Ruby parsing friendly,
  • be elegant by rule design,
  • produce user friendly parsing errors,
  • user documentation should be available in volume more than a calculator example,
  • UPD: allowing to omit optional whitespaces writing a grammar.

Fast parsing is not an important feature.

I tried Citrus but the lack of documentation and need to specify every space in rules just turned me away from it.

like image 683
Pavel Vlasov Avatar asked Apr 28 '26 08:04

Pavel Vlasov


1 Answers

  • Treetop
  • Ragel

Or in case you want to parse Ruby itself:

parse_tree and ruby_parser

Edit:

I just saw your last comment about needing a subset of Ruby for your project, in that case I'd also recommend having a look at tinyrb.

like image 59
Michael Kohl Avatar answered Apr 30 '26 02:04

Michael Kohl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!