cprover
json_y.tab.cpp
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.4.1. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
6  Inc.
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 
21 /* As a special exception, you may create a larger work that contains
22  part or all of the Bison parser skeleton and distribute that work
23  under terms of your choice, so long as that work isn't itself a
24  parser generator using the skeleton or a modified version thereof
25  as a parser skeleton. Alternatively, if you modify or redistribute
26  the parser skeleton itself, you may (at your option) remove this
27  special exception, which will cause the skeleton and the resulting
28  Bison output files to be licensed under the GNU General Public
29  License without this special exception.
30 
31  This special exception was added by the Free Software Foundation in
32  version 2.2 of Bison. */
33 
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35  simplifying the original so-called "semantic" parser. */
36 
37 /* All symbols defined below should begin with yy or YY, to avoid
38  infringing on user name space. This should be done even for local
39  variables, as they might otherwise be expanded by user macros.
40  There are some unavoidable exceptions within include files to
41  define necessary library symbols; they are noted "INFRINGES ON
42  USER NAME SPACE" below. */
43 
44 /* Undocumented macros, especially those whose name start with YY_,
45  are private implementation details. Do not rely on them. */
46 
47 /* Identify Bison output. */
48 #define YYBISON 1
49 
50 /* Bison version. */
51 #define YYBISON_VERSION "3.4.1"
52 
53 /* Skeleton name. */
54 #define YYSKELETON_NAME "yacc.c"
55 
56 /* Pure parsers. */
57 #define YYPURE 0
58 
59 /* Push parsers. */
60 #define YYPUSH 0
61 
62 /* Pull parsers. */
63 #define YYPULL 1
64 
65 
66 /* Substitute the variable and function names. */
67 #define yyparse yyjsonparse
68 #define yylex yyjsonlex
69 #define yyerror yyjsonerror
70 #define yydebug yyjsondebug
71 #define yynerrs yyjsonnerrs
72 
73 #define yylval yyjsonlval
74 #define yychar yyjsonchar
75 
76 /* First part of user prologue. */
77 #line 1 "parser.y"
78 
79 // Strictly follows http://www.json.org/
80 #line 5 "parser.y"
81 
82 #include "json_parser.h"
83 
84 int yyjsonlex();
85 extern char *yyjsontext;
86 extern int yyjsonleng; // really an int, not a size_t
87 
88 static std::string convert_TOK_STRING()
89 {
90  assert(yyjsontext[0]=='"');
91  std::size_t len=yyjsonleng;
92  assert(len>=2);
93  assert(yyjsontext[len-1]=='"');
94  std::string result;
95  result.reserve(len);
96  for(char *p=yyjsontext+1; *p!='"' && *p!=0; p++)
97  {
98  if(*p=='\\')
99  {
100  p++;
101  switch(*p)
102  {
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;
111  case 'u':
112  break;
113 
114  default:; /* an error */
115  }
116  }
117  else
118  result+=*p;
119  }
120 
121  return result;
122 }
123 
124 static std::string convert_TOK_NUMBER()
125 {
126  return yyjsontext;
127 }
128 
129 int yyjsonerror(const std::string &error)
130 {
132  return 0;
133 }
134 
135 
136 #line 137 "json_y.tab.cpp"
137 
138 # ifndef YY_NULLPTR
139 # if defined __cplusplus
140 # if 201103L <= __cplusplus
141 # define YY_NULLPTR nullptr
142 # else
143 # define YY_NULLPTR 0
144 # endif
145 # else
146 # define YY_NULLPTR ((void*)0)
147 # endif
148 # endif
149 
150 /* Enabling verbose error messages. */
151 #ifdef YYERROR_VERBOSE
152 # undef YYERROR_VERBOSE
153 # define YYERROR_VERBOSE 1
154 #else
155 # define YYERROR_VERBOSE 0
156 #endif
157 
158 /* Use api.header.include to #include this header
159  instead of duplicating it here. */
160 #ifndef YY_YYJSON_JSON_Y_TAB_HPP_INCLUDED
161 # define YY_YYJSON_JSON_Y_TAB_HPP_INCLUDED
162 /* Debug traces. */
163 #ifndef YYDEBUG
164 # define YYDEBUG 0
165 #endif
166 #if YYDEBUG
167 extern int yyjsondebug;
168 #endif
169 
170 /* Token type. */
171 #ifndef YYTOKENTYPE
172 # define YYTOKENTYPE
174  {
175  TOK_STRING = 258,
176  TOK_NUMBER = 259,
177  TOK_TRUE = 260,
178  TOK_FALSE = 261,
179  TOK_NULL = 262
180  };
181 #endif
182 /* Tokens. */
183 #define TOK_STRING 258
184 #define TOK_NUMBER 259
185 #define TOK_TRUE 260
186 #define TOK_FALSE 261
187 #define TOK_NULL 262
188 
189 /* Value type. */
190 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
191 typedef int YYSTYPE;
192 # define YYSTYPE_IS_TRIVIAL 1
193 # define YYSTYPE_IS_DECLARED 1
194 #endif
195 
196 
197 extern YYSTYPE yyjsonlval;
198 
199 int yyjsonparse (void);
200 
201 #endif /* !YY_YYJSON_JSON_Y_TAB_HPP_INCLUDED */
202 
203 
204 
205 #ifdef short
206 # undef short
207 #endif
208 
209 #ifdef YYTYPE_UINT8
210 typedef YYTYPE_UINT8 yytype_uint8;
211 #else
212 typedef unsigned char yytype_uint8;
213 #endif
214 
215 #ifdef YYTYPE_INT8
216 typedef YYTYPE_INT8 yytype_int8;
217 #else
218 typedef signed char yytype_int8;
219 #endif
220 
221 #ifdef YYTYPE_UINT16
222 typedef YYTYPE_UINT16 yytype_uint16;
223 #else
224 typedef unsigned short yytype_uint16;
225 #endif
226 
227 #ifdef YYTYPE_INT16
228 typedef YYTYPE_INT16 yytype_int16;
229 #else
230 typedef short yytype_int16;
231 #endif
232 
233 #ifndef YYSIZE_T
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
239 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
240 # define YYSIZE_T size_t
241 # else
242 # define YYSIZE_T unsigned
243 # endif
244 #endif
245 
246 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
247 
248 #ifndef YY_
249 # if defined YYENABLE_NLS && YYENABLE_NLS
250 # if ENABLE_NLS
251 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
252 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
253 # endif
254 # endif
255 # ifndef YY_
256 # define YY_(Msgid) Msgid
257 # endif
258 #endif
259 
260 #ifndef YY_ATTRIBUTE
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)
265 # else
266 # define YY_ATTRIBUTE(Spec) /* empty */
267 # endif
268 #endif
269 
270 #ifndef YY_ATTRIBUTE_PURE
271 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
272 #endif
273 
274 #ifndef YY_ATTRIBUTE_UNUSED
275 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
276 #endif
277 
278 /* Suppress unused-variable warnings by "using" E. */
279 #if ! defined lint || defined __GNUC__
280 # define YYUSE(E) ((void) (E))
281 #else
282 # define YYUSE(E) /* empty */
283 #endif
284 
285 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
286 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
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")
293 #else
294 # define YY_INITIAL_VALUE(Value) Value
295 #endif
296 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
297 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
298 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
299 #endif
300 #ifndef YY_INITIAL_VALUE
301 # define YY_INITIAL_VALUE(Value) /* Nothing. */
302 #endif
303 
304 
305 #define YY_ASSERT(E) ((void) (0 && (E)))
306 
307 #if ! defined yyoverflow || YYERROR_VERBOSE
308 
309 /* The parser invokes alloca or malloc; define the necessary symbols. */
310 
311 # ifdef YYSTACK_USE_ALLOCA
312 # if YYSTACK_USE_ALLOCA
313 # ifdef __GNUC__
314 # define YYSTACK_ALLOC __builtin_alloca
315 # elif defined __BUILTIN_VA_ARG_INCR
316 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
317 # elif defined _AIX
318 # define YYSTACK_ALLOC __alloca
319 # elif defined _MSC_VER
320 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
321 # define alloca _alloca
322 # else
323 # define YYSTACK_ALLOC alloca
324 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
325 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
326  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
327 # ifndef EXIT_SUCCESS
328 # define EXIT_SUCCESS 0
329 # endif
330 # endif
331 # endif
332 # endif
333 # endif
334 
335 # ifdef YYSTACK_ALLOC
336  /* Pacify GCC's 'empty if-body' warning. */
337 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
338 # ifndef YYSTACK_ALLOC_MAXIMUM
339  /* The OS might guarantee only one guard page at the bottom of the stack,
340  and a page size can be as small as 4096 bytes. So we cannot safely
341  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
342  to allow for a few compiler-allocated temporary stack slots. */
343 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
344 # endif
345 # else
346 # define YYSTACK_ALLOC YYMALLOC
347 # define YYSTACK_FREE YYFREE
348 # ifndef YYSTACK_ALLOC_MAXIMUM
349 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
350 # endif
351 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
352  && ! ((defined YYMALLOC || defined malloc) \
353  && (defined YYFREE || defined free)))
354 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
355 # ifndef EXIT_SUCCESS
356 # define EXIT_SUCCESS 0
357 # endif
358 # endif
359 # ifndef YYMALLOC
360 # define YYMALLOC malloc
361 # if ! defined malloc && ! defined EXIT_SUCCESS
362 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
363 # endif
364 # endif
365 # ifndef YYFREE
366 # define YYFREE free
367 # if ! defined free && ! defined EXIT_SUCCESS
368 void free (void *); /* INFRINGES ON USER NAME SPACE */
369 # endif
370 # endif
371 # endif
372 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
373 
374 
375 #if (! defined yyoverflow \
376  && (! defined __cplusplus \
377  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
378 
379 /* A type that is properly aligned for any stack member. */
380 union yyalloc
381 {
384 };
385 
386 /* The size of the maximum gap between one aligned stack and the next. */
387 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
388 
389 /* The size of an array large to enough to hold all stacks, each with
390  N elements. */
391 # define YYSTACK_BYTES(N) \
392  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
393  + YYSTACK_GAP_MAXIMUM)
394 
395 # define YYCOPY_NEEDED 1
396 
397 /* Relocate STACK from its old location to the new one. The
398  local variables YYSIZE and YYSTACKSIZE give the old and new number of
399  elements in the stack, and YYPTR gives the new location of the
400  stack. Advance YYPTR to a properly aligned location for the next
401  stack. */
402 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
403  do \
404  { \
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); \
410  } \
411  while (0)
412 
413 #endif
414 
415 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
416 /* Copy COUNT objects from SRC to DST. The source and destination do
417  not overlap. */
418 # ifndef YYCOPY
419 # if defined __GNUC__ && 1 < __GNUC__
420 # define YYCOPY(Dst, Src, Count) \
421  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
422 # else
423 # define YYCOPY(Dst, Src, Count) \
424  do \
425  { \
426  YYSIZE_T yyi; \
427  for (yyi = 0; yyi < (Count); yyi++) \
428  (Dst)[yyi] = (Src)[yyi]; \
429  } \
430  while (0)
431 # endif
432 # endif
433 #endif /* !YYCOPY_NEEDED */
434 
435 /* YYFINAL -- State number of the termination state. */
436 #define YYFINAL 16
437 /* YYLAST -- Last index in YYTABLE. */
438 #define YYLAST 30
439 
440 /* YYNTOKENS -- Number of terminals. */
441 #define YYNTOKENS 14
442 /* YYNNTS -- Number of nonterminals. */
443 #define YYNNTS 14
444 /* YYNRULES -- Number of rules. */
445 #define YYNRULES 24
446 /* YYNSTATES -- Number of states. */
447 #define YYNSTATES 34
448 
449 #define YYUNDEFTOK 2
450 #define YYMAXUTOK 262
451 
452 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
453  as returned by yylex, with out-of-bounds checking. */
454 #define YYTRANSLATE(YYX) \
455  ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
456 
457 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
458  as returned by yylex. */
459 static const yytype_uint8 yytranslate[] =
460 {
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,
487  5, 6, 7
488 };
489 
490 #if YYDEBUG
491  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
492 static const yytype_uint8 yyrline[] =
493 {
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
497 };
498 #endif
499 
500 #if YYDEBUG || YYERROR_VERBOSE || 0
501 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
502  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
503 static const char *const yytname[] =
504 {
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",
509  "array_value", "value", YY_NULLPTR
510 };
511 #endif
512 
513 # ifdef YYPRINT
514 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
515  (internal) symbol number NUM (which must be that of a token). */
516 static const yytype_uint16 yytoknum[] =
517 {
518  0, 256, 257, 258, 259, 260, 261, 262, 123, 125,
519  44, 58, 91, 93
520 };
521 # endif
522 
523 #define YYPACT_NINF -11
524 
525 #define yypact_value_is_default(Yystate) \
526  (!!((Yystate) == (-11)))
527 
528 #define YYTABLE_NINF -12
529 
530 #define yytable_value_is_error(Yytable_value) \
531  0
532 
533  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
534  STATE-NUM. */
535 static const yytype_int8 yypact[] =
536 {
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,
540  -2, -11, -11, -11
541 };
542 
543  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
544  Performed when YYTABLE does not specify something else to do. Zero
545  means the default is an error. */
546 static const yytype_uint8 yydefact[] =
547 {
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,
551  0, 8, 16, 10
552 };
553 
554  /* YYPGOTO[NTERM-NUM]. */
555 static const yytype_int8 yypgoto[] =
556 {
557  -11, -11, -11, -11, -11, -11, -10, -11, -11, -11,
558  -11, -11, -7, 0
559 };
560 
561  /* YYDEFGOTO[NTERM-NUM]. */
562 static const yytype_int8 yydefgoto[] =
563 {
564  -1, 8, 9, 12, 13, 19, 20, 25, 10, 14,
565  15, 22, 23, 24
566 };
567 
568  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
569  positive, shift that token. If negative, reduce the rule whose
570  number is the opposite. If YYTABLE_NINF, syntax error. */
571 static const yytype_int8 yytable[] =
572 {
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,
576  33
577 };
578 
579 static const yytype_int8 yycheck[] =
580 {
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,
584  30
585 };
586 
587  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
588  symbol of state STATE-NUM. */
589 static const yytype_uint8 yystos[] =
590 {
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,
594  11, 20, 26, 27
595 };
596 
597  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
598 static const yytype_uint8 yyr1[] =
599 {
600  0, 14, 15, 17, 16, 18, 16, 19, 19, 21,
601  20, 23, 22, 24, 22, 25, 25, 26, 27, 27,
602  27, 27, 27, 27, 27
603 };
604 
605  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
606 static const yytype_uint8 yyr2[] =
607 {
608  0, 2, 1, 0, 3, 0, 4, 1, 3, 0,
609  4, 0, 3, 0, 4, 1, 3, 1, 1, 1,
610  1, 1, 1, 1, 1
611 };
612 
613 
614 #define yyerrok (yyerrstatus = 0)
615 #define yyclearin (yychar = YYEMPTY)
616 #define YYEMPTY (-2)
617 #define YYEOF 0
618 
619 #define YYACCEPT goto yyacceptlab
620 #define YYABORT goto yyabortlab
621 #define YYERROR goto yyerrorlab
622 
623 
624 #define YYRECOVERING() (!!yyerrstatus)
625 
626 #define YYBACKUP(Token, Value) \
627  do \
628  if (yychar == YYEMPTY) \
629  { \
630  yychar = (Token); \
631  yylval = (Value); \
632  YYPOPSTACK (yylen); \
633  yystate = *yyssp; \
634  goto yybackup; \
635  } \
636  else \
637  { \
638  yyerror (YY_("syntax error: cannot back up")); \
639  YYERROR; \
640  } \
641  while (0)
642 
643 /* Error token number */
644 #define YYTERROR 1
645 #define YYERRCODE 256
646 
647 
648 
649 /* Enable debugging if requested. */
650 #if YYDEBUG
651 
652 # ifndef YYFPRINTF
653 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
654 # define YYFPRINTF fprintf
655 # endif
656 
657 # define YYDPRINTF(Args) \
658 do { \
659  if (yydebug) \
660  YYFPRINTF Args; \
661 } while (0)
662 
663 /* This macro is provided for backward compatibility. */
664 #ifndef YY_LOCATION_PRINT
665 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
666 #endif
667 
668 
669 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
670 do { \
671  if (yydebug) \
672  { \
673  YYFPRINTF (stderr, "%s ", Title); \
674  yy_symbol_print (stderr, \
675  Type, Value); \
676  YYFPRINTF (stderr, "\n"); \
677  } \
678 } while (0)
679 
680 
681 /*-----------------------------------.
682 | Print this symbol's value on YYO. |
683 `-----------------------------------*/
684 
685 static void
686 yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
687 {
688  FILE *yyoutput = yyo;
689  YYUSE (yyoutput);
690  if (!yyvaluep)
691  return;
692 # ifdef YYPRINT
693  if (yytype < YYNTOKENS)
694  YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
695 # endif
696  YYUSE (yytype);
697 }
698 
699 
700 /*---------------------------.
701 | Print this symbol on YYO. |
702 `---------------------------*/
703 
704 static void
705 yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
706 {
707  YYFPRINTF (yyo, "%s %s (",
708  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
709 
710  yy_symbol_value_print (yyo, yytype, yyvaluep);
711  YYFPRINTF (yyo, ")");
712 }
713 
714 /*------------------------------------------------------------------.
715 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
716 | TOP (included). |
717 `------------------------------------------------------------------*/
718 
719 static void
720 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
721 {
722  YYFPRINTF (stderr, "Stack now");
723  for (; yybottom <= yytop; yybottom++)
724  {
725  int yybot = *yybottom;
726  YYFPRINTF (stderr, " %d", yybot);
727  }
728  YYFPRINTF (stderr, "\n");
729 }
730 
731 # define YY_STACK_PRINT(Bottom, Top) \
732 do { \
733  if (yydebug) \
734  yy_stack_print ((Bottom), (Top)); \
735 } while (0)
736 
737 
738 /*------------------------------------------------.
739 | Report that the YYRULE is going to be reduced. |
740 `------------------------------------------------*/
741 
742 static void
743 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
744 {
745  unsigned long yylno = yyrline[yyrule];
746  int yynrhs = yyr2[yyrule];
747  int yyi;
748  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
749  yyrule - 1, yylno);
750  /* The symbols being reduced. */
751  for (yyi = 0; yyi < yynrhs; yyi++)
752  {
753  YYFPRINTF (stderr, " $%d = ", yyi + 1);
754  yy_symbol_print (stderr,
755  yystos[yyssp[yyi + 1 - yynrhs]],
756  &yyvsp[(yyi + 1) - (yynrhs)]
757  );
758  YYFPRINTF (stderr, "\n");
759  }
760 }
761 
762 # define YY_REDUCE_PRINT(Rule) \
763 do { \
764  if (yydebug) \
765  yy_reduce_print (yyssp, yyvsp, Rule); \
766 } while (0)
767 
768 /* Nonzero means print parse trace. It is left uninitialized so that
769  multiple parsers can coexist. */
770 int yydebug;
771 #else /* !YYDEBUG */
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)
776 #endif /* !YYDEBUG */
777 
778 
779 /* YYINITDEPTH -- initial size of the parser's stacks. */
780 #ifndef YYINITDEPTH
781 # define YYINITDEPTH 200
782 #endif
783 
784 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
785  if the built-in stack extension method is used).
786 
787  Do not make this value too large; the results are undefined if
788  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
789  evaluated with infinite-precision integer arithmetic. */
790 
791 #ifndef YYMAXDEPTH
792 # define YYMAXDEPTH 10000
793 #endif
794 
795 
796 #if YYERROR_VERBOSE
797 
798 # ifndef yystrlen
799 # if defined __GLIBC__ && defined _STRING_H
800 # define yystrlen strlen
801 # else
802 /* Return the length of YYSTR. */
803 static YYSIZE_T
804 yystrlen (const char *yystr)
805 {
806  YYSIZE_T yylen;
807  for (yylen = 0; yystr[yylen]; yylen++)
808  continue;
809  return yylen;
810 }
811 # endif
812 # endif
813 
814 # ifndef yystpcpy
815 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
816 # define yystpcpy stpcpy
817 # else
818 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
819  YYDEST. */
820 static char *
821 yystpcpy (char *yydest, const char *yysrc)
822 {
823  char *yyd = yydest;
824  const char *yys = yysrc;
825 
826  while ((*yyd++ = *yys++) != '\0')
827  continue;
828 
829  return yyd - 1;
830 }
831 # endif
832 # endif
833 
834 # ifndef yytnamerr
835 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
836  quotes and backslashes, so that it's suitable for yyerror. The
837  heuristic is that double-quoting is unnecessary unless the string
838  contains an apostrophe, a comma, or backslash (other than
839  backslash-backslash). YYSTR is taken from yytname. If YYRES is
840  null, do not copy; instead, return the length of what the result
841  would have been. */
842 static YYSIZE_T
843 yytnamerr (char *yyres, const char *yystr)
844 {
845  if (*yystr == '"')
846  {
847  YYSIZE_T yyn = 0;
848  char const *yyp = yystr;
849 
850  for (;;)
851  switch (*++yyp)
852  {
853  case '\'':
854  case ',':
855  goto do_not_strip_quotes;
856 
857  case '\\':
858  if (*++yyp != '\\')
859  goto do_not_strip_quotes;
860  else
861  goto append;
862 
863  append:
864  default:
865  if (yyres)
866  yyres[yyn] = *yyp;
867  yyn++;
868  break;
869 
870  case '"':
871  if (yyres)
872  yyres[yyn] = '\0';
873  return yyn;
874  }
875  do_not_strip_quotes: ;
876  }
877 
878  if (! yyres)
879  return yystrlen (yystr);
880 
881  return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
882 }
883 # endif
884 
885 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
886  about the unexpected token YYTOKEN for the state stack whose top is
887  YYSSP.
888 
889  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
890  not large enough to hold the message. In that case, also set
891  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
892  required number of bytes is too large to store. */
893 static int
894 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
895  yytype_int16 *yyssp, int yytoken)
896 {
897  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
898  YYSIZE_T yysize = yysize0;
899  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
900  /* Internationalized format string. */
901  const char *yyformat = YY_NULLPTR;
902  /* Arguments of yyformat. */
903  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
904  /* Number of reported tokens (one for the "unexpected", one per
905  "expected"). */
906  int yycount = 0;
907 
908  /* There are many possibilities here to consider:
909  - If this state is a consistent state with a default action, then
910  the only way this function was invoked is if the default action
911  is an error action. In that case, don't check for expected
912  tokens because there are none.
913  - The only way there can be no lookahead present (in yychar) is if
914  this state is a consistent state with a default action. Thus,
915  detecting the absence of a lookahead is sufficient to determine
916  that there is no unexpected or expected token to report. In that
917  case, just report a simple "syntax error".
918  - Don't assume there isn't a lookahead just because this state is a
919  consistent state with a default action. There might have been a
920  previous inconsistent state, consistent state with a non-default
921  action, or user semantic action that manipulated yychar.
922  - Of course, the expected token list depends on states to have
923  correct lookahead information, and it depends on the parser not
924  to perform extra reductions after fetching a lookahead from the
925  scanner and before detecting a syntax error. Thus, state merging
926  (from LALR or IELR) and default reductions corrupt the expected
927  token list. However, the list is correct for canonical LR with
928  one exception: it will still contain any token that will not be
929  accepted due to an error action in a later state.
930  */
931  if (yytoken != YYEMPTY)
932  {
933  int yyn = yypact[*yyssp];
934  yyarg[yycount++] = yytname[yytoken];
935  if (!yypact_value_is_default (yyn))
936  {
937  /* Start YYX at -YYN if negative to avoid negative indexes in
938  YYCHECK. In other words, skip the first -YYN actions for
939  this state because they are default actions. */
940  int yyxbegin = yyn < 0 ? -yyn : 0;
941  /* Stay within bounds of both yycheck and yytname. */
942  int yychecklim = YYLAST - yyn + 1;
943  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
944  int yyx;
945 
946  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
947  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
948  && !yytable_value_is_error (yytable[yyx + yyn]))
949  {
950  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
951  {
952  yycount = 1;
953  yysize = yysize0;
954  break;
955  }
956  yyarg[yycount++] = yytname[yyx];
957  {
958  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
959  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
960  yysize = yysize1;
961  else
962  return 2;
963  }
964  }
965  }
966  }
967 
968  switch (yycount)
969  {
970 # define YYCASE_(N, S) \
971  case N: \
972  yyformat = S; \
973  break
974  default: /* Avoid compiler warnings. */
975  YYCASE_(0, YY_("syntax error"));
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"));
981 # undef YYCASE_
982  }
983 
984  {
985  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
986  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
987  yysize = yysize1;
988  else
989  return 2;
990  }
991 
992  if (*yymsg_alloc < yysize)
993  {
994  *yymsg_alloc = 2 * yysize;
995  if (! (yysize <= *yymsg_alloc
996  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
997  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
998  return 1;
999  }
1000 
1001  /* Avoid sprintf, as that infringes on the user's name space.
1002  Don't have undefined behavior even if the translation
1003  produced a string with the wrong number of "%s"s. */
1004  {
1005  char *yyp = *yymsg;
1006  int yyi = 0;
1007  while ((*yyp = *yyformat) != '\0')
1008  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1009  {
1010  yyp += yytnamerr (yyp, yyarg[yyi++]);
1011  yyformat += 2;
1012  }
1013  else
1014  {
1015  yyp++;
1016  yyformat++;
1017  }
1018  }
1019  return 0;
1020 }
1021 #endif /* YYERROR_VERBOSE */
1022 
1023 /*-----------------------------------------------.
1024 | Release the memory associated to this symbol. |
1025 `-----------------------------------------------*/
1026 
1027 static void
1028 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1029 {
1030  YYUSE (yyvaluep);
1031  if (!yymsg)
1032  yymsg = "Deleting";
1033  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1034 
1036  YYUSE (yytype);
1038 }
1039 
1040 
1041 
1042 
1043 /* The lookahead symbol. */
1045 
1046 /* The semantic value of the lookahead symbol. */
1048 /* Number of syntax errors so far. */
1050 
1051 
1052 /*----------.
1053 | yyparse. |
1054 `----------*/
1055 
1056 int
1057 yyparse (void)
1058 {
1059  int yystate;
1060  /* Number of tokens to shift before error messages enabled. */
1061  int yyerrstatus;
1062 
1063  /* The stacks and their tools:
1064  'yyss': related to states.
1065  'yyvs': related to semantic values.
1066 
1067  Refer to the stacks through separate pointers, to allow yyoverflow
1068  to reallocate them elsewhere. */
1069 
1070  /* The state stack. */
1071  yytype_int16 yyssa[YYINITDEPTH];
1072  yytype_int16 *yyss;
1073  yytype_int16 *yyssp;
1074 
1075  /* The semantic value stack. */
1076  YYSTYPE yyvsa[YYINITDEPTH];
1077  YYSTYPE *yyvs;
1078  YYSTYPE *yyvsp;
1079 
1080  YYSIZE_T yystacksize;
1081 
1082  int yyn;
1083  int yyresult;
1084  /* Lookahead token as an internal (translated) token number. */
1085  int yytoken = 0;
1086  /* The variables used to return semantic value and location from the
1087  action routines. */
1088  YYSTYPE yyval;
1089 
1090 #if YYERROR_VERBOSE
1091  /* Buffer for error messages, and its allocated size. */
1092  char yymsgbuf[128];
1093  char *yymsg = yymsgbuf;
1094  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1095 #endif
1096 
1097 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1098 
1099  /* The number of symbols on the RHS of the reduced rule.
1100  Keep to zero when no symbol should be popped. */
1101  int yylen = 0;
1102 
1103  yyssp = yyss = yyssa;
1104  yyvsp = yyvs = yyvsa;
1105  yystacksize = YYINITDEPTH;
1106 
1107  YYDPRINTF ((stderr, "Starting parse\n"));
1108 
1109  yystate = 0;
1110  yyerrstatus = 0;
1111  yynerrs = 0;
1112  yychar = YYEMPTY; /* Cause a token to be read. */
1113  goto yysetstate;
1114 
1115 
1116 /*------------------------------------------------------------.
1117 | yynewstate -- push a new state, which is found in yystate. |
1118 `------------------------------------------------------------*/
1119 yynewstate:
1120  /* In all cases, when you get here, the value and location stacks
1121  have just been pushed. So pushing a state here evens the stacks. */
1122  yyssp++;
1123 
1124 
1125 /*--------------------------------------------------------------------.
1126 | yynewstate -- set current state (the top of the stack) to yystate. |
1127 `--------------------------------------------------------------------*/
1128 yysetstate:
1129  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1130  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1131  *yyssp = (yytype_int16) yystate;
1132 
1133  if (yyss + yystacksize - 1 <= yyssp)
1134 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1135  goto yyexhaustedlab;
1136 #else
1137  {
1138  /* Get the current used size of the three stacks, in elements. */
1139  YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
1140 
1141 # if defined yyoverflow
1142  {
1143  /* Give user a chance to reallocate the stack. Use copies of
1144  these so that the &'s don't force the real ones into
1145  memory. */
1146  YYSTYPE *yyvs1 = yyvs;
1147  yytype_int16 *yyss1 = yyss;
1148 
1149  /* Each stack pointer address is followed by the size of the
1150  data in use in that stack, in bytes. This used to be a
1151  conditional around just the two extra args, but that might
1152  be undefined if yyoverflow is a macro. */
1153  yyoverflow (YY_("memory exhausted"),
1154  &yyss1, yysize * sizeof (*yyssp),
1155  &yyvs1, yysize * sizeof (*yyvsp),
1156  &yystacksize);
1157  yyss = yyss1;
1158  yyvs = yyvs1;
1159  }
1160 # else /* defined YYSTACK_RELOCATE */
1161  /* Extend the stack our own way. */
1162  if (YYMAXDEPTH <= yystacksize)
1163  goto yyexhaustedlab;
1164  yystacksize *= 2;
1165  if (YYMAXDEPTH < yystacksize)
1166  yystacksize = YYMAXDEPTH;
1167 
1168  {
1169  yytype_int16 *yyss1 = yyss;
1170  union yyalloc *yyptr =
1171  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1172  if (! yyptr)
1173  goto yyexhaustedlab;
1174  YYSTACK_RELOCATE (yyss_alloc, yyss);
1175  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1176 # undef YYSTACK_RELOCATE
1177  if (yyss1 != yyssa)
1178  YYSTACK_FREE (yyss1);
1179  }
1180 # endif
1181 
1182  yyssp = yyss + yysize - 1;
1183  yyvsp = yyvs + yysize - 1;
1184 
1185  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1186  (unsigned long) yystacksize));
1187 
1188  if (yyss + yystacksize - 1 <= yyssp)
1189  YYABORT;
1190  }
1191 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1192 
1193  if (yystate == YYFINAL)
1194  YYACCEPT;
1195 
1196  goto yybackup;
1197 
1198 
1199 /*-----------.
1200 | yybackup. |
1201 `-----------*/
1202 yybackup:
1203  /* Do appropriate processing given the current state. Read a
1204  lookahead token if we need one and don't already have one. */
1205 
1206  /* First try to decide what to do without reference to lookahead token. */
1207  yyn = yypact[yystate];
1208  if (yypact_value_is_default (yyn))
1209  goto yydefault;
1210 
1211  /* Not known => get a lookahead token if don't already have one. */
1212 
1213  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1214  if (yychar == YYEMPTY)
1215  {
1216  YYDPRINTF ((stderr, "Reading a token: "));
1217  yychar = yylex ();
1218  }
1219 
1220  if (yychar <= YYEOF)
1221  {
1222  yychar = yytoken = YYEOF;
1223  YYDPRINTF ((stderr, "Now at end of input.\n"));
1224  }
1225  else
1226  {
1227  yytoken = YYTRANSLATE (yychar);
1228  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1229  }
1230 
1231  /* If the proper action on seeing token YYTOKEN is to reduce or to
1232  detect an error, take that action. */
1233  yyn += yytoken;
1234  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1235  goto yydefault;
1236  yyn = yytable[yyn];
1237  if (yyn <= 0)
1238  {
1239  if (yytable_value_is_error (yyn))
1240  goto yyerrlab;
1241  yyn = -yyn;
1242  goto yyreduce;
1243  }
1244 
1245  /* Count tokens shifted since error; after three, turn off error
1246  status. */
1247  if (yyerrstatus)
1248  yyerrstatus--;
1249 
1250  /* Shift the lookahead token. */
1251  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1252 
1253  /* Discard the shifted token. */
1254  yychar = YYEMPTY;
1255 
1256  yystate = yyn;
1258  *++yyvsp = yylval;
1260  goto yynewstate;
1261 
1262 
1263 /*-----------------------------------------------------------.
1264 | yydefault -- do the default action for the current state. |
1265 `-----------------------------------------------------------*/
1266 yydefault:
1267  yyn = yydefact[yystate];
1268  if (yyn == 0)
1269  goto yyerrlab;
1270  goto yyreduce;
1271 
1272 
1273 /*-----------------------------.
1274 | yyreduce -- do a reduction. |
1275 `-----------------------------*/
1276 yyreduce:
1277  /* yyn is the number of a rule to reduce with. */
1278  yylen = yyr2[yyn];
1279 
1280  /* If YYLEN is nonzero, implement the default value of the action:
1281  '$$ = $1'.
1282 
1283  Otherwise, the following line sets YYVAL to garbage.
1284  This behavior is undocumented and Bison
1285  users should not rely upon it. Assigning to YYVAL
1286  unconditionally makes the parser a bit smaller, and it avoids a
1287  GCC warning that YYVAL may be used uninitialized. */
1288  yyval = yyvsp[1-yylen];
1289 
1290 
1291  YY_REDUCE_PRINT (yyn);
1292  switch (yyn)
1293  {
1294  case 3:
1295 #line 72 "parser.y"
1296  { json_parser.push(json_objectt()); }
1297 #line 1298 "json_y.tab.cpp"
1298  break;
1299 
1300  case 5:
1301 #line 73 "parser.y"
1302  { json_parser.push(json_objectt()); }
1303 #line 1304 "json_y.tab.cpp"
1304  break;
1305 
1306  case 8:
1307 #line 79 "parser.y"
1308  {
1309  }
1310 #line 1311 "json_y.tab.cpp"
1311  break;
1312 
1313  case 9:
1314 #line 85 "parser.y"
1315  {
1316  // we abuse the 'value' to temporarily store the key
1318  }
1319 #line 1320 "json_y.tab.cpp"
1320  break;
1321 
1322  case 10:
1323 #line 90 "parser.y"
1324  {
1325  jsont tmp;
1326  json_parser.pop(tmp);
1327  json_parser.top().object[json_parser.top().value].swap(tmp);
1328  json_parser.top().value.clear(); // end abuse
1329  }
1330 #line 1331 "json_y.tab.cpp"
1331  break;
1332 
1333  case 11:
1334 #line 98 "parser.y"
1335  { json_parser.push(json_arrayt()); }
1336 #line 1337 "json_y.tab.cpp"
1337  break;
1338 
1339  case 13:
1340 #line 99 "parser.y"
1341  { json_parser.push(json_arrayt()); }
1342 #line 1343 "json_y.tab.cpp"
1343  break;
1344 
1345  case 17:
1346 #line 109 "parser.y"
1347  {
1348  jsont tmp;
1349  json_parser.pop(tmp);
1350  json_parser.top().array.push_back(tmp);
1351  }
1352 #line 1353 "json_y.tab.cpp"
1353  break;
1354 
1355  case 18:
1356 #line 117 "parser.y"
1358 #line 1359 "json_y.tab.cpp"
1359  break;
1360 
1361  case 19:
1362 #line 119 "parser.y"
1364 #line 1365 "json_y.tab.cpp"
1365  break;
1366 
1367  case 22:
1368 #line 123 "parser.y"
1369  { json_parser.push(json_truet()); }
1370 #line 1371 "json_y.tab.cpp"
1371  break;
1372 
1373  case 23:
1374 #line 125 "parser.y"
1375  { json_parser.push(json_falset()); }
1376 #line 1377 "json_y.tab.cpp"
1377  break;
1378 
1379  case 24:
1380 #line 127 "parser.y"
1381  { json_parser.push(json_nullt()); }
1382 #line 1383 "json_y.tab.cpp"
1383  break;
1384 
1385 
1386 #line 1387 "json_y.tab.cpp"
1387 
1388  default: break;
1389  }
1390  /* User semantic actions sometimes alter yychar, and that requires
1391  that yytoken be updated with the new translation. We take the
1392  approach of translating immediately before every use of yytoken.
1393  One alternative is translating here after every semantic action,
1394  but that translation would be missed if the semantic action invokes
1395  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1396  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1397  incorrect destructor might then be invoked immediately. In the
1398  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1399  to an incorrect destructor call or verbose syntax error message
1400  before the lookahead is translated. */
1401  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1402 
1403  YYPOPSTACK (yylen);
1404  yylen = 0;
1405  YY_STACK_PRINT (yyss, yyssp);
1406 
1407  *++yyvsp = yyval;
1408 
1409  /* Now 'shift' the result of the reduction. Determine what state
1410  that goes to, based on the state we popped back to and the rule
1411  number reduced by. */
1412  {
1413  const int yylhs = yyr1[yyn] - YYNTOKENS;
1414  const int yyi = yypgoto[yylhs] + *yyssp;
1415  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1416  ? yytable[yyi]
1417  : yydefgoto[yylhs]);
1418  }
1419 
1420  goto yynewstate;
1421 
1422 
1423 /*--------------------------------------.
1424 | yyerrlab -- here on detecting error. |
1425 `--------------------------------------*/
1426 yyerrlab:
1427  /* Make sure we have latest lookahead translation. See comments at
1428  user semantic actions for why this is necessary. */
1429  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1430 
1431  /* If not already recovering from an error, report this error. */
1432  if (!yyerrstatus)
1433  {
1434  ++yynerrs;
1435 #if ! YYERROR_VERBOSE
1436  yyerror (YY_("syntax error"));
1437 #else
1438 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1439  yyssp, yytoken)
1440  {
1441  char const *yymsgp = YY_("syntax error");
1442  int yysyntax_error_status;
1443  yysyntax_error_status = YYSYNTAX_ERROR;
1444  if (yysyntax_error_status == 0)
1445  yymsgp = yymsg;
1446  else if (yysyntax_error_status == 1)
1447  {
1448  if (yymsg != yymsgbuf)
1449  YYSTACK_FREE (yymsg);
1450  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1451  if (!yymsg)
1452  {
1453  yymsg = yymsgbuf;
1454  yymsg_alloc = sizeof yymsgbuf;
1455  yysyntax_error_status = 2;
1456  }
1457  else
1458  {
1459  yysyntax_error_status = YYSYNTAX_ERROR;
1460  yymsgp = yymsg;
1461  }
1462  }
1463  yyerror (yymsgp);
1464  if (yysyntax_error_status == 2)
1465  goto yyexhaustedlab;
1466  }
1467 # undef YYSYNTAX_ERROR
1468 #endif
1469  }
1470 
1471 
1472 
1473  if (yyerrstatus == 3)
1474  {
1475  /* If just tried and failed to reuse lookahead token after an
1476  error, discard it. */
1477 
1478  if (yychar <= YYEOF)
1479  {
1480  /* Return failure if at end of input. */
1481  if (yychar == YYEOF)
1482  YYABORT;
1483  }
1484  else
1485  {
1486  yydestruct ("Error: discarding",
1487  yytoken, &yylval);
1488  yychar = YYEMPTY;
1489  }
1490  }
1491 
1492  /* Else will try to reuse lookahead token after shifting the error
1493  token. */
1494  goto yyerrlab1;
1495 
1496 
1497 /*---------------------------------------------------.
1498 | yyerrorlab -- error raised explicitly by YYERROR. |
1499 `---------------------------------------------------*/
1500 yyerrorlab:
1501  /* Pacify compilers when the user code never invokes YYERROR and the
1502  label yyerrorlab therefore never appears in user code. */
1503  if (0)
1504  YYERROR;
1505 
1506  /* Do not reclaim the symbols of the rule whose action triggered
1507  this YYERROR. */
1508  YYPOPSTACK (yylen);
1509  yylen = 0;
1510  YY_STACK_PRINT (yyss, yyssp);
1511  yystate = *yyssp;
1512  goto yyerrlab1;
1513 
1514 
1515 /*-------------------------------------------------------------.
1516 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1517 `-------------------------------------------------------------*/
1518 yyerrlab1:
1519  yyerrstatus = 3; /* Each real token shifted decrements this. */
1520 
1521  for (;;)
1522  {
1523  yyn = yypact[yystate];
1524  if (!yypact_value_is_default (yyn))
1525  {
1526  yyn += YYTERROR;
1527  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1528  {
1529  yyn = yytable[yyn];
1530  if (0 < yyn)
1531  break;
1532  }
1533  }
1534 
1535  /* Pop the current state because it cannot handle the error token. */
1536  if (yyssp == yyss)
1537  YYABORT;
1538 
1539 
1540  yydestruct ("Error: popping",
1541  yystos[yystate], yyvsp);
1542  YYPOPSTACK (1);
1543  yystate = *yyssp;
1544  YY_STACK_PRINT (yyss, yyssp);
1545  }
1546 
1548  *++yyvsp = yylval;
1550 
1551 
1552  /* Shift the error token. */
1553  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1554 
1555  yystate = yyn;
1556  goto yynewstate;
1557 
1558 
1559 /*-------------------------------------.
1560 | yyacceptlab -- YYACCEPT comes here. |
1561 `-------------------------------------*/
1562 yyacceptlab:
1563  yyresult = 0;
1564  goto yyreturn;
1565 
1566 
1567 /*-----------------------------------.
1568 | yyabortlab -- YYABORT comes here. |
1569 `-----------------------------------*/
1570 yyabortlab:
1571  yyresult = 1;
1572  goto yyreturn;
1573 
1574 
1575 #if !defined yyoverflow || YYERROR_VERBOSE
1576 /*-------------------------------------------------.
1577 | yyexhaustedlab -- memory exhaustion comes here. |
1578 `-------------------------------------------------*/
1579 yyexhaustedlab:
1580  yyerror (YY_("memory exhausted"));
1581  yyresult = 2;
1582  /* Fall through. */
1583 #endif
1584 
1585 
1586 /*-----------------------------------------------------.
1587 | yyreturn -- parsing is finished, return the result. |
1588 `-----------------------------------------------------*/
1589 yyreturn:
1590  if (yychar != YYEMPTY)
1591  {
1592  /* Make sure we have latest lookahead translation. See comments at
1593  user semantic actions for why this is necessary. */
1594  yytoken = YYTRANSLATE (yychar);
1595  yydestruct ("Cleanup: discarding lookahead",
1596  yytoken, &yylval);
1597  }
1598  /* Do not reclaim the symbols of the rule whose action triggered
1599  this YYABORT or YYACCEPT. */
1600  YYPOPSTACK (yylen);
1601  YY_STACK_PRINT (yyss, yyssp);
1602  while (yyssp != yyss)
1603  {
1604  yydestruct ("Cleanup: popping",
1605  yystos[*yyssp], yyvsp);
1606  YYPOPSTACK (1);
1607  }
1608 #ifndef yyoverflow
1609  if (yyss != yyssa)
1610  YYSTACK_FREE (yyss);
1611 #endif
1612 #if YYERROR_VERBOSE
1613  if (yymsg != yymsgbuf)
1614  YYSTACK_FREE (yymsg);
1615 #endif
1616  return yyresult;
1617 }
yydebug
#define yydebug
Definition: json_y.tab.cpp:70
json_numbert
Definition: json.h:235
YYSYNTAX_ERROR
#define YYSYNTAX_ERROR
yylex
#define yylex
Definition: json_y.tab.cpp:68
json_truet
Definition: json.h:266
yytype_uint8
unsigned char yytype_uint8
Definition: json_y.tab.cpp:212
YYABORT
#define YYABORT
Definition: json_y.tab.cpp:620
YYSTACK_FREE
#define YYSTACK_FREE
Definition: json_y.tab.cpp:347
yytype_int16
short yytype_int16
Definition: json_y.tab.cpp:230
YYSTACK_RELOCATE
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: json_y.tab.cpp:402
json_parser
json_parsert json_parser
Definition: json_parser.cpp:13
jsont::object
objectt object
Definition: json.h:132
yyjsonlval
YYSTYPE yyjsonlval
Definition: json_y.tab.cpp:1047
yysyntax_error
static int yysyntax_error(size_t *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
Definition: jsil_y.tab.cpp:1238
YYCASE_
#define YYCASE_(N, S)
YYNSTATES
#define YYNSTATES
Definition: json_y.tab.cpp:447
yytype_int8
signed char yytype_int8
Definition: json_y.tab.cpp:218
YYFINAL
#define YYFINAL
Definition: json_y.tab.cpp:436
yytranslate
static const yytype_uint8 yytranslate[]
Definition: json_y.tab.cpp:459
TOK_NUMBER
#define TOK_NUMBER
Definition: json_y.tab.cpp:184
json_parsert::push
void push(const jsont &x)
Definition: json_parser.h:35
yyparse
#define yyparse
Definition: json_y.tab.cpp:67
yynerrs
#define yynerrs
Definition: json_y.tab.cpp:71
yytnamerr
static size_t yytnamerr(char *yyres, const char *yystr)
Definition: jsil_y.tab.cpp:1187
jsont
Definition: json.h:23
YYPOPSTACK
#define YYPOPSTACK(N)
yyalloc::yyss_alloc
yytype_int16 yyss_alloc
Definition: ansi_c_y.tab.cpp:741
json_arrayt
Definition: json.h:146
yyerror
#define yyerror
Definition: json_y.tab.cpp:69
json_objectt
Definition: json.h:244
json_parser.h
YYLAST
#define YYLAST
Definition: json_y.tab.cpp:438
YYSTYPE
Definition: xml_y.tab.cpp:166
convert_TOK_NUMBER
static std::string convert_TOK_NUMBER()
Definition: json_y.tab.cpp:124
yydefact
static const yytype_uint8 yydefact[]
Definition: json_y.tab.cpp:546
yytype_uint8
unsigned char yytype_uint8
Definition: ansi_c_y.tab.cpp:571
YY_NULLPTR
#define YY_NULLPTR
Definition: json_y.tab.cpp:146
YYSTACK_ALLOC_MAXIMUM
#define YYSTACK_ALLOC_MAXIMUM
Definition: json_y.tab.cpp:349
yytokentype
yytokentype
Definition: ansi_c_y.tab.h:50
yystos
static const yytype_uint8 yystos[]
Definition: json_y.tab.cpp:589
YYSIZE_T
#define YYSIZE_T
Definition: json_y.tab.cpp:240
YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: json_y.tab.cpp:298
yytname
static const char *const yytname[]
Definition: jsil_y.tab.cpp:592
yystrlen
static size_t yystrlen(const char *yystr)
Definition: jsil_y.tab.cpp:1148
YYDPRINTF
#define YYDPRINTF(Args)
Definition: json_y.tab.cpp:772
yypact
static const yytype_int8 yypact[]
Definition: json_y.tab.cpp:535
YYSTACK_BYTES
#define YYSTACK_BYTES(N)
Definition: json_y.tab.cpp:391
YY_SYMBOL_PRINT
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: json_y.tab.cpp:773
TOK_FALSE
#define TOK_FALSE
Definition: json_y.tab.cpp:186
yyjsonerror
int yyjsonerror(const std::string &error)
Definition: json_y.tab.cpp:129
yyr1
static const yytype_uint8 yyr1[]
Definition: json_y.tab.cpp:598
free
void free(void *)
YY_STACK_PRINT
#define YY_STACK_PRINT(Bottom, Top)
Definition: json_y.tab.cpp:774
convert_TOK_STRING
static std::string convert_TOK_STRING()
Definition: json_y.tab.cpp:88
json_falset
Definition: json.h:272
yyjsonparse
int yyjsonparse(void)
Definition: json_y.tab.cpp:1057
yyalloc::yyvs_alloc
YYSTYPE yyvs_alloc
Definition: json_y.tab.cpp:383
YYINITDEPTH
#define YYINITDEPTH
Definition: json_y.tab.cpp:781
YYNTOKENS
#define YYNTOKENS
Definition: json_y.tab.cpp:441
parsert::parse_error
void parse_error(const std::string &message, const std::string &before)
Definition: parser.cpp:30
YYTERROR
#define YYTERROR
Definition: json_y.tab.cpp:644
yyjsonleng
int yyjsonleng
Definition: json_lex.yy.cpp:530
yytable
static const yytype_int8 yytable[]
Definition: json_y.tab.cpp:571
yystpcpy
static char * yystpcpy(char *yydest, const char *yysrc)
Definition: jsil_y.tab.cpp:1165
yypact_value_is_default
#define yypact_value_is_default(Yystate)
Definition: json_y.tab.cpp:525
yydestruct
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Definition: json_y.tab.cpp:1028
yytype_int8
signed char yytype_int8
Definition: ansi_c_y.tab.cpp:577
TOK_NULL
#define TOK_NULL
Definition: json_y.tab.cpp:187
yyr2
static const yytype_uint8 yyr2[]
Definition: json_y.tab.cpp:606
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: json_y.tab.cpp:297
TOK_STRING
#define TOK_STRING
Definition: json_y.tab.cpp:183
jsont::array
arrayt array
Definition: json.h:129
YY_REDUCE_PRINT
#define YY_REDUCE_PRINT(Rule)
Definition: json_y.tab.cpp:775
YYSTYPE
int YYSTYPE
Definition: json_y.tab.cpp:191
malloc
void * malloc(size_t)
YYSTACK_ALLOC
#define YYSTACK_ALLOC
Definition: json_y.tab.cpp:346
YYEMPTY
#define YYEMPTY
Definition: json_y.tab.cpp:616
yydefgoto
static const yytype_int8 yydefgoto[]
Definition: json_y.tab.cpp:562
YYMAXDEPTH
#define YYMAXDEPTH
Definition: json_y.tab.cpp:792
yyalloc
Definition: ansi_c_y.tab.cpp:739
yychar
#define yychar
Definition: json_y.tab.cpp:74
json_parsert::pop
void pop(jsont &dest)
Definition: json_parser.h:40
YYTRANSLATE
#define YYTRANSLATE(YYX)
Definition: json_y.tab.cpp:454
yyjsonlex
int yyjsonlex()
The main scanner function which does all the work.
Definition: json_lex.yy.cpp:933
YYEOF
#define YYEOF
Definition: json_y.tab.cpp:617
YYERROR
#define YYERROR
Definition: json_y.tab.cpp:621
yypgoto
static const yytype_int8 yypgoto[]
Definition: json_y.tab.cpp:555
YY_
#define YY_(Msgid)
Definition: json_y.tab.cpp:256
yytype_uint16
unsigned short yytype_uint16
Definition: json_y.tab.cpp:224
yylval
#define yylval
Definition: json_y.tab.cpp:73
YYUSE
#define YYUSE(E)
Definition: json_y.tab.cpp:280
yyjsontext
char * yyjsontext
Definition: json_lex.yy.cpp:732
yytype_uint16
unsigned short yytype_uint16
Definition: ansi_c_y.tab.cpp:583
json_nullt
Definition: json.h:278
json_parsert::top
jsont & top()
Definition: json_parser.h:28
YYACCEPT
#define YYACCEPT
Definition: json_y.tab.cpp:619
yytype_int16
short yytype_int16
Definition: ansi_c_y.tab.cpp:589
yytable_value_is_error
#define yytable_value_is_error(Yytable_value)
Definition: json_y.tab.cpp:530
TOK_TRUE
#define TOK_TRUE
Definition: json_y.tab.cpp:185
YY_ASSERT
#define YY_ASSERT(E)
Definition: json_y.tab.cpp:305
json_stringt
Definition: json.h:214
jsont::value
std::string value
Definition: json.h:137
yycheck
static const yytype_int8 yycheck[]
Definition: json_y.tab.cpp:579