From: "juan pedro meriƱo" Date: 2006-11-12T01:02:55+09:00 Subject: Re: Ruby parsing in Ruby ------=_Part_46556_31277998.1163260972642 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline i said with ruby 2006/11/11, juan pedro meri=F1o : > > are you create a game as ruby? > > 2006/11/11, Wil : > > > > Hi all, > > > > I've been doing Ruby for a small while now, but I'm a newbie when it > > comes to parsing. I've been digging around, but still can't seem to > > find the answer. I was wondering if Ruby itself has classes that I can > > use to parse ruby source code into a parse tree. > > > > My first inclination was to use Racc > > (http://i.loveruby.net/en/projects/racc/), but I didn't want to have to > > write the BNF(en.wikipedia.org/wiki/Backus-Naur_form) for Ruby if I > > didn't have to (maybe it's not that hard?). I wasn't able to find a > > library of BNF for different languages (including Ruby), so then I > > started looking elsewhere. > > > > Both irb and ri probably use a Ruby parser of some sort, but looking at > > the source code, it looked like each of them rolled their own. I > > wasn't able to dig out the ruby parsing functionality from either by > > including what I thought were necessary code modules. > > > > What would be the easiest way to parse Ruby source into parse trees in > > Ruby? Thanks! > > > > Wil > > > > > > > > ------=_Part_46556_31277998.1163260972642--