1 #line 2 "../../src/scanner.cc"
3 #line 4 "../../src/scanner.cc"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
89 #endif /* ! FLEXINT_H */
93 /* The "const" storage-class-modifier is valid. */
96 #else /* ! __cplusplus */
98 /* C99 requires __STDC__ to be defined as 1. */
99 #if defined (__STDC__)
103 #endif /* defined (__STDC__) */
104 #endif /* ! __cplusplus */
107 #define yyconst const
112 /* Returned upon end-of-file. */
115 /* Promotes a possibly negative, possibly signed char to an unsigned
116 * integer for use as an array index. If the signed char is negative,
117 * we want to instead treat it as an 8-bit unsigned char, hence the
120 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
122 /* Enter a start condition. This macro really ought to take a parameter,
123 * but we do it the disgusting crufty way forced on us by the ()-less
124 * definition of BEGIN.
126 #define BEGIN (yy_start) = 1 + 2 *
128 /* Translate the current start state into a value that can be later handed
129 * to BEGIN to return to the state. The YYSTATE alias is for lex
132 #define YY_START (((yy_start) - 1) / 2)
133 #define YYSTATE YY_START
135 /* Action number for EOF rule of a given start state. */
136 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
138 /* Special action meaning "start processing a new file". */
139 #define YY_NEW_FILE yyrestart(yyin )
141 #define YY_END_OF_BUFFER_CHAR 0
143 /* Size of default input buffer. */
146 /* On IA-64, the buffer size is 16k, not 8k.
147 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
148 * Ditto for the __ia64__ case accordingly.
150 #define YY_BUF_SIZE 32768
152 #define YY_BUF_SIZE 16384
153 #endif /* __ia64__ */
156 /* The state buf must be large enough to hold one state per character in the main buffer.
158 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
160 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
161 #define YY_TYPEDEF_YY_BUFFER_STATE
162 typedef struct yy_buffer_state *YY_BUFFER_STATE;
167 extern FILE *yyin, *yyout;
169 #define EOB_ACT_CONTINUE_SCAN 0
170 #define EOB_ACT_END_OF_FILE 1
171 #define EOB_ACT_LAST_MATCH 2
173 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
174 * access to the local variable yy_act. Since yyless() is a macro, it would break
175 * existing scanners that call yyless() from OUTSIDE yylex.
176 * One obvious solution it to make yy_act a global. I tried that, and saw
177 * a 5% performance hit in a non-yylineno scanner, because yy_act is
178 * normally declared as a register variable-- so it is not worth it.
180 #define YY_LESS_LINENO(n) \
183 for ( yyl = n; yyl < yyleng; ++yyl )\
184 if ( yytext[yyl] == '\n' )\
188 /* Return all but the first "n" matched characters back to the input stream. */
192 /* Undo effects of setting up yytext. */ \
193 int yyless_macro_arg = (n); \
194 YY_LESS_LINENO(yyless_macro_arg);\
195 *yy_cp = (yy_hold_char); \
196 YY_RESTORE_YY_MORE_OFFSET \
197 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
198 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
202 #define unput(c) yyunput( c, (yytext_ptr) )
204 #ifndef YY_TYPEDEF_YY_SIZE_T
205 #define YY_TYPEDEF_YY_SIZE_T
206 typedef size_t yy_size_t;
209 #ifndef YY_STRUCT_YY_BUFFER_STATE
210 #define YY_STRUCT_YY_BUFFER_STATE
211 struct yy_buffer_state
215 char *yy_ch_buf; /* input buffer */
216 char *yy_buf_pos; /* current position in input buffer */
218 /* Size of input buffer in bytes, not including room for EOB
221 yy_size_t yy_buf_size;
223 /* Number of characters read into yy_ch_buf, not including EOB
228 /* Whether we "own" the buffer - i.e., we know we created it,
229 * and can realloc() it to grow it, and should free() it to
232 int yy_is_our_buffer;
234 /* Whether this is an "interactive" input source; if so, and
235 * if we're using stdio for input, then we want to use getc()
236 * instead of fread(), to make sure we stop fetching input after
239 int yy_is_interactive;
241 /* Whether we're considered to be at the beginning of a line.
242 * If so, '^' rules will be active on the next match, otherwise
247 int yy_bs_lineno; /**< The line count. */
248 int yy_bs_column; /**< The column count. */
250 /* Whether to try to fill the input buffer when we reach the
255 int yy_buffer_status;
257 #define YY_BUFFER_NEW 0
258 #define YY_BUFFER_NORMAL 1
259 /* When an EOF's been seen but there's still some text to process
260 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
261 * shouldn't try reading from the input source any more. We might
262 * still have a bunch of tokens to match, though, because of
263 * possible backing-up.
265 * When we actually see the EOF, we change the status to "new"
266 * (via yyrestart()), so that the user can continue scanning by
267 * just pointing yyin at a new input file.
269 #define YY_BUFFER_EOF_PENDING 2
272 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
274 /* Stack of input buffers. */
275 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
276 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
277 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
279 /* We provide macros for accessing buffer states in case in the
280 * future we want to put the buffer states in a more general
283 * Returns the top of the stack, or NULL.
285 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
286 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
289 /* Same as previous macro, but useful when we know that the buffer stack is not
290 * NULL or when we need an lvalue. For internal use only.
292 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
294 /* yy_hold_char holds the character lost when yytext is formed. */
295 static char yy_hold_char;
296 static int yy_n_chars; /* number of characters read into yy_ch_buf */
299 /* Points to current character in buffer. */
300 static char *yy_c_buf_p = (char *) 0;
301 static int yy_init = 0; /* whether we need to initialize */
302 static int yy_start = 0; /* start state number */
304 /* Flag which is used to allow yywrap()'s to do buffer switches
305 * instead of setting up a fresh yyin. A bit of a hack ...
307 static int yy_did_buffer_switch_on_eof;
309 void yyrestart (FILE *input_file );
310 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
311 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
312 void yy_delete_buffer (YY_BUFFER_STATE b );
313 void yy_flush_buffer (YY_BUFFER_STATE b );
314 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
315 void yypop_buffer_state (void );
317 static void yyensure_buffer_stack (void );
318 static void yy_load_buffer_state (void );
319 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
321 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
323 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
324 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
325 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
327 void *yyalloc (yy_size_t );
328 void *yyrealloc (void *,yy_size_t );
329 void yyfree (void * );
331 #define yy_new_buffer yy_create_buffer
333 #define yy_set_interactive(is_interactive) \
335 if ( ! YY_CURRENT_BUFFER ){ \
336 yyensure_buffer_stack (); \
337 YY_CURRENT_BUFFER_LVALUE = \
338 yy_create_buffer(yyin,YY_BUF_SIZE ); \
340 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
343 #define yy_set_bol(at_bol) \
345 if ( ! YY_CURRENT_BUFFER ){\
346 yyensure_buffer_stack (); \
347 YY_CURRENT_BUFFER_LVALUE = \
348 yy_create_buffer(yyin,YY_BUF_SIZE ); \
350 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
353 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
355 /* Begin user sect3 */
358 #define YY_SKIP_YYWRAP
360 typedef unsigned char YY_CHAR;
362 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
364 typedef int yy_state_type;
371 #define yytext_ptr yytext
373 static yy_state_type yy_get_previous_state (void );
374 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
375 static int yy_get_next_buffer (void );
376 static void yy_fatal_error (yyconst char msg[] );
378 /* Done after the current pattern has been matched and before the
379 * corresponding action - sets up yytext.
381 #define YY_DO_BEFORE_ACTION \
382 (yytext_ptr) = yy_bp; \
383 yyleng = (size_t) (yy_cp - yy_bp); \
384 (yy_hold_char) = *yy_cp; \
386 (yy_c_buf_p) = yy_cp;
388 #define YY_NUM_RULES 62
389 #define YY_END_OF_BUFFER 63
390 /* This struct is not used in this scanner,
391 but its presence is necessary. */
394 flex_int32_t yy_verify;
397 static yyconst flex_int16_t yy_accept[246] =
399 0, 0, 0, 0, 0, 0, 63, 61, 57, 59,
400 60, 56, 48, 58, 43, 42, 47, 41, 47, 47,
401 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
402 47, 47, 47, 47, 47, 47, 62, 46, 44, 45,
403 55, 51, 55, 54, 55, 57, 59, 56, 58, 0,
404 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
405 15, 0, 18, 0, 0, 0, 0, 0, 0, 0,
406 0, 0, 0, 0, 0, 0, 45, 51, 52, 0,
407 53, 0, 50, 0, 0, 0, 0, 0, 0, 0,
408 0, 0, 0, 0, 2, 0, 0, 0, 19, 0,
410 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
411 0, 14, 49, 0, 40, 0, 0, 0, 0, 0,
412 0, 0, 9, 17, 0, 0, 0, 4, 28, 0,
413 0, 0, 0, 0, 0, 0, 0, 39, 0, 0,
414 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
415 5, 25, 0, 0, 0, 0, 0, 0, 0, 0,
416 0, 0, 0, 3, 0, 0, 22, 0, 0, 0,
417 0, 0, 0, 0, 0, 0, 6, 0, 0, 36,
418 0, 0, 0, 0, 0, 16, 0, 0, 0, 0,
419 1, 0, 35, 0, 0, 23, 0, 30, 0, 0,
421 38, 0, 0, 0, 0, 0, 0, 0, 0, 10,
422 20, 0, 34, 24, 11, 0, 27, 37, 0, 0,
423 0, 0, 8, 29, 0, 31, 0, 0, 0, 26,
424 0, 0, 0, 0, 0, 0, 0, 7, 13, 0,
428 static yyconst flex_int32_t yy_ec[256] =
430 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
431 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 5, 1, 6, 7, 1, 1, 1, 1, 8,
434 9, 1, 1, 10, 11, 1, 1, 12, 12, 12,
435 12, 12, 12, 12, 12, 12, 12, 1, 1, 1,
436 13, 1, 14, 1, 15, 15, 15, 15, 15, 15,
437 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
438 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
439 1, 16, 1, 1, 1, 1, 17, 18, 19, 20,
441 21, 22, 23, 24, 25, 15, 26, 27, 28, 29,
442 30, 31, 32, 33, 34, 35, 36, 37, 15, 38,
443 39, 15, 1, 1, 1, 1, 1, 1, 1, 1,
444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
454 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
455 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
456 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460 static yyconst flex_int32_t yy_meta[40] =
462 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
465 1, 1, 1, 1, 1, 1, 1, 1, 1
468 static yyconst flex_int16_t yy_base[250] =
470 0, 0, 37, 47, 39, 57, 271, 272, 268, 0,
471 272, 264, 272, 0, 272, 272, 272, 272, 235, 32,
472 238, 239, 232, 239, 234, 232, 34, 231, 43, 30,
473 239, 47, 36, 225, 59, 237, 272, 272, 272, 245,
474 272, 253, 272, 272, 78, 253, 0, 249, 0, 230,
475 55, 216, 215, 61, 220, 229, 213, 218, 226, 218,
476 272, 222, 272, 208, 223, 208, 208, 220, 208, 204,
477 198, 204, 217, 206, 199, 197, 218, 226, 272, 64,
478 272, 199, 272, 58, 70, 206, 207, 208, 206, 195,
479 199, 204, 184, 199, 272, 195, 196, 181, 272, 190,
481 188, 182, 176, 176, 177, 184, 173, 186, 183, 169,
482 170, 272, 272, 172, 272, 166, 168, 170, 170, 165,
483 172, 169, 272, 272, 160, 163, 172, 75, 76, 167,
484 161, 173, 159, 163, 162, 151, 156, 272, 150, 162,
485 161, 156, 145, 152, 148, 157, 156, 150, 147, 152,
486 272, 79, 143, 141, 140, 148, 137, 136, 137, 142,
487 130, 130, 132, 272, 138, 125, 272, 125, 128, 132,
488 121, 119, 133, 123, 121, 117, 272, 129, 118, 272,
489 112, 118, 112, 110, 117, 126, 121, 120, 119, 110,
490 272, 105, 272, 108, 106, 272, 104, 272, 105, 98,
492 272, 98, 96, 112, 106, 109, 102, 105, 98, 272,
493 272, 104, 103, 272, 272, 93, 272, 272, 96, 101,
494 94, 91, 272, 272, 87, 272, 95, 98, 84, 272,
495 78, 84, 75, 69, 74, 71, 68, 272, 272, 66,
496 272, 272, 272, 272, 272, 109, 111, 78, 51
499 static yyconst flex_int16_t yy_def[250] =
501 245, 1, 246, 246, 247, 247, 245, 245, 245, 248,
502 245, 245, 245, 249, 245, 245, 245, 245, 245, 245,
503 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
504 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
505 245, 245, 245, 245, 245, 245, 248, 245, 249, 245,
506 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
507 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
508 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
509 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
510 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
512 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
513 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
514 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
515 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
516 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
517 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
518 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
519 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
520 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
521 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
523 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
524 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
525 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
526 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
527 245, 245, 245, 245, 0, 245, 245, 245, 245
530 static yyconst flex_int16_t yy_nxt[312] =
532 8, 9, 10, 11, 12, 13, 14, 15, 8, 16,
533 17, 17, 18, 17, 17, 8, 19, 17, 17, 20,
534 21, 22, 23, 24, 25, 17, 26, 27, 28, 29,
535 30, 17, 31, 32, 33, 34, 35, 17, 36, 37,
536 11, 42, 43, 14, 44, 38, 65, 39, 40, 37,
537 11, 49, 51, 14, 45, 38, 71, 39, 40, 42,
538 43, 52, 44, 59, 62, 66, 79, 68, 80, 60,
539 69, 63, 45, 64, 72, 74, 85, 91, 47, 75,
540 79, 70, 80, 81, 244, 86, 116, 114, 87, 88,
541 92, 115, 117, 82, 154, 156, 243, 118, 178, 242,
543 241, 155, 240, 239, 238, 157, 83, 237, 179, 8,
544 8, 41, 41, 236, 235, 234, 233, 232, 231, 230,
545 229, 228, 227, 112, 61, 226, 225, 224, 223, 222,
546 221, 220, 219, 218, 217, 216, 215, 214, 213, 212,
547 211, 210, 209, 208, 207, 206, 205, 204, 203, 202,
548 201, 200, 199, 198, 197, 196, 195, 194, 193, 192,
549 191, 190, 189, 188, 187, 186, 185, 184, 183, 182,
550 181, 180, 177, 176, 175, 174, 173, 172, 171, 170,
551 169, 168, 167, 166, 165, 164, 163, 162, 161, 160,
552 159, 158, 153, 152, 151, 150, 149, 148, 147, 146,
554 145, 144, 143, 142, 141, 140, 139, 138, 137, 136,
555 135, 134, 133, 132, 131, 130, 129, 128, 127, 126,
556 125, 124, 123, 122, 121, 120, 119, 113, 78, 77,
557 112, 111, 110, 109, 108, 107, 106, 105, 104, 103,
558 102, 101, 100, 99, 98, 97, 96, 95, 94, 93,
559 90, 89, 84, 48, 46, 78, 77, 76, 73, 67,
560 61, 58, 57, 56, 55, 54, 53, 50, 48, 46,
561 245, 7, 245, 245, 245, 245, 245, 245, 245, 245,
562 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
563 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
565 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
569 static yyconst flex_int16_t yy_chk[312] =
571 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
572 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
573 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
574 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
575 3, 5, 5, 3, 5, 3, 30, 3, 3, 4,
576 4, 249, 20, 4, 5, 4, 33, 4, 4, 6,
577 6, 20, 6, 27, 29, 30, 80, 32, 80, 27,
578 32, 29, 6, 29, 33, 35, 51, 54, 248, 35,
579 45, 32, 45, 45, 240, 51, 85, 84, 51, 51,
580 54, 84, 85, 45, 128, 129, 237, 85, 152, 236,
582 235, 128, 234, 233, 232, 129, 45, 231, 152, 246,
583 246, 247, 247, 229, 228, 227, 225, 222, 221, 220,
584 219, 216, 213, 212, 209, 208, 207, 206, 205, 204,
585 203, 202, 200, 199, 197, 195, 194, 192, 190, 189,
586 188, 187, 186, 185, 184, 183, 182, 181, 179, 178,
587 176, 175, 174, 173, 172, 171, 170, 169, 168, 166,
588 165, 163, 162, 161, 160, 159, 158, 157, 156, 155,
589 154, 153, 150, 149, 148, 147, 146, 145, 144, 143,
590 142, 141, 140, 139, 137, 136, 135, 134, 133, 132,
591 131, 130, 127, 126, 125, 122, 121, 120, 119, 118,
593 117, 116, 114, 111, 110, 109, 108, 107, 106, 105,
594 104, 103, 102, 101, 100, 98, 97, 96, 94, 93,
595 92, 91, 90, 89, 88, 87, 86, 82, 78, 77,
596 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,
597 66, 65, 64, 62, 60, 59, 58, 57, 56, 55,
598 53, 52, 50, 48, 46, 42, 40, 36, 34, 31,
599 28, 26, 25, 24, 23, 22, 21, 19, 12, 9,
600 7, 245, 245, 245, 245, 245, 245, 245, 245, 245,
601 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
602 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
604 245, 245, 245, 245, 245, 245, 245, 245, 245, 245,
608 /* Table of booleans, true if rule could match eol. */
609 static yyconst flex_int32_t yy_rule_can_match_eol[63] =
611 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
612 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
613 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1,
616 static yy_state_type yy_last_accepting_state;
617 static char *yy_last_accepting_cpos;
619 extern int yy_flex_debug;
620 int yy_flex_debug = 0;
622 /* The intent behind this definition is that it'll catch
623 * any uses of REJECT which flex missed.
625 #define REJECT reject_used_but_not_detected
626 #define yymore() yymore_used_but_not_detected
627 #define YY_MORE_ADJ 0
628 #define YY_RESTORE_YY_MORE_OFFSET
630 #line 1 "../../src/scanner.ll"
632 * Copyright (C) 1999-2007 Free Software Foundation, Inc.
634 * This file is part of GNU gengetopt
636 * GNU gengetopt is free software; you can redistribute it and/or modify
637 * it under the terms of the GNU General Public License as published by
638 * the Free Software Foundation; either version 3, or (at your option)
641 * GNU gengetopt is distributed in the hope that it will be useful, but
642 * WITHOUT ANY WARRANTY; without even the implied warranty of
643 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
644 * Public License for more details.
646 * You should have received a copy of the GNU General Public License along
647 * with gengetopt; see the file COPYING. If not, write to the Free Software
648 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
650 #line 23 "../../src/scanner.ll"
659 extern int gengetopt_count_line;
661 #include "my_sstream.h"
663 static void update_count_line (char *str);
664 static void updateTokenInfo (int pos);
666 // the buffer for strings (possibly spanning more lines)
667 static std::ostringstream buff;
669 static void buffer(const char *s);
670 static char *flush_buffer();
672 #define LINEBUF_LEN 1024
674 #define PUSH(s) yy_push_state(s);
675 #define POP() yy_pop_state();
678 char linebuf[LINEBUF_LEN] ; /* current line */
680 //#define DEBUG_SCANNER
682 #include <iostream> // for debug
683 #define DEB(s) std::cerr << s << std::endl;
684 #define DEB2(s,s2) std::cerr << s << ": " << s2 << std::endl;
691 #line 692 "../../src/scanner.cc"
695 #define STRING_STATE 2
697 #ifndef YY_NO_UNISTD_H
698 /* Special case for "unistd.h", since it is non-ANSI. We include it way
699 * down here because we want the user's section 1 to have been scanned first.
700 * The user has a chance to override it with an option.
705 #ifndef YY_EXTRA_TYPE
706 #define YY_EXTRA_TYPE void *
709 static int yy_init_globals (void );
711 /* Accessor methods to globals.
712 These are made visible to non-reentrant scanners for convenience. */
714 int yylex_destroy (void );
716 int yyget_debug (void );
718 void yyset_debug (int debug_flag );
720 YY_EXTRA_TYPE yyget_extra (void );
722 void yyset_extra (YY_EXTRA_TYPE user_defined );
724 FILE *yyget_in (void );
726 void yyset_in (FILE * in_str );
728 FILE *yyget_out (void );
730 void yyset_out (FILE * out_str );
732 int yyget_leng (void );
734 char *yyget_text (void );
736 int yyget_lineno (void );
738 void yyset_lineno (int line_number );
740 /* Macros after this point can all be overridden by user definitions in
744 #ifndef YY_SKIP_YYWRAP
746 extern "C" int yywrap (void );
748 extern int yywrap (void );
753 static void yy_flex_strncpy (char *,yyconst char *,int );
756 #ifdef YY_NEED_STRLEN
757 static int yy_flex_strlen (yyconst char * );
763 static int yyinput (void );
765 static int input (void );
770 static int yy_start_stack_ptr = 0;
771 static int yy_start_stack_depth = 0;
772 static int *yy_start_stack = NULL;
774 static void yy_push_state (int new_state );
776 static void yy_pop_state (void );
778 static int yy_top_state (void );
780 /* Amount of stuff to slurp up with each read. */
781 #ifndef YY_READ_BUF_SIZE
783 /* On IA-64, the buffer size is 16k, not 8k */
784 #define YY_READ_BUF_SIZE 16384
786 #define YY_READ_BUF_SIZE 8192
787 #endif /* __ia64__ */
790 /* Copy whatever the last rule matched to the standard output. */
792 /* This used to be an fputs(), but since the string might contain NUL's,
793 * we now use fwrite().
795 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
798 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
799 * is returned in "result".
802 #define YY_INPUT(buf,result,max_size) \
803 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
807 for ( n = 0; n < max_size && \
808 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
811 buf[n++] = (char) c; \
812 if ( c == EOF && ferror( yyin ) ) \
813 YY_FATAL_ERROR( "input in flex scanner failed" ); \
819 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
821 if( errno != EINTR) \
823 YY_FATAL_ERROR( "input in flex scanner failed" ); \
834 /* No semi-colon after return; correct usage is to write "yyterminate();" -
835 * we don't want an extra ';' after the "return" because that will cause
836 * some compilers to complain about unreachable statements.
839 #define yyterminate() return YY_NULL
842 /* Number of entries by which start-condition stack grows. */
843 #ifndef YY_START_STACK_INCR
844 #define YY_START_STACK_INCR 25
847 /* Report a fatal error. */
848 #ifndef YY_FATAL_ERROR
849 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
852 /* end tables serialization structures and prototypes */
854 /* Default declaration of generated scanner - a define so the user can
855 * easily add parameters.
858 #define YY_DECL_IS_OURS 1
860 extern int yylex (void);
862 #define YY_DECL int yylex (void)
863 #endif /* !YY_DECL */
865 /* Code executed at the beginning of each rule, after yytext and yyleng
868 #ifndef YY_USER_ACTION
869 #define YY_USER_ACTION
872 /* Code executed at the end of each rule. */
874 #define YY_BREAK break;
877 #define YY_RULE_SETUP \
880 /** The main scanner function which does all the work.
884 register yy_state_type yy_current_state;
885 register char *yy_cp, *yy_bp;
888 #line 71 "../../src/scanner.ll"
892 #line 893 "../../src/scanner.cc"
903 (yy_start) = 1; /* first start state */
911 if ( ! YY_CURRENT_BUFFER ) {
912 yyensure_buffer_stack ();
913 YY_CURRENT_BUFFER_LVALUE =
914 yy_create_buffer(yyin,YY_BUF_SIZE );
917 yy_load_buffer_state( );
920 while ( 1 ) /* loops until end-of-file is reached */
922 yy_cp = (yy_c_buf_p);
924 /* Support of yytext. */
925 *yy_cp = (yy_hold_char);
927 /* yy_bp points to the position in yy_ch_buf of the start of
932 yy_current_state = (yy_start);
936 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
937 if ( yy_accept[yy_current_state] )
939 (yy_last_accepting_state) = yy_current_state;
940 (yy_last_accepting_cpos) = yy_cp;
942 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
944 yy_current_state = (int) yy_def[yy_current_state];
945 if ( yy_current_state >= 246 )
946 yy_c = yy_meta[(unsigned int) yy_c];
948 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
951 while ( yy_base[yy_current_state] != 272 );
954 yy_act = yy_accept[yy_current_state];
956 { /* have to back up */
957 yy_cp = (yy_last_accepting_cpos);
958 yy_current_state = (yy_last_accepting_state);
959 yy_act = yy_accept[yy_current_state];
964 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
967 for ( yyl = 0; yyl < yyleng; ++yyl )
968 if ( yytext[yyl] == '\n' )
974 do_action: /* This label is used only to access EOF actions. */
977 { /* beginning of action switch */
978 case 0: /* must back up */
979 /* undo the effects of YY_DO_BEFORE_ACTION */
980 *yy_cp = (yy_hold_char);
981 yy_cp = (yy_last_accepting_cpos);
982 yy_current_state = (yy_last_accepting_state);
987 #line 74 "../../src/scanner.ll"
988 updateTokenInfo (-1); yylval.argtype = ARG_STRING; return TOK_ARGTYPE;
992 #line 75 "../../src/scanner.ll"
993 updateTokenInfo (-1); yylval.argtype = ARG_INT; return TOK_ARGTYPE;
997 #line 76 "../../src/scanner.ll"
998 updateTokenInfo (-1); yylval.argtype = ARG_SHORT; return TOK_ARGTYPE;
1002 #line 77 "../../src/scanner.ll"
1003 updateTokenInfo (-1); yylval.argtype = ARG_LONG; return TOK_ARGTYPE;
1007 #line 78 "../../src/scanner.ll"
1008 updateTokenInfo (-1); yylval.argtype = ARG_FLOAT; return TOK_ARGTYPE;
1012 #line 79 "../../src/scanner.ll"
1013 updateTokenInfo (-1); yylval.argtype = ARG_DOUBLE; return TOK_ARGTYPE;
1017 #line 80 "../../src/scanner.ll"
1018 updateTokenInfo (-1); yylval.argtype = ARG_LONGDOUBLE; return TOK_ARGTYPE;
1022 #line 81 "../../src/scanner.ll"
1023 updateTokenInfo (-1); yylval.argtype = ARG_LONGLONG; return TOK_ARGTYPE;
1027 #line 82 "../../src/scanner.ll"
1028 updateTokenInfo (-1); yylval.argtype = ARG_ENUM; return TOK_ARGTYPE;
1032 #line 84 "../../src/scanner.ll"
1033 updateTokenInfo (-1); return TOK_PACKAGE;
1037 #line 85 "../../src/scanner.ll"
1038 updateTokenInfo (-1); return TOK_VERSION;
1042 #line 86 "../../src/scanner.ll"
1043 updateTokenInfo (-1); yylloc.first_line = gengetopt_count_line; return TOK_GROUPOPTION;
1047 #line 87 "../../src/scanner.ll"
1048 updateTokenInfo (-1); yylloc.first_line = gengetopt_count_line; return TOK_MODEOPTION;
1052 #line 88 "../../src/scanner.ll"
1053 updateTokenInfo (-1); return TOK_YES;
1057 #line 89 "../../src/scanner.ll"
1058 updateTokenInfo (-1); return TOK_NO;
1062 #line 90 "../../src/scanner.ll"
1063 updateTokenInfo (-1); yylloc.first_line = gengetopt_count_line; return TOK_OPTION;
1067 #line 91 "../../src/scanner.ll"
1068 updateTokenInfo (-1); return TOK_FLAG;
1072 #line 92 "../../src/scanner.ll"
1073 updateTokenInfo (-1); return TOK_ON;
1077 #line 93 "../../src/scanner.ll"
1078 updateTokenInfo (-1); return TOK_OFF;
1082 #line 94 "../../src/scanner.ll"
1083 updateTokenInfo (-1); return TOK_PURPOSE;
1087 #line 95 "../../src/scanner.ll"
1088 updateTokenInfo (-1); return TOK_DESCRIPTION;
1092 #line 96 "../../src/scanner.ll"
1093 updateTokenInfo (-1); return TOK_USAGE;
1097 #line 97 "../../src/scanner.ll"
1098 updateTokenInfo (-1); return TOK_DEFAULT;
1102 #line 98 "../../src/scanner.ll"
1103 updateTokenInfo (-1); return TOK_TYPESTR;
1107 #line 99 "../../src/scanner.ll"
1108 updateTokenInfo (-1); return TOK_GROUP;
1112 #line 100 "../../src/scanner.ll"
1113 updateTokenInfo (-1); return TOK_GROUPDESC;
1117 #line 101 "../../src/scanner.ll"
1118 updateTokenInfo (-1); return TOK_DEFGROUP;
1122 #line 102 "../../src/scanner.ll"
1123 updateTokenInfo (-1); return TOK_MODE;
1127 #line 103 "../../src/scanner.ll"
1128 updateTokenInfo (-1); return TOK_MODEDESC;
1132 #line 104 "../../src/scanner.ll"
1133 updateTokenInfo (-1); return TOK_DEFMODE;
1137 #line 105 "../../src/scanner.ll"
1138 updateTokenInfo (-1); return TOK_MULTIPLE;
1142 #line 106 "../../src/scanner.ll"
1143 updateTokenInfo (-1); return TOK_ARGOPTIONAL;
1147 #line 107 "../../src/scanner.ll"
1148 updateTokenInfo (-1); return TOK_SECTIONDESC;
1152 #line 108 "../../src/scanner.ll"
1153 updateTokenInfo (-1); return TOK_SECTION;
1157 #line 109 "../../src/scanner.ll"
1158 updateTokenInfo (-1); return TOK_VALUES;
1162 #line 110 "../../src/scanner.ll"
1163 updateTokenInfo (-1); return TOK_HIDDEN;
1167 #line 111 "../../src/scanner.ll"
1168 updateTokenInfo (-1); return TOK_DEPENDON;
1172 #line 112 "../../src/scanner.ll"
1173 updateTokenInfo (-1); return TOK_DETAILS;
1177 #line 113 "../../src/scanner.ll"
1178 updateTokenInfo (-1); return TOK_TEXT;
1182 #line 114 "../../src/scanner.ll"
1183 updateTokenInfo (-1); return TOK_ARGS;
1187 #line 116 "../../src/scanner.ll"
1188 { updateTokenInfo (-1); return '='; }
1192 #line 117 "../../src/scanner.ll"
1193 { updateTokenInfo (-1); return ','; }
1197 #line 119 "../../src/scanner.ll"
1198 { PUSH(SIZE_STATE); updateTokenInfo (-1); return '('; }
1202 #line 120 "../../src/scanner.ll"
1203 { updateTokenInfo (-1); return '-'; }
1207 #line 121 "../../src/scanner.ll"
1208 { updateTokenInfo (-1); yylval.str = strdup(yytext); return TOK_SIZE; }
1212 #line 122 "../../src/scanner.ll"
1213 { POP(); updateTokenInfo (-1); return ')'; }
1217 #line 124 "../../src/scanner.ll"
1218 updateTokenInfo (-1); yylval.chr = yytext[0]; return TOK_CHAR;
1222 #line 126 "../../src/scanner.ll"
1223 { updateTokenInfo (-1); DEB("start string"); PUSH(STRING_STATE) ; }
1227 #line 127 "../../src/scanner.ll"
1228 { updateTokenInfo (2); buffer("\\\\n"); }
1232 #line 128 "../../src/scanner.ll"
1233 { updateTokenInfo (1); buffer("\n"); }
1236 /* rule 51 can match eol */
1238 #line 129 "../../src/scanner.ll"
1239 { update_count_line (yytext); buffer( yytext ) ; }
1242 /* rule 52 can match eol */
1244 #line 130 "../../src/scanner.ll"
1245 { update_count_line (yytext); /* a line break */ }
1249 #line 131 "../../src/scanner.ll"
1250 { updateTokenInfo (-1); buffer(yytext); }
1254 #line 132 "../../src/scanner.ll"
1255 { updateTokenInfo (-1); DEB("end string"); POP() ; yylval.str = flush_buffer(); return TOK_STRING; }
1259 #line 133 "../../src/scanner.ll"
1260 { updateTokenInfo (-1); buffer( yytext ) ; }
1264 #line 135 "../../src/scanner.ll"
1265 updateTokenInfo (-1);
1269 #line 136 "../../src/scanner.ll"
1270 updateTokenInfo (8*yyleng);
1274 #line 138 "../../src/scanner.ll"
1275 /* comments begin with # in any place (but strings) */
1278 /* rule 59 can match eol */
1280 #line 139 "../../src/scanner.ll"
1281 update_count_line (0); yyless(1) ; /* give back all but the \n to rescan */
1285 #line 141 "../../src/scanner.ll"
1290 #line 143 "../../src/scanner.ll"
1292 return 1000; /* little hack to produce a parse error too. */
1297 #line 147 "../../src/scanner.ll"
1300 #line 1301 "../../src/scanner.cc"
1301 case YY_STATE_EOF(INITIAL):
1302 case YY_STATE_EOF(SIZE_STATE):
1303 case YY_STATE_EOF(STRING_STATE):
1306 case YY_END_OF_BUFFER:
1308 /* Amount of text matched not including the EOB char. */
1309 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1311 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1312 *yy_cp = (yy_hold_char);
1313 YY_RESTORE_YY_MORE_OFFSET
1315 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1317 /* We're scanning a new file or input source. It's
1318 * possible that this happened because the user
1319 * just pointed yyin at a new source and called
1320 * yylex(). If so, then we have to assure
1321 * consistency between YY_CURRENT_BUFFER and our
1322 * globals. Here is the right place to do so, because
1323 * this is the first action (other than possibly a
1324 * back-up) that will match for the new input source.
1326 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1327 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1328 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1331 /* Note that here we test for yy_c_buf_p "<=" to the position
1332 * of the first EOB in the buffer, since yy_c_buf_p will
1333 * already have been incremented past the NUL character
1334 * (since all states make transitions on EOB to the
1335 * end-of-buffer state). Contrast this with the test
1338 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1339 { /* This was really a NUL. */
1340 yy_state_type yy_next_state;
1342 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1344 yy_current_state = yy_get_previous_state( );
1346 /* Okay, we're now positioned to make the NUL
1347 * transition. We couldn't have
1348 * yy_get_previous_state() go ahead and do it
1349 * for us because it doesn't know how to deal
1350 * with the possibility of jamming (and we don't
1351 * want to build jamming into it because then it
1352 * will run more slowly).
1355 yy_next_state = yy_try_NUL_trans( yy_current_state );
1357 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1359 if ( yy_next_state )
1361 /* Consume the NUL. */
1362 yy_cp = ++(yy_c_buf_p);
1363 yy_current_state = yy_next_state;
1369 yy_cp = (yy_c_buf_p);
1370 goto yy_find_action;
1374 else switch ( yy_get_next_buffer( ) )
1376 case EOB_ACT_END_OF_FILE:
1378 (yy_did_buffer_switch_on_eof) = 0;
1382 /* Note: because we've taken care in
1383 * yy_get_next_buffer() to have set up
1384 * yytext, we can now set up
1385 * yy_c_buf_p so that if some total
1386 * hoser (like flex itself) wants to
1387 * call the scanner after we return the
1388 * YY_NULL, it'll still work - another
1389 * YY_NULL will get returned.
1391 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1393 yy_act = YY_STATE_EOF(YY_START);
1399 if ( ! (yy_did_buffer_switch_on_eof) )
1405 case EOB_ACT_CONTINUE_SCAN:
1407 (yytext_ptr) + yy_amount_of_matched_text;
1409 yy_current_state = yy_get_previous_state( );
1411 yy_cp = (yy_c_buf_p);
1412 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1415 case EOB_ACT_LAST_MATCH:
1417 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1419 yy_current_state = yy_get_previous_state( );
1421 yy_cp = (yy_c_buf_p);
1422 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1423 goto yy_find_action;
1430 "fatal flex scanner internal error--no action found" );
1431 } /* end of action switch */
1432 } /* end of scanning one token */
1433 } /* end of yylex */
1435 /* yy_get_next_buffer - try to read in a new buffer
1437 * Returns a code representing an action:
1438 * EOB_ACT_LAST_MATCH -
1439 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1440 * EOB_ACT_END_OF_FILE - end of file
1442 static int yy_get_next_buffer (void)
1444 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1445 register char *source = (yytext_ptr);
1446 register int number_to_move, i;
1449 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1451 "fatal flex scanner internal error--end of buffer missed" );
1453 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1454 { /* Don't try to fill the buffer, so this is an EOF. */
1455 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1457 /* We matched a single character, the EOB, so
1458 * treat this as a final EOF.
1460 return EOB_ACT_END_OF_FILE;
1465 /* We matched some text prior to the EOB, first
1468 return EOB_ACT_LAST_MATCH;
1472 /* Try to read more data. */
1474 /* First move last chars to start of buffer. */
1475 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1477 for ( i = 0; i < number_to_move; ++i )
1478 *(dest++) = *(source++);
1480 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1481 /* don't do the read, it's not guaranteed to return an EOF,
1484 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1489 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1491 while ( num_to_read <= 0 )
1492 { /* Not enough room in the buffer - grow it. */
1494 /* just a shorter name for the current buffer */
1495 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1497 int yy_c_buf_p_offset =
1498 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1500 if ( b->yy_is_our_buffer )
1502 int new_size = b->yy_buf_size * 2;
1504 if ( new_size <= 0 )
1505 b->yy_buf_size += b->yy_buf_size / 8;
1507 b->yy_buf_size *= 2;
1509 b->yy_ch_buf = (char *)
1510 /* Include room in for 2 EOB chars. */
1511 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1514 /* Can't grow it, we don't own it. */
1517 if ( ! b->yy_ch_buf )
1519 "fatal error - scanner input buffer overflow" );
1521 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1523 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1528 if ( num_to_read > YY_READ_BUF_SIZE )
1529 num_to_read = YY_READ_BUF_SIZE;
1531 /* Read in more data. */
1532 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1533 (yy_n_chars), (size_t) num_to_read );
1535 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1538 if ( (yy_n_chars) == 0 )
1540 if ( number_to_move == YY_MORE_ADJ )
1542 ret_val = EOB_ACT_END_OF_FILE;
1548 ret_val = EOB_ACT_LAST_MATCH;
1549 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1550 YY_BUFFER_EOF_PENDING;
1555 ret_val = EOB_ACT_CONTINUE_SCAN;
1557 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1558 /* Extend the array by 50%, plus the number we really need. */
1559 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1560 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1561 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1562 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1565 (yy_n_chars) += number_to_move;
1566 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1567 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1569 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1574 /* yy_get_previous_state - get the state just before the EOB char was reached */
1576 static yy_state_type yy_get_previous_state (void)
1578 register yy_state_type yy_current_state;
1579 register char *yy_cp;
1581 yy_current_state = (yy_start);
1583 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1585 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1586 if ( yy_accept[yy_current_state] )
1588 (yy_last_accepting_state) = yy_current_state;
1589 (yy_last_accepting_cpos) = yy_cp;
1591 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1593 yy_current_state = (int) yy_def[yy_current_state];
1594 if ( yy_current_state >= 246 )
1595 yy_c = yy_meta[(unsigned int) yy_c];
1597 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1600 return yy_current_state;
1603 /* yy_try_NUL_trans - try to make a transition on the NUL character
1606 * next_state = yy_try_NUL_trans( current_state );
1608 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1610 register int yy_is_jam;
1611 register char *yy_cp = (yy_c_buf_p);
1613 register YY_CHAR yy_c = 1;
1614 if ( yy_accept[yy_current_state] )
1616 (yy_last_accepting_state) = yy_current_state;
1617 (yy_last_accepting_cpos) = yy_cp;
1619 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1621 yy_current_state = (int) yy_def[yy_current_state];
1622 if ( yy_current_state >= 246 )
1623 yy_c = yy_meta[(unsigned int) yy_c];
1625 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1626 yy_is_jam = (yy_current_state == 245);
1628 return yy_is_jam ? 0 : yy_current_state;
1633 static int yyinput (void)
1635 static int input (void)
1641 *(yy_c_buf_p) = (yy_hold_char);
1643 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1645 /* yy_c_buf_p now points to the character we want to return.
1646 * If this occurs *before* the EOB characters, then it's a
1647 * valid NUL; if not, then we've hit the end of the buffer.
1649 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1650 /* This was really a NUL. */
1651 *(yy_c_buf_p) = '\0';
1654 { /* need more input */
1655 int offset = (yy_c_buf_p) - (yytext_ptr);
1658 switch ( yy_get_next_buffer( ) )
1660 case EOB_ACT_LAST_MATCH:
1661 /* This happens because yy_g_n_b()
1662 * sees that we've accumulated a
1663 * token and flags that we need to
1664 * try matching the token before
1665 * proceeding. But for input(),
1666 * there's no matching to consider.
1667 * So convert the EOB_ACT_LAST_MATCH
1668 * to EOB_ACT_END_OF_FILE.
1671 /* Reset buffer status. */
1676 case EOB_ACT_END_OF_FILE:
1681 if ( ! (yy_did_buffer_switch_on_eof) )
1690 case EOB_ACT_CONTINUE_SCAN:
1691 (yy_c_buf_p) = (yytext_ptr) + offset;
1697 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1698 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1699 (yy_hold_char) = *++(yy_c_buf_p);
1708 #endif /* ifndef YY_NO_INPUT */
1710 /** Immediately switch to a different input stream.
1711 * @param input_file A readable stream.
1713 * @note This function does not reset the start condition to @c INITIAL .
1715 void yyrestart (FILE * input_file )
1718 if ( ! YY_CURRENT_BUFFER ){
1719 yyensure_buffer_stack ();
1720 YY_CURRENT_BUFFER_LVALUE =
1721 yy_create_buffer(yyin,YY_BUF_SIZE );
1724 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1725 yy_load_buffer_state( );
1728 /** Switch to a different input buffer.
1729 * @param new_buffer The new input buffer.
1732 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1735 /* TODO. We should be able to replace this entire function body
1737 * yypop_buffer_state();
1738 * yypush_buffer_state(new_buffer);
1740 yyensure_buffer_stack ();
1741 if ( YY_CURRENT_BUFFER == new_buffer )
1744 if ( YY_CURRENT_BUFFER )
1746 /* Flush out information for old buffer. */
1747 *(yy_c_buf_p) = (yy_hold_char);
1748 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1749 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1752 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1753 yy_load_buffer_state( );
1755 /* We don't actually know whether we did this switch during
1756 * EOF (yywrap()) processing, but the only time this flag
1757 * is looked at is after yywrap() is called, so it's safe
1758 * to go ahead and always set it.
1760 (yy_did_buffer_switch_on_eof) = 1;
1763 static void yy_load_buffer_state (void)
1765 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1766 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1767 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1768 (yy_hold_char) = *(yy_c_buf_p);
1771 /** Allocate and initialize an input buffer state.
1772 * @param file A readable stream.
1773 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1775 * @return the allocated buffer state.
1777 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1781 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1783 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1785 b->yy_buf_size = size;
1787 /* yy_ch_buf has to be 2 characters longer than the size given because
1788 * we need to put in 2 end-of-buffer characters.
1790 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1791 if ( ! b->yy_ch_buf )
1792 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1794 b->yy_is_our_buffer = 1;
1796 yy_init_buffer(b,file );
1801 /** Destroy the buffer.
1802 * @param b a buffer created with yy_create_buffer()
1805 void yy_delete_buffer (YY_BUFFER_STATE b )
1811 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1812 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1814 if ( b->yy_is_our_buffer )
1815 yyfree((void *) b->yy_ch_buf );
1817 yyfree((void *) b );
1821 extern int isatty (int );
1822 #endif /* __cplusplus */
1824 /* Initializes or reinitializes a buffer.
1825 * This function is sometimes called more than once on the same buffer,
1826 * such as during a yyrestart() or at EOF.
1828 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1833 yy_flush_buffer(b );
1835 b->yy_input_file = file;
1836 b->yy_fill_buffer = 1;
1838 /* If b is the current buffer, then yy_init_buffer was _probably_
1839 * called from yyrestart() or through yy_get_next_buffer.
1840 * In that case, we don't want to reset the lineno or column.
1842 if (b != YY_CURRENT_BUFFER){
1843 b->yy_bs_lineno = 1;
1844 b->yy_bs_column = 0;
1847 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1852 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1853 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1856 void yy_flush_buffer (YY_BUFFER_STATE b )
1863 /* We always need two end-of-buffer characters. The first causes
1864 * a transition to the end-of-buffer state. The second causes
1865 * a jam in that state.
1867 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1868 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1870 b->yy_buf_pos = &b->yy_ch_buf[0];
1873 b->yy_buffer_status = YY_BUFFER_NEW;
1875 if ( b == YY_CURRENT_BUFFER )
1876 yy_load_buffer_state( );
1879 /** Pushes the new state onto the stack. The new state becomes
1880 * the current state. This function will allocate the stack
1882 * @param new_buffer The new state.
1885 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1887 if (new_buffer == NULL)
1890 yyensure_buffer_stack();
1892 /* This block is copied from yy_switch_to_buffer. */
1893 if ( YY_CURRENT_BUFFER )
1895 /* Flush out information for old buffer. */
1896 *(yy_c_buf_p) = (yy_hold_char);
1897 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1898 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1901 /* Only push if top exists. Otherwise, replace top. */
1902 if (YY_CURRENT_BUFFER)
1903 (yy_buffer_stack_top)++;
1904 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1906 /* copied from yy_switch_to_buffer. */
1907 yy_load_buffer_state( );
1908 (yy_did_buffer_switch_on_eof) = 1;
1911 /** Removes and deletes the top of the stack, if present.
1912 * The next element becomes the new top.
1915 void yypop_buffer_state (void)
1917 if (!YY_CURRENT_BUFFER)
1920 yy_delete_buffer(YY_CURRENT_BUFFER );
1921 YY_CURRENT_BUFFER_LVALUE = NULL;
1922 if ((yy_buffer_stack_top) > 0)
1923 --(yy_buffer_stack_top);
1925 if (YY_CURRENT_BUFFER) {
1926 yy_load_buffer_state( );
1927 (yy_did_buffer_switch_on_eof) = 1;
1931 /* Allocates the stack if it does not exist.
1932 * Guarantees space for at least one push.
1934 static void yyensure_buffer_stack (void)
1938 if (!(yy_buffer_stack)) {
1940 /* First allocation is just for 2 elements, since we don't know if this
1941 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1942 * immediate realloc on the next call.
1945 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1946 (num_to_alloc * sizeof(struct yy_buffer_state*)
1948 if ( ! (yy_buffer_stack) )
1949 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1951 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1953 (yy_buffer_stack_max) = num_to_alloc;
1954 (yy_buffer_stack_top) = 0;
1958 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1960 /* Increase the buffer to prepare for a possible push. */
1961 int grow_size = 8 /* arbitrary grow size */;
1963 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1964 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1966 num_to_alloc * sizeof(struct yy_buffer_state*)
1968 if ( ! (yy_buffer_stack) )
1969 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1971 /* zero only the new slots.*/
1972 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1973 (yy_buffer_stack_max) = num_to_alloc;
1977 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1978 * @param base the character buffer
1979 * @param size the size in bytes of the character buffer
1981 * @return the newly allocated buffer state object.
1983 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1988 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1989 base[size-1] != YY_END_OF_BUFFER_CHAR )
1990 /* They forgot to leave room for the EOB's. */
1993 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1995 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1997 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1998 b->yy_buf_pos = b->yy_ch_buf = base;
1999 b->yy_is_our_buffer = 0;
2000 b->yy_input_file = 0;
2001 b->yy_n_chars = b->yy_buf_size;
2002 b->yy_is_interactive = 0;
2004 b->yy_fill_buffer = 0;
2005 b->yy_buffer_status = YY_BUFFER_NEW;
2007 yy_switch_to_buffer(b );
2012 /** Setup the input buffer state to scan a string. The next call to yylex() will
2013 * scan from a @e copy of @a str.
2014 * @param yystr a NUL-terminated string to scan
2016 * @return the newly allocated buffer state object.
2017 * @note If you want to scan bytes that may contain NUL values, then use
2018 * yy_scan_bytes() instead.
2020 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2023 return yy_scan_bytes(yystr,strlen(yystr) );
2026 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2027 * scan from a @e copy of @a bytes.
2028 * @param yybytes the byte buffer to scan
2029 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2031 * @return the newly allocated buffer state object.
2033 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
2040 /* Get memory for full buffer, including space for trailing EOB's. */
2041 n = _yybytes_len + 2;
2042 buf = (char *) yyalloc(n );
2044 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2046 for ( i = 0; i < _yybytes_len; ++i )
2047 buf[i] = yybytes[i];
2049 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2051 b = yy_scan_buffer(buf,n );
2053 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2055 /* It's okay to grow etc. this buffer, and we should throw it
2056 * away when we're done.
2058 b->yy_is_our_buffer = 1;
2063 static void yy_push_state (int new_state )
2065 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
2069 (yy_start_stack_depth) += YY_START_STACK_INCR;
2070 new_size = (yy_start_stack_depth) * sizeof( int );
2072 if ( ! (yy_start_stack) )
2073 (yy_start_stack) = (int *) yyalloc(new_size );
2076 (yy_start_stack) = (int *) yyrealloc((void *) (yy_start_stack),new_size );
2078 if ( ! (yy_start_stack) )
2079 YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2082 (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
2087 static void yy_pop_state (void)
2089 if ( --(yy_start_stack_ptr) < 0 )
2090 YY_FATAL_ERROR( "start-condition stack underflow" );
2092 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
2095 static int yy_top_state (void)
2097 return (yy_start_stack)[(yy_start_stack_ptr) - 1];
2100 #ifndef YY_EXIT_FAILURE
2101 #define YY_EXIT_FAILURE 2
2104 static void yy_fatal_error (yyconst char* msg )
2106 (void) fprintf( stderr, "%s\n", msg );
2107 exit( YY_EXIT_FAILURE );
2110 /* Redefine yyless() so it works in section 3 code. */
2116 /* Undo effects of setting up yytext. */ \
2117 int yyless_macro_arg = (n); \
2118 YY_LESS_LINENO(yyless_macro_arg);\
2119 yytext[yyleng] = (yy_hold_char); \
2120 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2121 (yy_hold_char) = *(yy_c_buf_p); \
2122 *(yy_c_buf_p) = '\0'; \
2123 yyleng = yyless_macro_arg; \
2127 /* Accessor methods (get/set functions) to struct members. */
2129 /** Get the current line number.
2132 int yyget_lineno (void)
2138 /** Get the input stream.
2141 FILE *yyget_in (void)
2146 /** Get the output stream.
2149 FILE *yyget_out (void)
2154 /** Get the length of the current token.
2157 int yyget_leng (void)
2162 /** Get the current token.
2166 char *yyget_text (void)
2171 /** Set the current line number.
2172 * @param line_number
2175 void yyset_lineno (int line_number )
2178 yylineno = line_number;
2181 /** Set the input stream. This does not discard the current
2183 * @param in_str A readable stream.
2185 * @see yy_switch_to_buffer
2187 void yyset_in (FILE * in_str )
2192 void yyset_out (FILE * out_str )
2197 int yyget_debug (void)
2199 return yy_flex_debug;
2202 void yyset_debug (int bdebug )
2204 yy_flex_debug = bdebug ;
2207 static int yy_init_globals (void)
2209 /* Initialization is the same as for the non-reentrant scanner.
2210 * This function is called from yylex_destroy(), so don't allocate here.
2213 /* We do not touch yylineno unless the option is enabled. */
2216 (yy_buffer_stack) = 0;
2217 (yy_buffer_stack_top) = 0;
2218 (yy_buffer_stack_max) = 0;
2219 (yy_c_buf_p) = (char *) 0;
2223 (yy_start_stack_ptr) = 0;
2224 (yy_start_stack_depth) = 0;
2225 (yy_start_stack) = NULL;
2227 /* Defined in main.c */
2236 /* For future reference: Set errno on error, since we are called by
2242 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2243 int yylex_destroy (void)
2246 /* Pop the buffer stack, destroying each element. */
2247 while(YY_CURRENT_BUFFER){
2248 yy_delete_buffer(YY_CURRENT_BUFFER );
2249 YY_CURRENT_BUFFER_LVALUE = NULL;
2250 yypop_buffer_state();
2253 /* Destroy the stack itself. */
2254 yyfree((yy_buffer_stack) );
2255 (yy_buffer_stack) = NULL;
2257 /* Destroy the start condition stack. */
2258 yyfree((yy_start_stack) );
2259 (yy_start_stack) = NULL;
2261 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2262 * yylex() is called, initialization will occur. */
2269 * Internal utility routines.
2273 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2276 for ( i = 0; i < n; ++i )
2281 #ifdef YY_NEED_STRLEN
2282 static int yy_flex_strlen (yyconst char * s )
2285 for ( n = 0; s[n]; ++n )
2292 void *yyalloc (yy_size_t size )
2294 return (void *) malloc( size );
2297 void *yyrealloc (void * ptr, yy_size_t size )
2299 /* The cast to (char *) in the following accommodates both
2300 * implementations that use char* generic pointers, and those
2301 * that use void* generic pointers. It works with the latter
2302 * because both ANSI C and C++ allow castless assignment from
2303 * any pointer type to void*, and deal with argument conversions
2304 * as though doing an assignment.
2306 return (void *) realloc( (char *) ptr, size );
2309 void yyfree (void * ptr )
2311 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2314 #define YYTABLES_NAME "yytables"
2316 #line 147 "../../src/scanner.ll"
2321 Otherwise '\n' within a TOK_MLSTRING would not be counted
2324 update_count_line (char *str)
2329 for (p = str; *p; ++p)
2331 ++gengetopt_count_line;
2332 tokenpos = 0 ; /* reset token position */
2333 strncpy (linebuf, ( (p+1) ? p+1 : ""), LINEBUF_LEN - 1);
2338 ++gengetopt_count_line;
2339 tokenpos = 0 ; /* reset token position */
2340 strncpy (linebuf, yytext+1, LINEBUF_LEN - 1); /* save the next line */
2345 updateTokenInfo( int pos )
2350 tokenpos += yyleng ;
2353 void buffer(const char *s)
2358 char *flush_buffer()
2360 char *ret = strdup(buff.str().c_str());