From: Robert Feldt Date: 2004-02-22T17:58:05+09:00 Subject: Re: Ruby to Parrot compiler My view on Ruby parsers below. >il Sat, 21 Feb 2004 09:54:25 -0500, "Sean Ross" > ha scritto:: > > > >>Hi. >>This is probably naive, but I was wondering why you couldn't just use Ruby's >>existing front-end implementation to parse and build an AST, >> >> > >I think this is what ruth , bytecoderuby and YAPV do. > > Yes, ruth and bytecoderuby (since it uses ruth!?) use the parser in your current ruby, and with almost certainty that also goes for YAPV. Good thing is that it really parses exactly the same language and you don't have to do much yourself. Bad thing is not all info is there. >ripper, OTOH, uses ruby's parse.y > > > > > In theory should be in sync with Ruby's parser since it is based on it but might lag if there are changes to Ruby's (although I think changes are minor in practice). Downside: more work. And then Rockit/Ruby: Rockit is a stand-alone parser generator with clean grammar grammar. Upside: more easily readable Ruby grammar. Actions can be plugged in. Generates AST-building actions from grammar. Rockit supports tree traversal, pretty-printing etc for all its AST's/grammars. Downside: Not yet released ;). Can get out of sync/might not parse exactly same language. /Robert