[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Searching for a working Ruby parser

Saladin Mundi

1/25/2008 3:25:00 PM

Hey folks!

I'm searching for a working Ruby parser. I found:
coco-ruby 1.0.0
antlr(antlr3rubytarget)

I tried both but they didn't worked for me. (Perhaps I did something
wrong...)


Does anyone of you uses / knows a working parser for Ruby?
Thanks for your help.


sala
--
Posted via http://www.ruby-....

9 Answers

James Gray

1/25/2008 3:48:00 PM

0

On Jan 25, 2008, at 9:24 AM, Saladin Mundi wrote:

> I'm searching for a working Ruby parser. I found:
> coco-ruby 1.0.0
> antlr(antlr3rubytarget)
>
> I tried both but they didn't worked for me. (Perhaps I did something
> wrong...)
>
>
> Does anyone of you uses / knows a working parser for Ruby?

I made my own Ghost Wheel library for generating parsers:

http://rubyforge.org/projects/g...

It's still young, so I'm sure it has rough edges but I've used it for
a few tasks now. The documentation hasn't been written yet, but I did
show a sample of usage on my blog:

http://blog.grayproductions.net/articles/ghost_whe...

You may also want to look at the Treetop parser:

http://rubyforge.org/projec...

Hope that helps.

James Edward Gray II




Daniel Brumbaugh Keeney

1/25/2008 8:18:00 PM

0

On Jan 25, 2008 9:24 AM, Saladin Mundi <saladin.mundi@gmx.de> wrote:
> Hey folks!
>
> I'm searching for a working Ruby parser. I found:
> coco-ruby 1.0.0
> antlr(antlr3rubytarget)
>

Also see

Dhaka
http://dhaka.ruby...
Racc
http://i.loveruby.net/en/proj...

Daniel Brumbaugh Keeney

Ryan Davis

1/26/2008 7:21:00 AM

0


On Jan 25, 2008, at 07:24 , Saladin Mundi wrote:

> Does anyone of you uses / knows a working parser for Ruby?
> Thanks for your help.

Parser generator (for any grammar specified) or a _ruby_ parser?


Saladin Mundi

1/26/2008 11:22:00 AM

0

Thank you very much for your help.

I forgot to say that I also tried dhaka and racc (but thanks Daniel).
There were problems getting them to run, so that I throwed them away to
look for a working parser.

Again, perhaps I'm just incompetend :) to use them.

@James: Ghost Wheel looks very interesting. I will try it out. Also
TreeTop looks interesting!

Ryan Davis wrote:
> Parser generator (for any grammar specified) or a _ruby_ parser?


Parser generator for Ruby Code

Example:
class X
def y()
puts "y"
end
end

Shall be parsed into a tree so that each element like class/method
definition, arguments, parameters, variables... has its own leaf inside
the tree.


Sala





--
Posted via http://www.ruby-....

Daniel Brumbaugh Keeney

1/26/2008 6:17:00 PM

0

I you want some help getting started, I've been learning both Treetop
and Dhaka for the last month or so and would be happy to help you get
started. (Not that I'm necessarily any good at them, but I've made
them work at least.) Ghost Wheel look nice, so I might try learning
that too. I can be found loitering on irc://irc.freenode.net/#rubyunix

Daniel Brumbaugh Keeney

Mickael Faivre-Macon

1/28/2008 2:46:00 PM

0

Hi Daniel,

I just found Treetop and I was waiting for such a lib for quite a time
now, not able to code it myself :-)
Can you compare Treetop and Dharka ?
Which one do you prefer ?

Mickael Faivre-Ma=E7on

On Jan 26, 2008 7:16 PM, Daniel Brumbaugh Keeney
<devi.webmaster@gmail.com> wrote:
> I you want some help getting started, I've been learning both Treetop
> and Dhaka for the last month or so and would be happy to help you get
> started. (Not that I'm necessarily any good at them, but I've made
> them work at least.) Ghost Wheel look nice, so I might try learning
> that too. I can be found loitering on irc://irc.freenode.net/#rubyunix
>
> Daniel Brumbaugh Keeney
>
>



--=20
Mickael.
Coding an AI ! http://faivrem.googlepages.com...

Clifford Heath

1/28/2008 9:39:00 PM

0

Saladin Mundi wrote:
> Ryan Davis wrote:
>> Parser generator (for any grammar specified) or a _ruby_ parser?
> Parser generator for Ruby Code

Check out the post at <http://www.infoq.com/news/2007/12/ruby_ruby_...
for the status on a pure Ruby parser for Ruby.

I believe that Nathan Sobo is planning to write a Ruby parser in Treetop.
Much easier than trying to do it with a limited-lookahead parser like racc,
even though Ryan seems to have achieved it :-). And obviously MRI does...

Clifford Heath.

Saladin Mundi

1/29/2008 9:48:00 PM

0

Clifford Heath wrote:
> Check out the post at
> <http://www.infoq.com/news/2007/12/ruby_ruby_...

thanks for this website. the ruby_parser looks good.

I will also try it
--
Posted via http://www.ruby-....

Ryan Davis

1/30/2008 4:47:00 AM

0


On Jan 29, 2008, at 13:47 , Saladin Mundi wrote:

> Clifford Heath wrote:
>> Check out the post at
>> <http://www.infoq.com/news/2007/12/ruby_ruby_...
>
> thanks for this website. the ruby_parser looks good.
>
> I will also try it

I wouldn't, and I wrote it. :)

Seriously, ruby_parser is slow, ugly, and ... ugly.

Look at ParseTree instead. ruby_parser will catch up, but it'll take
time.