twp
January 5, 2006, 7:57pm
1
I’m interested in writing compilers in Ruby. It appears that Racc is
a suitable replacement for Yacc, but I’ve not found any replacement
for Lex. I’ve probably missed something. In any case, I’d much
appreciate some help in finding something.
Thanks in advance,
Tom P.
twp
January 5, 2006, 9:51pm
2
twp
January 5, 2006, 10:27pm
3
It’s worth noting that, thanks to grammarian Martin Traverso, the
latest version of ANTLR v3 can generate parsers in Ruby.
split-s: ANTLR for Ruby
It’s still pre-alpha, but things only get better from here!
I believe there’s also a native Ruby port of ANTLR v2 bopping about
out there, though google isn’t helping me out much right now.
A decent LL parser generator really is worth it, though. LALR
sucks.
Incidentally, it looks like Martin will be writing much of the ANTLR
v3 grammar for Ruby. He’s got quite a bit done in SVN already.
-mental
twp
January 5, 2006, 10:33pm
4
Two popular parser generators have or will have ruby support:
ANTLR 3.0 (still in alpha and likely to remain so for another year or
two) will have ruby support too apparently:
http://split-s.blogspot.com/2005/12/antlr-for-ruby.html
They are even working on an antlr 3.0 grammar for ruby itself:
http://rubyforge.org/projects/rubygrammar
Also (not in alpha), there is a ruby version of Coco:
http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/
http://www.zenspider.com/ZSS/Products/CocoR/
http://rubyforge.org/projects/coco-ruby/