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;
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 );
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 );
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  {
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 #define YY_NO_UNISTD_H 1
507 #line 14 "scanner.l"
508 
509 #define PARSER json_parser
510 
511 #include "json_parser.h"
512 #include "json_y.tab.h"
513 
514 #include <util/pragma_wsign_compare.def>
515 #include <util/pragma_wnull_conversion.def>
516 #include <util/pragma_wdeprecated_register.def>
517 
518 #line 519 "json_lex.yy.cpp"
519 
520 #define INITIAL 0
521 
522 #ifndef YY_NO_UNISTD_H
523 /* Special case for "unistd.h", since it is non-ANSI. We include it way
524  * down here because we want the user's section 1 to have been scanned first.
525  * The user has a chance to override it with an option.
526  */
527 #include <unistd.h>
528 #endif
529 
530 #ifndef YY_EXTRA_TYPE
531 #define YY_EXTRA_TYPE void *
532 #endif
533 
534 static int yy_init_globals (void );
535 
536 /* Accessor methods to globals.
537  These are made visible to non-reentrant scanners for convenience. */
538 
539 int yyjsonlex_destroy (void );
540 
541 int yyjsonget_debug (void );
542 
543 void yyjsonset_debug (int debug_flag );
544 
546 
547 void yyjsonset_extra (YY_EXTRA_TYPE user_defined );
548 
549 FILE *yyjsonget_in (void );
550 
551 void yyjsonset_in (FILE * _in_str );
552 
553 FILE *yyjsonget_out (void );
554 
555 void yyjsonset_out (FILE * _out_str );
556 
557  int yyjsonget_leng (void );
558 
559 char *yyjsonget_text (void );
560 
561 int yyjsonget_lineno (void );
562 
563 void yyjsonset_lineno (int _line_number );
564 
565 /* Macros after this point can all be overridden by user definitions in
566  * section 1.
567  */
568 
569 #ifndef YY_SKIP_YYWRAP
570 #ifdef __cplusplus
571 extern "C" int yyjsonwrap (void );
572 #else
573 extern int yyjsonwrap (void );
574 #endif
575 #endif
576 
577 #ifndef YY_NO_UNPUT
578 
579 #endif
580 
581 #ifndef yytext_ptr
582 static void yy_flex_strncpy (char *,yyconst char *,int );
583 #endif
584 
585 #ifdef YY_NEED_STRLEN
586 static int yy_flex_strlen (yyconst char * );
587 #endif
588 
589 #ifndef YY_NO_INPUT
590 
591 #ifdef __cplusplus
592 static int yyinput (void );
593 #else
594 static int input (void );
595 #endif
596 
597 #endif
598 
599 /* Amount of stuff to slurp up with each read. */
600 #ifndef YY_READ_BUF_SIZE
601 #ifdef __ia64__
602 /* On IA-64, the buffer size is 16k, not 8k */
603 #define YY_READ_BUF_SIZE 16384
604 #else
605 #define YY_READ_BUF_SIZE 8192
606 #endif /* __ia64__ */
607 #endif
608 
609 /* Copy whatever the last rule matched to the standard output. */
610 #ifndef ECHO
611 /* This used to be an fputs(), but since the string might contain NUL's,
612  * we now use fwrite().
613  */
614 #define ECHO do { if (fwrite( yyjsontext, (size_t) yyjsonleng, 1, yyjsonout )) {} } while (0)
615 #endif
616 
617 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
618  * is returned in "result".
619  */
620 #ifndef YY_INPUT
621 #define YY_INPUT(buf,result,max_size) \
622  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
623  { \
624  int c = '*'; \
625  int n; \
626  for ( n = 0; n < max_size && \
627  (c = getc( yyjsonin )) != EOF && c != '\n'; ++n ) \
628  buf[n] = (char) c; \
629  if ( c == '\n' ) \
630  buf[n++] = (char) c; \
631  if ( c == EOF && ferror( yyjsonin ) ) \
632  YY_FATAL_ERROR( "input in flex scanner failed" ); \
633  result = n; \
634  } \
635  else \
636  { \
637  errno=0; \
638  while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyjsonin)) == 0 && ferror(yyjsonin)) \
639  { \
640  if( errno != EINTR) \
641  { \
642  YY_FATAL_ERROR( "input in flex scanner failed" ); \
643  break; \
644  } \
645  errno=0; \
646  clearerr(yyjsonin); \
647  } \
648  }\
649 \
650 
651 #endif
652 
653 /* No semi-colon after return; correct usage is to write "yyterminate();" -
654  * we don't want an extra ';' after the "return" because that will cause
655  * some compilers to complain about unreachable statements.
656  */
657 #ifndef yyterminate
658 #define yyterminate() return YY_NULL
659 #endif
660 
661 /* Number of entries by which start-condition stack grows. */
662 #ifndef YY_START_STACK_INCR
663 #define YY_START_STACK_INCR 25
664 #endif
665 
666 /* Report a fatal error. */
667 #ifndef YY_FATAL_ERROR
668 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
669 #endif
670 
671 /* end tables serialization structures and prototypes */
672 
673 /* Default declaration of generated scanner - a define so the user can
674  * easily add parameters.
675  */
676 #ifndef YY_DECL
677 #define YY_DECL_IS_OURS 1
678 
679 extern int yyjsonlex (void);
680 
681 #define YY_DECL int yyjsonlex (void)
682 #endif /* !YY_DECL */
683 
684 /* Code executed at the beginning of each rule, after yyjsontext and yyjsonleng
685  * have been set up.
686  */
687 #ifndef YY_USER_ACTION
688 #define YY_USER_ACTION
689 #endif
690 
691 /* Code executed at the end of each rule. */
692 #ifndef YY_BREAK
693 #define YY_BREAK /*LINTED*/break;
694 #endif
695 
696 #define YY_RULE_SETUP \
697  YY_USER_ACTION
698 
702 {
703  yy_state_type yy_current_state;
704  char *yy_cp, *yy_bp;
705  int yy_act;
706 
707  if ( !(yy_init) )
708  {
709  (yy_init) = 1;
710 
711 #ifdef YY_USER_INIT
712  YY_USER_INIT;
713 #endif
714 
715  if ( ! (yy_start) )
716  (yy_start) = 1; /* first start state */
717 
718  if ( ! yyjsonin )
719  yyjsonin = stdin;
720 
721  if ( ! yyjsonout )
722  yyjsonout = stdout;
723 
724  if ( ! YY_CURRENT_BUFFER ) {
728  }
729 
731  }
732 
733  {
734 #line 39 "scanner.l"
735 
736 
737 #line 738 "json_lex.yy.cpp"
738 
739  while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
740  {
741  yy_cp = (yy_c_buf_p);
742 
743  /* Support of yyjsontext. */
744  *yy_cp = (yy_hold_char);
745 
746  /* yy_bp points to the position in yy_ch_buf of the start of
747  * the current run.
748  */
749  yy_bp = yy_cp;
750 
751  yy_current_state = (yy_start);
752 yy_match:
753  do
754  {
755  YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
756  if ( yy_accept[yy_current_state] )
757  {
758  (yy_last_accepting_state) = yy_current_state;
759  (yy_last_accepting_cpos) = yy_cp;
760  }
761  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
762  {
763  yy_current_state = (int) yy_def[yy_current_state];
764  if ( yy_current_state >= 43 )
765  yy_c = yy_meta[(unsigned int) yy_c];
766  }
767  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
768  ++yy_cp;
769  }
770  while ( yy_current_state != 42 );
771  yy_cp = (yy_last_accepting_cpos);
772  yy_current_state = (yy_last_accepting_state);
773 
774 yy_find_action:
775  yy_act = yy_accept[yy_current_state];
776 
778 
779 do_action: /* This label is used only to access EOF actions. */
780 
781  switch ( yy_act )
782  { /* beginning of action switch */
783  case 0: /* must back up */
784  /* undo the effects of YY_DO_BEFORE_ACTION */
785  *yy_cp = (yy_hold_char);
786  yy_cp = (yy_last_accepting_cpos);
787  yy_current_state = (yy_last_accepting_state);
788  goto yy_find_action;
789 
790 case 1:
791 /* rule 1 can match eol */
793 #line 41 "scanner.l"
794 { return TOK_STRING; }
795  YY_BREAK
796 case 2:
798 #line 42 "scanner.l"
799 { return TOK_NUMBER; }
800  YY_BREAK
801 case 3:
803 #line 43 "scanner.l"
804 { return TOK_TRUE; }
805  YY_BREAK
806 case 4:
808 #line 44 "scanner.l"
809 { return TOK_FALSE; }
810  YY_BREAK
811 case 5:
813 #line 45 "scanner.l"
814 { return TOK_NULL; }
815  YY_BREAK
816 case 6:
817 /* rule 6 can match eol */
819 #line 47 "scanner.l"
820 { /* eat */ }
821  YY_BREAK
822 case 7:
824 #line 48 "scanner.l"
825 { return yyjsontext[0]; }
826  YY_BREAK
827 case 8:
829 #line 50 "scanner.l"
830 YY_FATAL_ERROR( "flex scanner jammed" );
831  YY_BREAK
832 #line 833 "json_lex.yy.cpp"
833 case YY_STATE_EOF(INITIAL):
834  yyterminate();
835 
836  case YY_END_OF_BUFFER:
837  {
838  /* Amount of text matched not including the EOB char. */
839  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
840 
841  /* Undo the effects of YY_DO_BEFORE_ACTION. */
842  *yy_cp = (yy_hold_char);
844 
845  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
846  {
847  /* We're scanning a new file or input source. It's
848  * possible that this happened because the user
849  * just pointed yyjsonin at a new source and called
850  * yyjsonlex(). If so, then we have to assure
851  * consistency between YY_CURRENT_BUFFER and our
852  * globals. Here is the right place to do so, because
853  * this is the first action (other than possibly a
854  * back-up) that will match for the new input source.
855  */
856  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
857  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyjsonin;
858  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
859  }
860 
861  /* Note that here we test for yy_c_buf_p "<=" to the position
862  * of the first EOB in the buffer, since yy_c_buf_p will
863  * already have been incremented past the NUL character
864  * (since all states make transitions on EOB to the
865  * end-of-buffer state). Contrast this with the test
866  * in input().
867  */
868  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
869  { /* This was really a NUL. */
870  yy_state_type yy_next_state;
871 
872  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
873 
874  yy_current_state = yy_get_previous_state( );
875 
876  /* Okay, we're now positioned to make the NUL
877  * transition. We couldn't have
878  * yy_get_previous_state() go ahead and do it
879  * for us because it doesn't know how to deal
880  * with the possibility of jamming (and we don't
881  * want to build jamming into it because then it
882  * will run more slowly).
883  */
884 
885  yy_next_state = yy_try_NUL_trans( yy_current_state );
886 
887  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
888 
889  if ( yy_next_state )
890  {
891  /* Consume the NUL. */
892  yy_cp = ++(yy_c_buf_p);
893  yy_current_state = yy_next_state;
894  goto yy_match;
895  }
896 
897  else
898  {
899  yy_cp = (yy_last_accepting_cpos);
900  yy_current_state = (yy_last_accepting_state);
901  goto yy_find_action;
902  }
903  }
904 
905  else switch ( yy_get_next_buffer( ) )
906  {
907  case EOB_ACT_END_OF_FILE:
908  {
910 
911  if ( yyjsonwrap( ) )
912  {
913  /* Note: because we've taken care in
914  * yy_get_next_buffer() to have set up
915  * yyjsontext, we can now set up
916  * yy_c_buf_p so that if some total
917  * hoser (like flex itself) wants to
918  * call the scanner after we return the
919  * YY_NULL, it'll still work - another
920  * YY_NULL will get returned.
921  */
923 
924  yy_act = YY_STATE_EOF(YY_START);
925  goto do_action;
926  }
927 
928  else
929  {
930  if ( ! (yy_did_buffer_switch_on_eof) )
931  YY_NEW_FILE;
932  }
933  break;
934  }
935 
937  (yy_c_buf_p) =
938  (yytext_ptr) + yy_amount_of_matched_text;
939 
940  yy_current_state = yy_get_previous_state( );
941 
942  yy_cp = (yy_c_buf_p);
943  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
944  goto yy_match;
945 
946  case EOB_ACT_LAST_MATCH:
947  (yy_c_buf_p) =
948  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
949 
950  yy_current_state = yy_get_previous_state( );
951 
952  yy_cp = (yy_c_buf_p);
953  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
954  goto yy_find_action;
955  }
956  break;
957  }
958 
959  default:
961  "fatal flex scanner internal error--no action found" );
962  } /* end of action switch */
963  } /* end of scanning one token */
964  } /* end of user's declarations */
965 } /* end of yyjsonlex */
966 
967 /* yy_get_next_buffer - try to read in a new buffer
968  *
969  * Returns a code representing an action:
970  * EOB_ACT_LAST_MATCH -
971  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
972  * EOB_ACT_END_OF_FILE - end of file
973  */
974 static int yy_get_next_buffer (void)
975 {
976  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
977  char *source = (yytext_ptr);
978  yy_size_t number_to_move, i;
979  int ret_val;
980 
981  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
983  "fatal flex scanner internal error--end of buffer missed" );
984 
985  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
986  { /* Don't try to fill the buffer, so this is an EOF. */
987  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
988  {
989  /* We matched a single character, the EOB, so
990  * treat this as a final EOF.
991  */
992  return EOB_ACT_END_OF_FILE;
993  }
994 
995  else
996  {
997  /* We matched some text prior to the EOB, first
998  * process it.
999  */
1000  return EOB_ACT_LAST_MATCH;
1001  }
1002  }
1003 
1004  /* Try to read more data. */
1005 
1006  /* First move last chars to start of buffer. */
1007  number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1008 
1009  for ( i = 0; i < number_to_move; ++i )
1010  *(dest++) = *(source++);
1011 
1012  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1013  /* don't do the read, it's not guaranteed to return an EOF,
1014  * just force an EOF
1015  */
1016  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1017 
1018  else
1019  {
1020  int num_to_read =
1021  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1022 
1023  while ( num_to_read <= 0 )
1024  { /* Not enough room in the buffer - grow it. */
1025 
1026  /* just a shorter name for the current buffer */
1028 
1029  int yy_c_buf_p_offset =
1030  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1031 
1032  if ( b->yy_is_our_buffer )
1033  {
1034  int new_size = b->yy_buf_size * 2;
1035 
1036  if ( new_size <= 0 )
1037  b->yy_buf_size += b->yy_buf_size / 8;
1038  else
1039  b->yy_buf_size *= 2;
1040 
1041  b->yy_ch_buf = (char *)
1042  /* Include room in for 2 EOB chars. */
1043  yyjsonrealloc((void *) b->yy_ch_buf,(yy_size_t) (b->yy_buf_size + 2) );
1044  }
1045  else
1046  /* Can't grow it, we don't own it. */
1047  b->yy_ch_buf = NULL;
1048 
1049  if ( ! b->yy_ch_buf )
1051  "fatal error - scanner input buffer overflow" );
1052 
1053  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1054 
1055  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1056  number_to_move - 1;
1057 
1058  }
1059 
1060  if ( num_to_read > YY_READ_BUF_SIZE )
1061  num_to_read = YY_READ_BUF_SIZE;
1062 
1063  /* Read in more data. */
1064  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1065  (yy_n_chars), num_to_read );
1066 
1067  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1068  }
1069 
1070  if ( (yy_n_chars) == 0 )
1071  {
1072  if ( number_to_move == YY_MORE_ADJ )
1073  {
1074  ret_val = EOB_ACT_END_OF_FILE;
1076  }
1077 
1078  else
1079  {
1080  ret_val = EOB_ACT_LAST_MATCH;
1081  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1083  }
1084  }
1085 
1086  else
1087  ret_val = EOB_ACT_CONTINUE_SCAN;
1088 
1089  if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1090  /* Extend the array by 50%, plus the number we really need. */
1091  int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1092  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyjsonrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,(yy_size_t) new_size );
1093  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1094  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1095  }
1096 
1097  (yy_n_chars) += number_to_move;
1100 
1101  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1102 
1103  return ret_val;
1104 }
1105 
1106 /* yy_get_previous_state - get the state just before the EOB char was reached */
1107 
1109 {
1110  yy_state_type yy_current_state;
1111  char *yy_cp;
1112 
1113  yy_current_state = (yy_start);
1114 
1115  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1116  {
1117  YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1118  if ( yy_accept[yy_current_state] )
1119  {
1120  (yy_last_accepting_state) = yy_current_state;
1121  (yy_last_accepting_cpos) = yy_cp;
1122  }
1123  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1124  {
1125  yy_current_state = (int) yy_def[yy_current_state];
1126  if ( yy_current_state >= 43 )
1127  yy_c = yy_meta[(unsigned int) yy_c];
1128  }
1129  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1130  }
1131 
1132  return yy_current_state;
1133 }
1134 
1135 /* yy_try_NUL_trans - try to make a transition on the NUL character
1136  *
1137  * synopsis
1138  * next_state = yy_try_NUL_trans( current_state );
1139  */
1140  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1141 {
1142  int yy_is_jam;
1143  char *yy_cp = (yy_c_buf_p);
1144 
1145  YY_CHAR yy_c = 1;
1146  if ( yy_accept[yy_current_state] )
1147  {
1148  (yy_last_accepting_state) = yy_current_state;
1149  (yy_last_accepting_cpos) = yy_cp;
1150  }
1151  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1152  {
1153  yy_current_state = (int) yy_def[yy_current_state];
1154  if ( yy_current_state >= 43 )
1155  yy_c = yy_meta[(unsigned int) yy_c];
1156  }
1157  yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1158  yy_is_jam = (yy_current_state == 42);
1159 
1160  return yy_is_jam ? 0 : yy_current_state;
1161 }
1162 
1163 #ifndef YY_NO_UNPUT
1164 
1165 #endif
1166 
1167 #ifndef YY_NO_INPUT
1168 #ifdef __cplusplus
1169  static int yyinput (void)
1170 #else
1171  static int input (void)
1172 #endif
1173 
1174 {
1175  int c;
1176 
1177  *(yy_c_buf_p) = (yy_hold_char);
1178 
1179  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1180  {
1181  /* yy_c_buf_p now points to the character we want to return.
1182  * If this occurs *before* the EOB characters, then it's a
1183  * valid NUL; if not, then we've hit the end of the buffer.
1184  */
1185  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1186  /* This was really a NUL. */
1187  *(yy_c_buf_p) = '\0';
1188 
1189  else
1190  { /* need more input */
1191  int offset = (yy_c_buf_p) - (yytext_ptr);
1192  ++(yy_c_buf_p);
1193 
1194  switch ( yy_get_next_buffer( ) )
1195  {
1196  case EOB_ACT_LAST_MATCH:
1197  /* This happens because yy_g_n_b()
1198  * sees that we've accumulated a
1199  * token and flags that we need to
1200  * try matching the token before
1201  * proceeding. But for input(),
1202  * there's no matching to consider.
1203  * So convert the EOB_ACT_LAST_MATCH
1204  * to EOB_ACT_END_OF_FILE.
1205  */
1206 
1207  /* Reset buffer status. */
1209 
1210  /*FALLTHROUGH*/
1211 
1212  case EOB_ACT_END_OF_FILE:
1213  {
1214  if ( yyjsonwrap( ) )
1215  return 0;
1216 
1217  if ( ! (yy_did_buffer_switch_on_eof) )
1218  YY_NEW_FILE;
1219 #ifdef __cplusplus
1220  return yyinput();
1221 #else
1222  return input();
1223 #endif
1224  }
1225 
1226  case EOB_ACT_CONTINUE_SCAN:
1227  (yy_c_buf_p) = (yytext_ptr) + offset;
1228  break;
1229  }
1230  }
1231  }
1232 
1233  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1234  *(yy_c_buf_p) = '\0'; /* preserve yyjsontext */
1235  (yy_hold_char) = *++(yy_c_buf_p);
1236 
1237  return c;
1238 }
1239 #endif /* ifndef YY_NO_INPUT */
1240 
1246  void yyjsonrestart (FILE * input_file )
1247 {
1248 
1249  if ( ! YY_CURRENT_BUFFER ){
1253  }
1254 
1257 }
1258 
1264 {
1265 
1266  /* TODO. We should be able to replace this entire function body
1267  * with
1268  * yyjsonpop_buffer_state();
1269  * yyjsonpush_buffer_state(new_buffer);
1270  */
1272  if ( YY_CURRENT_BUFFER == new_buffer )
1273  return;
1274 
1275  if ( YY_CURRENT_BUFFER )
1276  {
1277  /* Flush out information for old buffer. */
1278  *(yy_c_buf_p) = (yy_hold_char);
1279  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1280  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1281  }
1282 
1283  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1285 
1286  /* We don't actually know whether we did this switch during
1287  * EOF (yyjsonwrap()) processing, but the only time this flag
1288  * is looked at is after yyjsonwrap() is called, so it's safe
1289  * to go ahead and always set it.
1290  */
1292 }
1293 
1294 static void yyjson_load_buffer_state (void)
1295 {
1296  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1297  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1298  yyjsonin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1299  (yy_hold_char) = *(yy_c_buf_p);
1300 }
1301 
1309 {
1310  YY_BUFFER_STATE b;
1311 
1312  b = (YY_BUFFER_STATE) yyjsonalloc(sizeof( struct yy_buffer_state ) );
1313  if ( ! b )
1314  YY_FATAL_ERROR( "out of dynamic memory in yyjson_create_buffer()" );
1315 
1316  b->yy_buf_size = size;
1317 
1318  /* yy_ch_buf has to be 2 characters longer than the size given because
1319  * we need to put in 2 end-of-buffer characters.
1320  */
1321  b->yy_ch_buf = (char *) yyjsonalloc((yy_size_t) (b->yy_buf_size + 2) );
1322  if ( ! b->yy_ch_buf )
1323  YY_FATAL_ERROR( "out of dynamic memory in yyjson_create_buffer()" );
1324 
1325  b->yy_is_our_buffer = 1;
1326 
1328 
1329  return b;
1330 }
1331 
1337 {
1338 
1339  if ( ! b )
1340  return;
1341 
1342  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1344 
1345  if ( b->yy_is_our_buffer )
1346  yyjsonfree((void *) b->yy_ch_buf );
1347 
1348  yyjsonfree((void *) b );
1349 }
1350 
1351 /* Initializes or reinitializes a buffer.
1352  * This function is sometimes called more than once on the same buffer,
1353  * such as during a yyjsonrestart() or at EOF.
1354  */
1355  static void yyjson_init_buffer (YY_BUFFER_STATE b, FILE * file )
1356 
1357 {
1358  int oerrno = errno;
1359 
1360  yyjson_flush_buffer(b );
1361 
1362  b->yy_input_file = file;
1363  b->yy_fill_buffer = 1;
1364 
1365  /* If b is the current buffer, then yyjson_init_buffer was _probably_
1366  * called from yyjsonrestart() or through yy_get_next_buffer.
1367  * In that case, we don't want to reset the lineno or column.
1368  */
1369  if (b != YY_CURRENT_BUFFER){
1370  b->yy_bs_lineno = 1;
1371  b->yy_bs_column = 0;
1372  }
1373 
1374  b->yy_is_interactive = 0;
1375 
1376  errno = oerrno;
1377 }
1378 
1384 {
1385  if ( ! b )
1386  return;
1387 
1388  b->yy_n_chars = 0;
1389 
1390  /* We always need two end-of-buffer characters. The first causes
1391  * a transition to the end-of-buffer state. The second causes
1392  * a jam in that state.
1393  */
1396 
1397  b->yy_buf_pos = &b->yy_ch_buf[0];
1398 
1399  b->yy_at_bol = 1;
1401 
1402  if ( b == YY_CURRENT_BUFFER )
1404 }
1405 
1413 {
1414  if (new_buffer == NULL)
1415  return;
1416 
1418 
1419  /* This block is copied from yyjson_switch_to_buffer. */
1420  if ( YY_CURRENT_BUFFER )
1421  {
1422  /* Flush out information for old buffer. */
1423  *(yy_c_buf_p) = (yy_hold_char);
1424  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1425  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1426  }
1427 
1428  /* Only push if top exists. Otherwise, replace top. */
1429  if (YY_CURRENT_BUFFER)
1430  (yy_buffer_stack_top)++;
1431  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1432 
1433  /* copied from yyjson_switch_to_buffer. */
1436 }
1437 
1443 {
1444  if (!YY_CURRENT_BUFFER)
1445  return;
1446 
1448  YY_CURRENT_BUFFER_LVALUE = NULL;
1449  if ((yy_buffer_stack_top) > 0)
1450  --(yy_buffer_stack_top);
1451 
1452  if (YY_CURRENT_BUFFER) {
1455  }
1456 }
1457 
1458 /* Allocates the stack if it does not exist.
1459  * Guarantees space for at least one push.
1460  */
1461 static void yyjsonensure_buffer_stack (void)
1462 {
1463  int num_to_alloc;
1464 
1465  if (!(yy_buffer_stack)) {
1466 
1467  /* First allocation is just for 2 elements, since we don't know if this
1468  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1469  * immediate realloc on the next call.
1470  */
1471  num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1473  (num_to_alloc * sizeof(struct yy_buffer_state*)
1474  );
1475  if ( ! (yy_buffer_stack) )
1476  YY_FATAL_ERROR( "out of dynamic memory in yyjsonensure_buffer_stack()" );
1477 
1478  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1479 
1480  (yy_buffer_stack_max) = num_to_alloc;
1481  (yy_buffer_stack_top) = 0;
1482  return;
1483  }
1484 
1485  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1486 
1487  /* Increase the buffer to prepare for a possible push. */
1488  yy_size_t grow_size = 8 /* arbitrary grow size */;
1489 
1490  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1492  ((yy_buffer_stack),
1493  num_to_alloc * sizeof(struct yy_buffer_state*)
1494  );
1495  if ( ! (yy_buffer_stack) )
1496  YY_FATAL_ERROR( "out of dynamic memory in yyjsonensure_buffer_stack()" );
1497 
1498  /* zero only the new slots.*/
1499  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1500  (yy_buffer_stack_max) = num_to_alloc;
1501  }
1502 }
1503 
1511 {
1512  YY_BUFFER_STATE b;
1513 
1514  if ( size < 2 ||
1515  base[size-2] != YY_END_OF_BUFFER_CHAR ||
1516  base[size-1] != YY_END_OF_BUFFER_CHAR )
1517  /* They forgot to leave room for the EOB's. */
1518  return NULL;
1519 
1520  b = (YY_BUFFER_STATE) yyjsonalloc(sizeof( struct yy_buffer_state ) );
1521  if ( ! b )
1522  YY_FATAL_ERROR( "out of dynamic memory in yyjson_scan_buffer()" );
1523 
1524  b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1525  b->yy_buf_pos = b->yy_ch_buf = base;
1526  b->yy_is_our_buffer = 0;
1527  b->yy_input_file = NULL;
1528  b->yy_n_chars = b->yy_buf_size;
1529  b->yy_is_interactive = 0;
1530  b->yy_at_bol = 1;
1531  b->yy_fill_buffer = 0;
1533 
1535 
1536  return b;
1537 }
1538 
1548 {
1549 
1550  return yyjson_scan_bytes(yystr,(int) strlen(yystr) );
1551 }
1552 
1560 YY_BUFFER_STATE yyjson_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1561 {
1562  YY_BUFFER_STATE b;
1563  char *buf;
1564  yy_size_t n;
1565  yy_size_t i;
1566 
1567  /* Get memory for full buffer, including space for trailing EOB's. */
1568  n = (yy_size_t) _yybytes_len + 2;
1569  buf = (char *) yyjsonalloc(n );
1570  if ( ! buf )
1571  YY_FATAL_ERROR( "out of dynamic memory in yyjson_scan_bytes()" );
1572 
1573  for ( i = 0; i < _yybytes_len; ++i )
1574  buf[i] = yybytes[i];
1575 
1576  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1577 
1578  b = yyjson_scan_buffer(buf,n );
1579  if ( ! b )
1580  YY_FATAL_ERROR( "bad buffer in yyjson_scan_bytes()" );
1581 
1582  /* It's okay to grow etc. this buffer, and we should throw it
1583  * away when we're done.
1584  */
1585  b->yy_is_our_buffer = 1;
1586 
1587  return b;
1588 }
1589 
1590 #ifndef YY_EXIT_FAILURE
1591 #define YY_EXIT_FAILURE 2
1592 #endif
1593 
1594 static void yynoreturn yy_fatal_error (yyconst char* msg )
1595 {
1596  (void) fprintf( stderr, "%s\n", msg );
1597  exit( YY_EXIT_FAILURE );
1598 }
1599 
1600 /* Redefine yyless() so it works in section 3 code. */
1601 
1602 #undef yyless
1603 #define yyless(n) \
1604  do \
1605  { \
1606  /* Undo effects of setting up yyjsontext. */ \
1607  yy_size_t yyless_macro_arg = (n); \
1608  YY_LESS_LINENO(yyless_macro_arg);\
1609  yyjsontext[yyjsonleng] = (yy_hold_char); \
1610  (yy_c_buf_p) = yyjsontext + yyless_macro_arg; \
1611  (yy_hold_char) = *(yy_c_buf_p); \
1612  *(yy_c_buf_p) = '\0'; \
1613  yyjsonleng = yyless_macro_arg; \
1614  } \
1615  while ( 0 )
1616 
1617 /* Accessor methods (get/set functions) to struct members. */
1618 
1623 {
1624 
1625  return yyjsonlineno;
1626 }
1627 
1631 FILE *yyjsonget_in (void)
1632 {
1633  return yyjsonin;
1634 }
1635 
1639 FILE *yyjsonget_out (void)
1640 {
1641  return yyjsonout;
1642 }
1643 
1647 int yyjsonget_leng (void)
1648 {
1649  return yyjsonleng;
1650 }
1651 
1656 char *yyjsonget_text (void)
1657 {
1658  return yyjsontext;
1659 }
1660 
1665 void yyjsonset_lineno (int _line_number )
1666 {
1667 
1668  yyjsonlineno = _line_number;
1669 }
1670 
1677 void yyjsonset_in (FILE * _in_str )
1678 {
1679  yyjsonin = _in_str ;
1680 }
1681 
1682 void yyjsonset_out (FILE * _out_str )
1683 {
1684  yyjsonout = _out_str ;
1685 }
1686 
1688 {
1689  return yyjson_flex_debug;
1690 }
1691 
1692 void yyjsonset_debug (int _bdebug )
1693 {
1694  yyjson_flex_debug = _bdebug ;
1695 }
1696 
1697 static int yy_init_globals (void)
1698 {
1699  /* Initialization is the same as for the non-reentrant scanner.
1700  * This function is called from yyjsonlex_destroy(), so don't allocate here.
1701  */
1702 
1703  (yy_buffer_stack) = NULL;
1704  (yy_buffer_stack_top) = 0;
1705  (yy_buffer_stack_max) = 0;
1706  (yy_c_buf_p) = NULL;
1707  (yy_init) = 0;
1708  (yy_start) = 0;
1709 
1710 /* Defined in main.c */
1711 #ifdef YY_STDINIT
1712  yyjsonin = stdin;
1713  yyjsonout = stdout;
1714 #else
1715  yyjsonin = NULL;
1716  yyjsonout = NULL;
1717 #endif
1718 
1719  /* For future reference: Set errno on error, since we are called by
1720  * yyjsonlex_init()
1721  */
1722  return 0;
1723 }
1724 
1725 /* yyjsonlex_destroy is for both reentrant and non-reentrant scanners. */
1727 {
1728 
1729  /* Pop the buffer stack, destroying each element. */
1730  while(YY_CURRENT_BUFFER){
1732  YY_CURRENT_BUFFER_LVALUE = NULL;
1734  }
1735 
1736  /* Destroy the stack itself. */
1738  (yy_buffer_stack) = NULL;
1739 
1740  /* Reset the globals. This is important in a non-reentrant scanner so the next time
1741  * yyjsonlex() is called, initialization will occur. */
1742  yy_init_globals( );
1743 
1744  return 0;
1745 }
1746 
1747 /*
1748  * Internal utility routines.
1749  */
1750 
1751 #ifndef yytext_ptr
1752 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1753 {
1754 
1755  int i;
1756  for ( i = 0; i < n; ++i )
1757  s1[i] = s2[i];
1758 }
1759 #endif
1760 
1761 #ifdef YY_NEED_STRLEN
1762 static int yy_flex_strlen (yyconst char * s )
1763 {
1764  int n;
1765  for ( n = 0; s[n]; ++n )
1766  ;
1767 
1768  return n;
1769 }
1770 #endif
1771 
1772 void *yyjsonalloc (yy_size_t size )
1773 {
1774  return malloc(size);
1775 }
1776 
1777 void *yyjsonrealloc (void * ptr, yy_size_t size )
1778 {
1779 
1780  /* The cast to (char *) in the following accommodates both
1781  * implementations that use char* generic pointers, and those
1782  * that use void* generic pointers. It works with the latter
1783  * because both ANSI C and C++ allow castless assignment from
1784  * any pointer type to void*, and deal with argument conversions
1785  * as though doing an assignment.
1786  */
1787  return realloc(ptr, size);
1788 }
1789 
1790 void yyjsonfree (void * ptr )
1791 {
1792  free( (char *) ptr ); /* see yyjsonrealloc() for (char *) cast */
1793 }
1794 
1795 #define YYTABLES_NAME "yytables"
1796 
1797 #line 50 "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:214
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
flex_int32_t yy_verify
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
static int yy_n_chars
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)
flex_int32_t yy_nxt
#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