logo       

Re: rx_compile and FSAs: msg#00307

lang.perl.perl6.internals

Subject: Re: rx_compile and FSAs

Aaron Sherman <ajs@xxxxxxx> wrote:
> I've done quite a lot of thinking about Parrot's rx_compile op, as I was
> thinking about implementing it.

Given that rx_compile syntax and semantics aren't really final and
second that compiling a rx takes substantial time, I'd do something like
this:

# classes/rx_compiler.pmc
#
pmclass Rx_Compiler extends Compiler need_ext {
...
METHOD rx_to_fsa(){...} # as discussed today - NCI method
...
}

Then cou can

Px = new Rx_Compiler
foo = Px."rx_to_fsa"(bar)
... whatever is appropriate

You can experiment with needed methods, implement new ...
You can subclass the Rx_Compiler, implement it in PIR and what not.

Eventually for gaining the last bit of speed, we could make opcodes for
the methods.

leo




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise