51 #define YYBISON_VERSION "3.5"
54 #define YYSKELETON_NAME "yacc.c"
67 #define yyparse yyjsonparse
68 #define yylex yyjsonlex
69 #define yyerror yyjsonerror
70 #define yydebug yyjsondebug
71 #define yynerrs yyjsonnerrs
72 #define yylval yyjsonlval
73 #define yychar yyjsonchar
95 for(
char *p=
yyjsontext+1; *p!=
'"' && *p!=0; p++)
102 case '"': result+=
'"';
break;
103 case '\\': result+=
'\\';
break;
104 case '/': result+=
'/';
break;
105 case 'b': result+=
'\b';
break;
106 case 'f': result+=
'\f';
break;
107 case 'n': result+=
'\n';
break;
108 case 'r': result+=
'\r';
break;
109 case 't': result+=
'\t';
break;
135 #line 136 "json_y.tab.cpp"
139 # define YY_CAST(Type, Val) static_cast<Type> (Val)
140 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
142 # define YY_CAST(Type, Val) ((Type) (Val))
143 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
147 # if defined __cplusplus
148 # if 201103L <= __cplusplus
149 # define YY_NULLPTR nullptr
151 # define YY_NULLPTR 0
154 # define YY_NULLPTR ((void*)0)
159 #ifdef YYERROR_VERBOSE
160 # undef YYERROR_VERBOSE
161 # define YYERROR_VERBOSE 1
163 # define YYERROR_VERBOSE 0
168 #ifndef YY_YYJSON_JSON_Y_TAB_HPP_INCLUDED
169 # define YY_YYJSON_JSON_Y_TAB_HPP_INCLUDED
175 extern int yyjsondebug;
191 #define TOK_STRING 258
192 #define TOK_NUMBER 259
194 #define TOK_FALSE 261
198 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
200 # define YYSTYPE_IS_TRIVIAL 1
201 # define YYSTYPE_IS_DECLARED 1
221 #ifndef __PTRDIFF_MAX__
223 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
234 #ifdef __INT_LEAST8_MAX__
236 #elif defined YY_STDINT_H
242 #ifdef __INT_LEAST16_MAX__
244 #elif defined YY_STDINT_H
250 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
252 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
253 && UINT_LEAST8_MAX <= INT_MAX)
255 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
261 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
263 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
264 && UINT_LEAST16_MAX <= INT_MAX)
266 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
273 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
274 # define YYPTRDIFF_T __PTRDIFF_TYPE__
275 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
276 # elif defined PTRDIFF_MAX
280 # define YYPTRDIFF_T ptrdiff_t
281 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
283 # define YYPTRDIFF_T long
284 # define YYPTRDIFF_MAXIMUM LONG_MAX
289 # ifdef __SIZE_TYPE__
290 # define YYSIZE_T __SIZE_TYPE__
291 # elif defined size_t
292 # define YYSIZE_T size_t
293 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
295 # define YYSIZE_T size_t
297 # define YYSIZE_T unsigned
301 #define YYSIZE_MAXIMUM \
302 YY_CAST (YYPTRDIFF_T, \
303 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
304 ? YYPTRDIFF_MAXIMUM \
305 : YY_CAST (YYSIZE_T, -1)))
307 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
316 # if defined YYENABLE_NLS && YYENABLE_NLS
318 # include <libintl.h>
319 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
323 # define YY_(Msgid) Msgid
327 #ifndef YY_ATTRIBUTE_PURE
328 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
329 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
331 # define YY_ATTRIBUTE_PURE
335 #ifndef YY_ATTRIBUTE_UNUSED
336 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
337 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
339 # define YY_ATTRIBUTE_UNUSED
344 #if ! defined lint || defined __GNUC__
345 # define YYUSE(E) ((void) (E))
350 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
352 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
353 _Pragma ("GCC diagnostic push") \
354 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
355 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
356 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
357 _Pragma ("GCC diagnostic pop")
359 # define YY_INITIAL_VALUE(Value) Value
361 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
362 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
363 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
365 #ifndef YY_INITIAL_VALUE
366 # define YY_INITIAL_VALUE(Value)
369 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
370 # define YY_IGNORE_USELESS_CAST_BEGIN \
371 _Pragma ("GCC diagnostic push") \
372 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
373 # define YY_IGNORE_USELESS_CAST_END \
374 _Pragma ("GCC diagnostic pop")
376 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
377 # define YY_IGNORE_USELESS_CAST_BEGIN
378 # define YY_IGNORE_USELESS_CAST_END
382 #define YY_ASSERT(E) ((void) (0 && (E)))
384 #if ! defined yyoverflow || YYERROR_VERBOSE
388 # ifdef YYSTACK_USE_ALLOCA
389 # if YYSTACK_USE_ALLOCA
391 # define YYSTACK_ALLOC __builtin_alloca
392 # elif defined __BUILTIN_VA_ARG_INCR
395 # define YYSTACK_ALLOC __alloca
396 # elif defined _MSC_VER
398 # define alloca _alloca
400 # define YYSTACK_ALLOC alloca
401 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
404 # ifndef EXIT_SUCCESS
405 # define EXIT_SUCCESS 0
412 # ifdef YYSTACK_ALLOC
414 # define YYSTACK_FREE(Ptr) do { ; } while (0)
415 # ifndef YYSTACK_ALLOC_MAXIMUM
420 # define YYSTACK_ALLOC_MAXIMUM 4032
423 # define YYSTACK_ALLOC YYMALLOC
424 # define YYSTACK_FREE YYFREE
425 # ifndef YYSTACK_ALLOC_MAXIMUM
426 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
428 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
429 && ! ((defined YYMALLOC || defined malloc) \
430 && (defined YYFREE || defined free)))
432 # ifndef EXIT_SUCCESS
433 # define EXIT_SUCCESS 0
437 # define YYMALLOC malloc
438 # if ! defined malloc && ! defined EXIT_SUCCESS
444 # if ! defined free && ! defined EXIT_SUCCESS
452 #if (! defined yyoverflow \
453 && (! defined __cplusplus \
454 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
464 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
468 # define YYSTACK_BYTES(N) \
469 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
470 + YYSTACK_GAP_MAXIMUM)
472 # define YYCOPY_NEEDED 1
479 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
482 YYPTRDIFF_T yynewbytes; \
483 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
484 Stack = &yyptr->Stack_alloc; \
485 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
486 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
492 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
496 # if defined __GNUC__ && 1 < __GNUC__
497 # define YYCOPY(Dst, Src, Count) \
498 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
500 # define YYCOPY(Dst, Src, Count) \
504 for (yyi = 0; yyi < (Count); yyi++) \
505 (Dst)[yyi] = (Src)[yyi]; \
527 #define YYMAXUTOK 262
532 #define YYTRANSLATE(YYX) \
533 (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
539 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 10, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 11, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 12, 2, 13, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 8, 2, 9, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
572 0, 69, 69, 72, 72, 73, 73, 77, 78, 85,
573 84, 98, 98, 99, 99, 103, 104, 108, 116, 118,
574 120, 121, 122, 124, 126
578 #if YYDEBUG || YYERROR_VERBOSE || 0
581 static const char *
const yytname[] =
583 "$end",
"error",
"$undefined",
"TOK_STRING",
"TOK_NUMBER",
"TOK_TRUE",
584 "TOK_FALSE",
"TOK_NULL",
"'{'",
"'}'",
"','",
"':'",
"'['",
"']'",
585 "$accept",
"document",
"object",
"$@1",
"$@2",
"key_value_sequence",
586 "key_value_pair",
"$@3",
"array",
"$@4",
"$@5",
"array_value_sequence",
596 0, 256, 257, 258, 259, 260, 261, 262, 123, 125,
601 #define YYPACT_NINF (-11)
603 #define yypact_value_is_default(Yyn) \
604 ((Yyn) == YYPACT_NINF)
606 #define YYTABLE_NINF (-12)
608 #define yytable_value_is_error(Yyn) \
615 -2, -11, -11, -11, -11, -11, 5, -6, 11, -11,
616 -11, -11, 6, 13, 7, -2, -11, -11, -11, 4,
617 -11, -11, -1, -11, -11, 8, -11, 13, -2, -11,
626 0, 18, 19, 22, 23, 24, 3, 13, 0, 20,
627 21, 2, 0, 0, 0, 0, 1, 4, 9, 0,
628 7, 12, 0, 15, 17, 0, 6, 0, 0, 14,
635 -11, -11, -11, -11, -11, -11, -10, -11, -11, -11,
642 -1, 8, 9, 12, 13, 19, 20, 25, 10, 14,
651 11, 1, 2, 3, 4, 5, 6, -11, -5, 28,
652 7, 16, 29, 26, 27, 17, 18, 31, 0, 30,
653 21, 32, 0, 0, 0, 0, 0, 0, 0, 0,
659 0, 3, 4, 5, 6, 7, 8, 13, 3, 10,
660 12, 0, 13, 9, 10, 9, 3, 27, -1, 11,
661 13, 28, -1, -1, -1, -1, -1, -1, -1, -1,
669 0, 3, 4, 5, 6, 7, 8, 12, 15, 16,
670 22, 27, 17, 18, 23, 24, 0, 9, 3, 19,
671 20, 13, 25, 26, 27, 21, 9, 10, 10, 13,
678 0, 14, 15, 17, 16, 18, 16, 19, 19, 21,
679 20, 23, 22, 24, 22, 25, 25, 26, 27, 27,
686 0, 2, 1, 0, 3, 0, 4, 1, 3, 0,
687 4, 0, 3, 0, 4, 1, 3, 1, 1, 1,
692 #define yyerrok (yyerrstatus = 0)
693 #define yyclearin (yychar = YYEMPTY)
697 #define YYACCEPT goto yyacceptlab
698 #define YYABORT goto yyabortlab
699 #define YYERROR goto yyerrorlab
702 #define YYRECOVERING() (!!yyerrstatus)
704 #define YYBACKUP(Token, Value) \
706 if (yychar == YYEMPTY) \
710 YYPOPSTACK (yylen); \
716 yyerror (YY_("syntax error: cannot back up")); \
723 #define YYERRCODE 256
732 # define YYFPRINTF fprintf
735 # define YYDPRINTF(Args) \
742 #ifndef YY_LOCATION_PRINT
743 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
747 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
751 YYFPRINTF (stderr, "%s ", Title); \
752 yy_symbol_print (stderr, \
754 YYFPRINTF (stderr, "\n"); \
764 yy_symbol_value_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
766 FILE *yyoutput = yyo;
772 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
785 yy_symbol_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
787 YYFPRINTF (yyo,
"%s %s (",
790 yy_symbol_value_print (yyo, yytype, yyvaluep);
791 YYFPRINTF (yyo,
")");
802 YYFPRINTF (stderr,
"Stack now");
803 for (; yybottom <= yytop; yybottom++)
805 int yybot = *yybottom;
806 YYFPRINTF (stderr,
" %d", yybot);
808 YYFPRINTF (stderr,
"\n");
811 # define YY_STACK_PRINT(Bottom, Top) \
814 yy_stack_print ((Bottom), (Top)); \
825 int yylno = yyrline[yyrule];
826 int yynrhs =
yyr2[yyrule];
828 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %d):\n",
831 for (yyi = 0; yyi < yynrhs; yyi++)
833 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
834 yy_symbol_print (stderr,
835 yystos[yyssp[yyi + 1 - yynrhs]],
836 &yyvsp[(yyi + 1) - (yynrhs)]
838 YYFPRINTF (stderr,
"\n");
842 # define YY_REDUCE_PRINT(Rule) \
845 yy_reduce_print (yyssp, yyvsp, Rule); \
852 # define YYDPRINTF(Args)
853 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
854 # define YY_STACK_PRINT(Bottom, Top)
855 # define YY_REDUCE_PRINT(Rule)
861 # define YYINITDEPTH 200
872 # define YYMAXDEPTH 10000
879 # if defined __GLIBC__ && defined _STRING_H
880 # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
887 for (yylen = 0; yystr[yylen]; yylen++)
895 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
896 # define yystpcpy stpcpy
901 yystpcpy (
char *yydest,
const char *yysrc)
904 const char *yys = yysrc;
906 while ((*yyd++ = *yys++) !=
'\0')
923 yytnamerr (
char *yyres,
const char *yystr)
928 char const *yyp = yystr;
935 goto do_not_strip_quotes;
939 goto do_not_strip_quotes;
955 do_not_strip_quotes: ;
959 return yystpcpy (yyres, yystr) - yyres;
977 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
982 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1013 int yyn =
yypact[*yyssp];
1016 yyarg[yycount++] =
yytname[yytoken];
1022 int yyxbegin = yyn < 0 ? -yyn : 0;
1024 int yychecklim =
YYLAST - yyn + 1;
1028 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1032 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1038 yyarg[yycount++] =
yytname[yyx];
1053 # define YYCASE_(N, S) \
1059 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1060 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1061 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1062 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1063 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1077 if (*yymsg_alloc < yysize)
1079 *yymsg_alloc = 2 * yysize;
1080 if (! (yysize <= *yymsg_alloc
1092 while ((*yyp = *yyformat) !=
'\0')
1093 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1178 char *yymsg = yymsgbuf;
1182 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1188 yyssp = yyss = yyssa;
1189 yyvsp = yyvs = yyvsa;
1192 YYDPRINTF ((stderr,
"Starting parse\n"));
1214 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1220 if (yyss + yystacksize - 1 <= yyssp)
1221 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1222 goto yyexhaustedlab;
1228 # if defined yyoverflow
1240 yyoverflow (
YY_(
"memory exhausted"),
1241 &yyss1, yysize *
YYSIZEOF (*yyssp),
1242 &yyvs1, yysize *
YYSIZEOF (*yyvsp),
1250 goto yyexhaustedlab;
1261 goto yyexhaustedlab;
1264 # undef YYSTACK_RELOCATE
1270 yyssp = yyss + yysize - 1;
1271 yyvsp = yyvs + yysize - 1;
1274 YYDPRINTF ((stderr,
"Stack size increased to %ld\n",
1275 YY_CAST (
long, yystacksize)));
1278 if (yyss + yystacksize - 1 <= yyssp)
1306 YYDPRINTF ((stderr,
"Reading a token: "));
1313 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1377 yyval = yyvsp[1-yylen];
1386 #line 1387 "json_y.tab.cpp"
1392 #line 1393 "json_y.tab.cpp"
1399 #line 1400 "json_y.tab.cpp"
1408 #line 1409 "json_y.tab.cpp"
1419 #line 1420 "json_y.tab.cpp"
1425 #line 1426 "json_y.tab.cpp"
1431 #line 1432 "json_y.tab.cpp"
1435 #line 109 "parser.y"
1441 #line 1442 "json_y.tab.cpp"
1445 #line 117 "parser.y"
1447 #line 1448 "json_y.tab.cpp"
1451 #line 119 "parser.y"
1453 #line 1454 "json_y.tab.cpp"
1457 #line 123 "parser.y"
1459 #line 1460 "json_y.tab.cpp"
1463 #line 125 "parser.y"
1465 #line 1466 "json_y.tab.cpp"
1469 #line 127 "parser.y"
1471 #line 1472 "json_y.tab.cpp"
1475 #line 1476 "json_y.tab.cpp"
1503 const int yyi =
yypgoto[yylhs] + *yyssp;
1504 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
1524 #if ! YYERROR_VERBOSE
1527 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1530 char const *yymsgp =
YY_(
"syntax error");
1531 int yysyntax_error_status;
1533 if (yysyntax_error_status == 0)
1535 else if (yysyntax_error_status == 1)
1537 if (yymsg != yymsgbuf)
1543 yymsg_alloc =
sizeof yymsgbuf;
1544 yysyntax_error_status = 2;
1553 if (yysyntax_error_status == 2)
1554 goto yyexhaustedlab;
1556 # undef YYSYNTAX_ERROR
1562 if (yyerrstatus == 3)
1664 #if !defined yyoverflow || YYERROR_VERBOSE
1691 while (yyssp != yyss)
1702 if (yymsg != yymsgbuf)