Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / scripts / genksyms / lex.c_shipped
blobd9bfbb5948f2bb1dd42dd8d0760a1c3e008b7e98
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 $
6  */
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
12 #include <stdio.h>
13 #include <unistd.h>
16 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
17 #ifdef c_plusplus
18 #ifndef __cplusplus
19 #define __cplusplus
20 #endif
21 #endif
24 #ifdef __cplusplus
26 #include <stdlib.h>
28 /* Use prototypes in function declarations. */
29 #define YY_USE_PROTOS
31 /* The "const" storage-class-modifier is valid. */
32 #define YY_USE_CONST
34 #else   /* ! __cplusplus */
36 #if __STDC__
38 #define YY_USE_PROTOS
39 #define YY_USE_CONST
41 #endif  /* __STDC__ */
42 #endif  /* ! __cplusplus */
44 #ifdef __TURBOC__
45  #pragma warn -rch
46  #pragma warn -use
47 #include <io.h>
48 #include <stdlib.h>
49 #define YY_USE_CONST
50 #define YY_USE_PROTOS
51 #endif
53 #ifdef YY_USE_CONST
54 #define yyconst const
55 #else
56 #define yyconst
57 #endif
60 #ifdef YY_USE_PROTOS
61 #define YY_PROTO(proto) proto
62 #else
63 #define YY_PROTO(proto) ()
64 #endif
66 /* Returned upon end-of-file. */
67 #define YY_NULL 0
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
72  * double cast.
73  */
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.
79  */
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
84  * compatibility.
85  */
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;
102 extern int yyleng;
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 )
114  *              yyless( 5 );
115  *      else
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.
121  */
123 /* Return all but the first 'n' matched characters back to the input stream. */
125 #define yyless(n) \
126         do \
127                 { \
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 */ \
133                 } \
134         while ( 0 )
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).
141  */
142 typedef unsigned int yy_size_t;
145 struct yy_buffer_state
146         {
147         FILE *yy_input_file;
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
153          * characters.
154          */
155         yy_size_t yy_buf_size;
157         /* Number of characters read into yy_ch_buf, not including EOB
158          * characters.
159          */
160         int yy_n_chars;
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
164          * delete it.
165          */
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
171          * each newline.
172          */
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
177          * not.
178          */
179         int yy_at_bol;
181         /* Whether to try to fill the input buffer when we reach the
182          * end of it.
183          */
184         int yy_fill_buffer;
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.
194          *
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.
198          */
199 #define YY_BUFFER_EOF_PENDING 2
200         };
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
206  * "scanner state".
207  */
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 */
217 int yyleng;
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 ...
226  */
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) \
250         { \
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; \
254         }
256 #define yy_set_bol(at_bol) \
257         { \
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; \
261         }
263 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
266 #define yywrap() 1
267 #define YY_SKIP_YYWRAP
269 #define FLEX_DEBUG
270 typedef unsigned char YY_CHAR;
271 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
272 typedef int yy_state_type;
274 #define FLEX_DEBUG
275 extern char *yytext;
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.
285  */
286 #define YY_DO_BEFORE_ACTION \
287         yytext_ptr = yy_bp; \
288         yyleng = (int) (yy_cp - yy_bp); \
289         yy_hold_char = *yy_cp; \
290         *yy_cp = '\0'; \
291         yy_c_buf_p = yy_cp;
293 #define YY_NUM_RULES 13
294 #define YY_END_OF_BUFFER 14
295 static yyconst short int yy_accept[76] =
296     {   0,
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,
304         0,    0,    0,    1,    0
305     } ;
307 static yyconst int yy_ec[256] =
308     {   0,
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,
336         1,    1,    1,    1,    1
337     } ;
339 static yyconst int yy_meta[29] =
340     {   0,
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
344     } ;
346 static yyconst short int yy_base[88] =
347     {   0,
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
357     } ;
359 static yyconst short int yy_def[88] =
360     {   0,
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
370     } ;
372 static yyconst short int yy_nxt[313] =
373     {   0,
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,
408        75,   75
409     } ;
411 static yyconst short int yy_chk[313] =
412     {   0,
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,
447        75,   75
448     } ;
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] =
457     {   0,
458        69,   70,   71,   74,   77,   78,   79,   85,   86,   87,
459        89,   92
460     } ;
462 /* The intent behind this definition is that it'll catch
463  * any uses of REJECT which flex missed.
464  */
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
469 char *yytext;
470 #line 1 "scripts/genksyms/lex.l"
471 #define INITIAL 0
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"
495 #include <limits.h>
496 #include <stdlib.h>
497 #include <string.h>
498 #include <ctype.h>
500 #include "genksyms.h"
501 #include "parse.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.  */
509 #define V2_TOKENS 1
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
515  * section 1.
516  */
518 #ifndef YY_SKIP_YYWRAP
519 #ifdef __cplusplus
520 extern "C" int yywrap YY_PROTO(( void ));
521 #else
522 extern int yywrap YY_PROTO(( void ));
523 #endif
524 #endif
526 #ifndef YY_NO_UNPUT
527 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
528 #endif
530 #ifndef yytext_ptr
531 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
532 #endif
534 #ifdef YY_NEED_STRLEN
535 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
536 #endif
538 #ifndef YY_NO_INPUT
539 #ifdef __cplusplus
540 static int yyinput YY_PROTO(( void ));
541 #else
542 static int input YY_PROTO(( void ));
543 #endif
544 #endif
546 #if YY_STACK_USED
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 ));
552 #endif
553 #ifndef YY_NO_POP_STATE
554 static void yy_pop_state YY_PROTO(( void ));
555 #endif
556 #ifndef YY_NO_TOP_STATE
557 static int yy_top_state YY_PROTO(( void ));
558 #endif
560 #else
561 #define YY_NO_PUSH_STATE 1
562 #define YY_NO_POP_STATE 1
563 #define YY_NO_TOP_STATE 1
564 #endif
566 #ifdef YY_MALLOC_DECL
567 YY_MALLOC_DECL
568 #else
569 #if __STDC__
570 #ifndef __cplusplus
571 #include <stdlib.h>
572 #endif
573 #else
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).
577  */
578 #endif
579 #endif
581 /* Amount of stuff to slurp up with each read. */
582 #ifndef YY_READ_BUF_SIZE
583 #define YY_READ_BUF_SIZE 8192
584 #endif
586 /* Copy whatever the last rule matched to the standard output. */
588 #ifndef ECHO
589 /* This used to be an fputs(), but since the string might contain NUL's,
590  * we now use fwrite().
591  */
592 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
593 #endif
595 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
596  * is returned in "result".
597  */
598 #ifndef YY_INPUT
599 #define YY_INPUT(buf,result,max_size) \
600         if ( yy_current_buffer->yy_is_interactive ) \
601                 { \
602                 int c = '*', n; \
603                 for ( n = 0; n < max_size && \
604                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
605                         buf[n] = (char) c; \
606                 if ( c == '\n' ) \
607                         buf[n++] = (char) c; \
608                 if ( c == EOF && ferror( yyin ) ) \
609                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
610                 result = n; \
611                 } \
612         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
613                   && ferror( yyin ) ) \
614                 YY_FATAL_ERROR( "input in flex scanner failed" );
615 #endif
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.
620  */
621 #ifndef yyterminate
622 #define yyterminate() return YY_NULL
623 #endif
625 /* Number of entries by which start-condition stack grows. */
626 #ifndef YY_START_STACK_INCR
627 #define YY_START_STACK_INCR 25
628 #endif
630 /* Report a fatal error. */
631 #ifndef YY_FATAL_ERROR
632 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
633 #endif
635 /* Default declaration of generated scanner - a define so the user can
636  * easily add parameters.
637  */
638 #ifndef YY_DECL
639 #define YY_DECL int yylex YY_PROTO(( void ))
640 #endif
642 /* Code executed at the beginning of each rule, after yytext and yyleng
643  * have been set up.
644  */
645 #ifndef YY_USER_ACTION
646 #define YY_USER_ACTION
647 #endif
649 /* Code executed at the end of each rule. */
650 #ifndef YY_BREAK
651 #define YY_BREAK break;
652 #endif
654 #define YY_RULE_SETUP \
655         if ( yyleng > 0 ) \
656                 yy_current_buffer->yy_at_bol = \
657                                 (yytext[yyleng - 1] == '\n'); \
658         YY_USER_ACTION
660 YY_DECL
661         {
662         register yy_state_type yy_current_state;
663         register char *yy_cp = NULL, *yy_bp = NULL;
664         register int yy_act;
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"
673         if ( yy_init )
674                 {
675                 yy_init = 0;
677 #ifdef YY_USER_INIT
678                 YY_USER_INIT;
679 #endif
681                 if ( ! yy_start )
682                         yy_start = 1;   /* first start state */
684                 if ( ! yyin )
685                         yyin = stdin;
687                 if ( ! yyout )
688                         yyout = stdout;
690                 if ( ! yy_current_buffer )
691                         yy_current_buffer =
692                                 yy_create_buffer( yyin, YY_BUF_SIZE );
694                 yy_load_buffer_state();
695                 }
697         while ( 1 )             /* loops until end-of-file is reached */
698                 {
699                 yy_cp = yy_c_buf_p;
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
705                  * the current run.
706                  */
707                 yy_bp = yy_cp;
709                 yy_current_state = yy_start;
710                 yy_current_state += YY_AT_BOL();
711 yy_match:
712                 do
713                         {
714                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
715                         if ( yy_accept[yy_current_state] )
716                                 {
717                                 yy_last_accepting_state = yy_current_state;
718                                 yy_last_accepting_cpos = yy_cp;
719                                 }
720                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
721                                 {
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];
725                                 }
726                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
727                         ++yy_cp;
728                         }
729                 while ( yy_base[yy_current_state] != 284 );
731 yy_find_action:
732                 yy_act = yy_accept[yy_current_state];
733                 if ( yy_act == 0 )
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];
738                         }
740                 YY_DO_BEFORE_ACTION;
743 do_action:      /* This label is used only to access EOF actions. */
745                 if ( yy_flex_debug )
746                         {
747                         if ( yy_act == 0 )
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",
754                                          yytext );
755                         else if ( yy_act == 14 )
756                                 fprintf( stderr, "--(end of buffer or a NUL)\n" );
757                         else
758                                 fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
759                         }
761                 switch ( yy_act )
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;
768                         goto yy_find_action;
770 case 1:
771 YY_RULE_SETUP
772 #line 69 "scripts/genksyms/lex.l"
773 return FILENAME;
774         YY_BREAK
775 case 2:
776 YY_RULE_SETUP
777 #line 70 "scripts/genksyms/lex.l"
778 cur_line++;
779         YY_BREAK
780 case 3:
781 YY_RULE_SETUP
782 #line 71 "scripts/genksyms/lex.l"
783 cur_line++;
784         YY_BREAK
785 /* Ignore all other whitespace.  */
786 case 4:
787 YY_RULE_SETUP
788 #line 74 "scripts/genksyms/lex.l"
790         YY_BREAK
791 case 5:
792 YY_RULE_SETUP
793 #line 77 "scripts/genksyms/lex.l"
794 return STRING;
795         YY_BREAK
796 case 6:
797 YY_RULE_SETUP
798 #line 78 "scripts/genksyms/lex.l"
799 return CHAR;
800         YY_BREAK
801 case 7:
802 YY_RULE_SETUP
803 #line 79 "scripts/genksyms/lex.l"
804 return IDENT;
805         YY_BREAK
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.  */
810 case 8:
811 YY_RULE_SETUP
812 #line 85 "scripts/genksyms/lex.l"
813 return OTHER;
814         YY_BREAK
815 case 9:
816 YY_RULE_SETUP
817 #line 86 "scripts/genksyms/lex.l"
818 return INT;
819         YY_BREAK
820 case 10:
821 YY_RULE_SETUP
822 #line 87 "scripts/genksyms/lex.l"
823 return REAL;
824         YY_BREAK
825 case 11:
826 YY_RULE_SETUP
827 #line 89 "scripts/genksyms/lex.l"
828 return DOTS;
829         YY_BREAK
830 /* All other tokens are single characters.  */
831 case 12:
832 YY_RULE_SETUP
833 #line 92 "scripts/genksyms/lex.l"
834 return yytext[0];
835         YY_BREAK
836 case 13:
837 YY_RULE_SETUP
838 #line 95 "scripts/genksyms/lex.l"
839 ECHO;
840         YY_BREAK
841 #line 842 "scripts/genksyms/lex.c"
842 case YY_STATE_EOF(INITIAL):
843 case YY_STATE_EOF(V2_TOKENS):
844         yyterminate();
846         case YY_END_OF_BUFFER:
847                 {
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 )
856                         {
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.
865                          */
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;
869                         }
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
876                  * in input().
877                  */
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).
893                          */
895                         yy_next_state = yy_try_NUL_trans( yy_current_state );
897                         yy_bp = yytext_ptr + YY_MORE_ADJ;
899                         if ( yy_next_state )
900                                 {
901                                 /* Consume the NUL. */
902                                 yy_cp = ++yy_c_buf_p;
903                                 yy_current_state = yy_next_state;
904                                 goto yy_match;
905                                 }
907                         else
908                                 {
909                                 yy_cp = yy_c_buf_p;
910                                 goto yy_find_action;
911                                 }
912                         }
914                 else switch ( yy_get_next_buffer() )
915                         {
916                         case EOB_ACT_END_OF_FILE:
917                                 {
918                                 yy_did_buffer_switch_on_eof = 0;
920                                 if ( yywrap() )
921                                         {
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.
930                                          */
931                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
933                                         yy_act = YY_STATE_EOF(YY_START);
934                                         goto do_action;
935                                         }
937                                 else
938                                         {
939                                         if ( ! yy_did_buffer_switch_on_eof )
940                                                 YY_NEW_FILE;
941                                         }
942                                 break;
943                                 }
945                         case EOB_ACT_CONTINUE_SCAN:
946                                 yy_c_buf_p =
947                                         yytext_ptr + yy_amount_of_matched_text;
949                                 yy_current_state = yy_get_previous_state();
951                                 yy_cp = yy_c_buf_p;
952                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
953                                 goto yy_match;
955                         case EOB_ACT_LAST_MATCH:
956                                 yy_c_buf_p =
957                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
959                                 yy_current_state = yy_get_previous_state();
961                                 yy_cp = yy_c_buf_p;
962                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
963                                 goto yy_find_action;
964                         }
965                 break;
966                 }
968         default:
969                 YY_FATAL_ERROR(
970                         "fatal flex scanner internal error--no action found" );
971         } /* end of action switch */
972                 } /* end of scanning one token */
973         } /* end of yylex */
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
982  */
984 static int yy_get_next_buffer()
985         {
986         register char *dest = yy_current_buffer->yy_ch_buf;
987         register char *source = yytext_ptr;
988         register int number_to_move, i;
989         int ret_val;
991         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
992                 YY_FATAL_ERROR(
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 )
998                         {
999                         /* We matched a single character, the EOB, so
1000                          * treat this as a final EOF.
1001                          */
1002                         return EOB_ACT_END_OF_FILE;
1003                         }
1005                 else
1006                         {
1007                         /* We matched some text prior to the EOB, first
1008                          * process it.
1009                          */
1010                         return EOB_ACT_LAST_MATCH;
1011                         }
1012                 }
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,
1024                  * just force an EOF
1025                  */
1026                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1028         else
1029                 {
1030                 int num_to_read =
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
1036                         YY_FATAL_ERROR(
1037 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1038 #else
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 )
1047                                 {
1048                                 int new_size = b->yy_buf_size * 2;
1050                                 if ( new_size <= 0 )
1051                                         b->yy_buf_size += b->yy_buf_size / 8;
1052                                 else
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 );
1059                                 }
1060                         else
1061                                 /* Can't grow it, we don't own it. */
1062                                 b->yy_ch_buf = 0;
1064                         if ( ! b->yy_ch_buf )
1065                                 YY_FATAL_ERROR(
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 -
1071                                                 number_to_move - 1;
1072 #endif
1073                         }
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;
1083                 }
1085         if ( yy_n_chars == 0 )
1086                 {
1087                 if ( number_to_move == YY_MORE_ADJ )
1088                         {
1089                         ret_val = EOB_ACT_END_OF_FILE;
1090                         yyrestart( yyin );
1091                         }
1093                 else
1094                         {
1095                         ret_val = EOB_ACT_LAST_MATCH;
1096                         yy_current_buffer->yy_buffer_status =
1097                                 YY_BUFFER_EOF_PENDING;
1098                         }
1099                 }
1101         else
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];
1110         return ret_val;
1111         }
1114 /* yy_get_previous_state - get the state just before the EOB char was reached */
1116 static yy_state_type yy_get_previous_state()
1117         {
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 )
1125                 {
1126                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1127                 if ( yy_accept[yy_current_state] )
1128                         {
1129                         yy_last_accepting_state = yy_current_state;
1130                         yy_last_accepting_cpos = yy_cp;
1131                         }
1132                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1133                         {
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];
1137                         }
1138                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1139                 }
1141         return yy_current_state;
1142         }
1145 /* yy_try_NUL_trans - try to make a transition on the NUL character
1147  * synopsis
1148  *      next_state = yy_try_NUL_trans( current_state );
1149  */
1151 #ifdef YY_USE_PROTOS
1152 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1153 #else
1154 static yy_state_type yy_try_NUL_trans( yy_current_state )
1155 yy_state_type yy_current_state;
1156 #endif
1157         {
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] )
1163                 {
1164                 yy_last_accepting_state = yy_current_state;
1165                 yy_last_accepting_cpos = yy_cp;
1166                 }
1167         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1168                 {
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];
1172                 }
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;
1177         }
1180 #ifndef YY_NO_UNPUT
1181 #ifdef YY_USE_PROTOS
1182 static void yyunput( int c, register char *yy_bp )
1183 #else
1184 static void yyunput( c, yy_bp )
1185 int c;
1186 register char *yy_bp;
1187 #endif
1188         {
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" );
1213                 }
1215         *--yy_cp = (char) c;
1218         yytext_ptr = yy_bp;
1219         yy_hold_char = *yy_cp;
1220         yy_c_buf_p = yy_cp;
1221         }
1222 #endif  /* ifndef YY_NO_UNPUT */
1225 #ifdef __cplusplus
1226 static int yyinput()
1227 #else
1228 static int input()
1229 #endif
1230         {
1231         int c;
1233         *yy_c_buf_p = yy_hold_char;
1235         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1236                 {
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.
1240                  */
1241                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1242                         /* This was really a NUL. */
1243                         *yy_c_buf_p = '\0';
1245                 else
1246                         { /* need more input */
1247                         int offset = yy_c_buf_p - yytext_ptr;
1248                         ++yy_c_buf_p;
1250                         switch ( yy_get_next_buffer() )
1251                                 {
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.
1261                                          */
1263                                         /* Reset buffer status. */
1264                                         yyrestart( yyin );
1266                                         /* fall through */
1268                                 case EOB_ACT_END_OF_FILE:
1269                                         {
1270                                         if ( yywrap() )
1271                                                 return EOF;
1273                                         if ( ! yy_did_buffer_switch_on_eof )
1274                                                 YY_NEW_FILE;
1275 #ifdef __cplusplus
1276                                         return yyinput();
1277 #else
1278                                         return input();
1279 #endif
1280                                         }
1282                                 case EOB_ACT_CONTINUE_SCAN:
1283                                         yy_c_buf_p = yytext_ptr + offset;
1284                                         break;
1285                                 }
1286                         }
1287                 }
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');
1295         return c;
1296         }
1299 #ifdef YY_USE_PROTOS
1300 void yyrestart( FILE *input_file )
1301 #else
1302 void yyrestart( input_file )
1303 FILE *input_file;
1304 #endif
1305         {
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();
1311         }
1314 #ifdef YY_USE_PROTOS
1315 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1316 #else
1317 void yy_switch_to_buffer( new_buffer )
1318 YY_BUFFER_STATE new_buffer;
1319 #endif
1320         {
1321         if ( yy_current_buffer == new_buffer )
1322                 return;
1324         if ( yy_current_buffer )
1325                 {
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;
1330                 }
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.
1339          */
1340         yy_did_buffer_switch_on_eof = 1;
1341         }
1344 #ifdef YY_USE_PROTOS
1345 void yy_load_buffer_state( void )
1346 #else
1347 void yy_load_buffer_state()
1348 #endif
1349         {
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;
1354         }
1357 #ifdef YY_USE_PROTOS
1358 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1359 #else
1360 YY_BUFFER_STATE yy_create_buffer( file, size )
1361 FILE *file;
1362 int size;
1363 #endif
1364         {
1365         YY_BUFFER_STATE b;
1367         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1368         if ( ! b )
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.
1375          */
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 );
1384         return b;
1385         }
1388 #ifdef YY_USE_PROTOS
1389 void yy_delete_buffer( YY_BUFFER_STATE b )
1390 #else
1391 void yy_delete_buffer( b )
1392 YY_BUFFER_STATE b;
1393 #endif
1394         {
1395         if ( ! b )
1396                 return;
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 );
1405         }
1409 #ifdef YY_USE_PROTOS
1410 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1411 #else
1412 void yy_init_buffer( b, file )
1413 YY_BUFFER_STATE b;
1414 FILE *file;
1415 #endif
1418         {
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;
1426 #else
1427 #if YY_NEVER_INTERACTIVE
1428         b->yy_is_interactive = 0;
1429 #else
1430         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1431 #endif
1432 #endif
1433         }
1436 #ifdef YY_USE_PROTOS
1437 void yy_flush_buffer( YY_BUFFER_STATE b )
1438 #else
1439 void yy_flush_buffer( b )
1440 YY_BUFFER_STATE b;
1441 #endif
1443         {
1444         if ( ! b )
1445                 return;
1447         b->yy_n_chars = 0;
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.
1452          */
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];
1458         b->yy_at_bol = 1;
1459         b->yy_buffer_status = YY_BUFFER_NEW;
1461         if ( b == yy_current_buffer )
1462                 yy_load_buffer_state();
1463         }
1466 #ifndef YY_NO_SCAN_BUFFER
1467 #ifdef YY_USE_PROTOS
1468 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1469 #else
1470 YY_BUFFER_STATE yy_scan_buffer( base, size )
1471 char *base;
1472 yy_size_t size;
1473 #endif
1474         {
1475         YY_BUFFER_STATE b;
1477         if ( size < 2 ||
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. */
1481                 return 0;
1483         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1484         if ( ! b )
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;
1493         b->yy_at_bol = 1;
1494         b->yy_fill_buffer = 0;
1495         b->yy_buffer_status = YY_BUFFER_NEW;
1497         yy_switch_to_buffer( b );
1499         return b;
1500         }
1501 #endif
1504 #ifndef YY_NO_SCAN_STRING
1505 #ifdef YY_USE_PROTOS
1506 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1507 #else
1508 YY_BUFFER_STATE yy_scan_string( yy_str )
1509 yyconst char *yy_str;
1510 #endif
1511         {
1512         int len;
1513         for ( len = 0; yy_str[len]; ++len )
1514                 ;
1516         return yy_scan_bytes( yy_str, len );
1517         }
1518 #endif
1521 #ifndef YY_NO_SCAN_BYTES
1522 #ifdef YY_USE_PROTOS
1523 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1524 #else
1525 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1526 yyconst char *bytes;
1527 int len;
1528 #endif
1529         {
1530         YY_BUFFER_STATE b;
1531         char *buf;
1532         yy_size_t n;
1533         int i;
1535         /* Get memory for full buffer, including space for trailing EOB's. */
1536         n = len + 2;
1537         buf = (char *) yy_flex_alloc( n );
1538         if ( ! buf )
1539                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1541         for ( i = 0; i < len; ++i )
1542                 buf[i] = bytes[i];
1544         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1546         b = yy_scan_buffer( buf, n );
1547         if ( ! b )
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.
1552          */
1553         b->yy_is_our_buffer = 1;
1555         return b;
1556         }
1557 #endif
1560 #ifndef YY_NO_PUSH_STATE
1561 #ifdef YY_USE_PROTOS
1562 static void yy_push_state( int new_state )
1563 #else
1564 static void yy_push_state( new_state )
1565 int new_state;
1566 #endif
1567         {
1568         if ( yy_start_stack_ptr >= yy_start_stack_depth )
1569                 {
1570                 yy_size_t new_size;
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 );
1578                 else
1579                         yy_start_stack = (int *) yy_flex_realloc(
1580                                         (void *) yy_start_stack, new_size );
1582                 if ( ! yy_start_stack )
1583                         YY_FATAL_ERROR(
1584                         "out of memory expanding start-condition stack" );
1585                 }
1587         yy_start_stack[yy_start_stack_ptr++] = YY_START;
1589         BEGIN(new_state);
1590         }
1591 #endif
1594 #ifndef YY_NO_POP_STATE
1595 static void yy_pop_state()
1596         {
1597         if ( --yy_start_stack_ptr < 0 )
1598                 YY_FATAL_ERROR( "start-condition stack underflow" );
1600         BEGIN(yy_start_stack[yy_start_stack_ptr]);
1601         }
1602 #endif
1605 #ifndef YY_NO_TOP_STATE
1606 static int yy_top_state()
1607         {
1608         return yy_start_stack[yy_start_stack_ptr - 1];
1609         }
1610 #endif
1612 #ifndef YY_EXIT_FAILURE
1613 #define YY_EXIT_FAILURE 2
1614 #endif
1616 #ifdef YY_USE_PROTOS
1617 static void yy_fatal_error( yyconst char msg[] )
1618 #else
1619 static void yy_fatal_error( msg )
1620 char msg[];
1621 #endif
1622         {
1623         (void) fprintf( stderr, "%s\n", msg );
1624         exit( YY_EXIT_FAILURE );
1625         }
1629 /* Redefine yyless() so it works in section 3 code. */
1631 #undef yyless
1632 #define yyless(n) \
1633         do \
1634                 { \
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'; \
1640                 yyleng = n; \
1641                 } \
1642         while ( 0 )
1645 /* Internal utility routines. */
1647 #ifndef yytext_ptr
1648 #ifdef YY_USE_PROTOS
1649 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1650 #else
1651 static void yy_flex_strncpy( s1, s2, n )
1652 char *s1;
1653 yyconst char *s2;
1654 int n;
1655 #endif
1656         {
1657         register int i;
1658         for ( i = 0; i < n; ++i )
1659                 s1[i] = s2[i];
1660         }
1661 #endif
1663 #ifdef YY_NEED_STRLEN
1664 #ifdef YY_USE_PROTOS
1665 static int yy_flex_strlen( yyconst char *s )
1666 #else
1667 static int yy_flex_strlen( s )
1668 yyconst char *s;
1669 #endif
1670         {
1671         register int n;
1672         for ( n = 0; s[n]; ++n )
1673                 ;
1675         return n;
1676         }
1677 #endif
1680 #ifdef YY_USE_PROTOS
1681 static void *yy_flex_alloc( yy_size_t size )
1682 #else
1683 static void *yy_flex_alloc( size )
1684 yy_size_t size;
1685 #endif
1686         {
1687         return (void *) malloc( size );
1688         }
1690 #ifdef YY_USE_PROTOS
1691 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1692 #else
1693 static void *yy_flex_realloc( ptr, size )
1694 void *ptr;
1695 yy_size_t size;
1696 #endif
1697         {
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.
1704          */
1705         return (void *) realloc( (char *) ptr, size );
1706         }
1708 #ifdef YY_USE_PROTOS
1709 static void yy_flex_free( void *ptr )
1710 #else
1711 static void yy_flex_free( ptr )
1712 void *ptr;
1713 #endif
1714         {
1715         free( ptr );
1716         }
1718 #if YY_MAIN
1719 int main()
1720         {
1721         yylex();
1722         return 0;
1723         }
1724 #endif
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;                      \
1741                         } while (0)
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.  */
1750 yylex(void)
1752   static enum {
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)
1765     {
1766       BEGIN(V2_TOKENS);
1767       next_node = xmalloc(sizeof(*next_node));
1768       next_node->next = NULL;
1769       lexstate = ST_NORMAL;
1770     }
1772 repeat:
1773   token = yylex1();
1775   if (token == 0)
1776     return 0;
1777   else if (token == FILENAME)
1778     {
1779       char *file, *e;
1781       /* Save the filename and line number for later error messages.  */
1783       if (cur_filename)
1784         free(cur_filename);
1786       file = strchr(yytext, '\"')+1;
1787       e = strchr(file, '\"');
1788       *e = '\0';
1789       cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
1790       cur_line = atoi(yytext+2);
1792       goto repeat;
1793     }
1795   switch (lexstate)
1796     {
1797     case ST_NORMAL:
1798       switch (token)
1799         {
1800         case IDENT:
1801           APP;
1802           {
1803             const struct resword *r = is_reserved_word(yytext, yyleng);
1804             if (r)
1805               {
1806                 switch (token = r->token)
1807                   {
1808                   case ATTRIBUTE_KEYW:
1809                     lexstate = ST_ATTRIBUTE;
1810                     count = 0;
1811                     goto repeat;
1812                   case ASM_KEYW:
1813                     lexstate = ST_ASM;
1814                     count = 0;
1815                     goto repeat;
1817                   case STRUCT_KEYW:
1818                   case UNION_KEYW:
1819                     dont_want_brace_phrase = 3;
1820                   case ENUM_KEYW:
1821                     suppress_type_lookup = 2;
1822                     goto fini;
1824                   case EXPORT_SYMBOL_KEYW:
1825                       goto fini;
1826                   }
1827               }
1828             if (!suppress_type_lookup)
1829               {
1830                 struct symbol *sym = find_symbol(yytext, SYM_TYPEDEF);
1831                 if (sym && sym->type == SYM_TYPEDEF)
1832                   token = TYPE;
1833               }
1834           }
1835           break;
1837         case '[':
1838           APP;
1839           lexstate = ST_BRACKET;
1840           count = 1;
1841           goto repeat;
1843         case '{':
1844           APP;
1845           if (dont_want_brace_phrase)
1846             break;
1847           lexstate = ST_BRACE;
1848           count = 1;
1849           goto repeat;
1851         case '=': case ':':
1852           APP;
1853           lexstate = ST_EXPRESSION;
1854           break;
1856         case DOTS:
1857         default:
1858           APP;
1859           break;
1860         }
1861       break;
1863     case ST_ATTRIBUTE:
1864       APP;
1865       switch (token)
1866         {
1867         case '(':
1868           ++count;
1869           goto repeat;
1870         case ')':
1871           if (--count == 0)
1872             {
1873               lexstate = ST_NORMAL;
1874               token = ATTRIBUTE_PHRASE;
1875               break;
1876             }
1877           goto repeat;
1878         default:
1879           goto repeat;
1880         }
1881       break;
1883     case ST_ASM:
1884       APP;
1885       switch (token)
1886         {
1887         case '(':
1888           ++count;
1889           goto repeat;
1890         case ')':
1891           if (--count == 0)
1892             {
1893               lexstate = ST_NORMAL;
1894               token = ASM_PHRASE;
1895               break;
1896             }
1897           goto repeat;
1898         default:
1899           goto repeat;
1900         }
1901       break;
1903     case ST_BRACKET:
1904       APP;
1905       switch (token)
1906         {
1907         case '[':
1908           ++count;
1909           goto repeat;
1910         case ']':
1911           if (--count == 0)
1912             {
1913               lexstate = ST_NORMAL;
1914               token = BRACKET_PHRASE;
1915               break;
1916             }
1917           goto repeat;
1918         default:
1919           goto repeat;
1920         }
1921       break;
1923     case ST_BRACE:
1924       APP;
1925       switch (token)
1926         {
1927         case '{':
1928           ++count;
1929           goto repeat;
1930         case '}':
1931           if (--count == 0)
1932             {
1933               lexstate = ST_NORMAL;
1934               token = BRACE_PHRASE;
1935               break;
1936             }
1937           goto repeat;
1938         default:
1939           goto repeat;
1940         }
1941       break;
1943     case ST_EXPRESSION:
1944       switch (token)
1945         {
1946         case '(': case '[': case '{':
1947           ++count;
1948           APP;
1949           goto repeat;
1950         case ')': case ']': case '}':
1951           --count;
1952           APP;
1953           goto repeat;
1954         case ',': case ';':
1955           if (count == 0)
1956             {
1957               /* Put back the token we just read so's we can find it again
1958                  after registering the expression.  */
1959               unput(token);
1961               lexstate = ST_NORMAL;
1962               token = EXPRESSION_PHRASE;
1963               break;
1964             }
1965           APP;
1966           goto repeat;
1967         default:
1968           APP;
1969           goto repeat;
1970         }
1971       break;
1973     case ST_TABLE_1:
1974       goto repeat;
1976     case ST_TABLE_2:
1977       if (token == IDENT && yyleng == 1 && yytext[0] == 'X')
1978         {
1979           token = EXPORT_SYMBOL_KEYW;
1980           lexstate = ST_TABLE_5;
1981           APP;
1982           break;
1983         }
1984       lexstate = ST_TABLE_6;
1985       /* FALLTHRU */
1987     case ST_TABLE_6:
1988       switch (token)
1989         {
1990         case '{': case '[': case '(':
1991           ++count;
1992           break;
1993         case '}': case ']': case ')':
1994           --count;
1995           break;
1996         case ',':
1997           if (count == 0)
1998             lexstate = ST_TABLE_2;
1999           break;
2000         };
2001       goto repeat;
2003     case ST_TABLE_3:
2004       goto repeat;
2006     case ST_TABLE_4:
2007       if (token == ';')
2008         lexstate = ST_NORMAL;
2009       goto repeat;
2011     case ST_TABLE_5:
2012       switch (token)
2013         {
2014         case ',':
2015           token = ';';
2016           lexstate = ST_TABLE_2;
2017           APP;
2018           break;
2019         default:
2020           APP;
2021           break;
2022         }
2023       break;
2025     default:
2026       abort();
2027     }
2028 fini:
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;
2037   return token;
2039 #ifndef YYSTYPE
2040 #define YYSTYPE int
2041 #endif
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
2073 #define CHAR    288
2074 #define DOTS    289
2075 #define IDENT   290
2076 #define INT     291
2077 #define REAL    292
2078 #define STRING  293
2079 #define TYPE    294
2080 #define OTHER   295
2081 #define FILENAME        296
2084 extern YYSTYPE yylval;