develooper Front page | perl.perl5.porters | Postings from October 2014

Re: Bringing the regex compiler into the current millenium.

Thread Previous | Thread Next
Aaron Crane
October 23, 2014 13:47
Re: Bringing the regex compiler into the current millenium.
Message ID:
Dave Mitchell <> wrote:
> On Thu, Oct 23, 2014 at 10:15:05AM +0200, demerphq wrote:
>> 1. Change the current awkward multi-pass lexer, into a single pass lexer
>> which constructs an AST which is then analysed and optimised, which woud
>> then be used to produce the final encoded program.
> That sounds great. My only proviso would be that you use some sort of
> slab or arena system for allocating the AST nodes, to avoid lots of
> mallocs.

I was thinking much the same thing. The nice thing about preserving
the existing "sequence of regnodes" output structure is that any slabs
used for allocating the AST nodes can be easily discarded at the end
of regex compilation. Another way of looking at that is that the AST
would replace the regex compiler's sizing pass, but in a form that
promotes analysis and rewriting.

Aaron Crane **

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About