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
···
On Thu, 19 Aug 2004 18:18:07 +0900, Hal Fulton <hal9000@hypermetrics.com> wrote:
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.