return (*it).second;
}
-void showIns(std::ostream &o, const Ins &i, const Ins &base)
+const Ins* showIns(std::ostream &o, const Ins &i, const Ins &base)
{
o.width(3);
o << &i - &base << ": ";
+ const Ins *ret = &(&i)[1];
+
switch (i.i.tag)
{
{
o << "match ";
- for (const Ins *j = &(&i)[1]; j < (Ins*) i.i.link; ++j)
- prtCh(o, j->c.value);
+ for (; ret < (Ins*) i.i.link; ++ret)
+ prtCh(o, ret->c.value);
break;
}
}
o << "\n";
+ return ret;
}
uint RegExp::fixedLength()
optimize(ins);
+ /*
+ for (const Ins *inst = &ins[0]; inst < &ins[re->size]; ) {
+ inst = showIns(std::cout, *inst, ins[0]);
+ }
+ */
+
for (j = 0; j < re->size;)
{
unmark(&ins[j]);