blob: 11f6375f7e15547f76e5ca488ceac669aa4752ad [file] [log] [blame]
Sol Boucher69b88bf2015-02-26 11:47:19 -08001
2#line 3 "<stdout>"
3
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
8#define FLEX_SCANNER
9#define YY_FLEX_MAJOR_VERSION 2
Patrick Georgi2b807342016-06-28 20:45:34 +020010#define YY_FLEX_MINOR_VERSION 6
Hung-Te Lin9497fcb2019-03-04 14:28:37 +080011#define YY_FLEX_SUBMINOR_VERSION 1
Sol Boucher69b88bf2015-02-26 11:47:19 -080012#if YY_FLEX_SUBMINOR_VERSION > 0
13#define FLEX_BETA
14#endif
15
16/* First, we deal with platform-specific or compiler-specific issues. */
17
18/* begin standard C headers. */
19#include <stdio.h>
20#include <string.h>
21#include <errno.h>
22#include <stdlib.h>
23
24/* end standard C headers. */
25
26/* flex integer type definitions */
27
28#ifndef FLEXINT_H
29#define FLEXINT_H
30
31/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
35/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
Martin Roth5c734132021-02-14 13:52:00 -070036 * if you want the limit (max/min) macros for int types.
Sol Boucher69b88bf2015-02-26 11:47:19 -080037 */
38#ifndef __STDC_LIMIT_MACROS
39#define __STDC_LIMIT_MACROS 1
40#endif
41
42#include <inttypes.h>
43typedef int8_t flex_int8_t;
44typedef uint8_t flex_uint8_t;
45typedef int16_t flex_int16_t;
46typedef uint16_t flex_uint16_t;
47typedef int32_t flex_int32_t;
48typedef uint32_t flex_uint32_t;
49#else
50typedef signed char flex_int8_t;
51typedef short int flex_int16_t;
52typedef int flex_int32_t;
Martin Roth5c734132021-02-14 13:52:00 -070053typedef unsigned char flex_uint8_t;
Sol Boucher69b88bf2015-02-26 11:47:19 -080054typedef unsigned short int flex_uint16_t;
55typedef unsigned int flex_uint32_t;
56
57/* Limits of integral types. */
58#ifndef INT8_MIN
59#define INT8_MIN (-128)
60#endif
61#ifndef INT16_MIN
62#define INT16_MIN (-32767-1)
63#endif
64#ifndef INT32_MIN
65#define INT32_MIN (-2147483647-1)
66#endif
67#ifndef INT8_MAX
68#define INT8_MAX (127)
69#endif
70#ifndef INT16_MAX
71#define INT16_MAX (32767)
72#endif
73#ifndef INT32_MAX
74#define INT32_MAX (2147483647)
75#endif
76#ifndef UINT8_MAX
77#define UINT8_MAX (255U)
78#endif
79#ifndef UINT16_MAX
80#define UINT16_MAX (65535U)
81#endif
82#ifndef UINT32_MAX
83#define UINT32_MAX (4294967295U)
84#endif
85
86#endif /* ! C99 */
87
88#endif /* ! FLEXINT_H */
89
Hung-Te Lin9497fcb2019-03-04 14:28:37 +080090/* TODO: this is always defined, so inline it */
Sol Boucher69b88bf2015-02-26 11:47:19 -080091#define yyconst const
Hung-Te Lin9497fcb2019-03-04 14:28:37 +080092
93#if defined(__GNUC__) && __GNUC__ >= 3
94#define yynoreturn __attribute__((__noreturn__))
Sol Boucher69b88bf2015-02-26 11:47:19 -080095#else
Hung-Te Lin9497fcb2019-03-04 14:28:37 +080096#define yynoreturn
Sol Boucher69b88bf2015-02-26 11:47:19 -080097#endif
98
99/* Returned upon end-of-file. */
100#define YY_NULL 0
101
102/* Promotes a possibly negative, possibly signed char to an unsigned
103 * integer for use as an array index. If the signed char is negative,
104 * we want to instead treat it as an 8-bit unsigned char, hence the
105 * double cast.
106 */
107#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
108
109/* Enter a start condition. This macro really ought to take a parameter,
110 * but we do it the disgusting crufty way forced on us by the ()-less
111 * definition of BEGIN.
112 */
113#define BEGIN (yy_start) = 1 + 2 *
114
115/* Translate the current start state into a value that can be later handed
116 * to BEGIN to return to the state. The YYSTATE alias is for lex
117 * compatibility.
118 */
119#define YY_START (((yy_start) - 1) / 2)
120#define YYSTATE YY_START
121
122/* Action number for EOF rule of a given start state. */
123#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
124
125/* Special action meaning "start processing a new file". */
126#define YY_NEW_FILE yyrestart(yyin )
127
128#define YY_END_OF_BUFFER_CHAR 0
129
130/* Size of default input buffer. */
131#ifndef YY_BUF_SIZE
132#ifdef __ia64__
133/* On IA-64, the buffer size is 16k, not 8k.
134 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
135 * Ditto for the __ia64__ case accordingly.
136 */
137#define YY_BUF_SIZE 32768
138#else
139#define YY_BUF_SIZE 16384
140#endif /* __ia64__ */
141#endif
142
143/* The state buf must be large enough to hold one state per character in the main buffer.
144 */
145#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
146
147#ifndef YY_TYPEDEF_YY_BUFFER_STATE
148#define YY_TYPEDEF_YY_BUFFER_STATE
149typedef struct yy_buffer_state *YY_BUFFER_STATE;
150#endif
151
152#ifndef YY_TYPEDEF_YY_SIZE_T
153#define YY_TYPEDEF_YY_SIZE_T
154typedef size_t yy_size_t;
155#endif
156
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800157extern int yyleng;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800158
159extern FILE *yyin, *yyout;
160
161#define EOB_ACT_CONTINUE_SCAN 0
162#define EOB_ACT_END_OF_FILE 1
163#define EOB_ACT_LAST_MATCH 2
164
165 #define YY_LESS_LINENO(n)
166 #define YY_LINENO_REWIND_TO(ptr)
Martin Roth5c734132021-02-14 13:52:00 -0700167
Sol Boucher69b88bf2015-02-26 11:47:19 -0800168/* Return all but the first "n" matched characters back to the input stream. */
169#define yyless(n) \
170 do \
171 { \
172 /* Undo effects of setting up yytext. */ \
173 int yyless_macro_arg = (n); \
174 YY_LESS_LINENO(yyless_macro_arg);\
175 *yy_cp = (yy_hold_char); \
176 YY_RESTORE_YY_MORE_OFFSET \
177 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
178 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
179 } \
180 while ( 0 )
181
182#define unput(c) yyunput( c, (yytext_ptr) )
183
184#ifndef YY_STRUCT_YY_BUFFER_STATE
185#define YY_STRUCT_YY_BUFFER_STATE
186struct yy_buffer_state
187 {
188 FILE *yy_input_file;
189
190 char *yy_ch_buf; /* input buffer */
191 char *yy_buf_pos; /* current position in input buffer */
192
193 /* Size of input buffer in bytes, not including room for EOB
194 * characters.
195 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800196 int yy_buf_size;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800197
198 /* Number of characters read into yy_ch_buf, not including EOB
199 * characters.
200 */
Patrick Georgi2b807342016-06-28 20:45:34 +0200201 int yy_n_chars;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800202
203 /* Whether we "own" the buffer - i.e., we know we created it,
204 * and can realloc() it to grow it, and should free() it to
205 * delete it.
206 */
207 int yy_is_our_buffer;
208
209 /* Whether this is an "interactive" input source; if so, and
210 * if we're using stdio for input, then we want to use getc()
211 * instead of fread(), to make sure we stop fetching input after
212 * each newline.
213 */
214 int yy_is_interactive;
215
216 /* Whether we're considered to be at the beginning of a line.
217 * If so, '^' rules will be active on the next match, otherwise
218 * not.
219 */
220 int yy_at_bol;
221
222 int yy_bs_lineno; /**< The line count. */
223 int yy_bs_column; /**< The column count. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800224
Sol Boucher69b88bf2015-02-26 11:47:19 -0800225 /* Whether to try to fill the input buffer when we reach the
226 * end of it.
227 */
228 int yy_fill_buffer;
229
230 int yy_buffer_status;
231
232#define YY_BUFFER_NEW 0
233#define YY_BUFFER_NORMAL 1
234 /* When an EOF's been seen but there's still some text to process
235 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
236 * shouldn't try reading from the input source any more. We might
237 * still have a bunch of tokens to match, though, because of
238 * possible backing-up.
239 *
240 * When we actually see the EOF, we change the status to "new"
241 * (via yyrestart()), so that the user can continue scanning by
242 * just pointing yyin at a new input file.
243 */
244#define YY_BUFFER_EOF_PENDING 2
245
246 };
247#endif /* !YY_STRUCT_YY_BUFFER_STATE */
248
249/* Stack of input buffers. */
250static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
251static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800252static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
Sol Boucher69b88bf2015-02-26 11:47:19 -0800253
254/* We provide macros for accessing buffer states in case in the
255 * future we want to put the buffer states in a more general
256 * "scanner state".
257 *
258 * Returns the top of the stack, or NULL.
259 */
260#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
261 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
262 : NULL)
263
264/* Same as previous macro, but useful when we know that the buffer stack is not
265 * NULL or when we need an lvalue. For internal use only.
266 */
267#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
268
269/* yy_hold_char holds the character lost when yytext is formed. */
270static char yy_hold_char;
Patrick Georgi2b807342016-06-28 20:45:34 +0200271static int yy_n_chars; /* number of characters read into yy_ch_buf */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800272int yyleng;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800273
274/* Points to current character in buffer. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800275static char *yy_c_buf_p = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800276static int yy_init = 0; /* whether we need to initialize */
277static int yy_start = 0; /* start state number */
278
279/* Flag which is used to allow yywrap()'s to do buffer switches
280 * instead of setting up a fresh yyin. A bit of a hack ...
281 */
282static int yy_did_buffer_switch_on_eof;
283
284void yyrestart (FILE *input_file );
285void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
286YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
287void yy_delete_buffer (YY_BUFFER_STATE b );
288void yy_flush_buffer (YY_BUFFER_STATE b );
289void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
290void yypop_buffer_state (void );
291
292static void yyensure_buffer_stack (void );
293static void yy_load_buffer_state (void );
294static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
295
296#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
297
298YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
299YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800300YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800301
302void *yyalloc (yy_size_t );
303void *yyrealloc (void *,yy_size_t );
304void yyfree (void * );
305
306#define yy_new_buffer yy_create_buffer
307
308#define yy_set_interactive(is_interactive) \
309 { \
310 if ( ! YY_CURRENT_BUFFER ){ \
311 yyensure_buffer_stack (); \
312 YY_CURRENT_BUFFER_LVALUE = \
313 yy_create_buffer(yyin,YY_BUF_SIZE ); \
314 } \
315 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
316 }
317
318#define yy_set_bol(at_bol) \
319 { \
320 if ( ! YY_CURRENT_BUFFER ){\
321 yyensure_buffer_stack (); \
322 YY_CURRENT_BUFFER_LVALUE = \
323 yy_create_buffer(yyin,YY_BUF_SIZE ); \
324 } \
325 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
326 }
327
328#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
329
330/* Begin user sect3 */
331
Patrick Georgi2b807342016-06-28 20:45:34 +0200332#define yywrap() (/*CONSTCOND*/1)
Sol Boucher69b88bf2015-02-26 11:47:19 -0800333#define YY_SKIP_YYWRAP
334
335typedef unsigned char YY_CHAR;
336
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800337FILE *yyin = NULL, *yyout = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800338
339typedef int yy_state_type;
340
341extern int yylineno;
342
343int yylineno = 1;
344
345extern char *yytext;
Patrick Georgi2b807342016-06-28 20:45:34 +0200346#ifdef yytext_ptr
347#undef yytext_ptr
348#endif
Sol Boucher69b88bf2015-02-26 11:47:19 -0800349#define yytext_ptr yytext
350
351static yy_state_type yy_get_previous_state (void );
352static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
353static int yy_get_next_buffer (void );
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800354static void yynoreturn yy_fatal_error (yyconst char* msg );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800355
356/* Done after the current pattern has been matched and before the
357 * corresponding action - sets up yytext.
358 */
359#define YY_DO_BEFORE_ACTION \
360 (yytext_ptr) = yy_bp; \
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800361 yyleng = (int) (yy_cp - yy_bp); \
Sol Boucher69b88bf2015-02-26 11:47:19 -0800362 (yy_hold_char) = *yy_cp; \
363 *yy_cp = '\0'; \
364 (yy_c_buf_p) = yy_cp;
365
Hung-Te Lin49a44502019-03-04 15:41:09 +0800366#define YY_NUM_RULES 13
367#define YY_END_OF_BUFFER 14
Sol Boucher69b88bf2015-02-26 11:47:19 -0800368/* This struct is not used in this scanner,
369 but its presence is necessary. */
370struct yy_trans_info
371 {
372 flex_int32_t yy_verify;
373 flex_int32_t yy_nxt;
374 };
Hung-Te Lin49a44502019-03-04 15:41:09 +0800375static yyconst flex_int16_t yy_accept[40] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800376 { 0,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800377 11, 11, 11, 11, 14, 11, 1, 1, 12, 3,
378 12, 7, 8, 4, 11, 11, 11, 1, 0, 2,
379 9, 7, 11, 8, 8, 11, 11, 9, 10, 11,
380 11, 10, 5, 11, 11, 11, 11, 6, 0
Sol Boucher69b88bf2015-02-26 11:47:19 -0800381 } ;
382
Patrick Georgi2b807342016-06-28 20:45:34 +0200383static yyconst YY_CHAR yy_ec[256] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800384 { 0,
385 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
386 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 2, 1, 1, 4, 1, 1, 1, 1, 5,
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800389 6, 1, 1, 1, 1, 1, 1, 7, 8, 8,
390 8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800391 1, 1, 1, 9, 10, 11, 12, 10, 13, 14,
392 15, 1, 1, 1, 15, 1, 15, 1, 1, 16,
393 1, 17, 18, 1, 1, 19, 1, 20, 1, 1,
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800394 1, 1, 1, 1, 1, 1, 10, 10, 10, 10,
Sol Boucher69b88bf2015-02-26 11:47:19 -0800395
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800396 10, 10, 1, 1, 1, 1, 1, 1, 1, 1,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800397 1, 1, 1, 1, 1, 1, 1, 1, 1, 20,
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800398 1, 1, 9, 1, 9, 1, 1, 1, 1, 1,
Sol Boucher69b88bf2015-02-26 11:47:19 -0800399 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, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1
413 } ;
414
Hung-Te Lin49a44502019-03-04 15:41:09 +0800415static yyconst YY_CHAR yy_meta[21] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800416 { 0,
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800417 1, 2, 2, 2, 2, 2, 1, 1, 2, 1,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Sol Boucher69b88bf2015-02-26 11:47:19 -0800419 } ;
420
Hung-Te Lin49a44502019-03-04 15:41:09 +0800421static yyconst flex_uint16_t yy_base[43] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800422 { 0,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800423 0, 8, 12, 13, 63, 0, 18, 20, 59, 64,
424 64, 23, 19, 64, 50, 43, 0, 30, 56, 64,
425 20, 0, 37, 0, 0, 44, 44, 0, 41, 28,
426 24, 0, 0, 28, 22, 18, 23, 0, 64, 51,
427 0, 53
Sol Boucher69b88bf2015-02-26 11:47:19 -0800428 } ;
429
Hung-Te Lin49a44502019-03-04 15:41:09 +0800430static yyconst flex_int16_t yy_def[43] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800431 { 0,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800432 40, 40, 2, 2, 39, 41, 39, 39, 42, 39,
433 39, 41, 41, 39, 41, 41, 41, 39, 42, 39,
434 12, 41, 41, 13, 41, 41, 41, 41, 23, 41,
435 41, 41, 41, 41, 41, 41, 41, 41, 0, 39,
436 39, 39
Sol Boucher69b88bf2015-02-26 11:47:19 -0800437 } ;
438
Hung-Te Lin49a44502019-03-04 15:41:09 +0800439static yyconst flex_uint16_t yy_nxt[85] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800440 { 0,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800441 17, 7, 8, 9, 10, 11, 12, 13, 11, 7,
442 8, 9, 10, 11, 12, 13, 11, 14, 14, 18,
443 18, 18, 18, 15, 15, 24, 24, 16, 16, 21,
444 21, 18, 18, 25, 28, 38, 37, 22, 36, 17,
445 35, 34, 23, 29, 29, 33, 29, 29, 29, 29,
446 29, 6, 6, 19, 19, 32, 31, 30, 20, 27,
447 26, 20, 39, 5, 39, 39, 39, 39, 39, 39,
448 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
449 39, 39, 39, 39
Sol Boucher69b88bf2015-02-26 11:47:19 -0800450 } ;
451
Hung-Te Lin49a44502019-03-04 15:41:09 +0800452static yyconst flex_int16_t yy_chk[85] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800453 { 0,
Hung-Te Lin49a44502019-03-04 15:41:09 +0800454 41, 1, 1, 1, 1, 1, 1, 1, 1, 2,
455 2, 2, 2, 2, 2, 2, 2, 3, 4, 7,
456 7, 8, 8, 3, 4, 13, 13, 3, 4, 12,
457 12, 18, 18, 13, 21, 37, 36, 12, 35, 21,
458 34, 31, 12, 23, 23, 30, 23, 23, 23, 23,
459 23, 40, 40, 42, 42, 29, 27, 26, 19, 16,
460 15, 9, 5, 39, 39, 39, 39, 39, 39, 39,
461 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
462 39, 39, 39, 39
Sol Boucher69b88bf2015-02-26 11:47:19 -0800463 } ;
464
465static yy_state_type yy_last_accepting_state;
466static char *yy_last_accepting_cpos;
467
468extern int yy_flex_debug;
469int yy_flex_debug = 0;
470
471/* The intent behind this definition is that it'll catch
472 * any uses of REJECT which flex missed.
473 */
474#define REJECT reject_used_but_not_detected
475#define yymore() yymore_used_but_not_detected
476#define YY_MORE_ADJ 0
477#define YY_RESTORE_YY_MORE_OFFSET
478char *yytext;
479#line 1 "fmd_scanner.l"
480/*
481 * fmd_scanner.l, scanner generator for flashmap descriptor language
482 *
483 * Copyright (C) 2015 Google, Inc.
484 *
485 * This program is free software; you can redistribute it and/or modify
486 * it under the terms of the GNU General Public License as published by
487 * the Free Software Foundation; version 2 of the License.
488 *
489 * This program is distributed in the hope that it will be useful,
490 * but WITHOUT ANY WARRANTY; without even the implied warranty of
491 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
492 * GNU General Public License for more details.
Sol Boucher69b88bf2015-02-26 11:47:19 -0800493 */
Patrick Georgi2b807342016-06-28 20:45:34 +0200494#line 17 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800495#include "fmd_parser.h"
496
497#include <assert.h>
498#include <string.h>
499
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +0200500int parse_integer(char *src, int base);
501int copy_string(const char *src);
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800502
Hung-Te Lin49a44502019-03-04 15:41:09 +0800503#line 504 "<stdout>"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800504
505#define INITIAL 0
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800506#define FLAGS 1
Sol Boucher69b88bf2015-02-26 11:47:19 -0800507
508#ifndef YY_NO_UNISTD_H
509/* Special case for "unistd.h", since it is non-ANSI. We include it way
510 * down here because we want the user's section 1 to have been scanned first.
511 * The user has a chance to override it with an option.
512 */
513#include <unistd.h>
514#endif
515
516#ifndef YY_EXTRA_TYPE
517#define YY_EXTRA_TYPE void *
518#endif
519
520static int yy_init_globals (void );
521
522/* Accessor methods to globals.
523 These are made visible to non-reentrant scanners for convenience. */
524
525int yylex_destroy (void );
526
527int yyget_debug (void );
528
529void yyset_debug (int debug_flag );
530
531YY_EXTRA_TYPE yyget_extra (void );
532
533void yyset_extra (YY_EXTRA_TYPE user_defined );
534
535FILE *yyget_in (void );
536
Patrick Georgi2b807342016-06-28 20:45:34 +0200537void yyset_in (FILE * _in_str );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800538
539FILE *yyget_out (void );
540
Patrick Georgi2b807342016-06-28 20:45:34 +0200541void yyset_out (FILE * _out_str );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800542
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800543 int yyget_leng (void );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800544
545char *yyget_text (void );
546
547int yyget_lineno (void );
548
Patrick Georgi2b807342016-06-28 20:45:34 +0200549void yyset_lineno (int _line_number );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800550
551/* Macros after this point can all be overridden by user definitions in
552 * section 1.
553 */
554
555#ifndef YY_SKIP_YYWRAP
556#ifdef __cplusplus
557extern "C" int yywrap (void );
558#else
559extern int yywrap (void );
560#endif
561#endif
562
Patrick Georgi2b807342016-06-28 20:45:34 +0200563#ifndef YY_NO_UNPUT
Martin Roth5c734132021-02-14 13:52:00 -0700564
Sol Boucher69b88bf2015-02-26 11:47:19 -0800565 static void yyunput (int c,char *buf_ptr );
Martin Roth5c734132021-02-14 13:52:00 -0700566
Patrick Georgi2b807342016-06-28 20:45:34 +0200567#endif
568
Sol Boucher69b88bf2015-02-26 11:47:19 -0800569#ifndef yytext_ptr
570static void yy_flex_strncpy (char *,yyconst char *,int );
571#endif
572
573#ifdef YY_NEED_STRLEN
574static int yy_flex_strlen (yyconst char * );
575#endif
576
577#ifndef YY_NO_INPUT
578
579#ifdef __cplusplus
580static int yyinput (void );
581#else
582static int input (void );
583#endif
584
585#endif
586
587/* Amount of stuff to slurp up with each read. */
588#ifndef YY_READ_BUF_SIZE
589#ifdef __ia64__
590/* On IA-64, the buffer size is 16k, not 8k */
591#define YY_READ_BUF_SIZE 16384
592#else
593#define YY_READ_BUF_SIZE 8192
594#endif /* __ia64__ */
595#endif
596
597/* Copy whatever the last rule matched to the standard output. */
598#ifndef ECHO
599/* This used to be an fputs(), but since the string might contain NUL's,
600 * we now use fwrite().
601 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800602#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
Sol Boucher69b88bf2015-02-26 11:47:19 -0800603#endif
604
605/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
606 * is returned in "result".
607 */
608#ifndef YY_INPUT
609#define YY_INPUT(buf,result,max_size) \
610 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
611 { \
612 int c = '*'; \
613 size_t n; \
614 for ( n = 0; n < max_size && \
615 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
616 buf[n] = (char) c; \
617 if ( c == '\n' ) \
618 buf[n++] = (char) c; \
619 if ( c == EOF && ferror( yyin ) ) \
620 YY_FATAL_ERROR( "input in flex scanner failed" ); \
621 result = n; \
622 } \
623 else \
624 { \
625 errno=0; \
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800626 while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
Sol Boucher69b88bf2015-02-26 11:47:19 -0800627 { \
628 if( errno != EINTR) \
629 { \
630 YY_FATAL_ERROR( "input in flex scanner failed" ); \
631 break; \
632 } \
633 errno=0; \
634 clearerr(yyin); \
635 } \
636 }\
637\
638
639#endif
640
641/* No semi-colon after return; correct usage is to write "yyterminate();" -
642 * we don't want an extra ';' after the "return" because that will cause
643 * some compilers to complain about unreachable statements.
644 */
645#ifndef yyterminate
646#define yyterminate() return YY_NULL
647#endif
648
649/* Number of entries by which start-condition stack grows. */
650#ifndef YY_START_STACK_INCR
651#define YY_START_STACK_INCR 25
652#endif
653
654/* Report a fatal error. */
655#ifndef YY_FATAL_ERROR
656#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
657#endif
658
659/* end tables serialization structures and prototypes */
660
661/* Default declaration of generated scanner - a define so the user can
662 * easily add parameters.
663 */
664#ifndef YY_DECL
665#define YY_DECL_IS_OURS 1
666
667extern int yylex (void);
668
669#define YY_DECL int yylex (void)
670#endif /* !YY_DECL */
671
672/* Code executed at the beginning of each rule, after yytext and yyleng
673 * have been set up.
674 */
675#ifndef YY_USER_ACTION
676#define YY_USER_ACTION
677#endif
678
679/* Code executed at the end of each rule. */
680#ifndef YY_BREAK
Patrick Georgi2b807342016-06-28 20:45:34 +0200681#define YY_BREAK /*LINTED*/break;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800682#endif
683
684#define YY_RULE_SETUP \
685 YY_USER_ACTION
686
687/** The main scanner function which does all the work.
688 */
689YY_DECL
690{
Patrick Georgi2b807342016-06-28 20:45:34 +0200691 yy_state_type yy_current_state;
692 char *yy_cp, *yy_bp;
693 int yy_act;
Martin Roth5c734132021-02-14 13:52:00 -0700694
Sol Boucher69b88bf2015-02-26 11:47:19 -0800695 if ( !(yy_init) )
696 {
697 (yy_init) = 1;
698
699#ifdef YY_USER_INIT
700 YY_USER_INIT;
701#endif
702
703 if ( ! (yy_start) )
704 (yy_start) = 1; /* first start state */
705
706 if ( ! yyin )
707 yyin = stdin;
708
709 if ( ! yyout )
710 yyout = stdout;
711
712 if ( ! YY_CURRENT_BUFFER ) {
713 yyensure_buffer_stack ();
714 YY_CURRENT_BUFFER_LVALUE =
715 yy_create_buffer(yyin,YY_BUF_SIZE );
716 }
717
718 yy_load_buffer_state( );
719 }
720
721 {
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800722#line 31 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800723
Hung-Te Lin49a44502019-03-04 15:41:09 +0800724#line 725 "<stdout>"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800725
Patrick Georgi2b807342016-06-28 20:45:34 +0200726 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
Sol Boucher69b88bf2015-02-26 11:47:19 -0800727 {
728 yy_cp = (yy_c_buf_p);
729
730 /* Support of yytext. */
731 *yy_cp = (yy_hold_char);
732
733 /* yy_bp points to the position in yy_ch_buf of the start of
734 * the current run.
735 */
736 yy_bp = yy_cp;
737
738 yy_current_state = (yy_start);
739yy_match:
740 do
741 {
Patrick Georgi2b807342016-06-28 20:45:34 +0200742 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800743 if ( yy_accept[yy_current_state] )
744 {
745 (yy_last_accepting_state) = yy_current_state;
746 (yy_last_accepting_cpos) = yy_cp;
747 }
748 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
749 {
750 yy_current_state = (int) yy_def[yy_current_state];
Hung-Te Lin49a44502019-03-04 15:41:09 +0800751 if ( yy_current_state >= 40 )
Sol Boucher69b88bf2015-02-26 11:47:19 -0800752 yy_c = yy_meta[(unsigned int) yy_c];
753 }
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800754 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
Sol Boucher69b88bf2015-02-26 11:47:19 -0800755 ++yy_cp;
756 }
Hung-Te Lin49a44502019-03-04 15:41:09 +0800757 while ( yy_base[yy_current_state] != 64 );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800758
759yy_find_action:
760 yy_act = yy_accept[yy_current_state];
761 if ( yy_act == 0 )
762 { /* have to back up */
763 yy_cp = (yy_last_accepting_cpos);
764 yy_current_state = (yy_last_accepting_state);
765 yy_act = yy_accept[yy_current_state];
766 }
767
768 YY_DO_BEFORE_ACTION;
769
770do_action: /* This label is used only to access EOF actions. */
771
772 switch ( yy_act )
773 { /* beginning of action switch */
774 case 0: /* must back up */
775 /* undo the effects of YY_DO_BEFORE_ACTION */
776 *yy_cp = (yy_hold_char);
777 yy_cp = (yy_last_accepting_cpos);
778 yy_current_state = (yy_last_accepting_state);
779 goto yy_find_action;
780
781case 1:
782/* rule 1 can match eol */
783YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200784#line 32 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800785/* Eat whitespace. */
786 YY_BREAK
787case 2:
788*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
789(yy_c_buf_p) = yy_cp -= 1;
790YY_DO_BEFORE_ACTION; /* set up yytext again */
791YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200792#line 33 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800793/* Eat comments. */
794 YY_BREAK
795case 3:
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800796YY_RULE_SETUP
797#line 34 "fmd_scanner.l"
798BEGIN(FLAGS); return *yytext;
799 YY_BREAK
Sol Boucher69b88bf2015-02-26 11:47:19 -0800800case 4:
801YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200802#line 35 "fmd_scanner.l"
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800803BEGIN(INITIAL); return *yytext;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800804 YY_BREAK
805case 5:
806YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200807#line 36 "fmd_scanner.l"
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800808return FLAG_CBFS;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800809 YY_BREAK
810case 6:
Sol Boucher69b88bf2015-02-26 11:47:19 -0800811YY_RULE_SETUP
Hung-Te Lin49a44502019-03-04 15:41:09 +0800812#line 37 "fmd_scanner.l"
813return FLAG_PRESERVE;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800814 YY_BREAK
Hung-Te Lin49a44502019-03-04 15:41:09 +0800815case 7:
816#line 39 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800817case 8:
818YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200819#line 39 "fmd_scanner.l"
Hung-Te Lin49a44502019-03-04 15:41:09 +0800820return parse_integer(yytext, 10);
Sol Boucher69b88bf2015-02-26 11:47:19 -0800821 YY_BREAK
822case 9:
823YY_RULE_SETUP
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800824#line 40 "fmd_scanner.l"
Hung-Te Lin49a44502019-03-04 15:41:09 +0800825return OCTAL;
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800826 YY_BREAK
827case 10:
828YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200829#line 41 "fmd_scanner.l"
Hung-Te Lin49a44502019-03-04 15:41:09 +0800830return parse_integer(yytext + 2, 16);
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800831 YY_BREAK
832case 11:
833YY_RULE_SETUP
834#line 42 "fmd_scanner.l"
Hung-Te Lin49a44502019-03-04 15:41:09 +0800835return copy_string(yytext);
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800836 YY_BREAK
837case 12:
838YY_RULE_SETUP
Hung-Te Lin49a44502019-03-04 15:41:09 +0800839#line 43 "fmd_scanner.l"
840return *yytext;
841 YY_BREAK
842case 13:
843YY_RULE_SETUP
844#line 45 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800845ECHO;
846 YY_BREAK
Hung-Te Lin49a44502019-03-04 15:41:09 +0800847#line 848 "<stdout>"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800848case YY_STATE_EOF(INITIAL):
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800849case YY_STATE_EOF(FLAGS):
Sol Boucher69b88bf2015-02-26 11:47:19 -0800850 yyterminate();
851
852 case YY_END_OF_BUFFER:
853 {
854 /* Amount of text matched not including the EOB char. */
855 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
856
857 /* Undo the effects of YY_DO_BEFORE_ACTION. */
858 *yy_cp = (yy_hold_char);
859 YY_RESTORE_YY_MORE_OFFSET
860
861 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
862 {
863 /* We're scanning a new file or input source. It's
864 * possible that this happened because the user
865 * just pointed yyin at a new source and called
866 * yylex(). If so, then we have to assure
867 * consistency between YY_CURRENT_BUFFER and our
868 * globals. Here is the right place to do so, because
869 * this is the first action (other than possibly a
870 * back-up) that will match for the new input source.
871 */
872 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
873 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
874 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
875 }
876
877 /* Note that here we test for yy_c_buf_p "<=" to the position
878 * of the first EOB in the buffer, since yy_c_buf_p will
879 * already have been incremented past the NUL character
880 * (since all states make transitions on EOB to the
881 * end-of-buffer state). Contrast this with the test
882 * in input().
883 */
884 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
885 { /* This was really a NUL. */
886 yy_state_type yy_next_state;
887
888 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
889
890 yy_current_state = yy_get_previous_state( );
891
892 /* Okay, we're now positioned to make the NUL
893 * transition. We couldn't have
894 * yy_get_previous_state() go ahead and do it
895 * for us because it doesn't know how to deal
896 * with the possibility of jamming (and we don't
897 * want to build jamming into it because then it
898 * will run more slowly).
899 */
900
901 yy_next_state = yy_try_NUL_trans( yy_current_state );
902
903 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
904
905 if ( yy_next_state )
906 {
907 /* Consume the NUL. */
908 yy_cp = ++(yy_c_buf_p);
909 yy_current_state = yy_next_state;
910 goto yy_match;
911 }
912
913 else
914 {
915 yy_cp = (yy_c_buf_p);
916 goto yy_find_action;
917 }
918 }
919
920 else switch ( yy_get_next_buffer( ) )
921 {
922 case EOB_ACT_END_OF_FILE:
923 {
924 (yy_did_buffer_switch_on_eof) = 0;
925
926 if ( yywrap( ) )
927 {
928 /* Note: because we've taken care in
929 * yy_get_next_buffer() to have set up
930 * yytext, we can now set up
931 * yy_c_buf_p so that if some total
932 * hoser (like flex itself) wants to
933 * call the scanner after we return the
934 * YY_NULL, it'll still work - another
935 * YY_NULL will get returned.
936 */
937 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
938
939 yy_act = YY_STATE_EOF(YY_START);
940 goto do_action;
941 }
942
943 else
944 {
945 if ( ! (yy_did_buffer_switch_on_eof) )
946 YY_NEW_FILE;
947 }
948 break;
949 }
950
951 case EOB_ACT_CONTINUE_SCAN:
952 (yy_c_buf_p) =
953 (yytext_ptr) + yy_amount_of_matched_text;
954
955 yy_current_state = yy_get_previous_state( );
956
957 yy_cp = (yy_c_buf_p);
958 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
959 goto yy_match;
960
961 case EOB_ACT_LAST_MATCH:
962 (yy_c_buf_p) =
963 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
964
965 yy_current_state = yy_get_previous_state( );
966
967 yy_cp = (yy_c_buf_p);
968 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
969 goto yy_find_action;
970 }
971 break;
972 }
973
974 default:
975 YY_FATAL_ERROR(
976 "fatal flex scanner internal error--no action found" );
977 } /* end of action switch */
978 } /* end of scanning one token */
979 } /* end of user's declarations */
980} /* end of yylex */
981
982/* yy_get_next_buffer - try to read in a new buffer
983 *
984 * Returns a code representing an action:
985 * EOB_ACT_LAST_MATCH -
986 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
987 * EOB_ACT_END_OF_FILE - end of file
988 */
989static int yy_get_next_buffer (void)
990{
Patrick Georgi2b807342016-06-28 20:45:34 +0200991 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
992 char *source = (yytext_ptr);
Hung-Te Lin9497fcb2019-03-04 14:28:37 +0800993 int number_to_move, i;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800994 int ret_val;
995
996 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
997 YY_FATAL_ERROR(
998 "fatal flex scanner internal error--end of buffer missed" );
999
1000 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1001 { /* Don't try to fill the buffer, so this is an EOF. */
1002 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1003 {
1004 /* We matched a single character, the EOB, so
1005 * treat this as a final EOF.
1006 */
1007 return EOB_ACT_END_OF_FILE;
1008 }
1009
1010 else
1011 {
1012 /* We matched some text prior to the EOB, first
1013 * process it.
1014 */
1015 return EOB_ACT_LAST_MATCH;
1016 }
1017 }
1018
1019 /* Try to read more data. */
1020
1021 /* First move last chars to start of buffer. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001022 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001023
1024 for ( i = 0; i < number_to_move; ++i )
1025 *(dest++) = *(source++);
1026
1027 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1028 /* don't do the read, it's not guaranteed to return an EOF,
1029 * just force an EOF
1030 */
1031 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1032
1033 else
1034 {
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001035 int num_to_read =
Sol Boucher69b88bf2015-02-26 11:47:19 -08001036 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1037
1038 while ( num_to_read <= 0 )
1039 { /* Not enough room in the buffer - grow it. */
1040
1041 /* just a shorter name for the current buffer */
1042 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1043
1044 int yy_c_buf_p_offset =
1045 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1046
1047 if ( b->yy_is_our_buffer )
1048 {
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001049 int new_size = b->yy_buf_size * 2;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001050
1051 if ( new_size <= 0 )
1052 b->yy_buf_size += b->yy_buf_size / 8;
1053 else
1054 b->yy_buf_size *= 2;
1055
1056 b->yy_ch_buf = (char *)
1057 /* Include room in for 2 EOB chars. */
1058 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1059 }
1060 else
1061 /* Can't grow it, we don't own it. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001062 b->yy_ch_buf = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001063
1064 if ( ! b->yy_ch_buf )
1065 YY_FATAL_ERROR(
1066 "fatal error - scanner input buffer overflow" );
1067
1068 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1069
1070 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1071 number_to_move - 1;
1072
1073 }
1074
1075 if ( num_to_read > YY_READ_BUF_SIZE )
1076 num_to_read = YY_READ_BUF_SIZE;
1077
1078 /* Read in more data. */
1079 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1080 (yy_n_chars), num_to_read );
1081
1082 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1083 }
1084
1085 if ( (yy_n_chars) == 0 )
1086 {
1087 if ( number_to_move == YY_MORE_ADJ )
1088 {
1089 ret_val = EOB_ACT_END_OF_FILE;
1090 yyrestart(yyin );
1091 }
1092
1093 else
1094 {
1095 ret_val = EOB_ACT_LAST_MATCH;
1096 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1097 YY_BUFFER_EOF_PENDING;
1098 }
1099 }
1100
1101 else
1102 ret_val = EOB_ACT_CONTINUE_SCAN;
1103
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001104 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
Sol Boucher69b88bf2015-02-26 11:47:19 -08001105 /* Extend the array by 50%, plus the number we really need. */
Patrick Georgi2b807342016-06-28 20:45:34 +02001106 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001107 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1108 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1109 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1110 }
1111
1112 (yy_n_chars) += number_to_move;
1113 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1114 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1115
1116 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1117
1118 return ret_val;
1119}
1120
1121/* yy_get_previous_state - get the state just before the EOB char was reached */
1122
1123 static yy_state_type yy_get_previous_state (void)
1124{
Patrick Georgi2b807342016-06-28 20:45:34 +02001125 yy_state_type yy_current_state;
1126 char *yy_cp;
Martin Roth5c734132021-02-14 13:52:00 -07001127
Sol Boucher69b88bf2015-02-26 11:47:19 -08001128 yy_current_state = (yy_start);
1129
1130 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1131 {
Patrick Georgi2b807342016-06-28 20:45:34 +02001132 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001133 if ( yy_accept[yy_current_state] )
1134 {
1135 (yy_last_accepting_state) = yy_current_state;
1136 (yy_last_accepting_cpos) = yy_cp;
1137 }
1138 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1139 {
1140 yy_current_state = (int) yy_def[yy_current_state];
Hung-Te Lin49a44502019-03-04 15:41:09 +08001141 if ( yy_current_state >= 40 )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001142 yy_c = yy_meta[(unsigned int) yy_c];
1143 }
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001144 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
Sol Boucher69b88bf2015-02-26 11:47:19 -08001145 }
1146
1147 return yy_current_state;
1148}
1149
1150/* yy_try_NUL_trans - try to make a transition on the NUL character
1151 *
1152 * synopsis
1153 * next_state = yy_try_NUL_trans( current_state );
1154 */
1155 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1156{
Patrick Georgi2b807342016-06-28 20:45:34 +02001157 int yy_is_jam;
1158 char *yy_cp = (yy_c_buf_p);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001159
Patrick Georgi2b807342016-06-28 20:45:34 +02001160 YY_CHAR yy_c = 1;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001161 if ( yy_accept[yy_current_state] )
1162 {
1163 (yy_last_accepting_state) = yy_current_state;
1164 (yy_last_accepting_cpos) = yy_cp;
1165 }
1166 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1167 {
1168 yy_current_state = (int) yy_def[yy_current_state];
Hung-Te Lin49a44502019-03-04 15:41:09 +08001169 if ( yy_current_state >= 40 )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001170 yy_c = yy_meta[(unsigned int) yy_c];
1171 }
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001172 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
Hung-Te Lin49a44502019-03-04 15:41:09 +08001173 yy_is_jam = (yy_current_state == 39);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001174
1175 return yy_is_jam ? 0 : yy_current_state;
1176}
1177
Patrick Georgi2b807342016-06-28 20:45:34 +02001178#ifndef YY_NO_UNPUT
1179
1180 static void yyunput (int c, char * yy_bp )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001181{
Patrick Georgi2b807342016-06-28 20:45:34 +02001182 char *yy_cp;
Martin Roth5c734132021-02-14 13:52:00 -07001183
Sol Boucher69b88bf2015-02-26 11:47:19 -08001184 yy_cp = (yy_c_buf_p);
1185
1186 /* undo effects of setting up yytext */
1187 *yy_cp = (yy_hold_char);
1188
1189 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1190 { /* need to shift things up to make room */
1191 /* +2 for EOB chars. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001192 int number_to_move = (yy_n_chars) + 2;
Patrick Georgi2b807342016-06-28 20:45:34 +02001193 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
Sol Boucher69b88bf2015-02-26 11:47:19 -08001194 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
Patrick Georgi2b807342016-06-28 20:45:34 +02001195 char *source =
Sol Boucher69b88bf2015-02-26 11:47:19 -08001196 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1197
1198 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1199 *--dest = *--source;
1200
1201 yy_cp += (int) (dest - source);
1202 yy_bp += (int) (dest - source);
1203 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001204 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001205
1206 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1207 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1208 }
1209
1210 *--yy_cp = (char) c;
1211
1212 (yytext_ptr) = yy_bp;
1213 (yy_hold_char) = *yy_cp;
1214 (yy_c_buf_p) = yy_cp;
1215}
1216
Patrick Georgi2b807342016-06-28 20:45:34 +02001217#endif
1218
Sol Boucher69b88bf2015-02-26 11:47:19 -08001219#ifndef YY_NO_INPUT
1220#ifdef __cplusplus
1221 static int yyinput (void)
1222#else
1223 static int input (void)
1224#endif
1225
1226{
1227 int c;
Martin Roth5c734132021-02-14 13:52:00 -07001228
Sol Boucher69b88bf2015-02-26 11:47:19 -08001229 *(yy_c_buf_p) = (yy_hold_char);
1230
1231 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1232 {
1233 /* yy_c_buf_p now points to the character we want to return.
1234 * If this occurs *before* the EOB characters, then it's a
1235 * valid NUL; if not, then we've hit the end of the buffer.
1236 */
1237 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1238 /* This was really a NUL. */
1239 *(yy_c_buf_p) = '\0';
1240
1241 else
1242 { /* need more input */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001243 int offset = (yy_c_buf_p) - (yytext_ptr);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001244 ++(yy_c_buf_p);
1245
1246 switch ( yy_get_next_buffer( ) )
1247 {
1248 case EOB_ACT_LAST_MATCH:
1249 /* This happens because yy_g_n_b()
1250 * sees that we've accumulated a
1251 * token and flags that we need to
1252 * try matching the token before
1253 * proceeding. But for input(),
1254 * there's no matching to consider.
1255 * So convert the EOB_ACT_LAST_MATCH
1256 * to EOB_ACT_END_OF_FILE.
1257 */
1258
1259 /* Reset buffer status. */
1260 yyrestart(yyin );
1261
1262 /*FALLTHROUGH*/
1263
1264 case EOB_ACT_END_OF_FILE:
1265 {
1266 if ( yywrap( ) )
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001267 return 0;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001268
1269 if ( ! (yy_did_buffer_switch_on_eof) )
1270 YY_NEW_FILE;
1271#ifdef __cplusplus
1272 return yyinput();
1273#else
1274 return input();
1275#endif
1276 }
1277
1278 case EOB_ACT_CONTINUE_SCAN:
1279 (yy_c_buf_p) = (yytext_ptr) + offset;
1280 break;
1281 }
1282 }
1283 }
1284
1285 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1286 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1287 (yy_hold_char) = *++(yy_c_buf_p);
1288
1289 return c;
1290}
1291#endif /* ifndef YY_NO_INPUT */
1292
1293/** Immediately switch to a different input stream.
1294 * @param input_file A readable stream.
Martin Roth5c734132021-02-14 13:52:00 -07001295 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001296 * @note This function does not reset the start condition to @c INITIAL .
1297 */
1298 void yyrestart (FILE * input_file )
1299{
Martin Roth5c734132021-02-14 13:52:00 -07001300
Sol Boucher69b88bf2015-02-26 11:47:19 -08001301 if ( ! YY_CURRENT_BUFFER ){
1302 yyensure_buffer_stack ();
1303 YY_CURRENT_BUFFER_LVALUE =
1304 yy_create_buffer(yyin,YY_BUF_SIZE );
1305 }
1306
1307 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1308 yy_load_buffer_state( );
1309}
1310
1311/** Switch to a different input buffer.
1312 * @param new_buffer The new input buffer.
Martin Roth5c734132021-02-14 13:52:00 -07001313 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001314 */
1315 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1316{
Martin Roth5c734132021-02-14 13:52:00 -07001317
Sol Boucher69b88bf2015-02-26 11:47:19 -08001318 /* TODO. We should be able to replace this entire function body
1319 * with
1320 * yypop_buffer_state();
1321 * yypush_buffer_state(new_buffer);
1322 */
1323 yyensure_buffer_stack ();
1324 if ( YY_CURRENT_BUFFER == new_buffer )
1325 return;
1326
1327 if ( YY_CURRENT_BUFFER )
1328 {
1329 /* Flush out information for old buffer. */
1330 *(yy_c_buf_p) = (yy_hold_char);
1331 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1332 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1333 }
1334
1335 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1336 yy_load_buffer_state( );
1337
1338 /* We don't actually know whether we did this switch during
1339 * EOF (yywrap()) processing, but the only time this flag
1340 * is looked at is after yywrap() is called, so it's safe
1341 * to go ahead and always set it.
1342 */
1343 (yy_did_buffer_switch_on_eof) = 1;
1344}
1345
1346static void yy_load_buffer_state (void)
1347{
1348 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1349 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1350 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1351 (yy_hold_char) = *(yy_c_buf_p);
1352}
1353
1354/** Allocate and initialize an input buffer state.
1355 * @param file A readable stream.
1356 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
Martin Roth5c734132021-02-14 13:52:00 -07001357 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001358 * @return the allocated buffer state.
1359 */
1360 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1361{
1362 YY_BUFFER_STATE b;
Martin Roth5c734132021-02-14 13:52:00 -07001363
Sol Boucher69b88bf2015-02-26 11:47:19 -08001364 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1365 if ( ! b )
1366 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1367
Patrick Georgi2b807342016-06-28 20:45:34 +02001368 b->yy_buf_size = (yy_size_t)size;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001369
1370 /* yy_ch_buf has to be 2 characters longer than the size given because
1371 * we need to put in 2 end-of-buffer characters.
1372 */
1373 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1374 if ( ! b->yy_ch_buf )
1375 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1376
1377 b->yy_is_our_buffer = 1;
1378
1379 yy_init_buffer(b,file );
1380
1381 return b;
1382}
1383
1384/** Destroy the buffer.
1385 * @param b a buffer created with yy_create_buffer()
Martin Roth5c734132021-02-14 13:52:00 -07001386 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001387 */
1388 void yy_delete_buffer (YY_BUFFER_STATE b )
1389{
Martin Roth5c734132021-02-14 13:52:00 -07001390
Sol Boucher69b88bf2015-02-26 11:47:19 -08001391 if ( ! b )
1392 return;
1393
1394 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1395 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1396
1397 if ( b->yy_is_our_buffer )
1398 yyfree((void *) b->yy_ch_buf );
1399
1400 yyfree((void *) b );
1401}
1402
1403/* Initializes or reinitializes a buffer.
1404 * This function is sometimes called more than once on the same buffer,
1405 * such as during a yyrestart() or at EOF.
1406 */
1407 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1408
1409{
1410 int oerrno = errno;
Martin Roth5c734132021-02-14 13:52:00 -07001411
Sol Boucher69b88bf2015-02-26 11:47:19 -08001412 yy_flush_buffer(b );
1413
1414 b->yy_input_file = file;
1415 b->yy_fill_buffer = 1;
1416
1417 /* If b is the current buffer, then yy_init_buffer was _probably_
1418 * called from yyrestart() or through yy_get_next_buffer.
1419 * In that case, we don't want to reset the lineno or column.
1420 */
1421 if (b != YY_CURRENT_BUFFER){
1422 b->yy_bs_lineno = 1;
1423 b->yy_bs_column = 0;
1424 }
1425
1426 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
Martin Roth5c734132021-02-14 13:52:00 -07001427
Sol Boucher69b88bf2015-02-26 11:47:19 -08001428 errno = oerrno;
1429}
1430
1431/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1432 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
Martin Roth5c734132021-02-14 13:52:00 -07001433 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001434 */
1435 void yy_flush_buffer (YY_BUFFER_STATE b )
1436{
1437 if ( ! b )
1438 return;
1439
1440 b->yy_n_chars = 0;
1441
1442 /* We always need two end-of-buffer characters. The first causes
1443 * a transition to the end-of-buffer state. The second causes
1444 * a jam in that state.
1445 */
1446 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1447 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1448
1449 b->yy_buf_pos = &b->yy_ch_buf[0];
1450
1451 b->yy_at_bol = 1;
1452 b->yy_buffer_status = YY_BUFFER_NEW;
1453
1454 if ( b == YY_CURRENT_BUFFER )
1455 yy_load_buffer_state( );
1456}
1457
1458/** Pushes the new state onto the stack. The new state becomes
1459 * the current state. This function will allocate the stack
1460 * if necessary.
1461 * @param new_buffer The new state.
Martin Roth5c734132021-02-14 13:52:00 -07001462 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001463 */
1464void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1465{
1466 if (new_buffer == NULL)
1467 return;
1468
1469 yyensure_buffer_stack();
1470
1471 /* This block is copied from yy_switch_to_buffer. */
1472 if ( YY_CURRENT_BUFFER )
1473 {
1474 /* Flush out information for old buffer. */
1475 *(yy_c_buf_p) = (yy_hold_char);
1476 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1477 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1478 }
1479
1480 /* Only push if top exists. Otherwise, replace top. */
1481 if (YY_CURRENT_BUFFER)
1482 (yy_buffer_stack_top)++;
1483 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1484
1485 /* copied from yy_switch_to_buffer. */
1486 yy_load_buffer_state( );
1487 (yy_did_buffer_switch_on_eof) = 1;
1488}
1489
1490/** Removes and deletes the top of the stack, if present.
1491 * The next element becomes the new top.
Martin Roth5c734132021-02-14 13:52:00 -07001492 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001493 */
1494void yypop_buffer_state (void)
1495{
1496 if (!YY_CURRENT_BUFFER)
1497 return;
1498
1499 yy_delete_buffer(YY_CURRENT_BUFFER );
1500 YY_CURRENT_BUFFER_LVALUE = NULL;
1501 if ((yy_buffer_stack_top) > 0)
1502 --(yy_buffer_stack_top);
1503
1504 if (YY_CURRENT_BUFFER) {
1505 yy_load_buffer_state( );
1506 (yy_did_buffer_switch_on_eof) = 1;
1507 }
1508}
1509
1510/* Allocates the stack if it does not exist.
1511 * Guarantees space for at least one push.
1512 */
1513static void yyensure_buffer_stack (void)
1514{
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001515 int num_to_alloc;
Martin Roth5c734132021-02-14 13:52:00 -07001516
Sol Boucher69b88bf2015-02-26 11:47:19 -08001517 if (!(yy_buffer_stack)) {
1518
1519 /* First allocation is just for 2 elements, since we don't know if this
1520 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1521 * immediate realloc on the next call.
1522 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001523 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
Sol Boucher69b88bf2015-02-26 11:47:19 -08001524 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1525 (num_to_alloc * sizeof(struct yy_buffer_state*)
1526 );
1527 if ( ! (yy_buffer_stack) )
1528 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001529
Sol Boucher69b88bf2015-02-26 11:47:19 -08001530 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001531
Sol Boucher69b88bf2015-02-26 11:47:19 -08001532 (yy_buffer_stack_max) = num_to_alloc;
1533 (yy_buffer_stack_top) = 0;
1534 return;
1535 }
1536
1537 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1538
1539 /* Increase the buffer to prepare for a possible push. */
Patrick Georgi2b807342016-06-28 20:45:34 +02001540 yy_size_t grow_size = 8 /* arbitrary grow size */;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001541
1542 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1543 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1544 ((yy_buffer_stack),
1545 num_to_alloc * sizeof(struct yy_buffer_state*)
1546 );
1547 if ( ! (yy_buffer_stack) )
1548 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1549
1550 /* zero only the new slots.*/
1551 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1552 (yy_buffer_stack_max) = num_to_alloc;
1553 }
1554}
1555
1556/** Setup the input buffer state to scan directly from a user-specified character buffer.
1557 * @param base the character buffer
1558 * @param size the size in bytes of the character buffer
Martin Roth5c734132021-02-14 13:52:00 -07001559 *
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001560 * @return the newly allocated buffer state object.
Sol Boucher69b88bf2015-02-26 11:47:19 -08001561 */
1562YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1563{
1564 YY_BUFFER_STATE b;
Martin Roth5c734132021-02-14 13:52:00 -07001565
Sol Boucher69b88bf2015-02-26 11:47:19 -08001566 if ( size < 2 ||
1567 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1568 base[size-1] != YY_END_OF_BUFFER_CHAR )
1569 /* They forgot to leave room for the EOB's. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001570 return NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001571
1572 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1573 if ( ! b )
1574 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1575
1576 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1577 b->yy_buf_pos = b->yy_ch_buf = base;
1578 b->yy_is_our_buffer = 0;
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001579 b->yy_input_file = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001580 b->yy_n_chars = b->yy_buf_size;
1581 b->yy_is_interactive = 0;
1582 b->yy_at_bol = 1;
1583 b->yy_fill_buffer = 0;
1584 b->yy_buffer_status = YY_BUFFER_NEW;
1585
1586 yy_switch_to_buffer(b );
1587
1588 return b;
1589}
1590
1591/** Setup the input buffer state to scan a string. The next call to yylex() will
1592 * scan from a @e copy of @a str.
1593 * @param yystr a NUL-terminated string to scan
Martin Roth5c734132021-02-14 13:52:00 -07001594 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001595 * @return the newly allocated buffer state object.
1596 * @note If you want to scan bytes that may contain NUL values, then use
1597 * yy_scan_bytes() instead.
1598 */
1599YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1600{
Martin Roth5c734132021-02-14 13:52:00 -07001601
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001602 return yy_scan_bytes(yystr,(int) strlen(yystr) );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001603}
1604
1605/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1606 * scan from a @e copy of @a bytes.
1607 * @param yybytes the byte buffer to scan
1608 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
Martin Roth5c734132021-02-14 13:52:00 -07001609 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001610 * @return the newly allocated buffer state object.
1611 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001612YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001613{
1614 YY_BUFFER_STATE b;
1615 char *buf;
1616 yy_size_t n;
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001617 int i;
Martin Roth5c734132021-02-14 13:52:00 -07001618
Sol Boucher69b88bf2015-02-26 11:47:19 -08001619 /* Get memory for full buffer, including space for trailing EOB's. */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001620 n = (yy_size_t) (_yybytes_len + 2);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001621 buf = (char *) yyalloc(n );
1622 if ( ! buf )
1623 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1624
1625 for ( i = 0; i < _yybytes_len; ++i )
1626 buf[i] = yybytes[i];
1627
1628 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1629
1630 b = yy_scan_buffer(buf,n );
1631 if ( ! b )
1632 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1633
1634 /* It's okay to grow etc. this buffer, and we should throw it
1635 * away when we're done.
1636 */
1637 b->yy_is_our_buffer = 1;
1638
1639 return b;
1640}
1641
1642#ifndef YY_EXIT_FAILURE
1643#define YY_EXIT_FAILURE 2
1644#endif
1645
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001646static void yynoreturn yy_fatal_error (yyconst char* msg )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001647{
Patrick Georgi2b807342016-06-28 20:45:34 +02001648 (void) fprintf( stderr, "%s\n", msg );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001649 exit( YY_EXIT_FAILURE );
1650}
1651
1652/* Redefine yyless() so it works in section 3 code. */
1653
1654#undef yyless
1655#define yyless(n) \
1656 do \
1657 { \
1658 /* Undo effects of setting up yytext. */ \
1659 int yyless_macro_arg = (n); \
1660 YY_LESS_LINENO(yyless_macro_arg);\
1661 yytext[yyleng] = (yy_hold_char); \
1662 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1663 (yy_hold_char) = *(yy_c_buf_p); \
1664 *(yy_c_buf_p) = '\0'; \
1665 yyleng = yyless_macro_arg; \
1666 } \
1667 while ( 0 )
1668
1669/* Accessor methods (get/set functions) to struct members. */
1670
1671/** Get the current line number.
Martin Roth5c734132021-02-14 13:52:00 -07001672 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001673 */
1674int yyget_lineno (void)
1675{
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001676
Sol Boucher69b88bf2015-02-26 11:47:19 -08001677 return yylineno;
1678}
1679
1680/** Get the input stream.
Martin Roth5c734132021-02-14 13:52:00 -07001681 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001682 */
1683FILE *yyget_in (void)
1684{
1685 return yyin;
1686}
1687
1688/** Get the output stream.
Martin Roth5c734132021-02-14 13:52:00 -07001689 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001690 */
1691FILE *yyget_out (void)
1692{
1693 return yyout;
1694}
1695
1696/** Get the length of the current token.
Martin Roth5c734132021-02-14 13:52:00 -07001697 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001698 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001699int yyget_leng (void)
Sol Boucher69b88bf2015-02-26 11:47:19 -08001700{
1701 return yyleng;
1702}
1703
1704/** Get the current token.
Martin Roth5c734132021-02-14 13:52:00 -07001705 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001706 */
1707
1708char *yyget_text (void)
1709{
1710 return yytext;
1711}
1712
1713/** Set the current line number.
Patrick Georgi2b807342016-06-28 20:45:34 +02001714 * @param _line_number line number
Martin Roth5c734132021-02-14 13:52:00 -07001715 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001716 */
Patrick Georgi2b807342016-06-28 20:45:34 +02001717void yyset_lineno (int _line_number )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001718{
Martin Roth5c734132021-02-14 13:52:00 -07001719
Patrick Georgi2b807342016-06-28 20:45:34 +02001720 yylineno = _line_number;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001721}
1722
1723/** Set the input stream. This does not discard the current
1724 * input buffer.
Patrick Georgi2b807342016-06-28 20:45:34 +02001725 * @param _in_str A readable stream.
Martin Roth5c734132021-02-14 13:52:00 -07001726 *
Sol Boucher69b88bf2015-02-26 11:47:19 -08001727 * @see yy_switch_to_buffer
1728 */
Patrick Georgi2b807342016-06-28 20:45:34 +02001729void yyset_in (FILE * _in_str )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001730{
Patrick Georgi2b807342016-06-28 20:45:34 +02001731 yyin = _in_str ;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001732}
1733
Patrick Georgi2b807342016-06-28 20:45:34 +02001734void yyset_out (FILE * _out_str )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001735{
Patrick Georgi2b807342016-06-28 20:45:34 +02001736 yyout = _out_str ;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001737}
1738
1739int yyget_debug (void)
1740{
1741 return yy_flex_debug;
1742}
1743
Patrick Georgi2b807342016-06-28 20:45:34 +02001744void yyset_debug (int _bdebug )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001745{
Patrick Georgi2b807342016-06-28 20:45:34 +02001746 yy_flex_debug = _bdebug ;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001747}
1748
1749static int yy_init_globals (void)
1750{
1751 /* Initialization is the same as for the non-reentrant scanner.
1752 * This function is called from yylex_destroy(), so don't allocate here.
1753 */
1754
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001755 (yy_buffer_stack) = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001756 (yy_buffer_stack_top) = 0;
1757 (yy_buffer_stack_max) = 0;
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001758 (yy_c_buf_p) = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001759 (yy_init) = 0;
1760 (yy_start) = 0;
1761
1762/* Defined in main.c */
1763#ifdef YY_STDINIT
1764 yyin = stdin;
1765 yyout = stdout;
1766#else
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001767 yyin = NULL;
1768 yyout = NULL;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001769#endif
1770
1771 /* For future reference: Set errno on error, since we are called by
1772 * yylex_init()
1773 */
1774 return 0;
1775}
1776
1777/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1778int yylex_destroy (void)
1779{
Martin Roth5c734132021-02-14 13:52:00 -07001780
Sol Boucher69b88bf2015-02-26 11:47:19 -08001781 /* Pop the buffer stack, destroying each element. */
1782 while(YY_CURRENT_BUFFER){
1783 yy_delete_buffer(YY_CURRENT_BUFFER );
1784 YY_CURRENT_BUFFER_LVALUE = NULL;
1785 yypop_buffer_state();
1786 }
1787
1788 /* Destroy the stack itself. */
1789 yyfree((yy_buffer_stack) );
1790 (yy_buffer_stack) = NULL;
1791
1792 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1793 * yylex() is called, initialization will occur. */
1794 yy_init_globals( );
1795
1796 return 0;
1797}
1798
1799/*
1800 * Internal utility routines.
1801 */
1802
1803#ifndef yytext_ptr
1804static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1805{
Martin Roth5c734132021-02-14 13:52:00 -07001806
Patrick Georgi2b807342016-06-28 20:45:34 +02001807 int i;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001808 for ( i = 0; i < n; ++i )
1809 s1[i] = s2[i];
1810}
1811#endif
1812
1813#ifdef YY_NEED_STRLEN
1814static int yy_flex_strlen (yyconst char * s )
1815{
Patrick Georgi2b807342016-06-28 20:45:34 +02001816 int n;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001817 for ( n = 0; s[n]; ++n )
1818 ;
1819
1820 return n;
1821}
1822#endif
1823
1824void *yyalloc (yy_size_t size )
1825{
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001826 return malloc(size);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001827}
1828
1829void *yyrealloc (void * ptr, yy_size_t size )
1830{
Martin Roth5c734132021-02-14 13:52:00 -07001831
Sol Boucher69b88bf2015-02-26 11:47:19 -08001832 /* The cast to (char *) in the following accommodates both
1833 * implementations that use char* generic pointers, and those
1834 * that use void* generic pointers. It works with the latter
1835 * because both ANSI C and C++ allow castless assignment from
1836 * any pointer type to void*, and deal with argument conversions
1837 * as though doing an assignment.
1838 */
Hung-Te Lin9497fcb2019-03-04 14:28:37 +08001839 return realloc(ptr, size);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001840}
1841
1842void yyfree (void * ptr )
1843{
Patrick Georgi2b807342016-06-28 20:45:34 +02001844 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
Sol Boucher69b88bf2015-02-26 11:47:19 -08001845}
1846
1847#define YYTABLES_NAME "yytables"
1848
Hung-Te Lin49a44502019-03-04 15:41:09 +08001849#line 45 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -08001850
1851
1852
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001853int parse_integer(char *src, int base)
Sol Boucher69b88bf2015-02-26 11:47:19 -08001854{
1855 char *multiplier = NULL;
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001856 unsigned val = strtoul(src, &multiplier, base);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001857
1858 if (*multiplier) {
1859 switch(*multiplier) {
1860 case 'K':
1861 val *= 1024;
1862 break;
1863 case 'M':
1864 val *= 1024*1024;
1865 break;
1866 case 'G':
1867 val *= 1024*1024*1024;
1868 break;
1869 default:
1870 // If we ever get here, the MULTIPLIER regex is allowing
1871 // multiplier suffixes not handled by this code.
1872 assert(false);
1873 }
1874 }
1875
1876 yylval.intval = val;
1877 return INTEGER;
1878}
1879
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001880int copy_string(const char *src)
Sol Boucher69b88bf2015-02-26 11:47:19 -08001881{
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001882 yylval.strval = strdup(src);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001883 return STRING;
1884}
Patrick Georgi2b807342016-06-28 20:45:34 +02001885