Best lexer/parser for Ruby language itself

Discussion in 'Ruby' started by Anatol Pomozov, Dec 21, 2005.

  1. ------=_Part_2535_24192139.1135164518028
    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
    file.

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

    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 (http://pomozov.info)

    ------=_Part_2535_24192139.1135164518028--
    Anatol Pomozov, Dec 21, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Foster

    Assembler Parser/Lexer in Python

    Simon Foster, Nov 6, 2003, in forum: Python
    Replies:
    4
    Views:
    2,323
    Simon Burton
    Nov 10, 2003
  2. Replies:
    0
    Views:
    356
  3. Replies:
    5
    Views:
    113
    Eric Mahurin
    Nov 20, 2005
  4. Artur Merke

    ruby lexer/parser

    Artur Merke, Nov 3, 2006, in forum: Ruby
    Replies:
    2
    Views:
    114
    Artur Merke
    Nov 3, 2006
  5. Phrogz
    Replies:
    3
    Views:
    127
    Phrogz
    Feb 27, 2007
Loading...

Share This Page