From: Pierre Brengard Date: 2002-09-17T16:24:08+09:00 Subject: Re: Why are parser tools rarely used in ruby? MikkelFJ wrote: >Why is it that all the ruby source I find in the Ruby (windows) distribution >has zillions of handwritten parsers: rexml xpath, rdoc, sgml-parser ? > > rdoc uses rexml. >It the same time noone has answered the question recently posted about >whether to use racc or rbison. I have personally briefly used racc and found >it very easy to use, but can't answer for rbison. It seems like these tools >are not in widespread use. Rockit should also be mentioned as Ruby parser >tool. > > I also used racc. I cannot compare it to rbison as I did not used this one, but the way of using racc and bison are almost the same as both recognize LALR grammars. So, at the conceptual level, there are nearly no differences; using racc or rbison is just up to you, the harder step is to write the grammar. >One explanation could be that it is comparatively easy to write a parser in >Ruby. > >Another reason could be that using a compiler compiler requires an >additional build step and since Ruby don't generally use a build procedure, >this is a bit annoying. > > but, you can generate a complete parser with racc, so I do not think this argument is relevant. Then you can distribute your parser under the form of a Ruby script file. >Other reasons could be about error reporting, lack of knowledge about the >available tools, or lack of tool in typical distributions. > >Actually Racc does not seem to be in the 1.6.7 Windows distribution - but I >recall it being in an earlier version - a cygwin issue? > >So I just wonder - why are these tools not in more widespread use? > > I think these tools need theorical studies before you can use them efficiently. Pierre Brengard > >