1 /* Generated by re2c 1.0.3 */
2 /*
3 +----------------------------------------------------------------------+
4 | PHP Version 7 |
5 +----------------------------------------------------------------------+
6 | Copyright (c) 1997-2018 The PHP Group |
7 +----------------------------------------------------------------------+
8 | This source file is subject to version 3.01 of the PHP license, |
9 | that is bundled with this package in the file LICENSE, and is |
10 | available through the world-wide-web at the following url: |
11 | http://www.php.net/license/3_01.txt |
12 | If you did not receive a copy of the PHP license and are unable to |
13 | obtain it through the world-wide-web, please send a note to |
14 | license@php.net so we can mail you a copy immediately. |
15 +----------------------------------------------------------------------+
16 | Author: Jakub Zelenka <bukka@php.net> |
17 +----------------------------------------------------------------------+
18 */
19
20 #include "php.h"
21 #include "php_json_scanner.h"
22 #include "php_json_scanner_defs.h"
23 #include "php_json_parser.h"
24 #include "json_parser.tab.h"
25
26 #define YYCTYPE php_json_ctype
27 #define YYCURSOR s->cursor
28 #define YYLIMIT s->limit
29 #define YYMARKER s->marker
30 #define YYCTXMARKER s->ctxmarker
31
32 #define YYGETCONDITION() s->state
33 #define YYSETCONDITION(yystate) s->state = yystate
34
35 #define YYFILL(n)
36
37 #define PHP_JSON_CONDITION_SET(condition) YYSETCONDITION(yyc##condition)
38 #define PHP_JSON_CONDITION_GOTO(condition) goto yyc_##condition
39 #define PHP_JSON_CONDITION_SET_AND_GOTO(condition) \
40 PHP_JSON_CONDITION_SET(condition); \
41 PHP_JSON_CONDITION_GOTO(condition)
42 #define PHP_JSON_CONDITION_GOTO_STR_P2() \
43 do { \
44 if (s->utf8_invalid) { \
45 PHP_JSON_CONDITION_GOTO(STR_P2_BIN); \
46 } else { \
47 PHP_JSON_CONDITION_GOTO(STR_P2_UTF); \
48 } \
49 } while(0)
50
51
52 #define PHP_JSON_SCANNER_COPY_ESC() php_json_scanner_copy_string(s, 0)
53 #define PHP_JSON_SCANNER_COPY_UTF() php_json_scanner_copy_string(s, 5)
54 #define PHP_JSON_SCANNER_COPY_UTF_SP() php_json_scanner_copy_string(s, 11)
55
56 #define PHP_JSON_INT_MAX_LENGTH (MAX_LENGTH_OF_LONG - 1)
57
58
php_json_scanner_copy_string(php_json_scanner * s,int esc_size)59 static void php_json_scanner_copy_string(php_json_scanner *s, int esc_size)
60 {
61 size_t len = s->cursor - s->str_start - esc_size - 1;
62 if (len) {
63 memcpy(s->pstr, s->str_start, len);
64 s->pstr += len;
65 }
66 }
67
php_json_hex_to_int(char code)68 static int php_json_hex_to_int(char code)
69 {
70 if (code >= '0' && code <= '9') {
71 return code - '0';
72 } else if (code >= 'A' && code <= 'F') {
73 return code - ('A' - 10);
74 } else if (code >= 'a' && code <= 'f') {
75 return code - ('a' - 10);
76 } else {
77 /* this should never happened (just to suppress compiler warning) */
78 return -1;
79 }
80 }
81
php_json_ucs2_to_int_ex(php_json_scanner * s,int size,int start)82 static int php_json_ucs2_to_int_ex(php_json_scanner *s, int size, int start)
83 {
84 int i, code = 0;
85 php_json_ctype *pc = s->cursor - start;
86 for (i = 0; i < size; i++) {
87 code |= php_json_hex_to_int(*(pc--)) << (i * 4);
88 }
89 return code;
90 }
91
php_json_ucs2_to_int(php_json_scanner * s,int size)92 static int php_json_ucs2_to_int(php_json_scanner *s, int size)
93 {
94 return php_json_ucs2_to_int_ex(s, size, 1);
95 }
96
php_json_scanner_init(php_json_scanner * s,char * str,size_t str_len,int options)97 void php_json_scanner_init(php_json_scanner *s, char *str, size_t str_len, int options)
98 {
99 s->cursor = (php_json_ctype *) str;
100 s->limit = (php_json_ctype *) str + str_len;
101 s->options = options;
102 PHP_JSON_CONDITION_SET(JS);
103 }
104
php_json_scan(php_json_scanner * s)105 int php_json_scan(php_json_scanner *s)
106 {
107 ZVAL_NULL(&s->value);
108
109 std:
110 s->token = s->cursor;
111
112
113 {
114 YYCTYPE yych;
115 unsigned int yyaccept = 0;
116 if (YYGETCONDITION() < 2) {
117 if (YYGETCONDITION() < 1) {
118 goto yyc_JS;
119 } else {
120 goto yyc_STR_P1;
121 }
122 } else {
123 if (YYGETCONDITION() < 3) {
124 goto yyc_STR_P2_BIN;
125 } else {
126 goto yyc_STR_P2_UTF;
127 }
128 }
129 /* *********************************** */
130 yyc_JS:
131 {
132 static const unsigned char yybm[] = {
133 0, 0, 0, 0, 0, 0, 0, 0,
134 0, 64, 0, 0, 0, 64, 0, 0,
135 0, 0, 0, 0, 0, 0, 0, 0,
136 0, 0, 0, 0, 0, 0, 0, 0,
137 64, 0, 0, 0, 0, 0, 0, 0,
138 0, 0, 0, 0, 0, 0, 0, 0,
139 128, 128, 128, 128, 128, 128, 128, 128,
140 128, 128, 0, 0, 0, 0, 0, 0,
141 0, 0, 0, 0, 0, 0, 0, 0,
142 0, 0, 0, 0, 0, 0, 0, 0,
143 0, 0, 0, 0, 0, 0, 0, 0,
144 0, 0, 0, 0, 0, 0, 0, 0,
145 0, 0, 0, 0, 0, 0, 0, 0,
146 0, 0, 0, 0, 0, 0, 0, 0,
147 0, 0, 0, 0, 0, 0, 0, 0,
148 0, 0, 0, 0, 0, 0, 0, 0,
149 0, 0, 0, 0, 0, 0, 0, 0,
150 0, 0, 0, 0, 0, 0, 0, 0,
151 0, 0, 0, 0, 0, 0, 0, 0,
152 0, 0, 0, 0, 0, 0, 0, 0,
153 0, 0, 0, 0, 0, 0, 0, 0,
154 0, 0, 0, 0, 0, 0, 0, 0,
155 0, 0, 0, 0, 0, 0, 0, 0,
156 0, 0, 0, 0, 0, 0, 0, 0,
157 0, 0, 0, 0, 0, 0, 0, 0,
158 0, 0, 0, 0, 0, 0, 0, 0,
159 0, 0, 0, 0, 0, 0, 0, 0,
160 0, 0, 0, 0, 0, 0, 0, 0,
161 0, 0, 0, 0, 0, 0, 0, 0,
162 0, 0, 0, 0, 0, 0, 0, 0,
163 0, 0, 0, 0, 0, 0, 0, 0,
164 0, 0, 0, 0, 0, 0, 0, 0,
165 };
166 yych = *YYCURSOR;
167 if (yych <= ']') {
168 if (yych <= '"') {
169 if (yych <= '\f') {
170 if (yych <= 0x08) {
171 if (yych >= 0x01) goto yy5;
172 } else {
173 if (yych <= '\t') goto yy7;
174 if (yych <= '\n') goto yy10;
175 goto yy5;
176 }
177 } else {
178 if (yych <= 0x1F) {
179 if (yych <= '\r') goto yy11;
180 goto yy5;
181 } else {
182 if (yych <= ' ') goto yy7;
183 if (yych <= '!') goto yy12;
184 goto yy14;
185 }
186 }
187 } else {
188 if (yych <= '0') {
189 if (yych <= ',') {
190 if (yych <= '+') goto yy12;
191 goto yy16;
192 } else {
193 if (yych <= '-') goto yy18;
194 if (yych <= '/') goto yy12;
195 goto yy19;
196 }
197 } else {
198 if (yych <= 'Z') {
199 if (yych <= '9') goto yy21;
200 if (yych <= ':') goto yy23;
201 goto yy12;
202 } else {
203 if (yych <= '[') goto yy25;
204 if (yych <= '\\') goto yy12;
205 goto yy27;
206 }
207 }
208 }
209 } else {
210 if (yych <= '}') {
211 if (yych <= 's') {
212 if (yych <= 'f') {
213 if (yych <= 'e') goto yy12;
214 goto yy29;
215 } else {
216 if (yych == 'n') goto yy30;
217 goto yy12;
218 }
219 } else {
220 if (yych <= 'z') {
221 if (yych <= 't') goto yy31;
222 goto yy12;
223 } else {
224 if (yych <= '{') goto yy32;
225 if (yych <= '|') goto yy12;
226 goto yy34;
227 }
228 }
229 } else {
230 if (yych <= 0xEC) {
231 if (yych <= 0xC1) {
232 if (yych <= 0x7F) goto yy12;
233 goto yy36;
234 } else {
235 if (yych <= 0xDF) goto yy38;
236 if (yych <= 0xE0) goto yy39;
237 goto yy40;
238 }
239 } else {
240 if (yych <= 0xF0) {
241 if (yych <= 0xED) goto yy41;
242 if (yych <= 0xEF) goto yy40;
243 goto yy42;
244 } else {
245 if (yych <= 0xF3) goto yy43;
246 if (yych <= 0xF4) goto yy44;
247 goto yy36;
248 }
249 }
250 }
251 }
252 ++YYCURSOR;
253 {
254 if (s->limit < s->cursor) {
255 return PHP_JSON_T_EOI;
256 } else {
257 s->errcode = PHP_JSON_ERROR_CTRL_CHAR;
258 return PHP_JSON_T_ERROR;
259 }
260 }
261 yy5:
262 ++YYCURSOR;
263 {
264 s->errcode = PHP_JSON_ERROR_CTRL_CHAR;
265 return PHP_JSON_T_ERROR;
266 }
267 yy7:
268 yych = *++YYCURSOR;
269 yy8:
270 if (yybm[0+yych] & 64) {
271 goto yy7;
272 }
273 yy9:
274 { goto std; }
275 yy10:
276 ++YYCURSOR;
277 goto yy9;
278 yy11:
279 yych = *++YYCURSOR;
280 if (yych == '\n') goto yy10;
281 goto yy8;
282 yy12:
283 ++YYCURSOR;
284 yy13:
285 {
286 s->errcode = PHP_JSON_ERROR_SYNTAX;
287 return PHP_JSON_T_ERROR;
288 }
289 yy14:
290 ++YYCURSOR;
291 {
292 s->str_start = s->cursor;
293 s->str_esc = 0;
294 s->utf8_invalid = 0;
295 s->utf8_invalid_count = 0;
296 PHP_JSON_CONDITION_SET_AND_GOTO(STR_P1);
297 }
298 yy16:
299 ++YYCURSOR;
300 { return ','; }
301 yy18:
302 yych = *++YYCURSOR;
303 if (yych <= '/') goto yy13;
304 if (yych <= '0') goto yy19;
305 if (yych <= '9') goto yy21;
306 goto yy13;
307 yy19:
308 yyaccept = 0;
309 yych = *(YYMARKER = ++YYCURSOR);
310 if (yych <= 'D') {
311 if (yych == '.') goto yy45;
312 } else {
313 if (yych <= 'E') goto yy47;
314 if (yych == 'e') goto yy47;
315 }
316 yy20:
317 {
318 zend_bool bigint = 0, negative = s->token[0] == '-';
319 size_t digits = (size_t) (s->cursor - s->token - negative);
320 if (digits >= PHP_JSON_INT_MAX_LENGTH) {
321 if (digits == PHP_JSON_INT_MAX_LENGTH) {
322 int cmp = strncmp((char *) (s->token + negative), LONG_MIN_DIGITS, PHP_JSON_INT_MAX_LENGTH);
323 if (!(cmp < 0 || (cmp == 0 && negative))) {
324 bigint = 1;
325 }
326 } else {
327 bigint = 1;
328 }
329 }
330 if (!bigint) {
331 ZVAL_LONG(&s->value, ZEND_STRTOL((char *) s->token, NULL, 10));
332 return PHP_JSON_T_INT;
333 } else if (s->options & PHP_JSON_BIGINT_AS_STRING) {
334 ZVAL_STRINGL(&s->value, (char *) s->token, s->cursor - s->token);
335 return PHP_JSON_T_STRING;
336 } else {
337 ZVAL_DOUBLE(&s->value, zend_strtod((char *) s->token, NULL));
338 return PHP_JSON_T_DOUBLE;
339 }
340 }
341 yy21:
342 yyaccept = 0;
343 yych = *(YYMARKER = ++YYCURSOR);
344 if (yybm[0+yych] & 128) {
345 goto yy21;
346 }
347 if (yych <= 'D') {
348 if (yych == '.') goto yy45;
349 goto yy20;
350 } else {
351 if (yych <= 'E') goto yy47;
352 if (yych == 'e') goto yy47;
353 goto yy20;
354 }
355 yy23:
356 ++YYCURSOR;
357 { return ':'; }
358 yy25:
359 ++YYCURSOR;
360 { return '['; }
361 yy27:
362 ++YYCURSOR;
363 { return ']'; }
364 yy29:
365 yyaccept = 1;
366 yych = *(YYMARKER = ++YYCURSOR);
367 if (yych == 'a') goto yy48;
368 goto yy13;
369 yy30:
370 yyaccept = 1;
371 yych = *(YYMARKER = ++YYCURSOR);
372 if (yych == 'u') goto yy49;
373 goto yy13;
374 yy31:
375 yyaccept = 1;
376 yych = *(YYMARKER = ++YYCURSOR);
377 if (yych == 'r') goto yy50;
378 goto yy13;
379 yy32:
380 ++YYCURSOR;
381 { return '{'; }
382 yy34:
383 ++YYCURSOR;
384 { return '}'; }
385 yy36:
386 ++YYCURSOR;
387 yy37:
388 {
389 s->errcode = PHP_JSON_ERROR_UTF8;
390 return PHP_JSON_T_ERROR;
391 }
392 yy38:
393 yych = *++YYCURSOR;
394 if (yych <= 0x7F) goto yy37;
395 if (yych <= 0xBF) goto yy12;
396 goto yy37;
397 yy39:
398 yyaccept = 2;
399 yych = *(YYMARKER = ++YYCURSOR);
400 if (yych <= 0x9F) goto yy37;
401 if (yych <= 0xBF) goto yy51;
402 goto yy37;
403 yy40:
404 yyaccept = 2;
405 yych = *(YYMARKER = ++YYCURSOR);
406 if (yych <= 0x7F) goto yy37;
407 if (yych <= 0xBF) goto yy51;
408 goto yy37;
409 yy41:
410 yyaccept = 2;
411 yych = *(YYMARKER = ++YYCURSOR);
412 if (yych <= 0x7F) goto yy37;
413 if (yych <= 0x9F) goto yy51;
414 goto yy37;
415 yy42:
416 yyaccept = 2;
417 yych = *(YYMARKER = ++YYCURSOR);
418 if (yych <= 0x8F) goto yy37;
419 if (yych <= 0xBF) goto yy52;
420 goto yy37;
421 yy43:
422 yyaccept = 2;
423 yych = *(YYMARKER = ++YYCURSOR);
424 if (yych <= 0x7F) goto yy37;
425 if (yych <= 0xBF) goto yy52;
426 goto yy37;
427 yy44:
428 yyaccept = 2;
429 yych = *(YYMARKER = ++YYCURSOR);
430 if (yych <= 0x7F) goto yy37;
431 if (yych <= 0x8F) goto yy52;
432 goto yy37;
433 yy45:
434 yych = *++YYCURSOR;
435 if (yych <= '/') goto yy46;
436 if (yych <= '9') goto yy53;
437 yy46:
438 YYCURSOR = YYMARKER;
439 if (yyaccept <= 1) {
440 if (yyaccept == 0) {
441 goto yy20;
442 } else {
443 goto yy13;
444 }
445 } else {
446 if (yyaccept == 2) {
447 goto yy37;
448 } else {
449 goto yy55;
450 }
451 }
452 yy47:
453 yych = *++YYCURSOR;
454 if (yych <= ',') {
455 if (yych == '+') goto yy56;
456 goto yy46;
457 } else {
458 if (yych <= '-') goto yy56;
459 if (yych <= '/') goto yy46;
460 if (yych <= '9') goto yy57;
461 goto yy46;
462 }
463 yy48:
464 yych = *++YYCURSOR;
465 if (yych == 'l') goto yy59;
466 goto yy46;
467 yy49:
468 yych = *++YYCURSOR;
469 if (yych == 'l') goto yy60;
470 goto yy46;
471 yy50:
472 yych = *++YYCURSOR;
473 if (yych == 'u') goto yy61;
474 goto yy46;
475 yy51:
476 yych = *++YYCURSOR;
477 if (yych <= 0x7F) goto yy46;
478 if (yych <= 0xBF) goto yy12;
479 goto yy46;
480 yy52:
481 yych = *++YYCURSOR;
482 if (yych <= 0x7F) goto yy46;
483 if (yych <= 0xBF) goto yy51;
484 goto yy46;
485 yy53:
486 yyaccept = 3;
487 yych = *(YYMARKER = ++YYCURSOR);
488 if (yych <= 'D') {
489 if (yych <= '/') goto yy55;
490 if (yych <= '9') goto yy53;
491 } else {
492 if (yych <= 'E') goto yy47;
493 if (yych == 'e') goto yy47;
494 }
495 yy55:
496 {
497 ZVAL_DOUBLE(&s->value, zend_strtod((char *) s->token, NULL));
498 return PHP_JSON_T_DOUBLE;
499 }
500 yy56:
501 yych = *++YYCURSOR;
502 if (yych <= '/') goto yy46;
503 if (yych >= ':') goto yy46;
504 yy57:
505 yych = *++YYCURSOR;
506 if (yych <= '/') goto yy55;
507 if (yych <= '9') goto yy57;
508 goto yy55;
509 yy59:
510 yych = *++YYCURSOR;
511 if (yych == 's') goto yy62;
512 goto yy46;
513 yy60:
514 yych = *++YYCURSOR;
515 if (yych == 'l') goto yy63;
516 goto yy46;
517 yy61:
518 yych = *++YYCURSOR;
519 if (yych == 'e') goto yy65;
520 goto yy46;
521 yy62:
522 yych = *++YYCURSOR;
523 if (yych == 'e') goto yy67;
524 goto yy46;
525 yy63:
526 ++YYCURSOR;
527 {
528 ZVAL_NULL(&s->value);
529 return PHP_JSON_T_NUL;
530 }
531 yy65:
532 ++YYCURSOR;
533 {
534 ZVAL_TRUE(&s->value);
535 return PHP_JSON_T_TRUE;
536 }
537 yy67:
538 ++YYCURSOR;
539 {
540 ZVAL_FALSE(&s->value);
541 return PHP_JSON_T_FALSE;
542 }
543 }
544 /* *********************************** */
545 yyc_STR_P1:
546 yych = *YYCURSOR;
547 if (yych <= 0xDF) {
548 if (yych <= '[') {
549 if (yych <= 0x1F) goto yy71;
550 if (yych == '"') goto yy75;
551 goto yy73;
552 } else {
553 if (yych <= '\\') goto yy77;
554 if (yych <= 0x7F) goto yy73;
555 if (yych <= 0xC1) goto yy79;
556 goto yy81;
557 }
558 } else {
559 if (yych <= 0xEF) {
560 if (yych <= 0xE0) goto yy82;
561 if (yych == 0xED) goto yy84;
562 goto yy83;
563 } else {
564 if (yych <= 0xF0) goto yy85;
565 if (yych <= 0xF3) goto yy86;
566 if (yych <= 0xF4) goto yy87;
567 goto yy79;
568 }
569 }
570 yy71:
571 ++YYCURSOR;
572 {
573 s->errcode = PHP_JSON_ERROR_CTRL_CHAR;
574 return PHP_JSON_T_ERROR;
575 }
576 yy73:
577 ++YYCURSOR;
578 { PHP_JSON_CONDITION_GOTO(STR_P1); }
579 yy75:
580 ++YYCURSOR;
581 {
582 zend_string *str;
583 size_t len = s->cursor - s->str_start - s->str_esc - 1 + s->utf8_invalid_count;
584 if (len == 0) {
585 PHP_JSON_CONDITION_SET(JS);
586 ZVAL_EMPTY_STRING(&s->value);
587 return PHP_JSON_T_ESTRING;
588 }
589 str = zend_string_alloc(len, 0);
590 ZSTR_VAL(str)[len] = '\0';
591 ZVAL_STR(&s->value, str);
592 if (s->str_esc || s->utf8_invalid) {
593 s->pstr = (php_json_ctype *) Z_STRVAL(s->value);
594 s->cursor = s->str_start;
595 PHP_JSON_CONDITION_GOTO_STR_P2();
596 } else {
597 memcpy(Z_STRVAL(s->value), s->str_start, len);
598 PHP_JSON_CONDITION_SET(JS);
599 return PHP_JSON_T_STRING;
600 }
601 }
602 yy77:
603 yyaccept = 0;
604 yych = *(YYMARKER = ++YYCURSOR);
605 if (yych <= 'e') {
606 if (yych <= '/') {
607 if (yych == '"') goto yy88;
608 if (yych >= '/') goto yy88;
609 } else {
610 if (yych <= '\\') {
611 if (yych >= '\\') goto yy88;
612 } else {
613 if (yych == 'b') goto yy88;
614 }
615 }
616 } else {
617 if (yych <= 'q') {
618 if (yych <= 'f') goto yy88;
619 if (yych == 'n') goto yy88;
620 } else {
621 if (yych <= 's') {
622 if (yych <= 'r') goto yy88;
623 } else {
624 if (yych <= 't') goto yy88;
625 if (yych <= 'u') goto yy90;
626 }
627 }
628 }
629 yy78:
630 {
631 s->errcode = PHP_JSON_ERROR_SYNTAX;
632 return PHP_JSON_T_ERROR;
633 }
634 yy79:
635 ++YYCURSOR;
636 yy80:
637 {
638 if (s->options & (PHP_JSON_INVALID_UTF8_IGNORE | PHP_JSON_INVALID_UTF8_SUBSTITUTE)) {
639 if (s->options & PHP_JSON_INVALID_UTF8_SUBSTITUTE) {
640 if (s->utf8_invalid_count > INT_MAX - 2) {
641 s->errcode = PHP_JSON_ERROR_UTF8;
642 return PHP_JSON_T_ERROR;
643 }
644 s->utf8_invalid_count += 2;
645 } else {
646 s->utf8_invalid_count--;
647 }
648 s->utf8_invalid = 1;
649 PHP_JSON_CONDITION_GOTO(STR_P1);
650 }
651 s->errcode = PHP_JSON_ERROR_UTF8;
652 return PHP_JSON_T_ERROR;
653 }
654 yy81:
655 yych = *++YYCURSOR;
656 if (yych <= 0x7F) goto yy80;
657 if (yych <= 0xBF) goto yy73;
658 goto yy80;
659 yy82:
660 yyaccept = 1;
661 yych = *(YYMARKER = ++YYCURSOR);
662 if (yych <= 0x9F) goto yy80;
663 if (yych <= 0xBF) goto yy92;
664 goto yy80;
665 yy83:
666 yyaccept = 1;
667 yych = *(YYMARKER = ++YYCURSOR);
668 if (yych <= 0x7F) goto yy80;
669 if (yych <= 0xBF) goto yy92;
670 goto yy80;
671 yy84:
672 yyaccept = 1;
673 yych = *(YYMARKER = ++YYCURSOR);
674 if (yych <= 0x7F) goto yy80;
675 if (yych <= 0x9F) goto yy92;
676 goto yy80;
677 yy85:
678 yyaccept = 1;
679 yych = *(YYMARKER = ++YYCURSOR);
680 if (yych <= 0x8F) goto yy80;
681 if (yych <= 0xBF) goto yy93;
682 goto yy80;
683 yy86:
684 yyaccept = 1;
685 yych = *(YYMARKER = ++YYCURSOR);
686 if (yych <= 0x7F) goto yy80;
687 if (yych <= 0xBF) goto yy93;
688 goto yy80;
689 yy87:
690 yyaccept = 1;
691 yych = *(YYMARKER = ++YYCURSOR);
692 if (yych <= 0x7F) goto yy80;
693 if (yych <= 0x8F) goto yy93;
694 goto yy80;
695 yy88:
696 ++YYCURSOR;
697 {
698 s->str_esc++;
699 PHP_JSON_CONDITION_GOTO(STR_P1);
700 }
701 yy90:
702 yych = *++YYCURSOR;
703 if (yych <= 'D') {
704 if (yych <= '9') {
705 if (yych <= '/') goto yy91;
706 if (yych <= '0') goto yy94;
707 goto yy95;
708 } else {
709 if (yych <= '@') goto yy91;
710 if (yych <= 'C') goto yy95;
711 goto yy96;
712 }
713 } else {
714 if (yych <= 'c') {
715 if (yych <= 'F') goto yy95;
716 if (yych >= 'a') goto yy95;
717 } else {
718 if (yych <= 'd') goto yy96;
719 if (yych <= 'f') goto yy95;
720 }
721 }
722 yy91:
723 YYCURSOR = YYMARKER;
724 if (yyaccept <= 1) {
725 if (yyaccept == 0) {
726 goto yy78;
727 } else {
728 goto yy80;
729 }
730 } else {
731 goto yy114;
732 }
733 yy92:
734 yych = *++YYCURSOR;
735 if (yych <= 0x7F) goto yy91;
736 if (yych <= 0xBF) goto yy73;
737 goto yy91;
738 yy93:
739 yych = *++YYCURSOR;
740 if (yych <= 0x7F) goto yy91;
741 if (yych <= 0xBF) goto yy92;
742 goto yy91;
743 yy94:
744 yych = *++YYCURSOR;
745 if (yych <= '9') {
746 if (yych <= '/') goto yy91;
747 if (yych <= '0') goto yy97;
748 if (yych <= '7') goto yy98;
749 goto yy99;
750 } else {
751 if (yych <= 'F') {
752 if (yych <= '@') goto yy91;
753 goto yy99;
754 } else {
755 if (yych <= '`') goto yy91;
756 if (yych <= 'f') goto yy99;
757 goto yy91;
758 }
759 }
760 yy95:
761 yych = *++YYCURSOR;
762 if (yych <= '@') {
763 if (yych <= '/') goto yy91;
764 if (yych <= '9') goto yy99;
765 goto yy91;
766 } else {
767 if (yych <= 'F') goto yy99;
768 if (yych <= '`') goto yy91;
769 if (yych <= 'f') goto yy99;
770 goto yy91;
771 }
772 yy96:
773 yych = *++YYCURSOR;
774 if (yych <= 'B') {
775 if (yych <= '7') {
776 if (yych <= '/') goto yy91;
777 goto yy99;
778 } else {
779 if (yych <= '9') goto yy100;
780 if (yych <= '@') goto yy91;
781 goto yy100;
782 }
783 } else {
784 if (yych <= '`') {
785 if (yych <= 'F') goto yy101;
786 goto yy91;
787 } else {
788 if (yych <= 'b') goto yy100;
789 if (yych <= 'f') goto yy101;
790 goto yy91;
791 }
792 }
793 yy97:
794 yych = *++YYCURSOR;
795 if (yych <= '@') {
796 if (yych <= '/') goto yy91;
797 if (yych <= '7') goto yy102;
798 if (yych <= '9') goto yy103;
799 goto yy91;
800 } else {
801 if (yych <= 'F') goto yy103;
802 if (yych <= '`') goto yy91;
803 if (yych <= 'f') goto yy103;
804 goto yy91;
805 }
806 yy98:
807 yych = *++YYCURSOR;
808 if (yych <= '@') {
809 if (yych <= '/') goto yy91;
810 if (yych <= '9') goto yy103;
811 goto yy91;
812 } else {
813 if (yych <= 'F') goto yy103;
814 if (yych <= '`') goto yy91;
815 if (yych <= 'f') goto yy103;
816 goto yy91;
817 }
818 yy99:
819 yych = *++YYCURSOR;
820 if (yych <= '@') {
821 if (yych <= '/') goto yy91;
822 if (yych <= '9') goto yy104;
823 goto yy91;
824 } else {
825 if (yych <= 'F') goto yy104;
826 if (yych <= '`') goto yy91;
827 if (yych <= 'f') goto yy104;
828 goto yy91;
829 }
830 yy100:
831 yych = *++YYCURSOR;
832 if (yych <= '@') {
833 if (yych <= '/') goto yy91;
834 if (yych <= '9') goto yy105;
835 goto yy91;
836 } else {
837 if (yych <= 'F') goto yy105;
838 if (yych <= '`') goto yy91;
839 if (yych <= 'f') goto yy105;
840 goto yy91;
841 }
842 yy101:
843 yych = *++YYCURSOR;
844 if (yych <= '@') {
845 if (yych <= '/') goto yy91;
846 if (yych <= '9') goto yy106;
847 goto yy91;
848 } else {
849 if (yych <= 'F') goto yy106;
850 if (yych <= '`') goto yy91;
851 if (yych <= 'f') goto yy106;
852 goto yy91;
853 }
854 yy102:
855 yych = *++YYCURSOR;
856 if (yych <= '@') {
857 if (yych <= '/') goto yy91;
858 if (yych <= '9') goto yy107;
859 goto yy91;
860 } else {
861 if (yych <= 'F') goto yy107;
862 if (yych <= '`') goto yy91;
863 if (yych <= 'f') goto yy107;
864 goto yy91;
865 }
866 yy103:
867 yych = *++YYCURSOR;
868 if (yych <= '@') {
869 if (yych <= '/') goto yy91;
870 if (yych <= '9') goto yy109;
871 goto yy91;
872 } else {
873 if (yych <= 'F') goto yy109;
874 if (yych <= '`') goto yy91;
875 if (yych <= 'f') goto yy109;
876 goto yy91;
877 }
878 yy104:
879 yych = *++YYCURSOR;
880 if (yych <= '@') {
881 if (yych <= '/') goto yy91;
882 if (yych <= '9') goto yy111;
883 goto yy91;
884 } else {
885 if (yych <= 'F') goto yy111;
886 if (yych <= '`') goto yy91;
887 if (yych <= 'f') goto yy111;
888 goto yy91;
889 }
890 yy105:
891 yych = *++YYCURSOR;
892 if (yych <= '@') {
893 if (yych <= '/') goto yy91;
894 if (yych <= '9') goto yy113;
895 goto yy91;
896 } else {
897 if (yych <= 'F') goto yy113;
898 if (yych <= '`') goto yy91;
899 if (yych <= 'f') goto yy113;
900 goto yy91;
901 }
902 yy106:
903 yych = *++YYCURSOR;
904 if (yych <= '@') {
905 if (yych <= '/') goto yy91;
906 if (yych <= '9') goto yy115;
907 goto yy91;
908 } else {
909 if (yych <= 'F') goto yy115;
910 if (yych <= '`') goto yy91;
911 if (yych <= 'f') goto yy115;
912 goto yy91;
913 }
914 yy107:
915 ++YYCURSOR;
916 {
917 s->str_esc += 5;
918 PHP_JSON_CONDITION_GOTO(STR_P1);
919 }
920 yy109:
921 ++YYCURSOR;
922 {
923 s->str_esc += 4;
924 PHP_JSON_CONDITION_GOTO(STR_P1);
925 }
926 yy111:
927 ++YYCURSOR;
928 {
929 s->str_esc += 3;
930 PHP_JSON_CONDITION_GOTO(STR_P1);
931 }
932 yy113:
933 yyaccept = 2;
934 yych = *(YYMARKER = ++YYCURSOR);
935 if (yych == '\\') goto yy116;
936 yy114:
937 {
938 s->errcode = PHP_JSON_ERROR_UTF16;
939 return PHP_JSON_T_ERROR;
940 }
941 yy115:
942 ++YYCURSOR;
943 goto yy114;
944 yy116:
945 yych = *++YYCURSOR;
946 if (yych != 'u') goto yy91;
947 yych = *++YYCURSOR;
948 if (yych == 'D') goto yy118;
949 if (yych != 'd') goto yy91;
950 yy118:
951 yych = *++YYCURSOR;
952 if (yych <= 'B') goto yy91;
953 if (yych <= 'F') goto yy119;
954 if (yych <= 'b') goto yy91;
955 if (yych >= 'g') goto yy91;
956 yy119:
957 yych = *++YYCURSOR;
958 if (yych <= '@') {
959 if (yych <= '/') goto yy91;
960 if (yych >= ':') goto yy91;
961 } else {
962 if (yych <= 'F') goto yy120;
963 if (yych <= '`') goto yy91;
964 if (yych >= 'g') goto yy91;
965 }
966 yy120:
967 yych = *++YYCURSOR;
968 if (yych <= '@') {
969 if (yych <= '/') goto yy91;
970 if (yych >= ':') goto yy91;
971 } else {
972 if (yych <= 'F') goto yy121;
973 if (yych <= '`') goto yy91;
974 if (yych >= 'g') goto yy91;
975 }
976 yy121:
977 ++YYCURSOR;
978 {
979 s->str_esc += 8;
980 PHP_JSON_CONDITION_GOTO(STR_P1);
981 }
982 /* *********************************** */
983 yyc_STR_P2_BIN:
984 yych = *YYCURSOR;
985 if (yych <= 0xDF) {
986 if (yych <= '[') {
987 if (yych == '"') goto yy127;
988 } else {
989 if (yych <= '\\') goto yy129;
990 if (yych <= 0x7F) goto yy125;
991 if (yych <= 0xC1) goto yy131;
992 goto yy133;
993 }
994 } else {
995 if (yych <= 0xEF) {
996 if (yych <= 0xE0) goto yy134;
997 if (yych == 0xED) goto yy136;
998 goto yy135;
999 } else {
1000 if (yych <= 0xF0) goto yy137;
1001 if (yych <= 0xF3) goto yy138;
1002 if (yych <= 0xF4) goto yy139;
1003 goto yy131;
1004 }
1005 }
1006 yy125:
1007 ++YYCURSOR;
1008 { PHP_JSON_CONDITION_GOTO(STR_P2_BIN); }
1009 yy127:
1010 ++YYCURSOR;
1011 YYSETCONDITION(yycJS);
1012 {
1013 PHP_JSON_SCANNER_COPY_ESC();
1014 return PHP_JSON_T_STRING;
1015 }
1016 yy129:
1017 yyaccept = 0;
1018 yych = *(YYMARKER = ++YYCURSOR);
1019 if (yych == 'u') goto yy140;
1020 yy130:
1021 {
1022 char esc;
1023 PHP_JSON_SCANNER_COPY_ESC();
1024 switch (*s->cursor) {
1025 case 'b':
1026 esc = '\b';
1027 break;
1028 case 'f':
1029 esc = '\f'; break;
1030 case 'n':
1031 esc = '\n';
1032 break;
1033 case 'r':
1034 esc = '\r';
1035 break;
1036 case 't':
1037 esc = '\t';
1038 break;
1039 case '\\':
1040 case '/':
1041 case '"':
1042 esc = *s->cursor;
1043 break;
1044 default:
1045 s->errcode = PHP_JSON_ERROR_SYNTAX;
1046 return PHP_JSON_T_ERROR;
1047 }
1048 *(s->pstr++) = esc;
1049 ++YYCURSOR;
1050 s->str_start = s->cursor;
1051 PHP_JSON_CONDITION_GOTO_STR_P2();
1052 }
1053 yy131:
1054 ++YYCURSOR;
1055 yy132:
1056 {
1057 if (s->utf8_invalid) {
1058 PHP_JSON_SCANNER_COPY_ESC();
1059 if (s->options & PHP_JSON_INVALID_UTF8_SUBSTITUTE) {
1060 *(s->pstr++) = (char) (0xe0 | (0xfffd >> 12));
1061 *(s->pstr++) = (char) (0x80 | ((0xfffd >> 6) & 0x3f));
1062 *(s->pstr++) = (char) (0x80 | (0xfffd & 0x3f));
1063 }
1064 s->str_start = s->cursor;
1065 }
1066 PHP_JSON_CONDITION_GOTO(STR_P2_BIN);
1067 }
1068 yy133:
1069 yych = *++YYCURSOR;
1070 if (yych <= 0x7F) goto yy132;
1071 if (yych <= 0xBF) goto yy125;
1072 goto yy132;
1073 yy134:
1074 yyaccept = 1;
1075 yych = *(YYMARKER = ++YYCURSOR);
1076 if (yych <= 0x9F) goto yy132;
1077 if (yych <= 0xBF) goto yy142;
1078 goto yy132;
1079 yy135:
1080 yyaccept = 1;
1081 yych = *(YYMARKER = ++YYCURSOR);
1082 if (yych <= 0x7F) goto yy132;
1083 if (yych <= 0xBF) goto yy142;
1084 goto yy132;
1085 yy136:
1086 yyaccept = 1;
1087 yych = *(YYMARKER = ++YYCURSOR);
1088 if (yych <= 0x7F) goto yy132;
1089 if (yych <= 0x9F) goto yy142;
1090 goto yy132;
1091 yy137:
1092 yyaccept = 1;
1093 yych = *(YYMARKER = ++YYCURSOR);
1094 if (yych <= 0x8F) goto yy132;
1095 if (yych <= 0xBF) goto yy143;
1096 goto yy132;
1097 yy138:
1098 yyaccept = 1;
1099 yych = *(YYMARKER = ++YYCURSOR);
1100 if (yych <= 0x7F) goto yy132;
1101 if (yych <= 0xBF) goto yy143;
1102 goto yy132;
1103 yy139:
1104 yyaccept = 1;
1105 yych = *(YYMARKER = ++YYCURSOR);
1106 if (yych <= 0x7F) goto yy132;
1107 if (yych <= 0x8F) goto yy143;
1108 goto yy132;
1109 yy140:
1110 yych = *++YYCURSOR;
1111 if (yych <= 'D') {
1112 if (yych <= '9') {
1113 if (yych <= '/') goto yy141;
1114 if (yych <= '0') goto yy144;
1115 goto yy145;
1116 } else {
1117 if (yych <= '@') goto yy141;
1118 if (yych <= 'C') goto yy145;
1119 goto yy146;
1120 }
1121 } else {
1122 if (yych <= 'c') {
1123 if (yych <= 'F') goto yy145;
1124 if (yych >= 'a') goto yy145;
1125 } else {
1126 if (yych <= 'd') goto yy146;
1127 if (yych <= 'f') goto yy145;
1128 }
1129 }
1130 yy141:
1131 YYCURSOR = YYMARKER;
1132 if (yyaccept == 0) {
1133 goto yy130;
1134 } else {
1135 goto yy132;
1136 }
1137 yy142:
1138 yych = *++YYCURSOR;
1139 if (yych <= 0x7F) goto yy141;
1140 if (yych <= 0xBF) goto yy125;
1141 goto yy141;
1142 yy143:
1143 yych = *++YYCURSOR;
1144 if (yych <= 0x7F) goto yy141;
1145 if (yych <= 0xBF) goto yy142;
1146 goto yy141;
1147 yy144:
1148 yych = *++YYCURSOR;
1149 if (yych <= '9') {
1150 if (yych <= '/') goto yy141;
1151 if (yych <= '0') goto yy147;
1152 if (yych <= '7') goto yy148;
1153 goto yy149;
1154 } else {
1155 if (yych <= 'F') {
1156 if (yych <= '@') goto yy141;
1157 goto yy149;
1158 } else {
1159 if (yych <= '`') goto yy141;
1160 if (yych <= 'f') goto yy149;
1161 goto yy141;
1162 }
1163 }
1164 yy145:
1165 yych = *++YYCURSOR;
1166 if (yych <= '@') {
1167 if (yych <= '/') goto yy141;
1168 if (yych <= '9') goto yy149;
1169 goto yy141;
1170 } else {
1171 if (yych <= 'F') goto yy149;
1172 if (yych <= '`') goto yy141;
1173 if (yych <= 'f') goto yy149;
1174 goto yy141;
1175 }
1176 yy146:
1177 yych = *++YYCURSOR;
1178 if (yych <= '@') {
1179 if (yych <= '/') goto yy141;
1180 if (yych <= '7') goto yy149;
1181 if (yych <= '9') goto yy150;
1182 goto yy141;
1183 } else {
1184 if (yych <= 'B') goto yy150;
1185 if (yych <= '`') goto yy141;
1186 if (yych <= 'b') goto yy150;
1187 goto yy141;
1188 }
1189 yy147:
1190 yych = *++YYCURSOR;
1191 if (yych <= '@') {
1192 if (yych <= '/') goto yy141;
1193 if (yych <= '7') goto yy151;
1194 if (yych <= '9') goto yy152;
1195 goto yy141;
1196 } else {
1197 if (yych <= 'F') goto yy152;
1198 if (yych <= '`') goto yy141;
1199 if (yych <= 'f') goto yy152;
1200 goto yy141;
1201 }
1202 yy148:
1203 yych = *++YYCURSOR;
1204 if (yych <= '@') {
1205 if (yych <= '/') goto yy141;
1206 if (yych <= '9') goto yy152;
1207 goto yy141;
1208 } else {
1209 if (yych <= 'F') goto yy152;
1210 if (yych <= '`') goto yy141;
1211 if (yych <= 'f') goto yy152;
1212 goto yy141;
1213 }
1214 yy149:
1215 yych = *++YYCURSOR;
1216 if (yych <= '@') {
1217 if (yych <= '/') goto yy141;
1218 if (yych <= '9') goto yy153;
1219 goto yy141;
1220 } else {
1221 if (yych <= 'F') goto yy153;
1222 if (yych <= '`') goto yy141;
1223 if (yych <= 'f') goto yy153;
1224 goto yy141;
1225 }
1226 yy150:
1227 yych = *++YYCURSOR;
1228 if (yych <= '@') {
1229 if (yych <= '/') goto yy141;
1230 if (yych <= '9') goto yy154;
1231 goto yy141;
1232 } else {
1233 if (yych <= 'F') goto yy154;
1234 if (yych <= '`') goto yy141;
1235 if (yych <= 'f') goto yy154;
1236 goto yy141;
1237 }
1238 yy151:
1239 yych = *++YYCURSOR;
1240 if (yych <= '@') {
1241 if (yych <= '/') goto yy141;
1242 if (yych <= '9') goto yy155;
1243 goto yy141;
1244 } else {
1245 if (yych <= 'F') goto yy155;
1246 if (yych <= '`') goto yy141;
1247 if (yych <= 'f') goto yy155;
1248 goto yy141;
1249 }
1250 yy152:
1251 yych = *++YYCURSOR;
1252 if (yych <= '@') {
1253 if (yych <= '/') goto yy141;
1254 if (yych <= '9') goto yy157;
1255 goto yy141;
1256 } else {
1257 if (yych <= 'F') goto yy157;
1258 if (yych <= '`') goto yy141;
1259 if (yych <= 'f') goto yy157;
1260 goto yy141;
1261 }
1262 yy153:
1263 yych = *++YYCURSOR;
1264 if (yych <= '@') {
1265 if (yych <= '/') goto yy141;
1266 if (yych <= '9') goto yy159;
1267 goto yy141;
1268 } else {
1269 if (yych <= 'F') goto yy159;
1270 if (yych <= '`') goto yy141;
1271 if (yych <= 'f') goto yy159;
1272 goto yy141;
1273 }
1274 yy154:
1275 yych = *++YYCURSOR;
1276 if (yych <= '@') {
1277 if (yych <= '/') goto yy141;
1278 if (yych <= '9') goto yy161;
1279 goto yy141;
1280 } else {
1281 if (yych <= 'F') goto yy161;
1282 if (yych <= '`') goto yy141;
1283 if (yych <= 'f') goto yy161;
1284 goto yy141;
1285 }
1286 yy155:
1287 ++YYCURSOR;
1288 {
1289 int utf16 = php_json_ucs2_to_int(s, 2);
1290 PHP_JSON_SCANNER_COPY_UTF();
1291 *(s->pstr++) = (char) utf16;
1292 s->str_start = s->cursor;
1293 PHP_JSON_CONDITION_GOTO_STR_P2();
1294 }
1295 yy157:
1296 ++YYCURSOR;
1297 {
1298 int utf16 = php_json_ucs2_to_int(s, 3);
1299 PHP_JSON_SCANNER_COPY_UTF();
1300 *(s->pstr++) = (char) (0xc0 | (utf16 >> 6));
1301 *(s->pstr++) = (char) (0x80 | (utf16 & 0x3f));
1302 s->str_start = s->cursor;
1303 PHP_JSON_CONDITION_GOTO_STR_P2();
1304 }
1305 yy159:
1306 ++YYCURSOR;
1307 {
1308 int utf16 = php_json_ucs2_to_int(s, 4);
1309 PHP_JSON_SCANNER_COPY_UTF();
1310 *(s->pstr++) = (char) (0xe0 | (utf16 >> 12));
1311 *(s->pstr++) = (char) (0x80 | ((utf16 >> 6) & 0x3f));
1312 *(s->pstr++) = (char) (0x80 | (utf16 & 0x3f));
1313 s->str_start = s->cursor;
1314 PHP_JSON_CONDITION_GOTO_STR_P2();
1315 }
1316 yy161:
1317 yych = *++YYCURSOR;
1318 if (yych != '\\') goto yy141;
1319 yych = *++YYCURSOR;
1320 if (yych != 'u') goto yy141;
1321 yych = *++YYCURSOR;
1322 if (yych == 'D') goto yy164;
1323 if (yych != 'd') goto yy141;
1324 yy164:
1325 yych = *++YYCURSOR;
1326 if (yych <= 'B') goto yy141;
1327 if (yych <= 'F') goto yy165;
1328 if (yych <= 'b') goto yy141;
1329 if (yych >= 'g') goto yy141;
1330 yy165:
1331 yych = *++YYCURSOR;
1332 if (yych <= '@') {
1333 if (yych <= '/') goto yy141;
1334 if (yych >= ':') goto yy141;
1335 } else {
1336 if (yych <= 'F') goto yy166;
1337 if (yych <= '`') goto yy141;
1338 if (yych >= 'g') goto yy141;
1339 }
1340 yy166:
1341 yych = *++YYCURSOR;
1342 if (yych <= '@') {
1343 if (yych <= '/') goto yy141;
1344 if (yych >= ':') goto yy141;
1345 } else {
1346 if (yych <= 'F') goto yy167;
1347 if (yych <= '`') goto yy141;
1348 if (yych >= 'g') goto yy141;
1349 }
1350 yy167:
1351 ++YYCURSOR;
1352 {
1353 int utf32, utf16_hi, utf16_lo;
1354 utf16_hi = php_json_ucs2_to_int(s, 4);
1355 utf16_lo = php_json_ucs2_to_int_ex(s, 4, 7);
1356 utf32 = ((utf16_lo & 0x3FF) << 10) + (utf16_hi & 0x3FF) + 0x10000;
1357 PHP_JSON_SCANNER_COPY_UTF_SP();
1358 *(s->pstr++) = (char) (0xf0 | (utf32 >> 18));
1359 *(s->pstr++) = (char) (0x80 | ((utf32 >> 12) & 0x3f));
1360 *(s->pstr++) = (char) (0x80 | ((utf32 >> 6) & 0x3f));
1361 *(s->pstr++) = (char) (0x80 | (utf32 & 0x3f));
1362 s->str_start = s->cursor;
1363 PHP_JSON_CONDITION_GOTO_STR_P2();
1364 }
1365 /* *********************************** */
1366 yyc_STR_P2_UTF:
1367 yych = *YYCURSOR;
1368 if (yych == '"') goto yy173;
1369 if (yych == '\\') goto yy175;
1370 ++YYCURSOR;
1371 { PHP_JSON_CONDITION_GOTO(STR_P2_UTF); }
1372 yy173:
1373 ++YYCURSOR;
1374 YYSETCONDITION(yycJS);
1375 {
1376 PHP_JSON_SCANNER_COPY_ESC();
1377 return PHP_JSON_T_STRING;
1378 }
1379 yy175:
1380 yych = *(YYMARKER = ++YYCURSOR);
1381 if (yych == 'u') goto yy177;
1382 yy176:
1383 {
1384 char esc;
1385 PHP_JSON_SCANNER_COPY_ESC();
1386 switch (*s->cursor) {
1387 case 'b':
1388 esc = '\b';
1389 break;
1390 case 'f':
1391 esc = '\f'; break;
1392 case 'n':
1393 esc = '\n';
1394 break;
1395 case 'r':
1396 esc = '\r';
1397 break;
1398 case 't':
1399 esc = '\t';
1400 break;
1401 case '\\':
1402 case '/':
1403 case '"':
1404 esc = *s->cursor;
1405 break;
1406 default:
1407 s->errcode = PHP_JSON_ERROR_SYNTAX;
1408 return PHP_JSON_T_ERROR;
1409 }
1410 *(s->pstr++) = esc;
1411 ++YYCURSOR;
1412 s->str_start = s->cursor;
1413 PHP_JSON_CONDITION_GOTO_STR_P2();
1414 }
1415 yy177:
1416 yych = *++YYCURSOR;
1417 if (yych <= 'D') {
1418 if (yych <= '9') {
1419 if (yych <= '/') goto yy178;
1420 if (yych <= '0') goto yy179;
1421 goto yy180;
1422 } else {
1423 if (yych <= '@') goto yy178;
1424 if (yych <= 'C') goto yy180;
1425 goto yy181;
1426 }
1427 } else {
1428 if (yych <= 'c') {
1429 if (yych <= 'F') goto yy180;
1430 if (yych >= 'a') goto yy180;
1431 } else {
1432 if (yych <= 'd') goto yy181;
1433 if (yych <= 'f') goto yy180;
1434 }
1435 }
1436 yy178:
1437 YYCURSOR = YYMARKER;
1438 goto yy176;
1439 yy179:
1440 yych = *++YYCURSOR;
1441 if (yych <= '9') {
1442 if (yych <= '/') goto yy178;
1443 if (yych <= '0') goto yy182;
1444 if (yych <= '7') goto yy183;
1445 goto yy184;
1446 } else {
1447 if (yych <= 'F') {
1448 if (yych <= '@') goto yy178;
1449 goto yy184;
1450 } else {
1451 if (yych <= '`') goto yy178;
1452 if (yych <= 'f') goto yy184;
1453 goto yy178;
1454 }
1455 }
1456 yy180:
1457 yych = *++YYCURSOR;
1458 if (yych <= '@') {
1459 if (yych <= '/') goto yy178;
1460 if (yych <= '9') goto yy184;
1461 goto yy178;
1462 } else {
1463 if (yych <= 'F') goto yy184;
1464 if (yych <= '`') goto yy178;
1465 if (yych <= 'f') goto yy184;
1466 goto yy178;
1467 }
1468 yy181:
1469 yych = *++YYCURSOR;
1470 if (yych <= '@') {
1471 if (yych <= '/') goto yy178;
1472 if (yych <= '7') goto yy184;
1473 if (yych <= '9') goto yy185;
1474 goto yy178;
1475 } else {
1476 if (yych <= 'B') goto yy185;
1477 if (yych <= '`') goto yy178;
1478 if (yych <= 'b') goto yy185;
1479 goto yy178;
1480 }
1481 yy182:
1482 yych = *++YYCURSOR;
1483 if (yych <= '@') {
1484 if (yych <= '/') goto yy178;
1485 if (yych <= '7') goto yy186;
1486 if (yych <= '9') goto yy187;
1487 goto yy178;
1488 } else {
1489 if (yych <= 'F') goto yy187;
1490 if (yych <= '`') goto yy178;
1491 if (yych <= 'f') goto yy187;
1492 goto yy178;
1493 }
1494 yy183:
1495 yych = *++YYCURSOR;
1496 if (yych <= '@') {
1497 if (yych <= '/') goto yy178;
1498 if (yych <= '9') goto yy187;
1499 goto yy178;
1500 } else {
1501 if (yych <= 'F') goto yy187;
1502 if (yych <= '`') goto yy178;
1503 if (yych <= 'f') goto yy187;
1504 goto yy178;
1505 }
1506 yy184:
1507 yych = *++YYCURSOR;
1508 if (yych <= '@') {
1509 if (yych <= '/') goto yy178;
1510 if (yych <= '9') goto yy188;
1511 goto yy178;
1512 } else {
1513 if (yych <= 'F') goto yy188;
1514 if (yych <= '`') goto yy178;
1515 if (yych <= 'f') goto yy188;
1516 goto yy178;
1517 }
1518 yy185:
1519 yych = *++YYCURSOR;
1520 if (yych <= '@') {
1521 if (yych <= '/') goto yy178;
1522 if (yych <= '9') goto yy189;
1523 goto yy178;
1524 } else {
1525 if (yych <= 'F') goto yy189;
1526 if (yych <= '`') goto yy178;
1527 if (yych <= 'f') goto yy189;
1528 goto yy178;
1529 }
1530 yy186:
1531 yych = *++YYCURSOR;
1532 if (yych <= '@') {
1533 if (yych <= '/') goto yy178;
1534 if (yych <= '9') goto yy190;
1535 goto yy178;
1536 } else {
1537 if (yych <= 'F') goto yy190;
1538 if (yych <= '`') goto yy178;
1539 if (yych <= 'f') goto yy190;
1540 goto yy178;
1541 }
1542 yy187:
1543 yych = *++YYCURSOR;
1544 if (yych <= '@') {
1545 if (yych <= '/') goto yy178;
1546 if (yych <= '9') goto yy192;
1547 goto yy178;
1548 } else {
1549 if (yych <= 'F') goto yy192;
1550 if (yych <= '`') goto yy178;
1551 if (yych <= 'f') goto yy192;
1552 goto yy178;
1553 }
1554 yy188:
1555 yych = *++YYCURSOR;
1556 if (yych <= '@') {
1557 if (yych <= '/') goto yy178;
1558 if (yych <= '9') goto yy194;
1559 goto yy178;
1560 } else {
1561 if (yych <= 'F') goto yy194;
1562 if (yych <= '`') goto yy178;
1563 if (yych <= 'f') goto yy194;
1564 goto yy178;
1565 }
1566 yy189:
1567 yych = *++YYCURSOR;
1568 if (yych <= '@') {
1569 if (yych <= '/') goto yy178;
1570 if (yych <= '9') goto yy196;
1571 goto yy178;
1572 } else {
1573 if (yych <= 'F') goto yy196;
1574 if (yych <= '`') goto yy178;
1575 if (yych <= 'f') goto yy196;
1576 goto yy178;
1577 }
1578 yy190:
1579 ++YYCURSOR;
1580 {
1581 int utf16 = php_json_ucs2_to_int(s, 2);
1582 PHP_JSON_SCANNER_COPY_UTF();
1583 *(s->pstr++) = (char) utf16;
1584 s->str_start = s->cursor;
1585 PHP_JSON_CONDITION_GOTO_STR_P2();
1586 }
1587 yy192:
1588 ++YYCURSOR;
1589 {
1590 int utf16 = php_json_ucs2_to_int(s, 3);
1591 PHP_JSON_SCANNER_COPY_UTF();
1592 *(s->pstr++) = (char) (0xc0 | (utf16 >> 6));
1593 *(s->pstr++) = (char) (0x80 | (utf16 & 0x3f));
1594 s->str_start = s->cursor;
1595 PHP_JSON_CONDITION_GOTO_STR_P2();
1596 }
1597 yy194:
1598 ++YYCURSOR;
1599 {
1600 int utf16 = php_json_ucs2_to_int(s, 4);
1601 PHP_JSON_SCANNER_COPY_UTF();
1602 *(s->pstr++) = (char) (0xe0 | (utf16 >> 12));
1603 *(s->pstr++) = (char) (0x80 | ((utf16 >> 6) & 0x3f));
1604 *(s->pstr++) = (char) (0x80 | (utf16 & 0x3f));
1605 s->str_start = s->cursor;
1606 PHP_JSON_CONDITION_GOTO_STR_P2();
1607 }
1608 yy196:
1609 yych = *++YYCURSOR;
1610 if (yych != '\\') goto yy178;
1611 yych = *++YYCURSOR;
1612 if (yych != 'u') goto yy178;
1613 yych = *++YYCURSOR;
1614 if (yych == 'D') goto yy199;
1615 if (yych != 'd') goto yy178;
1616 yy199:
1617 yych = *++YYCURSOR;
1618 if (yych <= 'B') goto yy178;
1619 if (yych <= 'F') goto yy200;
1620 if (yych <= 'b') goto yy178;
1621 if (yych >= 'g') goto yy178;
1622 yy200:
1623 yych = *++YYCURSOR;
1624 if (yych <= '@') {
1625 if (yych <= '/') goto yy178;
1626 if (yych >= ':') goto yy178;
1627 } else {
1628 if (yych <= 'F') goto yy201;
1629 if (yych <= '`') goto yy178;
1630 if (yych >= 'g') goto yy178;
1631 }
1632 yy201:
1633 yych = *++YYCURSOR;
1634 if (yych <= '@') {
1635 if (yych <= '/') goto yy178;
1636 if (yych >= ':') goto yy178;
1637 } else {
1638 if (yych <= 'F') goto yy202;
1639 if (yych <= '`') goto yy178;
1640 if (yych >= 'g') goto yy178;
1641 }
1642 yy202:
1643 ++YYCURSOR;
1644 {
1645 int utf32, utf16_hi, utf16_lo;
1646 utf16_hi = php_json_ucs2_to_int(s, 4);
1647 utf16_lo = php_json_ucs2_to_int_ex(s, 4, 7);
1648 utf32 = ((utf16_lo & 0x3FF) << 10) + (utf16_hi & 0x3FF) + 0x10000;
1649 PHP_JSON_SCANNER_COPY_UTF_SP();
1650 *(s->pstr++) = (char) (0xf0 | (utf32 >> 18));
1651 *(s->pstr++) = (char) (0x80 | ((utf32 >> 12) & 0x3f));
1652 *(s->pstr++) = (char) (0x80 | ((utf32 >> 6) & 0x3f));
1653 *(s->pstr++) = (char) (0x80 | (utf32 & 0x3f));
1654 s->str_start = s->cursor;
1655 PHP_JSON_CONDITION_GOTO_STR_P2();
1656 }
1657 }
1658
1659
1660 }
1661
1662