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