⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 turtleparsertokenmanager.java

📁 jena2.5.4推理机系统的一种最基本实现 HP实验室出品
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
                     jjCheckNAddTwoStates(47, 48);                  break;               case 48:                  if ((0x7fffffe87fffffeL & l) != 0L && kind > 32)                     kind = 32;                  break;               case 49:                  if (curChar == 95)                     jjstateSet[jjnewStateCnt++] = 45;                  break;               case 51:               case 52:                  if ((0x7fffffe87fffffeL & l) == 0L)                     break;                  if (kind > 33)                     kind = 33;                  jjCheckNAdd(52);                  break;               case 53:                  if (curChar == 64)                     jjCheckNAdd(54);                  break;               case 54:                  if ((0x7fffffe07fffffeL & l) == 0L)                     break;                  if (kind > 34)                     kind = 34;                  jjCheckNAddTwoStates(54, 55);                  break;               case 56:                  if ((0x7fffffe07fffffeL & l) == 0L)                     break;                  if (kind > 34)                     kind = 34;                  jjCheckNAddTwoStates(55, 56);                  break;               case 59:                  jjAddStates(37, 42);                  break;               case 65:                  if (curChar == 91)                     jjCheckNAddStates(49, 51);                  break;               case 67:                  jjCheckNAddStates(43, 48);                  break;               case 70:                  if (curChar == 93 && kind > 44)                     kind = 44;                  break;               case 82:                  if ((0x2000000020L & l) != 0L)                     jjAddStates(68, 69);                  break;               case 89:                  if ((0x2000000020L & l) != 0L)                     jjAddStates(70, 71);                  break;               case 93:                  if ((0x2000000020L & l) != 0L)                     jjAddStates(72, 73);                  break;               case 99:                  if ((0x7fffffe07fffffeL & l) != 0L)                     jjCheckNAddStates(60, 65);                  break;               case 100:                  if ((0x7fffffe87fffffeL & l) != 0L)                     jjCheckNAddTwoStates(100, 101);                  break;               case 101:                  if ((0x7fffffe87fffffeL & l) != 0L)                     jjCheckNAdd(102);                  break;               case 103:                  if ((0x7fffffe87fffffeL & l) != 0L)                     jjCheckNAddTwoStates(103, 104);                  break;               case 104:                  if ((0x7fffffe87fffffeL & l) != 0L)                     jjCheckNAdd(105);                  break;               case 106:                  if ((0x7fffffe87fffffeL & l) == 0L)                     break;                  if (kind > 31)                     kind = 31;                  jjCheckNAddTwoStates(107, 108);                  break;               case 107:                  if ((0x7fffffe87fffffeL & l) != 0L)                     jjCheckNAddTwoStates(107, 108);                  break;               case 108:                  if ((0x7fffffe87fffffeL & l) != 0L && kind > 31)                     kind = 31;                  break;               default : break;            }         } while(i != startsAt);      }      else      {         int hiByte = (int)(curChar >> 8);         int i1 = hiByte >> 6;         long l1 = 1L << (hiByte & 077);         int i2 = (curChar & 0xff) >> 6;         long l2 = 1L << (curChar & 077);         do         {            switch(jjstateSet[--i])            {               case 0:                  if (jjCanMove_1(hiByte, i1, i2, l1, l2))                     jjCheckNAddStates(60, 65);                  break;               case 1:                  if (!jjCanMove_0(hiByte, i1, i2, l1, l2))                     break;                  if (kind > 12)                     kind = 12;                  jjAddStates(16, 18);                  break;               case 8:                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))                     jjAddStates(22, 24);                  break;               case 13:                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))                     jjAddStates(19, 21);                  break;               case 18:               case 22:                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))                     jjCheckNAddStates(25, 28);                  break;               case 30:               case 34:                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))                     jjCheckNAddStates(31, 34);                  break;               case 43:                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))                     jjAddStates(66, 67);                  break;               case 46:                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))                     break;                  if (kind > 32)                     kind = 32;                  jjCheckNAddTwoStates(47, 48);                  break;               case 47:                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))                     jjCheckNAddTwoStates(47, 48);                  break;               case 48:                  if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 32)                     kind = 32;                  break;               case 51:                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))                     break;                  if (kind > 33)                     kind = 33;                  jjCheckNAdd(52);                  break;               case 52:                  if (!jjCanMove_2(hiByte, i1, i2, l1, l2))                     break;                  if (kind > 33)                     kind = 33;                  jjCheckNAdd(52);                  break;               case 59:                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))                     jjAddStates(37, 42);                  break;               case 67:                  if (jjCanMove_0(hiByte, i1, i2, l1, l2))                     jjAddStates(43, 48);                  break;               case 100:                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))                     jjCheckNAddTwoStates(100, 101);                  break;               case 101:                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))                     jjCheckNAdd(102);                  break;               case 103:                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))                     jjCheckNAddTwoStates(103, 104);                  break;               case 104:                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))                     jjCheckNAdd(105);                  break;               case 106:                  if (!jjCanMove_1(hiByte, i1, i2, l1, l2))                     break;                  if (kind > 31)                     kind = 31;                  jjCheckNAddTwoStates(107, 108);                  break;               case 107:                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))                     jjCheckNAddTwoStates(107, 108);                  break;               case 108:                  if (jjCanMove_2(hiByte, i1, i2, l1, l2) && kind > 31)                     kind = 31;                  break;               default : break;            }         } while(i != startsAt);      }      if (kind != 0x7fffffff)      {         jjmatchedKind = kind;         jjmatchedPos = curPos;         kind = 0x7fffffff;      }      ++curPos;      if ((i = jjnewStateCnt) == (startsAt = 110 - (jjnewStateCnt = startsAt)))         break;      try { curChar = input_stream.readChar(); }      catch(java.io.IOException e) { break; }   }   if (jjmatchedPos > 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(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); }   if (jjmatchedPos < strPos)   {      jjmatchedKind = strKind;      jjmatchedPos = strPos;   }   else if (jjmatchedPos == strPos && jjmatchedKind > strKind)      jjmatchedKind = strKind;   return toRet;}static final int[] jjnextStates = {   74, 75, 76, 86, 87, 92, 93, 97, 74, 75, 78, 80, 85, 58, 61, 62,    1, 2, 4, 13, 14, 16, 8, 9, 11, 18, 19, 21, 23, 24, 26, 30,    31, 33, 35, 36, 38, 58, 59, 60, 64, 61, 62, 66, 67, 68, 72, 69,    70, 66, 69, 70, 86, 87, 92, 93, 100, 101, 103, 104, 100, 101, 102, 103,    104, 105, 43, 44, 83, 84, 90, 91, 94, 95, };private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2){   switch(hiByte)   {      case 0:         return ((jjbitVec2[i2] & l2) != 0L);      default :          if ((jjbitVec0[i1] & l1) != 0L)            return true;         return false;   }}private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2){   switch(hiByte)   {      case 0:         return ((jjbitVec4[i2] & l2) != 0L);      case 3:         return ((jjbitVec5[i2] & l2) != 0L);      case 32:         return ((jjbitVec6[i2] & l2) != 0L);      case 33:         return ((jjbitVec7[i2] & l2) != 0L);      case 47:         return ((jjbitVec8[i2] & l2) != 0L);      case 48:         return ((jjbitVec0[i2] & l2) != 0L);      case 255:         return ((jjbitVec9[i2] & l2) != 0L);      default :          if ((jjbitVec3[i1] & l1) != 0L)            return true;         return false;   }}private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2){   switch(hiByte)   {      case 0:         return ((jjbitVec10[i2] & l2) != 0L);      case 3:         return ((jjbitVec11[i2] & l2) != 0L);      case 32:         return ((jjbitVec12[i2] & l2) != 0L);      case 33:         return ((jjbitVec7[i2] & l2) != 0L);      case 47:         return ((jjbitVec8[i2] & l2) != 0L);      case 48:         return ((jjbitVec0[i2] & l2) != 0L);      case 255:         return ((jjbitVec9[i2] & l2) != 0L);      default :          if ((jjbitVec3[i1] & l1) != 0L)            return true;         return false;   }}public static final String[] jjstrLiteralImages = {"", "\41", "\174", "\136", "\55\76", "\74\55", null, null, null, null, null, null, null, "\141", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "\50", "\51", null, "\173", "\175", "\133", "\135", null, "\73", "\54", "\56", "\75", "\75\76", "\44", "\77", "\176", "\72", "\52", "\57", "\134", "\136\136", "\100", null, null, null, null, null, null, null, };public static final String[] lexStateNames = {   "DEFAULT", };static final long[] jjtoToken = {   0x7ffffe7ffc7e03fL, 0x0L, };static final long[] jjtoSkip = {   0x17c0L, 0x0L, };static final long[] jjtoSpecial = {   0x1000L, 0x0L, };protected JavaCharStream input_stream;private final int[] jjrounds = new int[110];private final int[] jjstateSet = new int[220];protected char curChar;public TurtleParserTokenManager(JavaCharStream stream){   if (JavaCharStream.staticFlag)      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");   input_stream = stream;}public TurtleParserTokenManager(JavaCharStream stream, int lexState){   this(stream);   SwitchTo(lexState);}public void ReInit(JavaCharStream stream){   jjmatchedPos = jjnewStateCnt = 0;   curLexState = defaultLexState;   input_stream = stream;   ReInitRounds();}private final void ReInitRounds(){   int i;   jjround = 0x80000001;   for (i = 110; i-- > 0;)      jjrounds[i] = 0x80000000;}public void ReInit(JavaCharStream stream, int lexState){   ReInit(stream);   SwitchTo(lexState);}public void SwitchTo(int lexState){   if (lexState >= 1 || lexState < 0)      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);   else      curLexState = lexState;}protected Token jjFillToken(){   Token t = Token.newToken(jjmatchedKind);   t.kind = jjmatchedKind;   String im = jjstrLiteralImages[jjmatchedKind];   t.image = (im == null) ? input_stream.GetImage() : im;   t.beginLine = input_stream.getBeginLine();   t.beginColumn = input_stream.getBeginColumn();   t.endLine = input_stream.getEndLine();   t.endColumn = input_stream.getEndColumn();   return t;}int curLexState = 0;int defaultLexState = 0;int jjnewStateCnt;int jjround;int jjmatchedPos;int jjmatchedKind;public Token getNextToken() {  int kind;  Token specialToken = null;  Token matchedToken;  int curPos = 0;  EOFLoop :  for (;;)  {      try      {           curChar = input_stream.BeginToken();   }        catch(java.io.IOException e)   {              jjmatchedKind = 0;      matchedToken = jjFillToken();      matchedToken.specialToken = specialToken;      return matchedToken;   }   jjmatchedKind = 0x7fffffff;   jjmatchedPos = 0;   curPos = jjMoveStringLiteralDfa0_0();   if (jjmatchedKind != 0x7fffffff)   {      if (jjmatchedPos + 1 < curPos)         input_stream.backup(curPos - jjmatchedPos - 1);      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)      {         matchedToken = jjFillToken();         matchedToken.specialToken = specialToken;         return matchedToken;      }      else      {         if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)         {            matchedToken = jjFillToken();            if (specialToken == null)               specialToken = matchedToken;            else            {               matchedToken.specialToken = specialToken;               specialToken = (specialToken.next = matchedToken);            }         }         continue EOFLoop;      }   }   int error_line = input_stream.getEndLine();   int error_column = input_stream.getEndColumn();   String error_after = null;   boolean EOFSeen = false;   try { input_stream.readChar(); input_stream.backup(1); }   catch (java.io.IOException e1) {      EOFSeen = true;      error_after = curPos <= 1 ? "" : input_stream.GetImage();      if (curChar == '\n' || curChar == '\r') {         error_line++;         error_column = 0;      }      else         error_column++;   }   if (!EOFSeen) {      input_stream.backup(1);      error_after = curPos <= 1 ? "" : input_stream.GetImage();   }   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);  }}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -