📄 yylex.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: Yylex.java
package org.json.simple.parser;
import java.io.*;
// Referenced classes of package org.json.simple.parser:
// Yytoken
class Yylex
{
private final int YY_BUFFER_SIZE = 512;
private final int YY_F = -1;
private final int YY_NO_STATE = -1;
private final int YY_NOT_ACCEPT = 0;
private final int YY_START = 1;
private final int YY_END = 2;
private final int YY_NO_ANCHOR = 4;
private final int YY_BOL = 0x10000;
private final int YY_EOF = 0x10001;
private StringBuffer sb;
private BufferedReader yy_reader;
private int yy_buffer_index;
private int yy_buffer_read;
private int yy_buffer_start;
private int yy_buffer_end;
private char yy_buffer[];
private boolean yy_at_bol;
private int yy_lexical_state;
private boolean yy_eof_done;
private final int YYINITIAL = 0;
private final int STRING_BEGIN = 1;
private final int yy_state_dtrans[] = {
0, 39
};
private boolean yy_last_was_cr;
private final int YY_E_INTERNAL = 0;
private final int YY_E_MATCH = 1;
private String yy_error_string[] = {
"Error: Internal error.\n", "Error: Unmatched input.\n"
};
private int yy_acpt[] = {
0, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 0, 4, 4, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0
};
private int yy_cmap[];
private int yy_rmap[];
private int yy_nxt[][];
Yylex(Reader reader)
{
this();
if (null == reader)
{
throw new Error("Error: Bad input stream initializer.");
} else
{
yy_reader = new BufferedReader(reader);
return;
}
}
Yylex(InputStream instream)
{
this();
if (null == instream)
{
throw new Error("Error: Bad input stream initializer.");
} else
{
yy_reader = new BufferedReader(new InputStreamReader(instream));
return;
}
}
private Yylex()
{
sb = new StringBuffer();
yy_eof_done = false;
yy_last_was_cr = false;
yy_cmap = unpackFromString(1, 0x10002, "11:8,27:2,28,11,27,28,11:18,27,11,2,11:8,16,25,12,14,3,13:10,26,11:6,10:4,15,10,11:20,23,1,24,11:3,18,4,10:2,17,5,11:5,19,11,6,11:3,7,20,8,9,11:5,21,11,22,11:65410,0:2")[0];
yy_rmap = unpackFromString(1, 45, "0,1:2,2,1:7,3,1:2,4,1:10,5,6,1,7,8,9,10,11,12,13,14,15,16,6,17,18,19,20,21,22")[0];
yy_nxt = unpackFromString(23, 29, "1,-1,2,-1:2,25,28,-1,29,-1:3,30,3,-1:7,4,5,6,7,8,9,10:2,-1:42,3,33,34,-1,34,-1:24,11,-1,34,-1,34,-1:12,16,17,18,19,20,21,22,23,40,-1:37,31,-1:23,26,-1:24,42,-1:26,32,-1:34,3,-1:34,35,-1:18,37,-1:32,11,-1:27,38,26,-1:2,38,-1:32,37,-1:27,12,-1:26,13,-1:11,1,14,15,27:25,-1:5,44:2,-1:4,44,-1:2,44,-1,44,-1,44:2,-1:14,24:2,-1:4,24,-1:2,24,-1,24,-1,24:2,-1:29,36,-1:13,41:2,-1:4,41,-1:2,41,-1,41,-1,41:2,-1:14,43:2,-1:4,43,-1:2,43,-1,43,-1,43:2,-1:10");
yy_buffer = new char[512];
yy_buffer_read = 0;
yy_buffer_index = 0;
yy_buffer_start = 0;
yy_buffer_end = 0;
yy_at_bol = true;
yy_lexical_state = 0;
}
private void yybegin(int state)
{
yy_lexical_state = state;
}
private int yy_advance()
throws IOException
{
if (yy_buffer_index < yy_buffer_read)
return yy_buffer[yy_buffer_index++];
if (0 != yy_buffer_start)
{
int i = yy_buffer_start;
int j;
for (j = 0; i < yy_buffer_read; j++)
{
yy_buffer[j] = yy_buffer[i];
i++;
}
yy_buffer_end = yy_buffer_end - yy_buffer_start;
yy_buffer_start = 0;
yy_buffer_read = j;
yy_buffer_index = j;
int next_read = yy_reader.read(yy_buffer, yy_buffer_read, yy_buffer.length - yy_buffer_read);
if (-1 == next_read)
return 0x10001;
yy_buffer_read = yy_buffer_read + next_read;
}
int next_read;
for (; yy_buffer_index >= yy_buffer_read; yy_buffer_read = yy_buffer_read + next_read)
{
if (yy_buffer_index >= yy_buffer.length)
yy_buffer = yy_double(yy_buffer);
next_read = yy_reader.read(yy_buffer, yy_buffer_read, yy_buffer.length - yy_buffer_read);
if (-1 == next_read)
return 0x10001;
}
return yy_buffer[yy_buffer_index++];
}
private void yy_move_end()
{
if (yy_buffer_end > yy_buffer_start && '\n' == yy_buffer[yy_buffer_end - 1])
yy_buffer_end--;
if (yy_buffer_end > yy_buffer_start && '\r' == yy_buffer[yy_buffer_end - 1])
yy_buffer_end--;
}
private void yy_mark_start()
{
yy_buffer_start = yy_buffer_index;
}
private void yy_mark_end()
{
yy_buffer_end = yy_buffer_index;
}
private void yy_to_mark()
{
yy_buffer_index = yy_buffer_end;
yy_at_bol = yy_buffer_end > yy_buffer_start && ('\r' == yy_buffer[yy_buffer_end - 1] || '\n' == yy_buffer[yy_buffer_end - 1] || '\u07EC' == yy_buffer[yy_buffer_end - 1] || '\u07ED' == yy_buffer[yy_buffer_end - 1]);
}
private String yytext()
{
return new String(yy_buffer, yy_buffer_start, yy_buffer_end - yy_buffer_start);
}
private int yylength()
{
return yy_buffer_end - yy_buffer_start;
}
private char[] yy_double(char buf[])
{
char newbuf[] = new char[2 * buf.length];
for (int i = 0; i < buf.length; i++)
newbuf[i] = buf[i];
return newbuf;
}
private void yy_error(int code, boolean fatal)
{
System.out.print(yy_error_string[code]);
System.out.flush();
if (fatal)
throw new Error("Fatal Error.\n");
else
return;
}
private int[][] unpackFromString(int size1, int size2, String st)
{
int colonIndex = -1;
int sequenceLength = 0;
int sequenceInteger = 0;
int res[][] = new int[size1][size2];
for (int i = 0; i < size1; i++)
{
for (int j = 0; j < size2; j++)
{
if (sequenceLength != 0)
{
res[i][j] = sequenceInteger;
sequenceLength--;
continue;
}
int commaIndex = st.indexOf(',');
String workString = commaIndex != -1 ? st.substring(0, commaIndex) : st;
st = st.substring(commaIndex + 1);
colonIndex = workString.indexOf(':');
if (colonIndex == -1)
{
res[i][j] = Integer.parseInt(workString);
} else
{
String lengthString = workString.substring(colonIndex + 1);
sequenceLength = Integer.parseInt(lengthString);
workString = workString.substring(0, colonIndex);
sequenceInteger = Integer.parseInt(workString);
res[i][j] = sequenceInteger;
sequenceLength--;
}
}
}
return res;
}
public Yytoken yylex()
throws IOException
{
int yy_anchor = 4;
int yy_state = yy_state_dtrans[yy_lexical_state];
int yy_next_state = -1;
int yy_last_accept_state = -1;
boolean yy_initial = true;
yy_mark_start();
int yy_this_accept = yy_acpt[yy_state];
if (0 != yy_this_accept)
{
yy_last_accept_state = yy_state;
yy_mark_end();
}
do
{
int yy_lookahead;
if (yy_initial && yy_at_bol)
yy_lookahead = 0x10000;
else
yy_lookahead = yy_advance();
yy_next_state = -1;
yy_next_state = yy_nxt[yy_rmap[yy_state]][yy_cmap[yy_lookahead]];
if (0x10001 == yy_lookahead && yy_initial)
return null;
if (-1 != yy_next_state)
{
yy_state = yy_next_state;
yy_initial = false;
yy_this_accept = yy_acpt[yy_state];
if (0 != yy_this_accept)
{
yy_last_accept_state = yy_state;
yy_mark_end();
}
} else
{
if (-1 == yy_last_accept_state)
throw new Error("Lexical Error: Unmatched Input.");
yy_anchor = yy_acpt[yy_last_accept_state];
if (0 != (2 & yy_anchor))
yy_move_end();
yy_to_mark();
switch (yy_last_accept_state)
{
case 2: // '\002'
{
sb.delete(0, sb.length());
yybegin(1);
break;
}
case 3: // '\003'
{
Long val = Long.valueOf(yytext());
return new Yytoken(0, val);
}
case 4: // '\004'
{
return new Yytoken(1, null);
}
case 5: // '\005'
{
return new Yytoken(2, null);
}
case 6: // '\006'
{
return new Yytoken(3, null);
}
case 7: // '\007'
{
return new Yytoken(4, null);
}
case 8: // '\b'
{
return new Yytoken(5, null);
}
case 9: // '\t'
{
return new Yytoken(6, null);
}
case 11: // '\013'
{
Double val = Double.valueOf(yytext());
return new Yytoken(0, val);
}
case 12: // '\f'
{
return new Yytoken(0, null);
}
case 13: // '\r'
{
Boolean val = Boolean.valueOf(yytext());
return new Yytoken(0, val);
}
case 14: // '\016'
{
sb.append(yytext());
break;
}
case 15: // '\017'
{
yybegin(0);
return new Yytoken(0, sb.toString());
}
case 16: // '\020'
{
sb.append('\\');
break;
}
case 17: // '\021'
{
sb.append('"');
break;
}
case 18: // '\022'
{
sb.append('/');
break;
}
case 19: // '\023'
{
sb.append('\b');
break;
}
case 20: // '\024'
{
sb.append('\f');
break;
}
case 21: // '\025'
{
sb.append('\n');
break;
}
case 22: // '\026'
{
sb.append('\r');
break;
}
case 23: // '\027'
{
sb.append('\t');
break;
}
case 24: // '\030'
{
int ch = Integer.parseInt(yytext().substring(2), 16);
sb.append((char)ch);
break;
}
case 26: // '\032'
{
Double val = Double.valueOf(yytext());
return new Yytoken(0, val);
}
case 27: // '\033'
{
sb.append(yytext());
break;
}
case 0: // '\0'
case 25: // '\031'
default:
{
yy_error(0, false);
break;
}
case -27:
case -26:
case -25:
case -24:
case -23:
case -22:
case -21:
case -20:
case -19:
case -18:
case -17:
case -16:
case -15:
case -14:
case -13:
case -12:
case -11:
case -10:
case -9:
case -8:
case -7:
case -6:
case -5:
case -4:
case -3:
case -2:
case -1:
case 1: // '\001'
case 10: // '\n'
break;
}
yy_initial = true;
yy_state = yy_state_dtrans[yy_lexical_state];
yy_next_state = -1;
yy_last_accept_state = -1;
yy_mark_start();
yy_this_accept = yy_acpt[yy_state];
if (0 != yy_this_accept)
{
yy_last_accept_state = yy_state;
yy_mark_end();
}
}
} while (true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -