blob: 105791be8769478d8dd91677c04a107686daf717 [file] [log] [blame]
Sol Boucher69b88bf2015-02-26 11:47:19 -08001
Sol Boucher69b88bf2015-02-26 11:47:19 -08002#define YY_INT_ALIGNED short int
3
4/* A lexical scanner generated by flex */
5
6#define FLEX_SCANNER
7#define YY_FLEX_MAJOR_VERSION 2
Patrick Georgi2b807342016-06-28 20:45:34 +02008#define YY_FLEX_MINOR_VERSION 6
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08009#define YY_FLEX_SUBMINOR_VERSION 4
Sol Boucher69b88bf2015-02-26 11:47:19 -080010#if YY_FLEX_SUBMINOR_VERSION > 0
11#define FLEX_BETA
12#endif
13
14/* First, we deal with platform-specific or compiler-specific issues. */
15
16/* begin standard C headers. */
17#include <stdio.h>
18#include <string.h>
19#include <errno.h>
20#include <stdlib.h>
21
22/* end standard C headers. */
23
24/* flex integer type definitions */
25
26#ifndef FLEXINT_H
27#define FLEXINT_H
28
29/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
30
31#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
32
33/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
Martin Roth5c734132021-02-14 13:52:00 -070034 * if you want the limit (max/min) macros for int types.
Sol Boucher69b88bf2015-02-26 11:47:19 -080035 */
36#ifndef __STDC_LIMIT_MACROS
37#define __STDC_LIMIT_MACROS 1
38#endif
39
40#include <inttypes.h>
41typedef int8_t flex_int8_t;
42typedef uint8_t flex_uint8_t;
43typedef int16_t flex_int16_t;
44typedef uint16_t flex_uint16_t;
45typedef int32_t flex_int32_t;
46typedef uint32_t flex_uint32_t;
47#else
48typedef signed char flex_int8_t;
49typedef short int flex_int16_t;
50typedef int flex_int32_t;
Martin Roth5c734132021-02-14 13:52:00 -070051typedef unsigned char flex_uint8_t;
Sol Boucher69b88bf2015-02-26 11:47:19 -080052typedef unsigned short int flex_uint16_t;
53typedef unsigned int flex_uint32_t;
54
55/* Limits of integral types. */
56#ifndef INT8_MIN
57#define INT8_MIN (-128)
58#endif
59#ifndef INT16_MIN
60#define INT16_MIN (-32767-1)
61#endif
62#ifndef INT32_MIN
63#define INT32_MIN (-2147483647-1)
64#endif
65#ifndef INT8_MAX
66#define INT8_MAX (127)
67#endif
68#ifndef INT16_MAX
69#define INT16_MAX (32767)
70#endif
71#ifndef INT32_MAX
72#define INT32_MAX (2147483647)
73#endif
74#ifndef UINT8_MAX
75#define UINT8_MAX (255U)
76#endif
77#ifndef UINT16_MAX
78#define UINT16_MAX (65535U)
79#endif
80#ifndef UINT32_MAX
81#define UINT32_MAX (4294967295U)
82#endif
83
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +080084#ifndef SIZE_MAX
85#define SIZE_MAX (~(size_t)0)
86#endif
87
Sol Boucher69b88bf2015-02-26 11:47:19 -080088#endif /* ! C99 */
89
90#endif /* ! FLEXINT_H */
91
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +080092/* begin standard C++ headers. */
93
Hung-Te Lin9497fcb2019-03-04 14:28:37 +080094/* TODO: this is always defined, so inline it */
Sol Boucher69b88bf2015-02-26 11:47:19 -080095#define yyconst const
Hung-Te Lin9497fcb2019-03-04 14:28:37 +080096
97#if defined(__GNUC__) && __GNUC__ >= 3
98#define yynoreturn __attribute__((__noreturn__))
Sol Boucher69b88bf2015-02-26 11:47:19 -080099#else
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800100#define yynoreturn
Sol Boucher69b88bf2015-02-26 11:47:19 -0800101#endif
102
103/* Returned upon end-of-file. */
104#define YY_NULL 0
105
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800106/* Promotes a possibly negative, possibly signed char to an
107 * integer in range [0..255] for use as an array index.
Sol Boucher69b88bf2015-02-26 11:47:19 -0800108 */
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800109#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
Sol Boucher69b88bf2015-02-26 11:47:19 -0800110
111/* Enter a start condition. This macro really ought to take a parameter,
112 * but we do it the disgusting crufty way forced on us by the ()-less
113 * definition of BEGIN.
114 */
115#define BEGIN (yy_start) = 1 + 2 *
Sol Boucher69b88bf2015-02-26 11:47:19 -0800116/* Translate the current start state into a value that can be later handed
117 * to BEGIN to return to the state. The YYSTATE alias is for lex
118 * compatibility.
119 */
120#define YY_START (((yy_start) - 1) / 2)
121#define YYSTATE YY_START
Sol Boucher69b88bf2015-02-26 11:47:19 -0800122/* Action number for EOF rule of a given start state. */
123#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
Sol Boucher69b88bf2015-02-26 11:47:19 -0800124/* Special action meaning "start processing a new file". */
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800125#define YY_NEW_FILE yyrestart( yyin )
Sol Boucher69b88bf2015-02-26 11:47:19 -0800126#define YY_END_OF_BUFFER_CHAR 0
127
128/* Size of default input buffer. */
129#ifndef YY_BUF_SIZE
130#ifdef __ia64__
131/* On IA-64, the buffer size is 16k, not 8k.
132 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
133 * Ditto for the __ia64__ case accordingly.
134 */
135#define YY_BUF_SIZE 32768
136#else
137#define YY_BUF_SIZE 16384
138#endif /* __ia64__ */
139#endif
140
141/* The state buf must be large enough to hold one state per character in the main buffer.
142 */
143#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
144
145#ifndef YY_TYPEDEF_YY_BUFFER_STATE
146#define YY_TYPEDEF_YY_BUFFER_STATE
147typedef struct yy_buffer_state *YY_BUFFER_STATE;
148#endif
149
150#ifndef YY_TYPEDEF_YY_SIZE_T
151#define YY_TYPEDEF_YY_SIZE_T
152typedef size_t yy_size_t;
153#endif
154
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800155extern int yyleng;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800156
157extern FILE *yyin, *yyout;
158
159#define EOB_ACT_CONTINUE_SCAN 0
160#define EOB_ACT_END_OF_FILE 1
161#define EOB_ACT_LAST_MATCH 2
162
163 #define YY_LESS_LINENO(n)
164 #define YY_LINENO_REWIND_TO(ptr)
Martin Roth5c734132021-02-14 13:52:00 -0700165
Sol Boucher69b88bf2015-02-26 11:47:19 -0800166/* Return all but the first "n" matched characters back to the input stream. */
167#define yyless(n) \
168 do \
169 { \
170 /* Undo effects of setting up yytext. */ \
171 int yyless_macro_arg = (n); \
172 YY_LESS_LINENO(yyless_macro_arg);\
173 *yy_cp = (yy_hold_char); \
174 YY_RESTORE_YY_MORE_OFFSET \
175 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
176 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
177 } \
178 while ( 0 )
Sol Boucher69b88bf2015-02-26 11:47:19 -0800179#define unput(c) yyunput( c, (yytext_ptr) )
180
181#ifndef YY_STRUCT_YY_BUFFER_STATE
182#define YY_STRUCT_YY_BUFFER_STATE
183struct yy_buffer_state
184 {
185 FILE *yy_input_file;
186
187 char *yy_ch_buf; /* input buffer */
188 char *yy_buf_pos; /* current position in input buffer */
189
190 /* Size of input buffer in bytes, not including room for EOB
191 * characters.
192 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800193 int yy_buf_size;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800194
195 /* Number of characters read into yy_ch_buf, not including EOB
196 * characters.
197 */
Patrick Georgi2b807342016-06-28 20:45:34 +0200198 int yy_n_chars;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800199
200 /* Whether we "own" the buffer - i.e., we know we created it,
201 * and can realloc() it to grow it, and should free() it to
202 * delete it.
203 */
204 int yy_is_our_buffer;
205
206 /* Whether this is an "interactive" input source; if so, and
207 * if we're using stdio for input, then we want to use getc()
208 * instead of fread(), to make sure we stop fetching input after
209 * each newline.
210 */
211 int yy_is_interactive;
212
213 /* Whether we're considered to be at the beginning of a line.
214 * If so, '^' rules will be active on the next match, otherwise
215 * not.
216 */
217 int yy_at_bol;
218
219 int yy_bs_lineno; /**< The line count. */
220 int yy_bs_column; /**< The column count. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800221
Sol Boucher69b88bf2015-02-26 11:47:19 -0800222 /* Whether to try to fill the input buffer when we reach the
223 * end of it.
224 */
225 int yy_fill_buffer;
226
227 int yy_buffer_status;
228
229#define YY_BUFFER_NEW 0
230#define YY_BUFFER_NORMAL 1
231 /* When an EOF's been seen but there's still some text to process
232 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
233 * shouldn't try reading from the input source any more. We might
234 * still have a bunch of tokens to match, though, because of
235 * possible backing-up.
236 *
237 * When we actually see the EOF, we change the status to "new"
238 * (via yyrestart()), so that the user can continue scanning by
239 * just pointing yyin at a new input file.
240 */
241#define YY_BUFFER_EOF_PENDING 2
242
243 };
244#endif /* !YY_STRUCT_YY_BUFFER_STATE */
245
246/* Stack of input buffers. */
247static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
248static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800249static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
Sol Boucher69b88bf2015-02-26 11:47:19 -0800250
251/* We provide macros for accessing buffer states in case in the
252 * future we want to put the buffer states in a more general
253 * "scanner state".
254 *
255 * Returns the top of the stack, or NULL.
256 */
257#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
258 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
259 : NULL)
Sol Boucher69b88bf2015-02-26 11:47:19 -0800260/* Same as previous macro, but useful when we know that the buffer stack is not
261 * NULL or when we need an lvalue. For internal use only.
262 */
263#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
264
265/* yy_hold_char holds the character lost when yytext is formed. */
266static char yy_hold_char;
Patrick Georgi2b807342016-06-28 20:45:34 +0200267static int yy_n_chars; /* number of characters read into yy_ch_buf */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800268int yyleng;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800269
270/* Points to current character in buffer. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800271static char *yy_c_buf_p = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800272static int yy_init = 0; /* whether we need to initialize */
273static int yy_start = 0; /* start state number */
274
275/* Flag which is used to allow yywrap()'s to do buffer switches
276 * instead of setting up a fresh yyin. A bit of a hack ...
277 */
278static int yy_did_buffer_switch_on_eof;
279
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800280void yyrestart ( FILE *input_file );
281void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
282YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
283void yy_delete_buffer ( YY_BUFFER_STATE b );
284void yy_flush_buffer ( YY_BUFFER_STATE b );
285void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
286void yypop_buffer_state ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800287
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800288static void yyensure_buffer_stack ( void );
289static void yy_load_buffer_state ( void );
290static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
291#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
Sol Boucher69b88bf2015-02-26 11:47:19 -0800292
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800293YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
294YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
295YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800296
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800297void *yyalloc ( yy_size_t );
298void *yyrealloc ( void *, yy_size_t );
299void yyfree ( void * );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800300
301#define yy_new_buffer yy_create_buffer
Sol Boucher69b88bf2015-02-26 11:47:19 -0800302#define yy_set_interactive(is_interactive) \
303 { \
304 if ( ! YY_CURRENT_BUFFER ){ \
305 yyensure_buffer_stack (); \
306 YY_CURRENT_BUFFER_LVALUE = \
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800307 yy_create_buffer( yyin, YY_BUF_SIZE ); \
Sol Boucher69b88bf2015-02-26 11:47:19 -0800308 } \
309 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
310 }
Sol Boucher69b88bf2015-02-26 11:47:19 -0800311#define yy_set_bol(at_bol) \
312 { \
313 if ( ! YY_CURRENT_BUFFER ){\
314 yyensure_buffer_stack (); \
315 YY_CURRENT_BUFFER_LVALUE = \
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800316 yy_create_buffer( yyin, YY_BUF_SIZE ); \
Sol Boucher69b88bf2015-02-26 11:47:19 -0800317 } \
318 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
319 }
Sol Boucher69b88bf2015-02-26 11:47:19 -0800320#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
321
322/* Begin user sect3 */
323
Patrick Georgi2b807342016-06-28 20:45:34 +0200324#define yywrap() (/*CONSTCOND*/1)
Sol Boucher69b88bf2015-02-26 11:47:19 -0800325#define YY_SKIP_YYWRAP
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800326typedef flex_uint8_t YY_CHAR;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800327
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800328FILE *yyin = NULL, *yyout = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800329
330typedef int yy_state_type;
331
332extern int yylineno;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800333int yylineno = 1;
334
335extern char *yytext;
Patrick Georgi2b807342016-06-28 20:45:34 +0200336#ifdef yytext_ptr
337#undef yytext_ptr
338#endif
Sol Boucher69b88bf2015-02-26 11:47:19 -0800339#define yytext_ptr yytext
340
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800341static yy_state_type yy_get_previous_state ( void );
342static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
343static int yy_get_next_buffer ( void );
344static void yynoreturn yy_fatal_error ( const char* msg );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800345
346/* Done after the current pattern has been matched and before the
347 * corresponding action - sets up yytext.
348 */
349#define YY_DO_BEFORE_ACTION \
350 (yytext_ptr) = yy_bp; \
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800351 yyleng = (int) (yy_cp - yy_bp); \
Sol Boucher69b88bf2015-02-26 11:47:19 -0800352 (yy_hold_char) = *yy_cp; \
353 *yy_cp = '\0'; \
354 (yy_c_buf_p) = yy_cp;
Hung-Te Lin49a44502019-03-04 15:41:09 +0800355#define YY_NUM_RULES 13
356#define YY_END_OF_BUFFER 14
Sol Boucher69b88bf2015-02-26 11:47:19 -0800357/* This struct is not used in this scanner,
358 but its presence is necessary. */
359struct yy_trans_info
360 {
361 flex_int32_t yy_verify;
362 flex_int32_t yy_nxt;
363 };
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800364static const flex_int16_t yy_accept[40] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800365 { 0,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800366 11, 11, 11, 11, 14, 11, 1, 1, 12, 3,
367 12, 7, 8, 4, 11, 11, 11, 1, 0, 2,
368 9, 7, 11, 8, 8, 11, 11, 9, 10, 11,
369 11, 10, 5, 11, 11, 11, 11, 6, 0
Sol Boucher69b88bf2015-02-26 11:47:19 -0800370 } ;
371
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800372static const YY_CHAR yy_ec[256] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800373 { 0,
374 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
375 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 2, 1, 1, 4, 1, 1, 1, 1, 5,
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800378 6, 1, 1, 1, 1, 1, 1, 7, 8, 8,
379 8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800380 1, 1, 1, 9, 10, 11, 12, 10, 13, 14,
381 15, 1, 1, 1, 15, 1, 15, 1, 1, 16,
382 1, 17, 18, 1, 1, 19, 1, 20, 1, 1,
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800383 1, 1, 1, 1, 1, 1, 10, 10, 10, 10,
Sol Boucher69b88bf2015-02-26 11:47:19 -0800384
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800385 10, 10, 1, 1, 1, 1, 1, 1, 1, 1,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800386 1, 1, 1, 1, 1, 1, 1, 1, 1, 20,
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800387 1, 1, 9, 1, 9, 1, 1, 1, 1, 1,
Sol Boucher69b88bf2015-02-26 11:47:19 -0800388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1
402 } ;
403
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800404static const YY_CHAR yy_meta[21] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800405 { 0,
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800406 1, 2, 2, 2, 2, 2, 1, 1, 2, 1,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Sol Boucher69b88bf2015-02-26 11:47:19 -0800408 } ;
409
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800410static const flex_int16_t yy_base[43] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800411 { 0,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800412 0, 8, 12, 13, 63, 0, 18, 20, 59, 64,
413 64, 23, 19, 64, 50, 43, 0, 30, 56, 64,
414 20, 0, 37, 0, 0, 44, 44, 0, 41, 28,
415 24, 0, 0, 28, 22, 18, 23, 0, 64, 51,
416 0, 53
Sol Boucher69b88bf2015-02-26 11:47:19 -0800417 } ;
418
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800419static const flex_int16_t yy_def[43] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800420 { 0,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800421 40, 40, 2, 2, 39, 41, 39, 39, 42, 39,
422 39, 41, 41, 39, 41, 41, 41, 39, 42, 39,
423 12, 41, 41, 13, 41, 41, 41, 41, 23, 41,
424 41, 41, 41, 41, 41, 41, 41, 41, 0, 39,
425 39, 39
Sol Boucher69b88bf2015-02-26 11:47:19 -0800426 } ;
427
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800428static const flex_int16_t yy_nxt[85] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800429 { 0,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800430 17, 7, 8, 9, 10, 11, 12, 13, 11, 7,
431 8, 9, 10, 11, 12, 13, 11, 14, 14, 18,
432 18, 18, 18, 15, 15, 24, 24, 16, 16, 21,
433 21, 18, 18, 25, 28, 38, 37, 22, 36, 17,
434 35, 34, 23, 29, 29, 33, 29, 29, 29, 29,
435 29, 6, 6, 19, 19, 32, 31, 30, 20, 27,
436 26, 20, 39, 5, 39, 39, 39, 39, 39, 39,
437 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
438 39, 39, 39, 39
Sol Boucher69b88bf2015-02-26 11:47:19 -0800439 } ;
440
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800441static const flex_int16_t yy_chk[85] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800442 { 0,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800443 41, 1, 1, 1, 1, 1, 1, 1, 1, 2,
444 2, 2, 2, 2, 2, 2, 2, 3, 4, 7,
445 7, 8, 8, 3, 4, 13, 13, 3, 4, 12,
446 12, 18, 18, 13, 21, 37, 36, 12, 35, 21,
447 34, 31, 12, 23, 23, 30, 23, 23, 23, 23,
448 23, 40, 40, 42, 42, 29, 27, 26, 19, 16,
449 15, 9, 5, 39, 39, 39, 39, 39, 39, 39,
450 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
451 39, 39, 39, 39
Sol Boucher69b88bf2015-02-26 11:47:19 -0800452 } ;
453
454static yy_state_type yy_last_accepting_state;
455static char *yy_last_accepting_cpos;
456
457extern int yy_flex_debug;
458int yy_flex_debug = 0;
459
460/* The intent behind this definition is that it'll catch
461 * any uses of REJECT which flex missed.
462 */
463#define REJECT reject_used_but_not_detected
464#define yymore() yymore_used_but_not_detected
465#define YY_MORE_ADJ 0
466#define YY_RESTORE_YY_MORE_OFFSET
467char *yytext;
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800468/* scanner generator for flashmap descriptor language */
469/* SPDX-License-Identifier: GPL-2.0-only */
Sol Boucher69b88bf2015-02-26 11:47:19 -0800470#include "fmd_parser.h"
471
472#include <assert.h>
473#include <string.h>
474
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +0200475int parse_integer(char *src, int base);
476int copy_string(const char *src);
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800477
Sol Boucher69b88bf2015-02-26 11:47:19 -0800478#define INITIAL 0
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800479#define FLAGS 1
Sol Boucher69b88bf2015-02-26 11:47:19 -0800480
481#ifndef YY_NO_UNISTD_H
482/* Special case for "unistd.h", since it is non-ANSI. We include it way
483 * down here because we want the user's section 1 to have been scanned first.
484 * The user has a chance to override it with an option.
485 */
486#include <unistd.h>
487#endif
488
489#ifndef YY_EXTRA_TYPE
490#define YY_EXTRA_TYPE void *
491#endif
492
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800493static int yy_init_globals ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800494
495/* Accessor methods to globals.
496 These are made visible to non-reentrant scanners for convenience. */
497
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800498int yylex_destroy ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800499
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800500int yyget_debug ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800501
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800502void yyset_debug ( int debug_flag );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800503
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800504YY_EXTRA_TYPE yyget_extra ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800505
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800506void yyset_extra ( YY_EXTRA_TYPE user_defined );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800507
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800508FILE *yyget_in ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800509
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800510void yyset_in ( FILE * _in_str );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800511
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800512FILE *yyget_out ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800513
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800514void yyset_out ( FILE * _out_str );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800515
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800516 int yyget_leng ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800517
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800518char *yyget_text ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800519
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800520int yyget_lineno ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800521
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800522void yyset_lineno ( int _line_number );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800523
524/* Macros after this point can all be overridden by user definitions in
525 * section 1.
526 */
527
528#ifndef YY_SKIP_YYWRAP
529#ifdef __cplusplus
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800530extern "C" int yywrap ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800531#else
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800532extern int yywrap ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800533#endif
534#endif
535
Patrick Georgi2b807342016-06-28 20:45:34 +0200536#ifndef YY_NO_UNPUT
Martin Roth5c734132021-02-14 13:52:00 -0700537
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800538 static void yyunput ( int c, char *buf_ptr );
Martin Roth5c734132021-02-14 13:52:00 -0700539
Patrick Georgi2b807342016-06-28 20:45:34 +0200540#endif
541
Sol Boucher69b88bf2015-02-26 11:47:19 -0800542#ifndef yytext_ptr
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800543static void yy_flex_strncpy ( char *, const char *, int );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800544#endif
545
546#ifdef YY_NEED_STRLEN
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800547static int yy_flex_strlen ( const char * );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800548#endif
549
550#ifndef YY_NO_INPUT
Sol Boucher69b88bf2015-02-26 11:47:19 -0800551#ifdef __cplusplus
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800552static int yyinput ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800553#else
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800554static int input ( void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800555#endif
556
557#endif
558
559/* Amount of stuff to slurp up with each read. */
560#ifndef YY_READ_BUF_SIZE
561#ifdef __ia64__
562/* On IA-64, the buffer size is 16k, not 8k */
563#define YY_READ_BUF_SIZE 16384
564#else
565#define YY_READ_BUF_SIZE 8192
566#endif /* __ia64__ */
567#endif
568
569/* Copy whatever the last rule matched to the standard output. */
570#ifndef ECHO
571/* This used to be an fputs(), but since the string might contain NUL's,
572 * we now use fwrite().
573 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800574#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
Sol Boucher69b88bf2015-02-26 11:47:19 -0800575#endif
576
577/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
578 * is returned in "result".
579 */
580#ifndef YY_INPUT
581#define YY_INPUT(buf,result,max_size) \
582 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
583 { \
584 int c = '*'; \
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800585 int n; \
Sol Boucher69b88bf2015-02-26 11:47:19 -0800586 for ( n = 0; n < max_size && \
587 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
588 buf[n] = (char) c; \
589 if ( c == '\n' ) \
590 buf[n++] = (char) c; \
591 if ( c == EOF && ferror( yyin ) ) \
592 YY_FATAL_ERROR( "input in flex scanner failed" ); \
593 result = n; \
594 } \
595 else \
596 { \
597 errno=0; \
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800598 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
Sol Boucher69b88bf2015-02-26 11:47:19 -0800599 { \
600 if( errno != EINTR) \
601 { \
602 YY_FATAL_ERROR( "input in flex scanner failed" ); \
603 break; \
604 } \
605 errno=0; \
606 clearerr(yyin); \
607 } \
608 }\
609\
610
611#endif
612
613/* No semi-colon after return; correct usage is to write "yyterminate();" -
614 * we don't want an extra ';' after the "return" because that will cause
615 * some compilers to complain about unreachable statements.
616 */
617#ifndef yyterminate
618#define yyterminate() return YY_NULL
619#endif
620
621/* Number of entries by which start-condition stack grows. */
622#ifndef YY_START_STACK_INCR
623#define YY_START_STACK_INCR 25
624#endif
625
626/* Report a fatal error. */
627#ifndef YY_FATAL_ERROR
628#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
629#endif
630
631/* end tables serialization structures and prototypes */
632
633/* Default declaration of generated scanner - a define so the user can
634 * easily add parameters.
635 */
636#ifndef YY_DECL
637#define YY_DECL_IS_OURS 1
638
639extern int yylex (void);
640
641#define YY_DECL int yylex (void)
642#endif /* !YY_DECL */
643
644/* Code executed at the beginning of each rule, after yytext and yyleng
645 * have been set up.
646 */
647#ifndef YY_USER_ACTION
648#define YY_USER_ACTION
649#endif
650
651/* Code executed at the end of each rule. */
652#ifndef YY_BREAK
Patrick Georgi2b807342016-06-28 20:45:34 +0200653#define YY_BREAK /*LINTED*/break;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800654#endif
655
656#define YY_RULE_SETUP \
657 YY_USER_ACTION
658
659/** The main scanner function which does all the work.
660 */
661YY_DECL
662{
Patrick Georgi2b807342016-06-28 20:45:34 +0200663 yy_state_type yy_current_state;
664 char *yy_cp, *yy_bp;
665 int yy_act;
Martin Roth5c734132021-02-14 13:52:00 -0700666
Sol Boucher69b88bf2015-02-26 11:47:19 -0800667 if ( !(yy_init) )
668 {
669 (yy_init) = 1;
670
671#ifdef YY_USER_INIT
672 YY_USER_INIT;
673#endif
674
675 if ( ! (yy_start) )
676 (yy_start) = 1; /* first start state */
677
678 if ( ! yyin )
679 yyin = stdin;
680
681 if ( ! yyout )
682 yyout = stdout;
683
684 if ( ! YY_CURRENT_BUFFER ) {
685 yyensure_buffer_stack ();
686 YY_CURRENT_BUFFER_LVALUE =
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800687 yy_create_buffer( yyin, YY_BUF_SIZE );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800688 }
689
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800690 yy_load_buffer_state( );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800691 }
692
693 {
Sol Boucher69b88bf2015-02-26 11:47:19 -0800694
Patrick Georgi2b807342016-06-28 20:45:34 +0200695 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
Sol Boucher69b88bf2015-02-26 11:47:19 -0800696 {
697 yy_cp = (yy_c_buf_p);
698
699 /* Support of yytext. */
700 *yy_cp = (yy_hold_char);
701
702 /* yy_bp points to the position in yy_ch_buf of the start of
703 * the current run.
704 */
705 yy_bp = yy_cp;
706
707 yy_current_state = (yy_start);
708yy_match:
709 do
710 {
Patrick Georgi2b807342016-06-28 20:45:34 +0200711 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800712 if ( yy_accept[yy_current_state] )
713 {
714 (yy_last_accepting_state) = yy_current_state;
715 (yy_last_accepting_cpos) = yy_cp;
716 }
717 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
718 {
719 yy_current_state = (int) yy_def[yy_current_state];
Hung-Te Lin49a44502019-03-04 15:41:09 +0800720 if ( yy_current_state >= 40 )
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800721 yy_c = yy_meta[yy_c];
Sol Boucher69b88bf2015-02-26 11:47:19 -0800722 }
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800723 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
Sol Boucher69b88bf2015-02-26 11:47:19 -0800724 ++yy_cp;
725 }
Hung-Te Lin49a44502019-03-04 15:41:09 +0800726 while ( yy_base[yy_current_state] != 64 );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800727
728yy_find_action:
729 yy_act = yy_accept[yy_current_state];
730 if ( yy_act == 0 )
731 { /* have to back up */
732 yy_cp = (yy_last_accepting_cpos);
733 yy_current_state = (yy_last_accepting_state);
734 yy_act = yy_accept[yy_current_state];
735 }
736
737 YY_DO_BEFORE_ACTION;
738
739do_action: /* This label is used only to access EOF actions. */
740
741 switch ( yy_act )
742 { /* beginning of action switch */
743 case 0: /* must back up */
744 /* undo the effects of YY_DO_BEFORE_ACTION */
745 *yy_cp = (yy_hold_char);
746 yy_cp = (yy_last_accepting_cpos);
747 yy_current_state = (yy_last_accepting_state);
748 goto yy_find_action;
749
750case 1:
751/* rule 1 can match eol */
752YY_RULE_SETUP
Sol Boucher69b88bf2015-02-26 11:47:19 -0800753/* Eat whitespace. */
754 YY_BREAK
755case 2:
756*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
757(yy_c_buf_p) = yy_cp -= 1;
758YY_DO_BEFORE_ACTION; /* set up yytext again */
759YY_RULE_SETUP
Sol Boucher69b88bf2015-02-26 11:47:19 -0800760/* Eat comments. */
761 YY_BREAK
762case 3:
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800763YY_RULE_SETUP
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800764BEGIN(FLAGS); return *yytext;
765 YY_BREAK
Sol Boucher69b88bf2015-02-26 11:47:19 -0800766case 4:
767YY_RULE_SETUP
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800768BEGIN(INITIAL); return *yytext;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800769 YY_BREAK
770case 5:
771YY_RULE_SETUP
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800772return FLAG_CBFS;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800773 YY_BREAK
774case 6:
Sol Boucher69b88bf2015-02-26 11:47:19 -0800775YY_RULE_SETUP
Hung-Te Lin49a44502019-03-04 15:41:09 +0800776return FLAG_PRESERVE;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800777 YY_BREAK
Hung-Te Lin49a44502019-03-04 15:41:09 +0800778case 7:
Sol Boucher69b88bf2015-02-26 11:47:19 -0800779case 8:
780YY_RULE_SETUP
Hung-Te Lin49a44502019-03-04 15:41:09 +0800781return parse_integer(yytext, 10);
Sol Boucher69b88bf2015-02-26 11:47:19 -0800782 YY_BREAK
783case 9:
784YY_RULE_SETUP
Hung-Te Lin49a44502019-03-04 15:41:09 +0800785return OCTAL;
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800786 YY_BREAK
787case 10:
788YY_RULE_SETUP
Hung-Te Lin49a44502019-03-04 15:41:09 +0800789return parse_integer(yytext + 2, 16);
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800790 YY_BREAK
791case 11:
792YY_RULE_SETUP
Hung-Te Lin49a44502019-03-04 15:41:09 +0800793return copy_string(yytext);
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800794 YY_BREAK
795case 12:
796YY_RULE_SETUP
Hung-Te Lin49a44502019-03-04 15:41:09 +0800797return *yytext;
798 YY_BREAK
799case 13:
800YY_RULE_SETUP
Sol Boucher69b88bf2015-02-26 11:47:19 -0800801ECHO;
802 YY_BREAK
Sol Boucher69b88bf2015-02-26 11:47:19 -0800803case YY_STATE_EOF(INITIAL):
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800804case YY_STATE_EOF(FLAGS):
Sol Boucher69b88bf2015-02-26 11:47:19 -0800805 yyterminate();
806
807 case YY_END_OF_BUFFER:
808 {
809 /* Amount of text matched not including the EOB char. */
810 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
811
812 /* Undo the effects of YY_DO_BEFORE_ACTION. */
813 *yy_cp = (yy_hold_char);
814 YY_RESTORE_YY_MORE_OFFSET
815
816 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
817 {
818 /* We're scanning a new file or input source. It's
819 * possible that this happened because the user
820 * just pointed yyin at a new source and called
821 * yylex(). If so, then we have to assure
822 * consistency between YY_CURRENT_BUFFER and our
823 * globals. Here is the right place to do so, because
824 * this is the first action (other than possibly a
825 * back-up) that will match for the new input source.
826 */
827 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
828 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
829 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
830 }
831
832 /* Note that here we test for yy_c_buf_p "<=" to the position
833 * of the first EOB in the buffer, since yy_c_buf_p will
834 * already have been incremented past the NUL character
835 * (since all states make transitions on EOB to the
836 * end-of-buffer state). Contrast this with the test
837 * in input().
838 */
839 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
840 { /* This was really a NUL. */
841 yy_state_type yy_next_state;
842
843 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
844
845 yy_current_state = yy_get_previous_state( );
846
847 /* Okay, we're now positioned to make the NUL
848 * transition. We couldn't have
849 * yy_get_previous_state() go ahead and do it
850 * for us because it doesn't know how to deal
851 * with the possibility of jamming (and we don't
852 * want to build jamming into it because then it
853 * will run more slowly).
854 */
855
856 yy_next_state = yy_try_NUL_trans( yy_current_state );
857
858 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
859
860 if ( yy_next_state )
861 {
862 /* Consume the NUL. */
863 yy_cp = ++(yy_c_buf_p);
864 yy_current_state = yy_next_state;
865 goto yy_match;
866 }
867
868 else
869 {
870 yy_cp = (yy_c_buf_p);
871 goto yy_find_action;
872 }
873 }
874
875 else switch ( yy_get_next_buffer( ) )
876 {
877 case EOB_ACT_END_OF_FILE:
878 {
879 (yy_did_buffer_switch_on_eof) = 0;
880
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +0800881 if ( yywrap( ) )
Sol Boucher69b88bf2015-02-26 11:47:19 -0800882 {
883 /* Note: because we've taken care in
884 * yy_get_next_buffer() to have set up
885 * yytext, we can now set up
886 * yy_c_buf_p so that if some total
887 * hoser (like flex itself) wants to
888 * call the scanner after we return the
889 * YY_NULL, it'll still work - another
890 * YY_NULL will get returned.
891 */
892 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
893
894 yy_act = YY_STATE_EOF(YY_START);
895 goto do_action;
896 }
897
898 else
899 {
900 if ( ! (yy_did_buffer_switch_on_eof) )
901 YY_NEW_FILE;
902 }
903 break;
904 }
905
906 case EOB_ACT_CONTINUE_SCAN:
907 (yy_c_buf_p) =
908 (yytext_ptr) + yy_amount_of_matched_text;
909
910 yy_current_state = yy_get_previous_state( );
911
912 yy_cp = (yy_c_buf_p);
913 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
914 goto yy_match;
915
916 case EOB_ACT_LAST_MATCH:
917 (yy_c_buf_p) =
918 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
919
920 yy_current_state = yy_get_previous_state( );
921
922 yy_cp = (yy_c_buf_p);
923 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
924 goto yy_find_action;
925 }
926 break;
927 }
928
929 default:
930 YY_FATAL_ERROR(
931 "fatal flex scanner internal error--no action found" );
932 } /* end of action switch */
933 } /* end of scanning one token */
934 } /* end of user's declarations */
935} /* end of yylex */
936
937/* yy_get_next_buffer - try to read in a new buffer
938 *
939 * Returns a code representing an action:
940 * EOB_ACT_LAST_MATCH -
941 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
942 * EOB_ACT_END_OF_FILE - end of file
943 */
944static int yy_get_next_buffer (void)
945{
Patrick Georgi2b807342016-06-28 20:45:34 +0200946 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
947 char *source = (yytext_ptr);
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800948 int number_to_move, i;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800949 int ret_val;
950
951 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
952 YY_FATAL_ERROR(
953 "fatal flex scanner internal error--end of buffer missed" );
954
955 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
956 { /* Don't try to fill the buffer, so this is an EOF. */
957 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
958 {
959 /* We matched a single character, the EOB, so
960 * treat this as a final EOF.
961 */
962 return EOB_ACT_END_OF_FILE;
963 }
964
965 else
966 {
967 /* We matched some text prior to the EOB, first
968 * process it.
969 */
970 return EOB_ACT_LAST_MATCH;
971 }
972 }
973
974 /* Try to read more data. */
975
976 /* First move last chars to start of buffer. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800977 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
Sol Boucher69b88bf2015-02-26 11:47:19 -0800978
979 for ( i = 0; i < number_to_move; ++i )
980 *(dest++) = *(source++);
981
982 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
983 /* don't do the read, it's not guaranteed to return an EOF,
984 * just force an EOF
985 */
986 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
987
988 else
989 {
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800990 int num_to_read =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800991 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
992
993 while ( num_to_read <= 0 )
994 { /* Not enough room in the buffer - grow it. */
995
996 /* just a shorter name for the current buffer */
997 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
998
999 int yy_c_buf_p_offset =
1000 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1001
1002 if ( b->yy_is_our_buffer )
1003 {
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001004 int new_size = b->yy_buf_size * 2;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001005
1006 if ( new_size <= 0 )
1007 b->yy_buf_size += b->yy_buf_size / 8;
1008 else
1009 b->yy_buf_size *= 2;
1010
1011 b->yy_ch_buf = (char *)
1012 /* Include room in for 2 EOB chars. */
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001013 yyrealloc( (void *) b->yy_ch_buf,
1014 (yy_size_t) (b->yy_buf_size + 2) );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001015 }
1016 else
1017 /* Can't grow it, we don't own it. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001018 b->yy_ch_buf = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001019
1020 if ( ! b->yy_ch_buf )
1021 YY_FATAL_ERROR(
1022 "fatal error - scanner input buffer overflow" );
1023
1024 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1025
1026 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1027 number_to_move - 1;
1028
1029 }
1030
1031 if ( num_to_read > YY_READ_BUF_SIZE )
1032 num_to_read = YY_READ_BUF_SIZE;
1033
1034 /* Read in more data. */
1035 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1036 (yy_n_chars), num_to_read );
1037
1038 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1039 }
1040
1041 if ( (yy_n_chars) == 0 )
1042 {
1043 if ( number_to_move == YY_MORE_ADJ )
1044 {
1045 ret_val = EOB_ACT_END_OF_FILE;
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001046 yyrestart( yyin );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001047 }
1048
1049 else
1050 {
1051 ret_val = EOB_ACT_LAST_MATCH;
1052 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1053 YY_BUFFER_EOF_PENDING;
1054 }
1055 }
1056
1057 else
1058 ret_val = EOB_ACT_CONTINUE_SCAN;
1059
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001060 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
Sol Boucher69b88bf2015-02-26 11:47:19 -08001061 /* Extend the array by 50%, plus the number we really need. */
Patrick Georgi2b807342016-06-28 20:45:34 +02001062 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001063 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1064 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001065 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1066 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001067 /* "- 2" to take care of EOB's */
1068 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001069 }
1070
1071 (yy_n_chars) += number_to_move;
1072 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1073 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1074
1075 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1076
1077 return ret_val;
1078}
1079
1080/* yy_get_previous_state - get the state just before the EOB char was reached */
1081
1082 static yy_state_type yy_get_previous_state (void)
1083{
Patrick Georgi2b807342016-06-28 20:45:34 +02001084 yy_state_type yy_current_state;
1085 char *yy_cp;
Martin Roth5c734132021-02-14 13:52:00 -07001086
Sol Boucher69b88bf2015-02-26 11:47:19 -08001087 yy_current_state = (yy_start);
1088
1089 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1090 {
Patrick Georgi2b807342016-06-28 20:45:34 +02001091 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001092 if ( yy_accept[yy_current_state] )
1093 {
1094 (yy_last_accepting_state) = yy_current_state;
1095 (yy_last_accepting_cpos) = yy_cp;
1096 }
1097 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1098 {
1099 yy_current_state = (int) yy_def[yy_current_state];
Hung-Te Lin49a44502019-03-04 15:41:09 +08001100 if ( yy_current_state >= 40 )
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001101 yy_c = yy_meta[yy_c];
Sol Boucher69b88bf2015-02-26 11:47:19 -08001102 }
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001103 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
Sol Boucher69b88bf2015-02-26 11:47:19 -08001104 }
1105
1106 return yy_current_state;
1107}
1108
1109/* yy_try_NUL_trans - try to make a transition on the NUL character
1110 *
1111 * synopsis
1112 * next_state = yy_try_NUL_trans( current_state );
1113 */
1114 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1115{
Patrick Georgi2b807342016-06-28 20:45:34 +02001116 int yy_is_jam;
1117 char *yy_cp = (yy_c_buf_p);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001118
Patrick Georgi2b807342016-06-28 20:45:34 +02001119 YY_CHAR yy_c = 1;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001120 if ( yy_accept[yy_current_state] )
1121 {
1122 (yy_last_accepting_state) = yy_current_state;
1123 (yy_last_accepting_cpos) = yy_cp;
1124 }
1125 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1126 {
1127 yy_current_state = (int) yy_def[yy_current_state];
Hung-Te Lin49a44502019-03-04 15:41:09 +08001128 if ( yy_current_state >= 40 )
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001129 yy_c = yy_meta[yy_c];
Sol Boucher69b88bf2015-02-26 11:47:19 -08001130 }
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001131 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
Hung-Te Lin49a44502019-03-04 15:41:09 +08001132 yy_is_jam = (yy_current_state == 39);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001133
1134 return yy_is_jam ? 0 : yy_current_state;
1135}
1136
Patrick Georgi2b807342016-06-28 20:45:34 +02001137#ifndef YY_NO_UNPUT
1138
1139 static void yyunput (int c, char * yy_bp )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001140{
Patrick Georgi2b807342016-06-28 20:45:34 +02001141 char *yy_cp;
Martin Roth5c734132021-02-14 13:52:00 -07001142
Sol Boucher69b88bf2015-02-26 11:47:19 -08001143 yy_cp = (yy_c_buf_p);
1144
1145 /* undo effects of setting up yytext */
1146 *yy_cp = (yy_hold_char);
1147
1148 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1149 { /* need to shift things up to make room */
1150 /* +2 for EOB chars. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001151 int number_to_move = (yy_n_chars) + 2;
Patrick Georgi2b807342016-06-28 20:45:34 +02001152 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
Sol Boucher69b88bf2015-02-26 11:47:19 -08001153 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
Patrick Georgi2b807342016-06-28 20:45:34 +02001154 char *source =
Sol Boucher69b88bf2015-02-26 11:47:19 -08001155 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1156
1157 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1158 *--dest = *--source;
1159
1160 yy_cp += (int) (dest - source);
1161 yy_bp += (int) (dest - source);
1162 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001163 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001164
1165 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1166 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1167 }
1168
1169 *--yy_cp = (char) c;
1170
1171 (yytext_ptr) = yy_bp;
1172 (yy_hold_char) = *yy_cp;
1173 (yy_c_buf_p) = yy_cp;
1174}
1175
Patrick Georgi2b807342016-06-28 20:45:34 +02001176#endif
1177
Sol Boucher69b88bf2015-02-26 11:47:19 -08001178#ifndef YY_NO_INPUT
1179#ifdef __cplusplus
1180 static int yyinput (void)
1181#else
1182 static int input (void)
1183#endif
1184
1185{
1186 int c;
Martin Roth5c734132021-02-14 13:52:00 -07001187
Sol Boucher69b88bf2015-02-26 11:47:19 -08001188 *(yy_c_buf_p) = (yy_hold_char);
1189
1190 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1191 {
1192 /* yy_c_buf_p now points to the character we want to return.
1193 * If this occurs *before* the EOB characters, then it's a
1194 * valid NUL; if not, then we've hit the end of the buffer.
1195 */
1196 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1197 /* This was really a NUL. */
1198 *(yy_c_buf_p) = '\0';
1199
1200 else
1201 { /* need more input */
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001202 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
Sol Boucher69b88bf2015-02-26 11:47:19 -08001203 ++(yy_c_buf_p);
1204
1205 switch ( yy_get_next_buffer( ) )
1206 {
1207 case EOB_ACT_LAST_MATCH:
1208 /* This happens because yy_g_n_b()
1209 * sees that we've accumulated a
1210 * token and flags that we need to
1211 * try matching the token before
1212 * proceeding. But for input(),
1213 * there's no matching to consider.
1214 * So convert the EOB_ACT_LAST_MATCH
1215 * to EOB_ACT_END_OF_FILE.
1216 */
1217
1218 /* Reset buffer status. */
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001219 yyrestart( yyin );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001220
1221 /*FALLTHROUGH*/
1222
1223 case EOB_ACT_END_OF_FILE:
1224 {
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001225 if ( yywrap( ) )
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001226 return 0;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001227
1228 if ( ! (yy_did_buffer_switch_on_eof) )
1229 YY_NEW_FILE;
1230#ifdef __cplusplus
1231 return yyinput();
1232#else
1233 return input();
1234#endif
1235 }
1236
1237 case EOB_ACT_CONTINUE_SCAN:
1238 (yy_c_buf_p) = (yytext_ptr) + offset;
1239 break;
1240 }
1241 }
1242 }
1243
1244 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1245 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1246 (yy_hold_char) = *++(yy_c_buf_p);
1247
1248 return c;
1249}
1250#endif /* ifndef YY_NO_INPUT */
1251
1252/** Immediately switch to a different input stream.
1253 * @param input_file A readable stream.
Martin Roth5c734132021-02-14 13:52:00 -07001254 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001255 * @note This function does not reset the start condition to @c INITIAL .
1256 */
1257 void yyrestart (FILE * input_file )
1258{
Martin Roth5c734132021-02-14 13:52:00 -07001259
Sol Boucher69b88bf2015-02-26 11:47:19 -08001260 if ( ! YY_CURRENT_BUFFER ){
1261 yyensure_buffer_stack ();
1262 YY_CURRENT_BUFFER_LVALUE =
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001263 yy_create_buffer( yyin, YY_BUF_SIZE );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001264 }
1265
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001266 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1267 yy_load_buffer_state( );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001268}
1269
1270/** Switch to a different input buffer.
1271 * @param new_buffer The new input buffer.
Martin Roth5c734132021-02-14 13:52:00 -07001272 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001273 */
1274 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1275{
Martin Roth5c734132021-02-14 13:52:00 -07001276
Sol Boucher69b88bf2015-02-26 11:47:19 -08001277 /* TODO. We should be able to replace this entire function body
1278 * with
1279 * yypop_buffer_state();
1280 * yypush_buffer_state(new_buffer);
1281 */
1282 yyensure_buffer_stack ();
1283 if ( YY_CURRENT_BUFFER == new_buffer )
1284 return;
1285
1286 if ( YY_CURRENT_BUFFER )
1287 {
1288 /* Flush out information for old buffer. */
1289 *(yy_c_buf_p) = (yy_hold_char);
1290 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1291 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1292 }
1293
1294 YY_CURRENT_BUFFER_LVALUE = new_buffer;
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001295 yy_load_buffer_state( );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001296
1297 /* We don't actually know whether we did this switch during
1298 * EOF (yywrap()) processing, but the only time this flag
1299 * is looked at is after yywrap() is called, so it's safe
1300 * to go ahead and always set it.
1301 */
1302 (yy_did_buffer_switch_on_eof) = 1;
1303}
1304
1305static void yy_load_buffer_state (void)
1306{
1307 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1308 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1309 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1310 (yy_hold_char) = *(yy_c_buf_p);
1311}
1312
1313/** Allocate and initialize an input buffer state.
1314 * @param file A readable stream.
1315 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
Martin Roth5c734132021-02-14 13:52:00 -07001316 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001317 * @return the allocated buffer state.
1318 */
1319 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1320{
1321 YY_BUFFER_STATE b;
Martin Roth5c734132021-02-14 13:52:00 -07001322
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001323 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001324 if ( ! b )
1325 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1326
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001327 b->yy_buf_size = size;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001328
1329 /* yy_ch_buf has to be 2 characters longer than the size given because
1330 * we need to put in 2 end-of-buffer characters.
1331 */
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001332 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001333 if ( ! b->yy_ch_buf )
1334 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1335
1336 b->yy_is_our_buffer = 1;
1337
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001338 yy_init_buffer( b, file );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001339
1340 return b;
1341}
1342
1343/** Destroy the buffer.
1344 * @param b a buffer created with yy_create_buffer()
Martin Roth5c734132021-02-14 13:52:00 -07001345 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001346 */
1347 void yy_delete_buffer (YY_BUFFER_STATE b )
1348{
Martin Roth5c734132021-02-14 13:52:00 -07001349
Sol Boucher69b88bf2015-02-26 11:47:19 -08001350 if ( ! b )
1351 return;
1352
1353 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1354 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1355
1356 if ( b->yy_is_our_buffer )
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001357 yyfree( (void *) b->yy_ch_buf );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001358
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001359 yyfree( (void *) b );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001360}
1361
1362/* Initializes or reinitializes a buffer.
1363 * This function is sometimes called more than once on the same buffer,
1364 * such as during a yyrestart() or at EOF.
1365 */
1366 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1367
1368{
1369 int oerrno = errno;
Martin Roth5c734132021-02-14 13:52:00 -07001370
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001371 yy_flush_buffer( b );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001372
1373 b->yy_input_file = file;
1374 b->yy_fill_buffer = 1;
1375
1376 /* If b is the current buffer, then yy_init_buffer was _probably_
1377 * called from yyrestart() or through yy_get_next_buffer.
1378 * In that case, we don't want to reset the lineno or column.
1379 */
1380 if (b != YY_CURRENT_BUFFER){
1381 b->yy_bs_lineno = 1;
1382 b->yy_bs_column = 0;
1383 }
1384
1385 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
Martin Roth5c734132021-02-14 13:52:00 -07001386
Sol Boucher69b88bf2015-02-26 11:47:19 -08001387 errno = oerrno;
1388}
1389
1390/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1391 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
Martin Roth5c734132021-02-14 13:52:00 -07001392 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001393 */
1394 void yy_flush_buffer (YY_BUFFER_STATE b )
1395{
1396 if ( ! b )
1397 return;
1398
1399 b->yy_n_chars = 0;
1400
1401 /* We always need two end-of-buffer characters. The first causes
1402 * a transition to the end-of-buffer state. The second causes
1403 * a jam in that state.
1404 */
1405 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1406 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1407
1408 b->yy_buf_pos = &b->yy_ch_buf[0];
1409
1410 b->yy_at_bol = 1;
1411 b->yy_buffer_status = YY_BUFFER_NEW;
1412
1413 if ( b == YY_CURRENT_BUFFER )
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001414 yy_load_buffer_state( );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001415}
1416
1417/** Pushes the new state onto the stack. The new state becomes
1418 * the current state. This function will allocate the stack
1419 * if necessary.
1420 * @param new_buffer The new state.
Martin Roth5c734132021-02-14 13:52:00 -07001421 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001422 */
1423void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1424{
1425 if (new_buffer == NULL)
1426 return;
1427
1428 yyensure_buffer_stack();
1429
1430 /* This block is copied from yy_switch_to_buffer. */
1431 if ( YY_CURRENT_BUFFER )
1432 {
1433 /* Flush out information for old buffer. */
1434 *(yy_c_buf_p) = (yy_hold_char);
1435 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1436 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1437 }
1438
1439 /* Only push if top exists. Otherwise, replace top. */
1440 if (YY_CURRENT_BUFFER)
1441 (yy_buffer_stack_top)++;
1442 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1443
1444 /* copied from yy_switch_to_buffer. */
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001445 yy_load_buffer_state( );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001446 (yy_did_buffer_switch_on_eof) = 1;
1447}
1448
1449/** Removes and deletes the top of the stack, if present.
1450 * The next element becomes the new top.
Martin Roth5c734132021-02-14 13:52:00 -07001451 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001452 */
1453void yypop_buffer_state (void)
1454{
1455 if (!YY_CURRENT_BUFFER)
1456 return;
1457
1458 yy_delete_buffer(YY_CURRENT_BUFFER );
1459 YY_CURRENT_BUFFER_LVALUE = NULL;
1460 if ((yy_buffer_stack_top) > 0)
1461 --(yy_buffer_stack_top);
1462
1463 if (YY_CURRENT_BUFFER) {
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001464 yy_load_buffer_state( );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001465 (yy_did_buffer_switch_on_eof) = 1;
1466 }
1467}
1468
1469/* Allocates the stack if it does not exist.
1470 * Guarantees space for at least one push.
1471 */
1472static void yyensure_buffer_stack (void)
1473{
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001474 yy_size_t num_to_alloc;
Martin Roth5c734132021-02-14 13:52:00 -07001475
Sol Boucher69b88bf2015-02-26 11:47:19 -08001476 if (!(yy_buffer_stack)) {
1477
1478 /* First allocation is just for 2 elements, since we don't know if this
1479 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1480 * immediate realloc on the next call.
1481 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001482 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
Sol Boucher69b88bf2015-02-26 11:47:19 -08001483 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1484 (num_to_alloc * sizeof(struct yy_buffer_state*)
1485 );
1486 if ( ! (yy_buffer_stack) )
1487 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001488
Sol Boucher69b88bf2015-02-26 11:47:19 -08001489 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001490
Sol Boucher69b88bf2015-02-26 11:47:19 -08001491 (yy_buffer_stack_max) = num_to_alloc;
1492 (yy_buffer_stack_top) = 0;
1493 return;
1494 }
1495
1496 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1497
1498 /* Increase the buffer to prepare for a possible push. */
Patrick Georgi2b807342016-06-28 20:45:34 +02001499 yy_size_t grow_size = 8 /* arbitrary grow size */;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001500
1501 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1502 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1503 ((yy_buffer_stack),
1504 num_to_alloc * sizeof(struct yy_buffer_state*)
1505 );
1506 if ( ! (yy_buffer_stack) )
1507 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1508
1509 /* zero only the new slots.*/
1510 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1511 (yy_buffer_stack_max) = num_to_alloc;
1512 }
1513}
1514
1515/** Setup the input buffer state to scan directly from a user-specified character buffer.
1516 * @param base the character buffer
1517 * @param size the size in bytes of the character buffer
Martin Roth5c734132021-02-14 13:52:00 -07001518 *
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001519 * @return the newly allocated buffer state object.
Sol Boucher69b88bf2015-02-26 11:47:19 -08001520 */
1521YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1522{
1523 YY_BUFFER_STATE b;
Martin Roth5c734132021-02-14 13:52:00 -07001524
Sol Boucher69b88bf2015-02-26 11:47:19 -08001525 if ( size < 2 ||
1526 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1527 base[size-1] != YY_END_OF_BUFFER_CHAR )
1528 /* They forgot to leave room for the EOB's. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001529 return NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001530
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001531 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001532 if ( ! b )
1533 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1534
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001535 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
Sol Boucher69b88bf2015-02-26 11:47:19 -08001536 b->yy_buf_pos = b->yy_ch_buf = base;
1537 b->yy_is_our_buffer = 0;
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001538 b->yy_input_file = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001539 b->yy_n_chars = b->yy_buf_size;
1540 b->yy_is_interactive = 0;
1541 b->yy_at_bol = 1;
1542 b->yy_fill_buffer = 0;
1543 b->yy_buffer_status = YY_BUFFER_NEW;
1544
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001545 yy_switch_to_buffer( b );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001546
1547 return b;
1548}
1549
1550/** Setup the input buffer state to scan a string. The next call to yylex() will
1551 * scan from a @e copy of @a str.
1552 * @param yystr a NUL-terminated string to scan
Martin Roth5c734132021-02-14 13:52:00 -07001553 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001554 * @return the newly allocated buffer state object.
1555 * @note If you want to scan bytes that may contain NUL values, then use
1556 * yy_scan_bytes() instead.
1557 */
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001558YY_BUFFER_STATE yy_scan_string (const char * yystr )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001559{
Martin Roth5c734132021-02-14 13:52:00 -07001560
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001561 return yy_scan_bytes( yystr, (int) strlen(yystr) );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001562}
1563
1564/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1565 * scan from a @e copy of @a bytes.
1566 * @param yybytes the byte buffer to scan
1567 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
Martin Roth5c734132021-02-14 13:52:00 -07001568 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001569 * @return the newly allocated buffer state object.
1570 */
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001571YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001572{
1573 YY_BUFFER_STATE b;
1574 char *buf;
1575 yy_size_t n;
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001576 int i;
Martin Roth5c734132021-02-14 13:52:00 -07001577
Sol Boucher69b88bf2015-02-26 11:47:19 -08001578 /* Get memory for full buffer, including space for trailing EOB's. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001579 n = (yy_size_t) (_yybytes_len + 2);
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001580 buf = (char *) yyalloc( n );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001581 if ( ! buf )
1582 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1583
1584 for ( i = 0; i < _yybytes_len; ++i )
1585 buf[i] = yybytes[i];
1586
1587 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1588
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001589 b = yy_scan_buffer( buf, n );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001590 if ( ! b )
1591 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1592
1593 /* It's okay to grow etc. this buffer, and we should throw it
1594 * away when we're done.
1595 */
1596 b->yy_is_our_buffer = 1;
1597
1598 return b;
1599}
1600
1601#ifndef YY_EXIT_FAILURE
1602#define YY_EXIT_FAILURE 2
1603#endif
1604
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001605static void yynoreturn yy_fatal_error (const char* msg )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001606{
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001607 fprintf( stderr, "%s\n", msg );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001608 exit( YY_EXIT_FAILURE );
1609}
1610
1611/* Redefine yyless() so it works in section 3 code. */
1612
1613#undef yyless
1614#define yyless(n) \
1615 do \
1616 { \
1617 /* Undo effects of setting up yytext. */ \
1618 int yyless_macro_arg = (n); \
1619 YY_LESS_LINENO(yyless_macro_arg);\
1620 yytext[yyleng] = (yy_hold_char); \
1621 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1622 (yy_hold_char) = *(yy_c_buf_p); \
1623 *(yy_c_buf_p) = '\0'; \
1624 yyleng = yyless_macro_arg; \
1625 } \
1626 while ( 0 )
1627
1628/* Accessor methods (get/set functions) to struct members. */
1629
1630/** Get the current line number.
Martin Roth5c734132021-02-14 13:52:00 -07001631 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001632 */
1633int yyget_lineno (void)
1634{
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001635
Sol Boucher69b88bf2015-02-26 11:47:19 -08001636 return yylineno;
1637}
1638
1639/** Get the input stream.
Martin Roth5c734132021-02-14 13:52:00 -07001640 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001641 */
1642FILE *yyget_in (void)
1643{
1644 return yyin;
1645}
1646
1647/** Get the output stream.
Martin Roth5c734132021-02-14 13:52:00 -07001648 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001649 */
1650FILE *yyget_out (void)
1651{
1652 return yyout;
1653}
1654
1655/** Get the length of the current token.
Martin Roth5c734132021-02-14 13:52:00 -07001656 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001657 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001658int yyget_leng (void)
Sol Boucher69b88bf2015-02-26 11:47:19 -08001659{
1660 return yyleng;
1661}
1662
1663/** Get the current token.
Martin Roth5c734132021-02-14 13:52:00 -07001664 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001665 */
1666
1667char *yyget_text (void)
1668{
1669 return yytext;
1670}
1671
1672/** Set the current line number.
Patrick Georgi2b807342016-06-28 20:45:34 +02001673 * @param _line_number line number
Martin Roth5c734132021-02-14 13:52:00 -07001674 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001675 */
Patrick Georgi2b807342016-06-28 20:45:34 +02001676void yyset_lineno (int _line_number )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001677{
Martin Roth5c734132021-02-14 13:52:00 -07001678
Patrick Georgi2b807342016-06-28 20:45:34 +02001679 yylineno = _line_number;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001680}
1681
1682/** Set the input stream. This does not discard the current
1683 * input buffer.
Patrick Georgi2b807342016-06-28 20:45:34 +02001684 * @param _in_str A readable stream.
Martin Roth5c734132021-02-14 13:52:00 -07001685 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001686 * @see yy_switch_to_buffer
1687 */
Patrick Georgi2b807342016-06-28 20:45:34 +02001688void yyset_in (FILE * _in_str )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001689{
Patrick Georgi2b807342016-06-28 20:45:34 +02001690 yyin = _in_str ;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001691}
1692
Patrick Georgi2b807342016-06-28 20:45:34 +02001693void yyset_out (FILE * _out_str )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001694{
Patrick Georgi2b807342016-06-28 20:45:34 +02001695 yyout = _out_str ;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001696}
1697
1698int yyget_debug (void)
1699{
1700 return yy_flex_debug;
1701}
1702
Patrick Georgi2b807342016-06-28 20:45:34 +02001703void yyset_debug (int _bdebug )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001704{
Patrick Georgi2b807342016-06-28 20:45:34 +02001705 yy_flex_debug = _bdebug ;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001706}
1707
1708static int yy_init_globals (void)
1709{
1710 /* Initialization is the same as for the non-reentrant scanner.
1711 * This function is called from yylex_destroy(), so don't allocate here.
1712 */
1713
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001714 (yy_buffer_stack) = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001715 (yy_buffer_stack_top) = 0;
1716 (yy_buffer_stack_max) = 0;
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001717 (yy_c_buf_p) = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001718 (yy_init) = 0;
1719 (yy_start) = 0;
1720
1721/* Defined in main.c */
1722#ifdef YY_STDINIT
1723 yyin = stdin;
1724 yyout = stdout;
1725#else
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001726 yyin = NULL;
1727 yyout = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001728#endif
1729
1730 /* For future reference: Set errno on error, since we are called by
1731 * yylex_init()
1732 */
1733 return 0;
1734}
1735
1736/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1737int yylex_destroy (void)
1738{
Martin Roth5c734132021-02-14 13:52:00 -07001739
Sol Boucher69b88bf2015-02-26 11:47:19 -08001740 /* Pop the buffer stack, destroying each element. */
1741 while(YY_CURRENT_BUFFER){
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001742 yy_delete_buffer( YY_CURRENT_BUFFER );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001743 YY_CURRENT_BUFFER_LVALUE = NULL;
1744 yypop_buffer_state();
1745 }
1746
1747 /* Destroy the stack itself. */
1748 yyfree((yy_buffer_stack) );
1749 (yy_buffer_stack) = NULL;
1750
1751 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1752 * yylex() is called, initialization will occur. */
1753 yy_init_globals( );
1754
1755 return 0;
1756}
1757
1758/*
1759 * Internal utility routines.
1760 */
1761
1762#ifndef yytext_ptr
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001763static void yy_flex_strncpy (char* s1, const char * s2, int n )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001764{
Martin Roth5c734132021-02-14 13:52:00 -07001765
Patrick Georgi2b807342016-06-28 20:45:34 +02001766 int i;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001767 for ( i = 0; i < n; ++i )
1768 s1[i] = s2[i];
1769}
1770#endif
1771
1772#ifdef YY_NEED_STRLEN
Hung-Te Lin8cb45aa2023-06-15 15:26:40 +08001773static int yy_flex_strlen (const char * s )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001774{
Patrick Georgi2b807342016-06-28 20:45:34 +02001775 int n;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001776 for ( n = 0; s[n]; ++n )
1777 ;
1778
1779 return n;
1780}
1781#endif
1782
1783void *yyalloc (yy_size_t size )
1784{
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001785 return malloc(size);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001786}
1787
1788void *yyrealloc (void * ptr, yy_size_t size )
1789{
Martin Roth5c734132021-02-14 13:52:00 -07001790
Sol Boucher69b88bf2015-02-26 11:47:19 -08001791 /* The cast to (char *) in the following accommodates both
1792 * implementations that use char* generic pointers, and those
1793 * that use void* generic pointers. It works with the latter
1794 * because both ANSI C and C++ allow castless assignment from
1795 * any pointer type to void*, and deal with argument conversions
1796 * as though doing an assignment.
1797 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001798 return realloc(ptr, size);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001799}
1800
1801void yyfree (void * ptr )
1802{
Patrick Georgi2b807342016-06-28 20:45:34 +02001803 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
Sol Boucher69b88bf2015-02-26 11:47:19 -08001804}
1805
1806#define YYTABLES_NAME "yytables"
1807
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001808int parse_integer(char *src, int base)
Sol Boucher69b88bf2015-02-26 11:47:19 -08001809{
1810 char *multiplier = NULL;
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001811 unsigned val = strtoul(src, &multiplier, base);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001812
1813 if (*multiplier) {
1814 switch(*multiplier) {
1815 case 'K':
1816 val *= 1024;
1817 break;
1818 case 'M':
1819 val *= 1024*1024;
1820 break;
1821 case 'G':
1822 val *= 1024*1024*1024;
1823 break;
1824 default:
1825 // If we ever get here, the MULTIPLIER regex is allowing
1826 // multiplier suffixes not handled by this code.
1827 assert(false);
1828 }
1829 }
1830
1831 yylval.intval = val;
1832 return INTEGER;
1833}
1834
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001835int copy_string(const char *src)
Sol Boucher69b88bf2015-02-26 11:47:19 -08001836{
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001837 yylval.strval = strdup(src);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001838 return STRING;
1839}
Patrick Georgi2b807342016-06-28 20:45:34 +02001840