Forum: Ruby ruby lexer/parser package ?

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.
didier.prophete (Guest)
on 2005-11-20 06:25
(Received via mailing list)
a quick question: is there a lex/yacc package for ruby ? or actually
anything to implement a lexer/parser in ruby ?
for some reason I can't seem to find anything like that out there...

thanks for your help.

-Didier
dbalmain.ml (Guest)
on 2005-11-20 06:41
(Received via mailing list)
Hi Didier,

Check out Racc. It comes with ruby in the standard library.

Cheers,
Dave
james (Guest)
on 2005-11-20 08:13
(Received via mailing list)
On Nov 19, 2005, at 10:37 PM, David B. wrote:

> Hi Didier,
>
> Check out Racc. It comes with ruby in the standard library.

Tiny clarification, the Racc *runtime* is a standard library.

James Edward G. II
eric.mahurin (Guest)
on 2005-11-20 08:13
(Received via mailing list)
On 11/19/05, removed_email_address@domain.invalid 
<removed_email_address@domain.invalid>
wrote:
> a quick question: is there a lex/yacc package for ruby ? or actually
> anything to implement a lexer/parser in ruby ?
> for some reason I can't seem to find anything like that out there...

Here are the general parser (and sometimes lexer) packages I found on
raa and rubyforge:

LR parsers:
http://raa.ruby-lang.org/project/racc/ (run-time extension in ruby 1.8)
http://raa.ruby-lang.org/project/rockit/ (doesn't work on 1.8?)

LL parsers:
http://raa.ruby-lang.org/project/coco-rb/
http://rubyforge.org/projects/tdp4r/
http://rubyforge.org/projects/coco-ruby/
http://rubyforge.org/projects/grammar/

Of course I'm biased toward my package (grammar) and think it is the
best out there.  You should take a look at all these if you are
interested in the topic.
didier.prophete (Guest)
on 2005-11-20 19:46
(Received via mailing list)
David, James, Eric,

Thanks a lot guys.
Now, I didn't see any obvious lexer package out there, but maybe I need
to spend more time looking at the examples.

-Didier
eric.mahurin (Guest)
on 2005-11-20 21:23
(Received via mailing list)
On 11/20/05, removed_email_address@domain.invalid 
<removed_email_address@domain.invalid>
wrote:
> David, James, Eric,
>
> Thanks a lot guys.
> Now, I didn't see any obvious lexer package out there, but maybe I need
> to spend more time looking at the examples.
>
> -Didier

For mine, a lexer and parser are made identically - one parses
characters and the other tokens.  On one extreme, you can make a
lexer-free parser and on the other you could make multi-level (more
than just lexer/parser) language transformer/compiler.
This topic is locked and can not be replied to.