MCPcopy Create free account
hub / github.com/Genivia/RE-flex / gen_predict_match

Method gen_predict_match

lib/pattern.cpp:4460–4470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4458}
4459
4460void Pattern::gen_predict_match(std::set<DFA::State*>& states)
4461{
4462 // find min between 0 and Const::BITS then populate bitap and hashes (bounded by min)
4463 gen_min(states);
4464 std::map<DFA::State*,std::pair<ORanges<Hash>,ORanges<Char> > > hashes[Const::BITS];
4465 gen_predict_match_start(states, hashes[0]);
4466 bool saturated = false; // PM hashes are saturated, e.g. \w{8,} explodes the hash space use and we can stop populating more
4467 for (uint16_t level = 1; level < Const::BITS && !hashes[level - 1].empty(); ++level)
4468 for (std::map<DFA::State*,std::pair<ORanges<Hash>,ORanges<Char> > >::iterator from = hashes[level - 1].begin(); from != hashes[level - 1].end(); ++from)
4469 gen_predict_match_transitions(level, from->first, from->second, hashes[level], saturated);
4470}
4471
4472void Pattern::gen_predict_match_start(std::set<DFA::State*>& states, std::map<DFA::State*,std::pair<ORanges<Hash>,ORanges<Char> > >& first_hashes)
4473{

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected