src/main/java/com/basistech/tclre/Compiler.java
private void wordchrs() throws RegexException {
        State left;
        State right;

        if (wordchrs != null) {
            lex.next();     /* for consistency */
            return;
        }

        left = nfa.newstate();
        right = nfa.newstate();
    /* fine point:  implemented with [::], and lexer will set REG_ULOCALE */
        lex.lexword();
        lex.next();
        assert savepattern != null && see('[');
        bracket(left, right);
        assert savepattern != null && see(']');
        lex.next();
        wordchrs = left;
    }
private void wordchrs() throws RegexException {
        State left;
        State right;

        if (wordchrs != null) {
            lex.next();     /* for consistency */
            return;
        }

        left = nfa.newstate();
        right = nfa.newstate();
    /* fine point:  implemented with [::], and lexer will set REG_ULOCALE */
        lex.lexword();
        lex.next();
        assert savepattern != null && see('[');
        bracket(left, right);
        assert savepattern != null && see(']');
        lex.next();
        wordchrs = left;
    }
wordchrs - set up word-chr list for word-boundary stuff, if needed
The list is kept as a bunch of arcs between two dummy states; it's
disposed of by the unreachable-states sweep in NFA optimization.
Does NEXT().  Must not be called from any unusual lexical context.
This should be reconciled with the \w etc. handling in lex.c, and
should be cleaned up to reduce dependencies on input scanning.