Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1 | |
| 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 Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 10 | #define YY_FLEX_MINOR_VERSION 6 |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 11 | #define YY_FLEX_SUBMINOR_VERSION 1 |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 12 | #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, |
| 36 | * if you want the limit (max/min) macros for int types. |
| 37 | */ |
| 38 | #ifndef __STDC_LIMIT_MACROS |
| 39 | #define __STDC_LIMIT_MACROS 1 |
| 40 | #endif |
| 41 | |
| 42 | #include <inttypes.h> |
| 43 | typedef int8_t flex_int8_t; |
| 44 | typedef uint8_t flex_uint8_t; |
| 45 | typedef int16_t flex_int16_t; |
| 46 | typedef uint16_t flex_uint16_t; |
| 47 | typedef int32_t flex_int32_t; |
| 48 | typedef uint32_t flex_uint32_t; |
| 49 | #else |
| 50 | typedef signed char flex_int8_t; |
| 51 | typedef short int flex_int16_t; |
| 52 | typedef int flex_int32_t; |
| 53 | typedef unsigned char flex_uint8_t; |
| 54 | typedef unsigned short int flex_uint16_t; |
| 55 | typedef 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 90 | /* TODO: this is always defined, so inline it */ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 91 | #define yyconst const |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 92 | |
| 93 | #if defined(__GNUC__) && __GNUC__ >= 3 |
| 94 | #define yynoreturn __attribute__((__noreturn__)) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 95 | #else |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 96 | #define yynoreturn |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 97 | #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 |
| 149 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
| 150 | #endif |
| 151 | |
| 152 | #ifndef YY_TYPEDEF_YY_SIZE_T |
| 153 | #define YY_TYPEDEF_YY_SIZE_T |
| 154 | typedef size_t yy_size_t; |
| 155 | #endif |
| 156 | |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 157 | extern int yyleng; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 158 | |
| 159 | extern 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) |
| 167 | |
| 168 | /* 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 |
| 186 | struct 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 196 | int yy_buf_size; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 197 | |
| 198 | /* Number of characters read into yy_ch_buf, not including EOB |
| 199 | * characters. |
| 200 | */ |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 201 | int yy_n_chars; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 202 | |
| 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 224 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 225 | /* 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. */ |
| 250 | static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ |
| 251 | static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 252 | static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 253 | |
| 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. */ |
| 270 | static char yy_hold_char; |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 271 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 272 | int yyleng; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 273 | |
| 274 | /* Points to current character in buffer. */ |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 275 | static char *yy_c_buf_p = NULL; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 276 | static int yy_init = 0; /* whether we need to initialize */ |
| 277 | static 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 | */ |
| 282 | static int yy_did_buffer_switch_on_eof; |
| 283 | |
| 284 | void yyrestart (FILE *input_file ); |
| 285 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); |
| 286 | YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); |
| 287 | void yy_delete_buffer (YY_BUFFER_STATE b ); |
| 288 | void yy_flush_buffer (YY_BUFFER_STATE b ); |
| 289 | void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); |
| 290 | void yypop_buffer_state (void ); |
| 291 | |
| 292 | static void yyensure_buffer_stack (void ); |
| 293 | static void yy_load_buffer_state (void ); |
| 294 | static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); |
| 295 | |
| 296 | #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) |
| 297 | |
| 298 | YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); |
| 299 | YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 300 | YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 301 | |
| 302 | void *yyalloc (yy_size_t ); |
| 303 | void *yyrealloc (void *,yy_size_t ); |
| 304 | void 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 Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 332 | #define yywrap() (/*CONSTCOND*/1) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 333 | #define YY_SKIP_YYWRAP |
| 334 | |
| 335 | typedef unsigned char YY_CHAR; |
| 336 | |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 337 | FILE *yyin = NULL, *yyout = NULL; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 338 | |
| 339 | typedef int yy_state_type; |
| 340 | |
| 341 | extern int yylineno; |
| 342 | |
| 343 | int yylineno = 1; |
| 344 | |
| 345 | extern char *yytext; |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 346 | #ifdef yytext_ptr |
| 347 | #undef yytext_ptr |
| 348 | #endif |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 349 | #define yytext_ptr yytext |
| 350 | |
| 351 | static yy_state_type yy_get_previous_state (void ); |
| 352 | static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); |
| 353 | static int yy_get_next_buffer (void ); |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 354 | static void yynoreturn yy_fatal_error (yyconst char* msg ); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 355 | |
| 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 361 | yyleng = (int) (yy_cp - yy_bp); \ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 362 | (yy_hold_char) = *yy_cp; \ |
| 363 | *yy_cp = '\0'; \ |
| 364 | (yy_c_buf_p) = yy_cp; |
| 365 | |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 366 | #define YY_NUM_RULES 13 |
| 367 | #define YY_END_OF_BUFFER 14 |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 368 | /* This struct is not used in this scanner, |
| 369 | but its presence is necessary. */ |
| 370 | struct yy_trans_info |
| 371 | { |
| 372 | flex_int32_t yy_verify; |
| 373 | flex_int32_t yy_nxt; |
| 374 | }; |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 375 | static yyconst flex_int16_t yy_accept[40] = |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 376 | { 0, |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 377 | 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 Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 381 | } ; |
| 382 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 383 | static yyconst YY_CHAR yy_ec[256] = |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 384 | { 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 389 | 6, 1, 1, 1, 1, 1, 1, 7, 8, 8, |
| 390 | 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 391 | 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 394 | 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 395 | |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 396 | 10, 10, 1, 1, 1, 1, 1, 1, 1, 1, |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 397 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 20, |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 398 | 1, 1, 9, 1, 9, 1, 1, 1, 1, 1, |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 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, 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 Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 415 | static yyconst YY_CHAR yy_meta[21] = |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 416 | { 0, |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 417 | 1, 2, 2, 2, 2, 2, 1, 1, 2, 1, |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 418 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 419 | } ; |
| 420 | |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 421 | static yyconst flex_uint16_t yy_base[43] = |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 422 | { 0, |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 423 | 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 Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 428 | } ; |
| 429 | |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 430 | static yyconst flex_int16_t yy_def[43] = |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 431 | { 0, |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 432 | 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 Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 437 | } ; |
| 438 | |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 439 | static yyconst flex_uint16_t yy_nxt[85] = |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 440 | { 0, |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 441 | 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 Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 450 | } ; |
| 451 | |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 452 | static yyconst flex_int16_t yy_chk[85] = |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 453 | { 0, |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 454 | 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 Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 463 | } ; |
| 464 | |
| 465 | static yy_state_type yy_last_accepting_state; |
| 466 | static char *yy_last_accepting_cpos; |
| 467 | |
| 468 | extern int yy_flex_debug; |
| 469 | int 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 |
| 478 | char *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 Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 493 | */ |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 494 | #line 17 "fmd_scanner.l" |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 495 | #include "fmd_parser.h" |
| 496 | |
| 497 | #include <assert.h> |
| 498 | #include <string.h> |
| 499 | |
Patrick Georgi | 1f8e4cb | 2015-05-25 22:53:19 +0200 | [diff] [blame] | 500 | int parse_integer(char *src, int base); |
| 501 | int copy_string(const char *src); |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 502 | |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 503 | #line 504 "<stdout>" |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 504 | |
| 505 | #define INITIAL 0 |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 506 | #define FLAGS 1 |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 507 | |
| 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 | |
| 520 | static int yy_init_globals (void ); |
| 521 | |
| 522 | /* Accessor methods to globals. |
| 523 | These are made visible to non-reentrant scanners for convenience. */ |
| 524 | |
| 525 | int yylex_destroy (void ); |
| 526 | |
| 527 | int yyget_debug (void ); |
| 528 | |
| 529 | void yyset_debug (int debug_flag ); |
| 530 | |
| 531 | YY_EXTRA_TYPE yyget_extra (void ); |
| 532 | |
| 533 | void yyset_extra (YY_EXTRA_TYPE user_defined ); |
| 534 | |
| 535 | FILE *yyget_in (void ); |
| 536 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 537 | void yyset_in (FILE * _in_str ); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 538 | |
| 539 | FILE *yyget_out (void ); |
| 540 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 541 | void yyset_out (FILE * _out_str ); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 542 | |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 543 | int yyget_leng (void ); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 544 | |
| 545 | char *yyget_text (void ); |
| 546 | |
| 547 | int yyget_lineno (void ); |
| 548 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 549 | void yyset_lineno (int _line_number ); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 550 | |
| 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 |
| 557 | extern "C" int yywrap (void ); |
| 558 | #else |
| 559 | extern int yywrap (void ); |
| 560 | #endif |
| 561 | #endif |
| 562 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 563 | #ifndef YY_NO_UNPUT |
| 564 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 565 | static void yyunput (int c,char *buf_ptr ); |
| 566 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 567 | #endif |
| 568 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 569 | #ifndef yytext_ptr |
| 570 | static void yy_flex_strncpy (char *,yyconst char *,int ); |
| 571 | #endif |
| 572 | |
| 573 | #ifdef YY_NEED_STRLEN |
| 574 | static int yy_flex_strlen (yyconst char * ); |
| 575 | #endif |
| 576 | |
| 577 | #ifndef YY_NO_INPUT |
| 578 | |
| 579 | #ifdef __cplusplus |
| 580 | static int yyinput (void ); |
| 581 | #else |
| 582 | static 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 602 | #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 603 | #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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 626 | while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 627 | { \ |
| 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 | |
| 667 | extern 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 Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 681 | #define YY_BREAK /*LINTED*/break; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 682 | #endif |
| 683 | |
| 684 | #define YY_RULE_SETUP \ |
| 685 | YY_USER_ACTION |
| 686 | |
| 687 | /** The main scanner function which does all the work. |
| 688 | */ |
| 689 | YY_DECL |
| 690 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 691 | yy_state_type yy_current_state; |
| 692 | char *yy_cp, *yy_bp; |
| 693 | int yy_act; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 694 | |
| 695 | 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 722 | #line 31 "fmd_scanner.l" |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 723 | |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 724 | #line 725 "<stdout>" |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 725 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 726 | while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 727 | { |
| 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); |
| 739 | yy_match: |
| 740 | do |
| 741 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 742 | YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 743 | 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 Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 751 | if ( yy_current_state >= 40 ) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 752 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 753 | } |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 754 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 755 | ++yy_cp; |
| 756 | } |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 757 | while ( yy_base[yy_current_state] != 64 ); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 758 | |
| 759 | yy_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 | |
| 770 | do_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 | |
| 781 | case 1: |
| 782 | /* rule 1 can match eol */ |
| 783 | YY_RULE_SETUP |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 784 | #line 32 "fmd_scanner.l" |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 785 | /* Eat whitespace. */ |
| 786 | YY_BREAK |
| 787 | case 2: |
| 788 | *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ |
| 789 | (yy_c_buf_p) = yy_cp -= 1; |
| 790 | YY_DO_BEFORE_ACTION; /* set up yytext again */ |
| 791 | YY_RULE_SETUP |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 792 | #line 33 "fmd_scanner.l" |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 793 | /* Eat comments. */ |
| 794 | YY_BREAK |
| 795 | case 3: |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 796 | YY_RULE_SETUP |
| 797 | #line 34 "fmd_scanner.l" |
| 798 | BEGIN(FLAGS); return *yytext; |
| 799 | YY_BREAK |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 800 | case 4: |
| 801 | YY_RULE_SETUP |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 802 | #line 35 "fmd_scanner.l" |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 803 | BEGIN(INITIAL); return *yytext; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 804 | YY_BREAK |
| 805 | case 5: |
| 806 | YY_RULE_SETUP |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 807 | #line 36 "fmd_scanner.l" |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 808 | return FLAG_CBFS; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 809 | YY_BREAK |
| 810 | case 6: |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 811 | YY_RULE_SETUP |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 812 | #line 37 "fmd_scanner.l" |
| 813 | return FLAG_PRESERVE; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 814 | YY_BREAK |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 815 | case 7: |
| 816 | #line 39 "fmd_scanner.l" |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 817 | case 8: |
| 818 | YY_RULE_SETUP |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 819 | #line 39 "fmd_scanner.l" |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 820 | return parse_integer(yytext, 10); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 821 | YY_BREAK |
| 822 | case 9: |
| 823 | YY_RULE_SETUP |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 824 | #line 40 "fmd_scanner.l" |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 825 | return OCTAL; |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 826 | YY_BREAK |
| 827 | case 10: |
| 828 | YY_RULE_SETUP |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 829 | #line 41 "fmd_scanner.l" |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 830 | return parse_integer(yytext + 2, 16); |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 831 | YY_BREAK |
| 832 | case 11: |
| 833 | YY_RULE_SETUP |
| 834 | #line 42 "fmd_scanner.l" |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 835 | return copy_string(yytext); |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 836 | YY_BREAK |
| 837 | case 12: |
| 838 | YY_RULE_SETUP |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 839 | #line 43 "fmd_scanner.l" |
| 840 | return *yytext; |
| 841 | YY_BREAK |
| 842 | case 13: |
| 843 | YY_RULE_SETUP |
| 844 | #line 45 "fmd_scanner.l" |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 845 | ECHO; |
| 846 | YY_BREAK |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 847 | #line 848 "<stdout>" |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 848 | case YY_STATE_EOF(INITIAL): |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 849 | case YY_STATE_EOF(FLAGS): |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 850 | 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 | */ |
| 989 | static int yy_get_next_buffer (void) |
| 990 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 991 | char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; |
| 992 | char *source = (yytext_ptr); |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 993 | int number_to_move, i; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 994 | 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1022 | number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1023 | |
| 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1035 | int num_to_read = |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1036 | 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1049 | int new_size = b->yy_buf_size * 2; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1050 | |
| 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1062 | b->yy_ch_buf = NULL; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1063 | |
| 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1104 | if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1105 | /* Extend the array by 50%, plus the number we really need. */ |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1106 | int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1107 | 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 Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1125 | yy_state_type yy_current_state; |
| 1126 | char *yy_cp; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1127 | |
| 1128 | 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 Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1132 | YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1133 | 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 Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 1141 | if ( yy_current_state >= 40 ) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1142 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 1143 | } |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1144 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1145 | } |
| 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 Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1157 | int yy_is_jam; |
| 1158 | char *yy_cp = (yy_c_buf_p); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1159 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1160 | YY_CHAR yy_c = 1; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1161 | 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 Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 1169 | if ( yy_current_state >= 40 ) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1170 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 1171 | } |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1172 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 1173 | yy_is_jam = (yy_current_state == 39); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1174 | |
| 1175 | return yy_is_jam ? 0 : yy_current_state; |
| 1176 | } |
| 1177 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1178 | #ifndef YY_NO_UNPUT |
| 1179 | |
| 1180 | static void yyunput (int c, char * yy_bp ) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1181 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1182 | char *yy_cp; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1183 | |
| 1184 | 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1192 | int number_to_move = (yy_n_chars) + 2; |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1193 | char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1194 | YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1195 | char *source = |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1196 | &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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1204 | (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1205 | |
| 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 Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1217 | #endif |
| 1218 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1219 | #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; |
| 1228 | |
| 1229 | *(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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1243 | int offset = (yy_c_buf_p) - (yytext_ptr); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1244 | ++(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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1267 | return 0; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1268 | |
| 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. |
| 1295 | * |
| 1296 | * @note This function does not reset the start condition to @c INITIAL . |
| 1297 | */ |
| 1298 | void yyrestart (FILE * input_file ) |
| 1299 | { |
| 1300 | |
| 1301 | 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. |
| 1313 | * |
| 1314 | */ |
| 1315 | void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) |
| 1316 | { |
| 1317 | |
| 1318 | /* 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 | |
| 1346 | static 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. |
| 1357 | * |
| 1358 | * @return the allocated buffer state. |
| 1359 | */ |
| 1360 | YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) |
| 1361 | { |
| 1362 | YY_BUFFER_STATE b; |
| 1363 | |
| 1364 | 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 Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1368 | b->yy_buf_size = (yy_size_t)size; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1369 | |
| 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() |
| 1386 | * |
| 1387 | */ |
| 1388 | void yy_delete_buffer (YY_BUFFER_STATE b ) |
| 1389 | { |
| 1390 | |
| 1391 | 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; |
| 1411 | |
| 1412 | 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; |
| 1427 | |
| 1428 | 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. |
| 1433 | * |
| 1434 | */ |
| 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. |
| 1462 | * |
| 1463 | */ |
| 1464 | void 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. |
| 1492 | * |
| 1493 | */ |
| 1494 | void 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 | */ |
| 1513 | static void yyensure_buffer_stack (void) |
| 1514 | { |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1515 | int num_to_alloc; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1516 | |
| 1517 | 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1523 | num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1524 | (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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1529 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1530 | memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1531 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1532 | (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 Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1540 | yy_size_t grow_size = 8 /* arbitrary grow size */; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1541 | |
| 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 |
| 1559 | * |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1560 | * @return the newly allocated buffer state object. |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1561 | */ |
| 1562 | YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) |
| 1563 | { |
| 1564 | YY_BUFFER_STATE b; |
| 1565 | |
| 1566 | 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1570 | return NULL; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1571 | |
| 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1579 | b->yy_input_file = NULL; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1580 | 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 |
| 1594 | * |
| 1595 | * @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 | */ |
| 1599 | YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) |
| 1600 | { |
| 1601 | |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1602 | return yy_scan_bytes(yystr,(int) strlen(yystr) ); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1603 | } |
| 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. |
| 1609 | * |
| 1610 | * @return the newly allocated buffer state object. |
| 1611 | */ |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1612 | YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1613 | { |
| 1614 | YY_BUFFER_STATE b; |
| 1615 | char *buf; |
| 1616 | yy_size_t n; |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1617 | int i; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1618 | |
| 1619 | /* Get memory for full buffer, including space for trailing EOB's. */ |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1620 | n = (yy_size_t) (_yybytes_len + 2); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1621 | 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1646 | static void yynoreturn yy_fatal_error (yyconst char* msg ) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1647 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1648 | (void) fprintf( stderr, "%s\n", msg ); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1649 | 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. |
| 1672 | * |
| 1673 | */ |
| 1674 | int yyget_lineno (void) |
| 1675 | { |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1676 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1677 | return yylineno; |
| 1678 | } |
| 1679 | |
| 1680 | /** Get the input stream. |
| 1681 | * |
| 1682 | */ |
| 1683 | FILE *yyget_in (void) |
| 1684 | { |
| 1685 | return yyin; |
| 1686 | } |
| 1687 | |
| 1688 | /** Get the output stream. |
| 1689 | * |
| 1690 | */ |
| 1691 | FILE *yyget_out (void) |
| 1692 | { |
| 1693 | return yyout; |
| 1694 | } |
| 1695 | |
| 1696 | /** Get the length of the current token. |
| 1697 | * |
| 1698 | */ |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1699 | int yyget_leng (void) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1700 | { |
| 1701 | return yyleng; |
| 1702 | } |
| 1703 | |
| 1704 | /** Get the current token. |
| 1705 | * |
| 1706 | */ |
| 1707 | |
| 1708 | char *yyget_text (void) |
| 1709 | { |
| 1710 | return yytext; |
| 1711 | } |
| 1712 | |
| 1713 | /** Set the current line number. |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1714 | * @param _line_number line number |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1715 | * |
| 1716 | */ |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1717 | void yyset_lineno (int _line_number ) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1718 | { |
| 1719 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1720 | yylineno = _line_number; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1721 | } |
| 1722 | |
| 1723 | /** Set the input stream. This does not discard the current |
| 1724 | * input buffer. |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1725 | * @param _in_str A readable stream. |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1726 | * |
| 1727 | * @see yy_switch_to_buffer |
| 1728 | */ |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1729 | void yyset_in (FILE * _in_str ) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1730 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1731 | yyin = _in_str ; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1732 | } |
| 1733 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1734 | void yyset_out (FILE * _out_str ) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1735 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1736 | yyout = _out_str ; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1737 | } |
| 1738 | |
| 1739 | int yyget_debug (void) |
| 1740 | { |
| 1741 | return yy_flex_debug; |
| 1742 | } |
| 1743 | |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1744 | void yyset_debug (int _bdebug ) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1745 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1746 | yy_flex_debug = _bdebug ; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1747 | } |
| 1748 | |
| 1749 | static 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1755 | (yy_buffer_stack) = NULL; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1756 | (yy_buffer_stack_top) = 0; |
| 1757 | (yy_buffer_stack_max) = 0; |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1758 | (yy_c_buf_p) = NULL; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1759 | (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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1767 | yyin = NULL; |
| 1768 | yyout = NULL; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1769 | #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. */ |
| 1778 | int yylex_destroy (void) |
| 1779 | { |
| 1780 | |
| 1781 | /* 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 |
| 1804 | static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) |
| 1805 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1806 | |
| 1807 | int i; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1808 | for ( i = 0; i < n; ++i ) |
| 1809 | s1[i] = s2[i]; |
| 1810 | } |
| 1811 | #endif |
| 1812 | |
| 1813 | #ifdef YY_NEED_STRLEN |
| 1814 | static int yy_flex_strlen (yyconst char * s ) |
| 1815 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1816 | int n; |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1817 | for ( n = 0; s[n]; ++n ) |
| 1818 | ; |
| 1819 | |
| 1820 | return n; |
| 1821 | } |
| 1822 | #endif |
| 1823 | |
| 1824 | void *yyalloc (yy_size_t size ) |
| 1825 | { |
Hung-Te Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1826 | return malloc(size); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1827 | } |
| 1828 | |
| 1829 | void *yyrealloc (void * ptr, yy_size_t size ) |
| 1830 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1831 | |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1832 | /* 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 Lin | 9497fcb | 2019-03-04 14:28:37 +0800 | [diff] [blame] | 1839 | return realloc(ptr, size); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1840 | } |
| 1841 | |
| 1842 | void yyfree (void * ptr ) |
| 1843 | { |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1844 | free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1845 | } |
| 1846 | |
| 1847 | #define YYTABLES_NAME "yytables" |
| 1848 | |
Hung-Te Lin | 49a4450 | 2019-03-04 15:41:09 +0800 | [diff] [blame] | 1849 | #line 45 "fmd_scanner.l" |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1850 | |
| 1851 | |
| 1852 | |
Patrick Georgi | 1f8e4cb | 2015-05-25 22:53:19 +0200 | [diff] [blame] | 1853 | int parse_integer(char *src, int base) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1854 | { |
| 1855 | char *multiplier = NULL; |
Patrick Georgi | 1f8e4cb | 2015-05-25 22:53:19 +0200 | [diff] [blame] | 1856 | unsigned val = strtoul(src, &multiplier, base); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1857 | |
| 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 Georgi | 1f8e4cb | 2015-05-25 22:53:19 +0200 | [diff] [blame] | 1880 | int copy_string(const char *src) |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1881 | { |
Patrick Georgi | 1f8e4cb | 2015-05-25 22:53:19 +0200 | [diff] [blame] | 1882 | yylval.strval = strdup(src); |
Sol Boucher | 69b88bf | 2015-02-26 11:47:19 -0800 | [diff] [blame] | 1883 | return STRING; |
| 1884 | } |
Patrick Georgi | 2b80734 | 2016-06-28 20:45:34 +0200 | [diff] [blame] | 1885 | |