[Rubygrammar-grammarians] Ruby Grammar Project
MenTaLguY
mental at rydia.net
Fri Nov 25 15:30:14 EST 2005
On Fri, 2005-11-25 at 10:53 -0800, Terence Parr wrote:
> Cool. Was wondering about that. Let's do in Java (only stable v3
> target at the moment) and then dump ASTs to disk and then compare.
Yeah, that would definitely be a lot easier.
Let's do it.
I guess we need:
1. an on-disk format to dump the ASTs to
2. a program that dumps using the existing YACC grammar
3. a java program that dumps using the ANTLR grammar
4. a program in (language-of-choice) which compares dumped ASTs
I can do #2, you will probably want to do #3, and we can probably defer
#4 until we've got things reasonably close and get tired of visual
inspection. If we're careful about whitespace plain diff(1) might do.
Unfortunately I've found that MetaRuby's ParseTree isn't going to be
comprehensive enough. It just does individual methods, not arbitrary
fragments or whole scripts.
However, looking at Ruby's source, it apparently has a "ripper" build
configuration which appears to dump parse trees somehow. I'll
investigate that, as it may dictate the ultimate format we use for #1.
-mental
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://rubyforge.org/pipermail/rubygrammar-grammarians/attachments/20051125/3acf979d/attachment.bin
More information about the Rubygrammar-grammarians
mailing list