51 #define YYBISON_VERSION "3.4.1"
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
73 #define yylval yyjsonlval
74 #define yychar yyjsonchar
96 for(
char *p=
yyjsontext+1; *p!=
'"' && *p!=0; p++)
103 case '"': result+=
'"';
break;
104 case '\\': result+=
'\\';
break;
105 case '/': result+=
'/';
break;
106 case 'b': result+=
'\b';
break;
107 case 'f': result+=
'\f';
break;
108 case 'n': result+=
'\n';
break;
109 case 'r': result+=
'\r';
break;
110 case 't': result+=
'\t';
break;
136 #line 137 "json_y.tab.cpp"
139 # if defined __cplusplus
140 # if 201103L <= __cplusplus
141 # define YY_NULLPTR nullptr
143 # define YY_NULLPTR 0
146 # define YY_NULLPTR ((void*)0)
151 #ifdef YYERROR_VERBOSE
152 # undef YYERROR_VERBOSE
153 # define YYERROR_VERBOSE 1
155 # define YYERROR_VERBOSE 0
160 #ifndef YY_YYJSON_JSON_Y_TAB_HPP_INCLUDED
161 # define YY_YYJSON_JSON_Y_TAB_HPP_INCLUDED
167 extern int yyjsondebug;
183 #define TOK_STRING 258
184 #define TOK_NUMBER 259
186 #define TOK_FALSE 261
190 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
192 # define YYSTYPE_IS_TRIVIAL 1
193 # define YYSTYPE_IS_DECLARED 1
234 # ifdef __SIZE_TYPE__
235 # define YYSIZE_T __SIZE_TYPE__
236 # elif defined size_t
237 # define YYSIZE_T size_t
238 # elif ! defined YYSIZE_T
240 # define YYSIZE_T size_t
242 # define YYSIZE_T unsigned
246 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
249 # if defined YYENABLE_NLS && YYENABLE_NLS
251 # include <libintl.h>
252 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
256 # define YY_(Msgid) Msgid
261 # if (defined __GNUC__ \
262 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
263 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
264 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
266 # define YY_ATTRIBUTE(Spec)
270 #ifndef YY_ATTRIBUTE_PURE
271 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
274 #ifndef YY_ATTRIBUTE_UNUSED
275 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
279 #if ! defined lint || defined __GNUC__
280 # define YYUSE(E) ((void) (E))
285 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
287 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
288 _Pragma ("GCC diagnostic push") \
289 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
290 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
291 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
292 _Pragma ("GCC diagnostic pop")
294 # define YY_INITIAL_VALUE(Value) Value
296 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
297 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
298 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
300 #ifndef YY_INITIAL_VALUE
301 # define YY_INITIAL_VALUE(Value)
305 #define YY_ASSERT(E) ((void) (0 && (E)))
307 #if ! defined yyoverflow || YYERROR_VERBOSE
311 # ifdef YYSTACK_USE_ALLOCA
312 # if YYSTACK_USE_ALLOCA
314 # define YYSTACK_ALLOC __builtin_alloca
315 # elif defined __BUILTIN_VA_ARG_INCR
318 # define YYSTACK_ALLOC __alloca
319 # elif defined _MSC_VER
321 # define alloca _alloca
323 # define YYSTACK_ALLOC alloca
324 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
327 # ifndef EXIT_SUCCESS
328 # define EXIT_SUCCESS 0
335 # ifdef YYSTACK_ALLOC
337 # define YYSTACK_FREE(Ptr) do { ; } while (0)
338 # ifndef YYSTACK_ALLOC_MAXIMUM
343 # define YYSTACK_ALLOC_MAXIMUM 4032
346 # define YYSTACK_ALLOC YYMALLOC
347 # define YYSTACK_FREE YYFREE
348 # ifndef YYSTACK_ALLOC_MAXIMUM
349 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
351 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
352 && ! ((defined YYMALLOC || defined malloc) \
353 && (defined YYFREE || defined free)))
355 # ifndef EXIT_SUCCESS
356 # define EXIT_SUCCESS 0
360 # define YYMALLOC malloc
361 # if ! defined malloc && ! defined EXIT_SUCCESS
367 # if ! defined free && ! defined EXIT_SUCCESS
375 #if (! defined yyoverflow \
376 && (! defined __cplusplus \
377 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
387 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
391 # define YYSTACK_BYTES(N) \
392 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
393 + YYSTACK_GAP_MAXIMUM)
395 # define YYCOPY_NEEDED 1
402 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
405 YYSIZE_T yynewbytes; \
406 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
407 Stack = &yyptr->Stack_alloc; \
408 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
409 yyptr += yynewbytes / sizeof (*yyptr); \
415 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
419 # if defined __GNUC__ && 1 < __GNUC__
420 # define YYCOPY(Dst, Src, Count) \
421 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
423 # define YYCOPY(Dst, Src, Count) \
427 for (yyi = 0; yyi < (Count); yyi++) \
428 (Dst)[yyi] = (Src)[yyi]; \
450 #define YYMAXUTOK 262
454 #define YYTRANSLATE(YYX) \
455 ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
461 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 10, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 11, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 12, 2, 13, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 8, 2, 9, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
494 0, 69, 69, 72, 72, 73, 73, 77, 78, 85,
495 84, 98, 98, 99, 99, 103, 104, 108, 116, 118,
496 120, 121, 122, 124, 126
500 #if YYDEBUG || YYERROR_VERBOSE || 0
503 static const char *
const yytname[] =
505 "$end",
"error",
"$undefined",
"TOK_STRING",
"TOK_NUMBER",
"TOK_TRUE",
506 "TOK_FALSE",
"TOK_NULL",
"'{'",
"'}'",
"','",
"':'",
"'['",
"']'",
507 "$accept",
"document",
"object",
"$@1",
"$@2",
"key_value_sequence",
508 "key_value_pair",
"$@3",
"array",
"$@4",
"$@5",
"array_value_sequence",
518 0, 256, 257, 258, 259, 260, 261, 262, 123, 125,
523 #define YYPACT_NINF -11
525 #define yypact_value_is_default(Yystate) \
526 (!!((Yystate) == (-11)))
528 #define YYTABLE_NINF -12
530 #define yytable_value_is_error(Yytable_value) \
537 -2, -11, -11, -11, -11, -11, 5, -6, 11, -11,
538 -11, -11, 6, 13, 7, -2, -11, -11, -11, 4,
539 -11, -11, -1, -11, -11, 8, -11, 13, -2, -11,
548 0, 18, 19, 22, 23, 24, 3, 13, 0, 20,
549 21, 2, 0, 0, 0, 0, 1, 4, 9, 0,
550 7, 12, 0, 15, 17, 0, 6, 0, 0, 14,
557 -11, -11, -11, -11, -11, -11, -10, -11, -11, -11,
564 -1, 8, 9, 12, 13, 19, 20, 25, 10, 14,
573 11, 1, 2, 3, 4, 5, 6, -11, -5, 28,
574 7, 16, 29, 26, 27, 17, 18, 31, 0, 30,
575 21, 32, 0, 0, 0, 0, 0, 0, 0, 0,
581 0, 3, 4, 5, 6, 7, 8, 13, 3, 10,
582 12, 0, 13, 9, 10, 9, 3, 27, -1, 11,
583 13, 28, -1, -1, -1, -1, -1, -1, -1, -1,
591 0, 3, 4, 5, 6, 7, 8, 12, 15, 16,
592 22, 27, 17, 18, 23, 24, 0, 9, 3, 19,
593 20, 13, 25, 26, 27, 21, 9, 10, 10, 13,
600 0, 14, 15, 17, 16, 18, 16, 19, 19, 21,
601 20, 23, 22, 24, 22, 25, 25, 26, 27, 27,
608 0, 2, 1, 0, 3, 0, 4, 1, 3, 0,
609 4, 0, 3, 0, 4, 1, 3, 1, 1, 1,
614 #define yyerrok (yyerrstatus = 0)
615 #define yyclearin (yychar = YYEMPTY)
619 #define YYACCEPT goto yyacceptlab
620 #define YYABORT goto yyabortlab
621 #define YYERROR goto yyerrorlab
624 #define YYRECOVERING() (!!yyerrstatus)
626 #define YYBACKUP(Token, Value) \
628 if (yychar == YYEMPTY) \
632 YYPOPSTACK (yylen); \
638 yyerror (YY_("syntax error: cannot back up")); \
645 #define YYERRCODE 256
654 # define YYFPRINTF fprintf
657 # define YYDPRINTF(Args) \
664 #ifndef YY_LOCATION_PRINT
665 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
669 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
673 YYFPRINTF (stderr, "%s ", Title); \
674 yy_symbol_print (stderr, \
676 YYFPRINTF (stderr, "\n"); \
686 yy_symbol_value_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
688 FILE *yyoutput = yyo;
694 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
705 yy_symbol_print (FILE *yyo,
int yytype,
YYSTYPE const *
const yyvaluep)
707 YYFPRINTF (yyo,
"%s %s (",
710 yy_symbol_value_print (yyo, yytype, yyvaluep);
711 YYFPRINTF (yyo,
")");
722 YYFPRINTF (stderr,
"Stack now");
723 for (; yybottom <= yytop; yybottom++)
725 int yybot = *yybottom;
726 YYFPRINTF (stderr,
" %d", yybot);
728 YYFPRINTF (stderr,
"\n");
731 # define YY_STACK_PRINT(Bottom, Top) \
734 yy_stack_print ((Bottom), (Top)); \
745 unsigned long yylno = yyrline[yyrule];
746 int yynrhs =
yyr2[yyrule];
748 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
751 for (yyi = 0; yyi < yynrhs; yyi++)
753 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
754 yy_symbol_print (stderr,
755 yystos[yyssp[yyi + 1 - yynrhs]],
756 &yyvsp[(yyi + 1) - (yynrhs)]
758 YYFPRINTF (stderr,
"\n");
762 # define YY_REDUCE_PRINT(Rule) \
765 yy_reduce_print (yyssp, yyvsp, Rule); \
772 # define YYDPRINTF(Args)
773 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
774 # define YY_STACK_PRINT(Bottom, Top)
775 # define YY_REDUCE_PRINT(Rule)
781 # define YYINITDEPTH 200
792 # define YYMAXDEPTH 10000
799 # if defined __GLIBC__ && defined _STRING_H
800 # define yystrlen strlen
807 for (yylen = 0; yystr[yylen]; yylen++)
815 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
816 # define yystpcpy stpcpy
821 yystpcpy (
char *yydest,
const char *yysrc)
824 const char *yys = yysrc;
826 while ((*yyd++ = *yys++) !=
'\0')
843 yytnamerr (
char *yyres,
const char *yystr)
848 char const *yyp = yystr;
855 goto do_not_strip_quotes;
859 goto do_not_strip_quotes;
875 do_not_strip_quotes: ;
899 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
903 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
934 yyarg[yycount++] =
yytname[yytoken];
940 int yyxbegin = yyn < 0 ? -yyn : 0;
942 int yychecklim =
YYLAST - yyn + 1;
946 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
950 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
956 yyarg[yycount++] =
yytname[yyx];
970 # define YYCASE_(N, S) \
976 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
977 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
978 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
979 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
980 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
992 if (*yymsg_alloc < yysize)
994 *yymsg_alloc = 2 * yysize;
995 if (! (yysize <= *yymsg_alloc
1007 while ((*yyp = *yyformat) !=
'\0')
1008 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1093 char *yymsg = yymsgbuf;
1094 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1097 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1103 yyssp = yyss = yyssa;
1104 yyvsp = yyvs = yyvsa;
1107 YYDPRINTF ((stderr,
"Starting parse\n"));
1129 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1133 if (yyss + yystacksize - 1 <= yyssp)
1134 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1135 goto yyexhaustedlab;
1141 # if defined yyoverflow
1153 yyoverflow (
YY_(
"memory exhausted"),
1154 &yyss1, yysize *
sizeof (*yyssp),
1155 &yyvs1, yysize *
sizeof (*yyvsp),
1163 goto yyexhaustedlab;
1173 goto yyexhaustedlab;
1176 # undef YYSTACK_RELOCATE
1182 yyssp = yyss + yysize - 1;
1183 yyvsp = yyvs + yysize - 1;
1185 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1186 (
unsigned long) yystacksize));
1188 if (yyss + yystacksize - 1 <= yyssp)
1216 YYDPRINTF ((stderr,
"Reading a token: "));
1223 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1288 yyval = yyvsp[1-yylen];
1297 #line 1298 "json_y.tab.cpp"
1303 #line 1304 "json_y.tab.cpp"
1310 #line 1311 "json_y.tab.cpp"
1319 #line 1320 "json_y.tab.cpp"
1330 #line 1331 "json_y.tab.cpp"
1336 #line 1337 "json_y.tab.cpp"
1342 #line 1343 "json_y.tab.cpp"
1346 #line 109 "parser.y"
1352 #line 1353 "json_y.tab.cpp"
1356 #line 117 "parser.y"
1358 #line 1359 "json_y.tab.cpp"
1362 #line 119 "parser.y"
1364 #line 1365 "json_y.tab.cpp"
1368 #line 123 "parser.y"
1370 #line 1371 "json_y.tab.cpp"
1374 #line 125 "parser.y"
1376 #line 1377 "json_y.tab.cpp"
1380 #line 127 "parser.y"
1382 #line 1383 "json_y.tab.cpp"
1386 #line 1387 "json_y.tab.cpp"
1414 const int yyi =
yypgoto[yylhs] + *yyssp;
1415 yystate = (0 <= yyi && yyi <=
YYLAST &&
yycheck[yyi] == *yyssp
1435 #if ! YYERROR_VERBOSE
1438 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1441 char const *yymsgp =
YY_(
"syntax error");
1442 int yysyntax_error_status;
1444 if (yysyntax_error_status == 0)
1446 else if (yysyntax_error_status == 1)
1448 if (yymsg != yymsgbuf)
1454 yymsg_alloc =
sizeof yymsgbuf;
1455 yysyntax_error_status = 2;
1464 if (yysyntax_error_status == 2)
1465 goto yyexhaustedlab;
1467 # undef YYSYNTAX_ERROR
1473 if (yyerrstatus == 3)
1575 #if !defined yyoverflow || YYERROR_VERBOSE
1602 while (yyssp != yyss)
1613 if (yymsg != yymsgbuf)