On Sat, Dec 15, 2007 at 05:45:56PM +0200, Allison Randal wrote:
> Patrick R. Michaud via RT wrote:
> >
> >Yes, I didn't quite expect anyone to be using PCT::HLLCompiler with
> >PAST-pm, or supplying their own PAST->POST transformation.
> >
> >If we need to put the ostgrammar back into the HLLCompiler, we can do
> >that.  
> 
> Supplying your own PAST->POST transformation should at least be an 
> option. HLLCompiler is useful for all HLLs, even ones that don't use 
> PGE, NQP, PAST, or POST at all in their implementation.

It is possible now.  I've been thinking that the way for someone to 
supply a custom PAST->POST transformation would be any or all of:

1.  Use the addstage(), removestage(), or stages() methods to
    change the compiler stage sequence and/or introduce new
    or replacement stages for the PAST->POST step.

2.  Subclass the PCT::HLLCompiler class to provide a custom 
    'post' method that calls whatever is desired.

3.  Subclass the PAST::Compiler class to provide custom PAST->POST
    transformations that might not exist in standard PCT.

Given that this gives us at least three "good" ways to supply
a custom PAST->POST transformation into PCT::HLLCompiler, I didn't
think we really needed a fourth one that is specific to ostgrammars
and TGE.

I'm also thinking that HLLGrammar may evolve slightly so that
each translator can globally register itself with HLLCompilers as
"I know how to transform something of type Foo into another thing
of type Bar".  Then an ostgrammar would simply register itself
as another PAST->POST converter, and a HLLCompiler would have some way of
saying "use the ostgrammar instead of POST::Compiler".

Pm

Reply via email to