Imported Upstream version 15.8a
[platform/upstream/cscope.git] / src / scanner.c
1
2 #line 3 "scanner.c"
3
4 #define  YY_INT_ALIGNED short int
5
6 /* A lexical scanner generated by flex */
7
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 35
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
15
16 /* First, we deal with  platform-specific or compiler-specific issues. */
17
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
23
24 /* end standard C headers. */
25
26 /* flex integer type definitions */
27
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
30
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36  * if you want the limit (max/min) macros for int types. 
37  */
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
40 #endif
41
42 #include <inttypes.h>
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
49 #else
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t; 
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
56 #endif /* ! C99 */
57
58 /* Limits of integral types. */
59 #ifndef INT8_MIN
60 #define INT8_MIN               (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN              (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN              (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX               (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX              (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX              (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX              (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX             (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX             (4294967295U)
85 #endif
86
87 #endif /* ! FLEXINT_H */
88
89 #ifdef __cplusplus
90
91 /* The "const" storage-class-modifier is valid. */
92 #define YY_USE_CONST
93
94 #else   /* ! __cplusplus */
95
96 /* C99 requires __STDC__ to be defined as 1. */
97 #if defined (__STDC__)
98
99 #define YY_USE_CONST
100
101 #endif  /* defined (__STDC__) */
102 #endif  /* ! __cplusplus */
103
104 #ifdef YY_USE_CONST
105 #define yyconst const
106 #else
107 #define yyconst
108 #endif
109
110 /* Returned upon end-of-file. */
111 #define YY_NULL 0
112
113 /* Promotes a possibly negative, possibly signed char to an unsigned
114  * integer for use as an array index.  If the signed char is negative,
115  * we want to instead treat it as an 8-bit unsigned char, hence the
116  * double cast.
117  */
118 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
119
120 /* Enter a start condition.  This macro really ought to take a parameter,
121  * but we do it the disgusting crufty way forced on us by the ()-less
122  * definition of BEGIN.
123  */
124 #define BEGIN (yy_start) = 1 + 2 *
125
126 /* Translate the current start state into a value that can be later handed
127  * to BEGIN to return to the state.  The YYSTATE alias is for lex
128  * compatibility.
129  */
130 #define YY_START (((yy_start) - 1) / 2)
131 #define YYSTATE YY_START
132
133 /* Action number for EOF rule of a given start state. */
134 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
135
136 /* Special action meaning "start processing a new file". */
137 #define YY_NEW_FILE yyrestart(yyin  )
138
139 #define YY_END_OF_BUFFER_CHAR 0
140
141 /* Size of default input buffer. */
142 #ifndef YY_BUF_SIZE
143 #define YY_BUF_SIZE 16384
144 #endif
145
146 /* The state buf must be large enough to hold one state per character in the main buffer.
147  */
148 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
149
150 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
151 #define YY_TYPEDEF_YY_BUFFER_STATE
152 typedef struct yy_buffer_state *YY_BUFFER_STATE;
153 #endif
154
155 extern int yyleng;
156
157 extern FILE *yyin, *yyout;
158
159 #define EOB_ACT_CONTINUE_SCAN 0
160 #define EOB_ACT_END_OF_FILE 1
161 #define EOB_ACT_LAST_MATCH 2
162
163     #define YY_LESS_LINENO(n)
164     
165 /* Return all but the first "n" matched characters back to the input stream. */
166 #define yyless(n) \
167         do \
168                 { \
169                 /* Undo effects of setting up yytext. */ \
170         int yyless_macro_arg = (n); \
171         YY_LESS_LINENO(yyless_macro_arg);\
172                 *yy_cp = (yy_hold_char); \
173                 YY_RESTORE_YY_MORE_OFFSET \
174                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
175                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
176                 } \
177         while ( 0 )
178
179 #define unput(c) yyunput( c, (yytext_ptr)  )
180
181 #ifndef YY_TYPEDEF_YY_SIZE_T
182 #define YY_TYPEDEF_YY_SIZE_T
183 typedef size_t yy_size_t;
184 #endif
185
186 #ifndef YY_STRUCT_YY_BUFFER_STATE
187 #define YY_STRUCT_YY_BUFFER_STATE
188 struct yy_buffer_state
189         {
190         FILE *yy_input_file;
191
192         char *yy_ch_buf;                /* input buffer */
193         char *yy_buf_pos;               /* current position in input buffer */
194
195         /* Size of input buffer in bytes, not including room for EOB
196          * characters.
197          */
198         yy_size_t yy_buf_size;
199
200         /* Number of characters read into yy_ch_buf, not including EOB
201          * characters.
202          */
203         int yy_n_chars;
204
205         /* Whether we "own" the buffer - i.e., we know we created it,
206          * and can realloc() it to grow it, and should free() it to
207          * delete it.
208          */
209         int yy_is_our_buffer;
210
211         /* Whether this is an "interactive" input source; if so, and
212          * if we're using stdio for input, then we want to use getc()
213          * instead of fread(), to make sure we stop fetching input after
214          * each newline.
215          */
216         int yy_is_interactive;
217
218         /* Whether we're considered to be at the beginning of a line.
219          * If so, '^' rules will be active on the next match, otherwise
220          * not.
221          */
222         int yy_at_bol;
223
224     int yy_bs_lineno; /**< The line count. */
225     int yy_bs_column; /**< The column count. */
226     
227         /* Whether to try to fill the input buffer when we reach the
228          * end of it.
229          */
230         int yy_fill_buffer;
231
232         int yy_buffer_status;
233
234 #define YY_BUFFER_NEW 0
235 #define YY_BUFFER_NORMAL 1
236         /* When an EOF's been seen but there's still some text to process
237          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
238          * shouldn't try reading from the input source any more.  We might
239          * still have a bunch of tokens to match, though, because of
240          * possible backing-up.
241          *
242          * When we actually see the EOF, we change the status to "new"
243          * (via yyrestart()), so that the user can continue scanning by
244          * just pointing yyin at a new input file.
245          */
246 #define YY_BUFFER_EOF_PENDING 2
247
248         };
249 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
250
251 /* Stack of input buffers. */
252 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
253 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
254 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
255
256 /* We provide macros for accessing buffer states in case in the
257  * future we want to put the buffer states in a more general
258  * "scanner state".
259  *
260  * Returns the top of the stack, or NULL.
261  */
262 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
263                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
264                           : NULL)
265
266 /* Same as previous macro, but useful when we know that the buffer stack is not
267  * NULL or when we need an lvalue. For internal use only.
268  */
269 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
270
271 /* yy_hold_char holds the character lost when yytext is formed. */
272 static char yy_hold_char;
273 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
274 int yyleng;
275
276 /* Points to current character in buffer. */
277 static char *yy_c_buf_p = (char *) 0;
278 static int yy_init = 0;         /* whether we need to initialize */
279 static int yy_start = 0;        /* start state number */
280
281 /* Flag which is used to allow yywrap()'s to do buffer switches
282  * instead of setting up a fresh yyin.  A bit of a hack ...
283  */
284 static int yy_did_buffer_switch_on_eof;
285
286 void yyrestart (FILE *input_file  );
287 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
288 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
289 void yy_delete_buffer (YY_BUFFER_STATE b  );
290 void yy_flush_buffer (YY_BUFFER_STATE b  );
291 void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
292 void yypop_buffer_state (void );
293
294 static void yyensure_buffer_stack (void );
295 static void yy_load_buffer_state (void );
296 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
297
298 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
299
300 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
301 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
302 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
303
304 void *yyalloc (yy_size_t  );
305 void *yyrealloc (void *,yy_size_t  );
306 void yyfree (void *  );
307
308 #define yy_new_buffer yy_create_buffer
309
310 #define yy_set_interactive(is_interactive) \
311         { \
312         if ( ! YY_CURRENT_BUFFER ){ \
313         yyensure_buffer_stack (); \
314                 YY_CURRENT_BUFFER_LVALUE =    \
315             yy_create_buffer(yyin,YY_BUF_SIZE ); \
316         } \
317         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
318         }
319
320 #define yy_set_bol(at_bol) \
321         { \
322         if ( ! YY_CURRENT_BUFFER ){\
323         yyensure_buffer_stack (); \
324                 YY_CURRENT_BUFFER_LVALUE =    \
325             yy_create_buffer(yyin,YY_BUF_SIZE ); \
326         } \
327         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
328         }
329
330 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
331
332 /* Begin user sect3 */
333
334 typedef unsigned char YY_CHAR;
335
336 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
337
338 typedef int yy_state_type;
339
340 extern int yylineno;
341
342 int yylineno = 1;
343
344 extern char *yytext;
345 #define yytext_ptr yytext
346
347 static yy_state_type yy_get_previous_state (void );
348 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
349 static int yy_get_next_buffer (void );
350 static void yy_fatal_error (yyconst char msg[]  );
351
352 /* Done after the current pattern has been matched and before the
353  * corresponding action - sets up yytext.
354  */
355 #define YY_DO_BEFORE_ACTION \
356         (yytext_ptr) = yy_bp; \
357         (yytext_ptr) -= (yy_more_len); \
358         yyleng = (size_t) (yy_cp - (yytext_ptr)); \
359         (yy_hold_char) = *yy_cp; \
360         *yy_cp = '\0'; \
361         (yy_c_buf_p) = yy_cp;
362
363 #define YY_NUM_RULES 37
364 #define YY_END_OF_BUFFER 38
365 /* This struct is not used in this scanner,
366    but its presence is necessary. */
367 struct yy_trans_info
368         {
369         flex_int32_t yy_verify;
370         flex_int32_t yy_nxt;
371         };
372 static yyconst flex_int16_t yy_acclist[267] =
373     {   0,
374        38,   36,   37,   29,   37,   31,   36,   37,   36,   37,
375        25,   36,   37,16406,16407,16408,   36,   37,   30,   36,
376        37,   12,   36,   37,   13,   36,   37,   16,   36,   37,
377        36,   37,   35,   36,   37,   15,   36,   37,   17,   36,
378        37,   14,   36,   37,   26,   36,   37,   36,   37,   27,
379        36,   37,   25,   36,   37,16406,16407,16408,   25,   36,
380        37,16406,16407,16408,   25,   36,   37,16406,16407,16408,
381        25,   36,   37,16406,16407,16408,    6,   36,   37,   11,
382        36,   37,   32,   36,   37,   36,   37,   25,   36,   37,
383     16406,16407,16408,   25,   36,   37,16406,16407,16408,   34,
384
385        34,   34,   34,   25,16406,16407,16408, 8215,    1,    2,
386        35,   35,   28,   25,16406,16407,16408,   25,16406,16407,
387     16408,   25,16406,16407,16408,   25,16406,16407,16408,   32,
388         3,   25,16406,16407,16408,   25,16406,16407,16408,   34,
389        34,   34,   34,    8,   34,   34, 8216,   25,16406,16407,
390     16408,   25,16406,16407,16408,   25,16406,16407,16408,   25,
391     16406,16407,16408,   25,16406,16407,16408,   25,16406,16407,
392     16408,   34,   34,   34,   34,   34,    8,   34,   34, 8214,
393        25,16406,16407,16408,   25,16404,16405,16406,16407,16408,
394        25,16406,16407,16408,   25,16406,16407,16408,   25,16406,
395
396     16407,16408,   25,16406,16407,16408,   34,    9,   34,   34,
397        34,   34,   25,16406,16407,16408, 8213,   25,16406,16407,
398     16408,   25,16406,16407,16408,   25,16406,16407,16408,   34,
399        10,   34,16391,    8,   34,   34, 8216,   25,16406,16407,
400     16408,   34,   34,   34, 8216, 8212,   25,16406,16407,16408,
401         4,    4,    4, 8216,   34,   19,   25,16406,16407,16408,
402         4,   18,    5,   18, 8199,   33
403     } ;
404
405 static yyconst flex_int16_t yy_accept[153] =
406     {   0,
407         1,    1,    1,    1,    1,    2,    4,    6,    9,   11,
408        17,   19,   22,   25,   28,   31,   33,   36,   39,   42,
409        45,   48,   50,   53,   59,   65,   71,   77,   80,   83,
410        86,   88,   94,  100,  100,  101,  102,  103,  104,  104,
411       104,  108,  109,  110,  111,  112,  113,  114,  118,  122,
412       126,  130,  131,  132,  136,  140,  141,  142,  143,  144,
413       146,  147,  148,  148,  148,  148,  152,  156,  160,  164,
414       168,  172,  173,  174,  175,  176,  177,  179,  180,  180,
415       181,  181,  185,  191,  195,  199,  203,  207,  208,  210,
416       211,  212,  213,  213,  217,  217,  217,  218,  222,  226,
417
418       230,  231,  234,  236,  237,  237,  237,  237,  238,  242,
419       242,  243,  243,  243,  244,  245,  245,  245,  246,  246,
420       246,  247,  251,  252,  253,  255,  255,  255,  255,  256,
421       256,  256,  256,  256,  257,  261,  262,  263,  263,  263,
422       263,  263,  263,  264,  265,  266,  267,  267,  267,  267,
423       267,  267
424     } ;
425
426 static yyconst flex_int32_t yy_ec[256] =
427     {   0,
428         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
429         4,    4,    4,    1,    1,    1,    1,    1,    1,    1,
430         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
431         1,    2,    1,    5,    6,    7,    8,    9,   10,   11,
432        12,   13,    1,   14,   15,   16,    1,   17,   18,   18,
433        18,   18,   18,   18,   18,   18,   19,   20,   21,   22,
434        23,   24,    1,    1,   25,   26,   26,   27,   28,   26,
435        29,   29,   29,   29,   29,   26,   29,   30,   29,   29,
436        29,   29,   31,   32,   26,   29,   29,   26,   29,   33,
437        34,   35,   36,    1,   37,    1,   38,   26,   39,   40,
438
439        41,   42,   29,   29,   43,   29,   29,   44,   45,   46,
440        47,   29,   29,   48,   49,   50,   51,   29,   29,   26,
441        29,   52,   53,    1,   54,    1,    1,    1,    1,    1,
442         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
443         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
444         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
445         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
446         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
447         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
448         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
449
450         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
451         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
452         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
453         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
454         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
455         1,    1,    1,    1,    1
456     } ;
457
458 static yyconst flex_int32_t yy_meta[55] =
459     {   0,
460         1,    2,    3,    4,    5,    6,    7,    1,    1,    1,
461         8,    9,   10,    1,    1,   11,   12,   12,   12,    9,
462         1,    1,    1,    5,   13,   13,   13,   13,   14,   14,
463        14,   14,   14,    1,    1,    1,   14,   13,   13,   13,
464        13,   13,   14,   13,   14,   14,   14,   14,   14,   14,
465        13,   14,   15,    1
466     } ;
467
468 static yyconst flex_int16_t yy_base[169] =
469     {   0,
470         0,   53,   28,   56,  306,  813,  813,  813,   61,   64,
471        16,  813,  813,  813,  813,   54,    0,  813,  813,  813,
472       813,  288,  813,   77,   92,   95,  107,  813,  813,   72,
473        70,  124,  128,  115,    0,  247,   39,   40,  146,  159,
474       162,  140,  813,  813,    0,    0,  813,  177,  180,  192,
475       195,   87,  813,  198,  210,    0,  242,   64,  240,   76,
476       233,  813,  214,  165,  255,  226,  240,  243,  246,  258,
477       263,  225,  222,  217,  212,  200,  193,  183,  275,  813,
478       167,  279,  294,  297,  300,  312,  327,  164,    0,  165,
479       162,  138,  146,  330,  354,  406,  813,  349,  366,  372,
480
481       110,  459,    0,  107,  125,  512,  183,  378,  384,  530,
482       110,  130,  315,    0,   88,   92,  548,  554,  390,  398,
483       813,  401,    0,  424,    0,  132,  430,  220,  416,   98,
484        47,    0,    0,  813,  437,    0,    0,  230,   51,  516,
485         0,   77,  442,    0,  813,    0,   43,  137,  553,  183,
486       813,  606,  619,  623,  630,  643,  656,  670,  684,  697,
487       711,  725,  739,  748,  761,  774,  783,  797
488     } ;
489
490 static yyconst flex_int16_t yy_def[169] =
491     {   0,
492       151,    1,    1,    1,  151,  151,  151,  151,  152,  153,
493       151,  151,  151,  151,  151,  151,  154,  151,  151,  151,
494       151,  151,  151,  153,  153,  153,  153,  151,  151,  151,
495       151,  153,  153,  152,  155,  155,  155,  155,  156,  156,
496       153,  151,  151,  151,  154,  154,  151,  153,  153,  153,
497       153,  151,  151,  153,  153,  155,  155,  155,  155,  155,
498       155,  151,  151,  157,  151,  153,  153,  153,  153,  153,
499       153,  155,  155,  155,  155,  155,  155,  155,  157,  151,
500       151,  153,  153,  153,  153,  153,  153,  155,  155,  155,
501       155,  155,  151,  153,  158,  158,  151,  153,  153,  153,
502
503       155,  151,  155,  155,  151,  159,  160,  160,  153,  161,
504       155,  162,  151,  102,  155,  151,  163,  163,  151,  160,
505       151,  153,  164,  156,  164,  165,  151,  151,  155,  151,
506       166,  118,  118,  151,  153,  164,  167,  151,  151,  151,
507       168,  151,  156,  167,  151,  168,  151,  151,  151,  151,
508         0,  151,  151,  151,  151,  151,  151,  151,  151,  151,
509       151,  151,  151,  151,  151,  151,  151,  151
510     } ;
511
512 static yyconst flex_int16_t yy_nxt[868] =
513     {   0,
514         6,    6,    7,    6,    8,    9,   10,   11,    6,   12,
515        13,   14,    6,   15,    6,   16,   17,   17,   17,   18,
516        19,    6,   20,    6,   10,   10,   10,   10,   10,   10,
517        10,   10,   10,   21,   22,   23,   10,   10,   24,   10,
518        25,   10,   10,   10,   10,   10,   10,   10,   26,   10,
519        27,   10,   28,   29,   30,   32,   30,   30,   33,   30,
520        31,  148,   34,   31,   34,   39,   40,   39,   43,   44,
521        45,   45,   45,   52,   42,   52,   40,   53,   39,   40,
522        39,   60,   58,   32,   59,   61,   33,   42,   52,   40,
523        52,  147,  145,   39,   40,   39,   39,   40,   39,  134,
524
525        36,   37,   42,   38,   40,   42,   73,   40,   39,   40,
526        39,  126,   74,  126,  142,   76,   34,   42,   34,   40,
527        48,   77,   43,   44,  130,   39,   40,   39,  129,   39,
528        40,   39,  113,  126,   42,  126,   40,   49,   42,  116,
529        40,   63,   63,   63,   50,  149,  115,   39,   40,   39,
530       111,   64,   51,   54,   36,   37,   42,   38,   40,   55,
531        40,   40,   40,   39,   40,   39,   79,   79,   79,  151,
532       105,   40,   42,  150,   40,   79,   79,   65,   39,   40,
533        39,   39,   40,   39,  119,  119,  119,   42,  104,   40,
534        42,  149,   40,   39,   40,   39,   39,   40,   39,   39,
535
536        40,   39,   42,  103,   40,   42,  102,   40,   42,  101,
537        40,   39,   40,   39,   66,   63,   63,   63,   93,  150,
538        42,  138,   40,  138,   70,   64,   92,   39,   40,   39,
539        67,  138,   76,  138,   71,  121,   42,   69,   40,   68,
540        91,   39,   40,   39,   39,   40,   39,   39,   40,   39,
541        42,   65,   40,   42,   90,   40,   42,   89,   40,   39,
542        40,   39,  139,   89,   39,   40,   39,   88,   42,   81,
543        40,   78,  139,   42,   82,   40,   79,   79,   79,   75,
544        39,   40,   39,   72,   83,   79,   79,   57,   86,   42,
545        47,   40,   85,   84,   87,   95,   96,   95,   39,   40,
546
547        39,   39,   40,   39,   42,  151,   40,   42,  151,   40,
548        42,  151,   40,   39,   40,   39,  127,  127,  127,  151,
549       128,  151,   42,  151,   40,  151,  151,   94,   39,   40,
550        39,  106,   40,  106,  151,   98,  151,   42,  151,   40,
551        42,  151,   40,   99,  151,   83,   97,  151,  151,  151,
552        39,   40,   39,  151,  100,   95,   96,   95,  151,   42,
553       107,   40,  151,  151,   42,  151,   40,   39,   40,   39,
554        62,   62,   62,  110,   40,  110,   42,  151,   40,  119,
555       119,  119,   42,  151,   40,   39,   40,   39,  151,  151,
556       109,  119,  119,  119,   42,  151,   40,  151,   83,  119,
557
558       119,  119,   39,   40,   39,  151,   97,   96,   96,   96,
559       151,   42,  107,   40,  151,  122,  151,  140,   40,  140,
560       141,  151,   62,   62,   62,   40,   40,   40,  135,  151,
561       121,  127,  127,  127,  151,  128,   40,  141,  143,   40,
562       143,  151,  121,   39,   40,   39,  151,   42,  151,   40,
563       121,  151,   42,  151,   40,  151,  151,  151,   97,  112,
564       112,  113,  112,  112,  112,  114,  112,  112,  112,  112,
565       112,  112,  112,  112,  112,  114,  114,  114,  112,  112,
566       112,  112,  112,  114,  114,  114,  114,  114,  114,  114,
567       114,  114,  112,  112,  112,  114,  114,  114,  114,  114,
568
569       114,  114,  114,  114,  114,  114,  114,  114,  114,  114,
570       114,  112,  112,  106,   40,  106,  151,  140,  117,  140,
571       141,  151,   42,  151,   40,  151,  151,  151,   62,   62,
572        62,  110,   40,  110,  151,  151,  123,  141,  151,  151,
573        42,  151,  124,  151,  151,  151,   62,   62,   62,  131,
574       131,  131,  151,  151,  132,  131,  131,  131,  131,  131,
575       132,  151,  151,  151,  131,  131,   63,  131,   63,  151,
576       151,  151,   63,  131,  151,   63,  151,  151,  151,  151,
577       151,  151,  151,  151,  151,  151,  151,  151,   63,  151,
578       151,  151,  151,  151,  151,  151,  151,  151,  151,  151,
579
580       134,  151,  151,  151,  151,  151,  134,   35,  151,   35,
581       151,  151,   35,  151,  151,  151,  151,  151,   35,   35,
582        41,   41,   41,  151,  151,   41,   41,  151,   41,  151,
583        41,   41,   41,   46,   46,   46,   56,  151,  151,  151,
584       151,   56,   56,   56,   62,   62,   62,  151,  151,  151,
585        62,  151,   62,  151,   62,   62,   62,   80,   80,   80,
586       151,   80,  151,   80,   80,  151,  151,  151,   80,   80,
587        80,  108,  108,  108,  151,  151,  108,  108,  151,  108,
588       151,  108,  108,  108,  108,  118,  118,  118,  151,  151,
589       118,  118,  151,  118,  151,  118,  118,  118,  120,  120,
590
591       120,  151,  151,  120,  151,  151,  151,  151,  120,  120,
592       120,  120,  125,  125,  125,  151,  151,  125,  125,  151,
593       125,  151,  125,  125,  125,  112,  112,  112,  112,  112,
594       112,  112,  112,  112,  112,  112,  112,  112,  112,  112,
595       133,  133,  133,  151,  151,  133,  133,  133,  151,  151,
596       133,  133,  133,  133,  136,  151,  151,  151,  151,  136,
597       136,  136,  137,  151,  137,  151,  151,  137,  151,  151,
598       151,  151,  151,  137,  137,  131,  131,  131,  151,  151,
599       151,  131,  131,  151,  151,  131,  131,  131,  131,  144,
600       151,  151,  151,  151,  144,  144,  144,  146,  151,  151,
601
602       146,  151,  146,  146,  146,  146,  146,  146,  146,  146,
603       146,  146,    5,  151,  151,  151,  151,  151,  151,  151,
604       151,  151,  151,  151,  151,  151,  151,  151,  151,  151,
605       151,  151,  151,  151,  151,  151,  151,  151,  151,  151,
606       151,  151,  151,  151,  151,  151,  151,  151,  151,  151,
607       151,  151,  151,  151,  151,  151,  151,  151,  151,  151,
608       151,  151,  151,  151,  151,  151,  151
609     } ;
610
611 static yyconst flex_int16_t yy_chk[868] =
612     {   0,
613         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
614         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
615         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
616         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
617         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
618         1,    1,    1,    1,    2,    3,    2,    4,    3,    4,
619         2,  147,    9,    4,    9,   10,   10,   10,   11,   11,
620        16,   16,   16,   30,   10,   30,   10,   31,   24,   24,
621        24,   38,   37,    4,   37,   38,    4,   24,   52,   24,
622        52,  142,  139,   25,   25,   25,   26,   26,   26,  131,
623
624         9,    9,   25,    9,   25,   26,   58,   26,   27,   27,
625        27,  111,   58,  111,  130,   60,   34,   27,   34,   27,
626        24,   60,   31,   31,  116,   32,   32,   32,  115,   33,
627        33,   33,  112,  126,   32,  126,   32,   25,   33,  105,
628        33,   42,   42,   42,   26,  148,  104,   39,   39,   39,
629       101,   42,   27,   32,   34,   34,   39,   34,   39,   33,
630        40,   40,   40,   41,   41,   41,   64,   64,   64,   40,
631        93,   40,   41,  148,   41,   64,   64,   42,   48,   48,
632        48,   49,   49,   49,  107,  107,  107,   48,   92,   48,
633        49,  150,   49,   50,   50,   50,   51,   51,   51,   54,
634
635        54,   54,   50,   91,   50,   51,   90,   51,   54,   88,
636        54,   55,   55,   55,   48,   63,   63,   63,   81,  150,
637        55,  128,   55,  128,   54,   63,   78,   66,   66,   66,
638        49,  138,   77,  138,   55,  107,   66,   51,   66,   50,
639        76,   67,   67,   67,   68,   68,   68,   69,   69,   69,
640        67,   63,   67,   68,   75,   68,   69,   74,   69,   70,
641        70,   70,  128,   73,   71,   71,   71,   72,   70,   65,
642        70,   61,  138,   71,   66,   71,   79,   79,   79,   59,
643        82,   82,   82,   57,   67,   79,   79,   36,   70,   82,
644        22,   82,   69,   68,   71,   83,   83,   83,   84,   84,
645
646        84,   85,   85,   85,   83,    5,   83,   84,    0,   84,
647        85,    0,   85,   86,   86,   86,  113,  113,  113,    0,
648       113,    0,   86,    0,   86,    0,    0,   82,   87,   87,
649        87,   94,   94,   94,    0,   84,    0,   87,    0,   87,
650        94,    0,   94,   86,    0,   85,   83,    0,    0,    0,
651        98,   98,   98,    0,   87,   95,   95,   95,    0,   98,
652        95,   98,    0,    0,   95,    0,   95,   99,   99,   99,
653        95,   95,   95,  100,  100,  100,   99,    0,   99,  108,
654       108,  108,  100,    0,  100,  109,  109,  109,    0,    0,
655        99,  119,  119,  119,  109,    0,  109,    0,   98,  120,
656
657       120,  120,  122,  122,  122,    0,   95,   96,   96,   96,
658         0,  122,   96,  122,    0,  109,   96,  129,   96,  129,
659       129,    0,   96,   96,   96,  124,  124,  124,  122,    0,
660       108,  127,  127,  127,  124,  127,  124,  129,  135,  135,
661       135,    0,  119,  143,  143,  143,    0,  135,    0,  135,
662       120,    0,  143,    0,  143,    0,    0,    0,   96,  102,
663       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
664       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
665       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
666       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
667
668       102,  102,  102,  102,  102,  102,  102,  102,  102,  102,
669       102,  102,  102,  106,  106,  106,    0,  140,  106,  140,
670       140,    0,  106,    0,  106,    0,    0,    0,  106,  106,
671       106,  110,  110,  110,    0,    0,  110,  140,    0,    0,
672       110,    0,  110,    0,    0,    0,  110,  110,  110,  117,
673       117,  117,    0,    0,  117,  118,  118,  118,  117,  117,
674       118,    0,    0,    0,  118,  118,  149,  117,  149,    0,
675         0,    0,  149,  118,    0,  149,    0,    0,    0,    0,
676         0,    0,    0,    0,    0,    0,    0,    0,  149,    0,
677         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
678
679       117,    0,    0,    0,    0,    0,  118,  152,    0,  152,
680         0,    0,  152,    0,    0,    0,    0,    0,  152,  152,
681       153,  153,  153,    0,    0,  153,  153,    0,  153,    0,
682       153,  153,  153,  154,  154,  154,  155,    0,    0,    0,
683         0,  155,  155,  155,  156,  156,  156,    0,    0,    0,
684       156,    0,  156,    0,  156,  156,  156,  157,  157,  157,
685         0,  157,    0,  157,  157,    0,    0,    0,  157,  157,
686       157,  158,  158,  158,    0,    0,  158,  158,    0,  158,
687         0,  158,  158,  158,  158,  159,  159,  159,    0,    0,
688       159,  159,    0,  159,    0,  159,  159,  159,  160,  160,
689
690       160,    0,    0,  160,    0,    0,    0,    0,  160,  160,
691       160,  160,  161,  161,  161,    0,    0,  161,  161,    0,
692       161,    0,  161,  161,  161,  162,  162,  162,  162,  162,
693       162,  162,  162,  162,  162,  162,  162,  162,  162,  162,
694       163,  163,  163,    0,    0,  163,  163,  163,    0,    0,
695       163,  163,  163,  163,  164,    0,    0,    0,    0,  164,
696       164,  164,  165,    0,  165,    0,    0,  165,    0,    0,
697         0,    0,    0,  165,  165,  166,  166,  166,    0,    0,
698         0,  166,  166,    0,    0,  166,  166,  166,  166,  167,
699         0,    0,    0,    0,  167,  167,  167,  168,    0,    0,
700
701       168,    0,  168,  168,  168,  168,  168,  168,  168,  168,
702       168,  168,  151,  151,  151,  151,  151,  151,  151,  151,
703       151,  151,  151,  151,  151,  151,  151,  151,  151,  151,
704       151,  151,  151,  151,  151,  151,  151,  151,  151,  151,
705       151,  151,  151,  151,  151,  151,  151,  151,  151,  151,
706       151,  151,  151,  151,  151,  151,  151,  151,  151,  151,
707       151,  151,  151,  151,  151,  151,  151
708     } ;
709
710 extern int yy_flex_debug;
711 int yy_flex_debug = 0;
712
713 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
714 static char *yy_full_match;
715 static int yy_lp;
716 static int yy_looking_for_trail_begin = 0;
717 static int yy_full_lp;
718 static int *yy_full_state;
719 #define YY_TRAILING_MASK 0x2000
720 #define YY_TRAILING_HEAD_MASK 0x4000
721 #define REJECT \
722 { \
723 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
724 yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
725 (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \
726 (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \
727 yy_current_state = *(yy_state_ptr); /* restore curr. state */ \
728 ++(yy_lp); \
729 goto find_rule; \
730 }
731
732 static int yy_more_flag = 0;
733 static int yy_more_len = 0;
734 #define yymore() ((yy_more_flag) = 1)
735 #define YY_MORE_ADJ (yy_more_len)
736 #define YY_RESTORE_YY_MORE_OFFSET
737 char *yytext;
738 #line 1 "scanner.l"
739 #line 2 "scanner.l"
740 /*===========================================================================
741  Copyright (c) 1998-2000, The Santa Cruz Operation 
742  All rights reserved.
743  
744  Redistribution and use in source and binary forms, with or without
745  modification, are permitted provided that the following conditions are met:
746
747  *Redistributions of source code must retain the above copyright notice,
748  this list of conditions and the following disclaimer.
749
750  *Redistributions in binary form must reproduce the above copyright notice,
751  this list of conditions and the following disclaimer in the documentation
752  and/or other materials provided with the distribution.
753
754  *Neither name of The Santa Cruz Operation nor the names of its contributors
755  may be used to endorse or promote products derived from this software
756  without specific prior written permission. 
757
758  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
759  IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
760  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
761  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
762  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
763  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
764  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
765  INTERRUPTION)
766  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
767  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
768  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
769  DAMAGE. 
770  =========================================================================*/
771
772 /*      cscope - interactive C symbol cross-reference
773  *
774  *      C symbol scanner
775  */
776 #include "global.h"
777 #include "scanner.h"
778 #include "lookup.h"
779
780 /* the line counting has been moved from character reading for speed */
781 /* comments are discarded */
782
783 #define IFLEVELINC      5       /* #if nesting level size increment */
784
785 static char const rcsid[] = "$Id: scanner.l,v 1.10 2011/06/29 15:48:00 nhorman Exp $";
786
787 int     first;  /* buffer index for first char of symbol */
788 int     last;   /* buffer index for last char of symbol */
789 int     lineno; /* symbol line number */
790 int     myylineno = 1;
791
792 static  BOOL    arraydimension;         /* inside array dimension declaration */
793 static  BOOL    bplisting;              /* breakpoint listing */
794 static  int     braces;                 /* unmatched left brace count */
795 static  BOOL    classdef;               /* c++ class definition */
796 static  BOOL    elseelif;               /* #else or #elif found */
797 static  BOOL    esudef;                 /* enum/struct/union global definition */
798 static  BOOL    external;               /* external definition */
799 static  int     externalbraces;         /* external definition outer brace count */
800 static  BOOL    fcndef;                 /* function definition */
801 static  BOOL    global;                 /* file global scope (outside functions) */
802 static  int     iflevel;                /* #if nesting level */
803 static  BOOL    initializer;            /* data initializer */
804 static  int     initializerbraces;      /* data initializer outer brace count */
805 static  BOOL    lex;                    /* lex file */
806 static  int     miflevel = IFLEVELINC;  /* maximum #if nesting level */
807 static  int     *maxifbraces;           /* maximum brace count within #if */
808 static  int     *preifbraces;           /* brace count before #if */
809 static  int     parens;                 /* unmatched left parenthesis count */
810 static  BOOL    ppdefine;               /* preprocessor define statement */
811 static  BOOL    pseudoelif;             /* pseudo-#elif */
812 static  BOOL    oldtype;                /* next identifier is an old type */
813 static  BOOL    rules;                  /* lex/yacc rules */
814 static  BOOL    sdl;                    /* sdl file */
815 static  BOOL    structfield;            /* structure field declaration */
816 static  int     tagdef;                 /* class/enum/struct/union tag definition */
817 static  BOOL    template;               /* function template */
818 static  int     templateparens;         /* function template outer parentheses count */
819 static  int     typedefbraces = -1;     /* initial typedef brace count */
820 static  int     token;                  /* token found */
821
822
823 void    multicharconstant(char terminator);
824 int     skipcomment_input(void);
825 int     comment(void);
826
827 #ifdef FLEX_SCANNER
828 #define YY_INPUT(buf,result,max_size) \
829         {\
830                 int c = skipcomment_input (); \
831                 result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \
832         }
833 #else
834 /* Assume this is the AT&T/SCO style lex */
835 #undef  input
836 #define input()  ((yytchar=(yytchar=yysptr>yysbuf?*(unsigned char *)--yysptr:getc(yyin))=='/'?comment():yytchar)==EOF?LEXEOF:yytchar)
837 #define noncommentinput()  ((yytchar=yysptr>yysbuf?*--yysptr:getc(yyin))==EOF?LEXEOF:yytchar)
838 #undef  unput
839 #define unput(c) (*yysptr++=(c))
840
841 #endif
842
843
844 #line 845 "scanner.c"
845
846 #define INITIAL 0
847 #define SDL 1
848
849 #ifndef YY_NO_UNISTD_H
850 /* Special case for "unistd.h", since it is non-ANSI. We include it way
851  * down here because we want the user's section 1 to have been scanned first.
852  * The user has a chance to override it with an option.
853  */
854 #include <unistd.h>
855 #endif
856
857 #ifndef YY_EXTRA_TYPE
858 #define YY_EXTRA_TYPE void *
859 #endif
860
861 static int yy_init_globals (void );
862
863 /* Accessor methods to globals.
864    These are made visible to non-reentrant scanners for convenience. */
865
866 int yylex_destroy (void );
867
868 int yyget_debug (void );
869
870 void yyset_debug (int debug_flag  );
871
872 YY_EXTRA_TYPE yyget_extra (void );
873
874 void yyset_extra (YY_EXTRA_TYPE user_defined  );
875
876 FILE *yyget_in (void );
877
878 void yyset_in  (FILE * in_str  );
879
880 FILE *yyget_out (void );
881
882 void yyset_out  (FILE * out_str  );
883
884 int yyget_leng (void );
885
886 char *yyget_text (void );
887
888 int yyget_lineno (void );
889
890 void yyset_lineno (int line_number  );
891
892 /* Macros after this point can all be overridden by user definitions in
893  * section 1.
894  */
895
896 #ifndef YY_SKIP_YYWRAP
897 #ifdef __cplusplus
898 extern "C" int yywrap (void );
899 #else
900 extern int yywrap (void );
901 #endif
902 #endif
903
904     static void yyunput (int c,char *buf_ptr  );
905     
906 #ifndef yytext_ptr
907 static void yy_flex_strncpy (char *,yyconst char *,int );
908 #endif
909
910 #ifdef YY_NEED_STRLEN
911 static int yy_flex_strlen (yyconst char * );
912 #endif
913
914 #ifndef YY_NO_INPUT
915
916 #ifdef __cplusplus
917 static int yyinput (void );
918 #else
919 static int input (void );
920 #endif
921
922 #endif
923
924 /* Amount of stuff to slurp up with each read. */
925 #ifndef YY_READ_BUF_SIZE
926 #define YY_READ_BUF_SIZE 8192
927 #endif
928
929 /* Copy whatever the last rule matched to the standard output. */
930 #ifndef ECHO
931 /* This used to be an fputs(), but since the string might contain NUL's,
932  * we now use fwrite().
933  */
934 #define ECHO fwrite( yytext, yyleng, 1, yyout )
935 #endif
936
937 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
938  * is returned in "result".
939  */
940 #ifndef YY_INPUT
941 #define YY_INPUT(buf,result,max_size) \
942         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
943                 { \
944                 int c = '*'; \
945                 int n; \
946                 for ( n = 0; n < max_size && \
947                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
948                         buf[n] = (char) c; \
949                 if ( c == '\n' ) \
950                         buf[n++] = (char) c; \
951                 if ( c == EOF && ferror( yyin ) ) \
952                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
953                 result = n; \
954                 } \
955         else \
956                 { \
957                 errno=0; \
958                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
959                         { \
960                         if( errno != EINTR) \
961                                 { \
962                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
963                                 break; \
964                                 } \
965                         errno=0; \
966                         clearerr(yyin); \
967                         } \
968                 }\
969 \
970
971 #endif
972
973 /* No semi-colon after return; correct usage is to write "yyterminate();" -
974  * we don't want an extra ';' after the "return" because that will cause
975  * some compilers to complain about unreachable statements.
976  */
977 #ifndef yyterminate
978 #define yyterminate() return YY_NULL
979 #endif
980
981 /* Number of entries by which start-condition stack grows. */
982 #ifndef YY_START_STACK_INCR
983 #define YY_START_STACK_INCR 25
984 #endif
985
986 /* Report a fatal error. */
987 #ifndef YY_FATAL_ERROR
988 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
989 #endif
990
991 /* end tables serialization structures and prototypes */
992
993 /* Default declaration of generated scanner - a define so the user can
994  * easily add parameters.
995  */
996 #ifndef YY_DECL
997 #define YY_DECL_IS_OURS 1
998
999 extern int yylex (void);
1000
1001 #define YY_DECL int yylex (void)
1002 #endif /* !YY_DECL */
1003
1004 /* Code executed at the beginning of each rule, after yytext and yyleng
1005  * have been set up.
1006  */
1007 #ifndef YY_USER_ACTION
1008 #define YY_USER_ACTION
1009 #endif
1010
1011 /* Code executed at the end of each rule. */
1012 #ifndef YY_BREAK
1013 #define YY_BREAK break;
1014 #endif
1015
1016 #define YY_RULE_SETUP \
1017         if ( yyleng > 0 ) \
1018                 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1019                                 (yytext[yyleng - 1] == '\n'); \
1020         YY_USER_ACTION
1021
1022 /** The main scanner function which does all the work.
1023  */
1024 YY_DECL
1025 {
1026         register yy_state_type yy_current_state;
1027         register char *yy_cp, *yy_bp;
1028         register int yy_act;
1029     
1030 #line 115 "scanner.l"
1031
1032 #line 1033 "scanner.c"
1033
1034         if ( !(yy_init) )
1035                 {
1036                 (yy_init) = 1;
1037
1038 #ifdef YY_USER_INIT
1039                 YY_USER_INIT;
1040 #endif
1041
1042         /* Create the reject buffer large enough to save one state per allowed character. */
1043         if ( ! (yy_state_buf) )
1044             (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE  );
1045             if ( ! (yy_state_buf) )
1046                 YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
1047
1048                 if ( ! (yy_start) )
1049                         (yy_start) = 1; /* first start state */
1050
1051                 if ( ! yyin )
1052                         yyin = stdin;
1053
1054                 if ( ! yyout )
1055                         yyout = stdout;
1056
1057                 if ( ! YY_CURRENT_BUFFER ) {
1058                         yyensure_buffer_stack ();
1059                         YY_CURRENT_BUFFER_LVALUE =
1060                                 yy_create_buffer(yyin,YY_BUF_SIZE );
1061                 }
1062
1063                 yy_load_buffer_state( );
1064                 }
1065
1066         while ( 1 )             /* loops until end-of-file is reached */
1067                 {
1068                 (yy_more_len) = 0;
1069                 if ( (yy_more_flag) )
1070                         {
1071                         (yy_more_len) = (yy_c_buf_p) - (yytext_ptr);
1072                         (yy_more_flag) = 0;
1073                         }
1074                 yy_cp = (yy_c_buf_p);
1075
1076                 /* Support of yytext. */
1077                 *yy_cp = (yy_hold_char);
1078
1079                 /* yy_bp points to the position in yy_ch_buf of the start of
1080                  * the current run.
1081                  */
1082                 yy_bp = yy_cp;
1083
1084                 yy_current_state = (yy_start);
1085                 yy_current_state += YY_AT_BOL();
1086
1087                 (yy_state_ptr) = (yy_state_buf);
1088                 *(yy_state_ptr)++ = yy_current_state;
1089
1090 yy_match:
1091                 do
1092                         {
1093                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1094                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1095                                 {
1096                                 yy_current_state = (int) yy_def[yy_current_state];
1097                                 if ( yy_current_state >= 152 )
1098                                         yy_c = yy_meta[(unsigned int) yy_c];
1099                                 }
1100                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1101                         *(yy_state_ptr)++ = yy_current_state;
1102                         ++yy_cp;
1103                         }
1104                 while ( yy_base[yy_current_state] != 813 );
1105
1106 yy_find_action:
1107                 yy_current_state = *--(yy_state_ptr);
1108                 (yy_lp) = yy_accept[yy_current_state];
1109 find_rule: /* we branch to this label when backing up */
1110                 for ( ; ; ) /* until we find what rule we matched */
1111                         {
1112                         if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
1113                                 {
1114                                 yy_act = yy_acclist[(yy_lp)];
1115                                 if ( yy_act & YY_TRAILING_HEAD_MASK ||
1116                                      (yy_looking_for_trail_begin) )
1117                                         {
1118                                         if ( yy_act == (yy_looking_for_trail_begin) )
1119                                                 {
1120                                                 (yy_looking_for_trail_begin) = 0;
1121                                                 yy_act &= ~YY_TRAILING_HEAD_MASK;
1122                                                 break;
1123                                                 }
1124                                         }
1125                                 else if ( yy_act & YY_TRAILING_MASK )
1126                                         {
1127                                         (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK;
1128                                         (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK;
1129                                         (yy_full_match) = yy_cp;
1130                                         (yy_full_state) = (yy_state_ptr);
1131                                         (yy_full_lp) = (yy_lp);
1132                                         }
1133                                 else
1134                                         {
1135                                         (yy_full_match) = yy_cp;
1136                                         (yy_full_state) = (yy_state_ptr);
1137                                         (yy_full_lp) = (yy_lp);
1138                                         break;
1139                                         }
1140                                 ++(yy_lp);
1141                                 goto find_rule;
1142                                 }
1143                         --yy_cp;
1144                         yy_current_state = *--(yy_state_ptr);
1145                         (yy_lp) = yy_accept[yy_current_state];
1146                         }
1147
1148                 YY_DO_BEFORE_ACTION;
1149
1150 do_action:      /* This label is used only to access EOF actions. */
1151
1152                 switch ( yy_act )
1153         { /* beginning of action switch */
1154 case 1:
1155 YY_RULE_SETUP
1156 #line 116 "scanner.l"
1157 {       /* lex/yacc C declarations/definitions */
1158                         global = YES;
1159                         goto more;
1160                         /* NOTREACHED */
1161                 }
1162         YY_BREAK
1163 case 2:
1164 YY_RULE_SETUP
1165 #line 121 "scanner.l"
1166 {
1167                         global = NO;
1168                         goto more;
1169                         /* NOTREACHED */
1170                 }
1171         YY_BREAK
1172 case 3:
1173 YY_RULE_SETUP
1174 #line 126 "scanner.l"
1175 {       /* lex/yacc rules delimiter */
1176                         braces = 0;
1177                         if (rules == NO) {
1178                                 rules = YES;
1179                                 
1180                                 /* simulate a yylex() or yyparse() definition */
1181                                 (void) strcat(yytext, " /* ");
1182                                 first = strlen(yytext);
1183                                 if (lex == YES) {
1184                                         (void) strcat(yytext, "yylex");
1185                                 }
1186                                 else {  /* yacc: yyparse implicitly calls yylex */
1187                                         char *s = " yylex()";
1188                                         char *cp = s + strlen(s);
1189                                         while (--cp >= s) {
1190                                                 unput(*cp);
1191                                         }
1192                                         (void) strcat(yytext, "yyparse");
1193                                 }
1194                                 last = strlen(yytext);
1195                                 (void) strcat(yytext, " */");
1196                                 yyleng = strlen(yytext);
1197                                 yymore();
1198                                 return(FCNDEF);
1199                         }
1200                         else {
1201                                 rules = NO;
1202                                 global = YES;
1203                                 last = first;
1204                                 yymore();
1205                                 return(FCNEND);
1206                                 /* NOTREACHED */
1207                         }
1208                 }
1209         YY_BREAK
1210 case 4:
1211 YY_RULE_SETUP
1212 #line 160 "scanner.l"
1213 { /* sdl state, treat as function def */
1214                         braces = 1;
1215                         fcndef = YES;
1216                         token = FCNDEF;
1217                         goto findident;
1218                         /* NOTREACHED */
1219                 }
1220         YY_BREAK
1221 case 5:
1222 YY_RULE_SETUP
1223 #line 167 "scanner.l"
1224 { /* end of an sdl state, treat as end of a function */
1225                         goto endstate;
1226                         /* NOTREACHED */
1227                 }
1228         YY_BREAK
1229 case 6:
1230 YY_RULE_SETUP
1231 #line 171 "scanner.l"
1232 {       /* count unmatched left braces for fcn def detection */
1233                         ++braces;
1234                         
1235                         /* mark an untagged enum/struct/union so its beginning
1236                            can be found */
1237                         if (tagdef) {
1238                                 if (braces == 1) {
1239                                         esudef = YES;
1240                                 }
1241                                 token = tagdef;
1242                                 tagdef = '\0';
1243                                 last = first;
1244                                 yymore();
1245                                 return(token);
1246                         }
1247                         goto more;
1248                         /* NOTREACHED */
1249                 }
1250         YY_BREAK
1251 case 7:
1252 /* rule 7 can match eol */
1253 YY_RULE_SETUP
1254 #line 189 "scanner.l"
1255 {
1256                         /* attempt to correct erroneous brace count caused by:
1257                          * 
1258                          * #if ...
1259                          *      ... {
1260                          * #endif
1261                          * #if ...
1262                          *      ... {
1263                          * #endif
1264                          */
1265                         /* the current #if must not have an #else or #elif */
1266                         if (elseelif == YES) {
1267                                 goto endif;
1268                                 /* NOTREACHED */
1269                         }
1270                         pseudoelif = YES;
1271                         goto more;
1272                         /* NOTREACHED */
1273                 }
1274         YY_BREAK
1275 case 8:
1276 YY_RULE_SETUP
1277 #line 208 "scanner.l"
1278 { /* #if, #ifdef or #ifndef */
1279                         elseelif = NO;
1280                         if (pseudoelif == YES) {
1281                                 pseudoelif = NO;
1282                                 goto elif;
1283                                 /* NOTREACHED */
1284                         }
1285                         /* make sure there is room for the current brace count */
1286                         if (iflevel == miflevel) {
1287                                 miflevel += IFLEVELINC;
1288                                 maxifbraces = myrealloc(maxifbraces, miflevel * sizeof(int));
1289                                 preifbraces = myrealloc(preifbraces, miflevel * sizeof(int));
1290                         }
1291                         /* push the current brace count */
1292                         preifbraces[iflevel] = braces;
1293                         maxifbraces[iflevel++] = 0;
1294                         goto more;
1295                         /* NOTREACHED */
1296                 }
1297         YY_BREAK
1298 case 9:
1299 YY_RULE_SETUP
1300 #line 227 "scanner.l"
1301 { /* #elif or #else */
1302                         elseelif = YES;
1303                 elif:
1304                         if (iflevel > 0) {
1305                                 
1306                                 /* save the maximum brace count for this #if */
1307                                 if (braces > maxifbraces[iflevel - 1]) {
1308                                         maxifbraces[iflevel - 1] = braces;
1309                                 }
1310                                 /* restore the brace count to before the #if */
1311                                 braces = preifbraces[iflevel - 1];
1312                         }
1313                         goto more;
1314                         /* NOTREACHED */
1315                 }
1316         YY_BREAK
1317 case 10:
1318 YY_RULE_SETUP
1319 #line 242 "scanner.l"
1320 {       /* #endif */
1321                 endif:
1322                         if (iflevel > 0) {
1323                                 
1324                                 /* get the maximum brace count for this #if */
1325                                 if (braces < maxifbraces[--iflevel]) {
1326                                         braces = maxifbraces[iflevel];
1327                                 }
1328                         }
1329                         goto more;
1330                         /* NOTREACHED */
1331                 }
1332         YY_BREAK
1333 case 11:
1334 YY_RULE_SETUP
1335 #line 254 "scanner.l"
1336 {
1337                         /* could be the last enum member initializer */
1338                         if (braces == initializerbraces) {
1339                                 initializerbraces = -1;
1340                                 initializer = NO;
1341                         }
1342                         if (--braces <= 0) {
1343                 endstate:
1344                                 braces = 0;
1345                                 classdef = NO;
1346                         }
1347                         if (braces == 0 || (braces == 1 && classdef == YES)) {
1348
1349                                 /* if the end of an enum/struct/union definition */
1350                                 if (esudef == YES) {
1351                                         esudef = NO;
1352                                 }
1353                                 /* if the end of the function */
1354                                 else if (fcndef == YES) {
1355                                         fcndef = NO;
1356                                         last = first;
1357                                         yymore();
1358                                         return(FCNEND);
1359                                 }
1360                         }
1361                         goto more;
1362                         /* NOTREACHED */
1363                 }
1364         YY_BREAK
1365 case 12:
1366 YY_RULE_SETUP
1367 #line 282 "scanner.l"
1368 {       /* count unmatched left parentheses for function templates */
1369                         ++parens;
1370                         goto more;
1371                         /* NOTREACHED */
1372                 }
1373         YY_BREAK
1374 case 13:
1375 YY_RULE_SETUP
1376 #line 287 "scanner.l"
1377 {
1378                         if (--parens <= 0) {
1379                                 parens = 0;
1380                         }
1381                         /* if the end of a function template */
1382                         if (parens == templateparens) {
1383                                 templateparens = -1;
1384                                 template = NO;
1385                         }
1386                         goto more;
1387                         /* NOTREACHED */
1388                 }
1389         YY_BREAK
1390 case 14:
1391 YY_RULE_SETUP
1392 #line 299 "scanner.l"
1393 {       /* if a global definition initializer */
1394                         if (global == YES && ppdefine == NO && yytext[0] != '#') {
1395                                 initializerbraces = braces;
1396                                 initializer = YES;
1397                         }
1398                         goto more;
1399                         /* NOTREACHED */
1400                 }
1401         YY_BREAK
1402 case 15:
1403 YY_RULE_SETUP
1404 #line 307 "scanner.l"
1405 {       /* a if global structure field */
1406                         if (global == YES && ppdefine == NO && yytext[0] != '#') {
1407                                 structfield = YES;
1408                         }
1409                         goto more;
1410                         /* NOTREACHED */
1411                 }
1412         YY_BREAK
1413 case 16:
1414 YY_RULE_SETUP
1415 #line 314 "scanner.l"
1416 {
1417                         if (braces == initializerbraces) {
1418                                 initializerbraces = -1;
1419                                 initializer = NO;
1420                         }
1421                         structfield = NO;
1422                         goto more;
1423                         /* NOTREACHED */
1424                 }
1425         YY_BREAK
1426 case 17:
1427 YY_RULE_SETUP
1428 #line 323 "scanner.l"
1429 {       /* if the enum/struct/union was not a definition */
1430                         if (braces == 0) {
1431                                 esudef = NO;
1432                         }
1433                         /* if the end of a typedef */
1434                         if (braces == typedefbraces) {
1435                                 typedefbraces = -1;
1436                         }
1437                         /* if the end of a external definition */
1438                         if (braces == externalbraces) {
1439                                 externalbraces = -1;
1440                                 external = NO;
1441                         }
1442                         structfield = NO;
1443                         initializer = NO;
1444                         goto more;
1445                         /* NOTREACHED */
1446                 }
1447         YY_BREAK
1448 case 18:
1449 YY_RULE_SETUP
1450 #line 341 "scanner.l"
1451 {
1452                                 
1453                         /* preprocessor macro or constant definition */
1454                         ppdefine = YES;
1455                         token = DEFINE;
1456                         if (compress == YES) {
1457                                 yytext[0] = '\1';       /* compress the keyword */
1458                         }
1459                 findident:
1460                         first = yyleng - 1;
1461                         while (yytext[first] != ' ' && yytext[first] != '\t') {
1462                                 --first;
1463                         }
1464                         ++first;
1465                         goto fcn;
1466                         /* NOTREACHED */
1467                 }
1468         YY_BREAK
1469 case 19:
1470 /* rule 19 can match eol */
1471 YY_RULE_SETUP
1472 #line 358 "scanner.l"
1473 {       /* class definition */
1474                         classdef = YES;
1475                         tagdef =  'c';
1476                         REJECT;
1477                         /* NOTREACHED */
1478                 }
1479         YY_BREAK
1480 case 20:
1481 /* rule 20 can match eol */
1482 YY_RULE_SETUP
1483 #line 364 "scanner.l"
1484 { /* enum/struct/union definition */
1485                         tagdef = *(yytext + first);
1486                         goto ident;
1487                         /* NOTREACHED */
1488                 }
1489         YY_BREAK
1490 case 21:
1491 /* rule 21 can match eol */
1492 YY_RULE_SETUP
1493 #line 369 "scanner.l"
1494 { /* tag-less e/s/u definition */
1495                         tagdef = yytext[first];
1496                         if (braces == 0) {
1497                                 esudef = YES;
1498                         }
1499                         last = first;
1500                         tagdef = '\0';
1501                         goto more;
1502                 }                       
1503         YY_BREAK
1504 case 22:
1505 /* rule 22 can match eol */
1506 YY_RULE_SETUP
1507 #line 378 "scanner.l"
1508 {
1509                         
1510                         /* warning: "if (...)" must not overflow yytext, so the content
1511                            of function argument definitions is restricted, in particular
1512                            parentheses are not allowed */
1513
1514                         /* if a function definition */
1515                         /* note: "#define a (b) {" and "#if defined(a)\n#" are not */
1516                         if ((braces == 0 && ppdefine == NO && yytext[0] != '#' && rules == NO) ||
1517                             (braces == 1 && classdef == YES)) {
1518                                 fcndef = YES;
1519                                 token = FCNDEF;
1520                                 goto fcn;
1521                                 /* NOTREACHED */
1522                         }
1523                         goto fcncal;
1524                         /* NOTREACHED */
1525                 }
1526         YY_BREAK
1527 case 23:
1528 YY_RULE_SETUP
1529 #line 396 "scanner.l"
1530 { /* if a function call */
1531                 fcncal: if (fcndef == YES || ppdefine == YES || rules == YES) {
1532                                 token = FCNCALL;
1533                                 goto fcn;
1534                                 /* NOTREACHED */
1535                         }
1536                         if (template == NO) {
1537                                 templateparens = parens;
1538                                 template = YES;
1539                         }
1540                         goto ident;
1541                         /* NOTREACHED */
1542                 }
1543         YY_BREAK
1544 case 24:
1545 /* rule 24 can match eol */
1546 YY_RULE_SETUP
1547 #line 409 "scanner.l"
1548 {       /* typedef name use */
1549                         goto ident;
1550                         /* NOTREACHED */
1551                 }
1552         YY_BREAK
1553 case 25:
1554 YY_RULE_SETUP
1555 #line 413 "scanner.l"
1556 {
1557                         char    *s;
1558
1559                         if (global == YES && ppdefine == NO && yytext[0] != '#' &&
1560                             external == NO && initializer == NO && 
1561                             arraydimension == NO && structfield == NO &&
1562                             template == NO && fcndef == NO) {
1563                                 if (esudef == YES) {    /* if enum/struct/union */
1564                                         token = MEMBERDEF;
1565                                 }
1566                                 else {
1567                                         token = GLOBALDEF;
1568                                 }
1569                         }
1570                         else {
1571                 ident:          token = IDENT;
1572                         }
1573                 fcn:
1574                         /* if a long line */
1575                         if (yyleng > STMTMAX) {
1576                                 int     c;
1577                                 
1578                                 /* skip to the end of the line */
1579                                 warning("line too long");
1580                                 while ((c = skipcomment_input()) != LEXEOF) { 
1581                                         if (c == '\n') {
1582                                                 unput(c);
1583                                                 break;
1584                                         }
1585                                 }
1586                         }
1587                         /* truncate a long symbol */
1588                         if (yyleng - first > PATLEN) {
1589                                 warning("symbol too long");
1590                                 yyleng = first + PATLEN;
1591                                 yytext[yyleng] = '\0';
1592                         }
1593                         /* if a keyword */
1594                         yymore();
1595                         if ((s = lookup(yytext + first)) != NULL) {
1596                                 first = yyleng;
1597                                 
1598                                 /* if the start of a typedef */
1599                                 if (s == typedeftext) {
1600                                         typedefbraces = braces;
1601                                         oldtype = YES;
1602                                 }
1603                                 /* if an enum/struct/union */
1604                                 /* (needed for "typedef struct tag name;" so
1605                                    tag isn't marked as the typedef name) */
1606                                 else if (s == enumtext || s == structtext || s == uniontext) {
1607                                 }
1608                                 /* if an external definition */
1609                                 else if (s == externtext) {
1610                                         externalbraces = braces;
1611                                         external = YES;
1612                                 }
1613                                 /* keyword doesn't start a function template */
1614                                 else if (templateparens == parens && template == YES) {
1615                                         templateparens = -1;
1616                                         template = NO;
1617                                 }
1618                                 else {  /* next identifier after typedef was a keyword */
1619                                         oldtype = NO;
1620                                 }
1621                         }
1622                         else {  /* identifier */
1623                                 last = yyleng;
1624                                 
1625                                 /* if a class/enum/struct/union tag definition */
1626                                 if (tagdef && strnotequal(yytext + first, "class")) {
1627                                         token = tagdef;
1628                                         tagdef = '\0';
1629                                         if (braces == 0) {
1630                                                 esudef = YES;
1631                                         }
1632                                 }
1633                                 /* if a typedef name */
1634                                 else if (braces == typedefbraces && oldtype == NO &&
1635                                     arraydimension == NO) {
1636                                         token = TYPEDEF;
1637                                 }
1638                                 else {
1639                                         oldtype = NO;
1640                                 }
1641                                 return(token);
1642                                 /* NOTREACHED */
1643                         }
1644                 }
1645         YY_BREAK
1646 case 26:
1647 YY_RULE_SETUP
1648 #line 502 "scanner.l"
1649 {       /* array dimension (don't worry or about subscripts) */
1650                         arraydimension = YES;
1651                         goto more;
1652                         /* NOTREACHED */
1653                 }
1654         YY_BREAK
1655 case 27:
1656 YY_RULE_SETUP
1657 #line 507 "scanner.l"
1658 {
1659                         arraydimension = NO;
1660                         goto more;
1661                         /* NOTREACHED */
1662                 }
1663         YY_BREAK
1664 case 28:
1665 /* rule 28 can match eol */
1666 YY_RULE_SETUP
1667 #line 512 "scanner.l"
1668 {       /* preprocessor statement is continued on next line */
1669                         goto eol;
1670                         /* NOTREACHED */
1671                 }
1672         YY_BREAK
1673 case 29:
1674 /* rule 29 can match eol */
1675 YY_RULE_SETUP
1676 #line 516 "scanner.l"
1677 {       /* end of the line */
1678                         if (ppdefine == YES) {  /* end of a #define */
1679                                 ppdefine = NO;
1680                                 yyless(yyleng - 1);     /* rescan \n */
1681                                 last = first;
1682                                 yymore();
1683                                 return(DEFINEEND);
1684                         }
1685                         /* skip the first 8 columns of a breakpoint listing line */
1686                         /* and skip the file path in the page header */
1687                         if (bplisting == YES) {
1688                                 int     c, i;
1689
1690                                 switch (skipcomment_input()) {  /* tab and EOF just fall through */
1691                                 case ' ':       /* breakpoint number line */
1692                                 case '[':
1693                                         for (i = 1; i < 8 && skipcomment_input() != LEXEOF; ++i)
1694                                                 ;
1695                                         break;
1696                                 case '.':       /* header line */
1697                                 case '/':
1698                                         /* skip to the end of the line */
1699                                         while ((c = skipcomment_input()) != LEXEOF) {
1700                                                 if (c == '\n') {
1701                                                         unput(c);
1702                                                         break;
1703                                                 }
1704                                         }
1705                                         break;
1706                                 case '\n':      /* empty line */
1707                                         unput('\n');
1708                                         break;
1709                                 }
1710                         }
1711                 eol:
1712                         ++myylineno;
1713                         first = 0;
1714                         last = 0;
1715                         if (symbols > 0) {
1716                                 return(NEWLINE);
1717                         }
1718                         lineno = myylineno;
1719                 }
1720         YY_BREAK
1721 case 30:
1722 YY_RULE_SETUP
1723 #line 559 "scanner.l"
1724 {       /* character constant */
1725                         if (sdl == NO) {
1726                                 multicharconstant('\'');
1727                         }
1728                         goto more;
1729                         /* NOTREACHED */
1730                 }
1731         YY_BREAK
1732 case 31:
1733 YY_RULE_SETUP
1734 #line 566 "scanner.l"
1735 {       /* string constant */
1736                         multicharconstant('"');
1737                         goto more;
1738                         /* NOTREACHED */
1739                 }
1740         YY_BREAK
1741 case 32:
1742 YY_RULE_SETUP
1743 #line 571 "scanner.l"
1744 {       /* don't save leading white space */
1745                 }
1746         YY_BREAK
1747 case 33:
1748 YY_RULE_SETUP
1749 #line 573 "scanner.l"
1750 { /* #include file */
1751                         char    *s;
1752                         
1753                         s = strpbrk(yytext, "\"<");
1754                         if (!s)
1755                                 return(LEXERR);
1756                         incfile(s + 1, s);
1757                         /* HBB: avoid pointer mismatch if yytext is
1758                          * unsigned, or a pointer */
1759                         first = s - (char *)&(yytext[0]);
1760                         last = yyleng;
1761                         if (compress == YES) {
1762                                 yytext[0] = '\2';       /* compress the keyword */
1763                         }
1764                         yymore();
1765                         return(INCLUDE);
1766                         /* NOTREACHED */
1767                 }
1768         YY_BREAK
1769 case 34:
1770 #line 592 "scanner.l"
1771 case 35:
1772 #line 593 "scanner.l"
1773 case 36:
1774 YY_RULE_SETUP
1775 #line 593 "scanner.l"
1776 {       /* punctuation and operators */
1777                 more:   first = yyleng;
1778                         yymore();
1779                 }
1780         YY_BREAK
1781 case 37:
1782 YY_RULE_SETUP
1783 #line 597 "scanner.l"
1784 ECHO;
1785         YY_BREAK
1786 #line 1787 "scanner.c"
1787                         case YY_STATE_EOF(INITIAL):
1788                         case YY_STATE_EOF(SDL):
1789                                 yyterminate();
1790
1791         case YY_END_OF_BUFFER:
1792                 {
1793                 /* Amount of text matched not including the EOB char. */
1794                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1795
1796                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1797                 *yy_cp = (yy_hold_char);
1798                 YY_RESTORE_YY_MORE_OFFSET
1799
1800                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1801                         {
1802                         /* We're scanning a new file or input source.  It's
1803                          * possible that this happened because the user
1804                          * just pointed yyin at a new source and called
1805                          * yylex().  If so, then we have to assure
1806                          * consistency between YY_CURRENT_BUFFER and our
1807                          * globals.  Here is the right place to do so, because
1808                          * this is the first action (other than possibly a
1809                          * back-up) that will match for the new input source.
1810                          */
1811                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1812                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1813                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1814                         }
1815
1816                 /* Note that here we test for yy_c_buf_p "<=" to the position
1817                  * of the first EOB in the buffer, since yy_c_buf_p will
1818                  * already have been incremented past the NUL character
1819                  * (since all states make transitions on EOB to the
1820                  * end-of-buffer state).  Contrast this with the test
1821                  * in input().
1822                  */
1823                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1824                         { /* This was really a NUL. */
1825                         yy_state_type yy_next_state;
1826
1827                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1828
1829                         yy_current_state = yy_get_previous_state(  );
1830
1831                         /* Okay, we're now positioned to make the NUL
1832                          * transition.  We couldn't have
1833                          * yy_get_previous_state() go ahead and do it
1834                          * for us because it doesn't know how to deal
1835                          * with the possibility of jamming (and we don't
1836                          * want to build jamming into it because then it
1837                          * will run more slowly).
1838                          */
1839
1840                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1841
1842                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1843
1844                         if ( yy_next_state )
1845                                 {
1846                                 /* Consume the NUL. */
1847                                 yy_cp = ++(yy_c_buf_p);
1848                                 yy_current_state = yy_next_state;
1849                                 goto yy_match;
1850                                 }
1851
1852                         else
1853                                 {
1854                                 yy_cp = (yy_c_buf_p);
1855                                 goto yy_find_action;
1856                                 }
1857                         }
1858
1859                 else switch ( yy_get_next_buffer(  ) )
1860                         {
1861                         case EOB_ACT_END_OF_FILE:
1862                                 {
1863                                 (yy_did_buffer_switch_on_eof) = 0;
1864
1865                                 if ( yywrap( ) )
1866                                         {
1867                                         /* Note: because we've taken care in
1868                                          * yy_get_next_buffer() to have set up
1869                                          * yytext, we can now set up
1870                                          * yy_c_buf_p so that if some total
1871                                          * hoser (like flex itself) wants to
1872                                          * call the scanner after we return the
1873                                          * YY_NULL, it'll still work - another
1874                                          * YY_NULL will get returned.
1875                                          */
1876                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1877
1878                                         yy_act = YY_STATE_EOF(YY_START);
1879                                         goto do_action;
1880                                         }
1881
1882                                 else
1883                                         {
1884                                         if ( ! (yy_did_buffer_switch_on_eof) )
1885                                                 YY_NEW_FILE;
1886                                         }
1887                                 break;
1888                                 }
1889
1890                         case EOB_ACT_CONTINUE_SCAN:
1891                                 (yy_c_buf_p) =
1892                                         (yytext_ptr) + yy_amount_of_matched_text;
1893
1894                                 yy_current_state = yy_get_previous_state(  );
1895
1896                                 yy_cp = (yy_c_buf_p);
1897                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1898                                 goto yy_match;
1899
1900                         case EOB_ACT_LAST_MATCH:
1901                                 (yy_c_buf_p) =
1902                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1903
1904                                 yy_current_state = yy_get_previous_state(  );
1905
1906                                 yy_cp = (yy_c_buf_p);
1907                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1908                                 goto yy_find_action;
1909                         }
1910                 break;
1911                 }
1912
1913         default:
1914                 YY_FATAL_ERROR(
1915                         "fatal flex scanner internal error--no action found" );
1916         } /* end of action switch */
1917                 } /* end of scanning one token */
1918 } /* end of yylex */
1919
1920 /* yy_get_next_buffer - try to read in a new buffer
1921  *
1922  * Returns a code representing an action:
1923  *      EOB_ACT_LAST_MATCH -
1924  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1925  *      EOB_ACT_END_OF_FILE - end of file
1926  */
1927 static int yy_get_next_buffer (void)
1928 {
1929         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1930         register char *source = (yytext_ptr);
1931         register int number_to_move, i;
1932         int ret_val;
1933
1934         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1935                 YY_FATAL_ERROR(
1936                 "fatal flex scanner internal error--end of buffer missed" );
1937
1938         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1939                 { /* Don't try to fill the buffer, so this is an EOF. */
1940                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1941                         {
1942                         /* We matched a single character, the EOB, so
1943                          * treat this as a final EOF.
1944                          */
1945                         return EOB_ACT_END_OF_FILE;
1946                         }
1947
1948                 else
1949                         {
1950                         /* We matched some text prior to the EOB, first
1951                          * process it.
1952                          */
1953                         return EOB_ACT_LAST_MATCH;
1954                         }
1955                 }
1956
1957         /* Try to read more data. */
1958
1959         /* First move last chars to start of buffer. */
1960         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1961
1962         for ( i = 0; i < number_to_move; ++i )
1963                 *(dest++) = *(source++);
1964
1965         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1966                 /* don't do the read, it's not guaranteed to return an EOF,
1967                  * just force an EOF
1968                  */
1969                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1970
1971         else
1972                 {
1973                         int num_to_read =
1974                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1975
1976                 while ( num_to_read <= 0 )
1977                         { /* Not enough room in the buffer - grow it. */
1978
1979                         YY_FATAL_ERROR(
1980 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1981
1982                         }
1983
1984                 if ( num_to_read > YY_READ_BUF_SIZE )
1985                         num_to_read = YY_READ_BUF_SIZE;
1986
1987                 /* Read in more data. */
1988                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1989                         (yy_n_chars), (size_t) num_to_read );
1990
1991                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1992                 }
1993
1994         if ( (yy_n_chars) == 0 )
1995                 {
1996                 if ( number_to_move == YY_MORE_ADJ )
1997                         {
1998                         ret_val = EOB_ACT_END_OF_FILE;
1999                         yyrestart(yyin  );
2000                         }
2001
2002                 else
2003                         {
2004                         ret_val = EOB_ACT_LAST_MATCH;
2005                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2006                                 YY_BUFFER_EOF_PENDING;
2007                         }
2008                 }
2009
2010         else
2011                 ret_val = EOB_ACT_CONTINUE_SCAN;
2012
2013         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2014                 /* Extend the array by 50%, plus the number we really need. */
2015                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2016                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
2017                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2018                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2019         }
2020
2021         (yy_n_chars) += number_to_move;
2022         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2023         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2024
2025         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2026
2027         return ret_val;
2028 }
2029
2030 /* yy_get_previous_state - get the state just before the EOB char was reached */
2031
2032     static yy_state_type yy_get_previous_state (void)
2033 {
2034         register yy_state_type yy_current_state;
2035         register char *yy_cp;
2036     
2037         yy_current_state = (yy_start);
2038         yy_current_state += YY_AT_BOL();
2039
2040         (yy_state_ptr) = (yy_state_buf);
2041         *(yy_state_ptr)++ = yy_current_state;
2042
2043         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2044                 {
2045                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2046                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2047                         {
2048                         yy_current_state = (int) yy_def[yy_current_state];
2049                         if ( yy_current_state >= 152 )
2050                                 yy_c = yy_meta[(unsigned int) yy_c];
2051                         }
2052                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2053                 *(yy_state_ptr)++ = yy_current_state;
2054                 }
2055
2056         return yy_current_state;
2057 }
2058
2059 /* yy_try_NUL_trans - try to make a transition on the NUL character
2060  *
2061  * synopsis
2062  *      next_state = yy_try_NUL_trans( current_state );
2063  */
2064     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
2065 {
2066         register int yy_is_jam;
2067     
2068         register YY_CHAR yy_c = 1;
2069         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2070                 {
2071                 yy_current_state = (int) yy_def[yy_current_state];
2072                 if ( yy_current_state >= 152 )
2073                         yy_c = yy_meta[(unsigned int) yy_c];
2074                 }
2075         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2076         yy_is_jam = (yy_current_state == 151);
2077         if ( ! yy_is_jam )
2078                 *(yy_state_ptr)++ = yy_current_state;
2079
2080         return yy_is_jam ? 0 : yy_current_state;
2081 }
2082
2083     static void yyunput (int c, register char * yy_bp )
2084 {
2085         register char *yy_cp;
2086     
2087     yy_cp = (yy_c_buf_p);
2088
2089         /* undo effects of setting up yytext */
2090         *yy_cp = (yy_hold_char);
2091
2092         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2093                 { /* need to shift things up to make room */
2094                 /* +2 for EOB chars. */
2095                 register int number_to_move = (yy_n_chars) + 2;
2096                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2097                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2098                 register char *source =
2099                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2100
2101                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2102                         *--dest = *--source;
2103
2104                 yy_cp += (int) (dest - source);
2105                 yy_bp += (int) (dest - source);
2106                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2107                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2108
2109                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2110                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
2111                 }
2112
2113         *--yy_cp = (char) c;
2114
2115         (yytext_ptr) = yy_bp;
2116         (yy_hold_char) = *yy_cp;
2117         (yy_c_buf_p) = yy_cp;
2118 }
2119
2120 #ifndef YY_NO_INPUT
2121 #ifdef __cplusplus
2122     static int yyinput (void)
2123 #else
2124     static int input  (void)
2125 #endif
2126
2127 {
2128         int c;
2129     
2130         *(yy_c_buf_p) = (yy_hold_char);
2131
2132         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2133                 {
2134                 /* yy_c_buf_p now points to the character we want to return.
2135                  * If this occurs *before* the EOB characters, then it's a
2136                  * valid NUL; if not, then we've hit the end of the buffer.
2137                  */
2138                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2139                         /* This was really a NUL. */
2140                         *(yy_c_buf_p) = '\0';
2141
2142                 else
2143                         { /* need more input */
2144                         int offset = (yy_c_buf_p) - (yytext_ptr);
2145                         ++(yy_c_buf_p);
2146
2147                         switch ( yy_get_next_buffer(  ) )
2148                                 {
2149                                 case EOB_ACT_LAST_MATCH:
2150                                         /* This happens because yy_g_n_b()
2151                                          * sees that we've accumulated a
2152                                          * token and flags that we need to
2153                                          * try matching the token before
2154                                          * proceeding.  But for input(),
2155                                          * there's no matching to consider.
2156                                          * So convert the EOB_ACT_LAST_MATCH
2157                                          * to EOB_ACT_END_OF_FILE.
2158                                          */
2159
2160                                         /* Reset buffer status. */
2161                                         yyrestart(yyin );
2162
2163                                         /*FALLTHROUGH*/
2164
2165                                 case EOB_ACT_END_OF_FILE:
2166                                         {
2167                                         if ( yywrap( ) )
2168                                                 return EOF;
2169
2170                                         if ( ! (yy_did_buffer_switch_on_eof) )
2171                                                 YY_NEW_FILE;
2172 #ifdef __cplusplus
2173                                         return yyinput();
2174 #else
2175                                         return input();
2176 #endif
2177                                         }
2178
2179                                 case EOB_ACT_CONTINUE_SCAN:
2180                                         (yy_c_buf_p) = (yytext_ptr) + offset;
2181                                         break;
2182                                 }
2183                         }
2184                 }
2185
2186         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
2187         *(yy_c_buf_p) = '\0';   /* preserve yytext */
2188         (yy_hold_char) = *++(yy_c_buf_p);
2189
2190         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2191
2192         return c;
2193 }
2194 #endif  /* ifndef YY_NO_INPUT */
2195
2196 /** Immediately switch to a different input stream.
2197  * @param input_file A readable stream.
2198  * 
2199  * @note This function does not reset the start condition to @c INITIAL .
2200  */
2201     void yyrestart  (FILE * input_file )
2202 {
2203     
2204         if ( ! YY_CURRENT_BUFFER ){
2205         yyensure_buffer_stack ();
2206                 YY_CURRENT_BUFFER_LVALUE =
2207             yy_create_buffer(yyin,YY_BUF_SIZE );
2208         }
2209
2210         yy_init_buffer(YY_CURRENT_BUFFER,input_file );
2211         yy_load_buffer_state( );
2212 }
2213
2214 /** Switch to a different input buffer.
2215  * @param new_buffer The new input buffer.
2216  * 
2217  */
2218     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
2219 {
2220     
2221         /* TODO. We should be able to replace this entire function body
2222          * with
2223          *              yypop_buffer_state();
2224          *              yypush_buffer_state(new_buffer);
2225      */
2226         yyensure_buffer_stack ();
2227         if ( YY_CURRENT_BUFFER == new_buffer )
2228                 return;
2229
2230         if ( YY_CURRENT_BUFFER )
2231                 {
2232                 /* Flush out information for old buffer. */
2233                 *(yy_c_buf_p) = (yy_hold_char);
2234                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2235                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2236                 }
2237
2238         YY_CURRENT_BUFFER_LVALUE = new_buffer;
2239         yy_load_buffer_state( );
2240
2241         /* We don't actually know whether we did this switch during
2242          * EOF (yywrap()) processing, but the only time this flag
2243          * is looked at is after yywrap() is called, so it's safe
2244          * to go ahead and always set it.
2245          */
2246         (yy_did_buffer_switch_on_eof) = 1;
2247 }
2248
2249 static void yy_load_buffer_state  (void)
2250 {
2251         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2252         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2253         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2254         (yy_hold_char) = *(yy_c_buf_p);
2255 }
2256
2257 /** Allocate and initialize an input buffer state.
2258  * @param file A readable stream.
2259  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2260  * 
2261  * @return the allocated buffer state.
2262  */
2263     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
2264 {
2265         YY_BUFFER_STATE b;
2266     
2267         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
2268         if ( ! b )
2269                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2270
2271         b->yy_buf_size = size;
2272
2273         /* yy_ch_buf has to be 2 characters longer than the size given because
2274          * we need to put in 2 end-of-buffer characters.
2275          */
2276         b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
2277         if ( ! b->yy_ch_buf )
2278                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2279
2280         b->yy_is_our_buffer = 1;
2281
2282         yy_init_buffer(b,file );
2283
2284         return b;
2285 }
2286
2287 /** Destroy the buffer.
2288  * @param b a buffer created with yy_create_buffer()
2289  * 
2290  */
2291     void yy_delete_buffer (YY_BUFFER_STATE  b )
2292 {
2293     
2294         if ( ! b )
2295                 return;
2296
2297         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2298                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2299
2300         if ( b->yy_is_our_buffer )
2301                 yyfree((void *) b->yy_ch_buf  );
2302
2303         yyfree((void *) b  );
2304 }
2305
2306 #ifndef __cplusplus
2307 extern int isatty (int );
2308 #endif /* __cplusplus */
2309     
2310 /* Initializes or reinitializes a buffer.
2311  * This function is sometimes called more than once on the same buffer,
2312  * such as during a yyrestart() or at EOF.
2313  */
2314     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
2315
2316 {
2317         int oerrno = errno;
2318     
2319         yy_flush_buffer(b );
2320
2321         b->yy_input_file = file;
2322         b->yy_fill_buffer = 1;
2323
2324     /* If b is the current buffer, then yy_init_buffer was _probably_
2325      * called from yyrestart() or through yy_get_next_buffer.
2326      * In that case, we don't want to reset the lineno or column.
2327      */
2328     if (b != YY_CURRENT_BUFFER){
2329         b->yy_bs_lineno = 1;
2330         b->yy_bs_column = 0;
2331     }
2332
2333         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2334     
2335         errno = oerrno;
2336 }
2337
2338 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2339  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2340  * 
2341  */
2342     void yy_flush_buffer (YY_BUFFER_STATE  b )
2343 {
2344         if ( ! b )
2345                 return;
2346
2347         b->yy_n_chars = 0;
2348
2349         /* We always need two end-of-buffer characters.  The first causes
2350          * a transition to the end-of-buffer state.  The second causes
2351          * a jam in that state.
2352          */
2353         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2354         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2355
2356         b->yy_buf_pos = &b->yy_ch_buf[0];
2357
2358         b->yy_at_bol = 1;
2359         b->yy_buffer_status = YY_BUFFER_NEW;
2360
2361         if ( b == YY_CURRENT_BUFFER )
2362                 yy_load_buffer_state( );
2363 }
2364
2365 /** Pushes the new state onto the stack. The new state becomes
2366  *  the current state. This function will allocate the stack
2367  *  if necessary.
2368  *  @param new_buffer The new state.
2369  *  
2370  */
2371 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2372 {
2373         if (new_buffer == NULL)
2374                 return;
2375
2376         yyensure_buffer_stack();
2377
2378         /* This block is copied from yy_switch_to_buffer. */
2379         if ( YY_CURRENT_BUFFER )
2380                 {
2381                 /* Flush out information for old buffer. */
2382                 *(yy_c_buf_p) = (yy_hold_char);
2383                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2384                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2385                 }
2386
2387         /* Only push if top exists. Otherwise, replace top. */
2388         if (YY_CURRENT_BUFFER)
2389                 (yy_buffer_stack_top)++;
2390         YY_CURRENT_BUFFER_LVALUE = new_buffer;
2391
2392         /* copied from yy_switch_to_buffer. */
2393         yy_load_buffer_state( );
2394         (yy_did_buffer_switch_on_eof) = 1;
2395 }
2396
2397 /** Removes and deletes the top of the stack, if present.
2398  *  The next element becomes the new top.
2399  *  
2400  */
2401 void yypop_buffer_state (void)
2402 {
2403         if (!YY_CURRENT_BUFFER)
2404                 return;
2405
2406         yy_delete_buffer(YY_CURRENT_BUFFER );
2407         YY_CURRENT_BUFFER_LVALUE = NULL;
2408         if ((yy_buffer_stack_top) > 0)
2409                 --(yy_buffer_stack_top);
2410
2411         if (YY_CURRENT_BUFFER) {
2412                 yy_load_buffer_state( );
2413                 (yy_did_buffer_switch_on_eof) = 1;
2414         }
2415 }
2416
2417 /* Allocates the stack if it does not exist.
2418  *  Guarantees space for at least one push.
2419  */
2420 static void yyensure_buffer_stack (void)
2421 {
2422         int num_to_alloc;
2423     
2424         if (!(yy_buffer_stack)) {
2425
2426                 /* First allocation is just for 2 elements, since we don't know if this
2427                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
2428                  * immediate realloc on the next call.
2429          */
2430                 num_to_alloc = 1;
2431                 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2432                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
2433                                                                 );
2434                 if ( ! (yy_buffer_stack) )
2435                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2436                                                                   
2437                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2438                                 
2439                 (yy_buffer_stack_max) = num_to_alloc;
2440                 (yy_buffer_stack_top) = 0;
2441                 return;
2442         }
2443
2444         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2445
2446                 /* Increase the buffer to prepare for a possible push. */
2447                 int grow_size = 8 /* arbitrary grow size */;
2448
2449                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2450                 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2451                                                                 ((yy_buffer_stack),
2452                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
2453                                                                 );
2454                 if ( ! (yy_buffer_stack) )
2455                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2456
2457                 /* zero only the new slots.*/
2458                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2459                 (yy_buffer_stack_max) = num_to_alloc;
2460         }
2461 }
2462
2463 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2464  * @param base the character buffer
2465  * @param size the size in bytes of the character buffer
2466  * 
2467  * @return the newly allocated buffer state object. 
2468  */
2469 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
2470 {
2471         YY_BUFFER_STATE b;
2472     
2473         if ( size < 2 ||
2474              base[size-2] != YY_END_OF_BUFFER_CHAR ||
2475              base[size-1] != YY_END_OF_BUFFER_CHAR )
2476                 /* They forgot to leave room for the EOB's. */
2477                 return 0;
2478
2479         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
2480         if ( ! b )
2481                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2482
2483         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
2484         b->yy_buf_pos = b->yy_ch_buf = base;
2485         b->yy_is_our_buffer = 0;
2486         b->yy_input_file = 0;
2487         b->yy_n_chars = b->yy_buf_size;
2488         b->yy_is_interactive = 0;
2489         b->yy_at_bol = 1;
2490         b->yy_fill_buffer = 0;
2491         b->yy_buffer_status = YY_BUFFER_NEW;
2492
2493         yy_switch_to_buffer(b  );
2494
2495         return b;
2496 }
2497
2498 /** Setup the input buffer state to scan a string. The next call to yylex() will
2499  * scan from a @e copy of @a str.
2500  * @param yystr a NUL-terminated string to scan
2501  * 
2502  * @return the newly allocated buffer state object.
2503  * @note If you want to scan bytes that may contain NUL values, then use
2504  *       yy_scan_bytes() instead.
2505  */
2506 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2507 {
2508     
2509         return yy_scan_bytes(yystr,strlen(yystr) );
2510 }
2511
2512 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2513  * scan from a @e copy of @a bytes.
2514  * @param bytes the byte buffer to scan
2515  * @param len the number of bytes in the buffer pointed to by @a bytes.
2516  * 
2517  * @return the newly allocated buffer state object.
2518  */
2519 YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2520 {
2521         YY_BUFFER_STATE b;
2522         char *buf;
2523         yy_size_t n;
2524         int i;
2525     
2526         /* Get memory for full buffer, including space for trailing EOB's. */
2527         n = _yybytes_len + 2;
2528         buf = (char *) yyalloc(n  );
2529         if ( ! buf )
2530                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2531
2532         for ( i = 0; i < _yybytes_len; ++i )
2533                 buf[i] = yybytes[i];
2534
2535         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2536
2537         b = yy_scan_buffer(buf,n );
2538         if ( ! b )
2539                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2540
2541         /* It's okay to grow etc. this buffer, and we should throw it
2542          * away when we're done.
2543          */
2544         b->yy_is_our_buffer = 1;
2545
2546         return b;
2547 }
2548
2549 #ifndef YY_EXIT_FAILURE
2550 #define YY_EXIT_FAILURE 2
2551 #endif
2552
2553 static void yy_fatal_error (yyconst char* msg )
2554 {
2555         (void) fprintf( stderr, "%s\n", msg );
2556         exit( YY_EXIT_FAILURE );
2557 }
2558
2559 /* Redefine yyless() so it works in section 3 code. */
2560
2561 #undef yyless
2562 #define yyless(n) \
2563         do \
2564                 { \
2565                 /* Undo effects of setting up yytext. */ \
2566         int yyless_macro_arg = (n); \
2567         YY_LESS_LINENO(yyless_macro_arg);\
2568                 yytext[yyleng] = (yy_hold_char); \
2569                 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2570                 (yy_hold_char) = *(yy_c_buf_p); \
2571                 *(yy_c_buf_p) = '\0'; \
2572                 yyleng = yyless_macro_arg; \
2573                 } \
2574         while ( 0 )
2575
2576 /* Accessor  methods (get/set functions) to struct members. */
2577
2578 /** Get the current line number.
2579  * 
2580  */
2581 int yyget_lineno  (void)
2582 {
2583         
2584     return yylineno;
2585 }
2586
2587 /** Get the input stream.
2588  * 
2589  */
2590 FILE *yyget_in  (void)
2591 {
2592         return yyin;
2593 }
2594
2595 /** Get the output stream.
2596  * 
2597  */
2598 FILE *yyget_out  (void)
2599 {
2600         return yyout;
2601 }
2602
2603 /** Get the length of the current token.
2604  * 
2605  */
2606 int yyget_leng  (void)
2607 {
2608         return yyleng;
2609 }
2610
2611 /** Get the current token.
2612  * 
2613  */
2614
2615 char *yyget_text  (void)
2616 {
2617         return yytext;
2618 }
2619
2620 /** Set the current line number.
2621  * @param line_number
2622  * 
2623  */
2624 void yyset_lineno (int  line_number )
2625 {
2626     
2627     yylineno = line_number;
2628 }
2629
2630 /** Set the input stream. This does not discard the current
2631  * input buffer.
2632  * @param in_str A readable stream.
2633  * 
2634  * @see yy_switch_to_buffer
2635  */
2636 void yyset_in (FILE *  in_str )
2637 {
2638         yyin = in_str ;
2639 }
2640
2641 void yyset_out (FILE *  out_str )
2642 {
2643         yyout = out_str ;
2644 }
2645
2646 int yyget_debug  (void)
2647 {
2648         return yy_flex_debug;
2649 }
2650
2651 void yyset_debug (int  bdebug )
2652 {
2653         yy_flex_debug = bdebug ;
2654 }
2655
2656 static int yy_init_globals (void)
2657 {
2658         /* Initialization is the same as for the non-reentrant scanner.
2659      * This function is called from yylex_destroy(), so don't allocate here.
2660      */
2661
2662     (yy_buffer_stack) = 0;
2663     (yy_buffer_stack_top) = 0;
2664     (yy_buffer_stack_max) = 0;
2665     (yy_c_buf_p) = (char *) 0;
2666     (yy_init) = 0;
2667     (yy_start) = 0;
2668
2669     (yy_state_buf) = 0;
2670     (yy_state_ptr) = 0;
2671     (yy_full_match) = 0;
2672     (yy_lp) = 0;
2673
2674 /* Defined in main.c */
2675 #ifdef YY_STDINIT
2676     yyin = stdin;
2677     yyout = stdout;
2678 #else
2679     yyin = (FILE *) 0;
2680     yyout = (FILE *) 0;
2681 #endif
2682
2683     /* For future reference: Set errno on error, since we are called by
2684      * yylex_init()
2685      */
2686     return 0;
2687 }
2688
2689 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2690 int yylex_destroy  (void)
2691 {
2692     
2693     /* Pop the buffer stack, destroying each element. */
2694         while(YY_CURRENT_BUFFER){
2695                 yy_delete_buffer(YY_CURRENT_BUFFER  );
2696                 YY_CURRENT_BUFFER_LVALUE = NULL;
2697                 yypop_buffer_state();
2698         }
2699
2700         /* Destroy the stack itself. */
2701         yyfree((yy_buffer_stack) );
2702         (yy_buffer_stack) = NULL;
2703
2704     yyfree ( (yy_state_buf) );
2705     (yy_state_buf)  = NULL;
2706
2707     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2708      * yylex() is called, initialization will occur. */
2709     yy_init_globals( );
2710
2711     return 0;
2712 }
2713
2714 /*
2715  * Internal utility routines.
2716  */
2717
2718 #ifndef yytext_ptr
2719 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2720 {
2721         register int i;
2722         for ( i = 0; i < n; ++i )
2723                 s1[i] = s2[i];
2724 }
2725 #endif
2726
2727 #ifdef YY_NEED_STRLEN
2728 static int yy_flex_strlen (yyconst char * s )
2729 {
2730         register int n;
2731         for ( n = 0; s[n]; ++n )
2732                 ;
2733
2734         return n;
2735 }
2736 #endif
2737
2738 void *yyalloc (yy_size_t  size )
2739 {
2740         return (void *) malloc( size );
2741 }
2742
2743 void *yyrealloc  (void * ptr, yy_size_t  size )
2744 {
2745         /* The cast to (char *) in the following accommodates both
2746          * implementations that use char* generic pointers, and those
2747          * that use void* generic pointers.  It works with the latter
2748          * because both ANSI C and C++ allow castless assignment from
2749          * any pointer type to void*, and deal with argument conversions
2750          * as though doing an assignment.
2751          */
2752         return (void *) realloc( (char *) ptr, size );
2753 }
2754
2755 void yyfree (void * ptr )
2756 {
2757         free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
2758 }
2759
2760 #define YYTABLES_NAME "yytables"
2761
2762 #line 597 "scanner.l"
2763
2764
2765
2766 void
2767 initscanner(char *srcfile)
2768 {
2769         char    *s;
2770         
2771         if (maxifbraces == NULL) {
2772                 maxifbraces = mymalloc(miflevel * sizeof(int));
2773                 preifbraces = mymalloc(miflevel * sizeof(int));
2774         }
2775         first = 0;              /* buffer index for first char of symbol */
2776         last = 0;               /* buffer index for last char of symbol */
2777         lineno = 1;             /* symbol line number */
2778         myylineno = 1;          /* input line number */
2779         arraydimension = NO;    /* inside array dimension declaration */
2780         bplisting = NO;         /* breakpoint listing */
2781         braces = 0;             /* unmatched left brace count */
2782         classdef = NO;          /* c++ class definition */
2783         elseelif = NO;          /* #else or #elif found */
2784         esudef = NO;            /* enum/struct/union global definition */
2785         external = NO;          /* external definition */
2786         externalbraces = -1;    /* external definition outer brace count */
2787         fcndef = NO;            /* function definition */
2788         global = YES;           /* file global scope (outside functions) */
2789         iflevel = 0;            /* #if nesting level */
2790         initializer = NO;       /* data initializer */
2791         initializerbraces = -1; /* data initializer outer brace count */
2792         lex = NO;               /* lex file */
2793         parens = 0;             /* unmatched left parenthesis count */
2794         ppdefine = NO;          /* preprocessor define statement */
2795         pseudoelif = NO;        /* pseudo-#elif */
2796         oldtype = NO;           /* next identifier is an old type */
2797         rules = NO;             /* lex/yacc rules */
2798         sdl = NO;               /* sdl file */
2799         structfield = NO;       /* structure field declaration */
2800         tagdef = '\0';          /* class/enum/struct/union tag definition */
2801         template = NO;          /* function template */
2802         templateparens = -1;    /* function template outer parentheses count */
2803         typedefbraces = -1;     /* initial typedef braces count */
2804
2805         BEGIN 0;
2806
2807         /* if this is not a C file */
2808         if ((s = strrchr(srcfile, '.')) != NULL) {
2809                 switch (*++s) { /* this switch saves time on C files */
2810                 case 'b':
2811                         if (strcmp(s, "bp") == 0) {     /* breakpoint listing */
2812                                 bplisting = YES;
2813                         }
2814                         break;
2815                 case 'l':
2816                         if (strcmp(s, "l") == 0) {      /* lex */
2817                                 lex = YES;
2818                                 global = NO;
2819                         }
2820                         break;
2821                 case 's':
2822                         if (strcmp(s, "sd") == 0) {     /* sdl */
2823                                 sdl = YES;
2824                                 BEGIN SDL;
2825                         }
2826                         break;
2827                 case 'y':
2828                         if (strcmp(s, "y") == 0) {      /* yacc */
2829                                 global = NO;
2830                         }
2831                         break;
2832                 }
2833         }
2834 }
2835
2836 int
2837 skipcomment_input(void)
2838 {
2839         int     c;
2840
2841         if ((c = getc (yyin)) == '/') {
2842                 return comment ();
2843         }
2844         else {
2845                 return c;
2846         }
2847         
2848 }
2849
2850 int
2851 comment_input(void)
2852 {
2853         int c;
2854
2855         c = getc (yyin);
2856
2857         return (c == EOF) ? LEXEOF : c;
2858 }
2859
2860 int
2861 comment(void)
2862 {
2863         int     c, lastc;
2864
2865         do {
2866                 if ((c = getc(yyin)) == '*') {  /* C comment */
2867                         lastc = '\0';
2868                         while ((c = getc(yyin)) != EOF &&
2869                             (c != '/' || lastc != '*')) { /* fewer '/'s */
2870                                 if (c == '\n') {
2871                                         ++myylineno;
2872                                 }
2873                                 lastc = c;
2874                         }
2875                         /* return a blank for Reiser cpp token concatenation */
2876                         if ((c = getc(yyin)) == '_' || isalnum(c)) {
2877                                 (void) ungetc(c, yyin);
2878                                 c = ' ';
2879                                 break;
2880                         }
2881                 }
2882                 else if (c == '/') {            /* C++ comment */
2883                         while ((c = getc(yyin)) != EOF && c != '\n') {
2884                                 ;
2885                         }
2886                         break;
2887                 }
2888                 else {  /* not a comment */
2889                         (void) ungetc(c, yyin);
2890                         c = '/';
2891                         break;
2892                         /* NOTREACHED */
2893                 }
2894                 
2895         /* there may be an immediately following comment */
2896         } while (c == '/');
2897         return(c);
2898 }
2899
2900 void
2901 multicharconstant(char terminator)
2902 {
2903         char    c;
2904
2905         /* scan until the terminator is found */
2906         while ((c = yytext[yyleng++] = comment_input()) != terminator) {
2907                 switch (c) {
2908                 case '\\':      /* escape character */
2909                         if ((yytext[yyleng++] = comment_input()) == '\n') {
2910                                 ++myylineno;
2911                         }
2912                         break;
2913                 case '\t':      /* tab character */
2914                 
2915                         /* if not a lex program, continue */
2916                         if (lex == NO) {
2917                                 break;
2918                         }
2919                         /* fall through */
2920                         
2921                 case '\n':      /* illegal character */
2922                         
2923                         /* assume the terminator is missing, so put
2924                            this character back */
2925                         unput(c);
2926                         yytext[--yyleng] = '\0';
2927                         /* fall through */
2928                         
2929                 case LEXEOF:    /* end of file */
2930                         return;
2931                         
2932                 default:
2933                         /* change a control character to a blank */
2934                         if (!isprint((unsigned char)c)) {
2935                                 yytext[yyleng - 1] = ' ';
2936                         }
2937                 }
2938                 /* if this token will overflow the line buffer */
2939                 /* note: '\\' may cause yyleng to be > STMTMAX */
2940                 if (yyleng >= STMTMAX) {
2941                         
2942                         /* truncate the token */
2943                         while ((c = comment_input()) != LEXEOF) {
2944                                 if (c == terminator) {
2945                                         unput(c);
2946                                         break;
2947                                 }
2948                                 else if (c == '\n') {
2949                                         ++myylineno;
2950                                 }
2951                         }
2952                 }
2953         }
2954         yytext[yyleng] = '\0';
2955 }
2956