cprover
json_lex.yy.cpp
Go to the documentation of this file.
1 #line 2 "json_lex.yy.cpp"
2 
3 #line 4 "json_lex.yy.cpp"
4 
5 #define YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define yy_create_buffer yyjson_create_buffer
10 #define yy_delete_buffer yyjson_delete_buffer
11 #define yy_flex_debug yyjson_flex_debug
12 #define yy_init_buffer yyjson_init_buffer
13 #define yy_flush_buffer yyjson_flush_buffer
14 #define yy_load_buffer_state yyjson_load_buffer_state
15 #define yy_switch_to_buffer yyjson_switch_to_buffer
16 #define yyin yyjsonin
17 #define yyleng yyjsonleng
18 #define yylex yyjsonlex
19 #define yylineno yyjsonlineno
20 #define yyout yyjsonout
21 #define yyrestart yyjsonrestart
22 #define yytext yyjsontext
23 #define yywrap yyjsonwrap
24 #define yyalloc yyjsonalloc
25 #define yyrealloc yyjsonrealloc
26 #define yyfree yyjsonfree
27 
28 #define FLEX_SCANNER
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 6
31 #define YY_FLEX_SUBMINOR_VERSION 1
32 #if YY_FLEX_SUBMINOR_VERSION > 0
33 #define FLEX_BETA
34 #endif
35 
36 /* First, we deal with platform-specific or compiler-specific issues. */
37 
38 /* begin standard C headers. */
39 #include <stdio.h>
40 #include <string.h>
41 #include <errno.h>
42 #include <stdlib.h>
43 
44 /* end standard C headers. */
45 
46 /* flex integer type definitions */
47 
48 #ifndef FLEXINT_H
49 #define FLEXINT_H
50 
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56  * if you want the limit (max/min) macros for int types.
57  */
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
60 #endif
61 
62 #include <inttypes.h>
63 typedef int8_t flex_int8_t;
64 typedef uint8_t flex_uint8_t;
65 typedef int16_t flex_int16_t;
66 typedef uint16_t flex_uint16_t;
67 typedef int32_t flex_int32_t;
68 typedef uint32_t flex_uint32_t;
69 #else
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
76 
77 /* Limits of integral types. */
78 #ifndef INT8_MIN
79 #define INT8_MIN (-128)
80 #endif
81 #ifndef INT16_MIN
82 #define INT16_MIN (-32767-1)
83 #endif
84 #ifndef INT32_MIN
85 #define INT32_MIN (-2147483647-1)
86 #endif
87 #ifndef INT8_MAX
88 #define INT8_MAX (127)
89 #endif
90 #ifndef INT16_MAX
91 #define INT16_MAX (32767)
92 #endif
93 #ifndef INT32_MAX
94 #define INT32_MAX (2147483647)
95 #endif
96 #ifndef UINT8_MAX
97 #define UINT8_MAX (255U)
98 #endif
99 #ifndef UINT16_MAX
100 #define UINT16_MAX (65535U)
101 #endif
102 #ifndef UINT32_MAX
103 #define UINT32_MAX (4294967295U)
104 #endif
105 
106 #endif /* ! C99 */
107 
108 #endif /* ! FLEXINT_H */
109 
110 /* TODO: this is always defined, so inline it */
111 #define yyconst const
112 
113 #if defined(__GNUC__) && __GNUC__ >= 3
114 #define yynoreturn __attribute__((__noreturn__))
115 #else
116 #define yynoreturn
117 #endif
118 
119 /* Returned upon end-of-file. */
120 #define YY_NULL 0
121 
122 /* Promotes a possibly negative, possibly signed char to an unsigned
123  * integer for use as an array index. If the signed char is negative,
124  * we want to instead treat it as an 8-bit unsigned char, hence the
125  * double cast.
126  */
127 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
128 
129 /* Enter a start condition. This macro really ought to take a parameter,
130  * but we do it the disgusting crufty way forced on us by the ()-less
131  * definition of BEGIN.
132  */
133 #define BEGIN (yy_start) = 1 + 2 *
134 
135 /* Translate the current start state into a value that can be later handed
136  * to BEGIN to return to the state. The YYSTATE alias is for lex
137  * compatibility.
138  */
139 #define YY_START (((yy_start) - 1) / 2)
140 #define YYSTATE YY_START
141 
142 /* Action number for EOF rule of a given start state. */
143 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
144 
145 /* Special action meaning "start processing a new file". */
146 #define YY_NEW_FILE yyjsonrestart(yyjsonin )
147 
148 #define YY_END_OF_BUFFER_CHAR 0
149 
150 /* Size of default input buffer. */
151 #ifndef YY_BUF_SIZE
152 #ifdef __ia64__
153 /* On IA-64, the buffer size is 16k, not 8k.
154  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
155  * Ditto for the __ia64__ case accordingly.
156  */
157 #define YY_BUF_SIZE 32768
158 #else
159 #define YY_BUF_SIZE 16384
160 #endif /* __ia64__ */
161 #endif
162 
163 /* The state buf must be large enough to hold one state per character in the main buffer.
164  */
165 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
166 
167 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
168 #define YY_TYPEDEF_YY_BUFFER_STATE
170 #endif
171 
172 #ifndef YY_TYPEDEF_YY_SIZE_T
173 #define YY_TYPEDEF_YY_SIZE_T
174 typedef size_t yy_size_t;
175 #endif
176 
177 extern int yyjsonleng;
178 
179 extern FILE *yyjsonin, *yyjsonout;
180 
181 #define EOB_ACT_CONTINUE_SCAN 0
182 #define EOB_ACT_END_OF_FILE 1
183 #define EOB_ACT_LAST_MATCH 2
184 
185  #define YY_LESS_LINENO(n)
186  #define YY_LINENO_REWIND_TO(ptr)
187 
188 /* Return all but the first "n" matched characters back to the input stream. */
189 #define yyless(n) \
190  do \
191  { \
192  /* Undo effects of setting up yyjsontext. */ \
193  yy_size_t yyless_macro_arg = (n); \
194  YY_LESS_LINENO(yyless_macro_arg);\
195  *yy_cp = (yy_hold_char); \
196  YY_RESTORE_YY_MORE_OFFSET \
197  (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198  YY_DO_BEFORE_ACTION; /* set up yyjsontext again */ \
199  } \
200  while ( 0 )
201 
202 #define unput(c) yyunput( c, (yytext_ptr) )
203 
204 #ifndef YY_STRUCT_YY_BUFFER_STATE
205 #define YY_STRUCT_YY_BUFFER_STATE
206 struct yy_buffer_state
207  {
208  FILE *yy_input_file;
209 
210  char *yy_ch_buf; /* input buffer */
211  char *yy_buf_pos; /* current position in input buffer */
212 
213  /* Size of input buffer in bytes, not including room for EOB
214  * characters.
215  */
216  int yy_buf_size;
217 
218  /* Number of characters read into yy_ch_buf, not including EOB
219  * characters.
220  */
221  int yy_n_chars;
222 
223  /* Whether we "own" the buffer - i.e., we know we created it,
224  * and can realloc() it to grow it, and should free() it to
225  * delete it.
226  */
227  int yy_is_our_buffer;
228 
229  /* Whether this is an "interactive" input source; if so, and
230  * if we're using stdio for input, then we want to use getc()
231  * instead of fread(), to make sure we stop fetching input after
232  * each newline.
233  */
234  int yy_is_interactive;
235 
236  /* Whether we're considered to be at the beginning of a line.
237  * If so, '^' rules will be active on the next match, otherwise
238  * not.
239  */
240  int yy_at_bol;
241 
242  int yy_bs_lineno;
243  int yy_bs_column;
245  /* Whether to try to fill the input buffer when we reach the
246  * end of it.
247  */
248  int yy_fill_buffer;
249 
250  int yy_buffer_status;
251 
252 #define YY_BUFFER_NEW 0
253 #define YY_BUFFER_NORMAL 1
254  /* When an EOF's been seen but there's still some text to process
255  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
256  * shouldn't try reading from the input source any more. We might
257  * still have a bunch of tokens to match, though, because of
258  * possible backing-up.
259  *
260  * When we actually see the EOF, we change the status to "new"
261  * (via yyjsonrestart()), so that the user can continue scanning by
262  * just pointing yyjsonin at a new input file.
263  */
264 #define YY_BUFFER_EOF_PENDING 2
265 
266  };
267 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
268 
269 /* Stack of input buffers. */
270 static size_t yy_buffer_stack_top = 0;
271 static size_t yy_buffer_stack_max = 0;
272 static YY_BUFFER_STATE * yy_buffer_stack = NULL;
274 /* We provide macros for accessing buffer states in case in the
275  * future we want to put the buffer states in a more general
276  * "scanner state".
277  *
278  * Returns the top of the stack, or NULL.
279  */
280 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
281  ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
282  : NULL)
283 
284 /* Same as previous macro, but useful when we know that the buffer stack is not
285  * NULL or when we need an lvalue. For internal use only.
286  */
287 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
288 
289 /* yy_hold_char holds the character lost when yyjsontext is formed. */
290 static char yy_hold_char;
291 static int yy_n_chars; /* number of characters read into yy_ch_buf */
293 
294 /* Points to current character in buffer. */
295 static char *yy_c_buf_p = NULL;
296 static int yy_init = 0; /* whether we need to initialize */
297 static int yy_start = 0; /* start state number */
298 
299 /* Flag which is used to allow yyjsonwrap()'s to do buffer switches
300  * instead of setting up a fresh yyjsonin. A bit of a hack ...
301  */
303 
304 void yyjsonrestart (FILE *input_file );
305 void yyjson_switch_to_buffer (YY_BUFFER_STATE new_buffer );
306 YY_BUFFER_STATE yyjson_create_buffer (FILE *file,int size );
307 void yyjson_delete_buffer (YY_BUFFER_STATE b );
308 void yyjson_flush_buffer (YY_BUFFER_STATE b );
309 void yyjsonpush_buffer_state (YY_BUFFER_STATE new_buffer );
310 void yyjsonpop_buffer_state (void );
311 
312 static void yyjsonensure_buffer_stack (void );
313 static void yyjson_load_buffer_state (void );
314 static void yyjson_init_buffer (YY_BUFFER_STATE b,FILE *file );
315 
316 #define YY_FLUSH_BUFFER yyjson_flush_buffer(YY_CURRENT_BUFFER )
317 
318 YY_BUFFER_STATE yyjson_scan_buffer (char *base,yy_size_t size );
319 YY_BUFFER_STATE yyjson_scan_string (yyconst char *yy_str );
320 YY_BUFFER_STATE yyjson_scan_bytes (yyconst char *bytes,int len );
321 
322 void *yyjsonalloc (yy_size_t );
323 void *yyjsonrealloc (void *,yy_size_t );
324 void yyjsonfree (void * );
325 
326 #define yy_new_buffer yyjson_create_buffer
327 
328 #define yy_set_interactive(is_interactive) \
329  { \
330  if ( ! YY_CURRENT_BUFFER ){ \
331  yyjsonensure_buffer_stack (); \
332  YY_CURRENT_BUFFER_LVALUE = \
333  yyjson_create_buffer(yyjsonin,YY_BUF_SIZE ); \
334  } \
335  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
336  }
337 
338 #define yy_set_bol(at_bol) \
339  { \
340  if ( ! YY_CURRENT_BUFFER ){\
341  yyjsonensure_buffer_stack (); \
342  YY_CURRENT_BUFFER_LVALUE = \
343  yyjson_create_buffer(yyjsonin,YY_BUF_SIZE ); \
344  } \
345  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
346  }
347 
348 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
349 
350 #define yyjsonwrap() (/*CONSTCOND*/1)
351 #define YY_SKIP_YYWRAP
352 
353 typedef unsigned char YY_CHAR;
354 
355 FILE *yyjsonin = NULL, *yyjsonout = NULL;
356 
357 typedef int yy_state_type;
358 
359 extern int yyjsonlineno;
360 
361 int yyjsonlineno = 1;
362 
363 extern char *yyjsontext;
364 #ifdef yytext_ptr
365 #undef yytext_ptr
366 #endif
367 #define yytext_ptr yyjsontext
368 
369 static yy_state_type yy_get_previous_state (void );
370 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
371 static int yy_get_next_buffer (void );
372 static void yynoreturn yy_fatal_error (yyconst char* msg );
373 
374 /* Done after the current pattern has been matched and before the
375  * corresponding action - sets up yyjsontext.
376  */
377 #define YY_DO_BEFORE_ACTION \
378  (yytext_ptr) = yy_bp; \
379  yyjsonleng = (int) (yy_cp - yy_bp); \
380  (yy_hold_char) = *yy_cp; \
381  *yy_cp = '\0'; \
382  (yy_c_buf_p) = yy_cp;
383 
384 #define YY_NUM_RULES 8
385 #define YY_END_OF_BUFFER 9
386 /* This struct is not used in this scanner,
387  but its presence is necessary. */
388 struct yy_trans_info
389  {
390  flex_int32_t yy_verify;
392  };
394  { 0,
395  0, 0, 9, 7, 6, 6, 6, 7, 2, 2,
396  7, 7, 7, 0, 1, 0, 2, 2, 0, 0,
397  0, 2, 0, 0, 0, 1, 2, 2, 0, 2,
398  0, 0, 0, 0, 0, 0, 5, 3, 0, 2,
399  4, 0
400  } ;
401 
402 static yyconst YY_CHAR yy_ec[256] =
403  { 0,
404  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
405  1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
406  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407  1, 2, 1, 4, 1, 1, 1, 1, 1, 1,
408  1, 1, 5, 1, 6, 7, 1, 8, 9, 9,
409  9, 9, 9, 9, 9, 9, 9, 1, 1, 1,
410  1, 1, 1, 1, 1, 1, 1, 1, 10, 1,
411  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413  1, 11, 1, 1, 1, 1, 12, 1, 1, 1,
414 
415  13, 14, 1, 1, 1, 1, 1, 15, 1, 16,
416  1, 1, 1, 17, 18, 19, 20, 1, 1, 1,
417  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 
426  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431  1, 1, 1, 1, 1
432  } ;
433 
434 static yyconst YY_CHAR yy_meta[21] =
435  { 0,
436  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437  1, 1, 1, 1, 1, 1, 1, 1, 1, 1
438  } ;
439 
441  { 0,
442  0, 0, 71, 72, 72, 72, 17, 14, 17, 17,
443  58, 49, 51, 25, 72, 27, 0, 24, 26, 34,
444  0, 0, 52, 51, 45, 33, 0, 37, 40, 43,
445  46, 48, 49, 48, 0, 42, 72, 72, 50, 52,
446  72, 72, 40
447  } ;
448 
450  { 0,
451  42, 1, 42, 42, 42, 42, 43, 42, 42, 9,
452  42, 42, 42, 43, 42, 43, 9, 9, 42, 42,
453  20, 10, 42, 42, 42, 43, 18, 42, 42, 42,
454  42, 42, 42, 42, 34, 42, 42, 42, 42, 42,
455  42, 0, 42
456  } ;
457 
459  { 0,
460  4, 5, 6, 7, 4, 8, 4, 9, 10, 4,
461  4, 4, 4, 11, 4, 12, 4, 4, 13, 4,
462  15, 17, 18, 19, 22, 22, 20, 16, 15, 21,
463  26, 27, 27, 28, 28, 16, 15, 16, 29, 29,
464  14, 30, 30, 16, 28, 28, 34, 30, 30, 35,
465  30, 30, 39, 39, 41, 40, 40, 40, 40, 40,
466  40, 38, 37, 36, 33, 32, 31, 25, 24, 23,
467  42, 3, 42, 42, 42, 42, 42, 42, 42, 42,
468  42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
469  42, 42
470 
471  } ;
472 
474  { 0,
475  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
476  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477  7, 8, 8, 9, 10, 10, 9, 7, 14, 9,
478  16, 18, 18, 19, 19, 14, 26, 16, 20, 20,
479  43, 20, 20, 26, 28, 28, 28, 29, 29, 28,
480  30, 30, 34, 34, 36, 34, 34, 39, 39, 40,
481  40, 33, 32, 31, 25, 24, 23, 13, 12, 11,
482  3, 42, 42, 42, 42, 42, 42, 42, 42, 42,
483  42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
484  42, 42
485 
486  } ;
487 
490 
491 extern int yyjson_flex_debug;
493 
494 /* The intent behind this definition is that it'll catch
495  * any uses of REJECT which flex missed.
496  */
497 #define REJECT reject_used_but_not_detected
498 #define yymore() yymore_used_but_not_detected
499 #define YY_MORE_ADJ 0
500 #define YY_RESTORE_YY_MORE_OFFSET
502 #line 1 "scanner.l"
503 #line 2 "scanner.l"
504 // Strictly follows http://www.json.org/
505 #define YY_NO_INPUT 1
506 #line 12 "scanner.l"
507 #ifdef _WIN32
508 #define YY_NO_UNISTD_H
509 static int isatty(int) { return 0; }
510 #endif
511 
512 #define PARSER json_parser
513 
514 #include "json_parser.h"
515 #include "json_y.tab.h"
516 
517 #include <util/pragma_wsign_compare.def>
518 #include <util/pragma_wnull_conversion.def>
519 #include <util/pragma_wdeprecated_register.def>
520 
521 #line 522 "json_lex.yy.cpp"
522 
523 #define INITIAL 0
524 
525 #ifndef YY_NO_UNISTD_H
526 /* Special case for "unistd.h", since it is non-ANSI. We include it way
527  * down here because we want the user's section 1 to have been scanned first.
528  * The user has a chance to override it with an option.
529  */
530 #include <unistd.h>
531 #endif
532 
533 #ifndef YY_EXTRA_TYPE
534 #define YY_EXTRA_TYPE void *
535 #endif
536 
537 static int yy_init_globals (void );
538 
539 /* Accessor methods to globals.
540  These are made visible to non-reentrant scanners for convenience. */
541 
542 int yyjsonlex_destroy (void );
543 
544 int yyjsonget_debug (void );
545 
546 void yyjsonset_debug (int debug_flag );
547 
549 
550 void yyjsonset_extra (YY_EXTRA_TYPE user_defined );
551 
552 FILE *yyjsonget_in (void );
553 
554 void yyjsonset_in (FILE * _in_str );
555 
556 FILE *yyjsonget_out (void );
557 
558 void yyjsonset_out (FILE * _out_str );
559 
560  int yyjsonget_leng (void );
561 
562 char *yyjsonget_text (void );
563 
564 int yyjsonget_lineno (void );
565 
566 void yyjsonset_lineno (int _line_number );
567 
568 /* Macros after this point can all be overridden by user definitions in
569  * section 1.
570  */
571 
572 #ifndef YY_SKIP_YYWRAP
573 #ifdef __cplusplus
574 extern "C" int yyjsonwrap (void );
575 #else
576 extern int yyjsonwrap (void );
577 #endif
578 #endif
579 
580 #ifndef YY_NO_UNPUT
581 
582 #endif
583 
584 #ifndef yytext_ptr
585 static void yy_flex_strncpy (char *,yyconst char *,int );
586 #endif
587 
588 #ifdef YY_NEED_STRLEN
589 static int yy_flex_strlen (yyconst char * );
590 #endif
591 
592 #ifndef YY_NO_INPUT
593 
594 #ifdef __cplusplus
595 static int yyinput (void );
596 #else
597 static int input (void );
598 #endif
599 
600 #endif
601 
602 /* Amount of stuff to slurp up with each read. */
603 #ifndef YY_READ_BUF_SIZE
604 #ifdef __ia64__
605 /* On IA-64, the buffer size is 16k, not 8k */
606 #define YY_READ_BUF_SIZE 16384
607 #else
608 #define YY_READ_BUF_SIZE 8192
609 #endif /* __ia64__ */
610 #endif
611 
612 /* Copy whatever the last rule matched to the standard output. */
613 #ifndef ECHO
614 /* This used to be an fputs(), but since the string might contain NUL's,
615  * we now use fwrite().
616  */
617 #define ECHO do { if (fwrite( yyjsontext, (size_t) yyjsonleng, 1, yyjsonout )) {} } while (0)
618 #endif
619 
620 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
621  * is returned in "result".
622  */
623 #ifndef YY_INPUT
624 #define YY_INPUT(buf,result,max_size) \
625  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
626  { \
627  int c = '*'; \
628  int n; \
629  for ( n = 0; n < max_size && \
630  (c = getc( yyjsonin )) != EOF && c != '\n'; ++n ) \
631  buf[n] = (char) c; \
632  if ( c == '\n' ) \
633  buf[n++] = (char) c; \
634  if ( c == EOF && ferror( yyjsonin ) ) \
635  YY_FATAL_ERROR( "input in flex scanner failed" ); \
636  result = n; \
637  } \
638  else \
639  { \
640  errno=0; \
641  while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyjsonin)) == 0 && ferror(yyjsonin)) \
642  { \
643  if( errno != EINTR) \
644  { \
645  YY_FATAL_ERROR( "input in flex scanner failed" ); \
646  break; \
647  } \
648  errno=0; \
649  clearerr(yyjsonin); \
650  } \
651  }\
652 \
653 
654 #endif
655 
656 /* No semi-colon after return; correct usage is to write "yyterminate();" -
657  * we don't want an extra ';' after the "return" because that will cause
658  * some compilers to complain about unreachable statements.
659  */
660 #ifndef yyterminate
661 #define yyterminate() return YY_NULL
662 #endif
663 
664 /* Number of entries by which start-condition stack grows. */
665 #ifndef YY_START_STACK_INCR
666 #define YY_START_STACK_INCR 25
667 #endif
668 
669 /* Report a fatal error. */
670 #ifndef YY_FATAL_ERROR
671 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
672 #endif
673 
674 /* end tables serialization structures and prototypes */
675 
676 /* Default declaration of generated scanner - a define so the user can
677  * easily add parameters.
678  */
679 #ifndef YY_DECL
680 #define YY_DECL_IS_OURS 1
681 
682 extern int yyjsonlex (void);
683 
684 #define YY_DECL int yyjsonlex (void)
685 #endif /* !YY_DECL */
686 
687 /* Code executed at the beginning of each rule, after yyjsontext and yyjsonleng
688  * have been set up.
689  */
690 #ifndef YY_USER_ACTION
691 #define YY_USER_ACTION
692 #endif
693 
694 /* Code executed at the end of each rule. */
695 #ifndef YY_BREAK
696 #define YY_BREAK /*LINTED*/break;
697 #endif
698 
699 #define YY_RULE_SETUP \
700  YY_USER_ACTION
701 
705 {
706  yy_state_type yy_current_state;
707  char *yy_cp, *yy_bp;
708  int yy_act;
709 
710  if ( !(yy_init) )
711  {
712  (yy_init) = 1;
713 
714 #ifdef YY_USER_INIT
715  YY_USER_INIT;
716 #endif
717 
718  if ( ! (yy_start) )
719  (yy_start) = 1; /* first start state */
720 
721  if ( ! yyjsonin )
722  yyjsonin = stdin;
723 
724  if ( ! yyjsonout )
725  yyjsonout = stdout;
726 
727  if ( ! YY_CURRENT_BUFFER ) {
731  }
732 
734  }
735 
736  {
737 #line 41 "scanner.l"
738 
739 
740 #line 741 "json_lex.yy.cpp"
741 
742  while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
743  {
744  yy_cp = (yy_c_buf_p);
745 
746  /* Support of yyjsontext. */
747  *yy_cp = (yy_hold_char);
748 
749  /* yy_bp points to the position in yy_ch_buf of the start of
750  * the current run.
751  */
752  yy_bp = yy_cp;
753 
754  yy_current_state = (yy_start);
755 yy_match:
756  do
757  {
758  YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
759  if ( yy_accept[yy_current_state] )
760  {
761  (yy_last_accepting_state) = yy_current_state;
762  (yy_last_accepting_cpos) = yy_cp;
763  }
764  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
765  {
766  yy_current_state = (int) yy_def[yy_current_state];
767  if ( yy_current_state >= 43 )
768  yy_c = yy_meta[(unsigned int) yy_c];
769  }
770  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
771  ++yy_cp;
772  }
773  while ( yy_base[yy_current_state] != 72 );
774 
775 yy_find_action:
776  yy_act = yy_accept[yy_current_state];
777  if ( yy_act == 0 )
778  { /* have to back up */
779  yy_cp = (yy_last_accepting_cpos);
780  yy_current_state = (yy_last_accepting_state);
781  yy_act = yy_accept[yy_current_state];
782  }
783 
785 
786 do_action: /* This label is used only to access EOF actions. */
787 
788  switch ( yy_act )
789  { /* beginning of action switch */
790  case 0: /* must back up */
791  /* undo the effects of YY_DO_BEFORE_ACTION */
792  *yy_cp = (yy_hold_char);
793  yy_cp = (yy_last_accepting_cpos);
794  yy_current_state = (yy_last_accepting_state);
795  goto yy_find_action;
796 
797 case 1:
798 /* rule 1 can match eol */
800 #line 43 "scanner.l"
801 { return TOK_STRING; }
802  YY_BREAK
803 case 2:
805 #line 44 "scanner.l"
806 { return TOK_NUMBER; }
807  YY_BREAK
808 case 3:
810 #line 45 "scanner.l"
811 { return TOK_TRUE; }
812  YY_BREAK
813 case 4:
815 #line 46 "scanner.l"
816 { return TOK_FALSE; }
817  YY_BREAK
818 case 5:
820 #line 47 "scanner.l"
821 { return TOK_NULL; }
822  YY_BREAK
823 case 6:
824 /* rule 6 can match eol */
826 #line 49 "scanner.l"
827 { /* eat */ }
828  YY_BREAK
829 case 7:
831 #line 50 "scanner.l"
832 { return yyjsontext[0]; }
833  YY_BREAK
834 case 8:
836 #line 52 "scanner.l"
837 YY_FATAL_ERROR( "flex scanner jammed" );
838  YY_BREAK
839 #line 840 "json_lex.yy.cpp"
840 case YY_STATE_EOF(INITIAL):
841  yyterminate();
842 
843  case YY_END_OF_BUFFER:
844  {
845  /* Amount of text matched not including the EOB char. */
846  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
847 
848  /* Undo the effects of YY_DO_BEFORE_ACTION. */
849  *yy_cp = (yy_hold_char);
851 
852  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
853  {
854  /* We're scanning a new file or input source. It's
855  * possible that this happened because the user
856  * just pointed yyjsonin at a new source and called
857  * yyjsonlex(). If so, then we have to assure
858  * consistency between YY_CURRENT_BUFFER and our
859  * globals. Here is the right place to do so, because
860  * this is the first action (other than possibly a
861  * back-up) that will match for the new input source.
862  */
863  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
864  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyjsonin;
865  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
866  }
867 
868  /* Note that here we test for yy_c_buf_p "<=" to the position
869  * of the first EOB in the buffer, since yy_c_buf_p will
870  * already have been incremented past the NUL character
871  * (since all states make transitions on EOB to the
872  * end-of-buffer state). Contrast this with the test
873  * in input().
874  */
875  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
876  { /* This was really a NUL. */
877  yy_state_type yy_next_state;
878 
879  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
880 
881  yy_current_state = yy_get_previous_state( );
882 
883  /* Okay, we're now positioned to make the NUL
884  * transition. We couldn't have
885  * yy_get_previous_state() go ahead and do it
886  * for us because it doesn't know how to deal
887  * with the possibility of jamming (and we don't
888  * want to build jamming into it because then it
889  * will run more slowly).
890  */
891 
892  yy_next_state = yy_try_NUL_trans( yy_current_state );
893 
894  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
895 
896  if ( yy_next_state )
897  {
898  /* Consume the NUL. */
899  yy_cp = ++(yy_c_buf_p);
900  yy_current_state = yy_next_state;
901  goto yy_match;
902  }
903 
904  else
905  {
906  yy_cp = (yy_c_buf_p);
907  goto yy_find_action;
908  }
909  }
910 
911  else switch ( yy_get_next_buffer( ) )
912  {
913  case EOB_ACT_END_OF_FILE:
914  {
916 
917  if ( yyjsonwrap( ) )
918  {
919  /* Note: because we've taken care in
920  * yy_get_next_buffer() to have set up
921  * yyjsontext, we can now set up
922  * yy_c_buf_p so that if some total
923  * hoser (like flex itself) wants to
924  * call the scanner after we return the
925  * YY_NULL, it'll still work - another
926  * YY_NULL will get returned.
927  */
929 
930  yy_act = YY_STATE_EOF(YY_START);
931  goto do_action;
932  }
933 
934  else
935  {
936  if ( ! (yy_did_buffer_switch_on_eof) )
937  YY_NEW_FILE;
938  }
939  break;
940  }
941 
943  (yy_c_buf_p) =
944  (yytext_ptr) + yy_amount_of_matched_text;
945 
946  yy_current_state = yy_get_previous_state( );
947 
948  yy_cp = (yy_c_buf_p);
949  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
950  goto yy_match;
951 
952  case EOB_ACT_LAST_MATCH:
953  (yy_c_buf_p) =
954  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
955 
956  yy_current_state = yy_get_previous_state( );
957 
958  yy_cp = (yy_c_buf_p);
959  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
960  goto yy_find_action;
961  }
962  break;
963  }
964 
965  default:
967  "fatal flex scanner internal error--no action found" );
968  } /* end of action switch */
969  } /* end of scanning one token */
970  } /* end of user's declarations */
971 } /* end of yyjsonlex */
972 
973 /* yy_get_next_buffer - try to read in a new buffer
974  *
975  * Returns a code representing an action:
976  * EOB_ACT_LAST_MATCH -
977  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
978  * EOB_ACT_END_OF_FILE - end of file
979  */
980 static int yy_get_next_buffer (void)
981 {
982  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
983  char *source = (yytext_ptr);
984  yy_size_t number_to_move, i;
985  int ret_val;
986 
987  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
989  "fatal flex scanner internal error--end of buffer missed" );
990 
991  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
992  { /* Don't try to fill the buffer, so this is an EOF. */
993  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
994  {
995  /* We matched a single character, the EOB, so
996  * treat this as a final EOF.
997  */
998  return EOB_ACT_END_OF_FILE;
999  }
1000 
1001  else
1002  {
1003  /* We matched some text prior to the EOB, first
1004  * process it.
1005  */
1006  return EOB_ACT_LAST_MATCH;
1007  }
1008  }
1009 
1010  /* Try to read more data. */
1011 
1012  /* First move last chars to start of buffer. */
1013  number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1014 
1015  for ( i = 0; i < number_to_move; ++i )
1016  *(dest++) = *(source++);
1017 
1018  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1019  /* don't do the read, it's not guaranteed to return an EOF,
1020  * just force an EOF
1021  */
1022  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1023 
1024  else
1025  {
1026  int num_to_read =
1027  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1028 
1029  while ( num_to_read <= 0 )
1030  { /* Not enough room in the buffer - grow it. */
1031 
1032  /* just a shorter name for the current buffer */
1033  YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1034 
1035  int yy_c_buf_p_offset =
1036  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1037 
1038  if ( b->yy_is_our_buffer )
1039  {
1040  int new_size = b->yy_buf_size * 2;
1041 
1042  if ( new_size <= 0 )
1043  b->yy_buf_size += b->yy_buf_size / 8;
1044  else
1045  b->yy_buf_size *= 2;
1046 
1047  b->yy_ch_buf = (char *)
1048  /* Include room in for 2 EOB chars. */
1049  yyjsonrealloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) );
1050  }
1051  else
1052  /* Can't grow it, we don't own it. */
1053  b->yy_ch_buf = NULL;
1054 
1055  if ( ! b->yy_ch_buf )
1057  "fatal error - scanner input buffer overflow" );
1058 
1059  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1060 
1061  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1062  number_to_move - 1;
1063 
1064  }
1065 
1066  if ( num_to_read > YY_READ_BUF_SIZE )
1067  num_to_read = YY_READ_BUF_SIZE;
1068 
1069  /* Read in more data. */
1070  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1071  (yy_n_chars), num_to_read );
1072 
1073  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1074  }
1075 
1076  if ( (yy_n_chars) == 0 )
1077  {
1078  if ( number_to_move == YY_MORE_ADJ )
1079  {
1080  ret_val = EOB_ACT_END_OF_FILE;
1082  }
1083 
1084  else
1085  {
1086  ret_val = EOB_ACT_LAST_MATCH;
1087  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1089  }
1090  }
1091 
1092  else
1093  ret_val = EOB_ACT_CONTINUE_SCAN;
1094 
1095  if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1096  /* Extend the array by 50%, plus the number we really need. */
1097  int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1098  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyjsonrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size );
1099  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1100  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1101  }
1102 
1103  (yy_n_chars) += number_to_move;
1106 
1107  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1108 
1109  return ret_val;
1110 }
1111 
1112 /* yy_get_previous_state - get the state just before the EOB char was reached */
1113 
1115 {
1116  yy_state_type yy_current_state;
1117  char *yy_cp;
1118 
1119  yy_current_state = (yy_start);
1120 
1121  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1122  {
1123  YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1124  if ( yy_accept[yy_current_state] )
1125  {
1126  (yy_last_accepting_state) = yy_current_state;
1127  (yy_last_accepting_cpos) = yy_cp;
1128  }
1129  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1130  {
1131  yy_current_state = (int) yy_def[yy_current_state];
1132  if ( yy_current_state >= 43 )
1133  yy_c = yy_meta[(unsigned int) yy_c];
1134  }
1135  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1136  }
1137 
1138  return yy_current_state;
1139 }
1140 
1141 /* yy_try_NUL_trans - try to make a transition on the NUL character
1142  *
1143  * synopsis
1144  * next_state = yy_try_NUL_trans( current_state );
1145  */
1146  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1147 {
1148  int yy_is_jam;
1149  char *yy_cp = (yy_c_buf_p);
1150 
1151  YY_CHAR yy_c = 1;
1152  if ( yy_accept[yy_current_state] )
1153  {
1154  (yy_last_accepting_state) = yy_current_state;
1155  (yy_last_accepting_cpos) = yy_cp;
1156  }
1157  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1158  {
1159  yy_current_state = (int) yy_def[yy_current_state];
1160  if ( yy_current_state >= 43 )
1161  yy_c = yy_meta[(unsigned int) yy_c];
1162  }
1163  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1164  yy_is_jam = (yy_current_state == 42);
1165 
1166  return yy_is_jam ? 0 : yy_current_state;
1167 }
1168 
1169 #ifndef YY_NO_UNPUT
1170 
1171 #endif
1172 
1173 #ifndef YY_NO_INPUT
1174 #ifdef __cplusplus
1175  static int yyinput (void)
1176 #else
1177  static int input (void)
1178 #endif
1179 
1180 {
1181  int c;
1182 
1183  *(yy_c_buf_p) = (yy_hold_char);
1184 
1185  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1186  {
1187  /* yy_c_buf_p now points to the character we want to return.
1188  * If this occurs *before* the EOB characters, then it's a
1189  * valid NUL; if not, then we've hit the end of the buffer.
1190  */
1191  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1192  /* This was really a NUL. */
1193  *(yy_c_buf_p) = '\0';
1194 
1195  else
1196  { /* need more input */
1197  int offset = (yy_c_buf_p) - (yytext_ptr);
1198  ++(yy_c_buf_p);
1199 
1200  switch ( yy_get_next_buffer( ) )
1201  {
1202  case EOB_ACT_LAST_MATCH:
1203  /* This happens because yy_g_n_b()
1204  * sees that we've accumulated a
1205  * token and flags that we need to
1206  * try matching the token before
1207  * proceeding. But for input(),
1208  * there's no matching to consider.
1209  * So convert the EOB_ACT_LAST_MATCH
1210  * to EOB_ACT_END_OF_FILE.
1211  */
1212 
1213  /* Reset buffer status. */
1215 
1216  /*FALLTHROUGH*/
1217 
1218  case EOB_ACT_END_OF_FILE:
1219  {
1220  if ( yyjsonwrap( ) )
1221  return 0;
1222 
1223  if ( ! (yy_did_buffer_switch_on_eof) )
1224  YY_NEW_FILE;
1225 #ifdef __cplusplus
1226  return yyinput();
1227 #else
1228  return input();
1229 #endif
1230  }
1231 
1232  case EOB_ACT_CONTINUE_SCAN:
1233  (yy_c_buf_p) = (yytext_ptr) + offset;
1234  break;
1235  }
1236  }
1237  }
1238 
1239  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1240  *(yy_c_buf_p) = '\0'; /* preserve yyjsontext */
1241  (yy_hold_char) = *++(yy_c_buf_p);
1242 
1243  return c;
1244 }
1245 #endif /* ifndef YY_NO_INPUT */
1246 
1252  void yyjsonrestart (FILE * input_file )
1253 {
1254 
1255  if ( ! YY_CURRENT_BUFFER ){
1259  }
1260 
1263 }
1264 
1269  void yyjson_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1270 {
1271 
1272  /* TODO. We should be able to replace this entire function body
1273  * with
1274  * yyjsonpop_buffer_state();
1275  * yyjsonpush_buffer_state(new_buffer);
1276  */
1278  if ( YY_CURRENT_BUFFER == new_buffer )
1279  return;
1280 
1281  if ( YY_CURRENT_BUFFER )
1282  {
1283  /* Flush out information for old buffer. */
1284  *(yy_c_buf_p) = (yy_hold_char);
1285  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1286  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1287  }
1288 
1289  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1291 
1292  /* We don't actually know whether we did this switch during
1293  * EOF (yyjsonwrap()) processing, but the only time this flag
1294  * is looked at is after yyjsonwrap() is called, so it's safe
1295  * to go ahead and always set it.
1296  */
1298 }
1299 
1300 static void yyjson_load_buffer_state (void)
1301 {
1302  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1303  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1304  yyjsonin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1305  (yy_hold_char) = *(yy_c_buf_p);
1306 }
1307 
1314  YY_BUFFER_STATE yyjson_create_buffer (FILE * file, int size )
1315 {
1316  YY_BUFFER_STATE b;
1317 
1318  b = (YY_BUFFER_STATE) yyjsonalloc(sizeof( struct yy_buffer_state ) );
1319  if ( ! b )
1320  YY_FATAL_ERROR( "out of dynamic memory in yyjson_create_buffer()" );
1321 
1322  b->yy_buf_size = size;
1323 
1324  /* yy_ch_buf has to be 2 characters longer than the size given because
1325  * we need to put in 2 end-of-buffer characters.
1326  */
1327  b->yy_ch_buf = (char *) yyjsonalloc((yy_size_t) (b->yy_buf_size + 2) );
1328  if ( ! b->yy_ch_buf )
1329  YY_FATAL_ERROR( "out of dynamic memory in yyjson_create_buffer()" );
1330 
1331  b->yy_is_our_buffer = 1;
1332 
1333  yyjson_init_buffer(b,file );
1334 
1335  return b;
1336 }
1337 
1342  void yyjson_delete_buffer (YY_BUFFER_STATE b )
1343 {
1344 
1345  if ( ! b )
1346  return;
1347 
1348  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1350 
1351  if ( b->yy_is_our_buffer )
1352  yyjsonfree((void *) b->yy_ch_buf );
1353 
1354  yyjsonfree((void *) b );
1355 }
1356 
1357 /* Initializes or reinitializes a buffer.
1358  * This function is sometimes called more than once on the same buffer,
1359  * such as during a yyjsonrestart() or at EOF.
1360  */
1361  static void yyjson_init_buffer (YY_BUFFER_STATE b, FILE * file )
1362 
1363 {
1364  int oerrno = errno;
1365 
1366  yyjson_flush_buffer(b );
1367 
1368  b->yy_input_file = file;
1369  b->yy_fill_buffer = 1;
1370 
1371  /* If b is the current buffer, then yyjson_init_buffer was _probably_
1372  * called from yyjsonrestart() or through yy_get_next_buffer.
1373  * In that case, we don't want to reset the lineno or column.
1374  */
1375  if (b != YY_CURRENT_BUFFER){
1376  b->yy_bs_lineno = 1;
1377  b->yy_bs_column = 0;
1378  }
1379 
1380  b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1381 
1382  errno = oerrno;
1383 }
1384 
1389  void yyjson_flush_buffer (YY_BUFFER_STATE b )
1390 {
1391  if ( ! b )
1392  return;
1393 
1394  b->yy_n_chars = 0;
1395 
1396  /* We always need two end-of-buffer characters. The first causes
1397  * a transition to the end-of-buffer state. The second causes
1398  * a jam in that state.
1399  */
1402 
1403  b->yy_buf_pos = &b->yy_ch_buf[0];
1404 
1405  b->yy_at_bol = 1;
1407 
1408  if ( b == YY_CURRENT_BUFFER )
1410 }
1411 
1418 void yyjsonpush_buffer_state (YY_BUFFER_STATE new_buffer )
1419 {
1420  if (new_buffer == NULL)
1421  return;
1422 
1424 
1425  /* This block is copied from yyjson_switch_to_buffer. */
1426  if ( YY_CURRENT_BUFFER )
1427  {
1428  /* Flush out information for old buffer. */
1429  *(yy_c_buf_p) = (yy_hold_char);
1430  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1431  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1432  }
1433 
1434  /* Only push if top exists. Otherwise, replace top. */
1435  if (YY_CURRENT_BUFFER)
1436  (yy_buffer_stack_top)++;
1437  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1438 
1439  /* copied from yyjson_switch_to_buffer. */
1442 }
1443 
1449 {
1450  if (!YY_CURRENT_BUFFER)
1451  return;
1452 
1454  YY_CURRENT_BUFFER_LVALUE = NULL;
1455  if ((yy_buffer_stack_top) > 0)
1456  --(yy_buffer_stack_top);
1457 
1458  if (YY_CURRENT_BUFFER) {
1461  }
1462 }
1463 
1464 /* Allocates the stack if it does not exist.
1465  * Guarantees space for at least one push.
1466  */
1467 static void yyjsonensure_buffer_stack (void)
1468 {
1469  int num_to_alloc;
1470 
1471  if (!(yy_buffer_stack)) {
1472 
1473  /* First allocation is just for 2 elements, since we don't know if this
1474  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1475  * immediate realloc on the next call.
1476  */
1477  num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1479  (num_to_alloc * sizeof(struct yy_buffer_state*)
1480  );
1481  if ( ! (yy_buffer_stack) )
1482  YY_FATAL_ERROR( "out of dynamic memory in yyjsonensure_buffer_stack()" );
1483 
1484  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1485 
1486  (yy_buffer_stack_max) = num_to_alloc;
1487  (yy_buffer_stack_top) = 0;
1488  return;
1489  }
1490 
1491  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1492 
1493  /* Increase the buffer to prepare for a possible push. */
1494  yy_size_t grow_size = 8 /* arbitrary grow size */;
1495 
1496  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1498  ((yy_buffer_stack),
1499  num_to_alloc * sizeof(struct yy_buffer_state*)
1500  );
1501  if ( ! (yy_buffer_stack) )
1502  YY_FATAL_ERROR( "out of dynamic memory in yyjsonensure_buffer_stack()" );
1503 
1504  /* zero only the new slots.*/
1505  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1506  (yy_buffer_stack_max) = num_to_alloc;
1507  }
1508 }
1509 
1516 YY_BUFFER_STATE yyjson_scan_buffer (char * base, yy_size_t size )
1517 {
1518  YY_BUFFER_STATE b;
1519 
1520  if ( size < 2 ||
1521  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1522  base[size-1] != YY_END_OF_BUFFER_CHAR )
1523  /* They forgot to leave room for the EOB's. */
1524  return NULL;
1525 
1526  b = (YY_BUFFER_STATE) yyjsonalloc(sizeof( struct yy_buffer_state ) );
1527  if ( ! b )
1528  YY_FATAL_ERROR( "out of dynamic memory in yyjson_scan_buffer()" );
1529 
1530  b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1531  b->yy_buf_pos = b->yy_ch_buf = base;
1532  b->yy_is_our_buffer = 0;
1533  b->yy_input_file = NULL;
1534  b->yy_n_chars = b->yy_buf_size;
1535  b->yy_is_interactive = 0;
1536  b->yy_at_bol = 1;
1537  b->yy_fill_buffer = 0;
1539 
1541 
1542  return b;
1543 }
1544 
1553 YY_BUFFER_STATE yyjson_scan_string (yyconst char * yystr )
1554 {
1555 
1556  return yyjson_scan_bytes(yystr,(int) strlen(yystr) );
1557 }
1558 
1566 YY_BUFFER_STATE yyjson_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1567 {
1568  YY_BUFFER_STATE b;
1569  char *buf;
1570  yy_size_t n;
1571  yy_size_t i;
1572 
1573  /* Get memory for full buffer, including space for trailing EOB's. */
1574  n = (yy_size_t) _yybytes_len + 2;
1575  buf = (char *) yyjsonalloc(n );
1576  if ( ! buf )
1577  YY_FATAL_ERROR( "out of dynamic memory in yyjson_scan_bytes()" );
1578 
1579  for ( i = 0; i < _yybytes_len; ++i )
1580  buf[i] = yybytes[i];
1581 
1582  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1583 
1584  b = yyjson_scan_buffer(buf,n );
1585  if ( ! b )
1586  YY_FATAL_ERROR( "bad buffer in yyjson_scan_bytes()" );
1587 
1588  /* It's okay to grow etc. this buffer, and we should throw it
1589  * away when we're done.
1590  */
1591  b->yy_is_our_buffer = 1;
1592 
1593  return b;
1594 }
1595 
1596 #ifndef YY_EXIT_FAILURE
1597 #define YY_EXIT_FAILURE 2
1598 #endif
1599 
1600 static void yynoreturn yy_fatal_error (yyconst char* msg )
1601 {
1602  (void) fprintf( stderr, "%s\n", msg );
1603  exit( YY_EXIT_FAILURE );
1604 }
1605 
1606 /* Redefine yyless() so it works in section 3 code. */
1607 
1608 #undef yyless
1609 #define yyless(n) \
1610  do \
1611  { \
1612  /* Undo effects of setting up yyjsontext. */ \
1613  yy_size_t yyless_macro_arg = (n); \
1614  YY_LESS_LINENO(yyless_macro_arg);\
1615  yyjsontext[yyjsonleng] = (yy_hold_char); \
1616  (yy_c_buf_p) = yyjsontext + yyless_macro_arg; \
1617  (yy_hold_char) = *(yy_c_buf_p); \
1618  *(yy_c_buf_p) = '\0'; \
1619  yyjsonleng = yyless_macro_arg; \
1620  } \
1621  while ( 0 )
1622 
1623 /* Accessor methods (get/set functions) to struct members. */
1624 
1629 {
1630 
1631  return yyjsonlineno;
1632 }
1633 
1637 FILE *yyjsonget_in (void)
1638 {
1639  return yyjsonin;
1640 }
1641 
1645 FILE *yyjsonget_out (void)
1646 {
1647  return yyjsonout;
1648 }
1649 
1653 int yyjsonget_leng (void)
1654 {
1655  return yyjsonleng;
1656 }
1657 
1662 char *yyjsonget_text (void)
1663 {
1664  return yyjsontext;
1665 }
1666 
1671 void yyjsonset_lineno (int _line_number )
1672 {
1673 
1674  yyjsonlineno = _line_number;
1675 }
1676 
1683 void yyjsonset_in (FILE * _in_str )
1684 {
1685  yyjsonin = _in_str ;
1686 }
1687 
1688 void yyjsonset_out (FILE * _out_str )
1689 {
1690  yyjsonout = _out_str ;
1691 }
1692 
1694 {
1695  return yyjson_flex_debug;
1696 }
1697 
1698 void yyjsonset_debug (int _bdebug )
1699 {
1700  yyjson_flex_debug = _bdebug ;
1701 }
1702 
1703 static int yy_init_globals (void)
1704 {
1705  /* Initialization is the same as for the non-reentrant scanner.
1706  * This function is called from yyjsonlex_destroy(), so don't allocate here.
1707  */
1708 
1709  (yy_buffer_stack) = NULL;
1710  (yy_buffer_stack_top) = 0;
1711  (yy_buffer_stack_max) = 0;
1712  (yy_c_buf_p) = NULL;
1713  (yy_init) = 0;
1714  (yy_start) = 0;
1715 
1716 /* Defined in main.c */
1717 #ifdef YY_STDINIT
1718  yyjsonin = stdin;
1719  yyjsonout = stdout;
1720 #else
1721  yyjsonin = NULL;
1722  yyjsonout = NULL;
1723 #endif
1724 
1725  /* For future reference: Set errno on error, since we are called by
1726  * yyjsonlex_init()
1727  */
1728  return 0;
1729 }
1730 
1731 /* yyjsonlex_destroy is for both reentrant and non-reentrant scanners. */
1733 {
1734 
1735  /* Pop the buffer stack, destroying each element. */
1736  while(YY_CURRENT_BUFFER){
1738  YY_CURRENT_BUFFER_LVALUE = NULL;
1740  }
1741 
1742  /* Destroy the stack itself. */
1743  yyjsonfree((yy_buffer_stack) );
1744  (yy_buffer_stack) = NULL;
1745 
1746  /* Reset the globals. This is important in a non-reentrant scanner so the next time
1747  * yyjsonlex() is called, initialization will occur. */
1748  yy_init_globals( );
1749 
1750  return 0;
1751 }
1752 
1753 /*
1754  * Internal utility routines.
1755  */
1756 
1757 #ifndef yytext_ptr
1758 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1759 {
1760 
1761  int i;
1762  for ( i = 0; i < n; ++i )
1763  s1[i] = s2[i];
1764 }
1765 #endif
1766 
1767 #ifdef YY_NEED_STRLEN
1768 static int yy_flex_strlen (yyconst char * s )
1769 {
1770  int n;
1771  for ( n = 0; s[n]; ++n )
1772  ;
1773 
1774  return n;
1775 }
1776 #endif
1777 
1778 void *yyjsonalloc (yy_size_t size )
1779 {
1780  return malloc(size);
1781 }
1782 
1783 void *yyjsonrealloc (void * ptr, yy_size_t size )
1784 {
1785 
1786  /* The cast to (char *) in the following accommodates both
1787  * implementations that use char* generic pointers, and those
1788  * that use void* generic pointers. It works with the latter
1789  * because both ANSI C and C++ allow castless assignment from
1790  * any pointer type to void*, and deal with argument conversions
1791  * as though doing an assignment.
1792  */
1793  return realloc(ptr, size);
1794 }
1795 
1796 void yyjsonfree (void * ptr )
1797 {
1798  free( (char *) ptr ); /* see yyjsonrealloc() for (char *) cast */
1799 }
1800 
1801 #define YYTABLES_NAME "yytables"
1802 
1803 #line 52 "scanner.l"
unsigned int flex_uint32_t
Definition: json_lex.yy.cpp:75
void yyjson_switch_to_buffer(YY_BUFFER_STATE new_buffer)
Switch to a different input buffer.
int yy_state_type
int yyjsonlex_destroy(void)
#define YY_INPUT(buf, result, max_size)
static char yy_hold_char
void yyjsonrestart(FILE *input_file)
Immediately switch to a different input stream.
#define TOK_TRUE
#define YY_DECL
static char * yy_last_accepting_cpos
#define YY_READ_BUF_SIZE
short int flex_int16_t
Definition: json_lex.yy.cpp:71
int yy_state_type
size_t yy_size_t
static int yy_start
static char * yy_c_buf_p
#define YY_MORE_ADJ
char * yyjsonget_text(void)
Get the current token.
static const flex_int16_t yy_accept[43]
static int yy_init_globals(void)
YY_BUFFER_STATE yyjson_scan_buffer(char *base, yy_size_t size)
Setup the input buffer state to scan directly from a user-specified character buffer.
YY_BUFFER_STATE yyjson_scan_string(const char *yy_str)
Setup the input buffer state to scan a string.
#define yyconst
unsigned short int flex_uint16_t
Definition: json_lex.yy.cpp:74
#define YY_END_OF_BUFFER
#define YY_STATE_EOF(state)
int yy_bs_lineno
The line count.
void yyjsonpush_buffer_state(YY_BUFFER_STATE new_buffer)
Pushes the new state onto the stack.
#define YY_BUFFER_EOF_PENDING
int yyjsonget_lineno(void)
Get the current line number.
int yyjsonget_debug(void)
unsigned char flex_uint8_t
Definition: json_lex.yy.cpp:73
#define yyjsonwrap()
YY_BUFFER_STATE yyjson_scan_bytes(const char *bytes, int len)
Setup the input buffer state to scan the given bytes.
FILE * yyjsonget_in(void)
Get the input stream.
#define yynoreturn
#define YY_DO_BEFORE_ACTION
#define YY_END_OF_BUFFER_CHAR
#define YY_NEW_FILE
void yyjsonset_lineno(int _line_number)
Set the current line number.
char * yyjsontext
static void yy_fatal_error(const char *msg)
int flex_int32_t
static YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
FILE * yyjsonget_out(void)
Get the output stream.
static int yy_did_buffer_switch_on_eof
int flex_int32_t
Definition: json_lex.yy.cpp:72
void free(void *)
#define INITIAL
FILE * yyjsonin
#define YY_RULE_SETUP
short int flex_int16_t
static const YY_CHAR yy_meta[21]
static yy_state_type yy_last_accepting_state
int yy_bs_column
The column count.
int yyjson_flex_debug
void yyjson_flush_buffer(YY_BUFFER_STATE b)
Discard all buffered characters.
static size_t yy_buffer_stack_top
index of top of stack.
#define YY_CURRENT_BUFFER
FILE * yyjsonout
void * yyjsonrealloc(void *, yy_size_t)
YY_BUFFER_STATE yyjson_create_buffer(FILE *file, int size)
Allocate and initialize an input buffer state.
void * yyjsonalloc(yy_size_t)
void yyjsonset_debug(int debug_flag)
unsigned short int flex_uint16_t
#define YY_BREAK
#define TOK_NULL
Definition: jsil_y.tab.cpp:215
static void yyjson_init_buffer(YY_BUFFER_STATE b, FILE *file)
#define YY_START
#define YY_CURRENT_BUFFER_LVALUE
void yyjsonset_in(FILE *_in_str)
Set the input stream.
void yyjsonset_extra(void *user_defined)
static size_t yy_buffer_stack_max
capacity of stack.
static void yyjson_load_buffer_state(void)
static void yyjsonensure_buffer_stack(void)
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
static const flex_int16_t yy_chk[93]
#define TOK_NUMBER
Definition: json_y.tab.cpp:176
static const flex_uint16_t yy_base[44]
unsigned char YY_CHAR
static yy_state_type yy_get_previous_state(void)
#define yyterminate()
#define TOK_STRING
#define TOK_FALSE
struct yy_buffer_state * YY_BUFFER_STATE
static int yy_init
static const flex_uint16_t yy_nxt[93]
static int yy_get_next_buffer(void)
#define YY_RESTORE_YY_MORE_OFFSET
#define EOB_ACT_LAST_MATCH
void yyjson_delete_buffer(YY_BUFFER_STATE b)
Destroy the buffer.
int yyjsonleng
#define YY_FATAL_ERROR(msg)
int yyjsonget_leng(void)
Get the length of the current token.
void * malloc(size_t)
#define YY_SC_TO_UI(c)
void yyjsonset_out(FILE *_out_str)
#define EOB_ACT_END_OF_FILE
void * yyjsonget_extra(void)
int8_t s1
Definition: bytecode_info.h:59
#define EOB_ACT_CONTINUE_SCAN
#define YY_BUFFER_NORMAL
int16_t s2
Definition: bytecode_info.h:60
#define yytext_ptr
#define YY_EXTRA_TYPE
static const YY_CHAR yy_ec[256]
unsigned char YY_CHAR
static const flex_int16_t yy_def[44]
#define YY_BUF_SIZE
void yyjsonpop_buffer_state(void)
Removes and deletes the top of the stack, if present.
void yyjsonfree(void *)
signed char flex_int8_t
Definition: json_lex.yy.cpp:70
#define YY_BUFFER_NEW
size_t yy_size_t
int yyjsonlex(void)
The main scanner function which does all the work.
int yyjsonlineno
#define YY_EXIT_FAILURE
Definition: kdev_t.h:19