📄 nexustokenmanager.java
字号:
case 59: if ((active0 & 0x800000L) != 0L) { jjmatchedKind = 23; jjmatchedPos = 3; } break; case 69: if ((active0 & 0x8000L) != 0L) { jjmatchedKind = 15; jjmatchedPos = 3; } break; case 78: return jjMoveStringLiteralDfa4_2(active0, 0x400000L); case 101: if ((active0 & 0x8000L) != 0L) { jjmatchedKind = 15; jjmatchedPos = 3; } break; case 110: return jjMoveStringLiteralDfa4_2(active0, 0x400000L); default : break; } return jjMoveNfa_2(0, 3);}static private final int jjMoveStringLiteralDfa4_2(long old0, long active0){ if (((active0 &= old0)) == 0L) return jjMoveNfa_2(0, 3); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_2(0, 3); } switch(curChar) { case 83: return jjMoveStringLiteralDfa5_2(active0, 0x400000L); case 115: return jjMoveStringLiteralDfa5_2(active0, 0x400000L); default : break; } return jjMoveNfa_2(0, 4);}static private final int jjMoveStringLiteralDfa5_2(long old0, long active0){ if (((active0 &= old0)) == 0L) return jjMoveNfa_2(0, 4); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_2(0, 4); } switch(curChar) { case 76: return jjMoveStringLiteralDfa6_2(active0, 0x400000L); case 108: return jjMoveStringLiteralDfa6_2(active0, 0x400000L); default : break; } return jjMoveNfa_2(0, 5);}static private final int jjMoveStringLiteralDfa6_2(long old0, long active0){ if (((active0 &= old0)) == 0L) return jjMoveNfa_2(0, 5); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_2(0, 5); } switch(curChar) { case 65: return jjMoveStringLiteralDfa7_2(active0, 0x400000L); case 97: return jjMoveStringLiteralDfa7_2(active0, 0x400000L); default : break; } return jjMoveNfa_2(0, 6);}static private final int jjMoveStringLiteralDfa7_2(long old0, long active0){ if (((active0 &= old0)) == 0L) return jjMoveNfa_2(0, 6); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_2(0, 6); } switch(curChar) { case 84: return jjMoveStringLiteralDfa8_2(active0, 0x400000L); case 116: return jjMoveStringLiteralDfa8_2(active0, 0x400000L); default : break; } return jjMoveNfa_2(0, 7);}static private final int jjMoveStringLiteralDfa8_2(long old0, long active0){ if (((active0 &= old0)) == 0L) return jjMoveNfa_2(0, 7); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_2(0, 7); } switch(curChar) { case 69: if ((active0 & 0x400000L) != 0L) { jjmatchedKind = 22; jjmatchedPos = 8; } break; case 101: if ((active0 & 0x400000L) != 0L) { jjmatchedKind = 22; jjmatchedPos = 8; } break; default : break; } return jjMoveNfa_2(0, 8);}static private final int jjMoveNfa_2(int startState, int curPos){ int strKind = jjmatchedKind; int strPos = jjmatchedPos; int seenUpto; input_stream.backup(seenUpto = curPos + 1); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { throw new Error("Internal Error"); } curPos = 0; int[] nextStates; int startsAt = 0; jjnewStateCnt = 18; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 0: if ((0x83ff6c7200000000L & l) != 0L) { if (kind > 35) kind = 35; jjCheckNAdd(12); } else if (curChar == 39) jjCheckNAddTwoStates(15, 16); if ((0x3ff000000000000L & l) != 0L) { if (kind > 27) kind = 27; jjCheckNAddStates(2, 4); } else if ((0x280000000000L & l) != 0L) jjCheckNAddTwoStates(4, 10); else if (curChar == 46) jjCheckNAdd(11); break; case 1: jjAddStates(0, 1); break; case 3: if ((0x280000000000L & l) != 0L) jjCheckNAddTwoStates(4, 10); break; case 4: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 27) kind = 27; jjCheckNAddStates(2, 4); break; case 5: if (curChar != 46) break; if (kind > 27) kind = 27; jjCheckNAddTwoStates(6, 7); break; case 6: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 27) kind = 27; jjCheckNAddTwoStates(6, 7); break; case 8: if ((0x280000000000L & l) != 0L) jjCheckNAdd(9); break; case 9: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 27) kind = 27; jjCheckNAdd(9); break; case 10: if (curChar == 46) jjCheckNAdd(11); break; case 11: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 27) kind = 27; jjCheckNAddTwoStates(11, 7); break; case 12: if ((0x83ff6c7200000000L & l) == 0L) break; if (kind > 35) kind = 35; jjCheckNAdd(12); break; case 13: if (curChar == 39) jjCheckNAddTwoStates(15, 16); break; case 14: if (curChar == 39) jjCheckNAddStates(5, 7); break; case 15: if (curChar == 39) jjstateSet[jjnewStateCnt++] = 14; break; case 16: if ((0x83ff7f7300003600L & l) != 0L) jjCheckNAddStates(5, 7); break; case 17: if (curChar == 39 && kind > 36) kind = 36; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 0: if ((0x7fffffffc7ffffffL & l) != 0L) { if (kind > 35) kind = 35; jjCheckNAdd(12); } else if (curChar == 91) jjCheckNAddTwoStates(1, 2); break; case 1: if ((0xffffffffdfffffffL & l) != 0L) jjCheckNAddTwoStates(1, 2); break; case 2: if (curChar == 93) kind = 6; break; case 7: if ((0x2000000020L & l) != 0L) jjAddStates(8, 9); break; case 12: if ((0x7fffffffc7ffffffL & l) == 0L) break; if (kind > 35) kind = 35; jjCheckNAdd(12); break; case 16: if ((0x7fffffffc7ffffffL & l) != 0L) jjAddStates(5, 7); break; default : break; } } while(i != startsAt); } else { int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((jjbitVec0[i2] & l2) != 0L) jjAddStates(0, 1); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 18 - (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 = { 1, 2, 4, 5, 7, 15, 16, 17, 8, 9, };public static final String[] jjstrLiteralImages = {"", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "\75", "\50", "\51", "\54", "\72", "\73", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, };public static final String[] lexStateNames = { "DEFAULT", "EOF_STATE", "TreesBlock", "OtherBlock", "BlockStart", "NexusBody", };public static final int[] jjnewLexState = { -1, -1, -1, -1, -1, -1, -1, 5, -1, 4, -1, 2, 3, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, };static final long[] jjtoToken = { 0x18087f8001L, };static final long[] jjtoSkip = { 0x2000807ffeL, };static protected SimpleCharStream input_stream;static private final int[] jjrounds = new int[18];static private final int[] jjstateSet = new int[36];static protected char curChar;public NexusTokenManager(SimpleCharStream stream){ if (input_stream != null) throw new TokenMgrError("ERROR: Second call to constructor of static lexer. You must use ReInit() to initialize the static variables.", TokenMgrError.STATIC_LEXER_ERROR); input_stream = stream;}public NexusTokenManager(SimpleCharStream stream, int lexState){ this(stream); SwitchTo(lexState);}static public void ReInit(SimpleCharStream stream){ jjmatchedPos = jjnewStateCnt = 0; curLexState = defaultLexState; input_stream = stream; ReInitRounds();}static private final void ReInitRounds(){ int i; jjround = 0x80000001; for (i = 18; i-- > 0;) jjrounds[i] = 0x80000000;}static public void ReInit(SimpleCharStream stream, int lexState){ ReInit(stream); SwitchTo(lexState);}static public void SwitchTo(int lexState){ if (lexState >= 6 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState;}static 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;}static int curLexState = 0;static int defaultLexState = 0;static int jjnewStateCnt;static int jjround;static int jjmatchedPos;static int jjmatchedKind;public static 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(); return matchedToken; } switch(curLexState) { case 0: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); if (jjmatchedPos == 0 && jjmatchedKind > 8) { jjmatchedKind = 8; } break; case 1: try { input_stream.backup(0); while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) curChar = input_stream.BeginToken(); } catch (java.io.IOException e1) { continue EOFLoop; } jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_1(); if (jjmatchedPos == 0 && jjmatchedKind > 37) { jjmatchedKind = 37; } break; case 2: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_2(); break; case 3: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_3(); if (jjmatchedPos == 0 && jjmatchedKind > 14) { jjmatchedKind = 14; } break; case 4: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_4(); if (jjmatchedPos == 0 && jjmatchedKind > 12) { jjmatchedKind = 12; } break; case 5: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_5(); if (jjmatchedPos == 0 && jjmatchedKind > 10) { jjmatchedKind = 10; } break; } if (jjmatchedKind != 0x7fffffff) { if (jjmatchedPos + 1 < curPos) input_stream.backup(curPos - jjmatchedPos - 1); if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { matchedToken = jjFillToken(); if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; return matchedToken; } else { if (jjnewLexState[jjmatchedKind] != -1) curLexState = jjnewLexState[jjmatchedKind]; 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 + -