cprover
json_y.tab.cpp
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.6.4. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 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 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38  especially those whose name start with YY_ or yy_. They are
39  private implementation details that can be changed or removed. */
40 
41 /* All symbols defined below should begin with yy or YY, to avoid
42  infringing on user name space. This should be done even for local
43  variables, as they might otherwise be expanded by user macros.
44  There are some unavoidable exceptions within include files to
45  define necessary library symbols; they are noted "INFRINGES ON
46  USER NAME SPACE" below. */
47 
48 /* Identify Bison output. */
49 #define YYBISON 1
50 
51 /* Bison version. */
52 #define YYBISON_VERSION "3.6.4"
53 
54 /* Skeleton name. */
55 #define YYSKELETON_NAME "yacc.c"
56 
57 /* Pure parsers. */
58 #define YYPURE 0
59 
60 /* Push parsers. */
61 #define YYPUSH 0
62 
63 /* Pull parsers. */
64 #define YYPULL 1
65 
66 
67 /* Substitute the variable and function names. */
68 #define yyparse yyjsonparse
69 #define yylex yyjsonlex
70 #define yyerror yyjsonerror
71 #define yydebug yyjsondebug
72 #define yynerrs yyjsonnerrs
73 #define yylval yyjsonlval
74 #define yychar yyjsonchar
75 
76 /* First part of user prologue. */
77 #line 1 "parser.y"
78 
79 #ifdef _MSC_VER
80 // possible loss of data
81 #pragma warning(disable:4242)
82 // possible loss of data
83 #pragma warning(disable:4244)
84 // signed/unsigned mismatch
85 #pragma warning(disable:4365)
86 // switch with default but no case labels
87 #pragma warning(disable:4065)
88 // unreachable code
89 #pragma warning(disable:4702)
90 #endif
91 
92 // Strictly follows http://www.json.org/
93 #line 18 "parser.y"
94 
95 #include "json_parser.h"
96 
97 #include <util/unicode.h>
98 
99 int yyjsonlex();
100 extern char *yyjsontext;
101 extern int yyjsonleng; // really an int, not a size_t
102 
103 static std::string convert_TOK_STRING()
104 {
105  assert(yyjsontext[0]=='"');
106  std::size_t len=yyjsonleng;
107  assert(len>=2);
108  assert(yyjsontext[len-1]=='"');
109  std::string result;
110  result.reserve(len);
111  for(char *p=yyjsontext+1; *p!='"' && *p!=0; p++)
112  {
113  if(*p=='\\')
114  {
115  p++;
116  switch(*p)
117  {
118  case '"': result+='"'; break;
119  case '\\': result+='\\'; break;
120  case '/': result+='/'; break;
121  case 'b': result+='\b'; break;
122  case 'f': result+='\f'; break;
123  case 'n': result+='\n'; break;
124  case 'r': result+='\r'; break;
125  case 't': result+='\t'; break;
126  case 'u':
127  {
128  // Character in hexadecimal Unicode representation, in the format
129  // \uABCD, i.e. the following four digits are part of this character.
130  char *last_hex_digit = p + 4;
131  assert(last_hex_digit < yyjsontext + len - 1);
132  std::string hex(++p, 4);
133  result += codepoint_hex_to_utf8(hex);
134  p = last_hex_digit;
135  break;
136  }
137  default:; /* an error */
138  }
139  }
140  else
141  result+=*p;
142  }
143 
144  return result;
145 }
146 
147 static std::string convert_TOK_NUMBER()
148 {
149  return yyjsontext;
150 }
151 
152 int yyjsonerror(const std::string &error)
153 {
155  return 0;
156 }
157 
158 
159 #line 160 "json_y.tab.cpp"
160 
161 # ifndef YY_CAST
162 # ifdef __cplusplus
163 # define YY_CAST(Type, Val) static_cast<Type> (Val)
164 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
165 # else
166 # define YY_CAST(Type, Val) ((Type) (Val))
167 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
168 # endif
169 # endif
170 # ifndef YY_NULLPTR
171 # if defined __cplusplus
172 # if 201103L <= __cplusplus
173 # define YY_NULLPTR nullptr
174 # else
175 # define YY_NULLPTR 0
176 # endif
177 # else
178 # define YY_NULLPTR ((void*)0)
179 # endif
180 # endif
181 
182 /* Use api.header.include to #include this header
183  instead of duplicating it here. */
184 #ifndef YY_YYJSON_JSON_Y_TAB_H_INCLUDED
185 # define YY_YYJSON_JSON_Y_TAB_H_INCLUDED
186 /* Debug traces. */
187 #ifndef YYDEBUG
188 # define YYDEBUG 0
189 #endif
190 #if YYDEBUG
191 extern int yyjsondebug;
192 #endif
193 
194 /* Token kinds. */
195 #ifndef YYTOKENTYPE
196 # define YYTOKENTYPE
198  {
199  YYEMPTY = -2,
200  YYEOF = 0, /* "end of file" */
201  YYerror = 256, /* error */
202  YYUNDEF = 257, /* "invalid token" */
203  TOK_STRING = 258, /* TOK_STRING */
204  TOK_NUMBER = 259, /* TOK_NUMBER */
205  TOK_TRUE = 260, /* TOK_TRUE */
206  TOK_FALSE = 261, /* TOK_FALSE */
207  TOK_NULL = 262 /* TOK_NULL */
208  };
209  typedef enum yytokentype yytoken_kind_t;
210 #endif
211 
212 /* Value type. */
213 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
214 typedef int YYSTYPE;
215 # define YYSTYPE_IS_TRIVIAL 1
216 # define YYSTYPE_IS_DECLARED 1
217 #endif
218 
219 
220 extern YYSTYPE yyjsonlval;
221 
222 int yyjsonparse (void);
223 
224 #endif /* !YY_YYJSON_JSON_Y_TAB_H_INCLUDED */
225 /* Symbol kind. */
227 {
229  YYSYMBOL_YYEOF = 0, /* "end of file" */
230  YYSYMBOL_YYerror = 1, /* error */
231  YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
232  YYSYMBOL_TOK_STRING = 3, /* TOK_STRING */
233  YYSYMBOL_TOK_NUMBER = 4, /* TOK_NUMBER */
234  YYSYMBOL_TOK_TRUE = 5, /* TOK_TRUE */
235  YYSYMBOL_TOK_FALSE = 6, /* TOK_FALSE */
236  YYSYMBOL_TOK_NULL = 7, /* TOK_NULL */
237  YYSYMBOL_8_ = 8, /* '{' */
238  YYSYMBOL_9_ = 9, /* '}' */
239  YYSYMBOL_10_ = 10, /* ',' */
240  YYSYMBOL_11_ = 11, /* ':' */
241  YYSYMBOL_12_ = 12, /* '[' */
242  YYSYMBOL_13_ = 13, /* ']' */
243  YYSYMBOL_YYACCEPT = 14, /* $accept */
244  YYSYMBOL_document = 15, /* document */
245  YYSYMBOL_object = 16, /* object */
246  YYSYMBOL_17_1 = 17, /* $@1 */
247  YYSYMBOL_18_2 = 18, /* $@2 */
248  YYSYMBOL_key_value_sequence = 19, /* key_value_sequence */
249  YYSYMBOL_key_value_pair = 20, /* key_value_pair */
250  YYSYMBOL_21_3 = 21, /* $@3 */
251  YYSYMBOL_array = 22, /* array */
252  YYSYMBOL_23_4 = 23, /* $@4 */
253  YYSYMBOL_24_5 = 24, /* $@5 */
254  YYSYMBOL_array_value_sequence = 25, /* array_value_sequence */
255  YYSYMBOL_array_value = 26, /* array_value */
256  YYSYMBOL_value = 27 /* value */
257 };
258 typedef enum yysymbol_kind_t yysymbol_kind_t;
259 
260 
261 
262 
263 #ifdef short
264 # undef short
265 #endif
266 
267 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
268  <limits.h> and (if available) <stdint.h> are included
269  so that the code can choose integer types of a good width. */
270 
271 #ifndef __PTRDIFF_MAX__
272 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
273 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
274 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
275 # define YY_STDINT_H
276 # endif
277 #endif
278 
279 /* Narrow types that promote to a signed type and that can represent a
280  signed or unsigned integer of at least N bits. In tables they can
281  save space and decrease cache pressure. Promoting to a signed type
282  helps avoid bugs in integer arithmetic. */
283 
284 #ifdef __INT_LEAST8_MAX__
285 typedef __INT_LEAST8_TYPE__ yytype_int8;
286 #elif defined YY_STDINT_H
287 typedef int_least8_t yytype_int8;
288 #else
289 typedef signed char yytype_int8;
290 #endif
291 
292 #ifdef __INT_LEAST16_MAX__
293 typedef __INT_LEAST16_TYPE__ yytype_int16;
294 #elif defined YY_STDINT_H
295 typedef int_least16_t yytype_int16;
296 #else
297 typedef short yytype_int16;
298 #endif
299 
300 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
301 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
302 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
303  && UINT_LEAST8_MAX <= INT_MAX)
304 typedef uint_least8_t yytype_uint8;
305 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
306 typedef unsigned char yytype_uint8;
307 #else
308 typedef short yytype_uint8;
309 #endif
310 
311 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
312 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
313 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
314  && UINT_LEAST16_MAX <= INT_MAX)
315 typedef uint_least16_t yytype_uint16;
316 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
317 typedef unsigned short yytype_uint16;
318 #else
319 typedef int yytype_uint16;
320 #endif
321 
322 #ifndef YYPTRDIFF_T
323 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
324 # define YYPTRDIFF_T __PTRDIFF_TYPE__
325 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
326 # elif defined PTRDIFF_MAX
327 # ifndef ptrdiff_t
328 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
329 # endif
330 # define YYPTRDIFF_T ptrdiff_t
331 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
332 # else
333 # define YYPTRDIFF_T long
334 # define YYPTRDIFF_MAXIMUM LONG_MAX
335 # endif
336 #endif
337 
338 #ifndef YYSIZE_T
339 # ifdef __SIZE_TYPE__
340 # define YYSIZE_T __SIZE_TYPE__
341 # elif defined size_t
342 # define YYSIZE_T size_t
343 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
344 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
345 # define YYSIZE_T size_t
346 # else
347 # define YYSIZE_T unsigned
348 # endif
349 #endif
350 
351 #define YYSIZE_MAXIMUM \
352  YY_CAST (YYPTRDIFF_T, \
353  (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
354  ? YYPTRDIFF_MAXIMUM \
355  : YY_CAST (YYSIZE_T, -1)))
356 
357 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
358 
359 
360 /* Stored state numbers (used for stacks). */
362 
363 /* State numbers in computations. */
364 typedef int yy_state_fast_t;
365 
366 #ifndef YY_
367 # if defined YYENABLE_NLS && YYENABLE_NLS
368 # if ENABLE_NLS
369 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
370 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
371 # endif
372 # endif
373 # ifndef YY_
374 # define YY_(Msgid) Msgid
375 # endif
376 #endif
377 
378 
379 #ifndef YY_ATTRIBUTE_PURE
380 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
381 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
382 # else
383 # define YY_ATTRIBUTE_PURE
384 # endif
385 #endif
386 
387 #ifndef YY_ATTRIBUTE_UNUSED
388 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
389 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
390 # else
391 # define YY_ATTRIBUTE_UNUSED
392 # endif
393 #endif
394 
395 /* Suppress unused-variable warnings by "using" E. */
396 #if ! defined lint || defined __GNUC__
397 # define YYUSE(E) ((void) (E))
398 #else
399 # define YYUSE(E) /* empty */
400 #endif
401 
402 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
403 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
404 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
405  _Pragma ("GCC diagnostic push") \
406  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
407  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
408 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
409  _Pragma ("GCC diagnostic pop")
410 #else
411 # define YY_INITIAL_VALUE(Value) Value
412 #endif
413 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
414 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
415 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
416 #endif
417 #ifndef YY_INITIAL_VALUE
418 # define YY_INITIAL_VALUE(Value) /* Nothing. */
419 #endif
420 
421 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
422 # define YY_IGNORE_USELESS_CAST_BEGIN \
423  _Pragma ("GCC diagnostic push") \
424  _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
425 # define YY_IGNORE_USELESS_CAST_END \
426  _Pragma ("GCC diagnostic pop")
427 #endif
428 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
429 # define YY_IGNORE_USELESS_CAST_BEGIN
430 # define YY_IGNORE_USELESS_CAST_END
431 #endif
432 
433 
434 #define YY_ASSERT(E) ((void) (0 && (E)))
435 
436 #if !defined yyoverflow
437 
438 /* The parser invokes alloca or malloc; define the necessary symbols. */
439 
440 # ifdef YYSTACK_USE_ALLOCA
441 # if YYSTACK_USE_ALLOCA
442 # ifdef __GNUC__
443 # define YYSTACK_ALLOC __builtin_alloca
444 # elif defined __BUILTIN_VA_ARG_INCR
445 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
446 # elif defined _AIX
447 # define YYSTACK_ALLOC __alloca
448 # elif defined _MSC_VER
449 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
450 # define alloca _alloca
451 # else
452 # define YYSTACK_ALLOC alloca
453 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
454 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
455  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
456 # ifndef EXIT_SUCCESS
457 # define EXIT_SUCCESS 0
458 # endif
459 # endif
460 # endif
461 # endif
462 # endif
463 
464 # ifdef YYSTACK_ALLOC
465  /* Pacify GCC's 'empty if-body' warning. */
466 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
467 # ifndef YYSTACK_ALLOC_MAXIMUM
468  /* The OS might guarantee only one guard page at the bottom of the stack,
469  and a page size can be as small as 4096 bytes. So we cannot safely
470  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
471  to allow for a few compiler-allocated temporary stack slots. */
472 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
473 # endif
474 # else
475 # define YYSTACK_ALLOC YYMALLOC
476 # define YYSTACK_FREE YYFREE
477 # ifndef YYSTACK_ALLOC_MAXIMUM
478 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
479 # endif
480 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
481  && ! ((defined YYMALLOC || defined malloc) \
482  && (defined YYFREE || defined free)))
483 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
484 # ifndef EXIT_SUCCESS
485 # define EXIT_SUCCESS 0
486 # endif
487 # endif
488 # ifndef YYMALLOC
489 # define YYMALLOC malloc
490 # if ! defined malloc && ! defined EXIT_SUCCESS
491 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
492 # endif
493 # endif
494 # ifndef YYFREE
495 # define YYFREE free
496 # if ! defined free && ! defined EXIT_SUCCESS
497 void free (void *); /* INFRINGES ON USER NAME SPACE */
498 # endif
499 # endif
500 # endif
501 #endif /* !defined yyoverflow */
502 
503 #if (! defined yyoverflow \
504  && (! defined __cplusplus \
505  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
506 
507 /* A type that is properly aligned for any stack member. */
508 union yyalloc
509 {
512 };
513 
514 /* The size of the maximum gap between one aligned stack and the next. */
515 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
516 
517 /* The size of an array large to enough to hold all stacks, each with
518  N elements. */
519 # define YYSTACK_BYTES(N) \
520  ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
521  + YYSTACK_GAP_MAXIMUM)
522 
523 # define YYCOPY_NEEDED 1
524 
525 /* Relocate STACK from its old location to the new one. The
526  local variables YYSIZE and YYSTACKSIZE give the old and new number of
527  elements in the stack, and YYPTR gives the new location of the
528  stack. Advance YYPTR to a properly aligned location for the next
529  stack. */
530 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
531  do \
532  { \
533  YYPTRDIFF_T yynewbytes; \
534  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
535  Stack = &yyptr->Stack_alloc; \
536  yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
537  yyptr += yynewbytes / YYSIZEOF (*yyptr); \
538  } \
539  while (0)
540 
541 #endif
542 
543 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
544 /* Copy COUNT objects from SRC to DST. The source and destination do
545  not overlap. */
546 # ifndef YYCOPY
547 # if defined __GNUC__ && 1 < __GNUC__
548 # define YYCOPY(Dst, Src, Count) \
549  __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
550 # else
551 # define YYCOPY(Dst, Src, Count) \
552  do \
553  { \
554  YYPTRDIFF_T yyi; \
555  for (yyi = 0; yyi < (Count); yyi++) \
556  (Dst)[yyi] = (Src)[yyi]; \
557  } \
558  while (0)
559 # endif
560 # endif
561 #endif /* !YYCOPY_NEEDED */
562 
563 /* YYFINAL -- State number of the termination state. */
564 #define YYFINAL 16
565 /* YYLAST -- Last index in YYTABLE. */
566 #define YYLAST 30
567 
568 /* YYNTOKENS -- Number of terminals. */
569 #define YYNTOKENS 14
570 /* YYNNTS -- Number of nonterminals. */
571 #define YYNNTS 14
572 /* YYNRULES -- Number of rules. */
573 #define YYNRULES 24
574 /* YYNSTATES -- Number of states. */
575 #define YYNSTATES 34
576 
577 #define YYMAXUTOK 262
578 
579 
580 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
581  as returned by yylex, with out-of-bounds checking. */
582 #define YYTRANSLATE(YYX) \
583  (0 <= (YYX) && (YYX) <= YYMAXUTOK \
584  ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
585  : YYSYMBOL_YYUNDEF)
586 
587 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
588  as returned by yylex. */
589 static const yytype_int8 yytranslate[] =
590 {
591  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595  2, 2, 2, 2, 10, 2, 2, 2, 2, 2,
596  2, 2, 2, 2, 2, 2, 2, 2, 11, 2,
597  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600  2, 12, 2, 13, 2, 2, 2, 2, 2, 2,
601  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603  2, 2, 2, 8, 2, 9, 2, 2, 2, 2,
604  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
617  5, 6, 7
618 };
619 
620 #if YYDEBUG
621  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
622 static const yytype_uint8 yyrline[] =
623 {
624  0, 92, 92, 95, 95, 96, 96, 100, 101, 108,
625  107, 121, 121, 122, 122, 126, 127, 131, 139, 141,
626  143, 144, 145, 147, 149
627 };
628 #endif
629 
631 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
632 
633 #if YYDEBUG || 0
634 /* The user-facing name of the symbol whose (internal) number is
635  YYSYMBOL. No bounds checking. */
636 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
637 
638 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
639  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
640 static const char *const yytname[] =
641 {
642  "\"end of file\"", "error", "\"invalid token\"", "TOK_STRING",
643  "TOK_NUMBER", "TOK_TRUE", "TOK_FALSE", "TOK_NULL", "'{'", "'}'", "','",
644  "':'", "'['", "']'", "$accept", "document", "object", "$@1", "$@2",
645  "key_value_sequence", "key_value_pair", "$@3", "array", "$@4", "$@5",
646  "array_value_sequence", "array_value", "value", YY_NULLPTR
647 };
648 
649 static const char *
650 yysymbol_name (yysymbol_kind_t yysymbol)
651 {
652  return yytname[yysymbol];
653 }
654 #endif
655 
656 #ifdef YYPRINT
657 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
658  (internal) symbol number NUM (which must be that of a token). */
659 static const yytype_int16 yytoknum[] =
660 {
661  0, 256, 257, 258, 259, 260, 261, 262, 123, 125,
662  44, 58, 91, 93
663 };
664 #endif
665 
666 #define YYPACT_NINF (-11)
667 
668 #define yypact_value_is_default(Yyn) \
669  ((Yyn) == YYPACT_NINF)
670 
671 #define YYTABLE_NINF (-12)
672 
673 #define yytable_value_is_error(Yyn) \
674  0
675 
676  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
677  STATE-NUM. */
678 static const yytype_int8 yypact[] =
679 {
680  -2, -11, -11, -11, -11, -11, 5, -6, 11, -11,
681  -11, -11, 6, 13, 7, -2, -11, -11, -11, 4,
682  -11, -11, -1, -11, -11, 8, -11, 13, -2, -11,
683  -2, -11, -11, -11
684 };
685 
686  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
687  Performed when YYTABLE does not specify something else to do. Zero
688  means the default is an error. */
689 static const yytype_int8 yydefact[] =
690 {
691  0, 18, 19, 22, 23, 24, 3, 13, 0, 20,
692  21, 2, 0, 0, 0, 0, 1, 4, 9, 0,
693  7, 12, 0, 15, 17, 0, 6, 0, 0, 14,
694  0, 8, 16, 10
695 };
696 
697  /* YYPGOTO[NTERM-NUM]. */
698 static const yytype_int8 yypgoto[] =
699 {
700  -11, -11, -11, -11, -11, -11, -10, -11, -11, -11,
701  -11, -11, -7, 0
702 };
703 
704  /* YYDEFGOTO[NTERM-NUM]. */
705 static const yytype_int8 yydefgoto[] =
706 {
707  -1, 8, 9, 12, 13, 19, 20, 25, 10, 14,
708  15, 22, 23, 24
709 };
710 
711  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
712  positive, shift that token. If negative, reduce the rule whose
713  number is the opposite. If YYTABLE_NINF, syntax error. */
714 static const yytype_int8 yytable[] =
715 {
716  11, 1, 2, 3, 4, 5, 6, -11, -5, 28,
717  7, 16, 29, 26, 27, 17, 18, 31, 0, 30,
718  21, 32, 0, 0, 0, 0, 0, 0, 0, 0,
719  33
720 };
721 
722 static const yytype_int8 yycheck[] =
723 {
724  0, 3, 4, 5, 6, 7, 8, 13, 3, 10,
725  12, 0, 13, 9, 10, 9, 3, 27, -1, 11,
726  13, 28, -1, -1, -1, -1, -1, -1, -1, -1,
727  30
728 };
729 
730  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
731  symbol of state STATE-NUM. */
732 static const yytype_int8 yystos[] =
733 {
734  0, 3, 4, 5, 6, 7, 8, 12, 15, 16,
735  22, 27, 17, 18, 23, 24, 0, 9, 3, 19,
736  20, 13, 25, 26, 27, 21, 9, 10, 10, 13,
737  11, 20, 26, 27
738 };
739 
740  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
741 static const yytype_int8 yyr1[] =
742 {
743  0, 14, 15, 17, 16, 18, 16, 19, 19, 21,
744  20, 23, 22, 24, 22, 25, 25, 26, 27, 27,
745  27, 27, 27, 27, 27
746 };
747 
748  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
749 static const yytype_int8 yyr2[] =
750 {
751  0, 2, 1, 0, 3, 0, 4, 1, 3, 0,
752  4, 0, 3, 0, 4, 1, 3, 1, 1, 1,
753  1, 1, 1, 1, 1
754 };
755 
756 
757 enum { YYENOMEM = -2 };
758 
759 #define yyerrok (yyerrstatus = 0)
760 #define yyclearin (yychar = YYEMPTY)
761 
762 #define YYACCEPT goto yyacceptlab
763 #define YYABORT goto yyabortlab
764 #define YYERROR goto yyerrorlab
765 
766 
767 #define YYRECOVERING() (!!yyerrstatus)
768 
769 #define YYBACKUP(Token, Value) \
770  do \
771  if (yychar == YYEMPTY) \
772  { \
773  yychar = (Token); \
774  yylval = (Value); \
775  YYPOPSTACK (yylen); \
776  yystate = *yyssp; \
777  goto yybackup; \
778  } \
779  else \
780  { \
781  yyerror (YY_("syntax error: cannot back up")); \
782  YYERROR; \
783  } \
784  while (0)
785 
786 /* Backward compatibility with an undocumented macro.
787  Use YYerror or YYUNDEF. */
788 #define YYERRCODE YYUNDEF
789 
790 
791 /* Enable debugging if requested. */
792 #if YYDEBUG
793 
794 # ifndef YYFPRINTF
795 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
796 # define YYFPRINTF fprintf
797 # endif
798 
799 # define YYDPRINTF(Args) \
800 do { \
801  if (yydebug) \
802  YYFPRINTF Args; \
803 } while (0)
804 
805 /* This macro is provided for backward compatibility. */
806 # ifndef YY_LOCATION_PRINT
807 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
808 # endif
809 
810 
811 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
812 do { \
813  if (yydebug) \
814  { \
815  YYFPRINTF (stderr, "%s ", Title); \
816  yy_symbol_print (stderr, \
817  Kind, Value); \
818  YYFPRINTF (stderr, "\n"); \
819  } \
820 } while (0)
821 
822 
823 /*-----------------------------------.
824 | Print this symbol's value on YYO. |
825 `-----------------------------------*/
826 
827 static void
828 yy_symbol_value_print (FILE *yyo,
829  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
830 {
831  FILE *yyoutput = yyo;
832  YYUSE (yyoutput);
833  if (!yyvaluep)
834  return;
835 # ifdef YYPRINT
836  if (yykind < YYNTOKENS)
837  YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
838 # endif
840  YYUSE (yykind);
842 }
843 
844 
845 /*---------------------------.
846 | Print this symbol on YYO. |
847 `---------------------------*/
848 
849 static void
850 yy_symbol_print (FILE *yyo,
851  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
852 {
853  YYFPRINTF (yyo, "%s %s (",
854  yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
855 
856  yy_symbol_value_print (yyo, yykind, yyvaluep);
857  YYFPRINTF (yyo, ")");
858 }
859 
860 /*------------------------------------------------------------------.
861 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
862 | TOP (included). |
863 `------------------------------------------------------------------*/
864 
865 static void
866 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
867 {
868  YYFPRINTF (stderr, "Stack now");
869  for (; yybottom <= yytop; yybottom++)
870  {
871  int yybot = *yybottom;
872  YYFPRINTF (stderr, " %d", yybot);
873  }
874  YYFPRINTF (stderr, "\n");
875 }
876 
877 # define YY_STACK_PRINT(Bottom, Top) \
878 do { \
879  if (yydebug) \
880  yy_stack_print ((Bottom), (Top)); \
881 } while (0)
882 
883 
884 /*------------------------------------------------.
885 | Report that the YYRULE is going to be reduced. |
886 `------------------------------------------------*/
887 
888 static void
889 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
890  int yyrule)
891 {
892  int yylno = yyrline[yyrule];
893  int yynrhs = yyr2[yyrule];
894  int yyi;
895  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
896  yyrule - 1, yylno);
897  /* The symbols being reduced. */
898  for (yyi = 0; yyi < yynrhs; yyi++)
899  {
900  YYFPRINTF (stderr, " $%d = ", yyi + 1);
901  yy_symbol_print (stderr,
902  YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
903  &yyvsp[(yyi + 1) - (yynrhs)]);
904  YYFPRINTF (stderr, "\n");
905  }
906 }
907 
908 # define YY_REDUCE_PRINT(Rule) \
909 do { \
910  if (yydebug) \
911  yy_reduce_print (yyssp, yyvsp, Rule); \
912 } while (0)
913 
914 /* Nonzero means print parse trace. It is left uninitialized so that
915  multiple parsers can coexist. */
916 int yydebug;
917 #else /* !YYDEBUG */
918 # define YYDPRINTF(Args) ((void) 0)
919 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
920 # define YY_STACK_PRINT(Bottom, Top)
921 # define YY_REDUCE_PRINT(Rule)
922 #endif /* !YYDEBUG */
923 
924 
925 /* YYINITDEPTH -- initial size of the parser's stacks. */
926 #ifndef YYINITDEPTH
927 # define YYINITDEPTH 200
928 #endif
929 
930 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
931  if the built-in stack extension method is used).
932 
933  Do not make this value too large; the results are undefined if
934  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
935  evaluated with infinite-precision integer arithmetic. */
936 
937 #ifndef YYMAXDEPTH
938 # define YYMAXDEPTH 10000
939 #endif
940 
941 
942 
943 
944 
945 
946 /*-----------------------------------------------.
947 | Release the memory associated to this symbol. |
948 `-----------------------------------------------*/
949 
950 static void
951 yydestruct (const char *yymsg,
952  yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
953 {
954  YYUSE (yyvaluep);
955  if (!yymsg)
956  yymsg = "Deleting";
957  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
958 
960  YYUSE (yykind);
962 }
963 
964 
965 /* The lookahead symbol. */
966 int yychar;
967 
968 /* The semantic value of the lookahead symbol. */
970 /* Number of syntax errors so far. */
972 
973 
974 
975 
976 /*----------.
977 | yyparse. |
978 `----------*/
979 
980 int
981 yyparse (void)
982 {
983  yy_state_fast_t yystate;
984  /* Number of tokens to shift before error messages enabled. */
985  int yyerrstatus;
986 
987  /* The stacks and their tools:
988  'yyss': related to states.
989  'yyvs': related to semantic values.
990 
991  Refer to the stacks through separate pointers, to allow yyoverflow
992  to reallocate them elsewhere. */
993 
994  /* Their size. */
995  YYPTRDIFF_T yystacksize;
996 
997  /* The state stack. */
998  yy_state_t yyssa[YYINITDEPTH];
999  yy_state_t *yyss;
1000  yy_state_t *yyssp;
1001 
1002  /* The semantic value stack. */
1003  YYSTYPE yyvsa[YYINITDEPTH];
1004  YYSTYPE *yyvs;
1005  YYSTYPE *yyvsp;
1006 
1007  int yyn;
1008  /* The return value of yyparse. */
1009  int yyresult;
1010  /* Lookahead token as an internal (translated) token number. */
1012  /* The variables used to return semantic value and location from the
1013  action routines. */
1014  YYSTYPE yyval;
1015 
1016 
1017 
1018 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1019 
1020  /* The number of symbols on the RHS of the reduced rule.
1021  Keep to zero when no symbol should be popped. */
1022  int yylen = 0;
1023 
1024  yynerrs = 0;
1025  yystate = 0;
1026  yyerrstatus = 0;
1027 
1028  yystacksize = YYINITDEPTH;
1029  yyssp = yyss = yyssa;
1030  yyvsp = yyvs = yyvsa;
1031 
1032 
1033  YYDPRINTF ((stderr, "Starting parse\n"));
1034 
1035  yychar = YYEMPTY; /* Cause a token to be read. */
1036  goto yysetstate;
1037 
1038 
1039 /*------------------------------------------------------------.
1040 | yynewstate -- push a new state, which is found in yystate. |
1041 `------------------------------------------------------------*/
1042 yynewstate:
1043  /* In all cases, when you get here, the value and location stacks
1044  have just been pushed. So pushing a state here evens the stacks. */
1045  yyssp++;
1046 
1047 
1048 /*--------------------------------------------------------------------.
1049 | yysetstate -- set current state (the top of the stack) to yystate. |
1050 `--------------------------------------------------------------------*/
1051 yysetstate:
1052  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1053  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1055  *yyssp = YY_CAST (yy_state_t, yystate);
1057  YY_STACK_PRINT (yyss, yyssp);
1058 
1059  if (yyss + yystacksize - 1 <= yyssp)
1060 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1061  goto yyexhaustedlab;
1062 #else
1063  {
1064  /* Get the current used size of the three stacks, in elements. */
1065  YYPTRDIFF_T yysize = yyssp - yyss + 1;
1066 
1067 # if defined yyoverflow
1068  {
1069  /* Give user a chance to reallocate the stack. Use copies of
1070  these so that the &'s don't force the real ones into
1071  memory. */
1072  yy_state_t *yyss1 = yyss;
1073  YYSTYPE *yyvs1 = yyvs;
1074 
1075  /* Each stack pointer address is followed by the size of the
1076  data in use in that stack, in bytes. This used to be a
1077  conditional around just the two extra args, but that might
1078  be undefined if yyoverflow is a macro. */
1079  yyoverflow (YY_("memory exhausted"),
1080  &yyss1, yysize * YYSIZEOF (*yyssp),
1081  &yyvs1, yysize * YYSIZEOF (*yyvsp),
1082  &yystacksize);
1083  yyss = yyss1;
1084  yyvs = yyvs1;
1085  }
1086 # else /* defined YYSTACK_RELOCATE */
1087  /* Extend the stack our own way. */
1088  if (YYMAXDEPTH <= yystacksize)
1089  goto yyexhaustedlab;
1090  yystacksize *= 2;
1091  if (YYMAXDEPTH < yystacksize)
1092  yystacksize = YYMAXDEPTH;
1093 
1094  {
1095  yy_state_t *yyss1 = yyss;
1096  union yyalloc *yyptr =
1097  YY_CAST (union yyalloc *,
1098  YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1099  if (! yyptr)
1100  goto yyexhaustedlab;
1101  YYSTACK_RELOCATE (yyss_alloc, yyss);
1102  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1103 # undef YYSTACK_RELOCATE
1104  if (yyss1 != yyssa)
1105  YYSTACK_FREE (yyss1);
1106  }
1107 # endif
1108 
1109  yyssp = yyss + yysize - 1;
1110  yyvsp = yyvs + yysize - 1;
1111 
1113  YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1114  YY_CAST (long, yystacksize)));
1116 
1117  if (yyss + yystacksize - 1 <= yyssp)
1118  YYABORT;
1119  }
1120 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1121 
1122  if (yystate == YYFINAL)
1123  YYACCEPT;
1124 
1125  goto yybackup;
1126 
1127 
1128 /*-----------.
1129 | yybackup. |
1130 `-----------*/
1131 yybackup:
1132  /* Do appropriate processing given the current state. Read a
1133  lookahead token if we need one and don't already have one. */
1134 
1135  /* First try to decide what to do without reference to lookahead token. */
1136  yyn = yypact[yystate];
1137  if (yypact_value_is_default (yyn))
1138  goto yydefault;
1139 
1140  /* Not known => get a lookahead token if don't already have one. */
1141 
1142  /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1143  if (yychar == YYEMPTY)
1144  {
1145  YYDPRINTF ((stderr, "Reading a token\n"));
1146  yychar = yylex ();
1147  }
1148 
1149  if (yychar <= YYEOF)
1150  {
1151  yychar = YYEOF;
1152  yytoken = YYSYMBOL_YYEOF;
1153  YYDPRINTF ((stderr, "Now at end of input.\n"));
1154  }
1155  else if (yychar == YYerror)
1156  {
1157  /* The scanner already issued an error message, process directly
1158  to error recovery. But do not keep the error token as
1159  lookahead, it is too special and may lead us to an endless
1160  loop in error recovery. */
1161  yychar = YYUNDEF;
1162  yytoken = YYSYMBOL_YYerror;
1163  goto yyerrlab1;
1164  }
1165  else
1166  {
1167  yytoken = YYTRANSLATE (yychar);
1168  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1169  }
1170 
1171  /* If the proper action on seeing token YYTOKEN is to reduce or to
1172  detect an error, take that action. */
1173  yyn += yytoken;
1174  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1175  goto yydefault;
1176  yyn = yytable[yyn];
1177  if (yyn <= 0)
1178  {
1179  if (yytable_value_is_error (yyn))
1180  goto yyerrlab;
1181  yyn = -yyn;
1182  goto yyreduce;
1183  }
1184 
1185  /* Count tokens shifted since error; after three, turn off error
1186  status. */
1187  if (yyerrstatus)
1188  yyerrstatus--;
1189 
1190  /* Shift the lookahead token. */
1191  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1192  yystate = yyn;
1194  *++yyvsp = yylval;
1196 
1197  /* Discard the shifted token. */
1198  yychar = YYEMPTY;
1199  goto yynewstate;
1200 
1201 
1202 /*-----------------------------------------------------------.
1203 | yydefault -- do the default action for the current state. |
1204 `-----------------------------------------------------------*/
1205 yydefault:
1206  yyn = yydefact[yystate];
1207  if (yyn == 0)
1208  goto yyerrlab;
1209  goto yyreduce;
1210 
1211 
1212 /*-----------------------------.
1213 | yyreduce -- do a reduction. |
1214 `-----------------------------*/
1215 yyreduce:
1216  /* yyn is the number of a rule to reduce with. */
1217  yylen = yyr2[yyn];
1218 
1219  /* If YYLEN is nonzero, implement the default value of the action:
1220  '$$ = $1'.
1221 
1222  Otherwise, the following line sets YYVAL to garbage.
1223  This behavior is undocumented and Bison
1224  users should not rely upon it. Assigning to YYVAL
1225  unconditionally makes the parser a bit smaller, and it avoids a
1226  GCC warning that YYVAL may be used uninitialized. */
1227  yyval = yyvsp[1-yylen];
1228 
1229 
1230  YY_REDUCE_PRINT (yyn);
1231  switch (yyn)
1232  {
1233  case 3:
1234 #line 95 "parser.y"
1235  { json_parser.push(json_objectt()); }
1236 #line 1237 "json_y.tab.cpp"
1237  break;
1238 
1239  case 5:
1240 #line 96 "parser.y"
1241  { json_parser.push(json_objectt()); }
1242 #line 1243 "json_y.tab.cpp"
1243  break;
1244 
1245  case 8:
1246 #line 102 "parser.y"
1247  {
1248  }
1249 #line 1250 "json_y.tab.cpp"
1250  break;
1251 
1252  case 9:
1253 #line 108 "parser.y"
1254  {
1255  // we abuse the 'value' to temporarily store the key
1257  }
1258 #line 1259 "json_y.tab.cpp"
1259  break;
1260 
1261  case 10:
1262 #line 113 "parser.y"
1263  {
1264  jsont tmp;
1265  json_parser.pop(tmp);
1267  json_parser.top().value.clear(); // end abuse
1268  }
1269 #line 1270 "json_y.tab.cpp"
1270  break;
1271 
1272  case 11:
1273 #line 121 "parser.y"
1274  { json_parser.push(json_arrayt()); }
1275 #line 1276 "json_y.tab.cpp"
1276  break;
1277 
1278  case 13:
1279 #line 122 "parser.y"
1280  { json_parser.push(json_arrayt()); }
1281 #line 1282 "json_y.tab.cpp"
1282  break;
1283 
1284  case 17:
1285 #line 132 "parser.y"
1286  {
1287  jsont tmp;
1288  json_parser.pop(tmp);
1290  }
1291 #line 1292 "json_y.tab.cpp"
1292  break;
1293 
1294  case 18:
1295 #line 140 "parser.y"
1297 #line 1298 "json_y.tab.cpp"
1298  break;
1299 
1300  case 19:
1301 #line 142 "parser.y"
1303 #line 1304 "json_y.tab.cpp"
1304  break;
1305 
1306  case 22:
1307 #line 146 "parser.y"
1308  { json_parser.push(json_truet()); }
1309 #line 1310 "json_y.tab.cpp"
1310  break;
1311 
1312  case 23:
1313 #line 148 "parser.y"
1314  { json_parser.push(json_falset()); }
1315 #line 1316 "json_y.tab.cpp"
1316  break;
1317 
1318  case 24:
1319 #line 150 "parser.y"
1320  { json_parser.push(json_nullt()); }
1321 #line 1322 "json_y.tab.cpp"
1322  break;
1323 
1324 
1325 #line 1326 "json_y.tab.cpp"
1326 
1327  default: break;
1328  }
1329  /* User semantic actions sometimes alter yychar, and that requires
1330  that yytoken be updated with the new translation. We take the
1331  approach of translating immediately before every use of yytoken.
1332  One alternative is translating here after every semantic action,
1333  but that translation would be missed if the semantic action invokes
1334  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1335  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1336  incorrect destructor might then be invoked immediately. In the
1337  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1338  to an incorrect destructor call or verbose syntax error message
1339  before the lookahead is translated. */
1340  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1341 
1342  YYPOPSTACK (yylen);
1343  yylen = 0;
1344 
1345  *++yyvsp = yyval;
1346 
1347  /* Now 'shift' the result of the reduction. Determine what state
1348  that goes to, based on the state we popped back to and the rule
1349  number reduced by. */
1350  {
1351  const int yylhs = yyr1[yyn] - YYNTOKENS;
1352  const int yyi = yypgoto[yylhs] + *yyssp;
1353  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1354  ? yytable[yyi]
1355  : yydefgoto[yylhs]);
1356  }
1357 
1358  goto yynewstate;
1359 
1360 
1361 /*--------------------------------------.
1362 | yyerrlab -- here on detecting error. |
1363 `--------------------------------------*/
1364 yyerrlab:
1365  /* Make sure we have latest lookahead translation. See comments at
1366  user semantic actions for why this is necessary. */
1367  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1368  /* If not already recovering from an error, report this error. */
1369  if (!yyerrstatus)
1370  {
1371  ++yynerrs;
1372  yyerror (YY_("syntax error"));
1373  }
1374 
1375  if (yyerrstatus == 3)
1376  {
1377  /* If just tried and failed to reuse lookahead token after an
1378  error, discard it. */
1379 
1380  if (yychar <= YYEOF)
1381  {
1382  /* Return failure if at end of input. */
1383  if (yychar == YYEOF)
1384  YYABORT;
1385  }
1386  else
1387  {
1388  yydestruct ("Error: discarding",
1389  yytoken, &yylval);
1390  yychar = YYEMPTY;
1391  }
1392  }
1393 
1394  /* Else will try to reuse lookahead token after shifting the error
1395  token. */
1396  goto yyerrlab1;
1397 
1398 
1399 /*---------------------------------------------------.
1400 | yyerrorlab -- error raised explicitly by YYERROR. |
1401 `---------------------------------------------------*/
1402 yyerrorlab:
1403  /* Pacify compilers when the user code never invokes YYERROR and the
1404  label yyerrorlab therefore never appears in user code. */
1405  if (0)
1406  YYERROR;
1407 
1408  /* Do not reclaim the symbols of the rule whose action triggered
1409  this YYERROR. */
1410  YYPOPSTACK (yylen);
1411  yylen = 0;
1412  YY_STACK_PRINT (yyss, yyssp);
1413  yystate = *yyssp;
1414  goto yyerrlab1;
1415 
1416 
1417 /*-------------------------------------------------------------.
1418 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1419 `-------------------------------------------------------------*/
1420 yyerrlab1:
1421  yyerrstatus = 3; /* Each real token shifted decrements this. */
1422 
1423  /* Pop stack until we find a state that shifts the error token. */
1424  for (;;)
1425  {
1426  yyn = yypact[yystate];
1427  if (!yypact_value_is_default (yyn))
1428  {
1429  yyn += YYSYMBOL_YYerror;
1430  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1431  {
1432  yyn = yytable[yyn];
1433  if (0 < yyn)
1434  break;
1435  }
1436  }
1437 
1438  /* Pop the current state because it cannot handle the error token. */
1439  if (yyssp == yyss)
1440  YYABORT;
1441 
1442 
1443  yydestruct ("Error: popping",
1444  YY_ACCESSING_SYMBOL (yystate), yyvsp);
1445  YYPOPSTACK (1);
1446  yystate = *yyssp;
1447  YY_STACK_PRINT (yyss, yyssp);
1448  }
1449 
1451  *++yyvsp = yylval;
1453 
1454 
1455  /* Shift the error token. */
1456  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1457 
1458  yystate = yyn;
1459  goto yynewstate;
1460 
1461 
1462 /*-------------------------------------.
1463 | yyacceptlab -- YYACCEPT comes here. |
1464 `-------------------------------------*/
1465 yyacceptlab:
1466  yyresult = 0;
1467  goto yyreturn;
1468 
1469 
1470 /*-----------------------------------.
1471 | yyabortlab -- YYABORT comes here. |
1472 `-----------------------------------*/
1473 yyabortlab:
1474  yyresult = 1;
1475  goto yyreturn;
1476 
1477 
1478 #if !defined yyoverflow
1479 /*-------------------------------------------------.
1480 | yyexhaustedlab -- memory exhaustion comes here. |
1481 `-------------------------------------------------*/
1482 yyexhaustedlab:
1483  yyerror (YY_("memory exhausted"));
1484  yyresult = 2;
1485  /* Fall through. */
1486 #endif
1487 
1488 
1489 /*-----------------------------------------------------.
1490 | yyreturn -- parsing is finished, return the result. |
1491 `-----------------------------------------------------*/
1492 yyreturn:
1493  if (yychar != YYEMPTY)
1494  {
1495  /* Make sure we have latest lookahead translation. See comments at
1496  user semantic actions for why this is necessary. */
1497  yytoken = YYTRANSLATE (yychar);
1498  yydestruct ("Cleanup: discarding lookahead",
1499  yytoken, &yylval);
1500  }
1501  /* Do not reclaim the symbols of the rule whose action triggered
1502  this YYABORT or YYACCEPT. */
1503  YYPOPSTACK (yylen);
1504  YY_STACK_PRINT (yyss, yyssp);
1505  while (yyssp != yyss)
1506  {
1507  yydestruct ("Cleanup: popping",
1508  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1509  YYPOPSTACK (1);
1510  }
1511 #ifndef yyoverflow
1512  if (yyss != yyssa)
1513  YYSTACK_FREE (yyss);
1514 #endif
1515 
1516  return yyresult;
1517 }
1518 
yydebug
#define yydebug
Definition: json_y.tab.cpp:71
json_numbert
Definition: json.h:289
TOK_FALSE
@ TOK_FALSE
Definition: json_y.tab.cpp:206
YY_CAST
#define YY_CAST(Type, Val)
Definition: json_y.tab.cpp:166
yylex
#define yylex
Definition: json_y.tab.cpp:69
YYSYMBOL_TOK_STRING
@ YYSYMBOL_TOK_STRING
Definition: json_y.tab.cpp:232
json_truet
Definition: json.h:401
YYSYMBOL_9_
@ YYSYMBOL_9_
Definition: json_y.tab.cpp:238
YYSYMBOL_17_1
@ YYSYMBOL_17_1
Definition: json_y.tab.cpp:246
yytype_uint8
unsigned char yytype_uint8
Definition: json_y.tab.cpp:306
yypact_value_is_default
#define yypact_value_is_default(Yyn)
Definition: json_y.tab.cpp:668
yysymbol_kind_t
yysymbol_kind_t
Definition: ansi_c_y.tab.cpp:389
YYABORT
#define YYABORT
Definition: json_y.tab.cpp:763
YYSTACK_FREE
#define YYSTACK_FREE
Definition: json_y.tab.cpp:476
YYSYMBOL_key_value_pair
@ YYSYMBOL_key_value_pair
Definition: json_y.tab.cpp:249
YYSYMBOL_document
@ YYSYMBOL_document
Definition: json_y.tab.cpp:244
yytype_int16
short yytype_int16
Definition: json_y.tab.cpp:297
YYSTACK_RELOCATE
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: json_y.tab.cpp:530
YYSYMBOL_8_
@ YYSYMBOL_8_
Definition: json_y.tab.cpp:237
YYSYMBOL_13_
@ YYSYMBOL_13_
Definition: json_y.tab.cpp:242
json_parser
json_parsert json_parser
Definition: json_parser.cpp:13
YYSYMBOL_10_
@ YYSYMBOL_10_
Definition: json_y.tab.cpp:239
yyjsonlval
YYSTYPE yyjsonlval
Definition: json_y.tab.cpp:969
yytable_value_is_error
#define yytable_value_is_error(Yyn)
Definition: json_y.tab.cpp:673
yy_state_t
yytype_int8 yy_state_t
Definition: json_y.tab.cpp:361
YYSYMBOL_YYEOF
@ YYSYMBOL_YYEOF
Definition: json_y.tab.cpp:229
YYNSTATES
#define YYNSTATES
Definition: json_y.tab.cpp:575
yytype_int8
signed char yytype_int8
Definition: json_y.tab.cpp:289
YYFINAL
#define YYFINAL
Definition: json_y.tab.cpp:564
YYSYMBOL_YYerror
@ YYSYMBOL_YYerror
Definition: json_y.tab.cpp:230
yyalloc::yyss_alloc
yy_state_t yyss_alloc
Definition: ansi_c_y.tab.cpp:1074
yy_state_t
yytype_int16 yy_state_t
Definition: ansi_c_y.tab.cpp:925
json_parsert::push
void push(const jsont &x)
Definition: json_parser.h:35
YYSYMBOL_value
@ YYSYMBOL_value
Definition: json_y.tab.cpp:256
yyparse
#define yyparse
Definition: json_y.tab.cpp:68
yynerrs
#define yynerrs
Definition: json_y.tab.cpp:72
to_json_array
json_arrayt & to_json_array(jsont &json)
Definition: json.h:424
jsont
Definition: json.h:25
YYPOPSTACK
#define YYPOPSTACK(N)
yysymbol_kind_t
yysymbol_kind_t
Definition: json_y.tab.cpp:227
YYEOF
@ YYEOF
Definition: json_y.tab.cpp:200
json_arrayt
Definition: json.h:163
yyerror
#define yyerror
Definition: json_y.tab.cpp:70
YYEMPTY
@ YYEMPTY
Definition: json_y.tab.cpp:199
json_objectt
Definition: json.h:298
json_parser.h
YYLAST
#define YYLAST
Definition: json_y.tab.cpp:566
YYSYMBOL_24_5
@ YYSYMBOL_24_5
Definition: json_y.tab.cpp:253
YYSTYPE
Definition: xml_y.tab.cpp:170
yydestruct
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
Definition: json_y.tab.cpp:951
convert_TOK_NUMBER
static std::string convert_TOK_NUMBER()
Definition: json_y.tab.cpp:147
YYSYMBOL_12_
@ YYSYMBOL_12_
Definition: json_y.tab.cpp:241
YY_SYMBOL_PRINT
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: json_y.tab.cpp:919
codepoint_hex_to_utf8
std::string codepoint_hex_to_utf8(const std::string &hex)
Definition: unicode.cpp:380
YY_IGNORE_USELESS_CAST_END
#define YY_IGNORE_USELESS_CAST_END
Definition: json_y.tab.cpp:430
yytype_uint8
unsigned char yytype_uint8
Definition: ansi_c_y.tab.cpp:870
yystos
static const yytype_int8 yystos[]
Definition: json_y.tab.cpp:732
YY_NULLPTR
#define YY_NULLPTR
Definition: json_y.tab.cpp:178
yytokentype
yytokentype
Definition: ansi_c_y.tab.h:52
YYSIZE_T
#define YYSIZE_T
Definition: json_y.tab.cpp:347
jsont::swap
void swap(jsont &other)
Definition: json.cpp:159
YYSYMBOL_key_value_sequence
@ YYSYMBOL_key_value_sequence
Definition: json_y.tab.cpp:248
YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: json_y.tab.cpp:415
YYSYMBOL_array_value_sequence
@ YYSYMBOL_array_value_sequence
Definition: json_y.tab.cpp:254
YYSYMBOL_YYEMPTY
@ YYSYMBOL_YYEMPTY
Definition: json_y.tab.cpp:228
YYerror
@ YYerror
Definition: json_y.tab.cpp:201
YYDPRINTF
#define YYDPRINTF(Args)
Definition: json_y.tab.cpp:918
yypact
static const yytype_int8 yypact[]
Definition: json_y.tab.cpp:678
YYSTACK_BYTES
#define YYSTACK_BYTES(N)
Definition: json_y.tab.cpp:519
yyjsonerror
int yyjsonerror(const std::string &error)
Definition: json_y.tab.cpp:152
YYSYMBOL_YYUNDEF
@ YYSYMBOL_YYUNDEF
Definition: json_y.tab.cpp:231
free
void free(void *)
YYENOMEM
@ YYENOMEM
Definition: json_y.tab.cpp:757
YY_STACK_PRINT
#define YY_STACK_PRINT(Bottom, Top)
Definition: json_y.tab.cpp:920
convert_TOK_STRING
static std::string convert_TOK_STRING()
Definition: json_y.tab.cpp:103
malloc
void * malloc(unsigned)
yytoken_kind_t
enum yytokentype yytoken_kind_t
Definition: json_y.tab.cpp:209
json_falset
Definition: json.h:407
yyjsonparse
int yyjsonparse(void)
Definition: json_y.tab.cpp:981
YYSYMBOL_23_4
@ YYSYMBOL_23_4
Definition: json_y.tab.cpp:252
YY_ACCESSING_SYMBOL
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
Definition: json_y.tab.cpp:631
yyalloc::yyvs_alloc
YYSTYPE yyvs_alloc
Definition: json_y.tab.cpp:511
YYINITDEPTH
#define YYINITDEPTH
Definition: json_y.tab.cpp:927
YYNTOKENS
#define YYNTOKENS
Definition: json_y.tab.cpp:569
YY_ATTRIBUTE_UNUSED
#define YY_ATTRIBUTE_UNUSED
Definition: json_y.tab.cpp:391
parsert::parse_error
void parse_error(const std::string &message, const std::string &before)
Definition: parser.cpp:30
YYSIZEOF
#define YYSIZEOF(X)
Definition: json_y.tab.cpp:357
YYSYMBOL_TOK_NULL
@ YYSYMBOL_TOK_NULL
Definition: json_y.tab.cpp:236
yyjsonleng
int yyjsonleng
Definition: json_lex.yy.cpp:530
yyr1
static const yytype_int8 yyr1[]
Definition: json_y.tab.cpp:741
yytable
static const yytype_int8 yytable[]
Definition: json_y.tab.cpp:714
YYSYMBOL_array_value
@ YYSYMBOL_array_value
Definition: json_y.tab.cpp:255
YY_IGNORE_USELESS_CAST_BEGIN
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition: json_y.tab.cpp:429
TOK_NULL
@ TOK_NULL
Definition: json_y.tab.cpp:207
TOK_TRUE
@ TOK_TRUE
Definition: json_y.tab.cpp:205
yytype_int8
signed char yytype_int8
Definition: ansi_c_y.tab.cpp:853
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: json_y.tab.cpp:414
YYSYMBOL_21_3
@ YYSYMBOL_21_3
Definition: json_y.tab.cpp:250
YYSYMBOL_18_2
@ YYSYMBOL_18_2
Definition: json_y.tab.cpp:247
to_json_object
json_objectt & to_json_object(jsont &json)
Definition: json.h:442
YYSYMBOL_TOK_NUMBER
@ YYSYMBOL_TOK_NUMBER
Definition: json_y.tab.cpp:233
YY_REDUCE_PRINT
#define YY_REDUCE_PRINT(Rule)
Definition: json_y.tab.cpp:921
YYSTYPE
int YYSTYPE
Definition: json_y.tab.cpp:214
yy_state_fast_t
int yy_state_fast_t
Definition: json_y.tab.cpp:364
YYSTACK_ALLOC
#define YYSTACK_ALLOC
Definition: json_y.tab.cpp:475
yydefgoto
static const yytype_int8 yydefgoto[]
Definition: json_y.tab.cpp:705
YYPTRDIFF_T
#define YYPTRDIFF_T
Definition: json_y.tab.cpp:333
YYMAXDEPTH
#define YYMAXDEPTH
Definition: json_y.tab.cpp:938
TOK_NUMBER
@ TOK_NUMBER
Definition: json_y.tab.cpp:204
unicode.h
yyalloc
Definition: ansi_c_y.tab.cpp:1073
yychar
#define yychar
Definition: json_y.tab.cpp:74
json_parsert::pop
void pop(jsont &dest)
Definition: json_parser.h:40
YYSYMBOL_object
@ YYSYMBOL_object
Definition: json_y.tab.cpp:245
YYTRANSLATE
#define YYTRANSLATE(YYX)
Definition: json_y.tab.cpp:582
YYSYMBOL_TOK_FALSE
@ YYSYMBOL_TOK_FALSE
Definition: json_y.tab.cpp:235
YYSYMBOL_YYACCEPT
@ YYSYMBOL_YYACCEPT
Definition: json_y.tab.cpp:243
yyjsonlex
int yyjsonlex()
The main scanner function which does all the work.
Definition: json_lex.yy.cpp:952
yydefact
static const yytype_int8 yydefact[]
Definition: json_y.tab.cpp:689
YYERROR
#define YYERROR
Definition: json_y.tab.cpp:764
yypgoto
static const yytype_int8 yypgoto[]
Definition: json_y.tab.cpp:698
yyr2
static const yytype_int8 yyr2[]
Definition: json_y.tab.cpp:749
YY_
#define YY_(Msgid)
Definition: json_y.tab.cpp:374
yytranslate
static const yytype_int8 yytranslate[]
Definition: json_y.tab.cpp:589
yytype_uint16
unsigned short yytype_uint16
Definition: json_y.tab.cpp:317
yylval
#define yylval
Definition: json_y.tab.cpp:73
YYUSE
#define YYUSE(E)
Definition: json_y.tab.cpp:397
YYSYMBOL_11_
@ YYSYMBOL_11_
Definition: json_y.tab.cpp:240
yyjsontext
char * yyjsontext
Definition: json_lex.yy.cpp:739
json_arrayt::push_back
jsont & push_back(const jsont &json)
Definition: json.h:210
json_nullt
Definition: json.h:413
json_parsert::top
jsont & top()
Definition: json_parser.h:28
YYSYMBOL_TOK_TRUE
@ YYSYMBOL_TOK_TRUE
Definition: json_y.tab.cpp:234
YYACCEPT
#define YYACCEPT
Definition: json_y.tab.cpp:762
yytype_int16
short yytype_int16
Definition: ansi_c_y.tab.cpp:861
yy_state_fast_t
int yy_state_fast_t
Definition: ansi_c_y.tab.cpp:928
YYUNDEF
@ YYUNDEF
Definition: json_y.tab.cpp:202
TOK_STRING
@ TOK_STRING
Definition: json_y.tab.cpp:203
YY_ASSERT
#define YY_ASSERT(E)
Definition: json_y.tab.cpp:434
YYSYMBOL_array
@ YYSYMBOL_array
Definition: json_y.tab.cpp:251
json_stringt
Definition: json.h:268
jsont::value
std::string value
Definition: json.h:130
yycheck
static const yytype_int8 yycheck[]
Definition: json_y.tab.cpp:722