On Fri, 8 Feb 2002, Dave Thomas wrote:

> Bil Kleb <W.L.Kleb / LaRC.NASA.Gov> writes:
> 
> > Hey! me thinks... if Rdoc could be refactored to accept the output
> > from a rockit run, Rdoc could handle *any* language as long as you
> > can supply a grammar file and how to map the resulting AST?
> 
> I think that would be great. And if you can make it handle Ruby using
> RockIT, and if I can still bundle everything into a single
> download,and if the performance is reasonable, I'd be very, very happy
> to throw away the current parser.
> 
There is still some work to do on testing the Ruby parser bundled with
Rockit. If anyone wants to write tests (the lexer is pretty
well-tested thanks to the help of Rich Kilmer but the parser needs more
tests) please mail me.

But, keep in mind that a full, general parser will have a hard time to
compete in speed with a custom-written one tailored to the task at
hand. For example, for RDoc I imagine you can simply skip to the next
method def while a general parser parses everything in between. I've got
some ideas for how to "specialize" a parser when one is only interested in
some parts of a grammar but this is way down on the todo and it will
probably be hard to find a solution that works for all cases (maybe its
even theoretically impossible but anyway... ;-)). 

However, I have high hopes that the final speed (without any
"specialization"/partial evaluation) will be good enough for many
applications.

Regards,

Robert