47 #define YYBISON_VERSION "3.0.4" 50 #define YYSKELETON_NAME "yacc.c" 63 #define yyparse yyjsonparse 64 #define yylex yyjsonlex 65 #define yyerror yyjsonerror 66 #define yydebug yyjsondebug 67 #define yynerrs yyjsonnerrs 69 #define yylval yyjsonlval 70 #define yychar yyjsonchar 92 for(
char *p=
yyjsontext+1; *p!=
'"' && *p!=0; p++)
99 case '"': result+=
'"';
break;
100 case '\\': result+=
'\\';
break;
101 case '/': result+=
'/';
break;
102 case 'b': result+=
'\b';
break;
103 case 'f': result+=
'\f';
break;
104 case 'n': result+=
'\n';
break;
105 case 'r': result+=
'\r';
break;
106 case 't': result+=
'\t';
break;
132 #line 133 "json_y.tab.cpp" 135 # if defined __cplusplus && 201103L <= __cplusplus 136 # define YY_NULLPTR nullptr 138 # define YY_NULLPTR 0 143 #ifdef YYERROR_VERBOSE 144 # undef YYERROR_VERBOSE 145 # define YYERROR_VERBOSE 1 147 # define YYERROR_VERBOSE 0 152 #ifndef YY_YYJSON_JSON_Y_TAB_HPP_INCLUDED 153 # define YY_YYJSON_JSON_Y_TAB_HPP_INCLUDED 159 extern int yyjsondebug;
175 #define TOK_STRING 258 176 #define TOK_NUMBER 259 178 #define TOK_FALSE 261 182 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 184 # define YYSTYPE_IS_TRIVIAL 1 185 # define YYSTYPE_IS_DECLARED 1 197 #line 198 "json_y.tab.cpp" 228 # ifdef __SIZE_TYPE__ 229 # define YYSIZE_T __SIZE_TYPE__ 230 # elif defined size_t 231 # define YYSIZE_T size_t 232 # elif ! defined YYSIZE_T 234 # define YYSIZE_T size_t 236 # define YYSIZE_T unsigned int 240 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 243 # if defined YYENABLE_NLS && YYENABLE_NLS 245 # include <libintl.h> 246 # define YY_(Msgid) dgettext ("bison-runtime", Msgid) 250 # define YY_(Msgid) Msgid 255 # if (defined __GNUC__ \ 256 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ 257 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 258 # define YY_ATTRIBUTE(Spec) __attribute__(Spec) 260 # define YY_ATTRIBUTE(Spec) 264 #ifndef YY_ATTRIBUTE_PURE 265 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) 268 #ifndef YY_ATTRIBUTE_UNUSED 269 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 272 #if !defined _Noreturn \ 273 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 274 # if defined _MSC_VER && 1200 <= _MSC_VER 275 # define _Noreturn __declspec (noreturn) 277 # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 282 #if ! defined lint || defined __GNUC__ 283 # define YYUSE(E) ((void) (E)) 288 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 290 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 291 _Pragma ("GCC diagnostic push") \ 292 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 293 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 294 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 295 _Pragma ("GCC diagnostic pop") 297 # define YY_INITIAL_VALUE(Value) Value 299 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 300 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 301 # define YY_IGNORE_MAYBE_UNINITIALIZED_END 303 #ifndef YY_INITIAL_VALUE 304 # define YY_INITIAL_VALUE(Value) 308 #if ! defined yyoverflow || YYERROR_VERBOSE 312 # ifdef YYSTACK_USE_ALLOCA 313 # if YYSTACK_USE_ALLOCA 315 # define YYSTACK_ALLOC __builtin_alloca 316 # elif defined __BUILTIN_VA_ARG_INCR 319 # define YYSTACK_ALLOC __alloca 320 # elif defined _MSC_VER 322 # define alloca _alloca 324 # define YYSTACK_ALLOC alloca 325 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 328 # ifndef EXIT_SUCCESS 329 # define EXIT_SUCCESS 0 336 # ifdef YYSTACK_ALLOC 338 # define YYSTACK_FREE(Ptr) do { ; } while (0) 339 # ifndef YYSTACK_ALLOC_MAXIMUM 344 # define YYSTACK_ALLOC_MAXIMUM 4032 347 # define YYSTACK_ALLOC YYMALLOC 348 # define YYSTACK_FREE YYFREE 349 # ifndef YYSTACK_ALLOC_MAXIMUM 350 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 352 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 353 && ! ((defined YYMALLOC || defined malloc) \ 354 && (defined YYFREE || defined free))) 356 # ifndef EXIT_SUCCESS 357 # define EXIT_SUCCESS 0 361 # define YYMALLOC malloc 362 # if ! defined malloc && ! defined EXIT_SUCCESS 368 # if ! defined free && ! defined EXIT_SUCCESS 376 #if (! defined yyoverflow \ 377 && (! defined __cplusplus \ 378 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 388 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 392 # define YYSTACK_BYTES(N) \ 393 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 394 + YYSTACK_GAP_MAXIMUM) 396 # define YYCOPY_NEEDED 1 403 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 406 YYSIZE_T yynewbytes; \ 407 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 408 Stack = &yyptr->Stack_alloc; \ 409 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 410 yyptr += yynewbytes / sizeof (*yyptr); \ 416 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 420 # if defined __GNUC__ && 1 < __GNUC__ 421 # define YYCOPY(Dst, Src, Count) \ 422 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 424 # define YYCOPY(Dst, Src, Count) \ 428 for (yyi = 0; yyi < (Count); yyi++) \ 429 (Dst)[yyi] = (Src)[yyi]; \ 453 #define YYMAXUTOK 262 455 #define YYTRANSLATE(YYX) \ 456 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 462 0, 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, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 10, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 11, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 12, 2, 13, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 8, 2, 9, 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, 2, 2, 2, 2,
487 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
495 0, 69, 69, 72, 72, 73, 73, 77, 78, 85,
496 84, 98, 98, 99, 99, 103, 104, 108, 116, 118,
497 120, 121, 122, 124, 126
501 #if YYDEBUG || YYERROR_VERBOSE || 0 504 static const char *
const yytname[] =
506 "$end",
"error",
"$undefined",
"TOK_STRING",
"TOK_NUMBER",
"TOK_TRUE",
507 "TOK_FALSE",
"TOK_NULL",
"'{'",
"'}'",
"','",
"':'",
"'['",
"']'",
508 "$accept",
"document",
"object",
"$@1",
"$@2",
"key_value_sequence",
509 "key_value_pair",
"$@3",
"array",
"$@4",
"$@5",
"array_value_sequence",
519 0, 256, 257, 258, 259, 260, 261, 262, 123, 125,
524 #define YYPACT_NINF -11 526 #define yypact_value_is_default(Yystate) \ 527 (!!((Yystate) == (-11))) 529 #define YYTABLE_NINF -12 531 #define yytable_value_is_error(Yytable_value) \ 538 -2, -11, -11, -11, -11, -11, 5, -6, 11, -11,
539 -11, -11, 6, 13, 7, -2, -11, -11, -11, 4,
540 -11, -11, -1, -11, -11, 8, -11, 13, -2, -11,
549 0, 18, 19, 22, 23, 24, 3, 13, 0, 20,
550 21, 2, 0, 0, 0, 0, 1, 4, 9, 0,
551 7, 12, 0, 15, 17, 0, 6, 0, 0, 14,
558 -11, -11, -11, -11, -11, -11, -10, -11, -11, -11,
565 -1, 8, 9, 12, 13, 19, 20, 25, 10, 14,
574 11, 1, 2, 3, 4, 5, 6, -11, -5, 28,
575 7, 16, 29, 26, 27, 17, 18, 31, 0, 30,
576 21, 32, 0, 0, 0, 0, 0, 0, 0, 0,
582 0, 3, 4, 5, 6, 7, 8, 13, 3, 10,
583 12, 0, 13, 9, 10, 9, 3, 27, -1, 11,
584 13, 28, -1, -1, -1, -1, -1, -1, -1, -1,
592 0, 3, 4, 5, 6, 7, 8, 12, 15, 16,
593 22, 27, 17, 18, 23, 24, 0, 9, 3, 19,
594 20, 13, 25, 26, 27, 21, 9, 10, 10, 13,
601 0, 14, 15, 17, 16, 18, 16, 19, 19, 21,
602 20, 23, 22, 24, 22, 25, 25, 26, 27, 27,
609 0, 2, 1, 0, 3, 0, 4, 1, 3, 0,
610 4, 0, 3, 0, 4, 1, 3, 1, 1, 1,
615 #define yyerrok (yyerrstatus = 0) 616 #define yyclearin (yychar = YYEMPTY) 620 #define YYACCEPT goto yyacceptlab 621 #define YYABORT goto yyabortlab 622 #define YYERROR goto yyerrorlab 625 #define YYRECOVERING() (!!yyerrstatus) 627 #define YYBACKUP(Token, Value) \ 629 if (yychar == YYEMPTY) \ 633 YYPOPSTACK (yylen); \ 639 yyerror (YY_("syntax error: cannot back up")); \ 646 #define YYERRCODE 256 655 # define YYFPRINTF fprintf 658 # define YYDPRINTF(Args) \ 665 #ifndef YY_LOCATION_PRINT 666 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 670 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 674 YYFPRINTF (stderr, "%s ", Title); \ 675 yy_symbol_print (stderr, \ 677 YYFPRINTF (stderr, "\n"); \ 687 yy_symbol_value_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep)
689 FILE *yyo = yyoutput;
695 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
706 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep)
708 YYFPRINTF (yyoutput,
"%s %s (",
711 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
712 YYFPRINTF (yyoutput,
")");
723 YYFPRINTF (stderr,
"Stack now");
724 for (; yybottom <= yytop; yybottom++)
726 int yybot = *yybottom;
727 YYFPRINTF (stderr,
" %d", yybot);
729 YYFPRINTF (stderr,
"\n");
732 # define YY_STACK_PRINT(Bottom, Top) \ 735 yy_stack_print ((Bottom), (Top)); \ 746 unsigned long int yylno = yyrline[yyrule];
747 int yynrhs =
yyr2[yyrule];
749 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
752 for (yyi = 0; yyi < yynrhs; yyi++)
754 YYFPRINTF (stderr,
" $%d = ", yyi + 1);
755 yy_symbol_print (stderr,
756 yystos[yyssp[yyi + 1 - yynrhs]],
757 &(yyvsp[(yyi + 1) - (yynrhs)])
759 YYFPRINTF (stderr,
"\n");
763 # define YY_REDUCE_PRINT(Rule) \ 766 yy_reduce_print (yyssp, yyvsp, Rule); \ 773 # define YYDPRINTF(Args) 774 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 775 # define YY_STACK_PRINT(Bottom, Top) 776 # define YY_REDUCE_PRINT(Rule) 782 # define YYINITDEPTH 200 793 # define YYMAXDEPTH 10000 800 # if defined __GLIBC__ && defined _STRING_H 801 # define yystrlen strlen 808 for (yylen = 0; yystr[yylen]; yylen++)
816 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 817 # define yystpcpy stpcpy 822 yystpcpy (
char *yydest,
const char *yysrc)
825 const char *yys = yysrc;
827 while ((*yyd++ = *yys++) !=
'\0')
844 yytnamerr (
char *yyres,
const char *yystr)
849 char const *yyp = yystr;
856 goto do_not_strip_quotes;
860 goto do_not_strip_quotes;
873 do_not_strip_quotes: ;
879 return yystpcpy (yyres, yystr) - yyres;
897 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
901 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
932 yyarg[yycount++] =
yytname[yytoken];
938 int yyxbegin = yyn < 0 ? -yyn : 0;
940 int yychecklim =
YYLAST - yyn + 1;
944 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
948 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
954 yyarg[yycount++] =
yytname[yyx];
957 if (! (yysize <= yysize1
968 # define YYCASE_(N, S) \ 973 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
974 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
975 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
976 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
977 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
988 if (*yymsg_alloc < yysize)
990 *yymsg_alloc = 2 * yysize;
991 if (! (yysize <= *yymsg_alloc
1003 while ((*yyp = *yyformat) !=
'\0')
1004 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
1089 char *yymsg = yymsgbuf;
1090 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1093 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1099 yyssp = yyss = yyssa;
1100 yyvsp = yyvs = yyvsa;
1103 YYDPRINTF ((stderr,
"Starting parse\n"));
1122 if (yyss + yystacksize - 1 <= yyssp)
1125 YYSIZE_T yysize = yyssp - yyss + 1;
1139 yyoverflow (
YY_(
"memory exhausted"),
1140 &yyss1, yysize *
sizeof (*yyssp),
1141 &yyvs1, yysize *
sizeof (*yyvsp),
1148 # ifndef YYSTACK_RELOCATE 1149 goto yyexhaustedlab;
1153 goto yyexhaustedlab;
1163 goto yyexhaustedlab;
1166 # undef YYSTACK_RELOCATE 1173 yyssp = yyss + yysize - 1;
1174 yyvsp = yyvs + yysize - 1;
1176 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1177 (
unsigned long int) yystacksize));
1179 if (yyss + yystacksize - 1 <= yyssp)
1183 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1208 YYDPRINTF ((stderr,
"Reading a token: "));
1215 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1281 yyval = yyvsp[1-yylen];
1290 #line 1291 "json_y.tab.cpp" 1296 #line 1297 "json_y.tab.cpp" 1303 #line 1304 "json_y.tab.cpp" 1312 #line 1313 "json_y.tab.cpp" 1323 #line 1324 "json_y.tab.cpp" 1329 #line 1330 "json_y.tab.cpp" 1335 #line 1336 "json_y.tab.cpp" 1339 #line 109 "parser.y" 1345 #line 1346 "json_y.tab.cpp" 1349 #line 117 "parser.y" 1351 #line 1352 "json_y.tab.cpp" 1355 #line 119 "parser.y" 1357 #line 1358 "json_y.tab.cpp" 1361 #line 123 "parser.y" 1363 #line 1364 "json_y.tab.cpp" 1367 #line 125 "parser.y" 1369 #line 1370 "json_y.tab.cpp" 1373 #line 127 "parser.y" 1375 #line 1376 "json_y.tab.cpp" 1379 #line 1380 "json_y.tab.cpp" 1408 if (0 <= yystate && yystate <=
YYLAST &&
yycheck[yystate] == *yyssp)
1428 #if ! YYERROR_VERBOSE 1431 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 1434 char const *yymsgp =
YY_(
"syntax error");
1435 int yysyntax_error_status;
1437 if (yysyntax_error_status == 0)
1439 else if (yysyntax_error_status == 1)
1441 if (yymsg != yymsgbuf)
1447 yymsg_alloc =
sizeof yymsgbuf;
1448 yysyntax_error_status = 2;
1457 if (yysyntax_error_status == 2)
1458 goto yyexhaustedlab;
1460 # undef YYSYNTAX_ERROR 1466 if (yyerrstatus == 3)
1568 #if !defined yyoverflow || YYERROR_VERBOSE 1591 while (yyssp != yyss)
1602 if (yymsg != yymsgbuf)
static int yysyntax_error(size_t *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
#define YY_STACK_PRINT(Bottom, Top)
static const yytype_uint8 yyr2[]
static const yytype_int8 yypgoto[]
static const yytype_int8 yypact[]
int yyjsonerror(const std::string &error)
static const yytype_uint8 yydefact[]
void push(const jsont &x)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
static const yytype_int8 yycheck[]
static const char *const yytname[]
unsigned char yytype_uint8
static const yytype_int8 yydefgoto[]
void parse_error(const std::string &message, const std::string &before)
static size_t yytnamerr(char *yyres, const char *yystr)
unsigned short int yytype_uint16
#define YY_REDUCE_PRINT(Rule)
#define yypact_value_is_default(Yystate)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
static const yytype_uint8 yyr1[]
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
static size_t yystrlen(const char *yystr)
static const yytype_int8 yytable[]
unsigned char yytype_uint8
int yyjsonlex()
The main scanner function which does all the work.
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define YYSTACK_ALLOC_MAXIMUM
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
static std::string convert_TOK_NUMBER()
static const yytype_uint8 yystos[]
unsigned short int yytype_uint16
static std::string convert_TOK_STRING()
#define yytable_value_is_error(Yytable_value)
static char * yystpcpy(char *yydest, const char *yysrc)
static const yytype_uint8 yytranslate[]