Forum: Ruby Ruby equivalent of Lex (or Flex)?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B3c9727cdd39d8127ec5f2bda195a2e2?d=identicon&s=25 Tom Payne (Guest)
on 2006-01-05 19:57
(Received via mailing list)
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 Payne
F3b7109c91841c7106784d229418f5dd?d=identicon&s=25 Justin Collins (Guest)
on 2006-01-05 21:51
(Received via mailing list)
912c61d9da47754de7039f4271334a9f?d=identicon&s=25 unknown (Guest)
on 2006-01-05 22:27
(Received via mailing list)
It's worth noting that, thanks to grammarian Martin Traverso, the
latest version of ANTLR v3 can generate parsers in Ruby.

 http://split-s.blogspot.com/2005/12/antlr-for-ruby.html

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
682fff6db11e1a150d6ce17f3b862448?d=identicon&s=25 Doug H (Guest)
on 2006-01-05 22:33
(Received via mailing list)
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/
This topic is locked and can not be replied to.