19 const size_t dfa_t::NIL = std::numeric_limits<size_t>::max();
89 std::sort(kernel, end);
90 const size_t size =
static_cast<size_t>(end - kernel) *
sizeof(
nfa_state_t*);
91 return kernels.
insert(kernel, size);
96 , nchars(charset.size() - 1)
98 std::map<size_t, std::set<RuleOp*> > s2rules;
101 std::vector<std::vector<nfa_state_t*> > arcs(
nchars);
104 for (
size_t i = 0; i < kernels.
size(); ++i)
111 for (
size_t j = 0; j < kernel_size; ++j)
122 for (; charset[c] != r->lower(); ++c);
123 for (; charset[c] != r->upper(); ++c)
125 arcs[c].push_back(m);
134 s2rules[i].insert(n->
value.
fin.rule);
142 for(
size_t c = 0; c <
nchars; ++c)
145 for (std::vector<nfa_state_t*>::const_iterator j = arcs[c].begin(); j != arcs[c].end(); ++j)
152 for(
size_t c = 0; c <
nchars; ++c)
159 const size_t count =
states.size();
160 for (
size_t i = 0; i < count; ++i)
163 std::set<RuleOp*> &rs = s2rules[i];
165 for (std::set<RuleOp*>::const_iterator j = rs.begin(); j != rs.end(); ++j)
174 for (std::set<RuleOp*>::const_iterator j = rs.begin(); j != rs.end(); ++j)
187 std::vector<dfa_state_t*>::iterator
static Range * ran(uint32_t l, uint32_t u)
std::vector< uint32_t > charset_t
union re2c::nfa_state_t::@6 value
std::vector< dfa_state_t * > states
std::map< rule_rank_t, rule_info_t > rules_t
dfa_t(const nfa_t &nfa, const charset_t &charset, rules_t &rules)
size_t insert(const void *data, size_t size)
static nfa_state_t ** closure(nfa_state_t **cP, nfa_state_t *n)
enum re2c::nfa_state_t::type_t type
struct re2c::nfa_state_t::@6::@10 fin
size_t deref(size_t i, data_t *&data)
struct re2c::nfa_state_t::@6::@7 alt
struct re2c::nfa_state_t::@6::@9 ctx
static size_t find_state(nfa_state_t **kernel, nfa_state_t **end, ord_hash_set_t &kernels)