On 29 April 2014 07:36, Jonathan S. Shapiro <[email protected]> wrote: > For a while, I thought we might get away with it on the grounds that > priority seemed to be a strict function of the PC value. Unfortunately, the > fine print of the subpattern rule says that the the higher priority > subpattern only wins if the remainder of the regular expression matches. > It's pretty fundamentally a recursive, backtracking implementation. Offhand, > I see no way (in general) to build a deterministic automata when this rule > is in effect. I can see ways to optimize/simplify a PCRE in such a way that > we can recognize when prioritized choice isn't necessary, but I don't see a > general way to turn an NFA with prioritized matching into a DFA.
It's a bit tricky. I don't think I can handle things like arbitrary choice this way, but given a finite list of pattern definitions I can do prioritised matching. It did take a day of meditating on it to come up with a solution, but I'm still writing it and haven't begun to prove it works. -- William Leslie Notice: Likely much of this email is, by the nature of copyright, covered under copyright law. You absolutely may reproduce any part of it in accordance with the copyright law of the nation you are reading this in. Any attempt to deny you those rights would be illegal without prior contractual agreement. _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
