src/main/java/com/basistech/tclre/Nfa.java
void dupnfa(State start, State stop, State from, State to) {
        if (start == stop) {
            newarc(Compiler.EMPTY, (short)0, from, to);
            return;
        }

        stop.tmp = to;
        duptraverse(start, from);
    /* done, except for clearing out the tmp pointers */

        stop.tmp = null;
        cleartraverse(start);
    }
void dupnfa(State start, State stop, State from, State to) {
        if (start == stop) {
            newarc(Compiler.EMPTY, (short)0, from, to);
            return;
        }

        stop.tmp = to;
        duptraverse(start, from);
    /* done, except for clearing out the tmp pointers */

        stop.tmp = null;
        cleartraverse(start);
    }
dupnfa - duplicate sub-NFA
Another recursive traversal, this time using tmp to point to duplicates
as well as mark already-seen states.  (You knew there was a reason why
it's a state pointer, didn't you? :-))

@param start duplicate starting here
@param stop  ending here.
@param from  stringing dup from here
@param to    here.