blob: 61215cf17c3ed4bd53907060ee783336ff3fad6c [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
11#define YY_FLEX_SUBMINOR_VERSION 0
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,
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>
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;
53typedef unsigned char flex_uint8_t;
54typedef 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
90#ifdef __cplusplus
91
92/* The "const" storage-class-modifier is valid. */
93#define YY_USE_CONST
94
95#else /* ! __cplusplus */
96
97/* C99 requires __STDC__ to be defined as 1. */
98#if defined (__STDC__)
99
100#define YY_USE_CONST
101
102#endif /* defined (__STDC__) */
103#endif /* ! __cplusplus */
104
105#ifdef YY_USE_CONST
106#define yyconst const
107#else
108#define yyconst
109#endif
110
111/* Returned upon end-of-file. */
112#define YY_NULL 0
113
114/* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
117 * double cast.
118 */
119#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
121/* Enter a start condition. This macro really ought to take a parameter,
122 * but we do it the disgusting crufty way forced on us by the ()-less
123 * definition of BEGIN.
124 */
125#define BEGIN (yy_start) = 1 + 2 *
126
127/* Translate the current start state into a value that can be later handed
128 * to BEGIN to return to the state. The YYSTATE alias is for lex
129 * compatibility.
130 */
131#define YY_START (((yy_start) - 1) / 2)
132#define YYSTATE YY_START
133
134/* Action number for EOF rule of a given start state. */
135#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136
137/* Special action meaning "start processing a new file". */
138#define YY_NEW_FILE yyrestart(yyin )
139
140#define YY_END_OF_BUFFER_CHAR 0
141
142/* Size of default input buffer. */
143#ifndef YY_BUF_SIZE
144#ifdef __ia64__
145/* On IA-64, the buffer size is 16k, not 8k.
146 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
147 * Ditto for the __ia64__ case accordingly.
148 */
149#define YY_BUF_SIZE 32768
150#else
151#define YY_BUF_SIZE 16384
152#endif /* __ia64__ */
153#endif
154
155/* The state buf must be large enough to hold one state per character in the main buffer.
156 */
157#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
158
159#ifndef YY_TYPEDEF_YY_BUFFER_STATE
160#define YY_TYPEDEF_YY_BUFFER_STATE
161typedef struct yy_buffer_state *YY_BUFFER_STATE;
162#endif
163
164#ifndef YY_TYPEDEF_YY_SIZE_T
165#define YY_TYPEDEF_YY_SIZE_T
166typedef size_t yy_size_t;
167#endif
168
169extern yy_size_t yyleng;
170
171extern FILE *yyin, *yyout;
172
173#define EOB_ACT_CONTINUE_SCAN 0
174#define EOB_ACT_END_OF_FILE 1
175#define EOB_ACT_LAST_MATCH 2
176
177 #define YY_LESS_LINENO(n)
178 #define YY_LINENO_REWIND_TO(ptr)
179
180/* Return all but the first "n" matched characters back to the input stream. */
181#define yyless(n) \
182 do \
183 { \
184 /* Undo effects of setting up yytext. */ \
185 int yyless_macro_arg = (n); \
186 YY_LESS_LINENO(yyless_macro_arg);\
187 *yy_cp = (yy_hold_char); \
188 YY_RESTORE_YY_MORE_OFFSET \
189 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
190 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
191 } \
192 while ( 0 )
193
194#define unput(c) yyunput( c, (yytext_ptr) )
195
196#ifndef YY_STRUCT_YY_BUFFER_STATE
197#define YY_STRUCT_YY_BUFFER_STATE
198struct yy_buffer_state
199 {
200 FILE *yy_input_file;
201
202 char *yy_ch_buf; /* input buffer */
203 char *yy_buf_pos; /* current position in input buffer */
204
205 /* Size of input buffer in bytes, not including room for EOB
206 * characters.
207 */
208 yy_size_t yy_buf_size;
209
210 /* Number of characters read into yy_ch_buf, not including EOB
211 * characters.
212 */
Patrick Georgi2b807342016-06-28 20:45:34 +0200213 int yy_n_chars;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800214
215 /* Whether we "own" the buffer - i.e., we know we created it,
216 * and can realloc() it to grow it, and should free() it to
217 * delete it.
218 */
219 int yy_is_our_buffer;
220
221 /* Whether this is an "interactive" input source; if so, and
222 * if we're using stdio for input, then we want to use getc()
223 * instead of fread(), to make sure we stop fetching input after
224 * each newline.
225 */
226 int yy_is_interactive;
227
228 /* Whether we're considered to be at the beginning of a line.
229 * If so, '^' rules will be active on the next match, otherwise
230 * not.
231 */
232 int yy_at_bol;
233
234 int yy_bs_lineno; /**< The line count. */
235 int yy_bs_column; /**< The column count. */
236
237 /* Whether to try to fill the input buffer when we reach the
238 * end of it.
239 */
240 int yy_fill_buffer;
241
242 int yy_buffer_status;
243
244#define YY_BUFFER_NEW 0
245#define YY_BUFFER_NORMAL 1
246 /* When an EOF's been seen but there's still some text to process
247 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
248 * shouldn't try reading from the input source any more. We might
249 * still have a bunch of tokens to match, though, because of
250 * possible backing-up.
251 *
252 * When we actually see the EOF, we change the status to "new"
253 * (via yyrestart()), so that the user can continue scanning by
254 * just pointing yyin at a new input file.
255 */
256#define YY_BUFFER_EOF_PENDING 2
257
258 };
259#endif /* !YY_STRUCT_YY_BUFFER_STATE */
260
261/* Stack of input buffers. */
262static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
263static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
264static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
265
266/* We provide macros for accessing buffer states in case in the
267 * future we want to put the buffer states in a more general
268 * "scanner state".
269 *
270 * Returns the top of the stack, or NULL.
271 */
272#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
273 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
274 : NULL)
275
276/* Same as previous macro, but useful when we know that the buffer stack is not
277 * NULL or when we need an lvalue. For internal use only.
278 */
279#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
280
281/* yy_hold_char holds the character lost when yytext is formed. */
282static char yy_hold_char;
Patrick Georgi2b807342016-06-28 20:45:34 +0200283static int yy_n_chars; /* number of characters read into yy_ch_buf */
Sol Boucher69b88bf2015-02-26 11:47:19 -0800284yy_size_t yyleng;
285
286/* Points to current character in buffer. */
287static char *yy_c_buf_p = (char *) 0;
288static int yy_init = 0; /* whether we need to initialize */
289static int yy_start = 0; /* start state number */
290
291/* Flag which is used to allow yywrap()'s to do buffer switches
292 * instead of setting up a fresh yyin. A bit of a hack ...
293 */
294static int yy_did_buffer_switch_on_eof;
295
296void yyrestart (FILE *input_file );
297void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
298YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
299void yy_delete_buffer (YY_BUFFER_STATE b );
300void yy_flush_buffer (YY_BUFFER_STATE b );
301void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
302void yypop_buffer_state (void );
303
304static void yyensure_buffer_stack (void );
305static void yy_load_buffer_state (void );
306static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
307
308#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
309
310YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
311YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
312YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
313
314void *yyalloc (yy_size_t );
315void *yyrealloc (void *,yy_size_t );
316void yyfree (void * );
317
318#define yy_new_buffer yy_create_buffer
319
320#define yy_set_interactive(is_interactive) \
321 { \
322 if ( ! YY_CURRENT_BUFFER ){ \
323 yyensure_buffer_stack (); \
324 YY_CURRENT_BUFFER_LVALUE = \
325 yy_create_buffer(yyin,YY_BUF_SIZE ); \
326 } \
327 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
328 }
329
330#define yy_set_bol(at_bol) \
331 { \
332 if ( ! YY_CURRENT_BUFFER ){\
333 yyensure_buffer_stack (); \
334 YY_CURRENT_BUFFER_LVALUE = \
335 yy_create_buffer(yyin,YY_BUF_SIZE ); \
336 } \
337 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
338 }
339
340#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
341
342/* Begin user sect3 */
343
Patrick Georgi2b807342016-06-28 20:45:34 +0200344#define yywrap() (/*CONSTCOND*/1)
Sol Boucher69b88bf2015-02-26 11:47:19 -0800345#define YY_SKIP_YYWRAP
346
347typedef unsigned char YY_CHAR;
348
349FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
350
351typedef int yy_state_type;
352
353extern int yylineno;
354
355int yylineno = 1;
356
357extern char *yytext;
Patrick Georgi2b807342016-06-28 20:45:34 +0200358#ifdef yytext_ptr
359#undef yytext_ptr
360#endif
Sol Boucher69b88bf2015-02-26 11:47:19 -0800361#define yytext_ptr yytext
362
363static yy_state_type yy_get_previous_state (void );
364static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
365static int yy_get_next_buffer (void );
Patrick Georgi2b807342016-06-28 20:45:34 +0200366#if defined(__GNUC__) && __GNUC__ >= 3
367__attribute__((__noreturn__))
368#endif
Sol Boucher69b88bf2015-02-26 11:47:19 -0800369static void yy_fatal_error (yyconst char msg[] );
370
371/* Done after the current pattern has been matched and before the
372 * corresponding action - sets up yytext.
373 */
374#define YY_DO_BEFORE_ACTION \
375 (yytext_ptr) = yy_bp; \
376 yyleng = (size_t) (yy_cp - yy_bp); \
377 (yy_hold_char) = *yy_cp; \
378 *yy_cp = '\0'; \
379 (yy_c_buf_p) = yy_cp;
380
381#define YY_NUM_RULES 9
382#define YY_END_OF_BUFFER 10
383/* This struct is not used in this scanner,
384 but its presence is necessary. */
385struct yy_trans_info
386 {
387 flex_int32_t yy_verify;
388 flex_int32_t yy_nxt;
389 };
390static yyconst flex_int16_t yy_accept[24] =
391 { 0,
392 7, 7, 10, 7, 1, 1, 8, 8, 3, 4,
393 7, 1, 0, 2, 5, 3, 7, 4, 4, 5,
394 6, 6, 0
395 } ;
396
Patrick Georgi2b807342016-06-28 20:45:34 +0200397static yyconst YY_CHAR yy_ec[256] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800398 { 0,
399 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
400 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 2, 1, 1, 4, 1, 1, 1, 1, 5,
403 5, 1, 1, 1, 1, 1, 1, 6, 7, 7,
404 7, 7, 7, 7, 7, 7, 7, 1, 1, 1,
Patrick Georgi2b807342016-06-28 20:45:34 +0200405 1, 1, 1, 5, 8, 8, 8, 8, 8, 8,
406 9, 1, 1, 1, 9, 1, 9, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 10, 1, 1,
408 1, 1, 1, 1, 1, 1, 8, 8, 8, 8,
Sol Boucher69b88bf2015-02-26 11:47:19 -0800409
Patrick Georgi2b807342016-06-28 20:45:34 +0200410 8, 8, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 10,
Sol Boucher69b88bf2015-02-26 11:47:19 -0800412 1, 1, 5, 1, 5, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1
427 } ;
428
Patrick Georgi2b807342016-06-28 20:45:34 +0200429static yyconst YY_CHAR yy_meta[11] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800430 { 0,
431 1, 2, 2, 3, 3, 1, 1, 1, 1, 1
432 } ;
433
Patrick Georgi2b807342016-06-28 20:45:34 +0200434static yyconst flex_uint16_t yy_base[27] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800435 { 0,
Patrick Georgi2b807342016-06-28 20:45:34 +0200436 0, 0, 33, 0, 0, 0, 20, 34, 10, 15,
437 0, 0, 12, 34, 16, 0, 21, 0, 0, 0,
438 5, 0, 34, 12, 10, 29
Sol Boucher69b88bf2015-02-26 11:47:19 -0800439 } ;
440
441static yyconst flex_int16_t yy_def[27] =
442 { 0,
443 23, 1, 23, 24, 25, 25, 26, 23, 23, 24,
444 24, 25, 26, 23, 9, 24, 24, 10, 24, 24,
445 17, 24, 0, 23, 23, 23
446 } ;
447
Patrick Georgi2b807342016-06-28 20:45:34 +0200448static yyconst flex_uint16_t yy_nxt[45] =
Sol Boucher69b88bf2015-02-26 11:47:19 -0800449 { 0,
450 4, 5, 6, 7, 8, 9, 10, 4, 4, 4,
Patrick Georgi2b807342016-06-28 20:45:34 +0200451 11, 12, 11, 22, 14, 15, 15, 11, 16, 17,
452 18, 18, 14, 19, 20, 11, 21, 21, 21, 13,
453 13, 13, 23, 3, 23, 23, 23, 23, 23, 23,
Sol Boucher69b88bf2015-02-26 11:47:19 -0800454 23, 23, 23, 23
455 } ;
456
457static yyconst flex_int16_t yy_chk[45] =
458 { 0,
459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460 9, 25, 24, 21, 13, 9, 9, 9, 9, 9,
Patrick Georgi2b807342016-06-28 20:45:34 +0200461 10, 10, 7, 10, 15, 15, 17, 17, 17, 26,
462 26, 26, 3, 23, 23, 23, 23, 23, 23, 23,
Sol Boucher69b88bf2015-02-26 11:47:19 -0800463 23, 23, 23, 23
464 } ;
465
466static yy_state_type yy_last_accepting_state;
467static char *yy_last_accepting_cpos;
468
469extern int yy_flex_debug;
470int yy_flex_debug = 0;
471
472/* The intent behind this definition is that it'll catch
473 * any uses of REJECT which flex missed.
474 */
475#define REJECT reject_used_but_not_detected
476#define yymore() yymore_used_but_not_detected
477#define YY_MORE_ADJ 0
478#define YY_RESTORE_YY_MORE_OFFSET
479char *yytext;
480#line 1 "fmd_scanner.l"
481/*
482 * fmd_scanner.l, scanner generator for flashmap descriptor language
483 *
484 * Copyright (C) 2015 Google, Inc.
485 *
486 * This program is free software; you can redistribute it and/or modify
487 * it under the terms of the GNU General Public License as published by
488 * the Free Software Foundation; version 2 of the License.
489 *
490 * This program is distributed in the hope that it will be useful,
491 * but WITHOUT ANY WARRANTY; without even the implied warranty of
492 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
493 * GNU General Public License for more details.
Sol Boucher69b88bf2015-02-26 11:47:19 -0800494 */
Patrick Georgi2b807342016-06-28 20:45:34 +0200495#line 17 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800496#include "fmd_parser.h"
497
498#include <assert.h>
499#include <string.h>
500
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +0200501int parse_integer(char *src, int base);
502int copy_string(const char *src);
Patrick Georgi2b807342016-06-28 20:45:34 +0200503#line 504 "<stdout>"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800504
505#define INITIAL 0
506
507#ifndef YY_NO_UNISTD_H
508/* Special case for "unistd.h", since it is non-ANSI. We include it way
509 * down here because we want the user's section 1 to have been scanned first.
510 * The user has a chance to override it with an option.
511 */
512#include <unistd.h>
513#endif
514
515#ifndef YY_EXTRA_TYPE
516#define YY_EXTRA_TYPE void *
517#endif
518
519static int yy_init_globals (void );
520
521/* Accessor methods to globals.
522 These are made visible to non-reentrant scanners for convenience. */
523
524int yylex_destroy (void );
525
526int yyget_debug (void );
527
528void yyset_debug (int debug_flag );
529
530YY_EXTRA_TYPE yyget_extra (void );
531
532void yyset_extra (YY_EXTRA_TYPE user_defined );
533
534FILE *yyget_in (void );
535
Patrick Georgi2b807342016-06-28 20:45:34 +0200536void yyset_in (FILE * _in_str );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800537
538FILE *yyget_out (void );
539
Patrick Georgi2b807342016-06-28 20:45:34 +0200540void yyset_out (FILE * _out_str );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800541
542yy_size_t yyget_leng (void );
543
544char *yyget_text (void );
545
546int yyget_lineno (void );
547
Patrick Georgi2b807342016-06-28 20:45:34 +0200548void yyset_lineno (int _line_number );
Sol Boucher69b88bf2015-02-26 11:47:19 -0800549
550/* Macros after this point can all be overridden by user definitions in
551 * section 1.
552 */
553
554#ifndef YY_SKIP_YYWRAP
555#ifdef __cplusplus
556extern "C" int yywrap (void );
557#else
558extern int yywrap (void );
559#endif
560#endif
561
Patrick Georgi2b807342016-06-28 20:45:34 +0200562#ifndef YY_NO_UNPUT
563
Sol Boucher69b88bf2015-02-26 11:47:19 -0800564 static void yyunput (int c,char *buf_ptr );
565
Patrick Georgi2b807342016-06-28 20:45:34 +0200566#endif
567
Sol Boucher69b88bf2015-02-26 11:47:19 -0800568#ifndef yytext_ptr
569static void yy_flex_strncpy (char *,yyconst char *,int );
570#endif
571
572#ifdef YY_NEED_STRLEN
573static int yy_flex_strlen (yyconst char * );
574#endif
575
576#ifndef YY_NO_INPUT
577
578#ifdef __cplusplus
579static int yyinput (void );
580#else
581static int input (void );
582#endif
583
584#endif
585
586/* Amount of stuff to slurp up with each read. */
587#ifndef YY_READ_BUF_SIZE
588#ifdef __ia64__
589/* On IA-64, the buffer size is 16k, not 8k */
590#define YY_READ_BUF_SIZE 16384
591#else
592#define YY_READ_BUF_SIZE 8192
593#endif /* __ia64__ */
594#endif
595
596/* Copy whatever the last rule matched to the standard output. */
597#ifndef ECHO
598/* This used to be an fputs(), but since the string might contain NUL's,
599 * we now use fwrite().
600 */
601#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
602#endif
603
604/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
605 * is returned in "result".
606 */
607#ifndef YY_INPUT
608#define YY_INPUT(buf,result,max_size) \
609 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
610 { \
611 int c = '*'; \
612 size_t n; \
613 for ( n = 0; n < max_size && \
614 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
615 buf[n] = (char) c; \
616 if ( c == '\n' ) \
617 buf[n++] = (char) c; \
618 if ( c == EOF && ferror( yyin ) ) \
619 YY_FATAL_ERROR( "input in flex scanner failed" ); \
620 result = n; \
621 } \
622 else \
623 { \
624 errno=0; \
625 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
626 { \
627 if( errno != EINTR) \
628 { \
629 YY_FATAL_ERROR( "input in flex scanner failed" ); \
630 break; \
631 } \
632 errno=0; \
633 clearerr(yyin); \
634 } \
635 }\
636\
637
638#endif
639
640/* No semi-colon after return; correct usage is to write "yyterminate();" -
641 * we don't want an extra ';' after the "return" because that will cause
642 * some compilers to complain about unreachable statements.
643 */
644#ifndef yyterminate
645#define yyterminate() return YY_NULL
646#endif
647
648/* Number of entries by which start-condition stack grows. */
649#ifndef YY_START_STACK_INCR
650#define YY_START_STACK_INCR 25
651#endif
652
653/* Report a fatal error. */
654#ifndef YY_FATAL_ERROR
655#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
656#endif
657
658/* end tables serialization structures and prototypes */
659
660/* Default declaration of generated scanner - a define so the user can
661 * easily add parameters.
662 */
663#ifndef YY_DECL
664#define YY_DECL_IS_OURS 1
665
666extern int yylex (void);
667
668#define YY_DECL int yylex (void)
669#endif /* !YY_DECL */
670
671/* Code executed at the beginning of each rule, after yytext and yyleng
672 * have been set up.
673 */
674#ifndef YY_USER_ACTION
675#define YY_USER_ACTION
676#endif
677
678/* Code executed at the end of each rule. */
679#ifndef YY_BREAK
Patrick Georgi2b807342016-06-28 20:45:34 +0200680#define YY_BREAK /*LINTED*/break;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800681#endif
682
683#define YY_RULE_SETUP \
684 YY_USER_ACTION
685
686/** The main scanner function which does all the work.
687 */
688YY_DECL
689{
Patrick Georgi2b807342016-06-28 20:45:34 +0200690 yy_state_type yy_current_state;
691 char *yy_cp, *yy_bp;
692 int yy_act;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800693
694 if ( !(yy_init) )
695 {
696 (yy_init) = 1;
697
698#ifdef YY_USER_INIT
699 YY_USER_INIT;
700#endif
701
702 if ( ! (yy_start) )
703 (yy_start) = 1; /* first start state */
704
705 if ( ! yyin )
706 yyin = stdin;
707
708 if ( ! yyout )
709 yyout = stdout;
710
711 if ( ! YY_CURRENT_BUFFER ) {
712 yyensure_buffer_stack ();
713 YY_CURRENT_BUFFER_LVALUE =
714 yy_create_buffer(yyin,YY_BUF_SIZE );
715 }
716
717 yy_load_buffer_state( );
718 }
719
720 {
Patrick Georgi2b807342016-06-28 20:45:34 +0200721#line 30 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800722
723
Patrick Georgi2b807342016-06-28 20:45:34 +0200724#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];
751 if ( yy_current_state >= 24 )
752 yy_c = yy_meta[(unsigned int) yy_c];
753 }
754 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
755 ++yy_cp;
756 }
757 while ( yy_base[yy_current_state] != 34 );
758
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:
Patrick Georgi2b807342016-06-28 20:45:34 +0200796#line 35 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800797case 4:
798YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200799#line 35 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800800return parse_integer(yytext, 10);
801 YY_BREAK
802case 5:
803YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200804#line 36 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800805return OCTAL;
806 YY_BREAK
807case 6:
808YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200809#line 37 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800810return parse_integer(yytext + 2, 16);
811 YY_BREAK
812case 7:
813YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200814#line 38 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800815return copy_string(yytext);
816 YY_BREAK
817case 8:
818YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200819#line 39 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800820return *yytext;
821 YY_BREAK
822case 9:
823YY_RULE_SETUP
Patrick Georgi2b807342016-06-28 20:45:34 +0200824#line 41 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800825ECHO;
826 YY_BREAK
Patrick Georgi2b807342016-06-28 20:45:34 +0200827#line 828 "<stdout>"
Sol Boucher69b88bf2015-02-26 11:47:19 -0800828case YY_STATE_EOF(INITIAL):
829 yyterminate();
830
831 case YY_END_OF_BUFFER:
832 {
833 /* Amount of text matched not including the EOB char. */
834 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
835
836 /* Undo the effects of YY_DO_BEFORE_ACTION. */
837 *yy_cp = (yy_hold_char);
838 YY_RESTORE_YY_MORE_OFFSET
839
840 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
841 {
842 /* We're scanning a new file or input source. It's
843 * possible that this happened because the user
844 * just pointed yyin at a new source and called
845 * yylex(). If so, then we have to assure
846 * consistency between YY_CURRENT_BUFFER and our
847 * globals. Here is the right place to do so, because
848 * this is the first action (other than possibly a
849 * back-up) that will match for the new input source.
850 */
851 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
852 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
853 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
854 }
855
856 /* Note that here we test for yy_c_buf_p "<=" to the position
857 * of the first EOB in the buffer, since yy_c_buf_p will
858 * already have been incremented past the NUL character
859 * (since all states make transitions on EOB to the
860 * end-of-buffer state). Contrast this with the test
861 * in input().
862 */
863 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
864 { /* This was really a NUL. */
865 yy_state_type yy_next_state;
866
867 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
868
869 yy_current_state = yy_get_previous_state( );
870
871 /* Okay, we're now positioned to make the NUL
872 * transition. We couldn't have
873 * yy_get_previous_state() go ahead and do it
874 * for us because it doesn't know how to deal
875 * with the possibility of jamming (and we don't
876 * want to build jamming into it because then it
877 * will run more slowly).
878 */
879
880 yy_next_state = yy_try_NUL_trans( yy_current_state );
881
882 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
883
884 if ( yy_next_state )
885 {
886 /* Consume the NUL. */
887 yy_cp = ++(yy_c_buf_p);
888 yy_current_state = yy_next_state;
889 goto yy_match;
890 }
891
892 else
893 {
894 yy_cp = (yy_c_buf_p);
895 goto yy_find_action;
896 }
897 }
898
899 else switch ( yy_get_next_buffer( ) )
900 {
901 case EOB_ACT_END_OF_FILE:
902 {
903 (yy_did_buffer_switch_on_eof) = 0;
904
905 if ( yywrap( ) )
906 {
907 /* Note: because we've taken care in
908 * yy_get_next_buffer() to have set up
909 * yytext, we can now set up
910 * yy_c_buf_p so that if some total
911 * hoser (like flex itself) wants to
912 * call the scanner after we return the
913 * YY_NULL, it'll still work - another
914 * YY_NULL will get returned.
915 */
916 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
917
918 yy_act = YY_STATE_EOF(YY_START);
919 goto do_action;
920 }
921
922 else
923 {
924 if ( ! (yy_did_buffer_switch_on_eof) )
925 YY_NEW_FILE;
926 }
927 break;
928 }
929
930 case EOB_ACT_CONTINUE_SCAN:
931 (yy_c_buf_p) =
932 (yytext_ptr) + yy_amount_of_matched_text;
933
934 yy_current_state = yy_get_previous_state( );
935
936 yy_cp = (yy_c_buf_p);
937 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
938 goto yy_match;
939
940 case EOB_ACT_LAST_MATCH:
941 (yy_c_buf_p) =
942 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
943
944 yy_current_state = yy_get_previous_state( );
945
946 yy_cp = (yy_c_buf_p);
947 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
948 goto yy_find_action;
949 }
950 break;
951 }
952
953 default:
954 YY_FATAL_ERROR(
955 "fatal flex scanner internal error--no action found" );
956 } /* end of action switch */
957 } /* end of scanning one token */
958 } /* end of user's declarations */
959} /* end of yylex */
960
961/* yy_get_next_buffer - try to read in a new buffer
962 *
963 * Returns a code representing an action:
964 * EOB_ACT_LAST_MATCH -
965 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
966 * EOB_ACT_END_OF_FILE - end of file
967 */
968static int yy_get_next_buffer (void)
969{
Patrick Georgi2b807342016-06-28 20:45:34 +0200970 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
971 char *source = (yytext_ptr);
972 yy_size_t number_to_move, i;
Sol Boucher69b88bf2015-02-26 11:47:19 -0800973 int ret_val;
974
975 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
976 YY_FATAL_ERROR(
977 "fatal flex scanner internal error--end of buffer missed" );
978
979 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
980 { /* Don't try to fill the buffer, so this is an EOF. */
981 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
982 {
983 /* We matched a single character, the EOB, so
984 * treat this as a final EOF.
985 */
986 return EOB_ACT_END_OF_FILE;
987 }
988
989 else
990 {
991 /* We matched some text prior to the EOB, first
992 * process it.
993 */
994 return EOB_ACT_LAST_MATCH;
995 }
996 }
997
998 /* Try to read more data. */
999
1000 /* First move last chars to start of buffer. */
Patrick Georgi2b807342016-06-28 20:45:34 +02001001 number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001002
1003 for ( i = 0; i < number_to_move; ++i )
1004 *(dest++) = *(source++);
1005
1006 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1007 /* don't do the read, it's not guaranteed to return an EOF,
1008 * just force an EOF
1009 */
1010 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1011
1012 else
1013 {
1014 yy_size_t num_to_read =
1015 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1016
1017 while ( num_to_read <= 0 )
1018 { /* Not enough room in the buffer - grow it. */
1019
1020 /* just a shorter name for the current buffer */
1021 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1022
1023 int yy_c_buf_p_offset =
1024 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1025
1026 if ( b->yy_is_our_buffer )
1027 {
1028 yy_size_t new_size = b->yy_buf_size * 2;
1029
1030 if ( new_size <= 0 )
1031 b->yy_buf_size += b->yy_buf_size / 8;
1032 else
1033 b->yy_buf_size *= 2;
1034
1035 b->yy_ch_buf = (char *)
1036 /* Include room in for 2 EOB chars. */
1037 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1038 }
1039 else
1040 /* Can't grow it, we don't own it. */
1041 b->yy_ch_buf = 0;
1042
1043 if ( ! b->yy_ch_buf )
1044 YY_FATAL_ERROR(
1045 "fatal error - scanner input buffer overflow" );
1046
1047 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1048
1049 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1050 number_to_move - 1;
1051
1052 }
1053
1054 if ( num_to_read > YY_READ_BUF_SIZE )
1055 num_to_read = YY_READ_BUF_SIZE;
1056
1057 /* Read in more data. */
1058 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1059 (yy_n_chars), num_to_read );
1060
1061 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1062 }
1063
1064 if ( (yy_n_chars) == 0 )
1065 {
1066 if ( number_to_move == YY_MORE_ADJ )
1067 {
1068 ret_val = EOB_ACT_END_OF_FILE;
1069 yyrestart(yyin );
1070 }
1071
1072 else
1073 {
1074 ret_val = EOB_ACT_LAST_MATCH;
1075 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1076 YY_BUFFER_EOF_PENDING;
1077 }
1078 }
1079
1080 else
1081 ret_val = EOB_ACT_CONTINUE_SCAN;
1082
Patrick Georgi2b807342016-06-28 20:45:34 +02001083 if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
Sol Boucher69b88bf2015-02-26 11:47:19 -08001084 /* Extend the array by 50%, plus the number we really need. */
Patrick Georgi2b807342016-06-28 20:45:34 +02001085 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001086 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1087 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1088 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1089 }
1090
1091 (yy_n_chars) += number_to_move;
1092 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1093 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1094
1095 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1096
1097 return ret_val;
1098}
1099
1100/* yy_get_previous_state - get the state just before the EOB char was reached */
1101
1102 static yy_state_type yy_get_previous_state (void)
1103{
Patrick Georgi2b807342016-06-28 20:45:34 +02001104 yy_state_type yy_current_state;
1105 char *yy_cp;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001106
1107 yy_current_state = (yy_start);
1108
1109 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1110 {
Patrick Georgi2b807342016-06-28 20:45:34 +02001111 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001112 if ( yy_accept[yy_current_state] )
1113 {
1114 (yy_last_accepting_state) = yy_current_state;
1115 (yy_last_accepting_cpos) = yy_cp;
1116 }
1117 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1118 {
1119 yy_current_state = (int) yy_def[yy_current_state];
1120 if ( yy_current_state >= 24 )
1121 yy_c = yy_meta[(unsigned int) yy_c];
1122 }
1123 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1124 }
1125
1126 return yy_current_state;
1127}
1128
1129/* yy_try_NUL_trans - try to make a transition on the NUL character
1130 *
1131 * synopsis
1132 * next_state = yy_try_NUL_trans( current_state );
1133 */
1134 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1135{
Patrick Georgi2b807342016-06-28 20:45:34 +02001136 int yy_is_jam;
1137 char *yy_cp = (yy_c_buf_p);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001138
Patrick Georgi2b807342016-06-28 20:45:34 +02001139 YY_CHAR yy_c = 1;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001140 if ( yy_accept[yy_current_state] )
1141 {
1142 (yy_last_accepting_state) = yy_current_state;
1143 (yy_last_accepting_cpos) = yy_cp;
1144 }
1145 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1146 {
1147 yy_current_state = (int) yy_def[yy_current_state];
1148 if ( yy_current_state >= 24 )
1149 yy_c = yy_meta[(unsigned int) yy_c];
1150 }
1151 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1152 yy_is_jam = (yy_current_state == 23);
1153
1154 return yy_is_jam ? 0 : yy_current_state;
1155}
1156
Patrick Georgi2b807342016-06-28 20:45:34 +02001157#ifndef YY_NO_UNPUT
1158
1159 static void yyunput (int c, char * yy_bp )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001160{
Patrick Georgi2b807342016-06-28 20:45:34 +02001161 char *yy_cp;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001162
1163 yy_cp = (yy_c_buf_p);
1164
1165 /* undo effects of setting up yytext */
1166 *yy_cp = (yy_hold_char);
1167
1168 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1169 { /* need to shift things up to make room */
1170 /* +2 for EOB chars. */
Patrick Georgi2b807342016-06-28 20:45:34 +02001171 yy_size_t number_to_move = (yy_n_chars) + 2;
1172 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
Sol Boucher69b88bf2015-02-26 11:47:19 -08001173 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
Patrick Georgi2b807342016-06-28 20:45:34 +02001174 char *source =
Sol Boucher69b88bf2015-02-26 11:47:19 -08001175 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1176
1177 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1178 *--dest = *--source;
1179
1180 yy_cp += (int) (dest - source);
1181 yy_bp += (int) (dest - source);
1182 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1183 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1184
1185 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1186 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1187 }
1188
1189 *--yy_cp = (char) c;
1190
1191 (yytext_ptr) = yy_bp;
1192 (yy_hold_char) = *yy_cp;
1193 (yy_c_buf_p) = yy_cp;
1194}
1195
Patrick Georgi2b807342016-06-28 20:45:34 +02001196#endif
1197
Sol Boucher69b88bf2015-02-26 11:47:19 -08001198#ifndef YY_NO_INPUT
1199#ifdef __cplusplus
1200 static int yyinput (void)
1201#else
1202 static int input (void)
1203#endif
1204
1205{
1206 int c;
1207
1208 *(yy_c_buf_p) = (yy_hold_char);
1209
1210 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1211 {
1212 /* yy_c_buf_p now points to the character we want to return.
1213 * If this occurs *before* the EOB characters, then it's a
1214 * valid NUL; if not, then we've hit the end of the buffer.
1215 */
1216 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1217 /* This was really a NUL. */
1218 *(yy_c_buf_p) = '\0';
1219
1220 else
1221 { /* need more input */
1222 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1223 ++(yy_c_buf_p);
1224
1225 switch ( yy_get_next_buffer( ) )
1226 {
1227 case EOB_ACT_LAST_MATCH:
1228 /* This happens because yy_g_n_b()
1229 * sees that we've accumulated a
1230 * token and flags that we need to
1231 * try matching the token before
1232 * proceeding. But for input(),
1233 * there's no matching to consider.
1234 * So convert the EOB_ACT_LAST_MATCH
1235 * to EOB_ACT_END_OF_FILE.
1236 */
1237
1238 /* Reset buffer status. */
1239 yyrestart(yyin );
1240
1241 /*FALLTHROUGH*/
1242
1243 case EOB_ACT_END_OF_FILE:
1244 {
1245 if ( yywrap( ) )
1246 return EOF;
1247
1248 if ( ! (yy_did_buffer_switch_on_eof) )
1249 YY_NEW_FILE;
1250#ifdef __cplusplus
1251 return yyinput();
1252#else
1253 return input();
1254#endif
1255 }
1256
1257 case EOB_ACT_CONTINUE_SCAN:
1258 (yy_c_buf_p) = (yytext_ptr) + offset;
1259 break;
1260 }
1261 }
1262 }
1263
1264 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1265 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1266 (yy_hold_char) = *++(yy_c_buf_p);
1267
1268 return c;
1269}
1270#endif /* ifndef YY_NO_INPUT */
1271
1272/** Immediately switch to a different input stream.
1273 * @param input_file A readable stream.
1274 *
1275 * @note This function does not reset the start condition to @c INITIAL .
1276 */
1277 void yyrestart (FILE * input_file )
1278{
1279
1280 if ( ! YY_CURRENT_BUFFER ){
1281 yyensure_buffer_stack ();
1282 YY_CURRENT_BUFFER_LVALUE =
1283 yy_create_buffer(yyin,YY_BUF_SIZE );
1284 }
1285
1286 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1287 yy_load_buffer_state( );
1288}
1289
1290/** Switch to a different input buffer.
1291 * @param new_buffer The new input buffer.
1292 *
1293 */
1294 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1295{
1296
1297 /* TODO. We should be able to replace this entire function body
1298 * with
1299 * yypop_buffer_state();
1300 * yypush_buffer_state(new_buffer);
1301 */
1302 yyensure_buffer_stack ();
1303 if ( YY_CURRENT_BUFFER == new_buffer )
1304 return;
1305
1306 if ( YY_CURRENT_BUFFER )
1307 {
1308 /* Flush out information for old buffer. */
1309 *(yy_c_buf_p) = (yy_hold_char);
1310 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1311 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1312 }
1313
1314 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1315 yy_load_buffer_state( );
1316
1317 /* We don't actually know whether we did this switch during
1318 * EOF (yywrap()) processing, but the only time this flag
1319 * is looked at is after yywrap() is called, so it's safe
1320 * to go ahead and always set it.
1321 */
1322 (yy_did_buffer_switch_on_eof) = 1;
1323}
1324
1325static void yy_load_buffer_state (void)
1326{
1327 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1328 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1329 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1330 (yy_hold_char) = *(yy_c_buf_p);
1331}
1332
1333/** Allocate and initialize an input buffer state.
1334 * @param file A readable stream.
1335 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1336 *
1337 * @return the allocated buffer state.
1338 */
1339 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1340{
1341 YY_BUFFER_STATE b;
1342
1343 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1344 if ( ! b )
1345 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1346
Patrick Georgi2b807342016-06-28 20:45:34 +02001347 b->yy_buf_size = (yy_size_t)size;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001348
1349 /* yy_ch_buf has to be 2 characters longer than the size given because
1350 * we need to put in 2 end-of-buffer characters.
1351 */
1352 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1353 if ( ! b->yy_ch_buf )
1354 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1355
1356 b->yy_is_our_buffer = 1;
1357
1358 yy_init_buffer(b,file );
1359
1360 return b;
1361}
1362
1363/** Destroy the buffer.
1364 * @param b a buffer created with yy_create_buffer()
1365 *
1366 */
1367 void yy_delete_buffer (YY_BUFFER_STATE b )
1368{
1369
1370 if ( ! b )
1371 return;
1372
1373 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1374 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1375
1376 if ( b->yy_is_our_buffer )
1377 yyfree((void *) b->yy_ch_buf );
1378
1379 yyfree((void *) b );
1380}
1381
1382/* Initializes or reinitializes a buffer.
1383 * This function is sometimes called more than once on the same buffer,
1384 * such as during a yyrestart() or at EOF.
1385 */
1386 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1387
1388{
1389 int oerrno = errno;
1390
1391 yy_flush_buffer(b );
1392
1393 b->yy_input_file = file;
1394 b->yy_fill_buffer = 1;
1395
1396 /* If b is the current buffer, then yy_init_buffer was _probably_
1397 * called from yyrestart() or through yy_get_next_buffer.
1398 * In that case, we don't want to reset the lineno or column.
1399 */
1400 if (b != YY_CURRENT_BUFFER){
1401 b->yy_bs_lineno = 1;
1402 b->yy_bs_column = 0;
1403 }
1404
1405 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1406
1407 errno = oerrno;
1408}
1409
1410/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1411 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1412 *
1413 */
1414 void yy_flush_buffer (YY_BUFFER_STATE b )
1415{
1416 if ( ! b )
1417 return;
1418
1419 b->yy_n_chars = 0;
1420
1421 /* We always need two end-of-buffer characters. The first causes
1422 * a transition to the end-of-buffer state. The second causes
1423 * a jam in that state.
1424 */
1425 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1426 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1427
1428 b->yy_buf_pos = &b->yy_ch_buf[0];
1429
1430 b->yy_at_bol = 1;
1431 b->yy_buffer_status = YY_BUFFER_NEW;
1432
1433 if ( b == YY_CURRENT_BUFFER )
1434 yy_load_buffer_state( );
1435}
1436
1437/** Pushes the new state onto the stack. The new state becomes
1438 * the current state. This function will allocate the stack
1439 * if necessary.
1440 * @param new_buffer The new state.
1441 *
1442 */
1443void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1444{
1445 if (new_buffer == NULL)
1446 return;
1447
1448 yyensure_buffer_stack();
1449
1450 /* This block is copied from yy_switch_to_buffer. */
1451 if ( YY_CURRENT_BUFFER )
1452 {
1453 /* Flush out information for old buffer. */
1454 *(yy_c_buf_p) = (yy_hold_char);
1455 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1456 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1457 }
1458
1459 /* Only push if top exists. Otherwise, replace top. */
1460 if (YY_CURRENT_BUFFER)
1461 (yy_buffer_stack_top)++;
1462 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1463
1464 /* copied from yy_switch_to_buffer. */
1465 yy_load_buffer_state( );
1466 (yy_did_buffer_switch_on_eof) = 1;
1467}
1468
1469/** Removes and deletes the top of the stack, if present.
1470 * The next element becomes the new top.
1471 *
1472 */
1473void yypop_buffer_state (void)
1474{
1475 if (!YY_CURRENT_BUFFER)
1476 return;
1477
1478 yy_delete_buffer(YY_CURRENT_BUFFER );
1479 YY_CURRENT_BUFFER_LVALUE = NULL;
1480 if ((yy_buffer_stack_top) > 0)
1481 --(yy_buffer_stack_top);
1482
1483 if (YY_CURRENT_BUFFER) {
1484 yy_load_buffer_state( );
1485 (yy_did_buffer_switch_on_eof) = 1;
1486 }
1487}
1488
1489/* Allocates the stack if it does not exist.
1490 * Guarantees space for at least one push.
1491 */
1492static void yyensure_buffer_stack (void)
1493{
1494 yy_size_t num_to_alloc;
1495
1496 if (!(yy_buffer_stack)) {
1497
1498 /* First allocation is just for 2 elements, since we don't know if this
1499 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1500 * immediate realloc on the next call.
1501 */
Patrick Georgi2b807342016-06-28 20:45:34 +02001502 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
Sol Boucher69b88bf2015-02-26 11:47:19 -08001503 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1504 (num_to_alloc * sizeof(struct yy_buffer_state*)
1505 );
1506 if ( ! (yy_buffer_stack) )
1507 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1508
1509 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1510
1511 (yy_buffer_stack_max) = num_to_alloc;
1512 (yy_buffer_stack_top) = 0;
1513 return;
1514 }
1515
1516 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1517
1518 /* Increase the buffer to prepare for a possible push. */
Patrick Georgi2b807342016-06-28 20:45:34 +02001519 yy_size_t grow_size = 8 /* arbitrary grow size */;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001520
1521 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1522 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1523 ((yy_buffer_stack),
1524 num_to_alloc * sizeof(struct yy_buffer_state*)
1525 );
1526 if ( ! (yy_buffer_stack) )
1527 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1528
1529 /* zero only the new slots.*/
1530 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1531 (yy_buffer_stack_max) = num_to_alloc;
1532 }
1533}
1534
1535/** Setup the input buffer state to scan directly from a user-specified character buffer.
1536 * @param base the character buffer
1537 * @param size the size in bytes of the character buffer
1538 *
1539 * @return the newly allocated buffer state object.
1540 */
1541YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1542{
1543 YY_BUFFER_STATE b;
1544
1545 if ( size < 2 ||
1546 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1547 base[size-1] != YY_END_OF_BUFFER_CHAR )
1548 /* They forgot to leave room for the EOB's. */
1549 return 0;
1550
1551 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1552 if ( ! b )
1553 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1554
1555 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1556 b->yy_buf_pos = b->yy_ch_buf = base;
1557 b->yy_is_our_buffer = 0;
1558 b->yy_input_file = 0;
1559 b->yy_n_chars = b->yy_buf_size;
1560 b->yy_is_interactive = 0;
1561 b->yy_at_bol = 1;
1562 b->yy_fill_buffer = 0;
1563 b->yy_buffer_status = YY_BUFFER_NEW;
1564
1565 yy_switch_to_buffer(b );
1566
1567 return b;
1568}
1569
1570/** Setup the input buffer state to scan a string. The next call to yylex() will
1571 * scan from a @e copy of @a str.
1572 * @param yystr a NUL-terminated string to scan
1573 *
1574 * @return the newly allocated buffer state object.
1575 * @note If you want to scan bytes that may contain NUL values, then use
1576 * yy_scan_bytes() instead.
1577 */
1578YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1579{
1580
1581 return yy_scan_bytes(yystr,strlen(yystr) );
1582}
1583
1584/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1585 * scan from a @e copy of @a bytes.
1586 * @param yybytes the byte buffer to scan
1587 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1588 *
1589 * @return the newly allocated buffer state object.
1590 */
1591YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1592{
1593 YY_BUFFER_STATE b;
1594 char *buf;
1595 yy_size_t n;
1596 yy_size_t i;
1597
1598 /* Get memory for full buffer, including space for trailing EOB's. */
1599 n = _yybytes_len + 2;
1600 buf = (char *) yyalloc(n );
1601 if ( ! buf )
1602 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1603
1604 for ( i = 0; i < _yybytes_len; ++i )
1605 buf[i] = yybytes[i];
1606
1607 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1608
1609 b = yy_scan_buffer(buf,n );
1610 if ( ! b )
1611 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1612
1613 /* It's okay to grow etc. this buffer, and we should throw it
1614 * away when we're done.
1615 */
1616 b->yy_is_our_buffer = 1;
1617
1618 return b;
1619}
1620
1621#ifndef YY_EXIT_FAILURE
1622#define YY_EXIT_FAILURE 2
1623#endif
1624
1625static void yy_fatal_error (yyconst char* msg )
1626{
Patrick Georgi2b807342016-06-28 20:45:34 +02001627 (void) fprintf( stderr, "%s\n", msg );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001628 exit( YY_EXIT_FAILURE );
1629}
1630
1631/* Redefine yyless() so it works in section 3 code. */
1632
1633#undef yyless
1634#define yyless(n) \
1635 do \
1636 { \
1637 /* Undo effects of setting up yytext. */ \
1638 int yyless_macro_arg = (n); \
1639 YY_LESS_LINENO(yyless_macro_arg);\
1640 yytext[yyleng] = (yy_hold_char); \
1641 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1642 (yy_hold_char) = *(yy_c_buf_p); \
1643 *(yy_c_buf_p) = '\0'; \
1644 yyleng = yyless_macro_arg; \
1645 } \
1646 while ( 0 )
1647
1648/* Accessor methods (get/set functions) to struct members. */
1649
1650/** Get the current line number.
1651 *
1652 */
1653int yyget_lineno (void)
1654{
1655
1656 return yylineno;
1657}
1658
1659/** Get the input stream.
1660 *
1661 */
1662FILE *yyget_in (void)
1663{
1664 return yyin;
1665}
1666
1667/** Get the output stream.
1668 *
1669 */
1670FILE *yyget_out (void)
1671{
1672 return yyout;
1673}
1674
1675/** Get the length of the current token.
1676 *
1677 */
1678yy_size_t yyget_leng (void)
1679{
1680 return yyleng;
1681}
1682
1683/** Get the current token.
1684 *
1685 */
1686
1687char *yyget_text (void)
1688{
1689 return yytext;
1690}
1691
1692/** Set the current line number.
Patrick Georgi2b807342016-06-28 20:45:34 +02001693 * @param _line_number line number
Sol Boucher69b88bf2015-02-26 11:47:19 -08001694 *
1695 */
Patrick Georgi2b807342016-06-28 20:45:34 +02001696void yyset_lineno (int _line_number )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001697{
1698
Patrick Georgi2b807342016-06-28 20:45:34 +02001699 yylineno = _line_number;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001700}
1701
1702/** Set the input stream. This does not discard the current
1703 * input buffer.
Patrick Georgi2b807342016-06-28 20:45:34 +02001704 * @param _in_str A readable stream.
Sol Boucher69b88bf2015-02-26 11:47:19 -08001705 *
1706 * @see yy_switch_to_buffer
1707 */
Patrick Georgi2b807342016-06-28 20:45:34 +02001708void yyset_in (FILE * _in_str )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001709{
Patrick Georgi2b807342016-06-28 20:45:34 +02001710 yyin = _in_str ;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001711}
1712
Patrick Georgi2b807342016-06-28 20:45:34 +02001713void yyset_out (FILE * _out_str )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001714{
Patrick Georgi2b807342016-06-28 20:45:34 +02001715 yyout = _out_str ;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001716}
1717
1718int yyget_debug (void)
1719{
1720 return yy_flex_debug;
1721}
1722
Patrick Georgi2b807342016-06-28 20:45:34 +02001723void yyset_debug (int _bdebug )
Sol Boucher69b88bf2015-02-26 11:47:19 -08001724{
Patrick Georgi2b807342016-06-28 20:45:34 +02001725 yy_flex_debug = _bdebug ;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001726}
1727
1728static int yy_init_globals (void)
1729{
1730 /* Initialization is the same as for the non-reentrant scanner.
1731 * This function is called from yylex_destroy(), so don't allocate here.
1732 */
1733
1734 (yy_buffer_stack) = 0;
1735 (yy_buffer_stack_top) = 0;
1736 (yy_buffer_stack_max) = 0;
1737 (yy_c_buf_p) = (char *) 0;
1738 (yy_init) = 0;
1739 (yy_start) = 0;
1740
1741/* Defined in main.c */
1742#ifdef YY_STDINIT
1743 yyin = stdin;
1744 yyout = stdout;
1745#else
1746 yyin = (FILE *) 0;
1747 yyout = (FILE *) 0;
1748#endif
1749
1750 /* For future reference: Set errno on error, since we are called by
1751 * yylex_init()
1752 */
1753 return 0;
1754}
1755
1756/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1757int yylex_destroy (void)
1758{
1759
1760 /* Pop the buffer stack, destroying each element. */
1761 while(YY_CURRENT_BUFFER){
1762 yy_delete_buffer(YY_CURRENT_BUFFER );
1763 YY_CURRENT_BUFFER_LVALUE = NULL;
1764 yypop_buffer_state();
1765 }
1766
1767 /* Destroy the stack itself. */
1768 yyfree((yy_buffer_stack) );
1769 (yy_buffer_stack) = NULL;
1770
1771 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1772 * yylex() is called, initialization will occur. */
1773 yy_init_globals( );
1774
1775 return 0;
1776}
1777
1778/*
1779 * Internal utility routines.
1780 */
1781
1782#ifndef yytext_ptr
1783static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1784{
Patrick Georgi2b807342016-06-28 20:45:34 +02001785
1786 int i;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001787 for ( i = 0; i < n; ++i )
1788 s1[i] = s2[i];
1789}
1790#endif
1791
1792#ifdef YY_NEED_STRLEN
1793static int yy_flex_strlen (yyconst char * s )
1794{
Patrick Georgi2b807342016-06-28 20:45:34 +02001795 int n;
Sol Boucher69b88bf2015-02-26 11:47:19 -08001796 for ( n = 0; s[n]; ++n )
1797 ;
1798
1799 return n;
1800}
1801#endif
1802
1803void *yyalloc (yy_size_t size )
1804{
Patrick Georgi2b807342016-06-28 20:45:34 +02001805 return (void *) malloc( size );
Sol Boucher69b88bf2015-02-26 11:47:19 -08001806}
1807
1808void *yyrealloc (void * ptr, yy_size_t size )
1809{
Patrick Georgi2b807342016-06-28 20:45:34 +02001810
Sol Boucher69b88bf2015-02-26 11:47:19 -08001811 /* The cast to (char *) in the following accommodates both
1812 * implementations that use char* generic pointers, and those
1813 * that use void* generic pointers. It works with the latter
1814 * because both ANSI C and C++ allow castless assignment from
1815 * any pointer type to void*, and deal with argument conversions
1816 * as though doing an assignment.
1817 */
1818 return (void *) realloc( (char *) ptr, size );
1819}
1820
1821void yyfree (void * ptr )
1822{
Patrick Georgi2b807342016-06-28 20:45:34 +02001823 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
Sol Boucher69b88bf2015-02-26 11:47:19 -08001824}
1825
1826#define YYTABLES_NAME "yytables"
1827
Patrick Georgi2b807342016-06-28 20:45:34 +02001828#line 41 "fmd_scanner.l"
Sol Boucher69b88bf2015-02-26 11:47:19 -08001829
1830
1831
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001832int parse_integer(char *src, int base)
Sol Boucher69b88bf2015-02-26 11:47:19 -08001833{
1834 char *multiplier = NULL;
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001835 unsigned val = strtoul(src, &multiplier, base);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001836
1837 if (*multiplier) {
1838 switch(*multiplier) {
1839 case 'K':
1840 val *= 1024;
1841 break;
1842 case 'M':
1843 val *= 1024*1024;
1844 break;
1845 case 'G':
1846 val *= 1024*1024*1024;
1847 break;
1848 default:
1849 // If we ever get here, the MULTIPLIER regex is allowing
1850 // multiplier suffixes not handled by this code.
1851 assert(false);
1852 }
1853 }
1854
1855 yylval.intval = val;
1856 return INTEGER;
1857}
1858
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001859int copy_string(const char *src)
Sol Boucher69b88bf2015-02-26 11:47:19 -08001860{
Patrick Georgi1f8e4cb2015-05-25 22:53:19 +02001861 yylval.strval = strdup(src);
Sol Boucher69b88bf2015-02-26 11:47:19 -08001862 return STRING;
1863}
Patrick Georgi2b807342016-06-28 20:45:34 +02001864