[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

parse tree for 1.9

Roger Pack

10/10/2008 5:31:00 AM

Anybody know if there is anything like parse_tree for 1.9?
Thanks!
-=R
--
Posted via http://www.ruby-....

3 Answers

Alex Fenton

10/10/2008 8:03:00 AM

0

Roger Pack wrote:
> Anybody know if there is anything like parse_tree for 1.9?
> Thanks!


Perhaps RubyVM::InstructionSequence.compile or
RubyVM::InstructionSequence::compile_file will do something similar to
what you want. These methods are standard in 1.9

alex

Ryan Davis

10/10/2008 8:31:00 AM

0


On Oct 9, 2008, at 22:30 , Roger Pack wrote:

> Anybody know if there is anything like parse_tree for 1.9?

ruby_parser (new and massively improved release coming soon)... don't
let the 1.0.0 release bias your opinion too much.

The only thing it doesn't do is ASTs of runtime objects (procs,
methods, classes/modules). It is 100% compatible with ParseTree's
output tho (that also has a big release coming and there is some
incompatibilities, tho minor).


Ryan Davis

10/10/2008 8:33:00 AM

0


On Oct 10, 2008, at 01:02 , Alex Fenton wrote:

> Roger Pack wrote:
>> Anybody know if there is anything like parse_tree for 1.9?
>> Thanks!
>
>
> Perhaps RubyVM::InstructionSequence.compile or
> RubyVM::InstructionSequence::compile_file will do something similar
> to what you want. These methods are standard in 1.9

unfortunately, no... that's not even close. :(

I've asked multiple times if we could get bytecode for procs and short
of writing more C extensions to hack it out myself, I doubt it'll ever
show. Even still, we'd have to write a bytecode decompiler to
something that was remotely readable/usable. That's a lot of work.