function stateExists(lexer, state) {
        while (state && state.length > 0) {
            var exist = lexer.stateNames[state];
            if (exist) {
                return true;
            }
            var idx = state.lastIndexOf('.');
            if (idx < 0) {
                state = null; // no further parent
            }
            else {
                state = state.substr(0, idx);
            }
        }
        return false;
    }
Is a certain state defined? In contrast to 'findRules' this works on a ILexerMin.
This is used during compilation where we may know the defined states
but not yet whether the corresponding rules are correct.