private int JjMoveNfa_2()

in src/Lucene.Net.QueryParser/Flexible/Standard/Parser/StandardSyntaxParserTokenManager.cs [116:427]


        private int JjMoveNfa_2(int startState, int curPos)
        {
            int startsAt = 0;
            jjnewStateCnt = 33;
            int i = 1;
            jjstateSet[0] = startState;
            int kind = 0x7fffffff;
            for (;;)
            {
                if (++jjround == 0x7fffffff)
                    ReInitRounds();
                if (m_curChar < 64)
                {
                    ulong l = (ulong)(1L << m_curChar);
                    do
                    {
                        switch (jjstateSet[--i])
                        {
                            case 0:
                                if ((0x8bff54f8ffffd9ffL & l) != 0L)
                                {
                                    if (kind > 23)
                                        kind = 23;
                                    JjCheckNAddTwoStates(20, 21);
                                }
                                else if ((0x100002600L & l) != 0L)
                                {
                                    if (kind > 7)
                                        kind = 7;
                                }
                                else if (m_curChar == 47)
                                    JjCheckNAddStates(0, 2);
                                else if (m_curChar == 34)
                                    JjCheckNAddStates(3, 5);
                                else if (m_curChar == 33)
                                {
                                    if (kind > 10)
                                        kind = 10;
                                }
                                if (m_curChar == 38)
                                    jjstateSet[jjnewStateCnt++] = 4;
                                break;
                            case 4:
                                if (m_curChar == 38 && kind > 8)
                                    kind = 8;
                                break;
                            case 5:
                                if (m_curChar == 38)
                                    jjstateSet[jjnewStateCnt++] = 4;
                                break;
                            case 13:
                                if (m_curChar == 33 && kind > 10)
                                    kind = 10;
                                break;
                            case 14:
                                if (m_curChar == 34)
                                    JjCheckNAddStates(3, 5);
                                break;
                            case 15:
                                if ((0xfffffffbffffffffL & l) != 0L)
                                    JjCheckNAddStates(3, 5);
                                break;
                            case 17:
                                JjCheckNAddStates(3, 5);
                                break;
                            case 18:
                                if (m_curChar == 34 && kind > 22)
                                    kind = 22;
                                break;
                            case 19:
                                if ((0x8bff54f8ffffd9ffL & l) == 0L)
                                    break;
                                if (kind > 23)
                                    kind = 23;
                                JjCheckNAddTwoStates(20, 21);
                                break;
                            case 20:
                                if ((0x8bff7cf8ffffd9ffL & l) == 0L)
                                    break;
                                if (kind > 23)
                                    kind = 23;
                                JjCheckNAddTwoStates(20, 21);
                                break;
                            case 22:
                                if (kind > 23)
                                    kind = 23;
                                JjCheckNAddTwoStates(20, 21);
                                break;
                            case 25:
                                if ((0x3ff000000000000L & l) == 0L)
                                    break;
                                if (kind > 24)
                                    kind = 24;
                                JjAddStates(6, 7);
                                break;
                            case 26:
                                if (m_curChar == 46)
                                    JjCheckNAdd(27);
                                break;
                            case 27:
                                if ((0x3ff000000000000L & l) == 0L)
                                    break;
                                if (kind > 24)
                                    kind = 24;
                                JjCheckNAdd(27);
                                break;
                            case 28:
                            case 30:
                                if (m_curChar == 47)
                                    JjCheckNAddStates(0, 2);
                                break;
                            case 29:
                                if ((0xffff7fffffffffffL & l) != 0L)
                                    JjCheckNAddStates(0, 2);
                                break;
                            case 32:
                                if (m_curChar == 47 && kind > 25)
                                    kind = 25;
                                break;
                            default: break;
                        }
                    } while (i != startsAt);
                }
                else if (m_curChar < 128)
                {
                    //long l = 1L << (curChar & 077);
                    ulong l = (ulong)(1L << (m_curChar & 63));
                    do
                    {
                        switch (jjstateSet[--i])
                        {
                            case 0:
                                if ((0x97ffffff87ffffffL & l) != 0L)
                                {
                                    if (kind > 23)
                                        kind = 23;
                                    JjCheckNAddTwoStates(20, 21);
                                }
                                else if (m_curChar == 126)
                                {
                                    if (kind > 24)
                                        kind = 24;
                                    jjstateSet[jjnewStateCnt++] = 25;
                                }
                                else if (m_curChar == 92)
                                    JjCheckNAdd(22);
                                if (m_curChar == 78)
                                    jjstateSet[jjnewStateCnt++] = 11;
                                else if (m_curChar == 124)
                                    jjstateSet[jjnewStateCnt++] = 8;
                                else if (m_curChar == 79)
                                    jjstateSet[jjnewStateCnt++] = 6;
                                else if (m_curChar == 65)
                                    jjstateSet[jjnewStateCnt++] = 2;
                                break;
                            case 1:
                                if (m_curChar == 68 && kind > 8)
                                    kind = 8;
                                break;
                            case 2:
                                if (m_curChar == 78)
                                    jjstateSet[jjnewStateCnt++] = 1;
                                break;
                            case 3:
                                if (m_curChar == 65)
                                    jjstateSet[jjnewStateCnt++] = 2;
                                break;
                            case 6:
                                if (m_curChar == 82 && kind > 9)
                                    kind = 9;
                                break;
                            case 7:
                                if (m_curChar == 79)
                                    jjstateSet[jjnewStateCnt++] = 6;
                                break;
                            case 8:
                                if (m_curChar == 124 && kind > 9)
                                    kind = 9;
                                break;
                            case 9:
                                if (m_curChar == 124)
                                    jjstateSet[jjnewStateCnt++] = 8;
                                break;
                            case 10:
                                if (m_curChar == 84 && kind > 10)
                                    kind = 10;
                                break;
                            case 11:
                                if (m_curChar == 79)
                                    jjstateSet[jjnewStateCnt++] = 10;
                                break;
                            case 12:
                                if (m_curChar == 78)
                                    jjstateSet[jjnewStateCnt++] = 11;
                                break;
                            case 15:
                                if ((0xffffffffefffffffL & l) != 0L)
                                    JjCheckNAddStates(3, 5);
                                break;
                            case 16:
                                if (m_curChar == 92)
                                    jjstateSet[jjnewStateCnt++] = 17;
                                break;
                            case 17:
                                JjCheckNAddStates(3, 5);
                                break;
                            case 19:
                            case 20:
                                if ((0x97ffffff87ffffffL & l) == 0L)
                                    break;
                                if (kind > 23)
                                    kind = 23;
                                JjCheckNAddTwoStates(20, 21);
                                break;
                            case 21:
                                if (m_curChar == 92)
                                    JjCheckNAddTwoStates(22, 22);
                                break;
                            case 22:
                                if (kind > 23)
                                    kind = 23;
                                JjCheckNAddTwoStates(20, 21);
                                break;
                            case 23:
                                if (m_curChar == 92)
                                    JjCheckNAdd(22);
                                break;
                            case 24:
                                if (m_curChar != 126)
                                    break;
                                if (kind > 24)
                                    kind = 24;
                                jjstateSet[jjnewStateCnt++] = 25;
                                break;
                            case 29:
                                JjAddStates(0, 2);
                                break;
                            case 31:
                                if (m_curChar == 92)
                                    jjstateSet[jjnewStateCnt++] = 30;
                                break;
                            default: break;
                        }
                    } while (i != startsAt);
                }
                else
                {
                    int hiByte = (int)(m_curChar >> 8);
                    int i1 = hiByte >> 6;
                    //long l1 = 1L << (hiByte & 077);
                    ulong l1 = (ulong)(1L << (hiByte & 63));
                    int i2 = (m_curChar & 0xff) >> 6;
                    //long l2 = 1L << (curChar & 077);
                    ulong l2 = (ulong)(1L << (m_curChar & 63));
                    do
                    {
                        switch (jjstateSet[--i])
                        {
                            case 0:
                                if (JjCanMove_0(hiByte, i1, i2, l1, l2))
                                {
                                    if (kind > 7)
                                        kind = 7;
                                }
                                if (JjCanMove_2(hiByte, i1, i2, l1, l2))
                                {
                                    if (kind > 23)
                                        kind = 23;
                                    JjCheckNAddTwoStates(20, 21);
                                }
                                break;
                            case 15:
                            case 17:
                                if (JjCanMove_1(hiByte, i1, i2, l1, l2))
                                    JjCheckNAddStates(3, 5);
                                break;
                            case 19:
                            case 20:
                                if (!JjCanMove_2(hiByte, i1, i2, l1, l2))
                                    break;
                                if (kind > 23)
                                    kind = 23;
                                JjCheckNAddTwoStates(20, 21);
                                break;
                            case 22:
                                if (!JjCanMove_1(hiByte, i1, i2, l1, l2))
                                    break;
                                if (kind > 23)
                                    kind = 23;
                                JjCheckNAddTwoStates(20, 21);
                                break;
                            case 29:
                                if (JjCanMove_1(hiByte, i1, i2, l1, l2))
                                    JjAddStates(0, 2);
                                break;
                            default: break;
                        }
                    } while (i != startsAt);
                }
                if (kind != 0x7fffffff)
                {
                    jjmatchedKind = kind;
                    jjmatchedPos = curPos;
                    kind = 0x7fffffff;
                }
                ++curPos;
                if ((i = jjnewStateCnt) == (startsAt = 33 - (jjnewStateCnt = startsAt)))
                    return curPos;
                try { m_curChar = m_input_stream.ReadChar(); }
                catch (Exception e) when (e.IsIOException()) { return curPos; }
            }
        }