From: "Hal E. Fulton" Date: 2001-05-09T11:33:50+09:00 Subject: [ruby-talk:14891] Re: ANTLR rules for Ruby ----- Original Message ----- From: Juancarlo Anez To: ruby-talk ML Sent: Tuesday, May 08, 2001 5:54 PM Subject: [ruby-talk:14885] Re: ANTLR rules for Ruby > I worked plenty with YACC while I was a student, and learned how difficult > it is to debug, maintain, enhance, and optimize table-driven parsers. > Top-down, procedural parsers are completely the opposite. A top down parser > pays out in the short term even if it has to be written by hand. > [some snips] > Anyway, ANTLR or not, I can't recommend a top-down parser enough. I've heard other people say the same thing -- basically that yacc is easy but the code can't compare with what you write by hand. I'm the opposite of most people, it seems -- I've never used yacc or the moral equivalent, but I have written a few recursive-descent parsers. Coming from my early [cough] Pascal background, I found I always "thought" in terms of Pascal-like syntax diagrams, and found that they translated very nicely into code. Of course, my Pangloss language which I implemented for CS 450 (Theory of Programming Languages) all those years ago was an order of magnitude simpler than Ruby in terms of syntax. > How about a top-down parser written in Ruby? It would be a short, easy, and > fun experiment. I myself would never describe it as short and easy. But I'll take your word for it. [snip again] Even if this isn't an "official" project, there's nothing to stop you from doing it yourself... witness Meta-Ruby and others. And if it turns out well, you'll be a minor hero, or at least have earned a little respect from the community. So go for it! Hal