n->mark = true;
switch (n->type) {
case nfa_state_t::ALT:
- closure(kernel, kend, n->value.alt.out2, tags, badtags, ntags);
- closure(kernel, kend, n->value.alt.out1, tags, badtags, ntags);
+ closure(kernel, kend, n->alt.out2, tags, badtags, ntags);
+ closure(kernel, kend, n->alt.out1, tags, badtags, ntags);
break;
case nfa_state_t::TAG: {
- const size_t t = n->value.tag.info;
+ const size_t t = n->tag.info;
const bool old = tags[t];
tags[t] = true;
- closure(kernel, kend, n->value.tag.out, tags, badtags, ntags);
+ closure(kernel, kend, n->tag.out, tags, badtags, ntags);
tags[t] = old;
break;
}
const bool *newtags = tagpool[kernel[j].tagidx];
switch (n->type) {
case nfa_state_t::RAN: {
- nfa_state_t *m = n->value.ran.out;
+ nfa_state_t *m = n->ran.out;
size_t c = 0;
- for (const Range *r = n->value.ran.ran; r; r = r->next ()) {
+ for (const Range *r = n->ran.ran; r; r = r->next ()) {
for (; charset[c] != r->lower(); ++c);
for (; charset[c] != r->upper(); ++c) {
merge_tags_with_mask(&arctags[c * ntags], newtags,
nfa_state_t *out;
size_t info;
} tag;
- } value;
+ };
size_t rule;
bool mark;
- void alt(size_t r, nfa_state_t *s1, nfa_state_t *s2)
+ void make_alt(size_t r, nfa_state_t *s1, nfa_state_t *s2)
{
type = ALT;
- value.alt.out1 = s1;
- value.alt.out2 = s2;
+ alt.out1 = s1;
+ alt.out2 = s2;
rule = r;
mark = false;
}
- void ran(size_t r, nfa_state_t *s, const Range *p)
+ void make_ran(size_t r, nfa_state_t *s, const Range *p)
{
type = RAN;
- value.ran.out = s;
- value.ran.ran = p;
+ ran.out = s;
+ ran.ran = p;
rule = r;
mark = false;
}
- void tag(size_t r, nfa_state_t *s, size_t i)
+ void make_tag(size_t r, nfa_state_t *s, size_t i)
{
type = TAG;
- value.tag.out = s;
- value.tag.info = i;
+ tag.out = s;
+ tag.info = i;
rule = r;
mark = false;
}
- void fin(size_t r)
+ void make_fin(size_t r)
{
type = FIN;
rule = r;
break;
case RegExp::SYM:
s = &nfa.states[nfa.size++];
- s->ran(nrule, t, re->sym);
+ s->make_ran(nrule, t, re->sym);
break;
case RegExp::ALT:
s = &nfa.states[nfa.size++];
- s->alt(nrule,
+ s->make_alt(nrule,
regexp2nfa(nfa, nrule, tagidx, re->alt.re1, t),
regexp2nfa(nfa, nrule, tagidx, re->alt.re2, t));
break;
break;
case RegExp::ITER:
s = &nfa.states[nfa.size++];
- s->alt(nrule, t, regexp2nfa(nfa, nrule, tagidx, re->iter, s));
+ s->make_alt(nrule, t, regexp2nfa(nfa, nrule, tagidx, re->iter, s));
break;
case RegExp::TAG:
if ((*nfa.tags)[tagidx].type == Tag::VAR) {
s = &nfa.states[nfa.size++];
- s->tag(nrule, t, tagidx);
+ s->make_tag(nrule, t, tagidx);
} else {
s = t;
}
size_t &tagidx, const RegExpRule *rule)
{
nfa_state_t *s = &nfa.states[nfa.size++];
- s->fin(nrule);
+ s->make_fin(nrule);
return regexp2nfa(nfa, nrule, tagidx, rule->re, s);
}
nfa_state_t *s = regexp2nfa_rule(nfa, 0, tagidx, regexps[0]);
for (size_t i = 1; i < nregexps; ++i) {
nfa_state_t *t = &nfa.states[nfa.size++];
- t->alt(i, s, regexp2nfa_rule(nfa, i, tagidx, regexps[i]));
+ t->make_alt(i, s, regexp2nfa_rule(nfa, i, tagidx, regexps[i]));
s = t;
}
nfa.root = s;