1 #line 2 "scripts/genksyms/lex.c"
2 /* A lexical scanner generated by flex */
4 /* Scanner skeleton version:
5 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
16 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
28 /* Use prototypes in function declarations. */
31 /* The "const" storage-class-modifier is valid. */
34 #else /* ! __cplusplus */
42 #endif /* ! __cplusplus */
61 #define YY_PROTO(proto) proto
63 #define YY_PROTO(proto) ()
66 /* Returned upon end-of-file. */
69 /* Promotes a possibly negative, possibly signed char to an unsigned
70 * integer for use as an array index. If the signed char is negative,
71 * we want to instead treat it as an 8-bit unsigned char, hence the
74 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
76 /* Enter a start condition. This macro really ought to take a parameter,
77 * but we do it the disgusting crufty way forced on us by the ()-less
78 * definition of BEGIN.
80 #define BEGIN yy_start = 1 + 2 *
82 /* Translate the current start state into a value that can be later handed
83 * to BEGIN to return to the state. The YYSTATE alias is for lex
86 #define YY_START ((yy_start - 1) / 2)
87 #define YYSTATE YY_START
89 /* Action number for EOF rule of a given start state. */
90 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
92 /* Special action meaning "start processing a new file". */
93 #define YY_NEW_FILE yyrestart( yyin )
95 #define YY_END_OF_BUFFER_CHAR 0
97 /* Size of default input buffer. */
98 #define YY_BUF_SIZE 16384
100 typedef struct yy_buffer_state *YY_BUFFER_STATE;
103 extern FILE *yyin, *yyout;
105 #define EOB_ACT_CONTINUE_SCAN 0
106 #define EOB_ACT_END_OF_FILE 1
107 #define EOB_ACT_LAST_MATCH 2
109 /* The funky do-while in the following #define is used to turn the definition
110 * int a single C statement (which needs a semi-colon terminator). This
111 * avoids problems with code like:
113 * if ( condition_holds )
116 * do_something_else();
118 * Prior to using the do-while the compiler would get upset at the
119 * "else" because it interpreted the "if" statement as being all
120 * done when it reached the ';' after the yyless() call.
123 /* Return all but the first 'n' matched characters back to the input stream. */
128 /* Undo effects of setting up yytext. */ \
129 *yy_cp = yy_hold_char; \
130 YY_RESTORE_YY_MORE_OFFSET \
131 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
132 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
136 #define unput(c) yyunput( c, yytext_ptr )
138 /* The following is because we cannot portably get our hands on size_t
139 * (without autoconf's help, which isn't available because we want
140 * flex-generated scanners to compile on their own).
142 typedef unsigned int yy_size_t;
145 struct yy_buffer_state
149 char *yy_ch_buf; /* input buffer */
150 char *yy_buf_pos; /* current position in input buffer */
152 /* Size of input buffer in bytes, not including room for EOB
155 yy_size_t yy_buf_size;
157 /* Number of characters read into yy_ch_buf, not including EOB
162 /* Whether we "own" the buffer - i.e., we know we created it,
163 * and can realloc() it to grow it, and should free() it to
166 int yy_is_our_buffer;
168 /* Whether this is an "interactive" input source; if so, and
169 * if we're using stdio for input, then we want to use getc()
170 * instead of fread(), to make sure we stop fetching input after
173 int yy_is_interactive;
175 /* Whether we're considered to be at the beginning of a line.
176 * If so, '^' rules will be active on the next match, otherwise
181 /* Whether to try to fill the input buffer when we reach the
186 int yy_buffer_status;
187 #define YY_BUFFER_NEW 0
188 #define YY_BUFFER_NORMAL 1
189 /* When an EOF's been seen but there's still some text to process
190 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
191 * shouldn't try reading from the input source any more. We might
192 * still have a bunch of tokens to match, though, because of
193 * possible backing-up.
195 * When we actually see the EOF, we change the status to "new"
196 * (via yyrestart()), so that the user can continue scanning by
197 * just pointing yyin at a new input file.
199 #define YY_BUFFER_EOF_PENDING 2
202 static YY_BUFFER_STATE yy_current_buffer = 0;
204 /* We provide macros for accessing buffer states in case in the
205 * future we want to put the buffer states in a more general
208 #define YY_CURRENT_BUFFER yy_current_buffer
211 /* yy_hold_char holds the character lost when yytext is formed. */
212 static char yy_hold_char;
214 static int yy_n_chars; /* number of characters read into yy_ch_buf */
219 /* Points to current character in buffer. */
220 static char *yy_c_buf_p = (char *) 0;
221 static int yy_init = 1; /* whether we need to initialize */
222 static int yy_start = 0; /* start state number */
224 /* Flag which is used to allow yywrap()'s to do buffer switches
225 * instead of setting up a fresh yyin. A bit of a hack ...
227 static int yy_did_buffer_switch_on_eof;
229 void yyrestart YY_PROTO(( FILE *input_file ));
231 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
232 void yy_load_buffer_state YY_PROTO(( void ));
233 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
234 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
235 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
236 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
237 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
239 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
240 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
241 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
243 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
244 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
245 static void yy_flex_free YY_PROTO(( void * ));
247 #define yy_new_buffer yy_create_buffer
249 #define yy_set_interactive(is_interactive) \
251 if ( ! yy_current_buffer ) \
252 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
253 yy_current_buffer->yy_is_interactive = is_interactive; \
256 #define yy_set_bol(at_bol) \
258 if ( ! yy_current_buffer ) \
259 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
260 yy_current_buffer->yy_at_bol = at_bol; \
263 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
267 #define YY_SKIP_YYWRAP
270 typedef unsigned char YY_CHAR;
271 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
272 typedef int yy_state_type;
276 #define yytext_ptr yytext
278 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
279 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
280 static int yy_get_next_buffer YY_PROTO(( void ));
281 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
283 /* Done after the current pattern has been matched and before the
284 * corresponding action - sets up yytext.
286 #define YY_DO_BEFORE_ACTION \
287 yytext_ptr = yy_bp; \
288 yyleng = (int) (yy_cp - yy_bp); \
289 yy_hold_char = *yy_cp; \
293 #define YY_NUM_RULES 13
294 #define YY_END_OF_BUFFER 14
295 static yyconst short int yy_accept[76] =
297 0, 0, 0, 0, 14, 12, 4, 3, 12, 7,
298 12, 12, 7, 12, 12, 12, 12, 12, 9, 9,
299 12, 12, 12, 4, 0, 5, 0, 7, 0, 6,
300 0, 0, 0, 0, 0, 0, 2, 8, 10, 10,
301 9, 0, 0, 9, 9, 0, 9, 0, 0, 11,
302 0, 0, 0, 10, 0, 10, 9, 9, 0, 0,
303 0, 0, 0, 0, 0, 10, 10, 0, 0, 0,
307 static yyconst int yy_ec[256] =
309 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
310 4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
311 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
312 1, 2, 1, 5, 6, 7, 8, 9, 10, 1,
313 1, 8, 11, 1, 12, 13, 8, 14, 15, 15,
314 15, 15, 15, 15, 15, 16, 16, 1, 1, 17,
315 18, 19, 1, 1, 20, 20, 20, 20, 21, 22,
316 7, 7, 7, 7, 7, 23, 7, 7, 7, 7,
317 7, 7, 7, 7, 24, 7, 7, 25, 7, 7,
318 1, 26, 1, 8, 7, 1, 20, 20, 20, 20,
320 21, 22, 7, 7, 7, 7, 7, 27, 7, 7,
321 7, 7, 7, 7, 7, 7, 24, 7, 7, 25,
322 7, 7, 1, 28, 1, 8, 1, 1, 1, 1,
323 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
324 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
328 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
329 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
333 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 static yyconst int yy_meta[29] =
341 1, 1, 2, 1, 1, 1, 3, 1, 1, 1,
342 4, 4, 5, 6, 6, 6, 1, 1, 1, 7,
343 8, 7, 3, 3, 3, 1, 3, 1
346 static yyconst short int yy_base[88] =
348 0, 147, 21, 140, 145, 284, 39, 284, 26, 0,
349 32, 126, 40, 44, 115, 35, 36, 46, 50, 53,
350 39, 61, 54, 79, 65, 284, 0, 0, 66, 284,
351 0, 119, 79, 75, 123, 104, 284, 284, 107, 0,
352 79, 73, 76, 76, 66, 0, 0, 85, 86, 284,
353 133, 83, 91, 284, 99, 147, 284, 114, 122, 70,
354 107, 141, 172, 151, 135, 181, 284, 137, 114, 157,
355 149, 48, 45, 284, 284, 208, 214, 222, 230, 238,
356 246, 250, 255, 256, 261, 267, 275
359 static yyconst short int yy_def[88] =
361 75, 1, 1, 3, 75, 75, 75, 75, 76, 77,
362 78, 75, 77, 79, 75, 75, 75, 75, 75, 19,
363 75, 75, 75, 75, 76, 75, 80, 77, 78, 75,
364 81, 75, 76, 78, 79, 79, 75, 75, 75, 39,
365 19, 82, 83, 75, 75, 84, 20, 76, 78, 75,
366 79, 51, 85, 75, 75, 75, 75, 84, 79, 51,
367 79, 79, 79, 51, 75, 75, 75, 86, 79, 63,
368 86, 87, 87, 75, 0, 75, 75, 75, 75, 75,
369 75, 75, 75, 75, 75, 75, 75
372 static yyconst short int yy_nxt[313] =
374 6, 7, 8, 7, 9, 6, 10, 6, 6, 11,
375 6, 6, 12, 6, 6, 6, 6, 6, 6, 10,
376 10, 10, 13, 10, 10, 6, 10, 6, 15, 16,
377 26, 15, 17, 18, 19, 20, 20, 21, 15, 22,
378 24, 30, 24, 38, 33, 36, 37, 74, 23, 34,
379 74, 27, 38, 38, 38, 38, 38, 31, 32, 39,
380 39, 39, 40, 41, 41, 42, 47, 47, 47, 26,
381 43, 38, 44, 45, 46, 30, 44, 75, 38, 38,
382 24, 38, 24, 26, 30, 40, 55, 55, 57, 26,
383 27, 31, 57, 43, 35, 30, 64, 64, 64, 57,
385 31, 65, 65, 75, 27, 36, 37, 35, 59, 37,
386 27, 31, 56, 56, 56, 59, 37, 51, 52, 52,
387 39, 39, 39, 59, 37, 37, 68, 53, 54, 54,
388 69, 50, 38, 54, 59, 37, 44, 45, 32, 37,
389 44, 35, 59, 37, 75, 14, 60, 60, 66, 66,
390 66, 37, 14, 72, 75, 61, 62, 63, 59, 61,
391 56, 56, 56, 69, 64, 64, 64, 69, 67, 67,
392 75, 75, 75, 67, 37, 35, 75, 75, 75, 61,
393 62, 75, 75, 61, 75, 70, 70, 70, 75, 75,
394 75, 70, 70, 70, 66, 66, 66, 75, 75, 75,
396 75, 75, 54, 54, 75, 75, 75, 54, 25, 25,
397 25, 25, 25, 25, 25, 25, 28, 75, 75, 28,
398 28, 28, 29, 29, 29, 29, 29, 29, 29, 29,
399 35, 35, 35, 35, 35, 35, 35, 35, 48, 75,
400 48, 48, 48, 48, 48, 48, 49, 75, 49, 49,
401 49, 49, 49, 49, 42, 42, 75, 42, 56, 75,
402 56, 58, 58, 58, 66, 75, 66, 71, 71, 71,
403 71, 71, 71, 71, 71, 73, 73, 73, 73, 73,
404 73, 73, 73, 5, 75, 75, 75, 75, 75, 75,
405 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
407 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
411 static yyconst short int yy_chk[313] =
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
416 9, 3, 3, 3, 3, 3, 3, 3, 3, 3,
417 7, 11, 7, 16, 13, 14, 14, 73, 3, 13,
418 72, 9, 16, 17, 17, 21, 21, 11, 18, 18,
419 18, 18, 19, 19, 19, 19, 20, 20, 20, 25,
420 19, 23, 19, 19, 19, 29, 19, 20, 22, 22,
421 24, 23, 24, 33, 34, 42, 43, 43, 45, 48,
422 25, 29, 45, 42, 60, 49, 52, 52, 52, 44,
424 34, 53, 53, 41, 33, 36, 36, 52, 61, 61,
425 48, 49, 55, 55, 55, 69, 69, 36, 36, 36,
426 39, 39, 39, 59, 59, 35, 59, 39, 39, 39,
427 61, 32, 15, 39, 51, 51, 58, 58, 12, 68,
428 58, 68, 62, 62, 5, 4, 51, 51, 65, 65,
429 65, 71, 2, 71, 0, 51, 51, 51, 70, 51,
430 56, 56, 56, 62, 64, 64, 64, 62, 56, 56,
431 0, 0, 0, 56, 63, 64, 0, 0, 0, 70,
432 70, 0, 0, 70, 0, 63, 63, 63, 0, 0,
433 0, 63, 63, 63, 66, 66, 66, 0, 0, 0,
435 0, 0, 66, 66, 0, 0, 0, 66, 76, 76,
436 76, 76, 76, 76, 76, 76, 77, 0, 0, 77,
437 77, 77, 78, 78, 78, 78, 78, 78, 78, 78,
438 79, 79, 79, 79, 79, 79, 79, 79, 80, 0,
439 80, 80, 80, 80, 80, 80, 81, 0, 81, 81,
440 81, 81, 81, 81, 82, 82, 0, 82, 83, 0,
441 83, 84, 84, 84, 85, 0, 85, 86, 86, 86,
442 86, 86, 86, 86, 86, 87, 87, 87, 87, 87,
443 87, 87, 87, 75, 75, 75, 75, 75, 75, 75,
444 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
446 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
450 static yy_state_type yy_last_accepting_state;
451 static char *yy_last_accepting_cpos;
453 extern int yy_flex_debug;
454 int yy_flex_debug = 1;
456 static yyconst short int yy_rule_linenum[13] =
458 69, 70, 71, 74, 77, 78, 79, 85, 86, 87,
462 /* The intent behind this definition is that it'll catch
463 * any uses of REJECT which flex missed.
465 #define REJECT reject_used_but_not_detected
466 #define yymore() yymore_used_but_not_detected
467 #define YY_MORE_ADJ 0
468 #define YY_RESTORE_YY_MORE_OFFSET
470 #line 1 "scripts/genksyms/lex.l"
472 /* Lexical analysis for genksyms.
473 Copyright 1996, 1997 Linux International.
475 New implementation contributed by Richard Henderson <rth@tamu.edu>
476 Based on original work by Bjorn Ekwall <bj0rn@blox.se>
478 Taken from Linux modutils 2.4.22.
480 This program is free software; you can redistribute it and/or modify it
481 under the terms of the GNU General Public License as published by the
482 Free Software Foundation; either version 2 of the License, or (at your
483 option) any later version.
485 This program is distributed in the hope that it will be useful, but
486 WITHOUT ANY WARRANTY; without even the implied warranty of
487 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
488 General Public License for more details.
490 You should have received a copy of the GNU General Public License
491 along with this program; if not, write to the Free Software Foundation,
492 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
493 #line 25 "scripts/genksyms/lex.l"
500 #include "genksyms.h"
503 /* We've got a two-level lexer here. We let flex do basic tokenization
504 and then we categorize those basic tokens in the second stage. */
505 #define YY_DECL static int yylex1(void)
507 /* Version 2 checksumming does proper tokenization; version 1 wasn't
508 quite so pedantic. */
511 /* We don't do multiple input files. */
512 #line 513 "scripts/genksyms/lex.c"
514 /* Macros after this point can all be overridden by user definitions in
518 #ifndef YY_SKIP_YYWRAP
520 extern "C" int yywrap YY_PROTO(( void ));
522 extern int yywrap YY_PROTO(( void ));
527 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
531 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
534 #ifdef YY_NEED_STRLEN
535 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
540 static int yyinput YY_PROTO(( void ));
542 static int input YY_PROTO(( void ));
547 static int yy_start_stack_ptr = 0;
548 static int yy_start_stack_depth = 0;
549 static int *yy_start_stack = 0;
550 #ifndef YY_NO_PUSH_STATE
551 static void yy_push_state YY_PROTO(( int new_state ));
553 #ifndef YY_NO_POP_STATE
554 static void yy_pop_state YY_PROTO(( void ));
556 #ifndef YY_NO_TOP_STATE
557 static int yy_top_state YY_PROTO(( void ));
561 #define YY_NO_PUSH_STATE 1
562 #define YY_NO_POP_STATE 1
563 #define YY_NO_TOP_STATE 1
566 #ifdef YY_MALLOC_DECL
574 /* Just try to get by without declaring the routines. This will fail
575 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
576 * or sizeof(void*) != sizeof(int).
581 /* Amount of stuff to slurp up with each read. */
582 #ifndef YY_READ_BUF_SIZE
583 #define YY_READ_BUF_SIZE 8192
586 /* Copy whatever the last rule matched to the standard output. */
589 /* This used to be an fputs(), but since the string might contain NUL's,
590 * we now use fwrite().
592 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
595 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
596 * is returned in "result".
599 #define YY_INPUT(buf,result,max_size) \
600 if ( yy_current_buffer->yy_is_interactive ) \
603 for ( n = 0; n < max_size && \
604 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
607 buf[n++] = (char) c; \
608 if ( c == EOF && ferror( yyin ) ) \
609 YY_FATAL_ERROR( "input in flex scanner failed" ); \
612 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
613 && ferror( yyin ) ) \
614 YY_FATAL_ERROR( "input in flex scanner failed" );
617 /* No semi-colon after return; correct usage is to write "yyterminate();" -
618 * we don't want an extra ';' after the "return" because that will cause
619 * some compilers to complain about unreachable statements.
622 #define yyterminate() return YY_NULL
625 /* Number of entries by which start-condition stack grows. */
626 #ifndef YY_START_STACK_INCR
627 #define YY_START_STACK_INCR 25
630 /* Report a fatal error. */
631 #ifndef YY_FATAL_ERROR
632 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
635 /* Default declaration of generated scanner - a define so the user can
636 * easily add parameters.
639 #define YY_DECL int yylex YY_PROTO(( void ))
642 /* Code executed at the beginning of each rule, after yytext and yyleng
645 #ifndef YY_USER_ACTION
646 #define YY_USER_ACTION
649 /* Code executed at the end of each rule. */
651 #define YY_BREAK break;
654 #define YY_RULE_SETUP \
656 yy_current_buffer->yy_at_bol = \
657 (yytext[yyleng - 1] == '\n'); \
662 register yy_state_type yy_current_state;
663 register char *yy_cp = NULL, *yy_bp = NULL;
666 #line 65 "scripts/genksyms/lex.l"
670 /* Keep track of our location in the original source files. */
671 #line 672 "scripts/genksyms/lex.c"
682 yy_start = 1; /* first start state */
690 if ( ! yy_current_buffer )
692 yy_create_buffer( yyin, YY_BUF_SIZE );
694 yy_load_buffer_state();
697 while ( 1 ) /* loops until end-of-file is reached */
701 /* Support of yytext. */
702 *yy_cp = yy_hold_char;
704 /* yy_bp points to the position in yy_ch_buf of the start of
709 yy_current_state = yy_start;
710 yy_current_state += YY_AT_BOL();
714 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
715 if ( yy_accept[yy_current_state] )
717 yy_last_accepting_state = yy_current_state;
718 yy_last_accepting_cpos = yy_cp;
720 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
722 yy_current_state = (int) yy_def[yy_current_state];
723 if ( yy_current_state >= 76 )
724 yy_c = yy_meta[(unsigned int) yy_c];
726 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
729 while ( yy_base[yy_current_state] != 284 );
732 yy_act = yy_accept[yy_current_state];
734 { /* have to back up */
735 yy_cp = yy_last_accepting_cpos;
736 yy_current_state = yy_last_accepting_state;
737 yy_act = yy_accept[yy_current_state];
743 do_action: /* This label is used only to access EOF actions. */
748 fprintf( stderr, "--scanner backing up\n" );
749 else if ( yy_act < 13 )
750 fprintf( stderr, "--accepting rule at line %d (\"%s\")\n",
751 yy_rule_linenum[yy_act], yytext );
752 else if ( yy_act == 13 )
753 fprintf( stderr, "--accepting default rule (\"%s\")\n",
755 else if ( yy_act == 14 )
756 fprintf( stderr, "--(end of buffer or a NUL)\n" );
758 fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
762 { /* beginning of action switch */
763 case 0: /* must back up */
764 /* undo the effects of YY_DO_BEFORE_ACTION */
765 *yy_cp = yy_hold_char;
766 yy_cp = yy_last_accepting_cpos;
767 yy_current_state = yy_last_accepting_state;
772 #line 69 "scripts/genksyms/lex.l"
777 #line 70 "scripts/genksyms/lex.l"
782 #line 71 "scripts/genksyms/lex.l"
785 /* Ignore all other whitespace. */
788 #line 74 "scripts/genksyms/lex.l"
793 #line 77 "scripts/genksyms/lex.l"
798 #line 78 "scripts/genksyms/lex.l"
803 #line 79 "scripts/genksyms/lex.l"
806 /* The Pedant requires that the other C multi-character tokens be
807 recognized as tokens. We don't actually use them since we don't
808 parse expressions, but we do want whitespace to be arranged
809 around them properly. */
812 #line 85 "scripts/genksyms/lex.l"
817 #line 86 "scripts/genksyms/lex.l"
822 #line 87 "scripts/genksyms/lex.l"
827 #line 89 "scripts/genksyms/lex.l"
830 /* All other tokens are single characters. */
833 #line 92 "scripts/genksyms/lex.l"
838 #line 95 "scripts/genksyms/lex.l"
841 #line 842 "scripts/genksyms/lex.c"
842 case YY_STATE_EOF(INITIAL):
843 case YY_STATE_EOF(V2_TOKENS):
846 case YY_END_OF_BUFFER:
848 /* Amount of text matched not including the EOB char. */
849 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
851 /* Undo the effects of YY_DO_BEFORE_ACTION. */
852 *yy_cp = yy_hold_char;
853 YY_RESTORE_YY_MORE_OFFSET
855 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
857 /* We're scanning a new file or input source. It's
858 * possible that this happened because the user
859 * just pointed yyin at a new source and called
860 * yylex(). If so, then we have to assure
861 * consistency between yy_current_buffer and our
862 * globals. Here is the right place to do so, because
863 * this is the first action (other than possibly a
864 * back-up) that will match for the new input source.
866 yy_n_chars = yy_current_buffer->yy_n_chars;
867 yy_current_buffer->yy_input_file = yyin;
868 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
871 /* Note that here we test for yy_c_buf_p "<=" to the position
872 * of the first EOB in the buffer, since yy_c_buf_p will
873 * already have been incremented past the NUL character
874 * (since all states make transitions on EOB to the
875 * end-of-buffer state). Contrast this with the test
878 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
879 { /* This was really a NUL. */
880 yy_state_type yy_next_state;
882 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
884 yy_current_state = yy_get_previous_state();
886 /* Okay, we're now positioned to make the NUL
887 * transition. We couldn't have
888 * yy_get_previous_state() go ahead and do it
889 * for us because it doesn't know how to deal
890 * with the possibility of jamming (and we don't
891 * want to build jamming into it because then it
892 * will run more slowly).
895 yy_next_state = yy_try_NUL_trans( yy_current_state );
897 yy_bp = yytext_ptr + YY_MORE_ADJ;
901 /* Consume the NUL. */
902 yy_cp = ++yy_c_buf_p;
903 yy_current_state = yy_next_state;
914 else switch ( yy_get_next_buffer() )
916 case EOB_ACT_END_OF_FILE:
918 yy_did_buffer_switch_on_eof = 0;
922 /* Note: because we've taken care in
923 * yy_get_next_buffer() to have set up
924 * yytext, we can now set up
925 * yy_c_buf_p so that if some total
926 * hoser (like flex itself) wants to
927 * call the scanner after we return the
928 * YY_NULL, it'll still work - another
929 * YY_NULL will get returned.
931 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
933 yy_act = YY_STATE_EOF(YY_START);
939 if ( ! yy_did_buffer_switch_on_eof )
945 case EOB_ACT_CONTINUE_SCAN:
947 yytext_ptr + yy_amount_of_matched_text;
949 yy_current_state = yy_get_previous_state();
952 yy_bp = yytext_ptr + YY_MORE_ADJ;
955 case EOB_ACT_LAST_MATCH:
957 &yy_current_buffer->yy_ch_buf[yy_n_chars];
959 yy_current_state = yy_get_previous_state();
962 yy_bp = yytext_ptr + YY_MORE_ADJ;
970 "fatal flex scanner internal error--no action found" );
971 } /* end of action switch */
972 } /* end of scanning one token */
976 /* yy_get_next_buffer - try to read in a new buffer
978 * Returns a code representing an action:
979 * EOB_ACT_LAST_MATCH -
980 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
981 * EOB_ACT_END_OF_FILE - end of file
984 static int yy_get_next_buffer()
986 register char *dest = yy_current_buffer->yy_ch_buf;
987 register char *source = yytext_ptr;
988 register int number_to_move, i;
991 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
993 "fatal flex scanner internal error--end of buffer missed" );
995 if ( yy_current_buffer->yy_fill_buffer == 0 )
996 { /* Don't try to fill the buffer, so this is an EOF. */
997 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
999 /* We matched a single character, the EOB, so
1000 * treat this as a final EOF.
1002 return EOB_ACT_END_OF_FILE;
1007 /* We matched some text prior to the EOB, first
1010 return EOB_ACT_LAST_MATCH;
1014 /* Try to read more data. */
1016 /* First move last chars to start of buffer. */
1017 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1019 for ( i = 0; i < number_to_move; ++i )
1020 *(dest++) = *(source++);
1022 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1023 /* don't do the read, it's not guaranteed to return an EOF,
1026 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1031 yy_current_buffer->yy_buf_size - number_to_move - 1;
1033 while ( num_to_read <= 0 )
1034 { /* Not enough room in the buffer - grow it. */
1035 #ifdef YY_USES_REJECT
1037 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1040 /* just a shorter name for the current buffer */
1041 YY_BUFFER_STATE b = yy_current_buffer;
1043 int yy_c_buf_p_offset =
1044 (int) (yy_c_buf_p - b->yy_ch_buf);
1046 if ( b->yy_is_our_buffer )
1048 int new_size = b->yy_buf_size * 2;
1050 if ( new_size <= 0 )
1051 b->yy_buf_size += b->yy_buf_size / 8;
1053 b->yy_buf_size *= 2;
1055 b->yy_ch_buf = (char *)
1056 /* Include room in for 2 EOB chars. */
1057 yy_flex_realloc( (void *) b->yy_ch_buf,
1058 b->yy_buf_size + 2 );
1061 /* Can't grow it, we don't own it. */
1064 if ( ! b->yy_ch_buf )
1066 "fatal error - scanner input buffer overflow" );
1068 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1070 num_to_read = yy_current_buffer->yy_buf_size -
1075 if ( num_to_read > YY_READ_BUF_SIZE )
1076 num_to_read = YY_READ_BUF_SIZE;
1078 /* Read in more data. */
1079 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1080 yy_n_chars, num_to_read );
1082 yy_current_buffer->yy_n_chars = yy_n_chars;
1085 if ( yy_n_chars == 0 )
1087 if ( number_to_move == YY_MORE_ADJ )
1089 ret_val = EOB_ACT_END_OF_FILE;
1095 ret_val = EOB_ACT_LAST_MATCH;
1096 yy_current_buffer->yy_buffer_status =
1097 YY_BUFFER_EOF_PENDING;
1102 ret_val = EOB_ACT_CONTINUE_SCAN;
1104 yy_n_chars += number_to_move;
1105 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1106 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1108 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1114 /* yy_get_previous_state - get the state just before the EOB char was reached */
1116 static yy_state_type yy_get_previous_state()
1118 register yy_state_type yy_current_state;
1119 register char *yy_cp;
1121 yy_current_state = yy_start;
1122 yy_current_state += YY_AT_BOL();
1124 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1126 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1127 if ( yy_accept[yy_current_state] )
1129 yy_last_accepting_state = yy_current_state;
1130 yy_last_accepting_cpos = yy_cp;
1132 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1134 yy_current_state = (int) yy_def[yy_current_state];
1135 if ( yy_current_state >= 76 )
1136 yy_c = yy_meta[(unsigned int) yy_c];
1138 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1141 return yy_current_state;
1145 /* yy_try_NUL_trans - try to make a transition on the NUL character
1148 * next_state = yy_try_NUL_trans( current_state );
1151 #ifdef YY_USE_PROTOS
1152 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1154 static yy_state_type yy_try_NUL_trans( yy_current_state )
1155 yy_state_type yy_current_state;
1158 register int yy_is_jam;
1159 register char *yy_cp = yy_c_buf_p;
1161 register YY_CHAR yy_c = 1;
1162 if ( yy_accept[yy_current_state] )
1164 yy_last_accepting_state = yy_current_state;
1165 yy_last_accepting_cpos = yy_cp;
1167 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1169 yy_current_state = (int) yy_def[yy_current_state];
1170 if ( yy_current_state >= 76 )
1171 yy_c = yy_meta[(unsigned int) yy_c];
1173 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1174 yy_is_jam = (yy_current_state == 75);
1176 return yy_is_jam ? 0 : yy_current_state;
1181 #ifdef YY_USE_PROTOS
1182 static void yyunput( int c, register char *yy_bp )
1184 static void yyunput( c, yy_bp )
1186 register char *yy_bp;
1189 register char *yy_cp = yy_c_buf_p;
1191 /* undo effects of setting up yytext */
1192 *yy_cp = yy_hold_char;
1194 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1195 { /* need to shift things up to make room */
1196 /* +2 for EOB chars. */
1197 register int number_to_move = yy_n_chars + 2;
1198 register char *dest = &yy_current_buffer->yy_ch_buf[
1199 yy_current_buffer->yy_buf_size + 2];
1200 register char *source =
1201 &yy_current_buffer->yy_ch_buf[number_to_move];
1203 while ( source > yy_current_buffer->yy_ch_buf )
1204 *--dest = *--source;
1206 yy_cp += (int) (dest - source);
1207 yy_bp += (int) (dest - source);
1208 yy_current_buffer->yy_n_chars =
1209 yy_n_chars = yy_current_buffer->yy_buf_size;
1211 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1212 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1215 *--yy_cp = (char) c;
1219 yy_hold_char = *yy_cp;
1222 #endif /* ifndef YY_NO_UNPUT */
1226 static int yyinput()
1233 *yy_c_buf_p = yy_hold_char;
1235 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1237 /* yy_c_buf_p now points to the character we want to return.
1238 * If this occurs *before* the EOB characters, then it's a
1239 * valid NUL; if not, then we've hit the end of the buffer.
1241 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1242 /* This was really a NUL. */
1246 { /* need more input */
1247 int offset = yy_c_buf_p - yytext_ptr;
1250 switch ( yy_get_next_buffer() )
1252 case EOB_ACT_LAST_MATCH:
1253 /* This happens because yy_g_n_b()
1254 * sees that we've accumulated a
1255 * token and flags that we need to
1256 * try matching the token before
1257 * proceeding. But for input(),
1258 * there's no matching to consider.
1259 * So convert the EOB_ACT_LAST_MATCH
1260 * to EOB_ACT_END_OF_FILE.
1263 /* Reset buffer status. */
1268 case EOB_ACT_END_OF_FILE:
1273 if ( ! yy_did_buffer_switch_on_eof )
1282 case EOB_ACT_CONTINUE_SCAN:
1283 yy_c_buf_p = yytext_ptr + offset;
1289 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1290 *yy_c_buf_p = '\0'; /* preserve yytext */
1291 yy_hold_char = *++yy_c_buf_p;
1293 yy_current_buffer->yy_at_bol = (c == '\n');
1299 #ifdef YY_USE_PROTOS
1300 void yyrestart( FILE *input_file )
1302 void yyrestart( input_file )
1306 if ( ! yy_current_buffer )
1307 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1309 yy_init_buffer( yy_current_buffer, input_file );
1310 yy_load_buffer_state();
1314 #ifdef YY_USE_PROTOS
1315 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1317 void yy_switch_to_buffer( new_buffer )
1318 YY_BUFFER_STATE new_buffer;
1321 if ( yy_current_buffer == new_buffer )
1324 if ( yy_current_buffer )
1326 /* Flush out information for old buffer. */
1327 *yy_c_buf_p = yy_hold_char;
1328 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1329 yy_current_buffer->yy_n_chars = yy_n_chars;
1332 yy_current_buffer = new_buffer;
1333 yy_load_buffer_state();
1335 /* We don't actually know whether we did this switch during
1336 * EOF (yywrap()) processing, but the only time this flag
1337 * is looked at is after yywrap() is called, so it's safe
1338 * to go ahead and always set it.
1340 yy_did_buffer_switch_on_eof = 1;
1344 #ifdef YY_USE_PROTOS
1345 void yy_load_buffer_state( void )
1347 void yy_load_buffer_state()
1350 yy_n_chars = yy_current_buffer->yy_n_chars;
1351 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1352 yyin = yy_current_buffer->yy_input_file;
1353 yy_hold_char = *yy_c_buf_p;
1357 #ifdef YY_USE_PROTOS
1358 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1360 YY_BUFFER_STATE yy_create_buffer( file, size )
1367 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1369 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1371 b->yy_buf_size = size;
1373 /* yy_ch_buf has to be 2 characters longer than the size given because
1374 * we need to put in 2 end-of-buffer characters.
1376 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1377 if ( ! b->yy_ch_buf )
1378 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1380 b->yy_is_our_buffer = 1;
1382 yy_init_buffer( b, file );
1388 #ifdef YY_USE_PROTOS
1389 void yy_delete_buffer( YY_BUFFER_STATE b )
1391 void yy_delete_buffer( b )
1398 if ( b == yy_current_buffer )
1399 yy_current_buffer = (YY_BUFFER_STATE) 0;
1401 if ( b->yy_is_our_buffer )
1402 yy_flex_free( (void *) b->yy_ch_buf );
1404 yy_flex_free( (void *) b );
1409 #ifdef YY_USE_PROTOS
1410 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1412 void yy_init_buffer( b, file )
1419 yy_flush_buffer( b );
1421 b->yy_input_file = file;
1422 b->yy_fill_buffer = 1;
1424 #if YY_ALWAYS_INTERACTIVE
1425 b->yy_is_interactive = 1;
1427 #if YY_NEVER_INTERACTIVE
1428 b->yy_is_interactive = 0;
1430 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1436 #ifdef YY_USE_PROTOS
1437 void yy_flush_buffer( YY_BUFFER_STATE b )
1439 void yy_flush_buffer( b )
1449 /* We always need two end-of-buffer characters. The first causes
1450 * a transition to the end-of-buffer state. The second causes
1451 * a jam in that state.
1453 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1454 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1456 b->yy_buf_pos = &b->yy_ch_buf[0];
1459 b->yy_buffer_status = YY_BUFFER_NEW;
1461 if ( b == yy_current_buffer )
1462 yy_load_buffer_state();
1466 #ifndef YY_NO_SCAN_BUFFER
1467 #ifdef YY_USE_PROTOS
1468 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1470 YY_BUFFER_STATE yy_scan_buffer( base, size )
1478 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1479 base[size-1] != YY_END_OF_BUFFER_CHAR )
1480 /* They forgot to leave room for the EOB's. */
1483 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1485 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1487 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1488 b->yy_buf_pos = b->yy_ch_buf = base;
1489 b->yy_is_our_buffer = 0;
1490 b->yy_input_file = 0;
1491 b->yy_n_chars = b->yy_buf_size;
1492 b->yy_is_interactive = 0;
1494 b->yy_fill_buffer = 0;
1495 b->yy_buffer_status = YY_BUFFER_NEW;
1497 yy_switch_to_buffer( b );
1504 #ifndef YY_NO_SCAN_STRING
1505 #ifdef YY_USE_PROTOS
1506 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1508 YY_BUFFER_STATE yy_scan_string( yy_str )
1509 yyconst char *yy_str;
1513 for ( len = 0; yy_str[len]; ++len )
1516 return yy_scan_bytes( yy_str, len );
1521 #ifndef YY_NO_SCAN_BYTES
1522 #ifdef YY_USE_PROTOS
1523 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1525 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1526 yyconst char *bytes;
1535 /* Get memory for full buffer, including space for trailing EOB's. */
1537 buf = (char *) yy_flex_alloc( n );
1539 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1541 for ( i = 0; i < len; ++i )
1544 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1546 b = yy_scan_buffer( buf, n );
1548 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1550 /* It's okay to grow etc. this buffer, and we should throw it
1551 * away when we're done.
1553 b->yy_is_our_buffer = 1;
1560 #ifndef YY_NO_PUSH_STATE
1561 #ifdef YY_USE_PROTOS
1562 static void yy_push_state( int new_state )
1564 static void yy_push_state( new_state )
1568 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1572 yy_start_stack_depth += YY_START_STACK_INCR;
1573 new_size = yy_start_stack_depth * sizeof( int );
1575 if ( ! yy_start_stack )
1576 yy_start_stack = (int *) yy_flex_alloc( new_size );
1579 yy_start_stack = (int *) yy_flex_realloc(
1580 (void *) yy_start_stack, new_size );
1582 if ( ! yy_start_stack )
1584 "out of memory expanding start-condition stack" );
1587 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1594 #ifndef YY_NO_POP_STATE
1595 static void yy_pop_state()
1597 if ( --yy_start_stack_ptr < 0 )
1598 YY_FATAL_ERROR( "start-condition stack underflow" );
1600 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1605 #ifndef YY_NO_TOP_STATE
1606 static int yy_top_state()
1608 return yy_start_stack[yy_start_stack_ptr - 1];
1612 #ifndef YY_EXIT_FAILURE
1613 #define YY_EXIT_FAILURE 2
1616 #ifdef YY_USE_PROTOS
1617 static void yy_fatal_error( yyconst char msg[] )
1619 static void yy_fatal_error( msg )
1623 (void) fprintf( stderr, "%s\n", msg );
1624 exit( YY_EXIT_FAILURE );
1629 /* Redefine yyless() so it works in section 3 code. */
1635 /* Undo effects of setting up yytext. */ \
1636 yytext[yyleng] = yy_hold_char; \
1637 yy_c_buf_p = yytext + n; \
1638 yy_hold_char = *yy_c_buf_p; \
1639 *yy_c_buf_p = '\0'; \
1645 /* Internal utility routines. */
1648 #ifdef YY_USE_PROTOS
1649 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1651 static void yy_flex_strncpy( s1, s2, n )
1658 for ( i = 0; i < n; ++i )
1663 #ifdef YY_NEED_STRLEN
1664 #ifdef YY_USE_PROTOS
1665 static int yy_flex_strlen( yyconst char *s )
1667 static int yy_flex_strlen( s )
1672 for ( n = 0; s[n]; ++n )
1680 #ifdef YY_USE_PROTOS
1681 static void *yy_flex_alloc( yy_size_t size )
1683 static void *yy_flex_alloc( size )
1687 return (void *) malloc( size );
1690 #ifdef YY_USE_PROTOS
1691 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1693 static void *yy_flex_realloc( ptr, size )
1698 /* The cast to (char *) in the following accommodates both
1699 * implementations that use char* generic pointers, and those
1700 * that use void* generic pointers. It works with the latter
1701 * because both ANSI C and C++ allow castless assignment from
1702 * any pointer type to void*, and deal with argument conversions
1703 * as though doing an assignment.
1705 return (void *) realloc( (char *) ptr, size );
1708 #ifdef YY_USE_PROTOS
1709 static void yy_flex_free( void *ptr )
1711 static void yy_flex_free( ptr )
1725 #line 95 "scripts/genksyms/lex.l"
1728 /* Bring in the keyword recognizer. */
1730 #include "keywords.c"
1733 /* Macros to append to our phrase collection list. */
1735 #define _APP(T,L) do { \
1736 cur_node = next_node; \
1737 next_node = xmalloc(sizeof(*next_node)); \
1738 next_node->next = cur_node; \
1739 cur_node->string = memcpy(xmalloc(L+1), T, L+1); \
1740 cur_node->tag = SYM_NORMAL; \
1743 #define APP _APP(yytext, yyleng)
1746 /* The second stage lexer. Here we incorporate knowledge of the state
1747 of the parser to tailor the tokens that are returned. */
1753 ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_BRACKET, ST_BRACE,
1754 ST_EXPRESSION, ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4,
1755 ST_TABLE_5, ST_TABLE_6
1756 } lexstate = ST_NOTSTARTED;
1758 static int suppress_type_lookup, dont_want_brace_phrase;
1759 static struct string_list *next_node;
1761 int token, count = 0;
1762 struct string_list *cur_node;
1764 if (lexstate == ST_NOTSTARTED)
1767 next_node = xmalloc(sizeof(*next_node));
1768 next_node->next = NULL;
1769 lexstate = ST_NORMAL;
1777 else if (token == FILENAME)
1781 /* Save the filename and line number for later error messages. */
1786 file = strchr(yytext, '\"')+1;
1787 e = strchr(file, '\"');
1789 cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
1790 cur_line = atoi(yytext+2);
1803 const struct resword *r = is_reserved_word(yytext, yyleng);
1806 switch (token = r->token)
1808 case ATTRIBUTE_KEYW:
1809 lexstate = ST_ATTRIBUTE;
1819 dont_want_brace_phrase = 3;
1821 suppress_type_lookup = 2;
1824 case EXPORT_SYMBOL_KEYW:
1828 if (!suppress_type_lookup)
1830 struct symbol *sym = find_symbol(yytext, SYM_TYPEDEF);
1831 if (sym && sym->type == SYM_TYPEDEF)
1839 lexstate = ST_BRACKET;
1845 if (dont_want_brace_phrase)
1847 lexstate = ST_BRACE;
1853 lexstate = ST_EXPRESSION;
1873 lexstate = ST_NORMAL;
1874 token = ATTRIBUTE_PHRASE;
1893 lexstate = ST_NORMAL;
1913 lexstate = ST_NORMAL;
1914 token = BRACKET_PHRASE;
1933 lexstate = ST_NORMAL;
1934 token = BRACE_PHRASE;
1946 case '(': case '[': case '{':
1950 case ')': case ']': case '}':
1957 /* Put back the token we just read so's we can find it again
1958 after registering the expression. */
1961 lexstate = ST_NORMAL;
1962 token = EXPRESSION_PHRASE;
1977 if (token == IDENT && yyleng == 1 && yytext[0] == 'X')
1979 token = EXPORT_SYMBOL_KEYW;
1980 lexstate = ST_TABLE_5;
1984 lexstate = ST_TABLE_6;
1990 case '{': case '[': case '(':
1993 case '}': case ']': case ')':
1998 lexstate = ST_TABLE_2;
2008 lexstate = ST_NORMAL;
2016 lexstate = ST_TABLE_2;
2030 if (suppress_type_lookup > 0)
2031 --suppress_type_lookup;
2032 if (dont_want_brace_phrase > 0)
2033 --dont_want_brace_phrase;
2035 yylval = &next_node->next;
2042 #define ASM_KEYW 257
2043 #define ATTRIBUTE_KEYW 258
2044 #define AUTO_KEYW 259
2045 #define BOOL_KEYW 260
2046 #define CHAR_KEYW 261
2047 #define CONST_KEYW 262
2048 #define DOUBLE_KEYW 263
2049 #define ENUM_KEYW 264
2050 #define EXTERN_KEYW 265
2051 #define FLOAT_KEYW 266
2052 #define INLINE_KEYW 267
2053 #define INT_KEYW 268
2054 #define LONG_KEYW 269
2055 #define REGISTER_KEYW 270
2056 #define RESTRICT_KEYW 271
2057 #define SHORT_KEYW 272
2058 #define SIGNED_KEYW 273
2059 #define STATIC_KEYW 274
2060 #define STRUCT_KEYW 275
2061 #define TYPEDEF_KEYW 276
2062 #define UNION_KEYW 277
2063 #define UNSIGNED_KEYW 278
2064 #define VOID_KEYW 279
2065 #define VOLATILE_KEYW 280
2066 #define TYPEOF_KEYW 281
2067 #define EXPORT_SYMBOL_KEYW 282
2068 #define ASM_PHRASE 283
2069 #define ATTRIBUTE_PHRASE 284
2070 #define BRACE_PHRASE 285
2071 #define BRACKET_PHRASE 286
2072 #define EXPRESSION_PHRASE 287
2081 #define FILENAME 296
2084 extern YYSTYPE yylval;