From: Robert Feldt Date: 2003-06-10T14:18:56+09:00 Subject: Re: Is Ruby's parse tree accessible (prior to evaluation) On Tue, 10 Jun 2003, you CAN teach an old dog ... wrote: > Is there any hook to get at the parsed-tree equivalent of Ruby > expressions (and statements) before these are evaluated? > Not directly but there is bruby (not sure name is correct) by the exerb author and also my Ruth extension. Ruth has been heavily updated and I'm about to release a new version shortly. It can dump the internal trees and also transform them to something more like an AST. It can give you the parse tree for already "compiled" code or be called on a string. I've done some work on going the other way, ie from the Ruby representation of the parse tree back to Ruby's internal representation (since that would allow some really cool/bizarre stuff) but it got messy. I hope to revisit that some day. There is also NodeDump by Dave Thomas and ii by Guy Decoux. I don't think any of them can give you a Ruby representation. They can dump the tree to text though. Regards, Robert Feldt