[Patch] Reimplment regex matcher using DFS

Stephen M. Webb stephen.webb@bregmasoft.ca
Tue Jul 23 15:34:00 GMT 2013


On 07/23/2013 10:22 AM, Tim Shen wrote:
> On Tue, Jul 23, 2013 at 10:06 PM, Stephen M. Webb
> <stephen.webb@bregmasoft.ca> wrote:
>> Would it be better to prescan the regex to determine which matcher to build?
> 
> Yes that's what I exactly intended to do. But I need some time. The
> Thompson NFA matcher is buggy(when grouping) and I need to fix it
> first, then connect it to the basic_regex constructor.
> 
>> Also, in the absence of back references, a DFA can be considerably faster than an NFA or a DFS.  We should consider
>> constructing a DFA if a prescan says there are no back references and the regex_constants::optimize flag is set.
> 
> That's another important optimization. Again, this could be done
> later. But for now features are needed to be implemented.

Yes, do not try to do too much all at once or you will get nothing done at all.

I just wanted to make sure you designed the code to allow for alternative paths later, and later could be during your
GSoC term so keep the alternatives in mind.

-- 
Stephen M. Webb  <stephen.webb@bregmasoft.ca>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20130723/25b51b36/attachment.sig>


More information about the Libstdc++ mailing list