4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
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
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
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;
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;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
87 #endif /* ! FLEXINT_H */
91 /* The "const" storage-class-modifier is valid. */
94 #else /* ! __cplusplus */
96 /* C99 requires __STDC__ to be defined as 1. */
97 #if defined (__STDC__)
101 #endif /* defined (__STDC__) */
102 #endif /* ! __cplusplus */
105 #define yyconst const
110 /* Returned upon end-of-file. */
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
118 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
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.
124 #define BEGIN (yy_start) = 1 + 2 *
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
130 #define YY_START (((yy_start) - 1) / 2)
131 #define YYSTATE YY_START
133 /* Action number for EOF rule of a given start state. */
134 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136 /* Special action meaning "start processing a new file". */
137 #define YY_NEW_FILE yyrestart(yyin )
139 #define YY_END_OF_BUFFER_CHAR 0
141 /* Size of default input buffer. */
143 #define YY_BUF_SIZE 16384
146 /* The state buf must be large enough to hold one state per character in the main buffer.
148 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
150 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
151 #define YY_TYPEDEF_YY_BUFFER_STATE
152 typedef struct yy_buffer_state *YY_BUFFER_STATE;
157 extern FILE *yyin, *yyout;
159 #define EOB_ACT_CONTINUE_SCAN 0
160 #define EOB_ACT_END_OF_FILE 1
161 #define EOB_ACT_LAST_MATCH 2
163 #define YY_LESS_LINENO(n)
165 /* Return all but the first "n" matched characters back to the input stream. */
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 */ \
179 #define unput(c) yyunput( c, (yytext_ptr) )
181 #ifndef YY_TYPEDEF_YY_SIZE_T
182 #define YY_TYPEDEF_YY_SIZE_T
183 typedef size_t yy_size_t;
186 #ifndef YY_STRUCT_YY_BUFFER_STATE
187 #define YY_STRUCT_YY_BUFFER_STATE
188 struct yy_buffer_state
192 char *yy_ch_buf; /* input buffer */
193 char *yy_buf_pos; /* current position in input buffer */
195 /* Size of input buffer in bytes, not including room for EOB
198 yy_size_t yy_buf_size;
200 /* Number of characters read into yy_ch_buf, not including EOB
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
209 int yy_is_our_buffer;
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
216 int yy_is_interactive;
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
224 int yy_bs_lineno; /**< The line count. */
225 int yy_bs_column; /**< The column count. */
227 /* Whether to try to fill the input buffer when we reach the
232 int yy_buffer_status;
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.
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.
246 #define YY_BUFFER_EOF_PENDING 2
249 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
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. */
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
260 * Returns the top of the stack, or NULL.
262 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
263 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
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.
269 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
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 */
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 */
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 ...
284 static int yy_did_buffer_switch_on_eof;
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 );
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 );
298 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
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 );
304 void *yyalloc (yy_size_t );
305 void *yyrealloc (void *,yy_size_t );
306 void yyfree (void * );
308 #define yy_new_buffer yy_create_buffer
310 #define yy_set_interactive(is_interactive) \
312 if ( ! YY_CURRENT_BUFFER ){ \
313 yyensure_buffer_stack (); \
314 YY_CURRENT_BUFFER_LVALUE = \
315 yy_create_buffer(yyin,YY_BUF_SIZE ); \
317 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
320 #define yy_set_bol(at_bol) \
322 if ( ! YY_CURRENT_BUFFER ){\
323 yyensure_buffer_stack (); \
324 YY_CURRENT_BUFFER_LVALUE = \
325 yy_create_buffer(yyin,YY_BUF_SIZE ); \
327 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
330 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
332 /* Begin user sect3 */
334 typedef unsigned char YY_CHAR;
336 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
338 typedef int yy_state_type;
345 #define yytext_ptr yytext
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[] );
352 /* Done after the current pattern has been matched and before the
353 * corresponding action - sets up yytext.
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; \
361 (yy_c_buf_p) = yy_cp;
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. */
369 flex_int32_t yy_verify;
372 static yyconst flex_int16_t yy_acclist[267] =
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,
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,
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
405 static yyconst flex_int16_t yy_accept[153] =
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,
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,
426 static yyconst flex_int32_t yy_ec[256] =
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,
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,
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,
458 static yyconst flex_int32_t yy_meta[55] =
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,
468 static yyconst flex_int16_t yy_base[169] =
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,
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
490 static yyconst flex_int16_t yy_def[169] =
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,
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
512 static yyconst flex_int16_t yy_nxt[868] =
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,
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,
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,
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,
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,
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,
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,
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,
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
611 static yyconst flex_int16_t yy_chk[868] =
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,
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,
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,
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,
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,
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,
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,
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,
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
710 extern int yy_flex_debug;
711 int yy_flex_debug = 0;
713 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
714 static char *yy_full_match;
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
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 */ \
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
740 /*===========================================================================
741 Copyright (c) 1998-2000, The Santa Cruz Operation
744 Redistribution and use in source and binary forms, with or without
745 modification, are permitted provided that the following conditions are met:
747 *Redistributions of source code must retain the above copyright notice,
748 this list of conditions and the following disclaimer.
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.
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.
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
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
770 =========================================================================*/
772 /* cscope - interactive C symbol cross-reference
780 /* the line counting has been moved from character reading for speed */
781 /* comments are discarded */
783 #define IFLEVELINC 5 /* #if nesting level size increment */
785 static char const rcsid[] = "$Id: scanner.l,v 1.10 2011/06/29 15:48:00 nhorman Exp $";
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 */
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 */
823 void multicharconstant(char terminator);
824 int skipcomment_input(void);
828 #define YY_INPUT(buf,result,max_size) \
830 int c = skipcomment_input (); \
831 result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \
834 /* Assume this is the AT&T/SCO style lex */
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)
839 #define unput(c) (*yysptr++=(c))
844 #line 845 "scanner.c"
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.
857 #ifndef YY_EXTRA_TYPE
858 #define YY_EXTRA_TYPE void *
861 static int yy_init_globals (void );
863 /* Accessor methods to globals.
864 These are made visible to non-reentrant scanners for convenience. */
866 int yylex_destroy (void );
868 int yyget_debug (void );
870 void yyset_debug (int debug_flag );
872 YY_EXTRA_TYPE yyget_extra (void );
874 void yyset_extra (YY_EXTRA_TYPE user_defined );
876 FILE *yyget_in (void );
878 void yyset_in (FILE * in_str );
880 FILE *yyget_out (void );
882 void yyset_out (FILE * out_str );
884 int yyget_leng (void );
886 char *yyget_text (void );
888 int yyget_lineno (void );
890 void yyset_lineno (int line_number );
892 /* Macros after this point can all be overridden by user definitions in
896 #ifndef YY_SKIP_YYWRAP
898 extern "C" int yywrap (void );
900 extern int yywrap (void );
904 static void yyunput (int c,char *buf_ptr );
907 static void yy_flex_strncpy (char *,yyconst char *,int );
910 #ifdef YY_NEED_STRLEN
911 static int yy_flex_strlen (yyconst char * );
917 static int yyinput (void );
919 static int input (void );
924 /* Amount of stuff to slurp up with each read. */
925 #ifndef YY_READ_BUF_SIZE
926 #define YY_READ_BUF_SIZE 8192
929 /* Copy whatever the last rule matched to the standard output. */
931 /* This used to be an fputs(), but since the string might contain NUL's,
932 * we now use fwrite().
934 #define ECHO fwrite( yytext, yyleng, 1, yyout )
937 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
938 * is returned in "result".
941 #define YY_INPUT(buf,result,max_size) \
942 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
946 for ( n = 0; n < max_size && \
947 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
950 buf[n++] = (char) c; \
951 if ( c == EOF && ferror( yyin ) ) \
952 YY_FATAL_ERROR( "input in flex scanner failed" ); \
958 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
960 if( errno != EINTR) \
962 YY_FATAL_ERROR( "input in flex scanner failed" ); \
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.
978 #define yyterminate() return YY_NULL
981 /* Number of entries by which start-condition stack grows. */
982 #ifndef YY_START_STACK_INCR
983 #define YY_START_STACK_INCR 25
986 /* Report a fatal error. */
987 #ifndef YY_FATAL_ERROR
988 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
991 /* end tables serialization structures and prototypes */
993 /* Default declaration of generated scanner - a define so the user can
994 * easily add parameters.
997 #define YY_DECL_IS_OURS 1
999 extern int yylex (void);
1001 #define YY_DECL int yylex (void)
1002 #endif /* !YY_DECL */
1004 /* Code executed at the beginning of each rule, after yytext and yyleng
1007 #ifndef YY_USER_ACTION
1008 #define YY_USER_ACTION
1011 /* Code executed at the end of each rule. */
1013 #define YY_BREAK break;
1016 #define YY_RULE_SETUP \
1018 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1019 (yytext[yyleng - 1] == '\n'); \
1022 /** The main scanner function which does all the work.
1026 register yy_state_type yy_current_state;
1027 register char *yy_cp, *yy_bp;
1028 register int yy_act;
1030 #line 115 "scanner.l"
1032 #line 1033 "scanner.c"
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()" );
1049 (yy_start) = 1; /* first start state */
1057 if ( ! YY_CURRENT_BUFFER ) {
1058 yyensure_buffer_stack ();
1059 YY_CURRENT_BUFFER_LVALUE =
1060 yy_create_buffer(yyin,YY_BUF_SIZE );
1063 yy_load_buffer_state( );
1066 while ( 1 ) /* loops until end-of-file is reached */
1069 if ( (yy_more_flag) )
1071 (yy_more_len) = (yy_c_buf_p) - (yytext_ptr);
1074 yy_cp = (yy_c_buf_p);
1076 /* Support of yytext. */
1077 *yy_cp = (yy_hold_char);
1079 /* yy_bp points to the position in yy_ch_buf of the start of
1084 yy_current_state = (yy_start);
1085 yy_current_state += YY_AT_BOL();
1087 (yy_state_ptr) = (yy_state_buf);
1088 *(yy_state_ptr)++ = yy_current_state;
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 )
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];
1100 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1101 *(yy_state_ptr)++ = yy_current_state;
1104 while ( yy_base[yy_current_state] != 813 );
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 */
1112 if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
1114 yy_act = yy_acclist[(yy_lp)];
1115 if ( yy_act & YY_TRAILING_HEAD_MASK ||
1116 (yy_looking_for_trail_begin) )
1118 if ( yy_act == (yy_looking_for_trail_begin) )
1120 (yy_looking_for_trail_begin) = 0;
1121 yy_act &= ~YY_TRAILING_HEAD_MASK;
1125 else if ( yy_act & YY_TRAILING_MASK )
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);
1135 (yy_full_match) = yy_cp;
1136 (yy_full_state) = (yy_state_ptr);
1137 (yy_full_lp) = (yy_lp);
1144 yy_current_state = *--(yy_state_ptr);
1145 (yy_lp) = yy_accept[yy_current_state];
1148 YY_DO_BEFORE_ACTION;
1150 do_action: /* This label is used only to access EOF actions. */
1153 { /* beginning of action switch */
1156 #line 116 "scanner.l"
1157 { /* lex/yacc C declarations/definitions */
1165 #line 121 "scanner.l"
1174 #line 126 "scanner.l"
1175 { /* lex/yacc rules delimiter */
1180 /* simulate a yylex() or yyparse() definition */
1181 (void) strcat(yytext, " /* ");
1182 first = strlen(yytext);
1184 (void) strcat(yytext, "yylex");
1186 else { /* yacc: yyparse implicitly calls yylex */
1187 char *s = " yylex()";
1188 char *cp = s + strlen(s);
1192 (void) strcat(yytext, "yyparse");
1194 last = strlen(yytext);
1195 (void) strcat(yytext, " */");
1196 yyleng = strlen(yytext);
1212 #line 160 "scanner.l"
1213 { /* sdl state, treat as function def */
1223 #line 167 "scanner.l"
1224 { /* end of an sdl state, treat as end of a function */
1231 #line 171 "scanner.l"
1232 { /* count unmatched left braces for fcn def detection */
1235 /* mark an untagged enum/struct/union so its beginning
1252 /* rule 7 can match eol */
1254 #line 189 "scanner.l"
1256 /* attempt to correct erroneous brace count caused by:
1265 /* the current #if must not have an #else or #elif */
1266 if (elseelif == YES) {
1277 #line 208 "scanner.l"
1278 { /* #if, #ifdef or #ifndef */
1280 if (pseudoelif == YES) {
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));
1291 /* push the current brace count */
1292 preifbraces[iflevel] = braces;
1293 maxifbraces[iflevel++] = 0;
1300 #line 227 "scanner.l"
1301 { /* #elif or #else */
1306 /* save the maximum brace count for this #if */
1307 if (braces > maxifbraces[iflevel - 1]) {
1308 maxifbraces[iflevel - 1] = braces;
1310 /* restore the brace count to before the #if */
1311 braces = preifbraces[iflevel - 1];
1319 #line 242 "scanner.l"
1324 /* get the maximum brace count for this #if */
1325 if (braces < maxifbraces[--iflevel]) {
1326 braces = maxifbraces[iflevel];
1335 #line 254 "scanner.l"
1337 /* could be the last enum member initializer */
1338 if (braces == initializerbraces) {
1339 initializerbraces = -1;
1342 if (--braces <= 0) {
1347 if (braces == 0 || (braces == 1 && classdef == YES)) {
1349 /* if the end of an enum/struct/union definition */
1350 if (esudef == YES) {
1353 /* if the end of the function */
1354 else if (fcndef == YES) {
1367 #line 282 "scanner.l"
1368 { /* count unmatched left parentheses for function templates */
1376 #line 287 "scanner.l"
1378 if (--parens <= 0) {
1381 /* if the end of a function template */
1382 if (parens == templateparens) {
1383 templateparens = -1;
1392 #line 299 "scanner.l"
1393 { /* if a global definition initializer */
1394 if (global == YES && ppdefine == NO && yytext[0] != '#') {
1395 initializerbraces = braces;
1404 #line 307 "scanner.l"
1405 { /* a if global structure field */
1406 if (global == YES && ppdefine == NO && yytext[0] != '#') {
1415 #line 314 "scanner.l"
1417 if (braces == initializerbraces) {
1418 initializerbraces = -1;
1428 #line 323 "scanner.l"
1429 { /* if the enum/struct/union was not a definition */
1433 /* if the end of a typedef */
1434 if (braces == typedefbraces) {
1437 /* if the end of a external definition */
1438 if (braces == externalbraces) {
1439 externalbraces = -1;
1450 #line 341 "scanner.l"
1453 /* preprocessor macro or constant definition */
1456 if (compress == YES) {
1457 yytext[0] = '\1'; /* compress the keyword */
1461 while (yytext[first] != ' ' && yytext[first] != '\t') {
1470 /* rule 19 can match eol */
1472 #line 358 "scanner.l"
1473 { /* class definition */
1481 /* rule 20 can match eol */
1483 #line 364 "scanner.l"
1484 { /* enum/struct/union definition */
1485 tagdef = *(yytext + first);
1491 /* rule 21 can match eol */
1493 #line 369 "scanner.l"
1494 { /* tag-less e/s/u definition */
1495 tagdef = yytext[first];
1505 /* rule 22 can match eol */
1507 #line 378 "scanner.l"
1510 /* warning: "if (...)" must not overflow yytext, so the content
1511 of function argument definitions is restricted, in particular
1512 parentheses are not allowed */
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)) {
1529 #line 396 "scanner.l"
1530 { /* if a function call */
1531 fcncal: if (fcndef == YES || ppdefine == YES || rules == YES) {
1536 if (template == NO) {
1537 templateparens = parens;
1545 /* rule 24 can match eol */
1547 #line 409 "scanner.l"
1548 { /* typedef name use */
1555 #line 413 "scanner.l"
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 */
1571 ident: token = IDENT;
1574 /* if a long line */
1575 if (yyleng > STMTMAX) {
1578 /* skip to the end of the line */
1579 warning("line too long");
1580 while ((c = skipcomment_input()) != LEXEOF) {
1587 /* truncate a long symbol */
1588 if (yyleng - first > PATLEN) {
1589 warning("symbol too long");
1590 yyleng = first + PATLEN;
1591 yytext[yyleng] = '\0';
1595 if ((s = lookup(yytext + first)) != NULL) {
1598 /* if the start of a typedef */
1599 if (s == typedeftext) {
1600 typedefbraces = braces;
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) {
1608 /* if an external definition */
1609 else if (s == externtext) {
1610 externalbraces = braces;
1613 /* keyword doesn't start a function template */
1614 else if (templateparens == parens && template == YES) {
1615 templateparens = -1;
1618 else { /* next identifier after typedef was a keyword */
1622 else { /* identifier */
1625 /* if a class/enum/struct/union tag definition */
1626 if (tagdef && strnotequal(yytext + first, "class")) {
1633 /* if a typedef name */
1634 else if (braces == typedefbraces && oldtype == NO &&
1635 arraydimension == NO) {
1648 #line 502 "scanner.l"
1649 { /* array dimension (don't worry or about subscripts) */
1650 arraydimension = YES;
1657 #line 507 "scanner.l"
1659 arraydimension = NO;
1665 /* rule 28 can match eol */
1667 #line 512 "scanner.l"
1668 { /* preprocessor statement is continued on next line */
1674 /* rule 29 can match eol */
1676 #line 516 "scanner.l"
1677 { /* end of the line */
1678 if (ppdefine == YES) { /* end of a #define */
1680 yyless(yyleng - 1); /* rescan \n */
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) {
1690 switch (skipcomment_input()) { /* tab and EOF just fall through */
1691 case ' ': /* breakpoint number line */
1693 for (i = 1; i < 8 && skipcomment_input() != LEXEOF; ++i)
1696 case '.': /* header line */
1698 /* skip to the end of the line */
1699 while ((c = skipcomment_input()) != LEXEOF) {
1706 case '\n': /* empty line */
1723 #line 559 "scanner.l"
1724 { /* character constant */
1726 multicharconstant('\'');
1734 #line 566 "scanner.l"
1735 { /* string constant */
1736 multicharconstant('"');
1743 #line 571 "scanner.l"
1744 { /* don't save leading white space */
1749 #line 573 "scanner.l"
1750 { /* #include file */
1753 s = strpbrk(yytext, "\"<");
1757 /* HBB: avoid pointer mismatch if yytext is
1758 * unsigned, or a pointer */
1759 first = s - (char *)&(yytext[0]);
1761 if (compress == YES) {
1762 yytext[0] = '\2'; /* compress the keyword */
1770 #line 592 "scanner.l"
1772 #line 593 "scanner.l"
1775 #line 593 "scanner.l"
1776 { /* punctuation and operators */
1777 more: first = yyleng;
1783 #line 597 "scanner.l"
1786 #line 1787 "scanner.c"
1787 case YY_STATE_EOF(INITIAL):
1788 case YY_STATE_EOF(SDL):
1791 case YY_END_OF_BUFFER:
1793 /* Amount of text matched not including the EOB char. */
1794 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1796 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1797 *yy_cp = (yy_hold_char);
1798 YY_RESTORE_YY_MORE_OFFSET
1800 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
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.
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;
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
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;
1827 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1829 yy_current_state = yy_get_previous_state( );
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).
1840 yy_next_state = yy_try_NUL_trans( yy_current_state );
1842 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1844 if ( yy_next_state )
1846 /* Consume the NUL. */
1847 yy_cp = ++(yy_c_buf_p);
1848 yy_current_state = yy_next_state;
1854 yy_cp = (yy_c_buf_p);
1855 goto yy_find_action;
1859 else switch ( yy_get_next_buffer( ) )
1861 case EOB_ACT_END_OF_FILE:
1863 (yy_did_buffer_switch_on_eof) = 0;
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.
1876 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1878 yy_act = YY_STATE_EOF(YY_START);
1884 if ( ! (yy_did_buffer_switch_on_eof) )
1890 case EOB_ACT_CONTINUE_SCAN:
1892 (yytext_ptr) + yy_amount_of_matched_text;
1894 yy_current_state = yy_get_previous_state( );
1896 yy_cp = (yy_c_buf_p);
1897 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1900 case EOB_ACT_LAST_MATCH:
1902 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1904 yy_current_state = yy_get_previous_state( );
1906 yy_cp = (yy_c_buf_p);
1907 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1908 goto yy_find_action;
1915 "fatal flex scanner internal error--no action found" );
1916 } /* end of action switch */
1917 } /* end of scanning one token */
1918 } /* end of yylex */
1920 /* yy_get_next_buffer - try to read in a new buffer
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
1927 static int yy_get_next_buffer (void)
1929 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1930 register char *source = (yytext_ptr);
1931 register int number_to_move, i;
1934 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1936 "fatal flex scanner internal error--end of buffer missed" );
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 )
1942 /* We matched a single character, the EOB, so
1943 * treat this as a final EOF.
1945 return EOB_ACT_END_OF_FILE;
1950 /* We matched some text prior to the EOB, first
1953 return EOB_ACT_LAST_MATCH;
1957 /* Try to read more data. */
1959 /* First move last chars to start of buffer. */
1960 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1962 for ( i = 0; i < number_to_move; ++i )
1963 *(dest++) = *(source++);
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,
1969 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1974 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1976 while ( num_to_read <= 0 )
1977 { /* Not enough room in the buffer - grow it. */
1980 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1984 if ( num_to_read > YY_READ_BUF_SIZE )
1985 num_to_read = YY_READ_BUF_SIZE;
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 );
1991 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1994 if ( (yy_n_chars) == 0 )
1996 if ( number_to_move == YY_MORE_ADJ )
1998 ret_val = EOB_ACT_END_OF_FILE;
2004 ret_val = EOB_ACT_LAST_MATCH;
2005 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2006 YY_BUFFER_EOF_PENDING;
2011 ret_val = EOB_ACT_CONTINUE_SCAN;
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()" );
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;
2025 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2030 /* yy_get_previous_state - get the state just before the EOB char was reached */
2032 static yy_state_type yy_get_previous_state (void)
2034 register yy_state_type yy_current_state;
2035 register char *yy_cp;
2037 yy_current_state = (yy_start);
2038 yy_current_state += YY_AT_BOL();
2040 (yy_state_ptr) = (yy_state_buf);
2041 *(yy_state_ptr)++ = yy_current_state;
2043 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
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 )
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];
2052 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2053 *(yy_state_ptr)++ = yy_current_state;
2056 return yy_current_state;
2059 /* yy_try_NUL_trans - try to make a transition on the NUL character
2062 * next_state = yy_try_NUL_trans( current_state );
2064 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2066 register int yy_is_jam;
2068 register YY_CHAR yy_c = 1;
2069 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
2075 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2076 yy_is_jam = (yy_current_state == 151);
2078 *(yy_state_ptr)++ = yy_current_state;
2080 return yy_is_jam ? 0 : yy_current_state;
2083 static void yyunput (int c, register char * yy_bp )
2085 register char *yy_cp;
2087 yy_cp = (yy_c_buf_p);
2089 /* undo effects of setting up yytext */
2090 *yy_cp = (yy_hold_char);
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];
2101 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2102 *--dest = *--source;
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;
2109 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2110 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2113 *--yy_cp = (char) c;
2115 (yytext_ptr) = yy_bp;
2116 (yy_hold_char) = *yy_cp;
2117 (yy_c_buf_p) = yy_cp;
2122 static int yyinput (void)
2124 static int input (void)
2130 *(yy_c_buf_p) = (yy_hold_char);
2132 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
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.
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';
2143 { /* need more input */
2144 int offset = (yy_c_buf_p) - (yytext_ptr);
2147 switch ( yy_get_next_buffer( ) )
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.
2160 /* Reset buffer status. */
2165 case EOB_ACT_END_OF_FILE:
2170 if ( ! (yy_did_buffer_switch_on_eof) )
2179 case EOB_ACT_CONTINUE_SCAN:
2180 (yy_c_buf_p) = (yytext_ptr) + offset;
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);
2190 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2194 #endif /* ifndef YY_NO_INPUT */
2196 /** Immediately switch to a different input stream.
2197 * @param input_file A readable stream.
2199 * @note This function does not reset the start condition to @c INITIAL .
2201 void yyrestart (FILE * input_file )
2204 if ( ! YY_CURRENT_BUFFER ){
2205 yyensure_buffer_stack ();
2206 YY_CURRENT_BUFFER_LVALUE =
2207 yy_create_buffer(yyin,YY_BUF_SIZE );
2210 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
2211 yy_load_buffer_state( );
2214 /** Switch to a different input buffer.
2215 * @param new_buffer The new input buffer.
2218 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2221 /* TODO. We should be able to replace this entire function body
2223 * yypop_buffer_state();
2224 * yypush_buffer_state(new_buffer);
2226 yyensure_buffer_stack ();
2227 if ( YY_CURRENT_BUFFER == new_buffer )
2230 if ( YY_CURRENT_BUFFER )
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);
2238 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2239 yy_load_buffer_state( );
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.
2246 (yy_did_buffer_switch_on_eof) = 1;
2249 static void yy_load_buffer_state (void)
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);
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.
2261 * @return the allocated buffer state.
2263 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2267 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2269 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2271 b->yy_buf_size = size;
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.
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()" );
2280 b->yy_is_our_buffer = 1;
2282 yy_init_buffer(b,file );
2287 /** Destroy the buffer.
2288 * @param b a buffer created with yy_create_buffer()
2291 void yy_delete_buffer (YY_BUFFER_STATE b )
2297 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2298 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2300 if ( b->yy_is_our_buffer )
2301 yyfree((void *) b->yy_ch_buf );
2303 yyfree((void *) b );
2307 extern int isatty (int );
2308 #endif /* __cplusplus */
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.
2314 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2319 yy_flush_buffer(b );
2321 b->yy_input_file = file;
2322 b->yy_fill_buffer = 1;
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.
2328 if (b != YY_CURRENT_BUFFER){
2329 b->yy_bs_lineno = 1;
2330 b->yy_bs_column = 0;
2333 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
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.
2342 void yy_flush_buffer (YY_BUFFER_STATE b )
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.
2353 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2354 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2356 b->yy_buf_pos = &b->yy_ch_buf[0];
2359 b->yy_buffer_status = YY_BUFFER_NEW;
2361 if ( b == YY_CURRENT_BUFFER )
2362 yy_load_buffer_state( );
2365 /** Pushes the new state onto the stack. The new state becomes
2366 * the current state. This function will allocate the stack
2368 * @param new_buffer The new state.
2371 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2373 if (new_buffer == NULL)
2376 yyensure_buffer_stack();
2378 /* This block is copied from yy_switch_to_buffer. */
2379 if ( YY_CURRENT_BUFFER )
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);
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;
2392 /* copied from yy_switch_to_buffer. */
2393 yy_load_buffer_state( );
2394 (yy_did_buffer_switch_on_eof) = 1;
2397 /** Removes and deletes the top of the stack, if present.
2398 * The next element becomes the new top.
2401 void yypop_buffer_state (void)
2403 if (!YY_CURRENT_BUFFER)
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);
2411 if (YY_CURRENT_BUFFER) {
2412 yy_load_buffer_state( );
2413 (yy_did_buffer_switch_on_eof) = 1;
2417 /* Allocates the stack if it does not exist.
2418 * Guarantees space for at least one push.
2420 static void yyensure_buffer_stack (void)
2424 if (!(yy_buffer_stack)) {
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.
2431 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2432 (num_to_alloc * sizeof(struct yy_buffer_state*)
2434 if ( ! (yy_buffer_stack) )
2435 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2437 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2439 (yy_buffer_stack_max) = num_to_alloc;
2440 (yy_buffer_stack_top) = 0;
2444 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2446 /* Increase the buffer to prepare for a possible push. */
2447 int grow_size = 8 /* arbitrary grow size */;
2449 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2450 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2452 num_to_alloc * sizeof(struct yy_buffer_state*)
2454 if ( ! (yy_buffer_stack) )
2455 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
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;
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
2467 * @return the newly allocated buffer state object.
2469 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
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. */
2479 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2481 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
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;
2490 b->yy_fill_buffer = 0;
2491 b->yy_buffer_status = YY_BUFFER_NEW;
2493 yy_switch_to_buffer(b );
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
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.
2506 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2509 return yy_scan_bytes(yystr,strlen(yystr) );
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.
2517 * @return the newly allocated buffer state object.
2519 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
2526 /* Get memory for full buffer, including space for trailing EOB's. */
2527 n = _yybytes_len + 2;
2528 buf = (char *) yyalloc(n );
2530 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2532 for ( i = 0; i < _yybytes_len; ++i )
2533 buf[i] = yybytes[i];
2535 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2537 b = yy_scan_buffer(buf,n );
2539 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2541 /* It's okay to grow etc. this buffer, and we should throw it
2542 * away when we're done.
2544 b->yy_is_our_buffer = 1;
2549 #ifndef YY_EXIT_FAILURE
2550 #define YY_EXIT_FAILURE 2
2553 static void yy_fatal_error (yyconst char* msg )
2555 (void) fprintf( stderr, "%s\n", msg );
2556 exit( YY_EXIT_FAILURE );
2559 /* Redefine yyless() so it works in section 3 code. */
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; \
2576 /* Accessor methods (get/set functions) to struct members. */
2578 /** Get the current line number.
2581 int yyget_lineno (void)
2587 /** Get the input stream.
2590 FILE *yyget_in (void)
2595 /** Get the output stream.
2598 FILE *yyget_out (void)
2603 /** Get the length of the current token.
2606 int yyget_leng (void)
2611 /** Get the current token.
2615 char *yyget_text (void)
2620 /** Set the current line number.
2621 * @param line_number
2624 void yyset_lineno (int line_number )
2627 yylineno = line_number;
2630 /** Set the input stream. This does not discard the current
2632 * @param in_str A readable stream.
2634 * @see yy_switch_to_buffer
2636 void yyset_in (FILE * in_str )
2641 void yyset_out (FILE * out_str )
2646 int yyget_debug (void)
2648 return yy_flex_debug;
2651 void yyset_debug (int bdebug )
2653 yy_flex_debug = bdebug ;
2656 static int yy_init_globals (void)
2658 /* Initialization is the same as for the non-reentrant scanner.
2659 * This function is called from yylex_destroy(), so don't allocate here.
2662 (yy_buffer_stack) = 0;
2663 (yy_buffer_stack_top) = 0;
2664 (yy_buffer_stack_max) = 0;
2665 (yy_c_buf_p) = (char *) 0;
2671 (yy_full_match) = 0;
2674 /* Defined in main.c */
2683 /* For future reference: Set errno on error, since we are called by
2689 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2690 int yylex_destroy (void)
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();
2700 /* Destroy the stack itself. */
2701 yyfree((yy_buffer_stack) );
2702 (yy_buffer_stack) = NULL;
2704 yyfree ( (yy_state_buf) );
2705 (yy_state_buf) = NULL;
2707 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2708 * yylex() is called, initialization will occur. */
2715 * Internal utility routines.
2719 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2722 for ( i = 0; i < n; ++i )
2727 #ifdef YY_NEED_STRLEN
2728 static int yy_flex_strlen (yyconst char * s )
2731 for ( n = 0; s[n]; ++n )
2738 void *yyalloc (yy_size_t size )
2740 return (void *) malloc( size );
2743 void *yyrealloc (void * ptr, yy_size_t size )
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.
2752 return (void *) realloc( (char *) ptr, size );
2755 void yyfree (void * ptr )
2757 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2760 #define YYTABLES_NAME "yytables"
2762 #line 597 "scanner.l"
2767 initscanner(char *srcfile)
2771 if (maxifbraces == NULL) {
2772 maxifbraces = mymalloc(miflevel * sizeof(int));
2773 preifbraces = mymalloc(miflevel * sizeof(int));
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 */
2807 /* if this is not a C file */
2808 if ((s = strrchr(srcfile, '.')) != NULL) {
2809 switch (*++s) { /* this switch saves time on C files */
2811 if (strcmp(s, "bp") == 0) { /* breakpoint listing */
2816 if (strcmp(s, "l") == 0) { /* lex */
2822 if (strcmp(s, "sd") == 0) { /* sdl */
2828 if (strcmp(s, "y") == 0) { /* yacc */
2837 skipcomment_input(void)
2841 if ((c = getc (yyin)) == '/') {
2857 return (c == EOF) ? LEXEOF : c;
2866 if ((c = getc(yyin)) == '*') { /* C comment */
2868 while ((c = getc(yyin)) != EOF &&
2869 (c != '/' || lastc != '*')) { /* fewer '/'s */
2875 /* return a blank for Reiser cpp token concatenation */
2876 if ((c = getc(yyin)) == '_' || isalnum(c)) {
2877 (void) ungetc(c, yyin);
2882 else if (c == '/') { /* C++ comment */
2883 while ((c = getc(yyin)) != EOF && c != '\n') {
2888 else { /* not a comment */
2889 (void) ungetc(c, yyin);
2895 /* there may be an immediately following comment */
2901 multicharconstant(char terminator)
2905 /* scan until the terminator is found */
2906 while ((c = yytext[yyleng++] = comment_input()) != terminator) {
2908 case '\\': /* escape character */
2909 if ((yytext[yyleng++] = comment_input()) == '\n') {
2913 case '\t': /* tab character */
2915 /* if not a lex program, continue */
2921 case '\n': /* illegal character */
2923 /* assume the terminator is missing, so put
2924 this character back */
2926 yytext[--yyleng] = '\0';
2929 case LEXEOF: /* end of file */
2933 /* change a control character to a blank */
2934 if (!isprint((unsigned char)c)) {
2935 yytext[yyleng - 1] = ' ';
2938 /* if this token will overflow the line buffer */
2939 /* note: '\\' may cause yyleng to be > STMTMAX */
2940 if (yyleng >= STMTMAX) {
2942 /* truncate the token */
2943 while ((c = comment_input()) != LEXEOF) {
2944 if (c == terminator) {
2948 else if (c == '\n') {
2954 yytext[yyleng] = '\0';