BÁRTHÁZI András wrote:
Hi,
Just a short question I'm interested in: where will be, and how will work (I just asking for a general description about it) the regular expression / rules part of Parrot?
I mean, if it will be at the language (Perl 6, Python, etc.) level, or at the virtual machine level? Will Parrot has a regexp support, and the language just have to add a transformation layer to it, or the language has to create the whole thing for it?
If it's documented somewhere, just give me a link there. :)
[There'll be a better answer coming shortly, I'm sure!]
Much thought has gone on in this over the years, and lots of prototyping. The objective has always been to convert REs to parrot instructions, but with the right instructions so that it could be maintainable and perform optimally.
Have a look at languages/regex, and in particular its README. As I recall, a few different approaches were tried, with varying degrees of success.
More recently though we have PGE, see compilers/pge/README and various other related files. This subsystem looks like it is here to stay (from what I've seen). It has a general purpose RE backend and various parsers, which convert the various RE textual formats to an intermediate format, before conversion.
Cheers,
Nick
(I'm assuming that you have access to the source code. If not, I can send links to these files)