[Patch 1/2] Rewrite regex scanner

Tim Shen timshen91@gmail.com
Fri Aug 23 09:15:00 GMT 2013


These two patches are not logically relative, but the next patch is
based on this one.

This patch of the regex scanner(or lexer) supports all styles
specified by N3376. It shall build an abstract layer of regex token
sequence, so that, ideally, the parser and executor do not need to
care which style they are handling.

Originally _Scanner is a class in regex_compiler.{h,tcc}. Since it
could be a standlone module, I move it to regex_scanner.{h,tcc}.

I try my best to reduce duplicated code and make the logic
clear(_M_escape_map and _M_spec_char help a lot). However, I'm still
worrying about potential unexpected behaviors, because it's not about
correctness, but about reading standards.

More testcases are welcome!

Thanks!

PS: For personal reasons, I probably cannot make a response in several
days, but I'll try my best ;)


-- 
Tim Shen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scanner.patch
Type: application/octet-stream
Size: 67292 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20130823/4595033f/attachment.obj>


More information about the Libstdc++ mailing list