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, 12,
298 12, 7, 7, 12, 12, 12, 12, 12, 9, 9,
299 12, 12, 12, 4, 0, 5, 0, 0, 6, 0,
300 0, 7, 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, 1, 7, 8, 9, 1,
313 1, 7, 10, 1, 11, 12, 7, 13, 14, 14,
314 14, 14, 14, 14, 14, 15, 15, 1, 1, 16,
315 17, 18, 1, 1, 19, 19, 19, 19, 20, 21,
316 22, 22, 22, 22, 22, 23, 22, 22, 22, 22,
317 22, 22, 22, 22, 24, 22, 22, 25, 22, 22,
318 1, 26, 1, 7, 22, 1, 19, 19, 19, 19,
320 20, 21, 22, 22, 22, 22, 22, 27, 22, 22,
321 22, 22, 22, 22, 22, 22, 24, 22, 22, 25,
322 22, 22, 1, 28, 1, 7, 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, 1, 1, 1, 3,
342 3, 4, 5, 5, 5, 1, 1, 1, 6, 7,
343 6, 8, 8, 8, 8, 1, 8, 1
346 static yyconst short int yy_base[88] =
348 0, 166, 22, 152, 151, 282, 39, 282, 26, 33,
349 138, 0, 39, 43, 124, 39, 36, 48, 52, 55,
350 41, 56, 54, 47, 73, 282, 0, 72, 282, 0,
351 116, 0, 78, 75, 122, 103, 282, 282, 106, 0,
352 97, 73, 76, 91, 65, 0, 0, 84, 81, 282,
353 132, 98, 84, 282, 117, 147, 282, 73, 134, 89,
354 100, 140, 172, 139, 134, 181, 282, 135, 106, 142,
355 168, 88, 52, 282, 282, 208, 216, 220, 228, 236,
356 244, 249, 254, 255, 260, 265, 273
359 static yyconst short int yy_def[88] =
361 75, 1, 1, 3, 75, 75, 75, 75, 76, 77,
362 75, 78, 78, 79, 75, 75, 75, 75, 75, 19,
363 75, 75, 75, 75, 76, 75, 80, 77, 75, 81,
364 75, 78, 76, 77, 79, 79, 75, 75, 75, 39,
365 19, 82, 83, 75, 75, 84, 20, 76, 77, 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[311] =
374 6, 7, 8, 7, 9, 6, 6, 6, 10, 6,
375 6, 11, 6, 6, 6, 6, 6, 6, 12, 12,
376 12, 12, 13, 12, 12, 6, 12, 6, 15, 16,
377 26, 15, 17, 18, 19, 20, 20, 21, 15, 22,
378 24, 29, 24, 33, 36, 37, 38, 34, 24, 23,
379 24, 27, 38, 38, 74, 38, 38, 38, 30, 31,
380 39, 39, 39, 40, 41, 41, 42, 47, 47, 47,
381 38, 43, 38, 38, 44, 45, 46, 26, 44, 75,
382 29, 38, 26, 29, 40, 55, 55, 57, 26, 29,
383 74, 57, 43, 65, 65, 44, 45, 30, 27, 44,
385 30, 59, 37, 27, 36, 37, 30, 59, 37, 27,
386 64, 64, 64, 35, 57, 51, 52, 52, 39, 39,
387 39, 75, 35, 69, 37, 53, 54, 50, 54, 56,
388 56, 56, 54, 59, 37, 59, 37, 37, 68, 35,
389 38, 59, 37, 59, 60, 60, 66, 66, 66, 31,
390 75, 64, 64, 64, 61, 62, 63, 14, 61, 56,
391 56, 56, 69, 35, 61, 62, 69, 67, 61, 67,
392 37, 14, 72, 67, 37, 75, 75, 75, 75, 75,
393 75, 75, 75, 75, 70, 70, 70, 75, 75, 75,
394 70, 70, 70, 66, 66, 66, 75, 75, 75, 75,
396 75, 54, 75, 54, 75, 75, 75, 54, 25, 25,
397 25, 25, 25, 25, 25, 25, 28, 28, 28, 28,
398 28, 28, 28, 28, 32, 32, 32, 32, 35, 35,
399 35, 35, 35, 35, 35, 35, 48, 75, 48, 48,
400 48, 48, 48, 48, 49, 75, 49, 49, 49, 49,
401 49, 49, 42, 42, 75, 42, 56, 75, 56, 58,
402 58, 58, 66, 75, 66, 71, 71, 71, 71, 71,
403 71, 71, 71, 73, 73, 73, 73, 73, 73, 73,
404 73, 5, 75, 75, 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
410 static yyconst short int yy_chk[311] =
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
415 9, 3, 3, 3, 3, 3, 3, 3, 3, 3,
416 7, 10, 7, 13, 14, 14, 16, 13, 24, 3,
417 24, 9, 17, 17, 73, 16, 21, 21, 10, 18,
418 18, 18, 18, 19, 19, 19, 19, 20, 20, 20,
419 23, 19, 22, 22, 19, 19, 19, 25, 19, 20,
420 28, 23, 33, 34, 42, 43, 43, 45, 48, 49,
421 72, 45, 42, 53, 53, 58, 58, 28, 25, 58,
423 34, 61, 61, 33, 36, 36, 49, 69, 69, 48,
424 52, 52, 52, 60, 44, 36, 36, 36, 39, 39,
425 39, 41, 52, 61, 35, 39, 39, 31, 39, 55,
426 55, 55, 39, 51, 51, 59, 59, 68, 59, 68,
427 15, 62, 62, 70, 51, 51, 65, 65, 65, 11,
428 5, 64, 64, 64, 51, 51, 51, 4, 51, 56,
429 56, 56, 62, 64, 70, 70, 62, 56, 70, 56,
430 71, 2, 71, 56, 63, 0, 0, 0, 0, 0,
431 0, 0, 0, 0, 63, 63, 63, 0, 0, 0,
432 63, 63, 63, 66, 66, 66, 0, 0, 0, 0,
434 0, 66, 0, 66, 0, 0, 0, 66, 76, 76,
435 76, 76, 76, 76, 76, 76, 77, 77, 77, 77,
436 77, 77, 77, 77, 78, 78, 78, 78, 79, 79,
437 79, 79, 79, 79, 79, 79, 80, 0, 80, 80,
438 80, 80, 80, 80, 81, 0, 81, 81, 81, 81,
439 81, 81, 82, 82, 0, 82, 83, 0, 83, 84,
440 84, 84, 85, 0, 85, 86, 86, 86, 86, 86,
441 86, 86, 86, 87, 87, 87, 87, 87, 87, 87,
442 87, 75, 75, 75, 75, 75, 75, 75, 75, 75,
443 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
445 75, 75, 75, 75, 75, 75, 75, 75, 75, 75
448 static yy_state_type yy_last_accepting_state;
449 static char *yy_last_accepting_cpos;
451 extern int yy_flex_debug;
452 int yy_flex_debug = 1;
454 static yyconst short int yy_rule_linenum[13] =
456 69, 70, 71, 74, 77, 78, 79, 85, 86, 87,
460 /* The intent behind this definition is that it'll catch
461 * any uses of REJECT which flex missed.
463 #define REJECT reject_used_but_not_detected
464 #define yymore() yymore_used_but_not_detected
465 #define YY_MORE_ADJ 0
466 #define YY_RESTORE_YY_MORE_OFFSET
468 #line 1 "scripts/genksyms/lex.l"
470 /* Lexical analysis for genksyms.
471 Copyright 1996, 1997 Linux International.
473 New implementation contributed by Richard Henderson <rth@tamu.edu>
474 Based on original work by Bjorn Ekwall <bj0rn@blox.se>
476 Taken from Linux modutils 2.4.22.
478 This program is free software; you can redistribute it and/or modify it
479 under the terms of the GNU General Public License as published by the
480 Free Software Foundation; either version 2 of the License, or (at your
481 option) any later version.
483 This program is distributed in the hope that it will be useful, but
484 WITHOUT ANY WARRANTY; without even the implied warranty of
485 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
486 General Public License for more details.
488 You should have received a copy of the GNU General Public License
489 along with this program; if not, write to the Free Software Foundation,
490 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
491 #line 25 "scripts/genksyms/lex.l"
498 #include "genksyms.h"
501 /* We've got a two-level lexer here. We let flex do basic tokenization
502 and then we categorize those basic tokens in the second stage. */
503 #define YY_DECL static int yylex1(void)
505 /* Version 2 checksumming does proper tokenization; version 1 wasn't
506 quite so pedantic. */
509 /* We don't do multiple input files. */
510 #line 511 "scripts/genksyms/lex.c"
512 /* Macros after this point can all be overridden by user definitions in
516 #ifndef YY_SKIP_YYWRAP
518 extern "C" int yywrap YY_PROTO(( void ));
520 extern int yywrap YY_PROTO(( void ));
525 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
529 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
532 #ifdef YY_NEED_STRLEN
533 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
538 static int yyinput YY_PROTO(( void ));
540 static int input YY_PROTO(( void ));
545 static int yy_start_stack_ptr = 0;
546 static int yy_start_stack_depth = 0;
547 static int *yy_start_stack = 0;
548 #ifndef YY_NO_PUSH_STATE
549 static void yy_push_state YY_PROTO(( int new_state ));
551 #ifndef YY_NO_POP_STATE
552 static void yy_pop_state YY_PROTO(( void ));
554 #ifndef YY_NO_TOP_STATE
555 static int yy_top_state YY_PROTO(( void ));
559 #define YY_NO_PUSH_STATE 1
560 #define YY_NO_POP_STATE 1
561 #define YY_NO_TOP_STATE 1
564 #ifdef YY_MALLOC_DECL
572 /* Just try to get by without declaring the routines. This will fail
573 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
574 * or sizeof(void*) != sizeof(int).
579 /* Amount of stuff to slurp up with each read. */
580 #ifndef YY_READ_BUF_SIZE
581 #define YY_READ_BUF_SIZE 8192
584 /* Copy whatever the last rule matched to the standard output. */
587 /* This used to be an fputs(), but since the string might contain NUL's,
588 * we now use fwrite().
590 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
593 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
594 * is returned in "result".
597 #define YY_INPUT(buf,result,max_size) \
598 if ( yy_current_buffer->yy_is_interactive ) \
601 for ( n = 0; n < max_size && \
602 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
605 buf[n++] = (char) c; \
606 if ( c == EOF && ferror( yyin ) ) \
607 YY_FATAL_ERROR( "input in flex scanner failed" ); \
610 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
611 && ferror( yyin ) ) \
612 YY_FATAL_ERROR( "input in flex scanner failed" );
615 /* No semi-colon after return; correct usage is to write "yyterminate();" -
616 * we don't want an extra ';' after the "return" because that will cause
617 * some compilers to complain about unreachable statements.
620 #define yyterminate() return YY_NULL
623 /* Number of entries by which start-condition stack grows. */
624 #ifndef YY_START_STACK_INCR
625 #define YY_START_STACK_INCR 25
628 /* Report a fatal error. */
629 #ifndef YY_FATAL_ERROR
630 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
633 /* Default declaration of generated scanner - a define so the user can
634 * easily add parameters.
637 #define YY_DECL int yylex YY_PROTO(( void ))
640 /* Code executed at the beginning of each rule, after yytext and yyleng
643 #ifndef YY_USER_ACTION
644 #define YY_USER_ACTION
647 /* Code executed at the end of each rule. */
649 #define YY_BREAK break;
652 #define YY_RULE_SETUP \
654 yy_current_buffer->yy_at_bol = \
655 (yytext[yyleng - 1] == '\n'); \
660 register yy_state_type yy_current_state;
661 register char *yy_cp = NULL, *yy_bp = NULL;
664 #line 65 "scripts/genksyms/lex.l"
668 /* Keep track of our location in the original source files. */
669 #line 670 "scripts/genksyms/lex.c"
680 yy_start = 1; /* first start state */
688 if ( ! yy_current_buffer )
690 yy_create_buffer( yyin, YY_BUF_SIZE );
692 yy_load_buffer_state();
695 while ( 1 ) /* loops until end-of-file is reached */
699 /* Support of yytext. */
700 *yy_cp = yy_hold_char;
702 /* yy_bp points to the position in yy_ch_buf of the start of
707 yy_current_state = yy_start;
708 yy_current_state += YY_AT_BOL();
712 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
713 if ( yy_accept[yy_current_state] )
715 yy_last_accepting_state = yy_current_state;
716 yy_last_accepting_cpos = yy_cp;
718 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
720 yy_current_state = (int) yy_def[yy_current_state];
721 if ( yy_current_state >= 76 )
722 yy_c = yy_meta[(unsigned int) yy_c];
724 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
727 while ( yy_base[yy_current_state] != 282 );
730 yy_act = yy_accept[yy_current_state];
732 { /* have to back up */
733 yy_cp = yy_last_accepting_cpos;
734 yy_current_state = yy_last_accepting_state;
735 yy_act = yy_accept[yy_current_state];
741 do_action: /* This label is used only to access EOF actions. */
746 fprintf( stderr, "--scanner backing up\n" );
747 else if ( yy_act < 13 )
748 fprintf( stderr, "--accepting rule at line %d (\"%s\")\n",
749 yy_rule_linenum[yy_act], yytext );
750 else if ( yy_act == 13 )
751 fprintf( stderr, "--accepting default rule (\"%s\")\n",
753 else if ( yy_act == 14 )
754 fprintf( stderr, "--(end of buffer or a NUL)\n" );
756 fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
760 { /* beginning of action switch */
761 case 0: /* must back up */
762 /* undo the effects of YY_DO_BEFORE_ACTION */
763 *yy_cp = yy_hold_char;
764 yy_cp = yy_last_accepting_cpos;
765 yy_current_state = yy_last_accepting_state;
770 #line 69 "scripts/genksyms/lex.l"
775 #line 70 "scripts/genksyms/lex.l"
780 #line 71 "scripts/genksyms/lex.l"
783 /* Ignore all other whitespace. */
786 #line 74 "scripts/genksyms/lex.l"
791 #line 77 "scripts/genksyms/lex.l"
796 #line 78 "scripts/genksyms/lex.l"
801 #line 79 "scripts/genksyms/lex.l"
804 /* The Pedant requires that the other C multi-character tokens be
805 recognized as tokens. We don't actually use them since we don't
806 parse expressions, but we do want whitespace to be arranged
807 around them properly. */
810 #line 85 "scripts/genksyms/lex.l"
815 #line 86 "scripts/genksyms/lex.l"
820 #line 87 "scripts/genksyms/lex.l"
825 #line 89 "scripts/genksyms/lex.l"
828 /* All other tokens are single characters. */
831 #line 92 "scripts/genksyms/lex.l"
836 #line 95 "scripts/genksyms/lex.l"
839 #line 840 "scripts/genksyms/lex.c"
840 case YY_STATE_EOF(INITIAL):
841 case YY_STATE_EOF(V2_TOKENS):
844 case YY_END_OF_BUFFER:
846 /* Amount of text matched not including the EOB char. */
847 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
849 /* Undo the effects of YY_DO_BEFORE_ACTION. */
850 *yy_cp = yy_hold_char;
851 YY_RESTORE_YY_MORE_OFFSET
853 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
855 /* We're scanning a new file or input source. It's
856 * possible that this happened because the user
857 * just pointed yyin at a new source and called
858 * yylex(). If so, then we have to assure
859 * consistency between yy_current_buffer and our
860 * globals. Here is the right place to do so, because
861 * this is the first action (other than possibly a
862 * back-up) that will match for the new input source.
864 yy_n_chars = yy_current_buffer->yy_n_chars;
865 yy_current_buffer->yy_input_file = yyin;
866 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
869 /* Note that here we test for yy_c_buf_p "<=" to the position
870 * of the first EOB in the buffer, since yy_c_buf_p will
871 * already have been incremented past the NUL character
872 * (since all states make transitions on EOB to the
873 * end-of-buffer state). Contrast this with the test
876 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
877 { /* This was really a NUL. */
878 yy_state_type yy_next_state;
880 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
882 yy_current_state = yy_get_previous_state();
884 /* Okay, we're now positioned to make the NUL
885 * transition. We couldn't have
886 * yy_get_previous_state() go ahead and do it
887 * for us because it doesn't know how to deal
888 * with the possibility of jamming (and we don't
889 * want to build jamming into it because then it
890 * will run more slowly).
893 yy_next_state = yy_try_NUL_trans( yy_current_state );
895 yy_bp = yytext_ptr + YY_MORE_ADJ;
899 /* Consume the NUL. */
900 yy_cp = ++yy_c_buf_p;
901 yy_current_state = yy_next_state;
912 else switch ( yy_get_next_buffer() )
914 case EOB_ACT_END_OF_FILE:
916 yy_did_buffer_switch_on_eof = 0;
920 /* Note: because we've taken care in
921 * yy_get_next_buffer() to have set up
922 * yytext, we can now set up
923 * yy_c_buf_p so that if some total
924 * hoser (like flex itself) wants to
925 * call the scanner after we return the
926 * YY_NULL, it'll still work - another
927 * YY_NULL will get returned.
929 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
931 yy_act = YY_STATE_EOF(YY_START);
937 if ( ! yy_did_buffer_switch_on_eof )
943 case EOB_ACT_CONTINUE_SCAN:
945 yytext_ptr + yy_amount_of_matched_text;
947 yy_current_state = yy_get_previous_state();
950 yy_bp = yytext_ptr + YY_MORE_ADJ;
953 case EOB_ACT_LAST_MATCH:
955 &yy_current_buffer->yy_ch_buf[yy_n_chars];
957 yy_current_state = yy_get_previous_state();
960 yy_bp = yytext_ptr + YY_MORE_ADJ;
968 "fatal flex scanner internal error--no action found" );
969 } /* end of action switch */
970 } /* end of scanning one token */
974 /* yy_get_next_buffer - try to read in a new buffer
976 * Returns a code representing an action:
977 * EOB_ACT_LAST_MATCH -
978 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
979 * EOB_ACT_END_OF_FILE - end of file
982 static int yy_get_next_buffer()
984 register char *dest = yy_current_buffer->yy_ch_buf;
985 register char *source = yytext_ptr;
986 register int number_to_move, i;
989 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
991 "fatal flex scanner internal error--end of buffer missed" );
993 if ( yy_current_buffer->yy_fill_buffer == 0 )
994 { /* Don't try to fill the buffer, so this is an EOF. */
995 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
997 /* We matched a single character, the EOB, so
998 * treat this as a final EOF.
1000 return EOB_ACT_END_OF_FILE;
1005 /* We matched some text prior to the EOB, first
1008 return EOB_ACT_LAST_MATCH;
1012 /* Try to read more data. */
1014 /* First move last chars to start of buffer. */
1015 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1017 for ( i = 0; i < number_to_move; ++i )
1018 *(dest++) = *(source++);
1020 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1021 /* don't do the read, it's not guaranteed to return an EOF,
1024 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1029 yy_current_buffer->yy_buf_size - number_to_move - 1;
1031 while ( num_to_read <= 0 )
1032 { /* Not enough room in the buffer - grow it. */
1033 #ifdef YY_USES_REJECT
1035 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1038 /* just a shorter name for the current buffer */
1039 YY_BUFFER_STATE b = yy_current_buffer;
1041 int yy_c_buf_p_offset =
1042 (int) (yy_c_buf_p - b->yy_ch_buf);
1044 if ( b->yy_is_our_buffer )
1046 int new_size = b->yy_buf_size * 2;
1048 if ( new_size <= 0 )
1049 b->yy_buf_size += b->yy_buf_size / 8;
1051 b->yy_buf_size *= 2;
1053 b->yy_ch_buf = (char *)
1054 /* Include room in for 2 EOB chars. */
1055 yy_flex_realloc( (void *) b->yy_ch_buf,
1056 b->yy_buf_size + 2 );
1059 /* Can't grow it, we don't own it. */
1062 if ( ! b->yy_ch_buf )
1064 "fatal error - scanner input buffer overflow" );
1066 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1068 num_to_read = yy_current_buffer->yy_buf_size -
1073 if ( num_to_read > YY_READ_BUF_SIZE )
1074 num_to_read = YY_READ_BUF_SIZE;
1076 /* Read in more data. */
1077 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1078 yy_n_chars, num_to_read );
1080 yy_current_buffer->yy_n_chars = yy_n_chars;
1083 if ( yy_n_chars == 0 )
1085 if ( number_to_move == YY_MORE_ADJ )
1087 ret_val = EOB_ACT_END_OF_FILE;
1093 ret_val = EOB_ACT_LAST_MATCH;
1094 yy_current_buffer->yy_buffer_status =
1095 YY_BUFFER_EOF_PENDING;
1100 ret_val = EOB_ACT_CONTINUE_SCAN;
1102 yy_n_chars += number_to_move;
1103 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1104 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1106 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1112 /* yy_get_previous_state - get the state just before the EOB char was reached */
1114 static yy_state_type yy_get_previous_state()
1116 register yy_state_type yy_current_state;
1117 register char *yy_cp;
1119 yy_current_state = yy_start;
1120 yy_current_state += YY_AT_BOL();
1122 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1124 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1125 if ( yy_accept[yy_current_state] )
1127 yy_last_accepting_state = yy_current_state;
1128 yy_last_accepting_cpos = yy_cp;
1130 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1132 yy_current_state = (int) yy_def[yy_current_state];
1133 if ( yy_current_state >= 76 )
1134 yy_c = yy_meta[(unsigned int) yy_c];
1136 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1139 return yy_current_state;
1143 /* yy_try_NUL_trans - try to make a transition on the NUL character
1146 * next_state = yy_try_NUL_trans( current_state );
1149 #ifdef YY_USE_PROTOS
1150 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1152 static yy_state_type yy_try_NUL_trans( yy_current_state )
1153 yy_state_type yy_current_state;
1156 register int yy_is_jam;
1157 register char *yy_cp = yy_c_buf_p;
1159 register YY_CHAR yy_c = 1;
1160 if ( yy_accept[yy_current_state] )
1162 yy_last_accepting_state = yy_current_state;
1163 yy_last_accepting_cpos = yy_cp;
1165 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1167 yy_current_state = (int) yy_def[yy_current_state];
1168 if ( yy_current_state >= 76 )
1169 yy_c = yy_meta[(unsigned int) yy_c];
1171 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1172 yy_is_jam = (yy_current_state == 75);
1174 return yy_is_jam ? 0 : yy_current_state;
1179 #ifdef YY_USE_PROTOS
1180 static void yyunput( int c, register char *yy_bp )
1182 static void yyunput( c, yy_bp )
1184 register char *yy_bp;
1187 register char *yy_cp = yy_c_buf_p;
1189 /* undo effects of setting up yytext */
1190 *yy_cp = yy_hold_char;
1192 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1193 { /* need to shift things up to make room */
1194 /* +2 for EOB chars. */
1195 register int number_to_move = yy_n_chars + 2;
1196 register char *dest = &yy_current_buffer->yy_ch_buf[
1197 yy_current_buffer->yy_buf_size + 2];
1198 register char *source =
1199 &yy_current_buffer->yy_ch_buf[number_to_move];
1201 while ( source > yy_current_buffer->yy_ch_buf )
1202 *--dest = *--source;
1204 yy_cp += (int) (dest - source);
1205 yy_bp += (int) (dest - source);
1206 yy_current_buffer->yy_n_chars =
1207 yy_n_chars = yy_current_buffer->yy_buf_size;
1209 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1210 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1213 *--yy_cp = (char) c;
1217 yy_hold_char = *yy_cp;
1220 #endif /* ifndef YY_NO_UNPUT */
1224 static int yyinput()
1231 *yy_c_buf_p = yy_hold_char;
1233 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1235 /* yy_c_buf_p now points to the character we want to return.
1236 * If this occurs *before* the EOB characters, then it's a
1237 * valid NUL; if not, then we've hit the end of the buffer.
1239 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1240 /* This was really a NUL. */
1244 { /* need more input */
1245 int offset = yy_c_buf_p - yytext_ptr;
1248 switch ( yy_get_next_buffer() )
1250 case EOB_ACT_LAST_MATCH:
1251 /* This happens because yy_g_n_b()
1252 * sees that we've accumulated a
1253 * token and flags that we need to
1254 * try matching the token before
1255 * proceeding. But for input(),
1256 * there's no matching to consider.
1257 * So convert the EOB_ACT_LAST_MATCH
1258 * to EOB_ACT_END_OF_FILE.
1261 /* Reset buffer status. */
1266 case EOB_ACT_END_OF_FILE:
1271 if ( ! yy_did_buffer_switch_on_eof )
1280 case EOB_ACT_CONTINUE_SCAN:
1281 yy_c_buf_p = yytext_ptr + offset;
1287 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1288 *yy_c_buf_p = '\0'; /* preserve yytext */
1289 yy_hold_char = *++yy_c_buf_p;
1291 yy_current_buffer->yy_at_bol = (c == '\n');
1297 #ifdef YY_USE_PROTOS
1298 void yyrestart( FILE *input_file )
1300 void yyrestart( input_file )
1304 if ( ! yy_current_buffer )
1305 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1307 yy_init_buffer( yy_current_buffer, input_file );
1308 yy_load_buffer_state();
1312 #ifdef YY_USE_PROTOS
1313 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1315 void yy_switch_to_buffer( new_buffer )
1316 YY_BUFFER_STATE new_buffer;
1319 if ( yy_current_buffer == new_buffer )
1322 if ( yy_current_buffer )
1324 /* Flush out information for old buffer. */
1325 *yy_c_buf_p = yy_hold_char;
1326 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1327 yy_current_buffer->yy_n_chars = yy_n_chars;
1330 yy_current_buffer = new_buffer;
1331 yy_load_buffer_state();
1333 /* We don't actually know whether we did this switch during
1334 * EOF (yywrap()) processing, but the only time this flag
1335 * is looked at is after yywrap() is called, so it's safe
1336 * to go ahead and always set it.
1338 yy_did_buffer_switch_on_eof = 1;
1342 #ifdef YY_USE_PROTOS
1343 void yy_load_buffer_state( void )
1345 void yy_load_buffer_state()
1348 yy_n_chars = yy_current_buffer->yy_n_chars;
1349 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1350 yyin = yy_current_buffer->yy_input_file;
1351 yy_hold_char = *yy_c_buf_p;
1355 #ifdef YY_USE_PROTOS
1356 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1358 YY_BUFFER_STATE yy_create_buffer( file, size )
1365 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1367 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1369 b->yy_buf_size = size;
1371 /* yy_ch_buf has to be 2 characters longer than the size given because
1372 * we need to put in 2 end-of-buffer characters.
1374 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1375 if ( ! b->yy_ch_buf )
1376 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1378 b->yy_is_our_buffer = 1;
1380 yy_init_buffer( b, file );
1386 #ifdef YY_USE_PROTOS
1387 void yy_delete_buffer( YY_BUFFER_STATE b )
1389 void yy_delete_buffer( b )
1396 if ( b == yy_current_buffer )
1397 yy_current_buffer = (YY_BUFFER_STATE) 0;
1399 if ( b->yy_is_our_buffer )
1400 yy_flex_free( (void *) b->yy_ch_buf );
1402 yy_flex_free( (void *) b );
1407 #ifdef YY_USE_PROTOS
1408 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1410 void yy_init_buffer( b, file )
1417 yy_flush_buffer( b );
1419 b->yy_input_file = file;
1420 b->yy_fill_buffer = 1;
1422 #if YY_ALWAYS_INTERACTIVE
1423 b->yy_is_interactive = 1;
1425 #if YY_NEVER_INTERACTIVE
1426 b->yy_is_interactive = 0;
1428 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1434 #ifdef YY_USE_PROTOS
1435 void yy_flush_buffer( YY_BUFFER_STATE b )
1437 void yy_flush_buffer( b )
1447 /* We always need two end-of-buffer characters. The first causes
1448 * a transition to the end-of-buffer state. The second causes
1449 * a jam in that state.
1451 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1452 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1454 b->yy_buf_pos = &b->yy_ch_buf[0];
1457 b->yy_buffer_status = YY_BUFFER_NEW;
1459 if ( b == yy_current_buffer )
1460 yy_load_buffer_state();
1464 #ifndef YY_NO_SCAN_BUFFER
1465 #ifdef YY_USE_PROTOS
1466 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1468 YY_BUFFER_STATE yy_scan_buffer( base, size )
1476 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1477 base[size-1] != YY_END_OF_BUFFER_CHAR )
1478 /* They forgot to leave room for the EOB's. */
1481 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1483 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1485 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1486 b->yy_buf_pos = b->yy_ch_buf = base;
1487 b->yy_is_our_buffer = 0;
1488 b->yy_input_file = 0;
1489 b->yy_n_chars = b->yy_buf_size;
1490 b->yy_is_interactive = 0;
1492 b->yy_fill_buffer = 0;
1493 b->yy_buffer_status = YY_BUFFER_NEW;
1495 yy_switch_to_buffer( b );
1502 #ifndef YY_NO_SCAN_STRING
1503 #ifdef YY_USE_PROTOS
1504 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1506 YY_BUFFER_STATE yy_scan_string( yy_str )
1507 yyconst char *yy_str;
1511 for ( len = 0; yy_str[len]; ++len )
1514 return yy_scan_bytes( yy_str, len );
1519 #ifndef YY_NO_SCAN_BYTES
1520 #ifdef YY_USE_PROTOS
1521 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1523 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1524 yyconst char *bytes;
1533 /* Get memory for full buffer, including space for trailing EOB's. */
1535 buf = (char *) yy_flex_alloc( n );
1537 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1539 for ( i = 0; i < len; ++i )
1542 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1544 b = yy_scan_buffer( buf, n );
1546 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1548 /* It's okay to grow etc. this buffer, and we should throw it
1549 * away when we're done.
1551 b->yy_is_our_buffer = 1;
1558 #ifndef YY_NO_PUSH_STATE
1559 #ifdef YY_USE_PROTOS
1560 static void yy_push_state( int new_state )
1562 static void yy_push_state( new_state )
1566 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1570 yy_start_stack_depth += YY_START_STACK_INCR;
1571 new_size = yy_start_stack_depth * sizeof( int );
1573 if ( ! yy_start_stack )
1574 yy_start_stack = (int *) yy_flex_alloc( new_size );
1577 yy_start_stack = (int *) yy_flex_realloc(
1578 (void *) yy_start_stack, new_size );
1580 if ( ! yy_start_stack )
1582 "out of memory expanding start-condition stack" );
1585 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1592 #ifndef YY_NO_POP_STATE
1593 static void yy_pop_state()
1595 if ( --yy_start_stack_ptr < 0 )
1596 YY_FATAL_ERROR( "start-condition stack underflow" );
1598 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1603 #ifndef YY_NO_TOP_STATE
1604 static int yy_top_state()
1606 return yy_start_stack[yy_start_stack_ptr - 1];
1610 #ifndef YY_EXIT_FAILURE
1611 #define YY_EXIT_FAILURE 2
1614 #ifdef YY_USE_PROTOS
1615 static void yy_fatal_error( yyconst char msg[] )
1617 static void yy_fatal_error( msg )
1621 (void) fprintf( stderr, "%s\n", msg );
1622 exit( YY_EXIT_FAILURE );
1627 /* Redefine yyless() so it works in section 3 code. */
1633 /* Undo effects of setting up yytext. */ \
1634 yytext[yyleng] = yy_hold_char; \
1635 yy_c_buf_p = yytext + n; \
1636 yy_hold_char = *yy_c_buf_p; \
1637 *yy_c_buf_p = '\0'; \
1643 /* Internal utility routines. */
1646 #ifdef YY_USE_PROTOS
1647 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1649 static void yy_flex_strncpy( s1, s2, n )
1656 for ( i = 0; i < n; ++i )
1661 #ifdef YY_NEED_STRLEN
1662 #ifdef YY_USE_PROTOS
1663 static int yy_flex_strlen( yyconst char *s )
1665 static int yy_flex_strlen( s )
1670 for ( n = 0; s[n]; ++n )
1678 #ifdef YY_USE_PROTOS
1679 static void *yy_flex_alloc( yy_size_t size )
1681 static void *yy_flex_alloc( size )
1685 return (void *) malloc( size );
1688 #ifdef YY_USE_PROTOS
1689 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1691 static void *yy_flex_realloc( ptr, size )
1696 /* The cast to (char *) in the following accommodates both
1697 * implementations that use char* generic pointers, and those
1698 * that use void* generic pointers. It works with the latter
1699 * because both ANSI C and C++ allow castless assignment from
1700 * any pointer type to void*, and deal with argument conversions
1701 * as though doing an assignment.
1703 return (void *) realloc( (char *) ptr, size );
1706 #ifdef YY_USE_PROTOS
1707 static void yy_flex_free( void *ptr )
1709 static void yy_flex_free( ptr )
1723 #line 95 "scripts/genksyms/lex.l"
1726 /* Bring in the keyword recognizer. */
1728 #include "keywords.c"
1731 /* Macros to append to our phrase collection list. */
1733 #define _APP(T,L) do { \
1734 cur_node = next_node; \
1735 next_node = xmalloc(sizeof(*next_node)); \
1736 next_node->next = cur_node; \
1737 cur_node->string = memcpy(xmalloc(L+1), T, L+1); \
1738 cur_node->tag = SYM_NORMAL; \
1741 #define APP _APP(yytext, yyleng)
1744 /* The second stage lexer. Here we incorporate knowledge of the state
1745 of the parser to tailor the tokens that are returned. */
1751 ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_BRACKET, ST_BRACE,
1752 ST_EXPRESSION, ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4,
1753 ST_TABLE_5, ST_TABLE_6
1754 } lexstate = ST_NOTSTARTED;
1756 static int suppress_type_lookup, dont_want_brace_phrase;
1757 static struct string_list *next_node;
1759 int token, count = 0;
1760 struct string_list *cur_node;
1762 if (lexstate == ST_NOTSTARTED)
1765 next_node = xmalloc(sizeof(*next_node));
1766 next_node->next = NULL;
1767 lexstate = ST_NORMAL;
1775 else if (token == FILENAME)
1779 /* Save the filename and line number for later error messages. */
1784 file = strchr(yytext, '\"')+1;
1785 e = strchr(file, '\"');
1787 cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
1788 cur_line = atoi(yytext+2);
1801 const struct resword *r = is_reserved_word(yytext, yyleng);
1804 switch (token = r->token)
1806 case ATTRIBUTE_KEYW:
1807 lexstate = ST_ATTRIBUTE;
1817 dont_want_brace_phrase = 3;
1819 suppress_type_lookup = 2;
1822 case EXPORT_SYMBOL_KEYW:
1826 if (!suppress_type_lookup)
1828 struct symbol *sym = find_symbol(yytext, SYM_TYPEDEF);
1829 if (sym && sym->type == SYM_TYPEDEF)
1837 lexstate = ST_BRACKET;
1843 if (dont_want_brace_phrase)
1845 lexstate = ST_BRACE;
1851 lexstate = ST_EXPRESSION;
1871 lexstate = ST_NORMAL;
1872 token = ATTRIBUTE_PHRASE;
1891 lexstate = ST_NORMAL;
1911 lexstate = ST_NORMAL;
1912 token = BRACKET_PHRASE;
1931 lexstate = ST_NORMAL;
1932 token = BRACE_PHRASE;
1944 case '(': case '[': case '{':
1948 case ')': case ']': case '}':
1955 /* Put back the token we just read so's we can find it again
1956 after registering the expression. */
1959 lexstate = ST_NORMAL;
1960 token = EXPRESSION_PHRASE;
1975 if (token == IDENT && yyleng == 1 && yytext[0] == 'X')
1977 token = EXPORT_SYMBOL_KEYW;
1978 lexstate = ST_TABLE_5;
1982 lexstate = ST_TABLE_6;
1988 case '{': case '[': case '(':
1991 case '}': case ']': case ')':
1996 lexstate = ST_TABLE_2;
2006 lexstate = ST_NORMAL;
2014 lexstate = ST_TABLE_2;
2028 if (suppress_type_lookup > 0)
2029 --suppress_type_lookup;
2030 if (dont_want_brace_phrase > 0)
2031 --dont_want_brace_phrase;
2033 yylval = &next_node->next;
2040 #define ASM_KEYW 257
2041 #define ATTRIBUTE_KEYW 258
2042 #define AUTO_KEYW 259
2043 #define BOOL_KEYW 260
2044 #define CHAR_KEYW 261
2045 #define CONST_KEYW 262
2046 #define DOUBLE_KEYW 263
2047 #define ENUM_KEYW 264
2048 #define EXTERN_KEYW 265
2049 #define FLOAT_KEYW 266
2050 #define INLINE_KEYW 267
2051 #define INT_KEYW 268
2052 #define LONG_KEYW 269
2053 #define REGISTER_KEYW 270
2054 #define RESTRICT_KEYW 271
2055 #define SHORT_KEYW 272
2056 #define SIGNED_KEYW 273
2057 #define STATIC_KEYW 274
2058 #define STRUCT_KEYW 275
2059 #define TYPEDEF_KEYW 276
2060 #define UNION_KEYW 277
2061 #define UNSIGNED_KEYW 278
2062 #define VOID_KEYW 279
2063 #define VOLATILE_KEYW 280
2064 #define TYPEOF_KEYW 281
2065 #define EXPORT_SYMBOL_KEYW 282
2066 #define ASM_PHRASE 283
2067 #define ATTRIBUTE_PHRASE 284
2068 #define BRACE_PHRASE 285
2069 #define BRACKET_PHRASE 286
2070 #define EXPRESSION_PHRASE 287
2079 #define FILENAME 296
2082 extern YYSTYPE yylval;