void closure_one(closure_t &clos, Tagpool &tagpool, clos_t &c0,
nfa_state_t *n, tagver_t *tags, closure_t *shadow)
{
- // trace the first iteration of each loop:
- // epsilon-loops may add ney tags and reveal conflicts
- if (n->loop > 1) {
- return;
- }
+ if (n->loop) return;
- ++n->loop;
+ n->loop = true;
switch (n->type) {
case nfa_state_t::NIL:
closure_one(clos, tagpool, c0, n->nil.out, tags, shadow);
break;
}
}
- --n->loop;
+ n->loop = false;
}
/*
} nil;
};
size_t rule;
- uint8_t loop;
+ bool loop;
void make_alt(size_t r, nfa_state_t *s1, nfa_state_t *s2)
{
alt.out1 = s1;
alt.out2 = s2;
rule = r;
- loop = 0;
+ loop = false;
}
void make_ran(size_t r, nfa_state_t *s, const Range *p)
{
ran.out = s;
ran.ran = p;
rule = r;
- loop = 0;
+ loop = false;
}
void make_tag(size_t r, nfa_state_t *s, size_t i, bool bottom)
{
tag.info = i;
tag.bottom = bottom;
rule = r;
- loop = 0;
+ loop = false;
}
void make_fin(size_t r)
{
type = FIN;
rule = r;
- loop = 0;
+ loop = false;
}
void make_nil(size_t r, nfa_state_t *s)
{
type = NIL;
nil.out = s;
rule = r;
- loop = 0;
+ loop = false;
}
};
case 'a':
yyt1 = YYCURSOR;
goto yy3;
- case 'b': goto yy5;
+ case 'b':
+ yyt1 = YYCURSOR;
+ goto yy5;
case 'c':
yyt1 = YYCURSOR;
goto yy8;
a = yyt1;
#line 2 "tags/nondet_iter.--tags.re"
{ @a }
-#line 29 "tags/nondet_iter.--tags.c"
+#line 31 "tags/nondet_iter.--tags.c"
yy3:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch (yych) {
- case 'b': goto yy5;
- default:
+ case 'b':
yyt1 = YYCURSOR;
- goto yy7;
+ goto yy5;
+ default: goto yy7;
}
yy7:
b = yyt1;
#line 5 "tags/nondet_iter.--tags.re"
{ @b }
-#line 54 "tags/nondet_iter.--tags.c"
+#line 56 "tags/nondet_iter.--tags.c"
yy8:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
c = yyt1;
#line 8 "tags/nondet_iter.--tags.re"
{ @c }
-#line 69 "tags/nondet_iter.--tags.c"
+#line 71 "tags/nondet_iter.--tags.c"
yy11:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
d = yyt1;
#line 3 "tags/nondet_iter.--tags.re"
{ @d }
-#line 84 "tags/nondet_iter.--tags.c"
+#line 86 "tags/nondet_iter.--tags.c"
yy14:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
e = yyt1;
#line 6 "tags/nondet_iter.--tags.re"
{ @e }
-#line 99 "tags/nondet_iter.--tags.c"
+#line 101 "tags/nondet_iter.--tags.c"
yy17:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
f = yyt1;
#line 9 "tags/nondet_iter.--tags.re"
{ @f }
-#line 114 "tags/nondet_iter.--tags.c"
+#line 116 "tags/nondet_iter.--tags.c"
}
#line 10 "tags/nondet_iter.--tags.re"