On Mon, Feb 25, 2002 at 12:18:20AM -0800, Brent Dax wrote:
> We have an opcode, rx_compile, slotted for a generic regex compiler.
> The idea is that most regex-heavy languages (like Perl) would implement
> their own compilers with the extra semantics necessary, but many
> languages that don't need advanced features can use the built-in.
> (Advanced features are things like (?{}), named groups (e.g. Microsoft's
> (?<name>regex) syntax), certain switches for things like
> accent-insensitive matches, etc.)  If it's in C, put it into an
> rxcomp.c/rxcomp.h and make rx_compile call it.  If it's not, well, I'm
> not sure what to do about that.  Port it to Parrot bytecode, perhaps?
> :^)

It's in Perl. And I was planning on supporting (?{}), though I don't
yet. ("Support" as in "somebody else compiles it and passes me a
label". Seems easy enough.)

Actually, the exact set of things supported is dependent on which
backend you use. Right now, I compile down to your rx ops and my own
re ops (with the re support much more complete because I'm
egocentric.) It throws an error if it encounters a construct not
supported by a particular backend. Though most constructs don't depend
on the existence of new bytecodes; Parrot is Turing-complete, after
all!

So just as soon as someone implements the rest of Perl6, I'm all ready
to port it over to Parrot bytecodes. Or has Simon done that already? I
can't keep track of him.

Reply via email to