Python and ruby together?

Parsing ruby is very complex, and there are very few complete (or
nearly complete) ruby parsers out there. It's possible that some
python library exists that can parse ruby, but unlikely. Your best bet
is to use one of the existing ruby parsers from a ruby interpreter
running in a separate process, serialize the tree it outputs and
figure out how to unserialize that into python data.

The ruby parsers I know of are:

RedParse (disclaimer: I wrote this one)
ParseTree (+JParseTree for jruby)
ruby_parser
RubyNode
ruby 1.9 + Ripper (which I only discovered today can output a tree)

···

On 8/4/09, Gwen Morse <goldmooneachna@yahoo.com> wrote:

Is it possible to set up python scripts in such a way that they can
parse ruby files?

Does this do what you want?
http://github.com/why/unholy/tree/master

-chris

···

On Tue, Aug 4, 2009 at 5:47 PM, Caleb Clausen <vikkous@gmail.com> wrote:

On 8/4/09, Gwen Morse <goldmooneachna@yahoo.com> wrote:
> Is it possible to set up python scripts in such a way that they can
> parse ruby files?

Parsing ruby is very complex, and there are very few complete (or
nearly complete) ruby parsers out there. It's possible that some
python library exists that can parse ruby, but unlikely. Your best bet
is to use one of the existing ruby parsers from a ruby interpreter
running in a separate process, serialize the tree it outputs and
figure out how to unserialize that into python data.

The ruby parsers I know of are:

RedParse (disclaimer: I wrote this one)
ParseTree (+JParseTree for jruby)
ruby_parser
RubyNode
ruby 1.9 + Ripper (which I only discovered today can output a tree)