private int mccMoveNfa_0()

in src/main/csharp/Selector/SelectorParserTokenManager.cs [518:884]


private int mccMoveNfa_0(int startState, int curPos)
{
   int strKind = mccmatchedKind;
   int strPos = mccmatchedPos;
   int seenUpto = curPos + 1;
   input_stream.Backup(seenUpto);
   try { curChar = input_stream.ReadChar(); }
   catch(System.IO.IOException) { throw new Exception("Internal Error"); }
   curPos = 0;
   //int[] nextStates;
   int startsAt = 0;
   mccnewStateCnt = 43;
   int i = 1;
   mccstateSet[0] = startState;
   int /*j,*/ kind = Int32.MaxValue;
   for (;;)
   {
      if (++mccround == Int32.MaxValue)
         ReInitRounds();
      if (curChar < 64)
      {
         long l = 1L << curChar;
         do
         {
            switch(mccstateSet[--i])
            {
               case 5:
                  if ((287948901175001088 & l) != 0L)
                     mccCheckNAddStates(0, 3);
                  else if (curChar == 36)
                  {
                     if (kind > 27)
                        kind = 27;
                     mccCheckNAdd(27);
                  }
                  else if (curChar == 39)
                     mccCheckNAddStates(4, 6);
                  else if (curChar == 46)
                     mccCheckNAdd(17);
                  else if (curChar == 47)
                     mccstateSet[mccnewStateCnt++] = 6;
                  else if (curChar == 45)
                     mccstateSet[mccnewStateCnt++] = 0;
                  if ((287667426198290432 & l) != 0L)
                  {
                     if (kind > 21)
                        kind = 21;
                     mccCheckNAddTwoStates(14, 15);
                  }
                  else if (curChar == 48)
                  {
                     if (kind > 23)
                        kind = 23;
                     mccCheckNAddTwoStates(40, 42);
                  }
                  break;
               case 0:
                  if (curChar == 45)
                     mccCheckNAddStates(7, 9);
                  break;
               case 1:
                  if ((-9217 & l) != 0L)
                     mccCheckNAddStates(7, 9);
                  break;
               case 2:
                  if ((9216 & l) != 0L && kind > 6)
                     kind = 6;
                  break;
               case 3:
                  if (curChar == 10 && kind > 6)
                     kind = 6;
                  break;
               case 4:
                  if (curChar == 13)
                     mccstateSet[mccnewStateCnt++] = 3;
                  break;
               case 6:
                  if (curChar == 42)
                     mccCheckNAddTwoStates(7, 8);
                  break;
               case 7:
                  if ((-4398046511105 & l) != 0L)
                     mccCheckNAddTwoStates(7, 8);
                  break;
               case 8:
                  if (curChar == 42)
                     mccCheckNAddStates(10, 12);
                  break;
               case 9:
                  if ((-145135534866433 & l) != 0L)
                     mccCheckNAddTwoStates(10, 8);
                  break;
               case 10:
                  if ((-4398046511105 & l) != 0L)
                     mccCheckNAddTwoStates(10, 8);
                  break;
               case 11:
                  if (curChar == 47 && kind > 7)
                     kind = 7;
                  break;
               case 12:
                  if (curChar == 47)
                     mccstateSet[mccnewStateCnt++] = 6;
                  break;
               case 13:
                  if ((287667426198290432 & l) == 0L)
                     break;
                  if (kind > 21)
                     kind = 21;
                  mccCheckNAddTwoStates(14, 15);
                  break;
               case 14:
                  if ((287948901175001088 & l) == 0L)
                     break;
                  if (kind > 21)
                     kind = 21;
                  mccCheckNAddTwoStates(14, 15);
                  break;
               case 16:
                  if (curChar == 46)
                     mccCheckNAdd(17);
                  break;
               case 17:
                  if ((287948901175001088 & l) == 0L)
                     break;
                  if (kind > 24)
                     kind = 24;
                  mccCheckNAddTwoStates(17, 18);
                  break;
               case 19:
                  if ((43980465111040 & l) != 0L)
                     mccCheckNAdd(20);
                  break;
               case 20:
                  if ((287948901175001088 & l) == 0L)
                     break;
                  if (kind > 24)
                     kind = 24;
                  mccCheckNAdd(20);
                  break;
               case 21:
               case 22:
                  if (curChar == 39)
                     mccCheckNAddStates(4, 6);
                  break;
               case 23:
                  if (curChar == 39)
                     mccstateSet[mccnewStateCnt++] = 22;
                  break;
               case 24:
                  if ((-549755813889 & l) != 0L)
                     mccCheckNAddStates(4, 6);
                  break;
               case 25:
                  if (curChar == 39 && kind > 26)
                     kind = 26;
                  break;
               case 26:
                  if (curChar != 36)
                     break;
                  if (kind > 27)
                     kind = 27;
                  mccCheckNAdd(27);
                  break;
               case 27:
                  if ((287948969894477824 & l) == 0L)
                     break;
                  if (kind > 27)
                     kind = 27;
                  mccCheckNAdd(27);
                  break;
               case 28:
                  if ((287948901175001088 & l) != 0L)
                     mccCheckNAddStates(0, 3);
                  break;
               case 29:
                  if ((287948901175001088 & l) != 0L)
                     mccCheckNAddTwoStates(29, 30);
                  break;
               case 30:
                  if (curChar != 46)
                     break;
                  if (kind > 24)
                     kind = 24;
                  mccCheckNAddTwoStates(31, 32);
                  break;
               case 31:
                  if ((287948901175001088 & l) == 0L)
                     break;
                  if (kind > 24)
                     kind = 24;
                  mccCheckNAddTwoStates(31, 32);
                  break;
               case 33:
                  if ((43980465111040 & l) != 0L)
                     mccCheckNAdd(34);
                  break;
               case 34:
                  if ((287948901175001088 & l) == 0L)
                     break;
                  if (kind > 24)
                     kind = 24;
                  mccCheckNAdd(34);
                  break;
               case 35:
                  if ((287948901175001088 & l) != 0L)
                     mccCheckNAddTwoStates(35, 36);
                  break;
               case 37:
                  if ((43980465111040 & l) != 0L)
                     mccCheckNAdd(38);
                  break;
               case 38:
                  if ((287948901175001088 & l) == 0L)
                     break;
                  if (kind > 24)
                     kind = 24;
                  mccCheckNAdd(38);
                  break;
               case 39:
                  if (curChar != 48)
                     break;
                  if (kind > 23)
                     kind = 23;
                  mccCheckNAddTwoStates(40, 42);
                  break;
               case 41:
                  if ((287948901175001088 & l) == 0L)
                     break;
                  if (kind > 22)
                     kind = 22;
                  mccstateSet[mccnewStateCnt++] = 41;
                  break;
               case 42:
                  if ((71776119061217280 & l) == 0L)
                     break;
                  if (kind > 23)
                     kind = 23;
                  mccCheckNAdd(42);
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      else if (curChar < 128)
      {
         long l = 1L << (curChar & 63);
         do
         {
            switch(mccstateSet[--i])
            {
               case 5:
               case 27:
                  if ((576460745995190270 & l) == 0L)
                     break;
                  if (kind > 27)
                     kind = 27;
                  mccCheckNAdd(27);
                  break;
               case 1:
                  mccAddStates(7, 9);
                  break;
               case 7:
                  mccCheckNAddTwoStates(7, 8);
                  break;
               case 9:
               case 10:
                  mccCheckNAddTwoStates(10, 8);
                  break;
               case 15:
                  if ((17592186048512 & l) != 0L && kind > 21)
                     kind = 21;
                  break;
               case 18:
                  if ((137438953504 & l) != 0L)
                     mccAddStates(13, 14);
                  break;
               case 24:
                  mccAddStates(4, 6);
                  break;
               case 32:
                  if ((137438953504 & l) != 0L)
                     mccAddStates(15, 16);
                  break;
               case 36:
                  if ((137438953504 & l) != 0L)
                     mccAddStates(17, 18);
                  break;
               case 40:
                  if ((72057594054705152 & l) != 0L)
                     mccCheckNAdd(41);
                  break;
               case 41:
                  if ((541165879422 & l) == 0L)
                     break;
                  if (kind > 22)
                     kind = 22;
                  mccCheckNAdd(41);
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      else
      {
         int hiByte = (curChar >> 8);
         int i1 = hiByte >> 6;
         long l1 = 1L << (hiByte & 63);
         int i2 = (curChar & 0xff) >> 6;
         long l2 = 1L << (curChar & 63);
         do
         {
            switch(mccstateSet[--i])
            {
               case 1:
                  if (mccCanMove_0(hiByte, i1, i2, l1, l2))
                     mccAddStates(7, 9);
                  break;
               case 7:
                  if (mccCanMove_0(hiByte, i1, i2, l1, l2))
                     mccCheckNAddTwoStates(7, 8);
                  break;
               case 9:
               case 10:
                  if (mccCanMove_0(hiByte, i1, i2, l1, l2))
                     mccCheckNAddTwoStates(10, 8);
                  break;
               case 24:
                  if (mccCanMove_0(hiByte, i1, i2, l1, l2))
                     mccAddStates(4, 6);
                  break;
               default : break;
            }
         } while(i != startsAt);
      }
      if (kind != Int32.MaxValue)
      {
         mccmatchedKind = kind;
         mccmatchedPos = curPos;
         kind = Int32.MaxValue;
      }
      ++curPos;
      if ((i = mccnewStateCnt) == (startsAt = 43 - (mccnewStateCnt = startsAt)))
         break;
      try { curChar = input_stream.ReadChar(); }
      catch(System.IO.IOException) { break; }
   }
   if (mccmatchedPos > strPos)
      return curPos;

   int toRet = Math.Max(curPos, seenUpto);

   if (curPos < toRet)
      for (i = toRet - Math.Min(curPos, seenUpto); i-- > 0; )
         try { curChar = input_stream.ReadChar(); }
         catch(System.IO.IOException) { throw new Exception("Internal Error : Please send a bug report."); }

   if (mccmatchedPos < strPos)
   {
      mccmatchedKind = strKind;
      mccmatchedPos = strPos;
   }
   else if (mccmatchedPos == strPos && mccmatchedKind > strKind)
      mccmatchedKind = strKind;

   return toRet;
}