1 #line 2 "scripts/genksyms/lex.c"
3 #line 4 "scripts/genksyms/lex.c"
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 33
13 #if YY_FLEX_SUBMINOR_VERSION > 0
28 /* First, we deal with platform-specific or compiler-specific issues. */
30 /* begin standard C headers. */
38 /* %if-tables-serialization */
40 /* end standard C headers. */
43 /* flex integer type definitions */
48 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
50 #if __STDC_VERSION__ >= 199901L
52 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
53 * if you want the limit (max/min) macros for int types.
55 #ifndef __STDC_LIMIT_MACROS
56 #define __STDC_LIMIT_MACROS 1
60 typedef int8_t flex_int8_t;
61 typedef uint8_t flex_uint8_t;
62 typedef int16_t flex_int16_t;
63 typedef uint16_t flex_uint16_t;
64 typedef int32_t flex_int32_t;
65 typedef uint32_t flex_uint32_t;
67 typedef signed char flex_int8_t;
68 typedef short int flex_int16_t;
69 typedef int flex_int32_t;
70 typedef unsigned char flex_uint8_t;
71 typedef unsigned short int flex_uint16_t;
72 typedef unsigned int flex_uint32_t;
75 /* Limits of integral types. */
77 #define INT8_MIN (-128)
80 #define INT16_MIN (-32767-1)
83 #define INT32_MIN (-2147483647-1)
86 #define INT8_MAX (127)
89 #define INT16_MAX (32767)
92 #define INT32_MAX (2147483647)
95 #define UINT8_MAX (255U)
98 #define UINT16_MAX (65535U)
101 #define UINT32_MAX (4294967295U)
104 #endif /* ! FLEXINT_H */
113 /* The "const" storage-class-modifier is valid. */
116 #else /* ! __cplusplus */
122 #endif /* __STDC__ */
123 #endif /* ! __cplusplus */
126 #define yyconst const
131 /* %not-for-header */
133 /* Returned upon end-of-file. */
137 /* %not-for-header */
139 /* Promotes a possibly negative, possibly signed char to an unsigned
140 * integer for use as an array index. If the signed char is negative,
141 * we want to instead treat it as an 8-bit unsigned char, hence the
144 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
150 /* %if-not-reentrant */
154 /* Enter a start condition. This macro really ought to take a parameter,
155 * but we do it the disgusting crufty way forced on us by the ()-less
156 * definition of BEGIN.
158 #define BEGIN (yy_start) = 1 + 2 *
160 /* Translate the current start state into a value that can be later handed
161 * to BEGIN to return to the state. The YYSTATE alias is for lex
164 #define YY_START (((yy_start) - 1) / 2)
165 #define YYSTATE YY_START
167 /* Action number for EOF rule of a given start state. */
168 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
170 /* Special action meaning "start processing a new file". */
171 #define YY_NEW_FILE yyrestart(yyin )
173 #define YY_END_OF_BUFFER_CHAR 0
175 /* Size of default input buffer. */
177 #define YY_BUF_SIZE 16384
180 /* The state buf must be large enough to hold one state per character in the main buffer.
182 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
184 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
185 #define YY_TYPEDEF_YY_BUFFER_STATE
186 typedef struct yy_buffer_state *YY_BUFFER_STATE;
189 /* %if-not-reentrant */
194 /* %if-not-reentrant */
195 extern FILE *yyin, *yyout;
199 #define EOB_ACT_CONTINUE_SCAN 0
200 #define EOB_ACT_END_OF_FILE 1
201 #define EOB_ACT_LAST_MATCH 2
203 #define YY_LESS_LINENO(n)
205 /* Return all but the first "n" matched characters back to the input stream. */
209 /* Undo effects of setting up yytext. */ \
210 int yyless_macro_arg = (n); \
211 YY_LESS_LINENO(yyless_macro_arg);\
212 *yy_cp = (yy_hold_char); \
213 YY_RESTORE_YY_MORE_OFFSET \
214 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
215 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
219 #define unput(c) yyunput( c, (yytext_ptr) )
221 /* The following is because we cannot portably get our hands on size_t
222 * (without autoconf's help, which isn't available because we want
223 * flex-generated scanners to compile on their own).
226 #ifndef YY_TYPEDEF_YY_SIZE_T
227 #define YY_TYPEDEF_YY_SIZE_T
228 typedef unsigned int yy_size_t;
231 #ifndef YY_STRUCT_YY_BUFFER_STATE
232 #define YY_STRUCT_YY_BUFFER_STATE
233 struct yy_buffer_state
242 char *yy_ch_buf; /* input buffer */
243 char *yy_buf_pos; /* current position in input buffer */
245 /* Size of input buffer in bytes, not including room for EOB
248 yy_size_t yy_buf_size;
250 /* Number of characters read into yy_ch_buf, not including EOB
255 /* Whether we "own" the buffer - i.e., we know we created it,
256 * and can realloc() it to grow it, and should free() it to
259 int yy_is_our_buffer;
261 /* Whether this is an "interactive" input source; if so, and
262 * if we're using stdio for input, then we want to use getc()
263 * instead of fread(), to make sure we stop fetching input after
266 int yy_is_interactive;
268 /* Whether we're considered to be at the beginning of a line.
269 * If so, '^' rules will be active on the next match, otherwise
274 int yy_bs_lineno; /**< The line count. */
275 int yy_bs_column; /**< The column count. */
277 /* Whether to try to fill the input buffer when we reach the
282 int yy_buffer_status;
284 #define YY_BUFFER_NEW 0
285 #define YY_BUFFER_NORMAL 1
286 /* When an EOF's been seen but there's still some text to process
287 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
288 * shouldn't try reading from the input source any more. We might
289 * still have a bunch of tokens to match, though, because of
290 * possible backing-up.
292 * When we actually see the EOF, we change the status to "new"
293 * (via yyrestart()), so that the user can continue scanning by
294 * just pointing yyin at a new input file.
296 #define YY_BUFFER_EOF_PENDING 2
299 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
301 /* %if-c-only Standard (non-C++) definition */
302 /* %not-for-header */
304 /* %if-not-reentrant */
306 /* Stack of input buffers. */
307 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
308 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
309 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
315 /* We provide macros for accessing buffer states in case in the
316 * future we want to put the buffer states in a more general
319 * Returns the top of the stack, or NULL.
321 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
322 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
325 /* Same as previous macro, but useful when we know that the buffer stack is not
326 * NULL or when we need an lvalue. For internal use only.
328 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
330 /* %if-c-only Standard (non-C++) definition */
332 /* %if-not-reentrant */
333 /* %not-for-header */
335 /* yy_hold_char holds the character lost when yytext is formed. */
336 static char yy_hold_char;
337 static int yy_n_chars; /* number of characters read into yy_ch_buf */
340 /* Points to current character in buffer. */
341 static char *yy_c_buf_p = (char *) 0;
342 static int yy_init = 0; /* whether we need to initialize */
343 static int yy_start = 0; /* start state number */
345 /* Flag which is used to allow yywrap()'s to do buffer switches
346 * instead of setting up a fresh yyin. A bit of a hack ...
348 static int yy_did_buffer_switch_on_eof;
353 void yyrestart (FILE *input_file );
354 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
355 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
356 void yy_delete_buffer (YY_BUFFER_STATE b );
357 void yy_flush_buffer (YY_BUFFER_STATE b );
358 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
359 void yypop_buffer_state (void );
361 static void yyensure_buffer_stack (void );
362 static void yy_load_buffer_state (void );
363 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
365 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
367 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
368 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
369 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
373 void *yyalloc (yy_size_t );
374 void *yyrealloc (void *,yy_size_t );
375 void yyfree (void * );
377 #define yy_new_buffer yy_create_buffer
379 #define yy_set_interactive(is_interactive) \
381 if ( ! YY_CURRENT_BUFFER ){ \
382 yyensure_buffer_stack (); \
383 YY_CURRENT_BUFFER_LVALUE = \
384 yy_create_buffer(yyin,YY_BUF_SIZE ); \
386 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
389 #define yy_set_bol(at_bol) \
391 if ( ! YY_CURRENT_BUFFER ){\
392 yyensure_buffer_stack (); \
393 YY_CURRENT_BUFFER_LVALUE = \
394 yy_create_buffer(yyin,YY_BUF_SIZE ); \
396 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
399 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
401 /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
402 /* Begin user sect3 */
405 #define YY_SKIP_YYWRAP
409 typedef unsigned char YY_CHAR;
411 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
413 typedef int yy_state_type;
420 #define yytext_ptr yytext
422 /* %if-c-only Standard (non-C++) definition */
424 static yy_state_type yy_get_previous_state (void );
425 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
426 static int yy_get_next_buffer (void );
427 static void yy_fatal_error (yyconst char msg[] );
431 /* Done after the current pattern has been matched and before the
432 * corresponding action - sets up yytext.
434 #define YY_DO_BEFORE_ACTION \
435 (yytext_ptr) = yy_bp; \
436 /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
437 yyleng = (size_t) (yy_cp - yy_bp); \
438 (yy_hold_char) = *yy_cp; \
440 /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
441 (yy_c_buf_p) = yy_cp;
443 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
444 #define YY_NUM_RULES 13
445 #define YY_END_OF_BUFFER 14
446 /* This struct is not used in this scanner,
447 but its presence is necessary. */
450 flex_int32_t yy_verify;
453 static yyconst flex_int16_t yy_accept[76] =
455 0, 0, 0, 0, 14, 12, 4, 3, 12, 7,
456 12, 12, 7, 12, 12, 12, 12, 12, 9, 9,
457 12, 12, 12, 4, 0, 5, 0, 7, 0, 6,
458 0, 0, 0, 0, 0, 0, 2, 8, 10, 10,
459 9, 0, 0, 9, 9, 0, 9, 0, 0, 11,
460 0, 0, 0, 10, 0, 10, 9, 9, 0, 0,
461 0, 0, 0, 0, 0, 10, 10, 0, 0, 0,
465 static yyconst flex_int32_t yy_ec[256] =
467 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
468 4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 2, 1, 5, 6, 7, 8, 9, 10, 1,
471 1, 8, 11, 1, 12, 13, 8, 14, 15, 15,
472 15, 15, 15, 15, 15, 16, 16, 1, 1, 17,
473 18, 19, 1, 1, 20, 20, 20, 20, 21, 22,
474 7, 7, 7, 7, 7, 23, 7, 7, 7, 7,
475 7, 7, 7, 7, 24, 7, 7, 25, 7, 7,
476 1, 26, 1, 8, 7, 1, 20, 20, 20, 20,
478 21, 22, 7, 7, 7, 7, 7, 27, 7, 7,
479 7, 7, 7, 7, 7, 7, 24, 7, 7, 25,
480 7, 7, 1, 28, 1, 8, 1, 1, 1, 1,
481 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
482 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
483 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
484 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
485 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
486 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
487 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
489 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
490 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
491 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
492 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
493 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
497 static yyconst flex_int32_t yy_meta[29] =
499 1, 1, 2, 1, 1, 1, 3, 1, 1, 1,
500 4, 4, 5, 6, 6, 6, 1, 1, 1, 7,
501 8, 7, 3, 3, 3, 1, 3, 1
504 static yyconst flex_int16_t yy_base[88] =
506 0, 147, 21, 140, 145, 284, 39, 284, 26, 0,
507 32, 126, 40, 44, 115, 35, 36, 46, 50, 53,
508 39, 61, 54, 79, 65, 284, 0, 0, 66, 284,
509 0, 119, 79, 75, 123, 104, 284, 284, 107, 0,
510 79, 73, 76, 76, 66, 0, 0, 85, 86, 284,
511 133, 83, 91, 284, 99, 147, 284, 114, 122, 70,
512 107, 141, 172, 151, 135, 181, 284, 137, 114, 157,
513 149, 48, 45, 284, 284, 208, 214, 222, 230, 238,
514 246, 250, 255, 256, 261, 267, 275
517 static yyconst flex_int16_t yy_def[88] =
519 75, 1, 1, 3, 75, 75, 75, 75, 76, 77,
520 78, 75, 77, 79, 75, 75, 75, 75, 75, 19,
521 75, 75, 75, 75, 76, 75, 80, 77, 78, 75,
522 81, 75, 76, 78, 79, 79, 75, 75, 75, 39,
523 19, 82, 83, 75, 75, 84, 20, 76, 78, 75,
524 79, 51, 85, 75, 75, 75, 75, 84, 79, 51,
525 79, 79, 79, 51, 75, 75, 75, 86, 79, 63,
526 86, 87, 87, 75, 0, 75, 75, 75, 75, 75,
527 75, 75, 75, 75, 75, 75, 75
530 static yyconst flex_int16_t yy_nxt[313] =
532 6, 7, 8, 7, 9, 6, 10, 6, 6, 11,
533 6, 6, 12, 6, 6, 6, 6, 6, 6, 10,
534 10, 10, 13, 10, 10, 6, 10, 6, 15, 16,
535 26, 15, 17, 18, 19, 20, 20, 21, 15, 22,
536 24, 30, 24, 38, 33, 36, 37, 74, 23, 34,
537 74, 27, 38, 38, 38, 38, 38, 31, 32, 39,
538 39, 39, 40, 41, 41, 42, 47, 47, 47, 26,
539 43, 38, 44, 45, 46, 30, 44, 75, 38, 38,
540 24, 38, 24, 26, 30, 40, 55, 55, 57, 26,
541 27, 31, 57, 43, 35, 30, 64, 64, 64, 57,
543 31, 65, 65, 75, 27, 36, 37, 35, 59, 37,
544 27, 31, 56, 56, 56, 59, 37, 51, 52, 52,
545 39, 39, 39, 59, 37, 37, 68, 53, 54, 54,
546 69, 50, 38, 54, 59, 37, 44, 45, 32, 37,
547 44, 35, 59, 37, 75, 14, 60, 60, 66, 66,
548 66, 37, 14, 72, 75, 61, 62, 63, 59, 61,
549 56, 56, 56, 69, 64, 64, 64, 69, 67, 67,
550 75, 75, 75, 67, 37, 35, 75, 75, 75, 61,
551 62, 75, 75, 61, 75, 70, 70, 70, 75, 75,
552 75, 70, 70, 70, 66, 66, 66, 75, 75, 75,
554 75, 75, 54, 54, 75, 75, 75, 54, 25, 25,
555 25, 25, 25, 25, 25, 25, 28, 75, 75, 28,
556 28, 28, 29, 29, 29, 29, 29, 29, 29, 29,
557 35, 35, 35, 35, 35, 35, 35, 35, 48, 75,
558 48, 48, 48, 48, 48, 48, 49, 75, 49, 49,
559 49, 49, 49, 49, 42, 42, 75, 42, 56, 75,
560 56, 58, 58, 58, 66, 75, 66, 71, 71, 71,
561 71, 71, 71, 71, 71, 73, 73, 73, 73, 73,
562 73, 73, 73, 5, 75, 75, 75, 75, 75, 75,
563 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
565 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
569 static yyconst flex_int16_t yy_chk[313] =
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, 3, 3,
574 9, 3, 3, 3, 3, 3, 3, 3, 3, 3,
575 7, 11, 7, 16, 13, 14, 14, 73, 3, 13,
576 72, 9, 16, 17, 17, 21, 21, 11, 18, 18,
577 18, 18, 19, 19, 19, 19, 20, 20, 20, 25,
578 19, 23, 19, 19, 19, 29, 19, 20, 22, 22,
579 24, 23, 24, 33, 34, 42, 43, 43, 45, 48,
580 25, 29, 45, 42, 60, 49, 52, 52, 52, 44,
582 34, 53, 53, 41, 33, 36, 36, 52, 61, 61,
583 48, 49, 55, 55, 55, 69, 69, 36, 36, 36,
584 39, 39, 39, 59, 59, 35, 59, 39, 39, 39,
585 61, 32, 15, 39, 51, 51, 58, 58, 12, 68,
586 58, 68, 62, 62, 5, 4, 51, 51, 65, 65,
587 65, 71, 2, 71, 0, 51, 51, 51, 70, 51,
588 56, 56, 56, 62, 64, 64, 64, 62, 56, 56,
589 0, 0, 0, 56, 63, 64, 0, 0, 0, 70,
590 70, 0, 0, 70, 0, 63, 63, 63, 0, 0,
591 0, 63, 63, 63, 66, 66, 66, 0, 0, 0,
593 0, 0, 66, 66, 0, 0, 0, 66, 76, 76,
594 76, 76, 76, 76, 76, 76, 77, 0, 0, 77,
595 77, 77, 78, 78, 78, 78, 78, 78, 78, 78,
596 79, 79, 79, 79, 79, 79, 79, 79, 80, 0,
597 80, 80, 80, 80, 80, 80, 81, 0, 81, 81,
598 81, 81, 81, 81, 82, 82, 0, 82, 83, 0,
599 83, 84, 84, 84, 85, 0, 85, 86, 86, 86,
600 86, 86, 86, 86, 86, 87, 87, 87, 87, 87,
601 87, 87, 87, 75, 75, 75, 75, 75, 75, 75,
602 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
604 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
608 static yy_state_type yy_last_accepting_state;
609 static char *yy_last_accepting_cpos;
611 extern int yy_flex_debug;
612 int yy_flex_debug = 1;
614 static yyconst flex_int16_t yy_rule_linenum[13] =
616 69, 70, 71, 74, 77, 78, 79, 85, 86, 87,
620 /* The intent behind this definition is that it'll catch
621 * any uses of REJECT which flex missed.
623 #define REJECT reject_used_but_not_detected
624 #define yymore() yymore_used_but_not_detected
625 #define YY_MORE_ADJ 0
626 #define YY_RESTORE_YY_MORE_OFFSET
628 #line 1 "scripts/genksyms/lex.l"
629 /* Lexical analysis for genksyms.
630 Copyright 1996, 1997 Linux International.
632 New implementation contributed by Richard Henderson <rth@tamu.edu>
633 Based on original work by Bjorn Ekwall <bj0rn@blox.se>
635 Taken from Linux modutils 2.4.22.
637 This program is free software; you can redistribute it and/or modify it
638 under the terms of the GNU General Public License as published by the
639 Free Software Foundation; either version 2 of the License, or (at your
640 option) any later version.
642 This program is distributed in the hope that it will be useful, but
643 WITHOUT ANY WARRANTY; without even the implied warranty of
644 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
645 General Public License for more details.
647 You should have received a copy of the GNU General Public License
648 along with this program; if not, write to the Free Software Foundation,
649 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
650 #line 25 "scripts/genksyms/lex.l"
657 #include "genksyms.h"
660 /* We've got a two-level lexer here. We let flex do basic tokenization
661 and then we categorize those basic tokens in the second stage. */
662 #define YY_DECL static int yylex1(void)
664 /* Version 2 checksumming does proper tokenization; version 1 wasn't
665 quite so pedantic. */
667 /* We don't do multiple input files. */
668 #line 669 "scripts/genksyms/lex.c"
673 #ifndef YY_NO_UNISTD_H
674 /* Special case for "unistd.h", since it is non-ANSI. We include it way
675 * down here because we want the user's section 1 to have been scanned first.
676 * The user has a chance to override it with an option.
685 #ifndef YY_EXTRA_TYPE
686 #define YY_EXTRA_TYPE void *
689 /* %if-c-only Reentrant structure and macros (non-C++). */
693 static int yy_init_globals (void );
698 /* %if-bison-bridge */
700 /* %endif End reentrant structures and macros. */
702 /* Macros after this point can all be overridden by user definitions in
706 #ifndef YY_SKIP_YYWRAP
708 extern "C" int yywrap (void );
710 extern int yywrap (void );
714 /* %not-for-header */
716 static void yyunput (int c,char *buf_ptr );
723 static void yy_flex_strncpy (char *,yyconst char *,int );
726 #ifdef YY_NEED_STRLEN
727 static int yy_flex_strlen (yyconst char * );
731 /* %if-c-only Standard (non-C++) definition */
732 /* %not-for-header */
735 static int yyinput (void );
737 static int input (void );
748 /* Amount of stuff to slurp up with each read. */
749 #ifndef YY_READ_BUF_SIZE
750 #define YY_READ_BUF_SIZE 8192
753 /* Copy whatever the last rule matched to the standard output. */
755 /* %if-c-only Standard (non-C++) definition */
756 /* This used to be an fputs(), but since the string might contain NUL's,
757 * we now use fwrite().
759 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
761 /* %if-c++-only C++ definition */
765 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
766 * is returned in "result".
769 #define YY_INPUT(buf,result,max_size) \
770 /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
771 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
775 for ( n = 0; n < max_size && \
776 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
779 buf[n++] = (char) c; \
780 if ( c == EOF && ferror( yyin ) ) \
781 YY_FATAL_ERROR( "input in flex scanner failed" ); \
787 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
789 if( errno != EINTR) \
791 YY_FATAL_ERROR( "input in flex scanner failed" ); \
799 /* %if-c++-only C++ definition \ */\
804 /* No semi-colon after return; correct usage is to write "yyterminate();" -
805 * we don't want an extra ';' after the "return" because that will cause
806 * some compilers to complain about unreachable statements.
809 #define yyterminate() return YY_NULL
812 /* Number of entries by which start-condition stack grows. */
813 #ifndef YY_START_STACK_INCR
814 #define YY_START_STACK_INCR 25
817 /* Report a fatal error. */
818 #ifndef YY_FATAL_ERROR
820 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
826 /* %if-tables-serialization structures and prototypes */
827 /* %not-for-header */
831 /* %not-for-header */
833 /* %tables-yydmap generated elements */
835 /* end tables serialization structures and prototypes */
839 /* Default declaration of generated scanner - a define so the user can
840 * easily add parameters.
843 #define YY_DECL_IS_OURS 1
844 /* %if-c-only Standard (non-C++) definition */
846 extern int yylex (void);
848 #define YY_DECL int yylex (void)
850 /* %if-c++-only C++ definition */
852 #endif /* !YY_DECL */
854 /* Code executed at the beginning of each rule, after yytext and yyleng
857 #ifndef YY_USER_ACTION
858 #define YY_USER_ACTION
861 /* Code executed at the end of each rule. */
863 #define YY_BREAK break;
866 /* %% [6.0] YY_RULE_SETUP definition goes here */
867 #define YY_RULE_SETUP \
869 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
870 (yytext[yyleng - 1] == '\n'); \
873 /* %not-for-header */
875 /** The main scanner function which does all the work.
879 register yy_state_type yy_current_state;
880 register char *yy_cp, *yy_bp;
883 /* %% [7.0] user's declarations go here */
884 #line 65 "scripts/genksyms/lex.l"
888 /* Keep track of our location in the original source files. */
889 #line 890 "scripts/genksyms/lex.c"
900 (yy_start) = 1; /* first start state */
916 if ( ! YY_CURRENT_BUFFER ) {
917 yyensure_buffer_stack ();
918 YY_CURRENT_BUFFER_LVALUE =
919 yy_create_buffer(yyin,YY_BUF_SIZE );
922 yy_load_buffer_state( );
925 while ( 1 ) /* loops until end-of-file is reached */
927 /* %% [8.0] yymore()-related code goes here */
928 yy_cp = (yy_c_buf_p);
930 /* Support of yytext. */
931 *yy_cp = (yy_hold_char);
933 /* yy_bp points to the position in yy_ch_buf of the start of
938 /* %% [9.0] code to set up and find next match goes here */
939 yy_current_state = (yy_start);
940 yy_current_state += YY_AT_BOL();
944 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
945 if ( yy_accept[yy_current_state] )
947 (yy_last_accepting_state) = yy_current_state;
948 (yy_last_accepting_cpos) = yy_cp;
950 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
952 yy_current_state = (int) yy_def[yy_current_state];
953 if ( yy_current_state >= 76 )
954 yy_c = yy_meta[(unsigned int) yy_c];
956 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
959 while ( yy_base[yy_current_state] != 284 );
962 /* %% [10.0] code to find the action number goes here */
963 yy_act = yy_accept[yy_current_state];
965 { /* have to back up */
966 yy_cp = (yy_last_accepting_cpos);
967 yy_current_state = (yy_last_accepting_state);
968 yy_act = yy_accept[yy_current_state];
973 /* %% [11.0] code for yylineno update goes here */
975 do_action: /* This label is used only to access EOF actions. */
977 /* %% [12.0] debug code goes here */
981 fprintf( stderr, "--scanner backing up\n" );
982 else if ( yy_act < 13 )
983 fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
984 (long)yy_rule_linenum[yy_act], yytext );
985 else if ( yy_act == 13 )
986 fprintf( stderr, "--accepting default rule (\"%s\")\n",
988 else if ( yy_act == 14 )
989 fprintf( stderr, "--(end of buffer or a NUL)\n" );
991 fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
995 { /* beginning of action switch */
996 /* %% [13.0] actions go here */
997 case 0: /* must back up */
998 /* undo the effects of YY_DO_BEFORE_ACTION */
999 *yy_cp = (yy_hold_char);
1000 yy_cp = (yy_last_accepting_cpos);
1001 yy_current_state = (yy_last_accepting_state);
1002 goto yy_find_action;
1005 /* rule 1 can match eol */
1007 #line 69 "scripts/genksyms/lex.l"
1011 /* rule 2 can match eol */
1013 #line 70 "scripts/genksyms/lex.l"
1017 /* rule 3 can match eol */
1019 #line 71 "scripts/genksyms/lex.l"
1022 /* Ignore all other whitespace. */
1025 #line 74 "scripts/genksyms/lex.l"
1029 /* rule 5 can match eol */
1031 #line 77 "scripts/genksyms/lex.l"
1035 /* rule 6 can match eol */
1037 #line 78 "scripts/genksyms/lex.l"
1042 #line 79 "scripts/genksyms/lex.l"
1045 /* The Pedant requires that the other C multi-character tokens be
1046 recognized as tokens. We don't actually use them since we don't
1047 parse expressions, but we do want whitespace to be arranged
1048 around them properly. */
1051 #line 85 "scripts/genksyms/lex.l"
1056 #line 86 "scripts/genksyms/lex.l"
1061 #line 87 "scripts/genksyms/lex.l"
1066 #line 89 "scripts/genksyms/lex.l"
1069 /* All other tokens are single characters. */
1072 #line 92 "scripts/genksyms/lex.l"
1077 #line 95 "scripts/genksyms/lex.l"
1080 #line 1081 "scripts/genksyms/lex.c"
1081 case YY_STATE_EOF(INITIAL):
1082 case YY_STATE_EOF(V2_TOKENS):
1085 case YY_END_OF_BUFFER:
1087 /* Amount of text matched not including the EOB char. */
1088 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1090 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1091 *yy_cp = (yy_hold_char);
1092 YY_RESTORE_YY_MORE_OFFSET
1094 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1096 /* We're scanning a new file or input source. It's
1097 * possible that this happened because the user
1098 * just pointed yyin at a new source and called
1099 * yylex(). If so, then we have to assure
1100 * consistency between YY_CURRENT_BUFFER and our
1101 * globals. Here is the right place to do so, because
1102 * this is the first action (other than possibly a
1103 * back-up) that will match for the new input source.
1105 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1106 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1107 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1110 /* Note that here we test for yy_c_buf_p "<=" to the position
1111 * of the first EOB in the buffer, since yy_c_buf_p will
1112 * already have been incremented past the NUL character
1113 * (since all states make transitions on EOB to the
1114 * end-of-buffer state). Contrast this with the test
1117 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1118 { /* This was really a NUL. */
1119 yy_state_type yy_next_state;
1121 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1123 yy_current_state = yy_get_previous_state( );
1125 /* Okay, we're now positioned to make the NUL
1126 * transition. We couldn't have
1127 * yy_get_previous_state() go ahead and do it
1128 * for us because it doesn't know how to deal
1129 * with the possibility of jamming (and we don't
1130 * want to build jamming into it because then it
1131 * will run more slowly).
1134 yy_next_state = yy_try_NUL_trans( yy_current_state );
1136 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1138 if ( yy_next_state )
1140 /* Consume the NUL. */
1141 yy_cp = ++(yy_c_buf_p);
1142 yy_current_state = yy_next_state;
1148 /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1149 yy_cp = (yy_c_buf_p);
1150 goto yy_find_action;
1154 else switch ( yy_get_next_buffer( ) )
1156 case EOB_ACT_END_OF_FILE:
1158 (yy_did_buffer_switch_on_eof) = 0;
1162 /* Note: because we've taken care in
1163 * yy_get_next_buffer() to have set up
1164 * yytext, we can now set up
1165 * yy_c_buf_p so that if some total
1166 * hoser (like flex itself) wants to
1167 * call the scanner after we return the
1168 * YY_NULL, it'll still work - another
1169 * YY_NULL will get returned.
1171 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1173 yy_act = YY_STATE_EOF(YY_START);
1179 if ( ! (yy_did_buffer_switch_on_eof) )
1185 case EOB_ACT_CONTINUE_SCAN:
1187 (yytext_ptr) + yy_amount_of_matched_text;
1189 yy_current_state = yy_get_previous_state( );
1191 yy_cp = (yy_c_buf_p);
1192 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1195 case EOB_ACT_LAST_MATCH:
1197 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1199 yy_current_state = yy_get_previous_state( );
1201 yy_cp = (yy_c_buf_p);
1202 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1203 goto yy_find_action;
1210 "fatal flex scanner internal error--no action found" );
1211 } /* end of action switch */
1212 } /* end of scanning one token */
1213 } /* end of yylex */
1214 /* %ok-for-header */
1217 /* %not-for-header */
1219 /* %ok-for-header */
1223 /* yy_get_next_buffer - try to read in a new buffer
1225 * Returns a code representing an action:
1226 * EOB_ACT_LAST_MATCH -
1227 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1228 * EOB_ACT_END_OF_FILE - end of file
1231 static int yy_get_next_buffer (void)
1236 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1237 register char *source = (yytext_ptr);
1238 register int number_to_move, i;
1241 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1243 "fatal flex scanner internal error--end of buffer missed" );
1245 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1246 { /* Don't try to fill the buffer, so this is an EOF. */
1247 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1249 /* We matched a single character, the EOB, so
1250 * treat this as a final EOF.
1252 return EOB_ACT_END_OF_FILE;
1257 /* We matched some text prior to the EOB, first
1260 return EOB_ACT_LAST_MATCH;
1264 /* Try to read more data. */
1266 /* First move last chars to start of buffer. */
1267 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1269 for ( i = 0; i < number_to_move; ++i )
1270 *(dest++) = *(source++);
1272 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1273 /* don't do the read, it's not guaranteed to return an EOF,
1276 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1281 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1283 while ( num_to_read <= 0 )
1284 { /* Not enough room in the buffer - grow it. */
1286 /* just a shorter name for the current buffer */
1287 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1289 int yy_c_buf_p_offset =
1290 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1292 if ( b->yy_is_our_buffer )
1294 int new_size = b->yy_buf_size * 2;
1296 if ( new_size <= 0 )
1297 b->yy_buf_size += b->yy_buf_size / 8;
1299 b->yy_buf_size *= 2;
1301 b->yy_ch_buf = (char *)
1302 /* Include room in for 2 EOB chars. */
1303 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1306 /* Can't grow it, we don't own it. */
1309 if ( ! b->yy_ch_buf )
1311 "fatal error - scanner input buffer overflow" );
1313 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1315 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1320 if ( num_to_read > YY_READ_BUF_SIZE )
1321 num_to_read = YY_READ_BUF_SIZE;
1323 /* Read in more data. */
1324 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1325 (yy_n_chars), (size_t) num_to_read );
1327 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1330 if ( (yy_n_chars) == 0 )
1332 if ( number_to_move == YY_MORE_ADJ )
1334 ret_val = EOB_ACT_END_OF_FILE;
1340 ret_val = EOB_ACT_LAST_MATCH;
1341 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1342 YY_BUFFER_EOF_PENDING;
1347 ret_val = EOB_ACT_CONTINUE_SCAN;
1349 (yy_n_chars) += number_to_move;
1350 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1351 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1353 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1358 /* yy_get_previous_state - get the state just before the EOB char was reached */
1361 /* %not-for-header */
1363 static yy_state_type yy_get_previous_state (void)
1368 register yy_state_type yy_current_state;
1369 register char *yy_cp;
1371 /* %% [15.0] code to get the start state into yy_current_state goes here */
1372 yy_current_state = (yy_start);
1373 yy_current_state += YY_AT_BOL();
1375 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1377 /* %% [16.0] code to find the next state goes here */
1378 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1379 if ( yy_accept[yy_current_state] )
1381 (yy_last_accepting_state) = yy_current_state;
1382 (yy_last_accepting_cpos) = yy_cp;
1384 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1386 yy_current_state = (int) yy_def[yy_current_state];
1387 if ( yy_current_state >= 76 )
1388 yy_c = yy_meta[(unsigned int) yy_c];
1390 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1393 return yy_current_state;
1396 /* yy_try_NUL_trans - try to make a transition on the NUL character
1399 * next_state = yy_try_NUL_trans( current_state );
1402 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1407 register int yy_is_jam;
1408 /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
1409 register char *yy_cp = (yy_c_buf_p);
1411 register YY_CHAR yy_c = 1;
1412 if ( yy_accept[yy_current_state] )
1414 (yy_last_accepting_state) = yy_current_state;
1415 (yy_last_accepting_cpos) = yy_cp;
1417 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1419 yy_current_state = (int) yy_def[yy_current_state];
1420 if ( yy_current_state >= 76 )
1421 yy_c = yy_meta[(unsigned int) yy_c];
1423 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1424 yy_is_jam = (yy_current_state == 75);
1426 return yy_is_jam ? 0 : yy_current_state;
1431 static void yyunput (int c, register char * yy_bp )
1436 register char *yy_cp;
1438 yy_cp = (yy_c_buf_p);
1440 /* undo effects of setting up yytext */
1441 *yy_cp = (yy_hold_char);
1443 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1444 { /* need to shift things up to make room */
1445 /* +2 for EOB chars. */
1446 register int number_to_move = (yy_n_chars) + 2;
1447 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1448 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1449 register char *source =
1450 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1452 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1453 *--dest = *--source;
1455 yy_cp += (int) (dest - source);
1456 yy_bp += (int) (dest - source);
1457 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1458 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1460 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1461 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1464 *--yy_cp = (char) c;
1466 /* %% [18.0] update yylineno here */
1468 (yytext_ptr) = yy_bp;
1469 (yy_hold_char) = *yy_cp;
1470 (yy_c_buf_p) = yy_cp;
1479 static int yyinput (void)
1481 static int input (void)
1490 *(yy_c_buf_p) = (yy_hold_char);
1492 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1494 /* yy_c_buf_p now points to the character we want to return.
1495 * If this occurs *before* the EOB characters, then it's a
1496 * valid NUL; if not, then we've hit the end of the buffer.
1498 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1499 /* This was really a NUL. */
1500 *(yy_c_buf_p) = '\0';
1503 { /* need more input */
1504 int offset = (yy_c_buf_p) - (yytext_ptr);
1507 switch ( yy_get_next_buffer( ) )
1509 case EOB_ACT_LAST_MATCH:
1510 /* This happens because yy_g_n_b()
1511 * sees that we've accumulated a
1512 * token and flags that we need to
1513 * try matching the token before
1514 * proceeding. But for input(),
1515 * there's no matching to consider.
1516 * So convert the EOB_ACT_LAST_MATCH
1517 * to EOB_ACT_END_OF_FILE.
1520 /* Reset buffer status. */
1525 case EOB_ACT_END_OF_FILE:
1530 if ( ! (yy_did_buffer_switch_on_eof) )
1539 case EOB_ACT_CONTINUE_SCAN:
1540 (yy_c_buf_p) = (yytext_ptr) + offset;
1546 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1547 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1548 (yy_hold_char) = *++(yy_c_buf_p);
1550 /* %% [19.0] update BOL and yylineno */
1551 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1556 #endif /* ifndef YY_NO_INPUT */
1559 /** Immediately switch to a different input stream.
1560 * @param input_file A readable stream.
1562 * @note This function does not reset the start condition to @c INITIAL .
1565 void yyrestart (FILE * input_file )
1571 if ( ! YY_CURRENT_BUFFER ){
1572 yyensure_buffer_stack ();
1573 YY_CURRENT_BUFFER_LVALUE =
1574 yy_create_buffer(yyin,YY_BUF_SIZE );
1577 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1578 yy_load_buffer_state( );
1581 /** Switch to a different input buffer.
1582 * @param new_buffer The new input buffer.
1586 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1592 /* TODO. We should be able to replace this entire function body
1594 * yypop_buffer_state();
1595 * yypush_buffer_state(new_buffer);
1597 yyensure_buffer_stack ();
1598 if ( YY_CURRENT_BUFFER == new_buffer )
1601 if ( YY_CURRENT_BUFFER )
1603 /* Flush out information for old buffer. */
1604 *(yy_c_buf_p) = (yy_hold_char);
1605 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1606 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1609 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1610 yy_load_buffer_state( );
1612 /* We don't actually know whether we did this switch during
1613 * EOF (yywrap()) processing, but the only time this flag
1614 * is looked at is after yywrap() is called, so it's safe
1615 * to go ahead and always set it.
1617 (yy_did_buffer_switch_on_eof) = 1;
1621 static void yy_load_buffer_state (void)
1626 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1627 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1628 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1629 (yy_hold_char) = *(yy_c_buf_p);
1632 /** Allocate and initialize an input buffer state.
1633 * @param file A readable stream.
1634 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1636 * @return the allocated buffer state.
1639 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1646 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1648 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1650 b->yy_buf_size = size;
1652 /* yy_ch_buf has to be 2 characters longer than the size given because
1653 * we need to put in 2 end-of-buffer characters.
1655 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1656 if ( ! b->yy_ch_buf )
1657 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1659 b->yy_is_our_buffer = 1;
1661 yy_init_buffer(b,file );
1666 /** Destroy the buffer.
1667 * @param b a buffer created with yy_create_buffer()
1671 void yy_delete_buffer (YY_BUFFER_STATE b )
1680 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1681 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1683 if ( b->yy_is_our_buffer )
1684 yyfree((void *) b->yy_ch_buf );
1686 yyfree((void *) b );
1692 extern int isatty (int );
1693 #endif /* __cplusplus */
1700 /* Initializes or reinitializes a buffer.
1701 * This function is sometimes called more than once on the same buffer,
1702 * such as during a yyrestart() or at EOF.
1705 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1713 yy_flush_buffer(b );
1715 b->yy_input_file = file;
1716 b->yy_fill_buffer = 1;
1718 /* If b is the current buffer, then yy_init_buffer was _probably_
1719 * called from yyrestart() or through yy_get_next_buffer.
1720 * In that case, we don't want to reset the lineno or column.
1722 if (b != YY_CURRENT_BUFFER){
1723 b->yy_bs_lineno = 1;
1724 b->yy_bs_column = 0;
1729 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1737 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1738 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1742 void yy_flush_buffer (YY_BUFFER_STATE b )
1752 /* We always need two end-of-buffer characters. The first causes
1753 * a transition to the end-of-buffer state. The second causes
1754 * a jam in that state.
1756 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1757 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1759 b->yy_buf_pos = &b->yy_ch_buf[0];
1762 b->yy_buffer_status = YY_BUFFER_NEW;
1764 if ( b == YY_CURRENT_BUFFER )
1765 yy_load_buffer_state( );
1769 /** Pushes the new state onto the stack. The new state becomes
1770 * the current state. This function will allocate the stack
1772 * @param new_buffer The new state.
1776 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1781 if (new_buffer == NULL)
1784 yyensure_buffer_stack();
1786 /* This block is copied from yy_switch_to_buffer. */
1787 if ( YY_CURRENT_BUFFER )
1789 /* Flush out information for old buffer. */
1790 *(yy_c_buf_p) = (yy_hold_char);
1791 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1792 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1795 /* Only push if top exists. Otherwise, replace top. */
1796 if (YY_CURRENT_BUFFER)
1797 (yy_buffer_stack_top)++;
1798 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1800 /* copied from yy_switch_to_buffer. */
1801 yy_load_buffer_state( );
1802 (yy_did_buffer_switch_on_eof) = 1;
1807 /** Removes and deletes the top of the stack, if present.
1808 * The next element becomes the new top.
1812 void yypop_buffer_state (void)
1817 if (!YY_CURRENT_BUFFER)
1820 yy_delete_buffer(YY_CURRENT_BUFFER );
1821 YY_CURRENT_BUFFER_LVALUE = NULL;
1822 if ((yy_buffer_stack_top) > 0)
1823 --(yy_buffer_stack_top);
1825 if (YY_CURRENT_BUFFER) {
1826 yy_load_buffer_state( );
1827 (yy_did_buffer_switch_on_eof) = 1;
1833 /* Allocates the stack if it does not exist.
1834 * Guarantees space for at least one push.
1837 static void yyensure_buffer_stack (void)
1844 if (!(yy_buffer_stack)) {
1846 /* First allocation is just for 2 elements, since we don't know if this
1847 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1848 * immediate realloc on the next call.
1851 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1852 (num_to_alloc * sizeof(struct yy_buffer_state*)
1855 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1857 (yy_buffer_stack_max) = num_to_alloc;
1858 (yy_buffer_stack_top) = 0;
1862 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1864 /* Increase the buffer to prepare for a possible push. */
1865 int grow_size = 8 /* arbitrary grow size */;
1867 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1868 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1870 num_to_alloc * sizeof(struct yy_buffer_state*)
1873 /* zero only the new slots.*/
1874 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1875 (yy_buffer_stack_max) = num_to_alloc;
1881 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1882 * @param base the character buffer
1883 * @param size the size in bytes of the character buffer
1885 * @return the newly allocated buffer state object.
1887 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1892 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1893 base[size-1] != YY_END_OF_BUFFER_CHAR )
1894 /* They forgot to leave room for the EOB's. */
1897 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1899 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1901 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1902 b->yy_buf_pos = b->yy_ch_buf = base;
1903 b->yy_is_our_buffer = 0;
1904 b->yy_input_file = 0;
1905 b->yy_n_chars = b->yy_buf_size;
1906 b->yy_is_interactive = 0;
1908 b->yy_fill_buffer = 0;
1909 b->yy_buffer_status = YY_BUFFER_NEW;
1911 yy_switch_to_buffer(b );
1918 /** Setup the input buffer state to scan a string. The next call to yylex() will
1919 * scan from a @e copy of @a str.
1920 * @param yystr a NUL-terminated string to scan
1922 * @return the newly allocated buffer state object.
1923 * @note If you want to scan bytes that may contain NUL values, then use
1924 * yy_scan_bytes() instead.
1926 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1929 return yy_scan_bytes(yystr,strlen(yystr) );
1934 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1935 * scan from a @e copy of @a bytes.
1936 * @param bytes the byte buffer to scan
1937 * @param len the number of bytes in the buffer pointed to by @a bytes.
1939 * @return the newly allocated buffer state object.
1941 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1948 /* Get memory for full buffer, including space for trailing EOB's. */
1949 n = _yybytes_len + 2;
1950 buf = (char *) yyalloc(n );
1952 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1954 for ( i = 0; i < _yybytes_len; ++i )
1955 buf[i] = yybytes[i];
1957 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1959 b = yy_scan_buffer(buf,n );
1961 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1963 /* It's okay to grow etc. this buffer, and we should throw it
1964 * away when we're done.
1966 b->yy_is_our_buffer = 1;
1972 #ifndef YY_EXIT_FAILURE
1973 #define YY_EXIT_FAILURE 2
1977 static void yy_fatal_error (yyconst char* msg )
1979 (void) fprintf( stderr, "%s\n", msg );
1980 exit( YY_EXIT_FAILURE );
1986 /* Redefine yyless() so it works in section 3 code. */
1992 /* Undo effects of setting up yytext. */ \
1993 int yyless_macro_arg = (n); \
1994 YY_LESS_LINENO(yyless_macro_arg);\
1995 yytext[yyleng] = (yy_hold_char); \
1996 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1997 (yy_hold_char) = *(yy_c_buf_p); \
1998 *(yy_c_buf_p) = '\0'; \
1999 yyleng = yyless_macro_arg; \
2003 /* Accessor methods (get/set functions) to struct members. */
2009 /** Get the current line number.
2012 int yyget_lineno (void)
2018 /** Get the input stream.
2021 FILE *yyget_in (void)
2026 /** Get the output stream.
2029 FILE *yyget_out (void)
2034 /** Get the length of the current token.
2037 int yyget_leng (void)
2042 /** Get the current token.
2046 char *yyget_text (void)
2054 /** Set the current line number.
2055 * @param line_number
2058 void yyset_lineno (int line_number )
2061 yylineno = line_number;
2064 /** Set the input stream. This does not discard the current
2066 * @param in_str A readable stream.
2068 * @see yy_switch_to_buffer
2070 void yyset_in (FILE * in_str )
2075 void yyset_out (FILE * out_str )
2080 int yyget_debug (void)
2082 return yy_flex_debug;
2085 void yyset_debug (int bdebug )
2087 yy_flex_debug = bdebug ;
2093 /* %if-bison-bridge */
2098 static int yy_init_globals (void)
2100 /* Initialization is the same as for the non-reentrant scanner.
2101 * This function is called from yylex_destroy(), so don't allocate here.
2104 (yy_buffer_stack) = 0;
2105 (yy_buffer_stack_top) = 0;
2106 (yy_buffer_stack_max) = 0;
2107 (yy_c_buf_p) = (char *) 0;
2111 /* Defined in main.c */
2120 /* For future reference: Set errno on error, since we are called by
2129 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2130 int yylex_destroy (void)
2136 /* Pop the buffer stack, destroying each element. */
2137 while(YY_CURRENT_BUFFER){
2138 yy_delete_buffer(YY_CURRENT_BUFFER );
2139 YY_CURRENT_BUFFER_LVALUE = NULL;
2140 yypop_buffer_state();
2143 /* Destroy the stack itself. */
2144 yyfree((yy_buffer_stack) );
2145 (yy_buffer_stack) = NULL;
2152 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2153 * yylex() is called, initialization will occur. */
2164 * Internal utility routines.
2168 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2171 for ( i = 0; i < n; ++i )
2176 #ifdef YY_NEED_STRLEN
2177 static int yy_flex_strlen (yyconst char * s )
2180 for ( n = 0; s[n]; ++n )
2187 void *yyalloc (yy_size_t size )
2189 return (void *) malloc( size );
2192 void *yyrealloc (void * ptr, yy_size_t size )
2194 /* The cast to (char *) in the following accommodates both
2195 * implementations that use char* generic pointers, and those
2196 * that use void* generic pointers. It works with the latter
2197 * because both ANSI C and C++ allow castless assignment from
2198 * any pointer type to void*, and deal with argument conversions
2199 * as though doing an assignment.
2201 return (void *) realloc( (char *) ptr, size );
2204 void yyfree (void * ptr )
2206 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2209 /* %if-tables-serialization definitions */
2210 /* %define-yytables The name for this specific scanner's tables. */
2211 #define YYTABLES_NAME "yytables"
2214 /* %ok-for-header */
2216 #line 95 "scripts/genksyms/lex.l"
2220 /* Bring in the keyword recognizer. */
2222 #include "keywords.c"
2225 /* Macros to append to our phrase collection list. */
2227 #define _APP(T,L) do { \
2228 cur_node = next_node; \
2229 next_node = xmalloc(sizeof(*next_node)); \
2230 next_node->next = cur_node; \
2231 cur_node->string = memcpy(xmalloc(L+1), T, L+1); \
2232 cur_node->tag = SYM_NORMAL; \
2235 #define APP _APP(yytext, yyleng)
2238 /* The second stage lexer. Here we incorporate knowledge of the state
2239 of the parser to tailor the tokens that are returned. */
2245 ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_BRACKET, ST_BRACE,
2246 ST_EXPRESSION, ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4,
2247 ST_TABLE_5, ST_TABLE_6
2248 } lexstate = ST_NOTSTARTED;
2250 static int suppress_type_lookup, dont_want_brace_phrase;
2251 static struct string_list *next_node;
2253 int token, count = 0;
2254 struct string_list *cur_node;
2256 if (lexstate == ST_NOTSTARTED)
2259 next_node = xmalloc(sizeof(*next_node));
2260 next_node->next = NULL;
2261 lexstate = ST_NORMAL;
2269 else if (token == FILENAME)
2273 /* Save the filename and line number for later error messages. */
2278 file = strchr(yytext, '\"')+1;
2279 e = strchr(file, '\"');
2281 cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
2282 cur_line = atoi(yytext+2);
2295 const struct resword *r = is_reserved_word(yytext, yyleng);
2298 switch (token = r->token)
2300 case ATTRIBUTE_KEYW:
2301 lexstate = ST_ATTRIBUTE;
2311 dont_want_brace_phrase = 3;
2313 suppress_type_lookup = 2;
2316 case EXPORT_SYMBOL_KEYW:
2320 if (!suppress_type_lookup)
2322 struct symbol *sym = find_symbol(yytext, SYM_TYPEDEF);
2323 if (sym && sym->type == SYM_TYPEDEF)
2331 lexstate = ST_BRACKET;
2337 if (dont_want_brace_phrase)
2339 lexstate = ST_BRACE;
2345 lexstate = ST_EXPRESSION;
2365 lexstate = ST_NORMAL;
2366 token = ATTRIBUTE_PHRASE;
2385 lexstate = ST_NORMAL;
2405 lexstate = ST_NORMAL;
2406 token = BRACKET_PHRASE;
2425 lexstate = ST_NORMAL;
2426 token = BRACE_PHRASE;
2438 case '(': case '[': case '{':
2442 case ')': case ']': case '}':
2449 /* Put back the token we just read so's we can find it again
2450 after registering the expression. */
2453 lexstate = ST_NORMAL;
2454 token = EXPRESSION_PHRASE;
2469 if (token == IDENT && yyleng == 1 && yytext[0] == 'X')
2471 token = EXPORT_SYMBOL_KEYW;
2472 lexstate = ST_TABLE_5;
2476 lexstate = ST_TABLE_6;
2482 case '{': case '[': case '(':
2485 case '}': case ']': case ')':
2490 lexstate = ST_TABLE_2;
2500 lexstate = ST_NORMAL;
2508 lexstate = ST_TABLE_2;
2522 if (suppress_type_lookup > 0)
2523 --suppress_type_lookup;
2524 if (dont_want_brace_phrase > 0)
2525 --dont_want_brace_phrase;
2527 yylval = &next_node->next;
2531 /* A Bison parser, made by GNU Bison 2.3. */
2533 /* Skeleton interface for Bison's Yacc-like parsers in C
2535 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
2536 Free Software Foundation, Inc.
2538 This program is free software; you can redistribute it and/or modify
2539 it under the terms of the GNU General Public License as published by
2540 the Free Software Foundation; either version 2, or (at your option)
2543 This program is distributed in the hope that it will be useful,
2544 but WITHOUT ANY WARRANTY; without even the implied warranty of
2545 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2546 GNU General Public License for more details.
2548 You should have received a copy of the GNU General Public License
2549 along with this program; if not, write to the Free Software
2550 Foundation, Inc., 51 Franklin Street, Fifth Floor,
2551 Boston, MA 02110-1301, USA. */
2553 /* As a special exception, you may create a larger work that contains
2554 part or all of the Bison parser skeleton and distribute that work
2555 under terms of your choice, so long as that work isn't itself a
2556 parser generator using the skeleton or a modified version thereof
2557 as a parser skeleton. Alternatively, if you modify or redistribute
2558 the parser skeleton itself, you may (at your option) remove this
2559 special exception, which will cause the skeleton and the resulting
2560 Bison output files to be licensed under the GNU General Public
2561 License without this special exception.
2563 This special exception was added by the Free Software Foundation in
2564 version 2.2 of Bison. */
2568 # define YYTOKENTYPE
2569 /* Put the tokens into the symbol table, so that GDB and other debuggers
2573 ATTRIBUTE_KEYW = 259,
2581 EXTENSION_KEYW = 267,
2586 REGISTER_KEYW = 272,
2587 RESTRICT_KEYW = 273,
2594 UNSIGNED_KEYW = 280,
2596 VOLATILE_KEYW = 282,
2598 EXPORT_SYMBOL_KEYW = 284,
2600 ATTRIBUTE_PHRASE = 286,
2602 BRACKET_PHRASE = 288,
2603 EXPRESSION_PHRASE = 289,
2616 #define ASM_KEYW 258
2617 #define ATTRIBUTE_KEYW 259
2618 #define AUTO_KEYW 260
2619 #define BOOL_KEYW 261
2620 #define CHAR_KEYW 262
2621 #define CONST_KEYW 263
2622 #define DOUBLE_KEYW 264
2623 #define ENUM_KEYW 265
2624 #define EXTERN_KEYW 266
2625 #define EXTENSION_KEYW 267
2626 #define FLOAT_KEYW 268
2627 #define INLINE_KEYW 269
2628 #define INT_KEYW 270
2629 #define LONG_KEYW 271
2630 #define REGISTER_KEYW 272
2631 #define RESTRICT_KEYW 273
2632 #define SHORT_KEYW 274
2633 #define SIGNED_KEYW 275
2634 #define STATIC_KEYW 276
2635 #define STRUCT_KEYW 277
2636 #define TYPEDEF_KEYW 278
2637 #define UNION_KEYW 279
2638 #define UNSIGNED_KEYW 280
2639 #define VOID_KEYW 281
2640 #define VOLATILE_KEYW 282
2641 #define TYPEOF_KEYW 283
2642 #define EXPORT_SYMBOL_KEYW 284
2643 #define ASM_PHRASE 285
2644 #define ATTRIBUTE_PHRASE 286
2645 #define BRACE_PHRASE 287
2646 #define BRACKET_PHRASE 288
2647 #define EXPRESSION_PHRASE 289
2656 #define FILENAME 298
2661 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
2662 typedef int YYSTYPE;
2663 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
2664 # define YYSTYPE_IS_DECLARED 1
2665 # define YYSTYPE_IS_TRIVIAL 1
2668 extern YYSTYPE yylval;