[LLVMdev] Regular Expression lib support

OvermindDL1 overminddl1 at gmail.com
Mon Aug 24 11:41:07 PDT 2009


On Sun, Aug 23, 2009 at 11:04 PM, Samuel Crow<samuraileumas at yahoo.com> wrote:
> Hello LLVM Devs,
>
> I thought I'd weigh in on some of these non-backtracking linear time RegEx algorithms.  If they're anything like the PackRat parsing algorithms they take at least 4x the amount of memory in terms of storage as the string length itself by not backtracking.  That should be fine for small RegExes but it wouldn't do so well for more elaborate and long expressions.
>
> If what you need is something for a short regex, a packrat algorithm will do fine.  A 256-character string may bloat up to a couple of KB and still be reasonably cheap.  If you're looking for a full parser, Spirit2.x might be better.

They stated later on (why not earlier I have no clue, but this is why
I switched away from pushing spirit and back to xpressive or
something) that the regex strings they look up are in the files it
reads rather then embedded.  If it was embedded in the code itself,
then yes, by far, they should use Spirit2.1.

As long as they pick a library that works everywhere and not just on
certain platforms I will be quite happy.  :)




More information about the llvm-dev mailing list