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