From: Mark Date: 2004-02-22T06:21:31+09:00 Subject: Re: Ruby to Parrot compiler Charles Comstock wrote: > Simon Strandgaard wrote: > >> On Sat, 21 Feb 2004 09:54:25 -0500, Sean Ross wrote: >> >>> 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, and >>> then build >>> a seperate generator that takes the AST as input to compile and emit >> >> >> [snip] >> >> Cool.. a ruby2ast converter. >> >> Question: is the AST a bunch of ruby classes, which can be >> manipulated/navigated through Ruby? >> >> >> One day, I hope, to extend my editor so it can interact with Rubys >> AST, then some really nice things becomes possible: >> >> * advanced syntax coloring which can identify syntax-errors. >> * obtain advanced help about the code under the cursor. >> * advanced code completion. >> >> >> -- >> Simon Strandgaard >> > > I think we definitely need a meta-aware ruby interpreter that you can > hook some stuff when it's parsing it's own file. Or even just an > interpreter switch that dumps the parse tree in a couple of different > formats, if it's too hard to get it at runtime. This would make it > much easier for alot of things. > This sounds like a Ruby version of Perls B::** modules, which I agree would be a very good thing. Though would it be best to do this by modifying the interpreter, or by using one of Ripper, Ruth or Rocket? -- Mark Sparshatt