[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Interesting (and useful) exercise with the Ruby grammar by Nick Sieger

M. Edward (Ed) Borasky

10/29/2006 6:22:00 PM

Nick Sieger just posted (well ... I just found out about it) a graph of
the Ruby grammar on his blog. He also posted the same graphs for Java
and Javascript. While the pictures are interesting, impressive and
useful, what's even more interesting, to me, anyhow, is that there
exists a tool set to do this sort of thing!

I haven't had a chance to go tracking down the whole tool set yet, but
it's definitely on my todo list at this point. Most of it appears to be
tied to Antlr, which leads me to wonder if it can/should be ported to Ruby.

And yes, Pat, if I can find a grammar for Forth I might well generate
the picture for it. :)

http://blog.nicksieger.com/articles/2006/10/27/visualization-of-rub...

Thanks, Nick!!

2 Answers

M. Edward (Ed) Borasky

10/30/2006 4:05:00 AM

0

Nick Sieger wrote:
> On 10/29/06, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:
>>
>>
>> I haven't had a chance to go tracking down the whole tool set yet, but
>> it's definitely on my todo list at this point. Most of it appears to be
>> tied to Antlr, which leads me to wonder if it can/should be ported to
>> Ruby.
>
>
> What's interesting with ANTLR 3 is that Ruby is one of the target
> languages. I haven't tried it yet but plan to in the near future -- it
> would be great if ANTLR would allow a more understandable, maintainable
> grammar that would allow Ruby to be able to parse itself.

It wasn't clear from my poking around the web site ... is ANTLRWorks
included in ANTLR 3? It looked like a download of ANTLRWorks included
ANTLR 3. I haven't attempted to get any of the magic up and running yet
-- too busy getting my own project started up.



Tomasz Wegrzanowski

11/3/2006 4:51:00 PM

0

On 10/30/06, Nick Sieger <nicksieger@gmail.com> wrote:
> What's interesting with ANTLR 3 is that Ruby is one of the target
> languages. I haven't tried it yet but plan to in the near future -- it
> would be great if ANTLR would allow a more understandable, maintainable
> grammar that would allow Ruby to be able to parse itself.

If you need an example of ANTLR 3 for Ruby in action,
RLisp ( http://zabor.org/... ) uses it to parse Lisp.

--
Tomasz Wegrzanowski [ http://t-a-w.blo... ]