On Mon, Nov 27, 2006 at 05:28:59PM -0800, Allison Randal wrote:
> Patrick R. Michaud wrote:
> >
> >I'll gladly add PAST::Stmt and PAST::Exp nodes if that's at all
> >useful.  Just because they're there doesn't mean a compiler has to
> >use them.  :-)
> 
> Well, I came to the conclusion that PAST::Exp was useless a while ago. 
> (Its entire point of existence was as a dummy node to be factored out at 
> the PAST-to-POST stage.) I do think PAST::Stmt is useful, but I want to 
> take a stab at refactoring it out first.

Excellent.  Let me know when/if you want PAST::Stmt added in, and any
attributes you want it to have.

> Oh, I should have mentioned that the patch I sent in to remove the dummy 
> 'root' rule from the POST::Grammar was part of what was making Punie 
> work (because Punie's top-level node isn't a PAST::Block, it's a 
> PAST::Stmts). I can refactor that out, but in this case it seemed to 
> make more sense to refactor the compiler tool (since the other languages 
> still worked with the change).

POST really needs to have a POST::Sub at the top of the tree,
so the purpose of the 'root' rule in POST::Grammar is (going to be) 
to create a POST::Sub for the tree if the lower transformations
don't happen to return one.  I'll add that code shortly, and then
things should work properly even if the top-level node in PAST
isn't a PAST::Block.

Pm

Reply via email to