Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Best lexer/parser for Ruby language itself

Thread Tools

Best lexer/parser for Ruby language itself

Anatol Pomozov
Posts: n/a
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi, all.

I need to do following thing: I have some program on ruby and I would like
parse this program, do some manipulations with code and write back it to

Manipulations with sourcecode quite simple, like changing from
puts 2 if a.nil?
if a.nil?
puts 2

or %Q{hello world} -> "hello world"

program is very similar to ruby code beautifier (and probably will be
somewhere in the future).

I am looking for articles/documents with theory background in this area as
well as example programs (better on ruby)

Could you also help me with choosing what is the best lib for doing that. I
saw bunch of ruby parser/lexer libs among them: grammar, parsetree,
rubylexer, syntax, ripper. I dont know what is the best for my task. And I
dont know from what to start. Could you give me any advice on that?

anatol (


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
obtain element name, or attribute and value of the document name itself, and some elemnts and attributes from an ancestor or the node itself using xquery Jeff Kish XML 4 10-30-2008 05:47 PM
limited python virtual machine (WAS: Another scripting language implementedinto Python itself?) Steven Bethard Python 29 01-30-2005 08:30 PM
Another scripting language implemented into Python itself? Python 0 01-27-2005 05:36 PM
Another scripting language implemented into Python itself? Quest Master Python 33 01-27-2005 04:08 PM
Python is the best and most popular general purpose scripting language; the universal scripting language Ron Stephens Python 23 04-12-2004 05:32 PM