From: Ulya Trofimovich Date: Mon, 6 Apr 2015 18:08:02 +0000 (+0100) Subject: Continued adding "--skeleton" switch. X-Git-Tag: 0.15~313 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=261353ba77ce640a26e98d6854e7b194371036d8;p=re2c Continued adding "--skeleton" switch. When generating DFA paths respect range lower bound as well as upper bound. --- diff --git a/re2c/code.cc b/re2c/code.cc index f0409e4b..49678337 100644 --- a/re2c/code.cc +++ b/re2c/code.cc @@ -1068,17 +1068,28 @@ static void generate_data (OutputFile & o, uint ind, State * s, const std::vecto else if (!s->generated) { s->generated = true; + uint b = 0; for (uint i = 0; i < s->go.nSpans; ++i) { std::vector, uint> > zs; for (uint j = 0; j < xs.size (); ++j) { - std::vector z (xs[j].first); - z.push_back (s->go.span[i].ub - 1); const uint l = s->rule == NULL ? xs[j].second : xs[j].first.size (); + + std::vector z (xs[j].first); + z.push_back (b); zs.push_back (std::make_pair (z, l)); + + if (b != s->go.span[i].ub - 1) + { + z.pop_back (); + z.push_back (s->go.span[i].ub - 1); + zs.push_back (std::make_pair (z, l)); + } + + b = s->go.span[i].ub; } generate_data (o, ind, s->go.span[i].to, zs, ys); }