AFAIK, you're facing the "DFA space explosion".
DFA has to match all your rules in one pass over the string. To do that every state needs a transition 1) to the beginning of every rule and 2) to the middle of every interleaving rule.
Further, the WILDCARD
might be creating "nondeterministic behaviour" because, for example, in the WILDCARD '&prvtof=' WILDCARD '&poru=' WILDCARD
rule the WILDCARD
will match &prvtof=
. This, and the sheer amount of options in the WILDCARD
might further explode the DFA.
In the Ragel 6.8 manual there are guidelines on how to simplify the DFA in the sections "2.5.5 Concatenation" and "4. Controlling nondeterminism".
To avoid the "DFA space explosion" you might want to kind of "deoptimize" the Ragel machine by using scanners, thus selectively switching from a "stateless" DFA to backtracking. And you might want to reduce nondeterminism by using the strong difference operator. And you might want to simplify the WILDCARD
, replacing it with any
.
action matched {return true;}
main := |*
'&prvtof=' (any* -- '&poru=') '&poru=' => matched;
'.a3s?n=' (any* -- '&zone_id=') '&zone_id=' => matched;
any;
*|