MCPcopy Create free account
hub / github.com/Genivia/ugrep / check_dfa_closure

Method check_dfa_closure

lib/pattern.cpp:3396–3422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3394
3395#ifndef WITH_NO_CODEGEN
3396void Pattern::check_dfa_closure(const DFA::State *state, int nest, bool& peek) const
3397{
3398 if (nest > 5)
3399 return;
3400 for (DFA::State::Edges::const_reverse_iterator i = state->edges.rbegin(); i != state->edges.rend(); ++i)
3401 {
3402#if WITH_COMPACT_DFA == -1
3403 Char lo = i->first;
3404 Char hi = i->second.first;
3405#else
3406 Char hi = i->first;
3407 Char lo = i->second.first;
3408#endif
3409 if (is_meta(lo))
3410 {
3411 do
3412 {
3413 if (lo == META_EOB || lo == META_EOL || lo == META_EWE || lo == META_BWE || lo == META_NWE || lo == META_WBE)
3414 {
3415 peek = true;
3416 break;
3417 }
3418 check_dfa_closure(i->second.second, nest + 1, peek);
3419 } while (++lo <= hi);
3420 }
3421 }
3422}
3423#endif
3424
3425#ifndef WITH_NO_CODEGEN

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected