📄 slparsertokenmanager.java
字号:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 47;
break;
case 47:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 48;
break;
case 48:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 49;
break;
case 49:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 50;
break;
case 51:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 52;
break;
case 52:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 53;
break;
case 53:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 54;
break;
case 54:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 55;
break;
case 55:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 56;
break;
case 56:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 57;
break;
case 57:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 58;
break;
case 58:
if ((0x3ff000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 59;
break;
case 59:
if ((0x3ff000000000000L & l) == 0L)
break;
if (kind > 16)
kind = 16;
jjstateSet[jjnewStateCnt++] = 60;
break;
case 61:
if (curChar == 58)
jjAddStates(20, 21);
break;
case 62:
if ((0x7800dcf200000000L & l) == 0L)
break;
if (kind > 14)
kind = 14;
jjCheckNAdd(63);
break;
case 63:
if ((0xfffffcfa00000000L & l) == 0L)
break;
if (kind > 14)
kind = 14;
jjCheckNAdd(63);
break;
case 64:
case 66:
if (curChar == 34)
jjCheckNAddStates(39, 41);
break;
case 65:
if ((0xfffffffbffffffffL & l) != 0L)
jjCheckNAddStates(39, 41);
break;
case 68:
if (curChar == 34 && kind > 15)
kind = 15;
break;
default : break;
}
} while(i != startsAt);
}
else if (curChar < 128)
{
long l = 1L << (curChar & 077);
MatchLoop: do
{
switch(jjstateSet[--i])
{
case 8:
case 9:
if (kind > 12)
kind = 12;
jjCheckNAdd(9);
break;
case 1:
if ((0x100000001000000L & l) != 0L)
jjCheckNAdd(2);
break;
case 2:
if ((0x7e0000007eL & l) == 0L)
break;
if (kind > 9)
kind = 9;
jjCheckNAdd(2);
break;
case 5:
if ((0x2000000020L & l) != 0L)
jjAddStates(42, 43);
break;
case 11:
jjAddStates(22, 24);
break;
case 13:
if (curChar == 92)
jjstateSet[jjnewStateCnt++] = 12;
break;
case 20:
case 21:
if (kind > 18)
kind = 18;
jjCheckNAdd(21);
break;
case 24:
case 25:
if (kind > 7)
kind = 7;
jjCheckNAdd(25);
break;
case 27:
jjAddStates(32, 34);
break;
case 29:
if (curChar == 92)
jjstateSet[jjnewStateCnt++] = 28;
break;
case 34:
if ((0x2000000020L & l) != 0L)
jjAddStates(44, 45);
break;
case 50:
if ((0x10000000100000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 51;
break;
case 60:
if ((0x7fffffe07fffffeL & l) != 0L && kind > 16)
kind = 16;
break;
case 62:
case 63:
if (kind > 14)
kind = 14;
jjCheckNAdd(63);
break;
case 65:
jjAddStates(39, 41);
break;
case 67:
if (curChar == 92)
jjstateSet[jjnewStateCnt++] = 66;
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);
MatchLoop: do
{
switch(jjstateSet[--i])
{
case 8:
case 9:
if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
break;
if (kind > 12)
kind = 12;
jjCheckNAdd(9);
break;
case 11:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjAddStates(22, 24);
break;
case 20:
case 21:
if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
break;
if (kind > 18)
kind = 18;
jjCheckNAdd(21);
break;
case 24:
case 25:
if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
break;
if (kind > 7)
kind = 7;
jjCheckNAdd(25);
break;
case 27:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjAddStates(32, 34);
break;
case 62:
case 63:
if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
break;
if (kind > 14)
kind = 14;
jjCheckNAdd(63);
break;
case 65:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjAddStates(39, 41);
break;
default : break;
}
} while(i != startsAt);
}
if (kind != 0x7fffffff)
{
jjmatchedKind = kind;
jjmatchedPos = curPos;
kind = 0x7fffffff;
}
++curPos;
if ((i = jjnewStateCnt) == (startsAt = 69 - (jjnewStateCnt = startsAt)))
return curPos;
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { return curPos; }
}
}
static final int[] jjnextStates = { 14, 16, 17, 55, 60, 46, 48, 50, 38, 43, 25, 31, 32, 38, 39, 41, 3, 33, 34, 43, 62, 64, 11, 13, 14, 24, 26, 32, 0, 3, 33, 37, 27, 29, 30, 38, 39, 41, 3, 65, 67, 68, 6, 7, 35, 36, };
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;
}
}
public static final String[] jjstrLiteralImages = {
"", null, null, null, null, "\50", "\51", null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, "\50", "\51", null, null,
null, null, null, null, null, null, null, null, null, null, };
public static final String[] lexStateNames = {
"DEFAULT",
"OPERATORSTATE",
};
public static final int[] jjnewLexState = { -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
static final long[] jjtoToken = { 0x1fff87ffe1L, };
static final long[] jjtoSkip = { 0x78001eL, };
protected SimpleCharStream input_stream;
private final int[] jjrounds = new int[69];
private final int[] jjstateSet = new int[138];
StringBuffer image;
int jjimageLen;
int lengthOfMatch;
protected char curChar;
public SLParserTokenManager(SimpleCharStream stream){
if (SimpleCharStream.staticFlag)
throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
input_stream = stream;
}
public SLParserTokenManager(SimpleCharStream stream, int lexState){
this(stream);
SwitchTo(lexState);
}
public void ReInit(SimpleCharStream stream)
{
jjmatchedPos = jjnewStateCnt = 0;
curLexState = defaultLexState;
input_stream = stream;
ReInitRounds();
}
private final void ReInitRounds()
{
int i;
jjround = 0x80000001;
for (i = 69; i-- > 0;)
jjrounds[i] = 0x80000000;
}
public void ReInit(SimpleCharStream stream, int lexState)
{
ReInit(stream);
SwitchTo(lexState);
}
public void SwitchTo(int lexState)
{
if (lexState >= 2 || 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();
return matchedToken;
}
image = null;
jjimageLen = 0;
switch(curLexState)
{
case 0:
try { input_stream.backup(0);
while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
curChar = input_stream.BeginToken();
}
catch (java.io.IOException e1) { continue EOFLoop; }
jjmatchedKind = 0x7fffffff;
jjmatchedPos = 0;
curPos = jjMoveStringLiteralDfa0_0();
break;
case 1:
try { input_stream.backup(0);
while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L)
curChar = input_stream.BeginToken();
}
catch (java.io.IOException e1) { continue EOFLoop; }
jjmatchedKind = 0x7fffffff;
jjmatchedPos = 0;
curPos = jjMoveStringLiteralDfa0_1();
break;
}
if (jjmatchedKind != 0x7fffffff)
{
if (jjmatchedPos + 1 < curPos)
input_stream.backup(curPos - jjmatchedPos - 1);
if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
{
matchedToken = jjFillToken();
TokenLexicalActions(matchedToken);
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);
}
}
void TokenLexicalActions(Token matchedToken)
{
switch(jjmatchedKind)
{
case 17 :
if (image == null)
image = new StringBuffer();
image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
String tmp = matchedToken.image.substring(1,matchedToken.image.length()-1);
int numBytes = Integer.parseInt(tmp);
if (numBytes < 0) {
throw new TokenMgrError("ERROR: PrefixByteLengthEncodedString with length < 0",
TokenMgrError.STATIC_LEXER_ERROR);
}
char[] bytes = new char[numBytes];
int i = 0;
while (numBytes-- > 0)
try {
bytes[i++] = input_stream.readChar();
}
catch (IOException e) {
System.out.println("IOException during PREFIXBYTELENGTHENCODEDSTRING");
throw new TokenMgrError(true, curLexState, input_stream.getEndLine(),
input_stream.getEndColumn(),input_stream.GetImage(),
curChar, TokenMgrError.LEXICAL_ERROR);
}
// If you want, you can add bytes to matchedToken.image here.
matchedToken.image = new String(bytes);
break;
default :
break;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -