What is the best analogue of ANTLR for creating parsers in ruby?

I used antlr and javacc / freecc for a while. Now I need to write a bunch of parsers using antlr grammars, but such parsers should be written in ruby ​​lang.

I googled but nothing was found. Is there a ruby ​​parser generator that takes antlr grammars and creates a parser? If there are a lot of them, which is better, in your opinion?

TIA Paolo

+6
ruby antlr grammar javacc parser-generator
source share
3 answers

You can also generate an ANTLR parser for Java or C and call it from your Ruby program using JRuby or FFI .

It should also give you a performance boost, which can be a big advantage if you have a lot of input for parsing.

+1
source share
  • You can easily get away using JRuby and storing your ANTLR parsers in java.
  • If PEG , treetop are enough for your work, and new citrus are the usual tools used by rubists.
  • Other parsers I dug during research for the project: peggy , Kanocc , Racc .

For my project, I chose treetop (citrus fruits have not yet been born).

+7
source share
+3
source share

All Articles