diff options
Diffstat (limited to 'src/org/json/simple/parser/Yylex.java')
-rw-r--r-- | src/org/json/simple/parser/Yylex.java | 68 |
1 files changed, 56 insertions, 12 deletions
diff --git a/src/org/json/simple/parser/Yylex.java b/src/org/json/simple/parser/Yylex.java index 10049c4..c1cf09d 100644 --- a/src/org/json/simple/parser/Yylex.java +++ b/src/org/json/simple/parser/Yylex.java | |||
@@ -24,7 +24,10 @@ class Yylex { | |||
24 | /** | 24 | /** |
25 | * Translates characters to character classes | 25 | * Translates characters to character classes |
26 | */ | 26 | */ |
27 | private static final String ZZ_CMAP_PACKED = "\11\0\1\7\1\7\2\0\1\7\22\0\1\7\1\0\1\11\10\0" + "\1\6\1\31\1\2\1\4\1\12\12\3\1\32\6\0\4\1\1\5" + "\1\1\24\0\1\27\1\10\1\30\3\0\1\22\1\13\2\1\1\21" + "\1\14\5\0\1\23\1\0\1\15\3\0\1\16\1\24\1\17\1\20" + "\5\0\1\25\1\0\1\26\uff82\0"; | 27 | private static final String ZZ_CMAP_PACKED = "\11\0\1\7\1\7\2\0\1\7\22\0\1\7\1\0\1\11\10\0" |
28 | + "\1\6\1\31\1\2\1\4\1\12\12\3\1\32\6\0\4\1\1\5" | ||
29 | + "\1\1\24\0\1\27\1\10\1\30\3\0\1\22\1\13\2\1\1\21" | ||
30 | + "\1\14\5\0\1\23\1\0\1\15\3\0\1\16\1\24\1\17\1\20" + "\5\0\1\25\1\0\1\26\uff82\0"; | ||
28 | 31 | ||
29 | /** | 32 | /** |
30 | * Translates characters to character classes | 33 | * Translates characters to character classes |
@@ -36,7 +39,9 @@ class Yylex { | |||
36 | */ | 39 | */ |
37 | private static final int[] ZZ_ACTION = Yylex.zzUnpackAction(); | 40 | private static final int[] ZZ_ACTION = Yylex.zzUnpackAction(); |
38 | 41 | ||
39 | private static final String ZZ_ACTION_PACKED_0 = "\2\0\2\1\1\2\1\3\1\4\3\1\1\5\1\6" + "\1\7\1\10\1\11\1\12\1\13\1\14\1\15\5\0" + "\1\14\1\16\1\17\1\20\1\21\1\22\1\23\1\24" + "\1\0\1\25\1\0\1\25\4\0\1\26\1\27\2\0" + "\1\30"; | 42 | private static final String ZZ_ACTION_PACKED_0 = "\2\0\2\1\1\2\1\3\1\4\3\1\1\5\1\6" |
43 | + "\1\7\1\10\1\11\1\12\1\13\1\14\1\15\5\0" + "\1\14\1\16\1\17\1\20\1\21\1\22\1\23\1\24" | ||
44 | + "\1\0\1\25\1\0\1\25\4\0\1\26\1\27\2\0" + "\1\30"; | ||
40 | 45 | ||
41 | private static int[] zzUnpackAction() { | 46 | private static int[] zzUnpackAction() { |
42 | final int[] result = new int[45]; | 47 | final int[] result = new int[45]; |
@@ -64,7 +69,12 @@ class Yylex { | |||
64 | */ | 69 | */ |
65 | private static final int[] ZZ_ROWMAP = Yylex.zzUnpackRowMap(); | 70 | private static final int[] ZZ_ROWMAP = Yylex.zzUnpackRowMap(); |
66 | 71 | ||
67 | private static final String ZZ_ROWMAP_PACKED_0 = "\0\0\0\33\0\66\0\121\0\154\0\207\0\66\0\242" + "\0\275\0\330\0\66\0\66\0\66\0\66\0\66\0\66" + "\0\363\0\u010e\0\66\0\u0129\0\u0144\0\u015f\0\u017a\0\u0195" + "\0\66\0\66\0\66\0\66\0\66\0\66\0\66\0\66" + "\0\u01b0\0\u01cb\0\u01e6\0\u01e6\0\u0201\0\u021c\0\u0237\0\u0252" + "\0\66\0\66\0\u026d\0\u0288\0\66"; | 72 | private static final String ZZ_ROWMAP_PACKED_0 = "\0\0\0\33\0\66\0\121\0\154\0\207\0\66\0\242" |
73 | + "\0\275\0\330\0\66\0\66\0\66\0\66\0\66\0\66" | ||
74 | + "\0\363\0\u010e\0\66\0\u0129\0\u0144\0\u015f\0\u017a\0\u0195" | ||
75 | + "\0\66\0\66\0\66\0\66\0\66\0\66\0\66\0\66" | ||
76 | + "\0\u01b0\0\u01cb\0\u01e6\0\u01e6\0\u0201\0\u021c\0\u0237\0\u0252" | ||
77 | + "\0\66\0\66\0\u026d\0\u0288\0\66"; | ||
68 | 78 | ||
69 | private static int[] zzUnpackRowMap() { | 79 | private static int[] zzUnpackRowMap() { |
70 | final int[] result = new int[45]; | 80 | final int[] result = new int[45]; |
@@ -87,9 +97,37 @@ class Yylex { | |||
87 | /** | 97 | /** |
88 | * The transition table of the DFA | 98 | * The transition table of the DFA |
89 | */ | 99 | */ |
90 | private static final int ZZ_TRANS[] = { 2, 2, 3, 4, 2, 2, 2, 5, 2, 6, 2, 2, 7, 8, 2, 9, 2, 2, 2, 2, 2, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 18, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 16, | 100 | private static final int ZZ_TRANS[] = { 2, 2, 3, 4, 2, 2, 2, 5, 2, 6, 2, 2, 7, 8, 2, 9, 2, 2, |
91 | 16, 16, 16, 16, 16, 16, 16, -1, -1, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, -1, -1, -1, -1, -1, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, -1, -1, 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, 39, -1, 39, -1, -1, -1, -1, -1, 39, 39, -1, -1, -1, -1, 39, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, | 101 | 2, 2, 2, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 18, 16, 16, 16, |
92 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 42, -1, 42, -1, 42, -1, -1, -1, -1, -1, 42, 42, -1, -1, -1, -1, 42, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, 43, -1, 43, -1, -1, -1, -1, -1, 43, 43, -1, -1, -1, -1, 43, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, -1, 44, -1, 44, -1, -1, -1, -1, -1, 44, 44, -1, -1, -1, -1, 44, 44, -1, -1, -1, -1, -1, -1, -1, -1, }; | 102 | 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, -1, -1, -1, -1, -1, -1, -1, -1, |
103 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
104 | 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
105 | -1, -1, -1, -1, -1, 4, 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, | ||
106 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, -1, -1, -1, -1, | ||
107 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
108 | -1, -1, -1, -1, -1, -1, -1, -1, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
109 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
110 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, | ||
111 | -1, -1, -1, -1, -1, 16, 16, 16, 16, 16, 16, 16, 16, -1, -1, 16, 16, 16, 16, 16, 16, 16, | ||
112 | 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, -1, -1, -1, -1, -1, -1, -1, -1, 24, 25, 26, 27, | ||
113 | 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -1, -1, -1, | ||
114 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
115 | 34, 35, -1, -1, 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
116 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
117 | 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
118 | -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
119 | -1, -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, 39, | ||
120 | -1, 39, -1, -1, -1, -1, -1, 39, 39, -1, -1, -1, -1, 39, 39, -1, -1, -1, -1, -1, -1, -1, | ||
121 | -1, -1, -1, -1, 33, -1, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, | ||
122 | -1, -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
123 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
124 | -1, -1, -1, -1, -1, -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
125 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, -1, -1, | ||
126 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, -1, -1, -1, | ||
127 | -1, -1, -1, -1, -1, 42, -1, 42, -1, 42, -1, -1, -1, -1, -1, 42, 42, -1, -1, -1, -1, 42, | ||
128 | 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, 43, -1, 43, -1, -1, -1, -1, -1, 43, 43, | ||
129 | -1, -1, -1, -1, 43, 43, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, -1, 44, -1, 44, -1, -1, | ||
130 | -1, -1, -1, 44, 44, -1, -1, -1, -1, 44, 44, -1, -1, -1, -1, -1, -1, -1, -1, }; | ||
93 | 131 | ||
94 | /* error codes */ | 132 | /* error codes */ |
95 | private static final int ZZ_UNKNOWN_ERROR = 0; | 133 | private static final int ZZ_UNKNOWN_ERROR = 0; |
@@ -97,14 +135,16 @@ class Yylex { | |||
97 | private static final int ZZ_PUSHBACK_2BIG = 2; | 135 | private static final int ZZ_PUSHBACK_2BIG = 2; |
98 | 136 | ||
99 | /* error messages for the codes above */ | 137 | /* error messages for the codes above */ |
100 | private static final String ZZ_ERROR_MSG[] = { "Unkown internal scanner error", "Error: could not match input", "Error: pushback value was too large" }; | 138 | private static final String ZZ_ERROR_MSG[] = { "Unkown internal scanner error", |
139 | "Error: could not match input", "Error: pushback value was too large" }; | ||
101 | 140 | ||
102 | /** | 141 | /** |
103 | * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code> | 142 | * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code> |
104 | */ | 143 | */ |
105 | private static final int[] ZZ_ATTRIBUTE = Yylex.zzUnpackAttribute(); | 144 | private static final int[] ZZ_ATTRIBUTE = Yylex.zzUnpackAttribute(); |
106 | 145 | ||
107 | private static final String ZZ_ATTRIBUTE_PACKED_0 = "\2\0\1\11\3\1\1\11\3\1\6\11\2\1\1\11" + "\5\0\10\11\1\0\1\1\1\0\1\1\4\0\2\11" + "\2\0\1\11"; | 146 | private static final String ZZ_ATTRIBUTE_PACKED_0 = "\2\0\1\11\3\1\1\11\3\1\6\11\2\1\1\11" |
147 | + "\5\0\10\11\1\0\1\1\1\0\1\1\4\0\2\11" + "\2\0\1\11"; | ||
108 | 148 | ||
109 | private static int[] zzUnpackAttribute() { | 149 | private static int[] zzUnpackAttribute() { |
110 | final int[] result = new int[45]; | 150 | final int[] result = new int[45]; |
@@ -239,7 +279,8 @@ class Yylex { | |||
239 | 279 | ||
240 | /* first: make room (if you can) */ | 280 | /* first: make room (if you can) */ |
241 | if (this.zzStartRead > 0) { | 281 | if (this.zzStartRead > 0) { |
242 | System.arraycopy(this.zzBuffer, this.zzStartRead, this.zzBuffer, 0, this.zzEndRead - this.zzStartRead); | 282 | System.arraycopy(this.zzBuffer, this.zzStartRead, this.zzBuffer, 0, this.zzEndRead |
283 | - this.zzStartRead); | ||
243 | 284 | ||
244 | /* translate stored positions */ | 285 | /* translate stored positions */ |
245 | this.zzEndRead -= this.zzStartRead; | 286 | this.zzEndRead -= this.zzStartRead; |
@@ -257,7 +298,8 @@ class Yylex { | |||
257 | } | 298 | } |
258 | 299 | ||
259 | /* finally: fill the buffer with new input */ | 300 | /* finally: fill the buffer with new input */ |
260 | final int numRead = this.zzReader.read(this.zzBuffer, this.zzEndRead, this.zzBuffer.length - this.zzEndRead); | 301 | final int numRead = this.zzReader.read(this.zzBuffer, this.zzEndRead, this.zzBuffer.length |
302 | - this.zzEndRead); | ||
261 | 303 | ||
262 | if (numRead > 0) { | 304 | if (numRead > 0) { |
263 | this.zzEndRead += numRead; | 305 | this.zzEndRead += numRead; |
@@ -532,7 +574,8 @@ class Yylex { | |||
532 | case 33: | 574 | case 33: |
533 | break; | 575 | break; |
534 | case 1: { | 576 | case 1: { |
535 | throw new ParseException(this.yychar, ParseException.ERROR_UNEXPECTED_CHAR, new Character(this.yycharat(0))); | 577 | throw new ParseException(this.yychar, ParseException.ERROR_UNEXPECTED_CHAR, |
578 | new Character(this.yycharat(0))); | ||
536 | } | 579 | } |
537 | case 34: | 580 | case 34: |
538 | break; | 581 | break; |
@@ -576,7 +619,8 @@ class Yylex { | |||
576 | final int ch = Integer.parseInt(this.yytext().substring(2), 16); | 619 | final int ch = Integer.parseInt(this.yytext().substring(2), 16); |
577 | this.sb.append((char) ch); | 620 | this.sb.append((char) ch); |
578 | } catch (final Exception e) { | 621 | } catch (final Exception e) { |
579 | throw new ParseException(this.yychar, ParseException.ERROR_UNEXPECTED_EXCEPTION, e); | 622 | throw new ParseException(this.yychar, |
623 | ParseException.ERROR_UNEXPECTED_EXCEPTION, e); | ||
580 | } | 624 | } |
581 | } | 625 | } |
582 | case 42: | 626 | case 42: |