Parsing Ruby...

H

Hal Fulton

I'm about to delve into the mysteries of parsing Ruby.

Some questions:

1. I seem to remember that ripper is "the future" of Ruby
parsing, correct?

2. But apparently now we are still using parse.c which is
generated by yacc?

3. My impression was that ripper itself could not create
an AST... correct or no??

4. There have been various attempts at Ruby parsers *in Ruby*,
I know... how mature are these? How accurate? How easy to
understand the code?

5. What experts are around who are willing to answer questions
from time to time?


Thanks,
Hal
 
C

Chad Fowler

I'm about to delve into the mysteries of parsing Ruby.

Some questions:

1. I seem to remember that ripper is "the future" of Ruby
parsing, correct?

Not sure anymore, but I'd love to know.
2. But apparently now we are still using parse.c which is
generated by yacc?

Right. In fact, Ripper does the same thing but gives you a Ruby
representation of the code....
3. My impression was that ripper itself could not create
an AST... correct or no??

Ripper can create an AST.

4. There have been various attempts at Ruby parsers *in Ruby*,
I know... how mature are these? How accurate? How easy to
understand the code?

Ripper is in Yacc, C, and Ruby, but I would definitely take a look at
it. It's pretty easy to understand and relatively mature. Mark S. is
using (and enhancing) it for Cardinal.
5. What experts are around who are willing to answer questions
from time to time?

If I were an expert, I would be willing. :)

Chad
 
M

Minero Aoki

Hi,

In mail "Parsing Ruby..."
Hal Fulton said:
I'm about to delve into the mysteries of parsing Ruby.

Some questions:

1. I seem to remember that ripper is "the future" of Ruby
parsing, correct?

In this month I met matz and got an agreement to commit ripper
in the standard distribution. I'll commit it in the very near
future (in this weekend, for example).

At the same time, matz is saying that he is writing a new parser.
I don't know when it reaches production level.

2. But apparently now we are still using parse.c which is
generated by yacc?

Ripper also uses yacc.
It is just an improvement patch for current parser.

3. My impression was that ripper itself could not create
an AST... correct or no??

Mark Sparshatt is working for ripper based AST.
See ripper repository hosted on RubyForge.


Regards,
Minero Aoki
 
M

mark sparshatt

Hal said:
I'm about to delve into the mysteries of parsing Ruby.

Some questions:


4. There have been various attempts at Ruby parsers *in Ruby*,
I know... how mature are these? How accurate? How easy to
understand the code?
Using Ripper I haven't had any troubles understanding the code (and
that's despite the fact my c skills are very rusty)
5. What experts are around who are willing to answer questions
from time to time?
I've been using Ripper as part of Cardinal and while I'm not an expert
I'm willing to try and answer any questions you might have.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top