1 #define yy_create_buffer gram__create_buffer
2 #define yy_delete_buffer gram__delete_buffer
3 #define yy_scan_buffer gram__scan_buffer
4 #define yy_scan_string gram__scan_string
5 #define yy_scan_bytes gram__scan_bytes
6 #define yy_flex_debug gram__flex_debug
7 #define yy_init_buffer gram__init_buffer
8 #define yy_flush_buffer gram__flush_buffer
9 #define yy_load_buffer_state gram__load_buffer_state
10 #define yy_switch_to_buffer gram__switch_to_buffer
12 #define yyleng gram_leng
13 #define yylex gram_lex
14 #define yyout gram_out
15 #define yyrestart gram_restart
16 #define yytext gram_text
18 #line 19 "scan-gram.c"
19 /* A lexical scanner generated by flex */
21 /* Scanner skeleton version:
26 #define YY_FLEX_MAJOR_VERSION 2
27 #define YY_FLEX_MINOR_VERSION 5
32 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
46 #ifndef YY_ALWAYS_INTERACTIVE
47 #ifndef YY_NEVER_INTERACTIVE
48 extern int isatty
YY_PROTO(( int ));
53 /* Use prototypes in function declarations. */
56 /* The "const" storage-class-modifier is valid. */
59 #else /* ! __cplusplus */
67 #endif /* ! __cplusplus */
86 #define YY_PROTO(proto) proto
88 #define YY_PROTO(proto) ()
91 /* Returned upon end-of-file. */
94 /* Promotes a possibly negative, possibly signed char to an unsigned
95 * integer for use as an array index. If the signed char is negative,
96 * we want to instead treat it as an 8-bit unsigned char, hence the
99 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
101 /* Enter a start condition. This macro really ought to take a parameter,
102 * but we do it the disgusting crufty way forced on us by the ()-less
103 * definition of BEGIN.
105 #define BEGIN yy_start = 1 + 2 *
107 /* Translate the current start state into a value that can be later handed
108 * to BEGIN to return to the state. The YYSTATE alias is for lex
111 #define YY_START ((yy_start - 1) / 2)
112 #define YYSTATE YY_START
114 /* Action number for EOF rule of a given start state. */
115 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
117 /* Special action meaning "start processing a new file". */
118 #define YY_NEW_FILE yyrestart( yyin )
120 #define YY_END_OF_BUFFER_CHAR 0
122 /* Size of default input buffer. */
123 #define YY_BUF_SIZE 16384
125 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
128 extern FILE *yyin
, *yyout
;
130 #define EOB_ACT_CONTINUE_SCAN 0
131 #define EOB_ACT_END_OF_FILE 1
132 #define EOB_ACT_LAST_MATCH 2
134 /* The funky do-while in the following #define is used to turn the definition
135 * int a single C statement (which needs a semi-colon terminator). This
136 * avoids problems with code like:
138 * if ( condition_holds )
141 * do_something_else();
143 * Prior to using the do-while the compiler would get upset at the
144 * "else" because it interpreted the "if" statement as being all
145 * done when it reached the ';' after the yyless() call.
148 /* Return all but the first 'n' matched characters back to the input stream. */
153 /* Undo effects of setting up yytext. */ \
154 *yy_cp = yy_hold_char; \
155 YY_RESTORE_YY_MORE_OFFSET \
156 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
157 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
161 #define unput(c) yyunput( c, yytext_ptr )
163 /* The following is because we cannot portably get our hands on size_t
164 * (without autoconf's help, which isn't available because we want
165 * flex-generated scanners to compile on their own).
167 typedef unsigned int yy_size_t
;
170 struct yy_buffer_state
174 char *yy_ch_buf
; /* input buffer */
175 char *yy_buf_pos
; /* current position in input buffer */
177 /* Size of input buffer in bytes, not including room for EOB
180 yy_size_t yy_buf_size
;
182 /* Number of characters read into yy_ch_buf, not including EOB
187 /* Whether we "own" the buffer - i.e., we know we created it,
188 * and can realloc() it to grow it, and should free() it to
191 int yy_is_our_buffer
;
193 /* Whether this is an "interactive" input source; if so, and
194 * if we're using stdio for input, then we want to use getc()
195 * instead of fread(), to make sure we stop fetching input after
198 int yy_is_interactive
;
200 /* Whether we're considered to be at the beginning of a line.
201 * If so, '^' rules will be active on the next match, otherwise
206 /* Whether to try to fill the input buffer when we reach the
211 int yy_buffer_status
;
212 #define YY_BUFFER_NEW 0
213 #define YY_BUFFER_NORMAL 1
214 /* When an EOF's been seen but there's still some text to process
215 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
216 * shouldn't try reading from the input source any more. We might
217 * still have a bunch of tokens to match, though, because of
218 * possible backing-up.
220 * When we actually see the EOF, we change the status to "new"
221 * (via yyrestart()), so that the user can continue scanning by
222 * just pointing yyin at a new input file.
224 #define YY_BUFFER_EOF_PENDING 2
227 static YY_BUFFER_STATE yy_current_buffer
= 0;
229 /* We provide macros for accessing buffer states in case in the
230 * future we want to put the buffer states in a more general
233 #define YY_CURRENT_BUFFER yy_current_buffer
236 /* yy_hold_char holds the character lost when yytext is formed. */
237 static char yy_hold_char
;
239 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
244 /* Points to current character in buffer. */
245 static char *yy_c_buf_p
= (char *) 0;
246 static int yy_init
= 1; /* whether we need to initialize */
247 static int yy_start
= 0; /* start state number */
249 /* Flag which is used to allow yywrap()'s to do buffer switches
250 * instead of setting up a fresh yyin. A bit of a hack ...
252 static int yy_did_buffer_switch_on_eof
;
254 void yyrestart
YY_PROTO(( FILE *input_file
));
256 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
257 void yy_load_buffer_state
YY_PROTO(( void ));
258 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
259 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
260 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
261 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
262 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
264 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
265 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
266 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
268 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
269 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
));
270 static void yy_flex_free
YY_PROTO(( void * ));
272 #define yy_new_buffer yy_create_buffer
274 #define yy_set_interactive(is_interactive) \
276 if ( ! yy_current_buffer ) \
277 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
278 yy_current_buffer->yy_is_interactive = is_interactive; \
281 #define yy_set_bol(at_bol) \
283 if ( ! yy_current_buffer ) \
284 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
285 yy_current_buffer->yy_at_bol = at_bol; \
288 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
292 #define YY_SKIP_YYWRAP
295 typedef unsigned char YY_CHAR
;
296 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
297 typedef int yy_state_type
;
301 #define yytext_ptr yytext
303 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
304 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
305 static int yy_get_next_buffer
YY_PROTO(( void ));
306 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
308 /* Done after the current pattern has been matched and before the
309 * corresponding action - sets up yytext.
311 #define YY_DO_BEFORE_ACTION \
312 yytext_ptr = yy_bp; \
313 yyleng = (int) (yy_cp - yy_bp); \
314 yy_hold_char = *yy_cp; \
318 #define YY_NUM_RULES 104
319 #define YY_END_OF_BUFFER 105
320 static yyconst
short int yy_accept
[398] =
322 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
323 0, 0, 0, 0, 0, 0, 0, 0, 105, 52,
324 41, 40, 40, 45, 52, 44, 38, 42, 52, 43,
325 36, 39, 52, 35, 49, 37, 56, 57, 57, 58,
326 53, 54, 83, 86, 86, 82, 53, 85, 54, 78,
327 81, 81, 77, 80, 60, 61, 61, 59, 76, 63,
328 64, 64, 62, 96, 97, 97, 88, 98, 87, 91,
329 98, 53, 54, 93, 92, 100, 102, 102, 88, 101,
330 87, 91, 103, 103, 103, 88, 87, 91, 41, 40,
331 40, 40, 40, 51, 0, 0, 0, 0, 0, 0,
333 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
334 48, 42, 46, 47, 43, 0, 56, 57, 57, 57,
335 57, 55, 83, 86, 86, 86, 86, 84, 78, 81,
336 81, 81, 81, 79, 60, 61, 61, 61, 61, 75,
337 74, 75, 67, 68, 69, 70, 71, 72, 73, 75,
338 64, 64, 64, 64, 96, 97, 97, 97, 97, 94,
339 0, 94, 0, 89, 90, 95, 0, 95, 100, 102,
340 102, 102, 102, 99, 103, 103, 103, 103, 103, 89,
341 90, 0, 0, 0, 0, 0, 0, 0, 0, 0,
342 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
344 0, 0, 0, 0, 0, 0, 0, 47, 50, 0,
345 0, 0, 90, 90, 90, 0, 0, 0, 0, 0,
346 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
347 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
348 0, 0, 0, 0, 0, 0, 0, 65, 66, 0,
349 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
350 12, 0, 0, 0, 0, 0, 0, 0, 0, 0,
351 21, 0, 0, 0, 0, 0, 28, 0, 31, 0,
352 0, 34, 0, 2, 0, 0, 6, 0, 0, 0,
353 0, 0, 0, 0, 14, 0, 0, 0, 18, 0,
355 0, 0, 0, 24, 0, 27, 29, 32, 0, 1,
356 3, 0, 0, 8, 0, 0, 0, 0, 0, 0,
357 0, 0, 19, 0, 0, 0, 0, 0, 0, 4,
358 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
359 0, 22, 0, 0, 0, 33, 0, 0, 0, 0,
360 0, 0, 0, 0, 16, 17, 0, 0, 26, 0,
361 0, 0, 0, 0, 0, 25, 13, 0, 0, 0,
362 0, 5, 0, 0, 0, 11, 0, 0, 0, 0,
363 0, 9, 0, 15, 20, 23, 30, 0, 0, 7,
368 static yyconst
int yy_ec
[256] =
370 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
371 1, 2, 4, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
373 1, 2, 1, 5, 1, 6, 7, 1, 8, 1,
374 1, 9, 1, 10, 11, 12, 13, 14, 14, 14,
375 14, 14, 14, 14, 14, 15, 15, 16, 17, 18,
376 19, 20, 1, 21, 22, 22, 22, 22, 22, 22,
377 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
378 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
379 23, 24, 25, 1, 26, 1, 27, 28, 29, 30,
381 31, 32, 33, 34, 35, 12, 36, 37, 38, 39,
382 40, 41, 12, 42, 43, 44, 45, 46, 12, 47,
383 48, 12, 49, 50, 51, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
386 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 static yyconst
int yy_meta
[52] =
402 1, 1, 2, 3, 4, 5, 6, 7, 8, 1,
403 1, 9, 10, 11, 11, 1, 1, 1, 1, 12,
404 5, 11, 13, 14, 13, 9, 11, 11, 11, 11,
405 11, 11, 9, 9, 9, 9, 9, 9, 9, 9,
406 9, 9, 9, 9, 9, 9, 9, 9, 5, 1,
410 static yyconst
short int yy_base
[424] =
412 0, 0, 49, 52, 59, 62, 65, 88, 75, 90,
413 94, 97, 119, 168, 217, 240, 125, 152, 857, 858,
414 854, 56, 67, 858, 259, 858, 858, 0, 94, 94,
415 858, 858, 0, 858, 858, 858, 0, 112, 116, 842,
416 858, 858, 0, 131, 133, 858, 858, 0, 858, 0,
417 142, 148, 858, 0, 0, 150, 155, 858, 304, 858,
418 158, 160, 858, 0, 163, 175, 858, 181, 858, 97,
419 191, 858, 858, 858, 858, 0, 179, 181, 858, 803,
420 858, 130, 197, 200, 204, 206, 208, 223, 851, 210,
421 212, 225, 230, 858, 817, 100, 34, 816, 813, 86,
423 818, 191, 803, 196, 812, 144, 206, 807, 814, 817,
424 858, 0, 858, 0, 235, 823, 0, 248, 252, 254,
425 256, 858, 0, 258, 264, 266, 268, 858, 0, 270,
426 272, 274, 276, 858, 0, 278, 280, 282, 290, 858,
427 858, 828, 858, 858, 858, 858, 858, 858, 858, 0,
428 307, 310, 312, 316, 0, 318, 320, 322, 326, 858,
429 319, 323, 0, 858, 0, 858, 325, 327, 0, 341,
430 349, 351, 353, 858, 355, 357, 359, 361, 363, 365,
431 367, 802, 344, 798, 797, 797, 280, 795, 341, 807,
432 793, 796, 363, 802, 788, 789, 155, 788, 796, 797,
434 800, 784, 789, 783, 788, 780, 792, 0, 858, 806,
435 0, 799, 0, 374, 378, 791, 772, 781, 771, 783,
436 773, 781, 780, 779, 798, 764, 796, 779, 772, 773,
437 766, 775, 759, 759, 756, 769, 758, 765, 761, 757,
438 751, 754, 760, 759, 749, 760, 758, 858, 858, 369,
439 744, 752, 745, 741, 753, 739, 751, 768, 748, 736,
440 858, 735, 731, 743, 368, 738, 729, 733, 725, 738,
441 858, 724, 374, 723, 735, 721, 858, 725, 858, 724,
442 722, 858, 713, 858, 729, 714, 858, 380, 714, 716,
443 382, 729, 728, 719, 858, 712, 713, 708, 858, 706,
445 738, 717, 706, 858, 702, 858, 384, 858, 702, 858,
446 701, 714, 696, 858, 699, 700, 697, 696, 697, 694,
447 704, 694, 858, 692, 690, 704, 690, 685, 671, 858,
448 654, 643, 640, 612, 611, 624, 611, 617, 604, 617,
449 616, 858, 598, 598, 608, 858, 594, 591, 600, 563,
450 575, 567, 541, 548, 858, 858, 537, 512, 858, 526,
451 511, 522, 510, 499, 497, 858, 858, 500, 382, 376,
452 368, 858, 364, 351, 341, 858, 302, 309, 293, 275,
453 252, 858, 244, 858, 858, 858, 858, 233, 385, 858,
454 207, 163, 157, 138, 61, 858, 858, 411, 425, 439,
456 453, 467, 481, 495, 509, 138, 523, 537, 551, 563,
457 577, 589, 603, 616, 630, 644, 658, 672, 46, 686,
461 static yyconst
short int yy_def
[424] =
463 397, 1, 398, 398, 399, 399, 400, 400, 401, 401,
464 402, 402, 403, 403, 404, 404, 405, 405, 397, 397,
465 397, 397, 397, 397, 397, 397, 397, 406, 397, 397,
466 397, 397, 407, 397, 397, 397, 408, 397, 397, 397,
467 397, 397, 409, 397, 397, 397, 397, 410, 397, 411,
468 397, 397, 397, 412, 413, 397, 397, 397, 414, 397,
469 397, 397, 397, 415, 397, 397, 397, 397, 397, 397,
470 397, 397, 397, 397, 397, 416, 397, 397, 397, 397,
471 397, 397, 417, 417, 417, 417, 417, 417, 397, 397,
472 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
474 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
475 397, 406, 397, 418, 397, 407, 408, 397, 397, 397,
476 397, 397, 409, 397, 397, 397, 397, 397, 411, 397,
477 397, 397, 397, 397, 413, 397, 397, 397, 397, 397,
478 397, 397, 397, 397, 397, 397, 397, 397, 397, 419,
479 397, 397, 397, 397, 415, 397, 397, 397, 397, 397,
480 397, 397, 420, 397, 421, 397, 397, 397, 416, 397,
481 397, 397, 397, 397, 417, 417, 417, 417, 417, 417,
482 422, 397, 397, 397, 397, 397, 397, 397, 397, 397,
483 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
485 397, 397, 397, 397, 397, 397, 397, 418, 397, 397,
486 423, 420, 421, 422, 422, 397, 397, 397, 397, 397,
487 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
488 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
489 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
490 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
491 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
492 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
493 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
494 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
496 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
497 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
498 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
499 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
500 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
501 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
502 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
503 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
504 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
505 397, 397, 397, 397, 397, 397, 0, 397, 397, 397,
507 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
508 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
512 static yyconst
short int yy_nxt
[910] =
514 20, 21, 22, 23, 24, 20, 25, 26, 20, 27,
515 20, 28, 29, 30, 30, 31, 32, 33, 34, 20,
516 20, 28, 20, 20, 20, 28, 28, 28, 28, 28,
517 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
518 28, 28, 28, 28, 28, 28, 28, 28, 35, 36,
519 20, 38, 39, 249, 38, 39, 211, 40, 90, 91,
520 40, 44, 45, 46, 44, 45, 46, 51, 52, 92,
521 93, 41, 53, 42, 41, 185, 42, 56, 57, 58,
522 186, 47, 48, 49, 47, 48, 49, 47, 54, 49,
523 51, 52, 56, 57, 58, 53, 61, 62, 59, 61,
525 62, 63, 113, 396, 63, 164, 114, 115, 115, 165,
526 47, 54, 49, 59, 118, 119, 189, 59, 120, 121,
527 59, 65, 66, 67, 68, 190, 69, 84, 85, 86,
528 183, 70, 87, 124, 125, 126, 127, 88, 164, 71,
529 184, 72, 165, 73, 130, 131, 112, 47, 112, 49,
530 132, 133, 136, 137, 84, 85, 86, 138, 139, 87,
531 151, 152, 153, 154, 88, 156, 157, 74, 395, 75,
532 65, 66, 67, 68, 47, 69, 49, 158, 159, 200,
533 70, 170, 171, 172, 173, 236, 160, 201, 71, 237,
534 72, 161, 73, 394, 162, 162, 166, 393, 163, 176,
536 177, 167, 176, 178, 168, 168, 179, 177, 176, 177,
537 176, 177, 90, 91, 92, 93, 74, 192, 75, 77,
538 78, 79, 196, 80, 81, 176, 177, 90, 91, 82,
539 193, 180, 92, 93, 194, 181, 202, 197, 392, 47,
540 198, 49, 77, 78, 79, 203, 80, 81, 115, 115,
541 118, 119, 82, 204, 120, 121, 118, 119, 120, 121,
542 124, 125, 47, 390, 49, 94, 126, 127, 124, 125,
543 126, 127, 130, 131, 132, 133, 130, 131, 132, 133,
544 136, 137, 138, 139, 136, 137, 95, 389, 96, 97,
545 98, 99, 138, 139, 388, 100, 101, 102, 103, 104,
547 105, 106, 107, 108, 109, 387, 110, 111, 141, 151,
548 152, 141, 153, 154, 151, 152, 223, 142, 153, 154,
549 156, 157, 158, 159, 156, 157, 224, 141, 158, 159,
550 143, 144, 162, 162, 386, 145, 162, 162, 168, 168,
551 168, 168, 146, 170, 171, 147, 385, 148, 384, 149,
552 150, 172, 173, 170, 171, 172, 173, 176, 177, 176,
553 178, 179, 177, 179, 177, 176, 178, 176, 177, 176,
554 215, 217, 226, 231, 160, 218, 176, 215, 296, 161,
555 179, 215, 162, 162, 303, 383, 219, 227, 231, 213,
556 313, 213, 316, 296, 328, 391, 213, 382, 213, 303,
558 213, 232, 213, 381, 380, 313, 379, 316, 378, 328,
559 391, 37, 37, 37, 37, 37, 37, 37, 37, 37,
560 37, 37, 37, 37, 37, 43, 43, 43, 43, 43,
561 43, 43, 43, 43, 43, 43, 43, 43, 43, 50,
562 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
563 50, 50, 50, 55, 55, 55, 55, 55, 55, 55,
564 55, 55, 55, 55, 55, 55, 55, 60, 60, 60,
565 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
566 60, 64, 64, 64, 64, 64, 64, 64, 64, 64,
567 64, 64, 64, 64, 64, 76, 76, 76, 76, 76,
569 76, 76, 76, 76, 76, 76, 76, 76, 76, 83,
570 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
571 83, 83, 83, 116, 116, 116, 116, 116, 116, 116,
572 116, 116, 116, 116, 377, 116, 116, 117, 376, 375,
573 117, 117, 117, 117, 374, 117, 117, 117, 117, 373,
574 117, 123, 372, 371, 370, 123, 123, 123, 123, 123,
575 123, 123, 123, 128, 128, 128, 128, 128, 128, 128,
576 128, 128, 128, 128, 128, 128, 128, 129, 369, 368,
577 129, 129, 129, 367, 129, 129, 129, 129, 129, 134,
578 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
580 134, 134, 134, 135, 366, 365, 364, 135, 135, 135,
581 135, 135, 135, 135, 135, 135, 140, 140, 140, 140,
582 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
583 155, 363, 362, 361, 360, 155, 359, 155, 155, 358,
584 155, 155, 357, 155, 169, 356, 355, 354, 169, 353,
585 352, 169, 169, 351, 169, 169, 350, 169, 175, 175,
586 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
587 349, 175, 208, 348, 208, 208, 208, 208, 208, 208,
588 208, 208, 208, 208, 208, 208, 212, 212, 212, 212,
589 212, 212, 212, 212, 212, 212, 212, 347, 212, 212,
591 213, 346, 213, 213, 213, 213, 213, 213, 213, 213,
592 213, 213, 213, 213, 214, 214, 214, 214, 214, 214,
593 214, 214, 214, 214, 214, 214, 214, 214, 345, 344,
594 343, 342, 341, 340, 339, 338, 337, 336, 335, 334,
595 333, 332, 331, 330, 329, 327, 326, 325, 324, 323,
596 322, 321, 320, 319, 318, 317, 315, 314, 312, 311,
597 310, 309, 308, 307, 306, 305, 304, 302, 301, 300,
598 299, 298, 297, 295, 294, 293, 292, 291, 290, 289,
599 288, 287, 286, 285, 284, 283, 282, 281, 280, 279,
600 278, 277, 276, 275, 274, 273, 272, 271, 270, 269,
602 268, 267, 266, 265, 264, 263, 262, 261, 260, 259,
603 258, 257, 256, 255, 254, 253, 252, 251, 250, 248,
604 247, 246, 245, 244, 243, 242, 241, 240, 239, 238,
605 235, 234, 233, 230, 229, 228, 225, 222, 221, 220,
606 216, 210, 209, 207, 206, 205, 199, 195, 191, 188,
607 187, 182, 89, 174, 122, 89, 397, 19, 397, 397,
608 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
609 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
610 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
611 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
613 397, 397, 397, 397, 397, 397, 397, 397, 397
616 static yyconst
short int yy_chk
[910] =
618 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
619 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
620 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
621 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
622 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
623 1, 3, 3, 423, 4, 4, 419, 3, 22, 22,
624 4, 5, 5, 5, 6, 6, 6, 7, 7, 23,
625 23, 3, 7, 3, 4, 97, 4, 9, 9, 9,
626 97, 5, 5, 5, 6, 6, 6, 7, 7, 7,
627 8, 8, 10, 10, 10, 8, 11, 11, 9, 12,
629 12, 11, 29, 395, 12, 70, 29, 30, 30, 70,
630 8, 8, 8, 10, 38, 38, 100, 11, 39, 39,
631 12, 13, 13, 13, 13, 100, 13, 17, 17, 17,
632 96, 13, 17, 44, 44, 45, 45, 17, 82, 13,
633 96, 13, 82, 13, 51, 51, 406, 17, 406, 17,
634 52, 52, 56, 56, 18, 18, 18, 57, 57, 18,
635 61, 61, 62, 62, 18, 65, 65, 13, 394, 13,
636 14, 14, 14, 14, 18, 14, 18, 66, 66, 106,
637 14, 77, 77, 78, 78, 197, 68, 106, 14, 197,
638 14, 68, 14, 393, 68, 68, 71, 392, 68, 83,
640 83, 71, 84, 84, 71, 71, 85, 85, 86, 86,
641 87, 87, 90, 90, 91, 91, 14, 102, 14, 15,
642 15, 15, 104, 15, 15, 88, 88, 92, 92, 15,
643 102, 88, 93, 93, 102, 88, 107, 104, 391, 15,
644 104, 15, 16, 16, 16, 107, 16, 16, 115, 115,
645 118, 118, 16, 107, 119, 119, 120, 120, 121, 121,
646 124, 124, 16, 388, 16, 25, 125, 125, 126, 126,
647 127, 127, 130, 130, 131, 131, 132, 132, 133, 133,
648 136, 136, 137, 137, 138, 138, 25, 383, 25, 25,
649 25, 25, 139, 139, 381, 25, 25, 25, 25, 25,
651 25, 25, 25, 25, 25, 380, 25, 25, 59, 151,
652 151, 59, 152, 152, 153, 153, 187, 59, 154, 154,
653 156, 156, 157, 157, 158, 158, 187, 59, 159, 159,
654 59, 59, 161, 161, 379, 59, 162, 162, 167, 167,
655 168, 168, 59, 170, 170, 59, 378, 59, 377, 59,
656 59, 171, 171, 172, 172, 173, 173, 175, 175, 176,
657 176, 177, 177, 178, 178, 179, 179, 180, 180, 181,
658 181, 183, 189, 193, 250, 183, 214, 214, 265, 250,
659 215, 215, 250, 250, 273, 375, 183, 189, 193, 181,
660 288, 181, 291, 265, 307, 389, 214, 374, 214, 273,
662 215, 193, 215, 373, 371, 288, 370, 291, 369, 307,
663 389, 398, 398, 398, 398, 398, 398, 398, 398, 398,
664 398, 398, 398, 398, 398, 399, 399, 399, 399, 399,
665 399, 399, 399, 399, 399, 399, 399, 399, 399, 400,
666 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
667 400, 400, 400, 401, 401, 401, 401, 401, 401, 401,
668 401, 401, 401, 401, 401, 401, 401, 402, 402, 402,
669 402, 402, 402, 402, 402, 402, 402, 402, 402, 402,
670 402, 403, 403, 403, 403, 403, 403, 403, 403, 403,
671 403, 403, 403, 403, 403, 404, 404, 404, 404, 404,
673 404, 404, 404, 404, 404, 404, 404, 404, 404, 405,
674 405, 405, 405, 405, 405, 405, 405, 405, 405, 405,
675 405, 405, 405, 407, 407, 407, 407, 407, 407, 407,
676 407, 407, 407, 407, 368, 407, 407, 408, 365, 364,
677 408, 408, 408, 408, 363, 408, 408, 408, 408, 362,
678 408, 409, 361, 360, 358, 409, 409, 409, 409, 409,
679 409, 409, 409, 410, 410, 410, 410, 410, 410, 410,
680 410, 410, 410, 410, 410, 410, 410, 411, 357, 354,
681 411, 411, 411, 353, 411, 411, 411, 411, 411, 412,
682 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
684 412, 412, 412, 413, 352, 351, 350, 413, 413, 413,
685 413, 413, 413, 413, 413, 413, 414, 414, 414, 414,
686 414, 414, 414, 414, 414, 414, 414, 414, 414, 414,
687 415, 349, 348, 347, 345, 415, 344, 415, 415, 343,
688 415, 415, 341, 415, 416, 340, 339, 338, 416, 337,
689 336, 416, 416, 335, 416, 416, 334, 416, 417, 417,
690 417, 417, 417, 417, 417, 417, 417, 417, 417, 417,
691 333, 417, 418, 332, 418, 418, 418, 418, 418, 418,
692 418, 418, 418, 418, 418, 418, 420, 420, 420, 420,
693 420, 420, 420, 420, 420, 420, 420, 331, 420, 420,
695 421, 329, 421, 421, 421, 421, 421, 421, 421, 421,
696 421, 421, 421, 421, 422, 422, 422, 422, 422, 422,
697 422, 422, 422, 422, 422, 422, 422, 422, 328, 327,
698 326, 325, 324, 322, 321, 320, 319, 318, 317, 316,
699 315, 313, 312, 311, 309, 305, 303, 302, 301, 300,
700 298, 297, 296, 294, 293, 292, 290, 289, 286, 285,
701 283, 281, 280, 278, 276, 275, 274, 272, 270, 269,
702 268, 267, 266, 264, 263, 262, 260, 259, 258, 257,
703 256, 255, 254, 253, 252, 251, 247, 246, 245, 244,
704 243, 242, 241, 240, 239, 238, 237, 236, 235, 234,
706 233, 232, 231, 230, 229, 228, 227, 226, 225, 224,
707 223, 222, 221, 220, 219, 218, 217, 216, 212, 210,
708 207, 206, 205, 204, 203, 202, 201, 200, 199, 198,
709 196, 195, 194, 192, 191, 190, 188, 186, 185, 184,
710 182, 142, 116, 110, 109, 108, 105, 103, 101, 99,
711 98, 95, 89, 80, 40, 21, 19, 397, 397, 397,
712 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
713 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
714 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
715 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
717 397, 397, 397, 397, 397, 397, 397, 397, 397
720 static yy_state_type yy_last_accepting_state
;
721 static char *yy_last_accepting_cpos
;
723 extern int yy_flex_debug
;
724 int yy_flex_debug
= 1;
726 static yyconst
short int yy_rule_linenum
[104] =
728 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
729 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
730 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
731 149, 150, 151, 152, 154, 155, 156, 157, 158, 160,
732 161, 162, 168, 171, 174, 177, 178, 181, 184, 187,
733 195, 201, 217, 218, 229, 241, 242, 243, 260, 270,
734 272, 292, 308, 310, 330, 342, 346, 347, 348, 349,
735 350, 351, 352, 353, 354, 360, 371, 377, 378, 380,
736 382, 400, 406, 407, 409, 411, 429, 432, 435, 436,
737 439, 450, 462, 464, 466, 469, 470, 473, 493, 500,
742 /* The intent behind this definition is that it'll catch
743 * any uses of REJECT which flex missed.
745 #define REJECT reject_used_but_not_detected
746 #define yymore() yymore_used_but_not_detected
747 #define YY_MORE_ADJ 0
748 #define YY_RESTORE_YY_MORE_OFFSET
750 #line 1 "scan-gram.l"
752 /* Bison Grammar Scanner -*- C -*-
753 Copyright (C) 2002 Free Software Foundation, Inc.
755 This file is part of Bison, the GNU Compiler Compiler.
757 This program is free software; you can redistribute it and/or modify
758 it under the terms of the GNU General Public License as published by
759 the Free Software Foundation; either version 2 of the License, or
760 (at your option) any later version.
762 This program is distributed in the hope that it will be useful,
763 but WITHOUT ANY WARRANTY; without even the implied warranty of
764 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
765 GNU General Public License for more details.
767 You should have received a copy of the GNU General Public License
768 along with this program; if not, write to the Free Software
769 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
772 #define YY_NO_UNPUT 1
773 #define YY_NEVER_INTERACTIVE 1
774 #define YY_STACK_USED 1
775 #line 26 "scan-gram.l"
777 #include "complain.h"
783 /* Each time we match a string, move the end cursor to its end. */
784 #define YY_USER_INIT \
786 LOCATION_RESET (*yylloc); \
787 yylloc->file = infile; \
788 /* This is only to avoid GCC warnings. */ \
789 if (yycontrol) {;}; \
792 #define YY_USER_ACTION LOCATION_COLUMNS (*yylloc, yyleng);
793 #define YY_LINES LOCATION_LINES (*yylloc, yyleng);
794 #define YY_STEP LOCATION_STEP (*yylloc);
796 /* STRING_OBSTACK -- Used to store all the characters that we need to
797 keep (to construct ID, STRINGS etc.). Use the following macros to
800 Use YY_OBS_GROW to append what has just been matched, and
801 YY_OBS_FINISH to end the string (it puts the ending 0).
802 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
803 used, and which is used by YY_OBS_FREE to free the last string. */
805 static struct obstack string_obstack
;
808 #define YY_OBS_GROW \
809 obstack_grow (&string_obstack, yytext, yyleng)
811 #define YY_OBS_FINISH \
813 obstack_1grow (&string_obstack, '\0'); \
814 last_string = obstack_finish (&string_obstack); \
817 #define YY_OBS_FREE \
819 obstack_free (&string_obstack, last_string); \
823 scanner_last_string_free (void)
829 static int braces_level
= 0;
830 static int percent_percent_count
= 0;
832 /* Within well-formed rules, RULE_LENGTH is the number of values in
833 the current rule so far, which says where to find `$0' with respect
834 to the top of the stack. It is not the same as the rule->length in
835 the case of mid rule actions.
837 Outside of well-formed rules, RULE_LENGTH has an undefined value. */
838 static int rule_length
;
840 static void handle_dollar
PARAMS ((braced_code_t code_kind
,
841 char *cp
, location_t location
));
842 static void handle_at
PARAMS ((braced_code_t code_kind
,
843 char *cp
, location_t location
));
848 #define SC_CHARACTER 3
850 #define SC_ESCAPED_STRING 4
851 #define SC_ESCAPED_CHARACTER 5
853 #define SC_BRACED_CODE 6
854 #define SC_PROLOGUE 7
855 #define SC_EPILOGUE 8
857 #line 858 "scan-gram.c"
859 /* Macros after this point can all be overridden by user definitions in
863 #ifndef YY_SKIP_YYWRAP
865 extern "C" int yywrap
YY_PROTO(( void ));
867 extern int yywrap
YY_PROTO(( void ));
872 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
876 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
879 #ifdef YY_NEED_STRLEN
880 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
885 static int yyinput
YY_PROTO(( void ));
887 static int input
YY_PROTO(( void ));
892 static int yy_start_stack_ptr
= 0;
893 static int yy_start_stack_depth
= 0;
894 static int *yy_start_stack
= 0;
895 #ifndef YY_NO_PUSH_STATE
896 static void yy_push_state
YY_PROTO(( int new_state
));
898 #ifndef YY_NO_POP_STATE
899 static void yy_pop_state
YY_PROTO(( void ));
901 #ifndef YY_NO_TOP_STATE
902 static int yy_top_state
YY_PROTO(( void ));
906 #define YY_NO_PUSH_STATE 1
907 #define YY_NO_POP_STATE 1
908 #define YY_NO_TOP_STATE 1
911 #ifdef YY_MALLOC_DECL
919 /* Just try to get by without declaring the routines. This will fail
920 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
921 * or sizeof(void*) != sizeof(int).
926 /* Amount of stuff to slurp up with each read. */
927 #ifndef YY_READ_BUF_SIZE
928 #define YY_READ_BUF_SIZE 8192
931 /* Copy whatever the last rule matched to the standard output. */
934 /* This used to be an fputs(), but since the string might contain NUL's,
935 * we now use fwrite().
937 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
940 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
941 * is returned in "result".
944 #define YY_INPUT(buf,result,max_size) \
945 if ( yy_current_buffer->yy_is_interactive ) \
948 for ( n = 0; n < max_size && \
949 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
952 buf[n++] = (char) c; \
953 if ( c == EOF && ferror( yyin ) ) \
954 YY_FATAL_ERROR( "input in flex scanner failed" ); \
960 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
962 if( errno != EINTR) \
964 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 /* Default declaration of generated scanner - a define so the user can
992 * easily add parameters.
995 #define YY_DECL int yylex YY_PROTO(( void ))
998 /* Code executed at the beginning of each rule, after yytext and yyleng
1001 #ifndef YY_USER_ACTION
1002 #define YY_USER_ACTION
1005 /* Code executed at the end of each rule. */
1007 #define YY_BREAK break;
1010 #define YY_RULE_SETUP \
1015 register yy_state_type yy_current_state
;
1016 register char *yy_cp
, *yy_bp
;
1017 register int yy_act
;
1019 #line 106 "scan-gram.l"
1022 /* At each yylex invocation, mark the current position as the
1023 start of the next token. */
1028 /*----------------------------.
1029 | Scanning Bison directives. |
1030 `----------------------------*/
1031 #line 1032 "scan-gram.c"
1042 yy_start
= 1; /* first start state */
1050 if ( ! yy_current_buffer
)
1052 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1054 yy_load_buffer_state();
1057 while ( 1 ) /* loops until end-of-file is reached */
1061 /* Support of yytext. */
1062 *yy_cp
= yy_hold_char
;
1064 /* yy_bp points to the position in yy_ch_buf of the start of
1069 yy_current_state
= yy_start
;
1073 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1074 if ( yy_accept
[yy_current_state
] )
1076 yy_last_accepting_state
= yy_current_state
;
1077 yy_last_accepting_cpos
= yy_cp
;
1079 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1081 yy_current_state
= (int) yy_def
[yy_current_state
];
1082 if ( yy_current_state
>= 398 )
1083 yy_c
= yy_meta
[(unsigned int) yy_c
];
1085 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1088 while ( yy_base
[yy_current_state
] != 858 );
1091 yy_act
= yy_accept
[yy_current_state
];
1093 { /* have to back up */
1094 yy_cp
= yy_last_accepting_cpos
;
1095 yy_current_state
= yy_last_accepting_state
;
1096 yy_act
= yy_accept
[yy_current_state
];
1099 YY_DO_BEFORE_ACTION
;
1102 do_action
: /* This label is used only to access EOF actions. */
1104 if ( yy_flex_debug
)
1107 fprintf( stderr
, "--scanner backing up\n" );
1108 else if ( yy_act
< 104 )
1109 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1110 yy_rule_linenum
[yy_act
], yytext
);
1111 else if ( yy_act
== 104 )
1112 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1114 else if ( yy_act
== 105 )
1115 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1117 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1121 { /* beginning of action switch */
1122 case 0: /* must back up */
1123 /* undo the effects of YY_DO_BEFORE_ACTION */
1124 *yy_cp
= yy_hold_char
;
1125 yy_cp
= yy_last_accepting_cpos
;
1126 yy_current_state
= yy_last_accepting_state
;
1127 goto yy_find_action
;
1133 #line 119 "scan-gram.l"
1134 return PERCENT_NONASSOC
;
1138 #line 120 "scan-gram.l"
1139 return PERCENT_DEBUG
;
1143 #line 121 "scan-gram.l"
1144 return PERCENT_DEFINE
;
1148 #line 122 "scan-gram.l"
1149 return PERCENT_DEFINES
;
1153 #line 123 "scan-gram.l"
1154 return PERCENT_DESTRUCTOR
;
1158 #line 124 "scan-gram.l"
1159 return PERCENT_DPREC
;
1163 #line 125 "scan-gram.l"
1164 return PERCENT_ERROR_VERBOSE
;
1168 #line 126 "scan-gram.l"
1169 return PERCENT_EXPECT
;
1173 #line 127 "scan-gram.l"
1174 return PERCENT_FILE_PREFIX
;
1178 #line 128 "scan-gram.l"
1179 return PERCENT_YACC
;
1183 #line 129 "scan-gram.l"
1184 return PERCENT_GLR_PARSER
;
1188 #line 130 "scan-gram.l"
1189 return PERCENT_LEFT
;
1193 #line 131 "scan-gram.l"
1194 return PERCENT_LOCATIONS
;
1198 #line 132 "scan-gram.l"
1199 return PERCENT_MERGE
;
1203 #line 133 "scan-gram.l"
1204 return PERCENT_NAME_PREFIX
;
1208 #line 134 "scan-gram.l"
1209 return PERCENT_NO_LINES
;
1213 #line 135 "scan-gram.l"
1214 return PERCENT_NONASSOC
;
1218 #line 136 "scan-gram.l"
1219 return PERCENT_NTERM
;
1223 #line 137 "scan-gram.l"
1224 return PERCENT_OUTPUT
;
1228 #line 138 "scan-gram.l"
1229 return PERCENT_PARSE_PARAM
;
1233 #line 139 "scan-gram.l"
1234 { rule_length
--; return PERCENT_PREC
; }
1238 #line 140 "scan-gram.l"
1239 return PERCENT_PRINTER
;
1243 #line 141 "scan-gram.l"
1244 return PERCENT_PURE_PARSER
;
1248 #line 142 "scan-gram.l"
1249 return PERCENT_RIGHT
;
1253 #line 143 "scan-gram.l"
1254 return PERCENT_LEX_PARAM
;
1258 #line 144 "scan-gram.l"
1259 return PERCENT_SKELETON
;
1263 #line 145 "scan-gram.l"
1264 return PERCENT_START
;
1268 #line 146 "scan-gram.l"
1269 return PERCENT_TOKEN
;
1273 #line 147 "scan-gram.l"
1274 return PERCENT_TOKEN
;
1278 #line 148 "scan-gram.l"
1279 return PERCENT_TOKEN_TABLE
;
1283 #line 149 "scan-gram.l"
1284 return PERCENT_TYPE
;
1288 #line 150 "scan-gram.l"
1289 return PERCENT_UNION
;
1293 #line 151 "scan-gram.l"
1294 return PERCENT_VERBOSE
;
1298 #line 152 "scan-gram.l"
1299 return PERCENT_YACC
;
1303 #line 154 "scan-gram.l"
1308 #line 155 "scan-gram.l"
1309 { rule_length
= 0; return COLON
; }
1313 #line 156 "scan-gram.l"
1314 { rule_length
= 0; return PIPE
; }
1318 #line 157 "scan-gram.l"
1323 #line 158 "scan-gram.l"
1328 #line 160 "scan-gram.l"
1333 #line 161 "scan-gram.l"
1338 #line 162 "scan-gram.l"
1340 yylval
->symbol
= symbol_get (yytext
, *yylloc
);
1347 #line 168 "scan-gram.l"
1348 yylval
->integer
= strtol (yytext
, 0, 10); return INT
;
1350 /* Characters. We don't check there is only one. */
1353 #line 171 "scan-gram.l"
1354 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1359 #line 174 "scan-gram.l"
1360 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1365 #line 177 "scan-gram.l"
1366 yy_push_state (SC_COMMENT
);
1370 #line 178 "scan-gram.l"
1376 #line 181 "scan-gram.l"
1377 yy_push_state (SC_PROLOGUE
);
1379 /* Code in between braces. */
1382 #line 184 "scan-gram.l"
1383 YY_OBS_GROW
; ++braces_level
; yy_push_state (SC_BRACED_CODE
);
1388 #line 187 "scan-gram.l"
1390 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1392 yylval
->string
= last_string
;
1398 #line 195 "scan-gram.l"
1400 if (++percent_percent_count
== 2)
1401 yy_push_state (SC_EPILOGUE
);
1402 return PERCENT_PERCENT
;
1407 #line 201 "scan-gram.l"
1409 LOCATION_PRINT (stderr
, *yylloc
);
1410 fprintf (stderr
, _(": invalid character: `%c'\n"), *yytext
);
1415 /*------------------------------------------------------------.
1416 | Whatever the start condition (but those which correspond to |
1417 | entity `swallowed' by Bison: SC_ESCAPED_STRING and |
1418 | SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1419 `------------------------------------------------------------*/
1424 #line 217 "scan-gram.l"
1425 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@<:@");
1429 #line 218 "scan-gram.l"
1430 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@:>@");
1433 /*-----------------------------------------------------------.
1434 | Scanning a C comment. The initial `/ *' is already eaten. |
1435 `-----------------------------------------------------------*/
1440 #line 229 "scan-gram.l"
1441 { /* End of the comment. */
1442 if (yy_top_state () == INITIAL
)
1455 #line 241 "scan-gram.l"
1456 if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1460 #line 242 "scan-gram.l"
1461 if (yy_top_state () != INITIAL
) YY_OBS_GROW
; YY_LINES
;
1465 #line 243 "scan-gram.l"
1466 /* Stray `*'. */if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1468 case YY_STATE_EOF(SC_COMMENT
):
1469 #line 245 "scan-gram.l"
1471 LOCATION_PRINT (stderr
, *yylloc
);
1472 fprintf (stderr
, _(": unexpected end of file in a comment\n"));
1477 /*----------------------------------------------------------------.
1478 | Scanning a C string, including its escapes. The initial `"' is |
1480 `----------------------------------------------------------------*/
1485 #line 260 "scan-gram.l"
1487 assert (yy_top_state () == INITIAL
);
1490 yylval
->string
= last_string
;
1498 #line 270 "scan-gram.l"
1503 #line 272 "scan-gram.l"
1504 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1506 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1507 #line 274 "scan-gram.l"
1509 LOCATION_PRINT (stderr
, *yylloc
);
1510 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1511 assert (yy_top_state () == INITIAL
);
1513 yylval
->string
= last_string
;
1519 /*---------------------------------------------------------------.
1520 | Scanning a C character, decoding its escapes. The initial "'" |
1521 | is already eaten. |
1522 `---------------------------------------------------------------*/
1527 #line 292 "scan-gram.l"
1530 assert (yy_top_state () == INITIAL
);
1533 yylval
->symbol
= symbol_get (last_string
, *yylloc
);
1534 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1535 symbol_user_token_number_set (yylval
->symbol
,
1536 (unsigned char) last_string
[1], *yylloc
);
1546 #line 308 "scan-gram.l"
1551 #line 310 "scan-gram.l"
1552 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1554 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1555 #line 312 "scan-gram.l"
1557 LOCATION_PRINT (stderr
, *yylloc
);
1558 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1559 assert (yy_top_state () == INITIAL
);
1561 yylval
->string
= last_string
;
1567 /*----------------------------.
1568 | Decode escaped characters. |
1569 `----------------------------*/
1574 #line 330 "scan-gram.l"
1576 long c
= strtol (yytext
+ 1, 0, 8);
1579 LOCATION_PRINT (stderr
, *yylloc
);
1580 fprintf (stderr
, _(": invalid escape: %s\n"), quote (yytext
));
1584 obstack_1grow (&string_obstack
, c
);
1589 #line 342 "scan-gram.l"
1591 obstack_1grow (&string_obstack
, strtol (yytext
+ 2, 0, 16));
1596 #line 346 "scan-gram.l"
1597 obstack_1grow (&string_obstack
, '\a');
1601 #line 347 "scan-gram.l"
1602 obstack_1grow (&string_obstack
, '\b');
1606 #line 348 "scan-gram.l"
1607 obstack_1grow (&string_obstack
, '\f');
1611 #line 349 "scan-gram.l"
1612 obstack_1grow (&string_obstack
, '\n');
1616 #line 350 "scan-gram.l"
1617 obstack_1grow (&string_obstack
, '\r');
1621 #line 351 "scan-gram.l"
1622 obstack_1grow (&string_obstack
, '\t');
1626 #line 352 "scan-gram.l"
1627 obstack_1grow (&string_obstack
, '\v');
1631 #line 353 "scan-gram.l"
1632 obstack_1grow (&string_obstack
, yytext
[1]);
1636 #line 354 "scan-gram.l"
1638 LOCATION_PRINT (stderr
, *yylloc
);
1639 fprintf (stderr
, _(": unrecognized escape: %s\n"), quote (yytext
));
1643 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1646 #line 360 "scan-gram.l"
1650 /*----------------------------------------------------------.
1651 | Scanning a C character without decoding its escapes. The |
1652 | initial "'" is already eaten. |
1653 `----------------------------------------------------------*/
1658 #line 371 "scan-gram.l"
1661 assert (yy_top_state () != INITIAL
);
1667 #line 377 "scan-gram.l"
1672 #line 378 "scan-gram.l"
1675 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1678 #line 380 "scan-gram.l"
1683 #line 382 "scan-gram.l"
1684 YY_OBS_GROW
; YY_LINES
;
1686 case YY_STATE_EOF(SC_CHARACTER
):
1687 #line 384 "scan-gram.l"
1689 LOCATION_PRINT (stderr
, *yylloc
);
1690 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1691 assert (yy_top_state () != INITIAL
);
1696 /*----------------------------------------------------------------.
1697 | Scanning a C string, without decoding its escapes. The initial |
1698 | `"' is already eaten. |
1699 `----------------------------------------------------------------*/
1704 #line 400 "scan-gram.l"
1706 assert (yy_top_state () != INITIAL
);
1713 #line 406 "scan-gram.l"
1718 #line 407 "scan-gram.l"
1721 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1724 #line 409 "scan-gram.l"
1729 #line 411 "scan-gram.l"
1730 YY_OBS_GROW
; YY_LINES
;
1732 case YY_STATE_EOF(SC_STRING
):
1733 #line 413 "scan-gram.l"
1735 LOCATION_PRINT (stderr
, *yylloc
);
1736 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1737 assert (yy_top_state () != INITIAL
);
1742 /*---------------------------------------------------.
1743 | Strings, comments etc. can be found in user code. |
1744 `---------------------------------------------------*/
1747 /* Characters. We don't check there is only one. */
1750 #line 429 "scan-gram.l"
1751 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1756 #line 432 "scan-gram.l"
1757 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1762 #line 435 "scan-gram.l"
1763 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1767 #line 436 "scan-gram.l"
1773 #line 439 "scan-gram.l"
1777 /*---------------------------------------------------------------.
1778 | Scanning some code in braces (%union and actions). The initial |
1779 | "{" is already eaten. |
1780 `---------------------------------------------------------------*/
1785 #line 450 "scan-gram.l"
1788 if (--braces_level
== 0)
1792 yylval
->string
= last_string
;
1800 #line 462 "scan-gram.l"
1801 YY_OBS_GROW
; braces_level
++;
1805 #line 464 "scan-gram.l"
1806 { handle_dollar (current_braced_code
,
1811 #line 466 "scan-gram.l"
1812 { handle_at (current_braced_code
,
1817 #line 469 "scan-gram.l"
1822 #line 470 "scan-gram.l"
1823 YY_OBS_GROW
; YY_LINES
;
1825 /* A lose $, or /, or etc. */
1828 #line 473 "scan-gram.l"
1831 case YY_STATE_EOF(SC_BRACED_CODE
):
1832 #line 475 "scan-gram.l"
1834 LOCATION_PRINT (stderr
, *yylloc
);
1835 fprintf (stderr
, _(": unexpected end of file in a braced code\n"));
1838 yylval
->string
= last_string
;
1843 /*--------------------------------------------------------------.
1844 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1845 `--------------------------------------------------------------*/
1850 #line 493 "scan-gram.l"
1854 yylval
->string
= last_string
;
1860 #line 500 "scan-gram.l"
1865 #line 501 "scan-gram.l"
1870 #line 502 "scan-gram.l"
1871 YY_OBS_GROW
; YY_LINES
;
1873 case YY_STATE_EOF(SC_PROLOGUE
):
1874 #line 504 "scan-gram.l"
1876 LOCATION_PRINT (stderr
, *yylloc
);
1877 fprintf (stderr
, _(": unexpected end of file in a prologue\n"));
1880 yylval
->string
= last_string
;
1885 /*---------------------------------------------------------------.
1886 | Scanning the epilogue (everything after the second "%%", which |
1887 | has already been eaten. |
1888 `---------------------------------------------------------------*/
1893 #line 522 "scan-gram.l"
1896 case YY_STATE_EOF(SC_EPILOGUE
):
1897 #line 524 "scan-gram.l"
1901 yylval
->string
= last_string
;
1908 #line 533 "scan-gram.l"
1909 YY_FATAL_ERROR( "flex scanner jammed" );
1911 #line 1912 "scan-gram.c"
1912 case YY_STATE_EOF(INITIAL
):
1915 case YY_END_OF_BUFFER
:
1917 /* Amount of text matched not including the EOB char. */
1918 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
1920 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1921 *yy_cp
= yy_hold_char
;
1922 YY_RESTORE_YY_MORE_OFFSET
1924 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1926 /* We're scanning a new file or input source. It's
1927 * possible that this happened because the user
1928 * just pointed yyin at a new source and called
1929 * yylex(). If so, then we have to assure
1930 * consistency between yy_current_buffer and our
1931 * globals. Here is the right place to do so, because
1932 * this is the first action (other than possibly a
1933 * back-up) that will match for the new input source.
1935 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1936 yy_current_buffer
->yy_input_file
= yyin
;
1937 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1940 /* Note that here we test for yy_c_buf_p "<=" to the position
1941 * of the first EOB in the buffer, since yy_c_buf_p will
1942 * already have been incremented past the NUL character
1943 * (since all states make transitions on EOB to the
1944 * end-of-buffer state). Contrast this with the test
1947 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1948 { /* This was really a NUL. */
1949 yy_state_type yy_next_state
;
1951 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1953 yy_current_state
= yy_get_previous_state();
1955 /* Okay, we're now positioned to make the NUL
1956 * transition. We couldn't have
1957 * yy_get_previous_state() go ahead and do it
1958 * for us because it doesn't know how to deal
1959 * with the possibility of jamming (and we don't
1960 * want to build jamming into it because then it
1961 * will run more slowly).
1964 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1966 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1968 if ( yy_next_state
)
1970 /* Consume the NUL. */
1971 yy_cp
= ++yy_c_buf_p
;
1972 yy_current_state
= yy_next_state
;
1979 goto yy_find_action
;
1983 else switch ( yy_get_next_buffer() )
1985 case EOB_ACT_END_OF_FILE
:
1987 yy_did_buffer_switch_on_eof
= 0;
1991 /* Note: because we've taken care in
1992 * yy_get_next_buffer() to have set up
1993 * yytext, we can now set up
1994 * yy_c_buf_p so that if some total
1995 * hoser (like flex itself) wants to
1996 * call the scanner after we return the
1997 * YY_NULL, it'll still work - another
1998 * YY_NULL will get returned.
2000 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
2002 yy_act
= YY_STATE_EOF(YY_START
);
2008 if ( ! yy_did_buffer_switch_on_eof
)
2014 case EOB_ACT_CONTINUE_SCAN
:
2016 yytext_ptr
+ yy_amount_of_matched_text
;
2018 yy_current_state
= yy_get_previous_state();
2021 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2024 case EOB_ACT_LAST_MATCH
:
2026 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
2028 yy_current_state
= yy_get_previous_state();
2031 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2032 goto yy_find_action
;
2039 "fatal flex scanner internal error--no action found" );
2040 } /* end of action switch */
2041 } /* end of scanning one token */
2042 } /* end of yylex */
2045 /* yy_get_next_buffer - try to read in a new buffer
2047 * Returns a code representing an action:
2048 * EOB_ACT_LAST_MATCH -
2049 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2050 * EOB_ACT_END_OF_FILE - end of file
2053 static int yy_get_next_buffer()
2055 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2056 register char *source
= yytext_ptr
;
2057 register int number_to_move
, i
;
2060 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2062 "fatal flex scanner internal error--end of buffer missed" );
2064 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2065 { /* Don't try to fill the buffer, so this is an EOF. */
2066 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2068 /* We matched a single character, the EOB, so
2069 * treat this as a final EOF.
2071 return EOB_ACT_END_OF_FILE
;
2076 /* We matched some text prior to the EOB, first
2079 return EOB_ACT_LAST_MATCH
;
2083 /* Try to read more data. */
2085 /* First move last chars to start of buffer. */
2086 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2088 for ( i
= 0; i
< number_to_move
; ++i
)
2089 *(dest
++) = *(source
++);
2091 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2092 /* don't do the read, it's not guaranteed to return an EOF,
2095 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2100 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2102 while ( num_to_read
<= 0 )
2103 { /* Not enough room in the buffer - grow it. */
2104 #ifdef YY_USES_REJECT
2106 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2109 /* just a shorter name for the current buffer */
2110 YY_BUFFER_STATE b
= yy_current_buffer
;
2112 int yy_c_buf_p_offset
=
2113 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2115 if ( b
->yy_is_our_buffer
)
2117 int new_size
= b
->yy_buf_size
* 2;
2119 if ( new_size
<= 0 )
2120 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2122 b
->yy_buf_size
*= 2;
2124 b
->yy_ch_buf
= (char *)
2125 /* Include room in for 2 EOB chars. */
2126 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2127 b
->yy_buf_size
+ 2 );
2130 /* Can't grow it, we don't own it. */
2133 if ( ! b
->yy_ch_buf
)
2135 "fatal error - scanner input buffer overflow" );
2137 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2139 num_to_read
= yy_current_buffer
->yy_buf_size
-
2144 if ( num_to_read
> YY_READ_BUF_SIZE
)
2145 num_to_read
= YY_READ_BUF_SIZE
;
2147 /* Read in more data. */
2148 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2149 yy_n_chars
, num_to_read
);
2151 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2154 if ( yy_n_chars
== 0 )
2156 if ( number_to_move
== YY_MORE_ADJ
)
2158 ret_val
= EOB_ACT_END_OF_FILE
;
2164 ret_val
= EOB_ACT_LAST_MATCH
;
2165 yy_current_buffer
->yy_buffer_status
=
2166 YY_BUFFER_EOF_PENDING
;
2171 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2173 yy_n_chars
+= number_to_move
;
2174 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2175 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2177 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2183 /* yy_get_previous_state - get the state just before the EOB char was reached */
2185 static yy_state_type
yy_get_previous_state()
2187 register yy_state_type yy_current_state
;
2188 register char *yy_cp
;
2190 yy_current_state
= yy_start
;
2192 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2194 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2195 if ( yy_accept
[yy_current_state
] )
2197 yy_last_accepting_state
= yy_current_state
;
2198 yy_last_accepting_cpos
= yy_cp
;
2200 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2202 yy_current_state
= (int) yy_def
[yy_current_state
];
2203 if ( yy_current_state
>= 398 )
2204 yy_c
= yy_meta
[(unsigned int) yy_c
];
2206 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2209 return yy_current_state
;
2213 /* yy_try_NUL_trans - try to make a transition on the NUL character
2216 * next_state = yy_try_NUL_trans( current_state );
2219 #ifdef YY_USE_PROTOS
2220 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2222 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2223 yy_state_type yy_current_state
;
2226 register int yy_is_jam
;
2227 register char *yy_cp
= yy_c_buf_p
;
2229 register YY_CHAR yy_c
= 1;
2230 if ( yy_accept
[yy_current_state
] )
2232 yy_last_accepting_state
= yy_current_state
;
2233 yy_last_accepting_cpos
= yy_cp
;
2235 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2237 yy_current_state
= (int) yy_def
[yy_current_state
];
2238 if ( yy_current_state
>= 398 )
2239 yy_c
= yy_meta
[(unsigned int) yy_c
];
2241 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2242 yy_is_jam
= (yy_current_state
== 397);
2244 return yy_is_jam
? 0 : yy_current_state
;
2249 #ifdef YY_USE_PROTOS
2250 static void yyunput( int c
, register char *yy_bp
)
2252 static void yyunput( c
, yy_bp
)
2254 register char *yy_bp
;
2257 register char *yy_cp
= yy_c_buf_p
;
2259 /* undo effects of setting up yytext */
2260 *yy_cp
= yy_hold_char
;
2262 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2263 { /* need to shift things up to make room */
2264 /* +2 for EOB chars. */
2265 register int number_to_move
= yy_n_chars
+ 2;
2266 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2267 yy_current_buffer
->yy_buf_size
+ 2];
2268 register char *source
=
2269 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2271 while ( source
> yy_current_buffer
->yy_ch_buf
)
2272 *--dest
= *--source
;
2274 yy_cp
+= (int) (dest
- source
);
2275 yy_bp
+= (int) (dest
- source
);
2276 yy_current_buffer
->yy_n_chars
=
2277 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2279 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2280 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2283 *--yy_cp
= (char) c
;
2287 yy_hold_char
= *yy_cp
;
2290 #endif /* ifndef YY_NO_UNPUT */
2294 static int yyinput()
2301 *yy_c_buf_p
= yy_hold_char
;
2303 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2305 /* yy_c_buf_p now points to the character we want to return.
2306 * If this occurs *before* the EOB characters, then it's a
2307 * valid NUL; if not, then we've hit the end of the buffer.
2309 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2310 /* This was really a NUL. */
2314 { /* need more input */
2315 int offset
= yy_c_buf_p
- yytext_ptr
;
2318 switch ( yy_get_next_buffer() )
2320 case EOB_ACT_LAST_MATCH
:
2321 /* This happens because yy_g_n_b()
2322 * sees that we've accumulated a
2323 * token and flags that we need to
2324 * try matching the token before
2325 * proceeding. But for input(),
2326 * there's no matching to consider.
2327 * So convert the EOB_ACT_LAST_MATCH
2328 * to EOB_ACT_END_OF_FILE.
2331 /* Reset buffer status. */
2336 case EOB_ACT_END_OF_FILE
:
2341 if ( ! yy_did_buffer_switch_on_eof
)
2350 case EOB_ACT_CONTINUE_SCAN
:
2351 yy_c_buf_p
= yytext_ptr
+ offset
;
2357 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2358 *yy_c_buf_p
= '\0'; /* preserve yytext */
2359 yy_hold_char
= *++yy_c_buf_p
;
2366 #ifdef YY_USE_PROTOS
2367 void yyrestart( FILE *input_file
)
2369 void yyrestart( input_file
)
2373 if ( ! yy_current_buffer
)
2374 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2376 yy_init_buffer( yy_current_buffer
, input_file
);
2377 yy_load_buffer_state();
2381 #ifdef YY_USE_PROTOS
2382 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2384 void yy_switch_to_buffer( new_buffer
)
2385 YY_BUFFER_STATE new_buffer
;
2388 if ( yy_current_buffer
== new_buffer
)
2391 if ( yy_current_buffer
)
2393 /* Flush out information for old buffer. */
2394 *yy_c_buf_p
= yy_hold_char
;
2395 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2396 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2399 yy_current_buffer
= new_buffer
;
2400 yy_load_buffer_state();
2402 /* We don't actually know whether we did this switch during
2403 * EOF (yywrap()) processing, but the only time this flag
2404 * is looked at is after yywrap() is called, so it's safe
2405 * to go ahead and always set it.
2407 yy_did_buffer_switch_on_eof
= 1;
2411 #ifdef YY_USE_PROTOS
2412 void yy_load_buffer_state( void )
2414 void yy_load_buffer_state()
2417 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2418 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2419 yyin
= yy_current_buffer
->yy_input_file
;
2420 yy_hold_char
= *yy_c_buf_p
;
2424 #ifdef YY_USE_PROTOS
2425 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2427 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2434 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2436 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2438 b
->yy_buf_size
= size
;
2440 /* yy_ch_buf has to be 2 characters longer than the size given because
2441 * we need to put in 2 end-of-buffer characters.
2443 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2444 if ( ! b
->yy_ch_buf
)
2445 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2447 b
->yy_is_our_buffer
= 1;
2449 yy_init_buffer( b
, file
);
2455 #ifdef YY_USE_PROTOS
2456 void yy_delete_buffer( YY_BUFFER_STATE b
)
2458 void yy_delete_buffer( b
)
2465 if ( b
== yy_current_buffer
)
2466 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2468 if ( b
->yy_is_our_buffer
)
2469 yy_flex_free( (void *) b
->yy_ch_buf
);
2471 yy_flex_free( (void *) b
);
2478 #ifndef YY_ALWAYS_INTERACTIVE
2479 #ifndef YY_NEVER_INTERACTIVE
2480 extern int isatty
YY_PROTO(( int ));
2485 #ifdef YY_USE_PROTOS
2486 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2488 void yy_init_buffer( b
, file
)
2495 yy_flush_buffer( b
);
2497 b
->yy_input_file
= file
;
2498 b
->yy_fill_buffer
= 1;
2500 #if YY_ALWAYS_INTERACTIVE
2501 b
->yy_is_interactive
= 1;
2503 #if YY_NEVER_INTERACTIVE
2504 b
->yy_is_interactive
= 0;
2506 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2512 #ifdef YY_USE_PROTOS
2513 void yy_flush_buffer( YY_BUFFER_STATE b
)
2515 void yy_flush_buffer( b
)
2525 /* We always need two end-of-buffer characters. The first causes
2526 * a transition to the end-of-buffer state. The second causes
2527 * a jam in that state.
2529 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2530 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2532 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2535 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2537 if ( b
== yy_current_buffer
)
2538 yy_load_buffer_state();
2542 #ifndef YY_NO_SCAN_BUFFER
2543 #ifdef YY_USE_PROTOS
2544 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2546 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2554 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2555 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2556 /* They forgot to leave room for the EOB's. */
2559 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2561 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2563 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2564 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2565 b
->yy_is_our_buffer
= 0;
2566 b
->yy_input_file
= 0;
2567 b
->yy_n_chars
= b
->yy_buf_size
;
2568 b
->yy_is_interactive
= 0;
2570 b
->yy_fill_buffer
= 0;
2571 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2573 yy_switch_to_buffer( b
);
2580 #ifndef YY_NO_SCAN_STRING
2581 #ifdef YY_USE_PROTOS
2582 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2584 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2585 yyconst
char *yy_str
;
2589 for ( len
= 0; yy_str
[len
]; ++len
)
2592 return yy_scan_bytes( yy_str
, len
);
2597 #ifndef YY_NO_SCAN_BYTES
2598 #ifdef YY_USE_PROTOS
2599 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2601 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2602 yyconst
char *bytes
;
2611 /* Get memory for full buffer, including space for trailing EOB's. */
2613 buf
= (char *) yy_flex_alloc( n
);
2615 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2617 for ( i
= 0; i
< len
; ++i
)
2620 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2622 b
= yy_scan_buffer( buf
, n
);
2624 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2626 /* It's okay to grow etc. this buffer, and we should throw it
2627 * away when we're done.
2629 b
->yy_is_our_buffer
= 1;
2636 #ifndef YY_NO_PUSH_STATE
2637 #ifdef YY_USE_PROTOS
2638 static void yy_push_state( int new_state
)
2640 static void yy_push_state( new_state
)
2644 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2648 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2649 new_size
= yy_start_stack_depth
* sizeof( int );
2651 if ( ! yy_start_stack
)
2652 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2655 yy_start_stack
= (int *) yy_flex_realloc(
2656 (void *) yy_start_stack
, new_size
);
2658 if ( ! yy_start_stack
)
2660 "out of memory expanding start-condition stack" );
2663 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2670 #ifndef YY_NO_POP_STATE
2671 static void yy_pop_state()
2673 if ( --yy_start_stack_ptr
< 0 )
2674 YY_FATAL_ERROR( "start-condition stack underflow" );
2676 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2681 #ifndef YY_NO_TOP_STATE
2682 static int yy_top_state()
2684 return yy_start_stack
[yy_start_stack_ptr
- 1];
2688 #ifndef YY_EXIT_FAILURE
2689 #define YY_EXIT_FAILURE 2
2692 #ifdef YY_USE_PROTOS
2693 static void yy_fatal_error( yyconst
char msg
[] )
2695 static void yy_fatal_error( msg
)
2699 (void) fprintf( stderr
, "%s\n", msg
);
2700 exit( YY_EXIT_FAILURE
);
2705 /* Redefine yyless() so it works in section 3 code. */
2711 /* Undo effects of setting up yytext. */ \
2712 yytext[yyleng] = yy_hold_char; \
2713 yy_c_buf_p = yytext + n; \
2714 yy_hold_char = *yy_c_buf_p; \
2715 *yy_c_buf_p = '\0'; \
2721 /* Internal utility routines. */
2724 #ifdef YY_USE_PROTOS
2725 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2727 static void yy_flex_strncpy( s1
, s2
, n
)
2734 for ( i
= 0; i
< n
; ++i
)
2739 #ifdef YY_NEED_STRLEN
2740 #ifdef YY_USE_PROTOS
2741 static int yy_flex_strlen( yyconst
char *s
)
2743 static int yy_flex_strlen( s
)
2748 for ( n
= 0; s
[n
]; ++n
)
2756 #ifdef YY_USE_PROTOS
2757 static void *yy_flex_alloc( yy_size_t size
)
2759 static void *yy_flex_alloc( size
)
2763 return (void *) malloc( size
);
2766 #ifdef YY_USE_PROTOS
2767 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2769 static void *yy_flex_realloc( ptr
, size
)
2774 /* The cast to (char *) in the following accommodates both
2775 * implementations that use char* generic pointers, and those
2776 * that use void* generic pointers. It works with the latter
2777 * because both ANSI C and C++ allow castless assignment from
2778 * any pointer type to void*, and deal with argument conversions
2779 * as though doing an assignment.
2781 return (void *) realloc( (char *) ptr
, size
);
2784 #ifdef YY_USE_PROTOS
2785 static void yy_flex_free( void *ptr
)
2787 static void yy_flex_free( ptr
)
2801 #line 533 "scan-gram.l"
2804 /*------------------------------------------------------------------.
2805 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2807 | Possible inputs: $[<TYPENAME>]($|integer) |
2809 | Output to the STRING_OBSTACK a reference to this semantic value. |
2810 `------------------------------------------------------------------*/
2813 handle_action_dollar (char *text
, location_t location
)
2815 const char *type_name
= NULL
;
2816 char *cp
= text
+ 1;
2818 /* Get the type name if explicit. */
2831 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2832 if (!type_name
&& typed
)
2833 complain_at (location
, _("$$ of `%s' has no declared type"),
2834 current_rule
->sym
->tag
);
2837 obstack_fgrow1 (&string_obstack
,
2838 "]b4_lhs_value([%s])[", type_name
);
2840 else if (('0' <= *cp
&& *cp
<= '9') || *cp
== '-')
2842 int n
= strtol (cp
, &cp
, 10);
2844 if (n
> rule_length
)
2845 complain_at (location
, _("invalid value: %s%d"), "$", n
);
2848 if (!type_name
&& n
> 0)
2849 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
2851 if (!type_name
&& typed
)
2852 complain_at (location
, _("$%d of `%s' has no declared type"),
2853 n
, current_rule
->sym
->tag
);
2856 obstack_fgrow3 (&string_obstack
,
2857 "]b4_rhs_value([%d], [%d], [%s])[",
2858 rule_length
, n
, type_name
);
2863 complain_at (location
, _("%s is invalid"), quote (text
));
2868 /*---------------------------------------------------------------.
2869 | TEXT is expexted tp be $$ in some code associated to a symbol: |
2870 | destructor or printer. |
2871 `---------------------------------------------------------------*/
2874 handle_symbol_code_dollar (char *text
, location_t location
)
2876 char *cp
= text
+ 1;
2878 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
2880 complain_at (location
, _("%s is invalid"), quote (text
));
2884 /*-----------------------------------------------------------------.
2885 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2886 | depending upon CODE_KIND. |
2887 `-----------------------------------------------------------------*/
2890 handle_dollar (braced_code_t braced_code_kind
,
2891 char *text
, location_t location
)
2893 switch (braced_code_kind
)
2895 case action_braced_code
:
2896 handle_action_dollar (text
, location
);
2899 case destructor_braced_code
:
2900 case printer_braced_code
:
2901 handle_symbol_code_dollar (text
, location
);
2907 /*------------------------------------------------------.
2908 | TEXT is a location token (i.e., a `@...'). Output to |
2909 | STRING_OBSTACK a reference to this location. |
2910 `------------------------------------------------------*/
2913 handle_action_at (char *text
, location_t location
)
2915 char *cp
= text
+ 1;
2920 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
2922 else if (('0' <= *cp
&& *cp
<= '9') || *cp
== '-')
2924 int n
= strtol (cp
, &cp
, 10);
2926 if (n
> rule_length
)
2927 complain_at (location
, _("invalid value: %s%d"), "@", n
);
2929 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
2934 complain_at (location
, _("%s is invalid"), quote (text
));
2939 /*---------------------------------------------------------------.
2940 | TEXT is expexted tp be @$ in some code associated to a symbol: |
2941 | destructor or printer. |
2942 `---------------------------------------------------------------*/
2945 handle_symbol_code_at (char *text
, location_t location
)
2947 char *cp
= text
+ 1;
2949 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
2951 complain_at (location
, _("%s is invalid"), quote (text
));
2955 /*-------------------------------------------------------------------.
2956 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
2958 `-------------------------------------------------------------------*/
2961 handle_at (braced_code_t braced_code_kind
,
2962 char *text
, location_t location
)
2964 switch (braced_code_kind
)
2966 case action_braced_code
:
2967 handle_action_at (text
, location
);
2970 case destructor_braced_code
:
2971 case printer_braced_code
:
2972 handle_symbol_code_at (text
, location
);
2978 /*-------------------------.
2979 | Initialize the scanner. |
2980 `-------------------------*/
2983 scanner_initialize (void)
2985 obstack_init (&string_obstack
);
2989 /*-----------------------------------------------.
2990 | Free all the memory allocated to the scanner. |
2991 `-----------------------------------------------*/
2996 obstack_free (&string_obstack
, 0);
2997 /* Reclaim Flex's buffers. */
2998 yy_delete_buffer (YY_CURRENT_BUFFER
);