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" */
45 /* Use prototypes in function declarations. */
48 /* The "const" storage-class-modifier is valid. */
51 #else /* ! __cplusplus */
59 #endif /* ! __cplusplus */
78 #define YY_PROTO(proto) proto
80 #define YY_PROTO(proto) ()
83 /* Returned upon end-of-file. */
86 /* Promotes a possibly negative, possibly signed char to an unsigned
87 * integer for use as an array index. If the signed char is negative,
88 * we want to instead treat it as an 8-bit unsigned char, hence the
91 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
93 /* Enter a start condition. This macro really ought to take a parameter,
94 * but we do it the disgusting crufty way forced on us by the ()-less
95 * definition of BEGIN.
97 #define BEGIN yy_start = 1 + 2 *
99 /* Translate the current start state into a value that can be later handed
100 * to BEGIN to return to the state. The YYSTATE alias is for lex
103 #define YY_START ((yy_start - 1) / 2)
104 #define YYSTATE YY_START
106 /* Action number for EOF rule of a given start state. */
107 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
109 /* Special action meaning "start processing a new file". */
110 #define YY_NEW_FILE yyrestart( yyin )
112 #define YY_END_OF_BUFFER_CHAR 0
114 /* Size of default input buffer. */
115 #define YY_BUF_SIZE 16384
117 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
120 extern FILE *yyin
, *yyout
;
122 #define EOB_ACT_CONTINUE_SCAN 0
123 #define EOB_ACT_END_OF_FILE 1
124 #define EOB_ACT_LAST_MATCH 2
126 /* The funky do-while in the following #define is used to turn the definition
127 * int a single C statement (which needs a semi-colon terminator). This
128 * avoids problems with code like:
130 * if ( condition_holds )
133 * do_something_else();
135 * Prior to using the do-while the compiler would get upset at the
136 * "else" because it interpreted the "if" statement as being all
137 * done when it reached the ';' after the yyless() call.
140 /* Return all but the first 'n' matched characters back to the input stream. */
145 /* Undo effects of setting up yytext. */ \
146 *yy_cp = yy_hold_char; \
147 YY_RESTORE_YY_MORE_OFFSET \
148 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
149 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
153 #define unput(c) yyunput( c, yytext_ptr )
155 /* The following is because we cannot portably get our hands on size_t
156 * (without autoconf's help, which isn't available because we want
157 * flex-generated scanners to compile on their own).
159 typedef unsigned int yy_size_t
;
162 struct yy_buffer_state
166 char *yy_ch_buf
; /* input buffer */
167 char *yy_buf_pos
; /* current position in input buffer */
169 /* Size of input buffer in bytes, not including room for EOB
172 yy_size_t yy_buf_size
;
174 /* Number of characters read into yy_ch_buf, not including EOB
179 /* Whether we "own" the buffer - i.e., we know we created it,
180 * and can realloc() it to grow it, and should free() it to
183 int yy_is_our_buffer
;
185 /* Whether this is an "interactive" input source; if so, and
186 * if we're using stdio for input, then we want to use getc()
187 * instead of fread(), to make sure we stop fetching input after
190 int yy_is_interactive
;
192 /* Whether we're considered to be at the beginning of a line.
193 * If so, '^' rules will be active on the next match, otherwise
198 /* Whether to try to fill the input buffer when we reach the
203 int yy_buffer_status
;
204 #define YY_BUFFER_NEW 0
205 #define YY_BUFFER_NORMAL 1
206 /* When an EOF's been seen but there's still some text to process
207 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
208 * shouldn't try reading from the input source any more. We might
209 * still have a bunch of tokens to match, though, because of
210 * possible backing-up.
212 * When we actually see the EOF, we change the status to "new"
213 * (via yyrestart()), so that the user can continue scanning by
214 * just pointing yyin at a new input file.
216 #define YY_BUFFER_EOF_PENDING 2
219 static YY_BUFFER_STATE yy_current_buffer
= 0;
221 /* We provide macros for accessing buffer states in case in the
222 * future we want to put the buffer states in a more general
225 #define YY_CURRENT_BUFFER yy_current_buffer
228 /* yy_hold_char holds the character lost when yytext is formed. */
229 static char yy_hold_char
;
231 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
236 /* Points to current character in buffer. */
237 static char *yy_c_buf_p
= (char *) 0;
238 static int yy_init
= 1; /* whether we need to initialize */
239 static int yy_start
= 0; /* start state number */
241 /* Flag which is used to allow yywrap()'s to do buffer switches
242 * instead of setting up a fresh yyin. A bit of a hack ...
244 static int yy_did_buffer_switch_on_eof
;
246 void yyrestart
YY_PROTO(( FILE *input_file
));
248 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
249 void yy_load_buffer_state
YY_PROTO(( void ));
250 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
251 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
252 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
253 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
254 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
256 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
257 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
258 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
260 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
261 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
));
262 static void yy_flex_free
YY_PROTO(( void * ));
264 #define yy_new_buffer yy_create_buffer
266 #define yy_set_interactive(is_interactive) \
268 if ( ! yy_current_buffer ) \
269 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
270 yy_current_buffer->yy_is_interactive = is_interactive; \
273 #define yy_set_bol(at_bol) \
275 if ( ! yy_current_buffer ) \
276 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
277 yy_current_buffer->yy_at_bol = at_bol; \
280 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
284 #define YY_SKIP_YYWRAP
287 typedef unsigned char YY_CHAR
;
288 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
289 typedef int yy_state_type
;
293 #define yytext_ptr yytext
295 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
296 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
297 static int yy_get_next_buffer
YY_PROTO(( void ));
298 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
300 /* Done after the current pattern has been matched and before the
301 * corresponding action - sets up yytext.
303 #define YY_DO_BEFORE_ACTION \
304 yytext_ptr = yy_bp; \
305 yyleng = (int) (yy_cp - yy_bp); \
306 yy_hold_char = *yy_cp; \
310 #define YY_NUM_RULES 104
311 #define YY_END_OF_BUFFER 105
312 static yyconst
short int yy_accept
[398] =
314 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
315 0, 0, 0, 0, 0, 0, 0, 0, 105, 52,
316 41, 40, 40, 45, 52, 44, 38, 42, 52, 43,
317 36, 39, 52, 35, 49, 37, 56, 57, 57, 58,
318 53, 54, 83, 86, 86, 82, 53, 85, 54, 78,
319 81, 81, 77, 80, 60, 61, 61, 59, 76, 63,
320 64, 64, 62, 96, 97, 97, 88, 98, 87, 91,
321 98, 53, 54, 93, 92, 100, 102, 102, 88, 101,
322 87, 91, 103, 103, 103, 88, 87, 91, 41, 40,
323 40, 40, 40, 51, 0, 0, 0, 0, 0, 0,
325 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
326 48, 42, 46, 47, 43, 0, 56, 57, 57, 57,
327 57, 55, 83, 86, 86, 86, 86, 84, 78, 81,
328 81, 81, 81, 79, 60, 61, 61, 61, 61, 75,
329 74, 75, 67, 68, 69, 70, 71, 72, 73, 75,
330 64, 64, 64, 64, 96, 97, 97, 97, 97, 94,
331 0, 94, 0, 89, 90, 95, 0, 95, 100, 102,
332 102, 102, 102, 99, 103, 103, 103, 103, 103, 89,
333 90, 0, 0, 0, 0, 0, 0, 0, 0, 0,
334 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
336 0, 0, 0, 0, 0, 0, 0, 47, 50, 0,
337 0, 0, 90, 90, 90, 0, 0, 0, 0, 0,
338 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
339 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
340 0, 0, 0, 0, 0, 0, 0, 65, 66, 0,
341 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
342 12, 0, 0, 0, 0, 0, 0, 0, 0, 0,
343 21, 0, 0, 0, 0, 0, 28, 0, 31, 0,
344 0, 34, 0, 2, 0, 0, 6, 0, 0, 0,
345 0, 0, 0, 0, 14, 0, 0, 0, 18, 0,
347 0, 0, 0, 24, 0, 27, 29, 32, 0, 1,
348 3, 0, 0, 8, 0, 0, 0, 0, 0, 0,
349 0, 0, 19, 0, 0, 0, 0, 0, 0, 4,
350 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
351 0, 22, 0, 0, 0, 33, 0, 0, 0, 0,
352 0, 0, 0, 0, 16, 17, 0, 0, 26, 0,
353 0, 0, 0, 0, 0, 25, 13, 0, 0, 0,
354 0, 5, 0, 0, 0, 11, 0, 0, 0, 0,
355 0, 9, 0, 15, 20, 23, 30, 0, 0, 7,
360 static yyconst
int yy_ec
[256] =
362 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
363 1, 2, 4, 1, 1, 1, 1, 1, 1, 1,
364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
365 1, 2, 1, 5, 1, 6, 7, 1, 8, 1,
366 1, 9, 1, 10, 11, 12, 13, 14, 14, 14,
367 14, 14, 14, 14, 14, 15, 15, 16, 17, 18,
368 19, 20, 1, 21, 22, 22, 22, 22, 22, 22,
369 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
370 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
371 23, 24, 25, 1, 26, 1, 27, 28, 29, 30,
373 31, 32, 33, 34, 35, 12, 36, 37, 38, 39,
374 40, 41, 12, 42, 43, 44, 45, 46, 12, 47,
375 48, 12, 49, 50, 51, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382 1, 1, 1, 1, 1, 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,
392 static yyconst
int yy_meta
[52] =
394 1, 1, 2, 3, 4, 5, 6, 7, 8, 1,
395 1, 9, 10, 11, 11, 1, 1, 1, 1, 12,
396 5, 11, 13, 14, 13, 9, 11, 11, 11, 11,
397 11, 11, 9, 9, 9, 9, 9, 9, 9, 9,
398 9, 9, 9, 9, 9, 9, 9, 9, 5, 1,
402 static yyconst
short int yy_base
[424] =
404 0, 0, 49, 52, 59, 62, 65, 88, 75, 90,
405 94, 97, 119, 168, 217, 240, 125, 152, 857, 858,
406 854, 56, 67, 858, 259, 858, 858, 0, 94, 94,
407 858, 858, 0, 858, 858, 858, 0, 112, 116, 842,
408 858, 858, 0, 131, 133, 858, 858, 0, 858, 0,
409 142, 148, 858, 0, 0, 150, 155, 858, 304, 858,
410 158, 160, 858, 0, 163, 175, 858, 181, 858, 97,
411 191, 858, 858, 858, 858, 0, 179, 181, 858, 803,
412 858, 130, 197, 200, 204, 206, 208, 223, 851, 210,
413 212, 225, 230, 858, 817, 100, 34, 816, 813, 86,
415 818, 191, 803, 196, 812, 144, 206, 807, 814, 817,
416 858, 0, 858, 0, 235, 823, 0, 248, 252, 254,
417 256, 858, 0, 258, 264, 266, 268, 858, 0, 270,
418 272, 274, 276, 858, 0, 278, 280, 282, 290, 858,
419 858, 828, 858, 858, 858, 858, 858, 858, 858, 0,
420 307, 310, 312, 316, 0, 318, 320, 322, 326, 858,
421 319, 323, 0, 858, 0, 858, 325, 327, 0, 341,
422 349, 351, 353, 858, 355, 357, 359, 361, 363, 365,
423 367, 802, 344, 798, 797, 797, 280, 795, 341, 807,
424 793, 796, 363, 802, 788, 789, 155, 788, 796, 797,
426 800, 784, 789, 783, 788, 780, 792, 0, 858, 806,
427 0, 799, 0, 374, 378, 791, 772, 781, 771, 783,
428 773, 781, 780, 779, 798, 764, 796, 779, 772, 773,
429 766, 775, 759, 759, 756, 769, 758, 765, 761, 757,
430 751, 754, 760, 759, 749, 760, 758, 858, 858, 369,
431 744, 752, 745, 741, 753, 739, 751, 768, 748, 736,
432 858, 735, 731, 743, 368, 738, 729, 733, 725, 738,
433 858, 724, 374, 723, 735, 721, 858, 725, 858, 724,
434 722, 858, 713, 858, 729, 714, 858, 380, 714, 716,
435 382, 729, 728, 719, 858, 712, 713, 708, 858, 706,
437 738, 717, 706, 858, 702, 858, 384, 858, 702, 858,
438 701, 714, 696, 858, 699, 700, 697, 696, 697, 694,
439 704, 694, 858, 692, 690, 704, 690, 685, 671, 858,
440 654, 643, 640, 612, 611, 624, 611, 617, 604, 617,
441 616, 858, 598, 598, 608, 858, 594, 591, 600, 563,
442 575, 567, 541, 548, 858, 858, 537, 512, 858, 526,
443 511, 522, 510, 499, 497, 858, 858, 500, 382, 376,
444 368, 858, 364, 351, 341, 858, 302, 309, 293, 275,
445 252, 858, 244, 858, 858, 858, 858, 233, 385, 858,
446 207, 163, 157, 138, 61, 858, 858, 411, 425, 439,
448 453, 467, 481, 495, 509, 138, 523, 537, 551, 563,
449 577, 589, 603, 616, 630, 644, 658, 672, 46, 686,
453 static yyconst
short int yy_def
[424] =
455 397, 1, 398, 398, 399, 399, 400, 400, 401, 401,
456 402, 402, 403, 403, 404, 404, 405, 405, 397, 397,
457 397, 397, 397, 397, 397, 397, 397, 406, 397, 397,
458 397, 397, 407, 397, 397, 397, 408, 397, 397, 397,
459 397, 397, 409, 397, 397, 397, 397, 410, 397, 411,
460 397, 397, 397, 412, 413, 397, 397, 397, 414, 397,
461 397, 397, 397, 415, 397, 397, 397, 397, 397, 397,
462 397, 397, 397, 397, 397, 416, 397, 397, 397, 397,
463 397, 397, 417, 417, 417, 417, 417, 417, 397, 397,
464 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
466 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
467 397, 406, 397, 418, 397, 407, 408, 397, 397, 397,
468 397, 397, 409, 397, 397, 397, 397, 397, 411, 397,
469 397, 397, 397, 397, 413, 397, 397, 397, 397, 397,
470 397, 397, 397, 397, 397, 397, 397, 397, 397, 419,
471 397, 397, 397, 397, 415, 397, 397, 397, 397, 397,
472 397, 397, 420, 397, 421, 397, 397, 397, 416, 397,
473 397, 397, 397, 397, 417, 417, 417, 417, 417, 417,
474 422, 397, 397, 397, 397, 397, 397, 397, 397, 397,
475 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
477 397, 397, 397, 397, 397, 397, 397, 418, 397, 397,
478 423, 420, 421, 422, 422, 397, 397, 397, 397, 397,
479 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
480 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
481 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
482 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
483 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
484 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
485 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
486 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,
495 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, 0, 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,
504 static yyconst
short int yy_nxt
[910] =
506 20, 21, 22, 23, 24, 20, 25, 26, 20, 27,
507 20, 28, 29, 30, 30, 31, 32, 33, 34, 20,
508 20, 28, 20, 20, 20, 28, 28, 28, 28, 28,
509 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
510 28, 28, 28, 28, 28, 28, 28, 28, 35, 36,
511 20, 38, 39, 249, 38, 39, 211, 40, 90, 91,
512 40, 44, 45, 46, 44, 45, 46, 51, 52, 92,
513 93, 41, 53, 42, 41, 185, 42, 56, 57, 58,
514 186, 47, 48, 49, 47, 48, 49, 47, 54, 49,
515 51, 52, 56, 57, 58, 53, 61, 62, 59, 61,
517 62, 63, 113, 396, 63, 164, 114, 115, 115, 165,
518 47, 54, 49, 59, 118, 119, 189, 59, 120, 121,
519 59, 65, 66, 67, 68, 190, 69, 84, 85, 86,
520 183, 70, 87, 124, 125, 126, 127, 88, 164, 71,
521 184, 72, 165, 73, 130, 131, 112, 47, 112, 49,
522 132, 133, 136, 137, 84, 85, 86, 138, 139, 87,
523 151, 152, 153, 154, 88, 156, 157, 74, 395, 75,
524 65, 66, 67, 68, 47, 69, 49, 158, 159, 200,
525 70, 170, 171, 172, 173, 236, 160, 201, 71, 237,
526 72, 161, 73, 394, 162, 162, 166, 393, 163, 176,
528 177, 167, 176, 178, 168, 168, 179, 177, 176, 177,
529 176, 177, 90, 91, 92, 93, 74, 192, 75, 77,
530 78, 79, 196, 80, 81, 176, 177, 90, 91, 82,
531 193, 180, 92, 93, 194, 181, 202, 197, 392, 47,
532 198, 49, 77, 78, 79, 203, 80, 81, 115, 115,
533 118, 119, 82, 204, 120, 121, 118, 119, 120, 121,
534 124, 125, 47, 390, 49, 94, 126, 127, 124, 125,
535 126, 127, 130, 131, 132, 133, 130, 131, 132, 133,
536 136, 137, 138, 139, 136, 137, 95, 389, 96, 97,
537 98, 99, 138, 139, 388, 100, 101, 102, 103, 104,
539 105, 106, 107, 108, 109, 387, 110, 111, 141, 151,
540 152, 141, 153, 154, 151, 152, 223, 142, 153, 154,
541 156, 157, 158, 159, 156, 157, 224, 141, 158, 159,
542 143, 144, 162, 162, 386, 145, 162, 162, 168, 168,
543 168, 168, 146, 170, 171, 147, 385, 148, 384, 149,
544 150, 172, 173, 170, 171, 172, 173, 176, 177, 176,
545 178, 179, 177, 179, 177, 176, 178, 176, 177, 176,
546 215, 217, 226, 231, 160, 218, 176, 215, 296, 161,
547 179, 215, 162, 162, 303, 383, 219, 227, 231, 213,
548 313, 213, 316, 296, 328, 391, 213, 382, 213, 303,
550 213, 232, 213, 381, 380, 313, 379, 316, 378, 328,
551 391, 37, 37, 37, 37, 37, 37, 37, 37, 37,
552 37, 37, 37, 37, 37, 43, 43, 43, 43, 43,
553 43, 43, 43, 43, 43, 43, 43, 43, 43, 50,
554 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
555 50, 50, 50, 55, 55, 55, 55, 55, 55, 55,
556 55, 55, 55, 55, 55, 55, 55, 60, 60, 60,
557 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
558 60, 64, 64, 64, 64, 64, 64, 64, 64, 64,
559 64, 64, 64, 64, 64, 76, 76, 76, 76, 76,
561 76, 76, 76, 76, 76, 76, 76, 76, 76, 83,
562 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
563 83, 83, 83, 116, 116, 116, 116, 116, 116, 116,
564 116, 116, 116, 116, 377, 116, 116, 117, 376, 375,
565 117, 117, 117, 117, 374, 117, 117, 117, 117, 373,
566 117, 123, 372, 371, 370, 123, 123, 123, 123, 123,
567 123, 123, 123, 128, 128, 128, 128, 128, 128, 128,
568 128, 128, 128, 128, 128, 128, 128, 129, 369, 368,
569 129, 129, 129, 367, 129, 129, 129, 129, 129, 134,
570 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
572 134, 134, 134, 135, 366, 365, 364, 135, 135, 135,
573 135, 135, 135, 135, 135, 135, 140, 140, 140, 140,
574 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
575 155, 363, 362, 361, 360, 155, 359, 155, 155, 358,
576 155, 155, 357, 155, 169, 356, 355, 354, 169, 353,
577 352, 169, 169, 351, 169, 169, 350, 169, 175, 175,
578 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
579 349, 175, 208, 348, 208, 208, 208, 208, 208, 208,
580 208, 208, 208, 208, 208, 208, 212, 212, 212, 212,
581 212, 212, 212, 212, 212, 212, 212, 347, 212, 212,
583 213, 346, 213, 213, 213, 213, 213, 213, 213, 213,
584 213, 213, 213, 213, 214, 214, 214, 214, 214, 214,
585 214, 214, 214, 214, 214, 214, 214, 214, 345, 344,
586 343, 342, 341, 340, 339, 338, 337, 336, 335, 334,
587 333, 332, 331, 330, 329, 327, 326, 325, 324, 323,
588 322, 321, 320, 319, 318, 317, 315, 314, 312, 311,
589 310, 309, 308, 307, 306, 305, 304, 302, 301, 300,
590 299, 298, 297, 295, 294, 293, 292, 291, 290, 289,
591 288, 287, 286, 285, 284, 283, 282, 281, 280, 279,
592 278, 277, 276, 275, 274, 273, 272, 271, 270, 269,
594 268, 267, 266, 265, 264, 263, 262, 261, 260, 259,
595 258, 257, 256, 255, 254, 253, 252, 251, 250, 248,
596 247, 246, 245, 244, 243, 242, 241, 240, 239, 238,
597 235, 234, 233, 230, 229, 228, 225, 222, 221, 220,
598 216, 210, 209, 207, 206, 205, 199, 195, 191, 188,
599 187, 182, 89, 174, 122, 89, 397, 19, 397, 397,
600 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
601 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
602 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
603 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
605 397, 397, 397, 397, 397, 397, 397, 397, 397
608 static yyconst
short int yy_chk
[910] =
610 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
611 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
612 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
613 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
614 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
615 1, 3, 3, 423, 4, 4, 419, 3, 22, 22,
616 4, 5, 5, 5, 6, 6, 6, 7, 7, 23,
617 23, 3, 7, 3, 4, 97, 4, 9, 9, 9,
618 97, 5, 5, 5, 6, 6, 6, 7, 7, 7,
619 8, 8, 10, 10, 10, 8, 11, 11, 9, 12,
621 12, 11, 29, 395, 12, 70, 29, 30, 30, 70,
622 8, 8, 8, 10, 38, 38, 100, 11, 39, 39,
623 12, 13, 13, 13, 13, 100, 13, 17, 17, 17,
624 96, 13, 17, 44, 44, 45, 45, 17, 82, 13,
625 96, 13, 82, 13, 51, 51, 406, 17, 406, 17,
626 52, 52, 56, 56, 18, 18, 18, 57, 57, 18,
627 61, 61, 62, 62, 18, 65, 65, 13, 394, 13,
628 14, 14, 14, 14, 18, 14, 18, 66, 66, 106,
629 14, 77, 77, 78, 78, 197, 68, 106, 14, 197,
630 14, 68, 14, 393, 68, 68, 71, 392, 68, 83,
632 83, 71, 84, 84, 71, 71, 85, 85, 86, 86,
633 87, 87, 90, 90, 91, 91, 14, 102, 14, 15,
634 15, 15, 104, 15, 15, 88, 88, 92, 92, 15,
635 102, 88, 93, 93, 102, 88, 107, 104, 391, 15,
636 104, 15, 16, 16, 16, 107, 16, 16, 115, 115,
637 118, 118, 16, 107, 119, 119, 120, 120, 121, 121,
638 124, 124, 16, 388, 16, 25, 125, 125, 126, 126,
639 127, 127, 130, 130, 131, 131, 132, 132, 133, 133,
640 136, 136, 137, 137, 138, 138, 25, 383, 25, 25,
641 25, 25, 139, 139, 381, 25, 25, 25, 25, 25,
643 25, 25, 25, 25, 25, 380, 25, 25, 59, 151,
644 151, 59, 152, 152, 153, 153, 187, 59, 154, 154,
645 156, 156, 157, 157, 158, 158, 187, 59, 159, 159,
646 59, 59, 161, 161, 379, 59, 162, 162, 167, 167,
647 168, 168, 59, 170, 170, 59, 378, 59, 377, 59,
648 59, 171, 171, 172, 172, 173, 173, 175, 175, 176,
649 176, 177, 177, 178, 178, 179, 179, 180, 180, 181,
650 181, 183, 189, 193, 250, 183, 214, 214, 265, 250,
651 215, 215, 250, 250, 273, 375, 183, 189, 193, 181,
652 288, 181, 291, 265, 307, 389, 214, 374, 214, 273,
654 215, 193, 215, 373, 371, 288, 370, 291, 369, 307,
655 389, 398, 398, 398, 398, 398, 398, 398, 398, 398,
656 398, 398, 398, 398, 398, 399, 399, 399, 399, 399,
657 399, 399, 399, 399, 399, 399, 399, 399, 399, 400,
658 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
659 400, 400, 400, 401, 401, 401, 401, 401, 401, 401,
660 401, 401, 401, 401, 401, 401, 401, 402, 402, 402,
661 402, 402, 402, 402, 402, 402, 402, 402, 402, 402,
662 402, 403, 403, 403, 403, 403, 403, 403, 403, 403,
663 403, 403, 403, 403, 403, 404, 404, 404, 404, 404,
665 404, 404, 404, 404, 404, 404, 404, 404, 404, 405,
666 405, 405, 405, 405, 405, 405, 405, 405, 405, 405,
667 405, 405, 405, 407, 407, 407, 407, 407, 407, 407,
668 407, 407, 407, 407, 368, 407, 407, 408, 365, 364,
669 408, 408, 408, 408, 363, 408, 408, 408, 408, 362,
670 408, 409, 361, 360, 358, 409, 409, 409, 409, 409,
671 409, 409, 409, 410, 410, 410, 410, 410, 410, 410,
672 410, 410, 410, 410, 410, 410, 410, 411, 357, 354,
673 411, 411, 411, 353, 411, 411, 411, 411, 411, 412,
674 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
676 412, 412, 412, 413, 352, 351, 350, 413, 413, 413,
677 413, 413, 413, 413, 413, 413, 414, 414, 414, 414,
678 414, 414, 414, 414, 414, 414, 414, 414, 414, 414,
679 415, 349, 348, 347, 345, 415, 344, 415, 415, 343,
680 415, 415, 341, 415, 416, 340, 339, 338, 416, 337,
681 336, 416, 416, 335, 416, 416, 334, 416, 417, 417,
682 417, 417, 417, 417, 417, 417, 417, 417, 417, 417,
683 333, 417, 418, 332, 418, 418, 418, 418, 418, 418,
684 418, 418, 418, 418, 418, 418, 420, 420, 420, 420,
685 420, 420, 420, 420, 420, 420, 420, 331, 420, 420,
687 421, 329, 421, 421, 421, 421, 421, 421, 421, 421,
688 421, 421, 421, 421, 422, 422, 422, 422, 422, 422,
689 422, 422, 422, 422, 422, 422, 422, 422, 328, 327,
690 326, 325, 324, 322, 321, 320, 319, 318, 317, 316,
691 315, 313, 312, 311, 309, 305, 303, 302, 301, 300,
692 298, 297, 296, 294, 293, 292, 290, 289, 286, 285,
693 283, 281, 280, 278, 276, 275, 274, 272, 270, 269,
694 268, 267, 266, 264, 263, 262, 260, 259, 258, 257,
695 256, 255, 254, 253, 252, 251, 247, 246, 245, 244,
696 243, 242, 241, 240, 239, 238, 237, 236, 235, 234,
698 233, 232, 231, 230, 229, 228, 227, 226, 225, 224,
699 223, 222, 221, 220, 219, 218, 217, 216, 212, 210,
700 207, 206, 205, 204, 203, 202, 201, 200, 199, 198,
701 196, 195, 194, 192, 191, 190, 188, 186, 185, 184,
702 182, 142, 116, 110, 109, 108, 105, 103, 101, 99,
703 98, 95, 89, 80, 40, 21, 19, 397, 397, 397,
704 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
705 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
706 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
707 397, 397, 397, 397, 397, 397, 397, 397, 397, 397,
709 397, 397, 397, 397, 397, 397, 397, 397, 397
712 static yy_state_type yy_last_accepting_state
;
713 static char *yy_last_accepting_cpos
;
715 extern int yy_flex_debug
;
716 int yy_flex_debug
= 1;
718 static yyconst
short int yy_rule_linenum
[104] =
720 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
721 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
722 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
723 149, 150, 151, 152, 154, 155, 156, 157, 158, 160,
724 161, 162, 168, 171, 174, 177, 178, 181, 184, 187,
725 195, 201, 217, 218, 229, 241, 242, 243, 260, 270,
726 272, 292, 308, 310, 330, 342, 346, 347, 348, 349,
727 350, 351, 352, 353, 354, 360, 371, 377, 378, 380,
728 382, 400, 406, 407, 409, 411, 429, 432, 435, 436,
729 439, 450, 462, 464, 466, 469, 470, 473, 493, 500,
734 /* The intent behind this definition is that it'll catch
735 * any uses of REJECT which flex missed.
737 #define REJECT reject_used_but_not_detected
738 #define yymore() yymore_used_but_not_detected
739 #define YY_MORE_ADJ 0
740 #define YY_RESTORE_YY_MORE_OFFSET
742 #line 1 "scan-gram.l"
744 /* Bison Grammar Scanner -*- C -*-
745 Copyright (C) 2002 Free Software Foundation, Inc.
747 This file is part of Bison, the GNU Compiler Compiler.
749 This program is free software; you can redistribute it and/or modify
750 it under the terms of the GNU General Public License as published by
751 the Free Software Foundation; either version 2 of the License, or
752 (at your option) any later version.
754 This program is distributed in the hope that it will be useful,
755 but WITHOUT ANY WARRANTY; without even the implied warranty of
756 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
757 GNU General Public License for more details.
759 You should have received a copy of the GNU General Public License
760 along with this program; if not, write to the Free Software
761 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
764 #define YY_NO_UNPUT 1
765 #define YY_NEVER_INTERACTIVE 1
766 #define YY_STACK_USED 1
767 #line 26 "scan-gram.l"
769 #include "complain.h"
775 /* Each time we match a string, move the end cursor to its end. */
776 #define YY_USER_INIT \
778 LOCATION_RESET (*yylloc); \
779 yylloc->file = infile; \
780 /* This is only to avoid GCC warnings. */ \
781 if (yycontrol) {;}; \
784 #define YY_USER_ACTION LOCATION_COLUMNS (*yylloc, yyleng);
785 #define YY_LINES LOCATION_LINES (*yylloc, yyleng);
786 #define YY_STEP LOCATION_STEP (*yylloc);
788 /* STRING_OBSTACK -- Used to store all the characters that we need to
789 keep (to construct ID, STRINGS etc.). Use the following macros to
792 Use YY_OBS_GROW to append what has just been matched, and
793 YY_OBS_FINISH to end the string (it puts the ending 0).
794 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
795 used, and which is used by YY_OBS_FREE to free the last string. */
797 static struct obstack string_obstack
;
800 #define YY_OBS_GROW \
801 obstack_grow (&string_obstack, yytext, yyleng)
803 #define YY_OBS_FINISH \
805 obstack_1grow (&string_obstack, '\0'); \
806 last_string = obstack_finish (&string_obstack); \
809 #define YY_OBS_FREE \
811 obstack_free (&string_obstack, last_string); \
815 scanner_last_string_free (void)
821 static int braces_level
= 0;
822 static int percent_percent_count
= 0;
824 /* Within well-formed rules, RULE_LENGTH is the number of values in
825 the current rule so far, which says where to find `$0' with respect
826 to the top of the stack. It is not the same as the rule->length in
827 the case of mid rule actions.
829 Outside of well-formed rules, RULE_LENGTH has an undefined value. */
830 static int rule_length
;
832 static void handle_dollar (braced_code_t code_kind
,
833 char *cp
, location_t location
);
834 static void handle_at (braced_code_t code_kind
,
835 char *cp
, location_t location
);
840 #define SC_CHARACTER 3
842 #define SC_ESCAPED_STRING 4
843 #define SC_ESCAPED_CHARACTER 5
845 #define SC_BRACED_CODE 6
846 #define SC_PROLOGUE 7
847 #define SC_EPILOGUE 8
849 #line 850 "scan-gram.c"
851 /* Macros after this point can all be overridden by user definitions in
855 #ifndef YY_SKIP_YYWRAP
857 extern "C" int yywrap
YY_PROTO(( void ));
859 extern int yywrap
YY_PROTO(( void ));
864 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
868 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
871 #ifdef YY_NEED_STRLEN
872 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
877 static int yyinput
YY_PROTO(( void ));
879 static int input
YY_PROTO(( void ));
884 static int yy_start_stack_ptr
= 0;
885 static int yy_start_stack_depth
= 0;
886 static int *yy_start_stack
= 0;
887 #ifndef YY_NO_PUSH_STATE
888 static void yy_push_state
YY_PROTO(( int new_state
));
890 #ifndef YY_NO_POP_STATE
891 static void yy_pop_state
YY_PROTO(( void ));
893 #ifndef YY_NO_TOP_STATE
894 static int yy_top_state
YY_PROTO(( void ));
898 #define YY_NO_PUSH_STATE 1
899 #define YY_NO_POP_STATE 1
900 #define YY_NO_TOP_STATE 1
903 #ifdef YY_MALLOC_DECL
911 /* Just try to get by without declaring the routines. This will fail
912 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
913 * or sizeof(void*) != sizeof(int).
918 /* Amount of stuff to slurp up with each read. */
919 #ifndef YY_READ_BUF_SIZE
920 #define YY_READ_BUF_SIZE 8192
923 /* Copy whatever the last rule matched to the standard output. */
926 /* This used to be an fputs(), but since the string might contain NUL's,
927 * we now use fwrite().
929 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
932 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
933 * is returned in "result".
936 #define YY_INPUT(buf,result,max_size) \
937 if ( yy_current_buffer->yy_is_interactive ) \
940 for ( n = 0; n < max_size && \
941 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
944 buf[n++] = (char) c; \
945 if ( c == EOF && ferror( yyin ) ) \
946 YY_FATAL_ERROR( "input in flex scanner failed" ); \
949 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
950 && ferror( yyin ) ) \
951 YY_FATAL_ERROR( "input in flex scanner failed" );
954 /* No semi-colon after return; correct usage is to write "yyterminate();" -
955 * we don't want an extra ';' after the "return" because that will cause
956 * some compilers to complain about unreachable statements.
959 #define yyterminate() return YY_NULL
962 /* Number of entries by which start-condition stack grows. */
963 #ifndef YY_START_STACK_INCR
964 #define YY_START_STACK_INCR 25
967 /* Report a fatal error. */
968 #ifndef YY_FATAL_ERROR
969 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
972 /* Default declaration of generated scanner - a define so the user can
973 * easily add parameters.
976 #define YY_DECL int yylex YY_PROTO(( void ))
979 /* Code executed at the beginning of each rule, after yytext and yyleng
982 #ifndef YY_USER_ACTION
983 #define YY_USER_ACTION
986 /* Code executed at the end of each rule. */
988 #define YY_BREAK break;
991 #define YY_RULE_SETUP \
996 register yy_state_type yy_current_state
;
997 register char *yy_cp
, *yy_bp
;
1000 #line 106 "scan-gram.l"
1003 /* At each yylex invocation, mark the current position as the
1004 start of the next token. */
1009 /*----------------------------.
1010 | Scanning Bison directives. |
1011 `----------------------------*/
1012 #line 1013 "scan-gram.c"
1023 yy_start
= 1; /* first start state */
1031 if ( ! yy_current_buffer
)
1033 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1035 yy_load_buffer_state();
1038 while ( 1 ) /* loops until end-of-file is reached */
1042 /* Support of yytext. */
1043 *yy_cp
= yy_hold_char
;
1045 /* yy_bp points to the position in yy_ch_buf of the start of
1050 yy_current_state
= yy_start
;
1054 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1055 if ( yy_accept
[yy_current_state
] )
1057 yy_last_accepting_state
= yy_current_state
;
1058 yy_last_accepting_cpos
= yy_cp
;
1060 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1062 yy_current_state
= (int) yy_def
[yy_current_state
];
1063 if ( yy_current_state
>= 398 )
1064 yy_c
= yy_meta
[(unsigned int) yy_c
];
1066 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1069 while ( yy_base
[yy_current_state
] != 858 );
1072 yy_act
= yy_accept
[yy_current_state
];
1074 { /* have to back up */
1075 yy_cp
= yy_last_accepting_cpos
;
1076 yy_current_state
= yy_last_accepting_state
;
1077 yy_act
= yy_accept
[yy_current_state
];
1080 YY_DO_BEFORE_ACTION
;
1083 do_action
: /* This label is used only to access EOF actions. */
1085 if ( yy_flex_debug
)
1088 fprintf( stderr
, "--scanner backing up\n" );
1089 else if ( yy_act
< 104 )
1090 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1091 yy_rule_linenum
[yy_act
], yytext
);
1092 else if ( yy_act
== 104 )
1093 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1095 else if ( yy_act
== 105 )
1096 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1098 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1102 { /* beginning of action switch */
1103 case 0: /* must back up */
1104 /* undo the effects of YY_DO_BEFORE_ACTION */
1105 *yy_cp
= yy_hold_char
;
1106 yy_cp
= yy_last_accepting_cpos
;
1107 yy_current_state
= yy_last_accepting_state
;
1108 goto yy_find_action
;
1114 #line 119 "scan-gram.l"
1115 return PERCENT_NONASSOC
;
1119 #line 120 "scan-gram.l"
1120 return PERCENT_DEBUG
;
1124 #line 121 "scan-gram.l"
1125 return PERCENT_DEFINE
;
1129 #line 122 "scan-gram.l"
1130 return PERCENT_DEFINES
;
1134 #line 123 "scan-gram.l"
1135 return PERCENT_DESTRUCTOR
;
1139 #line 124 "scan-gram.l"
1140 return PERCENT_DPREC
;
1144 #line 125 "scan-gram.l"
1145 return PERCENT_ERROR_VERBOSE
;
1149 #line 126 "scan-gram.l"
1150 return PERCENT_EXPECT
;
1154 #line 127 "scan-gram.l"
1155 return PERCENT_FILE_PREFIX
;
1159 #line 128 "scan-gram.l"
1160 return PERCENT_YACC
;
1164 #line 129 "scan-gram.l"
1165 return PERCENT_GLR_PARSER
;
1169 #line 130 "scan-gram.l"
1170 return PERCENT_LEFT
;
1174 #line 131 "scan-gram.l"
1175 return PERCENT_LOCATIONS
;
1179 #line 132 "scan-gram.l"
1180 return PERCENT_MERGE
;
1184 #line 133 "scan-gram.l"
1185 return PERCENT_NAME_PREFIX
;
1189 #line 134 "scan-gram.l"
1190 return PERCENT_NO_LINES
;
1194 #line 135 "scan-gram.l"
1195 return PERCENT_NONASSOC
;
1199 #line 136 "scan-gram.l"
1200 return PERCENT_NTERM
;
1204 #line 137 "scan-gram.l"
1205 return PERCENT_OUTPUT
;
1209 #line 138 "scan-gram.l"
1210 return PERCENT_PARSE_PARAM
;
1214 #line 139 "scan-gram.l"
1215 { rule_length
--; return PERCENT_PREC
; }
1219 #line 140 "scan-gram.l"
1220 return PERCENT_PRINTER
;
1224 #line 141 "scan-gram.l"
1225 return PERCENT_PURE_PARSER
;
1229 #line 142 "scan-gram.l"
1230 return PERCENT_RIGHT
;
1234 #line 143 "scan-gram.l"
1235 return PERCENT_LEX_PARAM
;
1239 #line 144 "scan-gram.l"
1240 return PERCENT_SKELETON
;
1244 #line 145 "scan-gram.l"
1245 return PERCENT_START
;
1249 #line 146 "scan-gram.l"
1250 return PERCENT_TOKEN
;
1254 #line 147 "scan-gram.l"
1255 return PERCENT_TOKEN
;
1259 #line 148 "scan-gram.l"
1260 return PERCENT_TOKEN_TABLE
;
1264 #line 149 "scan-gram.l"
1265 return PERCENT_TYPE
;
1269 #line 150 "scan-gram.l"
1270 return PERCENT_UNION
;
1274 #line 151 "scan-gram.l"
1275 return PERCENT_VERBOSE
;
1279 #line 152 "scan-gram.l"
1280 return PERCENT_YACC
;
1284 #line 154 "scan-gram.l"
1289 #line 155 "scan-gram.l"
1290 { rule_length
= 0; return COLON
; }
1294 #line 156 "scan-gram.l"
1295 { rule_length
= 0; return PIPE
; }
1299 #line 157 "scan-gram.l"
1304 #line 158 "scan-gram.l"
1309 #line 160 "scan-gram.l"
1314 #line 161 "scan-gram.l"
1319 #line 162 "scan-gram.l"
1321 yylval
->symbol
= symbol_get (yytext
, *yylloc
);
1328 #line 168 "scan-gram.l"
1329 yylval
->integer
= strtol (yytext
, 0, 10); return INT
;
1331 /* Characters. We don't check there is only one. */
1334 #line 171 "scan-gram.l"
1335 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1340 #line 174 "scan-gram.l"
1341 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1346 #line 177 "scan-gram.l"
1347 yy_push_state (SC_COMMENT
);
1351 #line 178 "scan-gram.l"
1357 #line 181 "scan-gram.l"
1358 yy_push_state (SC_PROLOGUE
);
1360 /* Code in between braces. */
1363 #line 184 "scan-gram.l"
1364 YY_OBS_GROW
; ++braces_level
; yy_push_state (SC_BRACED_CODE
);
1369 #line 187 "scan-gram.l"
1371 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1373 yylval
->string
= last_string
;
1379 #line 195 "scan-gram.l"
1381 if (++percent_percent_count
== 2)
1382 yy_push_state (SC_EPILOGUE
);
1383 return PERCENT_PERCENT
;
1388 #line 201 "scan-gram.l"
1390 LOCATION_PRINT (stderr
, *yylloc
);
1391 fprintf (stderr
, _(": invalid character: `%c'\n"), *yytext
);
1396 /*------------------------------------------------------------.
1397 | Whatever the start condition (but those which correspond to |
1398 | entity `swallowed' by Bison: SC_ESCAPED_STRING and |
1399 | SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1400 `------------------------------------------------------------*/
1405 #line 217 "scan-gram.l"
1406 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@<:@");
1410 #line 218 "scan-gram.l"
1411 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@:>@");
1414 /*-----------------------------------------------------------.
1415 | Scanning a C comment. The initial `/ *' is already eaten. |
1416 `-----------------------------------------------------------*/
1421 #line 229 "scan-gram.l"
1422 { /* End of the comment. */
1423 if (yy_top_state () == INITIAL
)
1436 #line 241 "scan-gram.l"
1437 if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1441 #line 242 "scan-gram.l"
1442 if (yy_top_state () != INITIAL
) YY_OBS_GROW
; YY_LINES
;
1446 #line 243 "scan-gram.l"
1447 /* Stray `*'. */if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1449 case YY_STATE_EOF(SC_COMMENT
):
1450 #line 245 "scan-gram.l"
1452 LOCATION_PRINT (stderr
, *yylloc
);
1453 fprintf (stderr
, _(": unexpected end of file in a comment\n"));
1458 /*----------------------------------------------------------------.
1459 | Scanning a C string, including its escapes. The initial `"' is |
1461 `----------------------------------------------------------------*/
1466 #line 260 "scan-gram.l"
1468 assert (yy_top_state () == INITIAL
);
1471 yylval
->string
= last_string
;
1479 #line 270 "scan-gram.l"
1484 #line 272 "scan-gram.l"
1485 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1487 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1488 #line 274 "scan-gram.l"
1490 LOCATION_PRINT (stderr
, *yylloc
);
1491 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1492 assert (yy_top_state () == INITIAL
);
1494 yylval
->string
= last_string
;
1500 /*---------------------------------------------------------------.
1501 | Scanning a C character, decoding its escapes. The initial "'" |
1502 | is already eaten. |
1503 `---------------------------------------------------------------*/
1508 #line 292 "scan-gram.l"
1511 assert (yy_top_state () == INITIAL
);
1514 yylval
->symbol
= symbol_get (last_string
, *yylloc
);
1515 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1516 symbol_user_token_number_set (yylval
->symbol
,
1517 (unsigned char) last_string
[1], *yylloc
);
1527 #line 308 "scan-gram.l"
1532 #line 310 "scan-gram.l"
1533 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1535 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1536 #line 312 "scan-gram.l"
1538 LOCATION_PRINT (stderr
, *yylloc
);
1539 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1540 assert (yy_top_state () == INITIAL
);
1542 yylval
->string
= last_string
;
1548 /*----------------------------.
1549 | Decode escaped characters. |
1550 `----------------------------*/
1555 #line 330 "scan-gram.l"
1557 long c
= strtol (yytext
+ 1, 0, 8);
1560 LOCATION_PRINT (stderr
, *yylloc
);
1561 fprintf (stderr
, _(": invalid escape: %s\n"), quote (yytext
));
1565 obstack_1grow (&string_obstack
, c
);
1570 #line 342 "scan-gram.l"
1572 obstack_1grow (&string_obstack
, strtol (yytext
+ 2, 0, 16));
1577 #line 346 "scan-gram.l"
1578 obstack_1grow (&string_obstack
, '\a');
1582 #line 347 "scan-gram.l"
1583 obstack_1grow (&string_obstack
, '\b');
1587 #line 348 "scan-gram.l"
1588 obstack_1grow (&string_obstack
, '\f');
1592 #line 349 "scan-gram.l"
1593 obstack_1grow (&string_obstack
, '\n');
1597 #line 350 "scan-gram.l"
1598 obstack_1grow (&string_obstack
, '\r');
1602 #line 351 "scan-gram.l"
1603 obstack_1grow (&string_obstack
, '\t');
1607 #line 352 "scan-gram.l"
1608 obstack_1grow (&string_obstack
, '\v');
1612 #line 353 "scan-gram.l"
1613 obstack_1grow (&string_obstack
, yytext
[1]);
1617 #line 354 "scan-gram.l"
1619 LOCATION_PRINT (stderr
, *yylloc
);
1620 fprintf (stderr
, _(": unrecognized escape: %s\n"), quote (yytext
));
1624 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1627 #line 360 "scan-gram.l"
1631 /*----------------------------------------------------------.
1632 | Scanning a C character without decoding its escapes. The |
1633 | initial "'" is already eaten. |
1634 `----------------------------------------------------------*/
1639 #line 371 "scan-gram.l"
1642 assert (yy_top_state () != INITIAL
);
1648 #line 377 "scan-gram.l"
1653 #line 378 "scan-gram.l"
1656 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1659 #line 380 "scan-gram.l"
1664 #line 382 "scan-gram.l"
1665 YY_OBS_GROW
; YY_LINES
;
1667 case YY_STATE_EOF(SC_CHARACTER
):
1668 #line 384 "scan-gram.l"
1670 LOCATION_PRINT (stderr
, *yylloc
);
1671 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1672 assert (yy_top_state () != INITIAL
);
1677 /*----------------------------------------------------------------.
1678 | Scanning a C string, without decoding its escapes. The initial |
1679 | `"' is already eaten. |
1680 `----------------------------------------------------------------*/
1685 #line 400 "scan-gram.l"
1687 assert (yy_top_state () != INITIAL
);
1694 #line 406 "scan-gram.l"
1699 #line 407 "scan-gram.l"
1702 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1705 #line 409 "scan-gram.l"
1710 #line 411 "scan-gram.l"
1711 YY_OBS_GROW
; YY_LINES
;
1713 case YY_STATE_EOF(SC_STRING
):
1714 #line 413 "scan-gram.l"
1716 LOCATION_PRINT (stderr
, *yylloc
);
1717 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1718 assert (yy_top_state () != INITIAL
);
1723 /*---------------------------------------------------.
1724 | Strings, comments etc. can be found in user code. |
1725 `---------------------------------------------------*/
1728 /* Characters. We don't check there is only one. */
1731 #line 429 "scan-gram.l"
1732 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1737 #line 432 "scan-gram.l"
1738 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1743 #line 435 "scan-gram.l"
1744 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1748 #line 436 "scan-gram.l"
1754 #line 439 "scan-gram.l"
1758 /*---------------------------------------------------------------.
1759 | Scanning some code in braces (%union and actions). The initial |
1760 | "{" is already eaten. |
1761 `---------------------------------------------------------------*/
1766 #line 450 "scan-gram.l"
1769 if (--braces_level
== 0)
1773 yylval
->string
= last_string
;
1781 #line 462 "scan-gram.l"
1782 YY_OBS_GROW
; braces_level
++;
1786 #line 464 "scan-gram.l"
1787 { handle_dollar (current_braced_code
,
1792 #line 466 "scan-gram.l"
1793 { handle_at (current_braced_code
,
1798 #line 469 "scan-gram.l"
1803 #line 470 "scan-gram.l"
1804 YY_OBS_GROW
; YY_LINES
;
1806 /* A lose $, or /, or etc. */
1809 #line 473 "scan-gram.l"
1812 case YY_STATE_EOF(SC_BRACED_CODE
):
1813 #line 475 "scan-gram.l"
1815 LOCATION_PRINT (stderr
, *yylloc
);
1816 fprintf (stderr
, _(": unexpected end of file in a braced code\n"));
1819 yylval
->string
= last_string
;
1824 /*--------------------------------------------------------------.
1825 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1826 `--------------------------------------------------------------*/
1831 #line 493 "scan-gram.l"
1835 yylval
->string
= last_string
;
1841 #line 500 "scan-gram.l"
1846 #line 501 "scan-gram.l"
1851 #line 502 "scan-gram.l"
1852 YY_OBS_GROW
; YY_LINES
;
1854 case YY_STATE_EOF(SC_PROLOGUE
):
1855 #line 504 "scan-gram.l"
1857 LOCATION_PRINT (stderr
, *yylloc
);
1858 fprintf (stderr
, _(": unexpected end of file in a prologue\n"));
1861 yylval
->string
= last_string
;
1866 /*---------------------------------------------------------------.
1867 | Scanning the epilogue (everything after the second "%%", which |
1868 | has already been eaten. |
1869 `---------------------------------------------------------------*/
1874 #line 522 "scan-gram.l"
1877 case YY_STATE_EOF(SC_EPILOGUE
):
1878 #line 524 "scan-gram.l"
1882 yylval
->string
= last_string
;
1889 #line 533 "scan-gram.l"
1890 YY_FATAL_ERROR( "flex scanner jammed" );
1892 #line 1893 "scan-gram.c"
1893 case YY_STATE_EOF(INITIAL
):
1896 case YY_END_OF_BUFFER
:
1898 /* Amount of text matched not including the EOB char. */
1899 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
1901 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1902 *yy_cp
= yy_hold_char
;
1903 YY_RESTORE_YY_MORE_OFFSET
1905 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1907 /* We're scanning a new file or input source. It's
1908 * possible that this happened because the user
1909 * just pointed yyin at a new source and called
1910 * yylex(). If so, then we have to assure
1911 * consistency between yy_current_buffer and our
1912 * globals. Here is the right place to do so, because
1913 * this is the first action (other than possibly a
1914 * back-up) that will match for the new input source.
1916 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1917 yy_current_buffer
->yy_input_file
= yyin
;
1918 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1921 /* Note that here we test for yy_c_buf_p "<=" to the position
1922 * of the first EOB in the buffer, since yy_c_buf_p will
1923 * already have been incremented past the NUL character
1924 * (since all states make transitions on EOB to the
1925 * end-of-buffer state). Contrast this with the test
1928 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1929 { /* This was really a NUL. */
1930 yy_state_type yy_next_state
;
1932 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1934 yy_current_state
= yy_get_previous_state();
1936 /* Okay, we're now positioned to make the NUL
1937 * transition. We couldn't have
1938 * yy_get_previous_state() go ahead and do it
1939 * for us because it doesn't know how to deal
1940 * with the possibility of jamming (and we don't
1941 * want to build jamming into it because then it
1942 * will run more slowly).
1945 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1947 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1949 if ( yy_next_state
)
1951 /* Consume the NUL. */
1952 yy_cp
= ++yy_c_buf_p
;
1953 yy_current_state
= yy_next_state
;
1960 goto yy_find_action
;
1964 else switch ( yy_get_next_buffer() )
1966 case EOB_ACT_END_OF_FILE
:
1968 yy_did_buffer_switch_on_eof
= 0;
1972 /* Note: because we've taken care in
1973 * yy_get_next_buffer() to have set up
1974 * yytext, we can now set up
1975 * yy_c_buf_p so that if some total
1976 * hoser (like flex itself) wants to
1977 * call the scanner after we return the
1978 * YY_NULL, it'll still work - another
1979 * YY_NULL will get returned.
1981 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
1983 yy_act
= YY_STATE_EOF(YY_START
);
1989 if ( ! yy_did_buffer_switch_on_eof
)
1995 case EOB_ACT_CONTINUE_SCAN
:
1997 yytext_ptr
+ yy_amount_of_matched_text
;
1999 yy_current_state
= yy_get_previous_state();
2002 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2005 case EOB_ACT_LAST_MATCH
:
2007 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
2009 yy_current_state
= yy_get_previous_state();
2012 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2013 goto yy_find_action
;
2020 "fatal flex scanner internal error--no action found" );
2021 } /* end of action switch */
2022 } /* end of scanning one token */
2023 } /* end of yylex */
2026 /* yy_get_next_buffer - try to read in a new buffer
2028 * Returns a code representing an action:
2029 * EOB_ACT_LAST_MATCH -
2030 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2031 * EOB_ACT_END_OF_FILE - end of file
2034 static int yy_get_next_buffer()
2036 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2037 register char *source
= yytext_ptr
;
2038 register int number_to_move
, i
;
2041 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2043 "fatal flex scanner internal error--end of buffer missed" );
2045 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2046 { /* Don't try to fill the buffer, so this is an EOF. */
2047 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2049 /* We matched a single character, the EOB, so
2050 * treat this as a final EOF.
2052 return EOB_ACT_END_OF_FILE
;
2057 /* We matched some text prior to the EOB, first
2060 return EOB_ACT_LAST_MATCH
;
2064 /* Try to read more data. */
2066 /* First move last chars to start of buffer. */
2067 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2069 for ( i
= 0; i
< number_to_move
; ++i
)
2070 *(dest
++) = *(source
++);
2072 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2073 /* don't do the read, it's not guaranteed to return an EOF,
2076 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2081 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2083 while ( num_to_read
<= 0 )
2084 { /* Not enough room in the buffer - grow it. */
2085 #ifdef YY_USES_REJECT
2087 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2090 /* just a shorter name for the current buffer */
2091 YY_BUFFER_STATE b
= yy_current_buffer
;
2093 int yy_c_buf_p_offset
=
2094 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2096 if ( b
->yy_is_our_buffer
)
2098 int new_size
= b
->yy_buf_size
* 2;
2100 if ( new_size
<= 0 )
2101 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2103 b
->yy_buf_size
*= 2;
2105 b
->yy_ch_buf
= (char *)
2106 /* Include room in for 2 EOB chars. */
2107 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2108 b
->yy_buf_size
+ 2 );
2111 /* Can't grow it, we don't own it. */
2114 if ( ! b
->yy_ch_buf
)
2116 "fatal error - scanner input buffer overflow" );
2118 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2120 num_to_read
= yy_current_buffer
->yy_buf_size
-
2125 if ( num_to_read
> YY_READ_BUF_SIZE
)
2126 num_to_read
= YY_READ_BUF_SIZE
;
2128 /* Read in more data. */
2129 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2130 yy_n_chars
, num_to_read
);
2132 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2135 if ( yy_n_chars
== 0 )
2137 if ( number_to_move
== YY_MORE_ADJ
)
2139 ret_val
= EOB_ACT_END_OF_FILE
;
2145 ret_val
= EOB_ACT_LAST_MATCH
;
2146 yy_current_buffer
->yy_buffer_status
=
2147 YY_BUFFER_EOF_PENDING
;
2152 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2154 yy_n_chars
+= number_to_move
;
2155 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2156 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2158 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2164 /* yy_get_previous_state - get the state just before the EOB char was reached */
2166 static yy_state_type
yy_get_previous_state()
2168 register yy_state_type yy_current_state
;
2169 register char *yy_cp
;
2171 yy_current_state
= yy_start
;
2173 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2175 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2176 if ( yy_accept
[yy_current_state
] )
2178 yy_last_accepting_state
= yy_current_state
;
2179 yy_last_accepting_cpos
= yy_cp
;
2181 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2183 yy_current_state
= (int) yy_def
[yy_current_state
];
2184 if ( yy_current_state
>= 398 )
2185 yy_c
= yy_meta
[(unsigned int) yy_c
];
2187 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2190 return yy_current_state
;
2194 /* yy_try_NUL_trans - try to make a transition on the NUL character
2197 * next_state = yy_try_NUL_trans( current_state );
2200 #ifdef YY_USE_PROTOS
2201 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2203 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2204 yy_state_type yy_current_state
;
2207 register int yy_is_jam
;
2208 register char *yy_cp
= yy_c_buf_p
;
2210 register YY_CHAR yy_c
= 1;
2211 if ( yy_accept
[yy_current_state
] )
2213 yy_last_accepting_state
= yy_current_state
;
2214 yy_last_accepting_cpos
= yy_cp
;
2216 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2218 yy_current_state
= (int) yy_def
[yy_current_state
];
2219 if ( yy_current_state
>= 398 )
2220 yy_c
= yy_meta
[(unsigned int) yy_c
];
2222 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2223 yy_is_jam
= (yy_current_state
== 397);
2225 return yy_is_jam
? 0 : yy_current_state
;
2230 #ifdef YY_USE_PROTOS
2231 static void yyunput( int c
, register char *yy_bp
)
2233 static void yyunput( c
, yy_bp
)
2235 register char *yy_bp
;
2238 register char *yy_cp
= yy_c_buf_p
;
2240 /* undo effects of setting up yytext */
2241 *yy_cp
= yy_hold_char
;
2243 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2244 { /* need to shift things up to make room */
2245 /* +2 for EOB chars. */
2246 register int number_to_move
= yy_n_chars
+ 2;
2247 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2248 yy_current_buffer
->yy_buf_size
+ 2];
2249 register char *source
=
2250 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2252 while ( source
> yy_current_buffer
->yy_ch_buf
)
2253 *--dest
= *--source
;
2255 yy_cp
+= (int) (dest
- source
);
2256 yy_bp
+= (int) (dest
- source
);
2257 yy_current_buffer
->yy_n_chars
=
2258 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2260 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2261 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2264 *--yy_cp
= (char) c
;
2268 yy_hold_char
= *yy_cp
;
2271 #endif /* ifndef YY_NO_UNPUT */
2275 static int yyinput()
2282 *yy_c_buf_p
= yy_hold_char
;
2284 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2286 /* yy_c_buf_p now points to the character we want to return.
2287 * If this occurs *before* the EOB characters, then it's a
2288 * valid NUL; if not, then we've hit the end of the buffer.
2290 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2291 /* This was really a NUL. */
2295 { /* need more input */
2296 int offset
= yy_c_buf_p
- yytext_ptr
;
2299 switch ( yy_get_next_buffer() )
2301 case EOB_ACT_LAST_MATCH
:
2302 /* This happens because yy_g_n_b()
2303 * sees that we've accumulated a
2304 * token and flags that we need to
2305 * try matching the token before
2306 * proceeding. But for input(),
2307 * there's no matching to consider.
2308 * So convert the EOB_ACT_LAST_MATCH
2309 * to EOB_ACT_END_OF_FILE.
2312 /* Reset buffer status. */
2317 case EOB_ACT_END_OF_FILE
:
2322 if ( ! yy_did_buffer_switch_on_eof
)
2331 case EOB_ACT_CONTINUE_SCAN
:
2332 yy_c_buf_p
= yytext_ptr
+ offset
;
2338 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2339 *yy_c_buf_p
= '\0'; /* preserve yytext */
2340 yy_hold_char
= *++yy_c_buf_p
;
2347 #ifdef YY_USE_PROTOS
2348 void yyrestart( FILE *input_file
)
2350 void yyrestart( input_file
)
2354 if ( ! yy_current_buffer
)
2355 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2357 yy_init_buffer( yy_current_buffer
, input_file
);
2358 yy_load_buffer_state();
2362 #ifdef YY_USE_PROTOS
2363 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2365 void yy_switch_to_buffer( new_buffer
)
2366 YY_BUFFER_STATE new_buffer
;
2369 if ( yy_current_buffer
== new_buffer
)
2372 if ( yy_current_buffer
)
2374 /* Flush out information for old buffer. */
2375 *yy_c_buf_p
= yy_hold_char
;
2376 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2377 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2380 yy_current_buffer
= new_buffer
;
2381 yy_load_buffer_state();
2383 /* We don't actually know whether we did this switch during
2384 * EOF (yywrap()) processing, but the only time this flag
2385 * is looked at is after yywrap() is called, so it's safe
2386 * to go ahead and always set it.
2388 yy_did_buffer_switch_on_eof
= 1;
2392 #ifdef YY_USE_PROTOS
2393 void yy_load_buffer_state( void )
2395 void yy_load_buffer_state()
2398 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2399 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2400 yyin
= yy_current_buffer
->yy_input_file
;
2401 yy_hold_char
= *yy_c_buf_p
;
2405 #ifdef YY_USE_PROTOS
2406 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2408 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2415 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2417 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2419 b
->yy_buf_size
= size
;
2421 /* yy_ch_buf has to be 2 characters longer than the size given because
2422 * we need to put in 2 end-of-buffer characters.
2424 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2425 if ( ! b
->yy_ch_buf
)
2426 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2428 b
->yy_is_our_buffer
= 1;
2430 yy_init_buffer( b
, file
);
2436 #ifdef YY_USE_PROTOS
2437 void yy_delete_buffer( YY_BUFFER_STATE b
)
2439 void yy_delete_buffer( b
)
2446 if ( b
== yy_current_buffer
)
2447 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2449 if ( b
->yy_is_our_buffer
)
2450 yy_flex_free( (void *) b
->yy_ch_buf
);
2452 yy_flex_free( (void *) b
);
2456 #ifndef YY_ALWAYS_INTERACTIVE
2457 #ifndef YY_NEVER_INTERACTIVE
2458 extern int isatty
YY_PROTO(( int ));
2462 #ifdef YY_USE_PROTOS
2463 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2465 void yy_init_buffer( b
, file
)
2472 yy_flush_buffer( b
);
2474 b
->yy_input_file
= file
;
2475 b
->yy_fill_buffer
= 1;
2477 #if YY_ALWAYS_INTERACTIVE
2478 b
->yy_is_interactive
= 1;
2480 #if YY_NEVER_INTERACTIVE
2481 b
->yy_is_interactive
= 0;
2483 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2489 #ifdef YY_USE_PROTOS
2490 void yy_flush_buffer( YY_BUFFER_STATE b
)
2492 void yy_flush_buffer( b
)
2502 /* We always need two end-of-buffer characters. The first causes
2503 * a transition to the end-of-buffer state. The second causes
2504 * a jam in that state.
2506 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2507 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2509 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2512 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2514 if ( b
== yy_current_buffer
)
2515 yy_load_buffer_state();
2519 #ifndef YY_NO_SCAN_BUFFER
2520 #ifdef YY_USE_PROTOS
2521 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2523 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2531 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2532 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2533 /* They forgot to leave room for the EOB's. */
2536 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2538 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2540 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2541 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2542 b
->yy_is_our_buffer
= 0;
2543 b
->yy_input_file
= 0;
2544 b
->yy_n_chars
= b
->yy_buf_size
;
2545 b
->yy_is_interactive
= 0;
2547 b
->yy_fill_buffer
= 0;
2548 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2550 yy_switch_to_buffer( b
);
2557 #ifndef YY_NO_SCAN_STRING
2558 #ifdef YY_USE_PROTOS
2559 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2561 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2562 yyconst
char *yy_str
;
2566 for ( len
= 0; yy_str
[len
]; ++len
)
2569 return yy_scan_bytes( yy_str
, len
);
2574 #ifndef YY_NO_SCAN_BYTES
2575 #ifdef YY_USE_PROTOS
2576 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2578 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2579 yyconst
char *bytes
;
2588 /* Get memory for full buffer, including space for trailing EOB's. */
2590 buf
= (char *) yy_flex_alloc( n
);
2592 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2594 for ( i
= 0; i
< len
; ++i
)
2597 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2599 b
= yy_scan_buffer( buf
, n
);
2601 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2603 /* It's okay to grow etc. this buffer, and we should throw it
2604 * away when we're done.
2606 b
->yy_is_our_buffer
= 1;
2613 #ifndef YY_NO_PUSH_STATE
2614 #ifdef YY_USE_PROTOS
2615 static void yy_push_state( int new_state
)
2617 static void yy_push_state( new_state
)
2621 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2625 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2626 new_size
= yy_start_stack_depth
* sizeof( int );
2628 if ( ! yy_start_stack
)
2629 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2632 yy_start_stack
= (int *) yy_flex_realloc(
2633 (void *) yy_start_stack
, new_size
);
2635 if ( ! yy_start_stack
)
2637 "out of memory expanding start-condition stack" );
2640 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2647 #ifndef YY_NO_POP_STATE
2648 static void yy_pop_state()
2650 if ( --yy_start_stack_ptr
< 0 )
2651 YY_FATAL_ERROR( "start-condition stack underflow" );
2653 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2658 #ifndef YY_NO_TOP_STATE
2659 static int yy_top_state()
2661 return yy_start_stack
[yy_start_stack_ptr
- 1];
2665 #ifndef YY_EXIT_FAILURE
2666 #define YY_EXIT_FAILURE 2
2669 #ifdef YY_USE_PROTOS
2670 static void yy_fatal_error( yyconst
char msg
[] )
2672 static void yy_fatal_error( msg
)
2676 (void) fprintf( stderr
, "%s\n", msg
);
2677 exit( YY_EXIT_FAILURE
);
2682 /* Redefine yyless() so it works in section 3 code. */
2688 /* Undo effects of setting up yytext. */ \
2689 yytext[yyleng] = yy_hold_char; \
2690 yy_c_buf_p = yytext + n; \
2691 yy_hold_char = *yy_c_buf_p; \
2692 *yy_c_buf_p = '\0'; \
2698 /* Internal utility routines. */
2701 #ifdef YY_USE_PROTOS
2702 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2704 static void yy_flex_strncpy( s1
, s2
, n
)
2711 for ( i
= 0; i
< n
; ++i
)
2716 #ifdef YY_NEED_STRLEN
2717 #ifdef YY_USE_PROTOS
2718 static int yy_flex_strlen( yyconst
char *s
)
2720 static int yy_flex_strlen( s
)
2725 for ( n
= 0; s
[n
]; ++n
)
2733 #ifdef YY_USE_PROTOS
2734 static void *yy_flex_alloc( yy_size_t size
)
2736 static void *yy_flex_alloc( size
)
2740 return (void *) malloc( size
);
2743 #ifdef YY_USE_PROTOS
2744 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2746 static void *yy_flex_realloc( ptr
, size
)
2751 /* The cast to (char *) in the following accommodates both
2752 * implementations that use char* generic pointers, and those
2753 * that use void* generic pointers. It works with the latter
2754 * because both ANSI C and C++ allow castless assignment from
2755 * any pointer type to void*, and deal with argument conversions
2756 * as though doing an assignment.
2758 return (void *) realloc( (char *) ptr
, size
);
2761 #ifdef YY_USE_PROTOS
2762 static void yy_flex_free( void *ptr
)
2764 static void yy_flex_free( ptr
)
2778 #line 533 "scan-gram.l"
2781 /*------------------------------------------------------------------.
2782 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2784 | Possible inputs: $[<TYPENAME>]($|integer) |
2786 | Output to the STRING_OBSTACK a reference to this semantic value. |
2787 `------------------------------------------------------------------*/
2790 handle_action_dollar (char *text
, location_t location
)
2792 const char *type_name
= NULL
;
2793 char *cp
= text
+ 1;
2795 /* Get the type name if explicit. */
2808 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2809 if (!type_name
&& typed
)
2810 complain_at (location
, _("$$ of `%s' has no declared type"),
2811 current_rule
->sym
->tag
);
2814 obstack_fgrow1 (&string_obstack
,
2815 "]b4_lhs_value([%s])[", type_name
);
2817 else if (('0' <= *cp
&& *cp
<= '9') || *cp
== '-')
2819 int n
= strtol (cp
, &cp
, 10);
2821 if (n
> rule_length
)
2822 complain_at (location
, _("invalid value: %s%d"), "$", n
);
2825 if (!type_name
&& n
> 0)
2826 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
2828 if (!type_name
&& typed
)
2829 complain_at (location
, _("$%d of `%s' has no declared type"),
2830 n
, current_rule
->sym
->tag
);
2833 obstack_fgrow3 (&string_obstack
,
2834 "]b4_rhs_value([%d], [%d], [%s])[",
2835 rule_length
, n
, type_name
);
2840 complain_at (location
, _("%s is invalid"), quote (text
));
2845 /*---------------------------------------------------------------.
2846 | TEXT is expexted tp be $$ in some code associated to a symbol: |
2847 | destructor or printer. |
2848 `---------------------------------------------------------------*/
2851 handle_symbol_code_dollar (char *text
, location_t location
)
2853 char *cp
= text
+ 1;
2855 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
2857 complain_at (location
, _("%s is invalid"), quote (text
));
2861 /*-----------------------------------------------------------------.
2862 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2863 | depending upon CODE_KIND. |
2864 `-----------------------------------------------------------------*/
2867 handle_dollar (braced_code_t braced_code_kind
,
2868 char *text
, location_t location
)
2870 switch (braced_code_kind
)
2872 case action_braced_code
:
2873 handle_action_dollar (text
, location
);
2876 case destructor_braced_code
:
2877 case printer_braced_code
:
2878 handle_symbol_code_dollar (text
, location
);
2884 /*------------------------------------------------------.
2885 | TEXT is a location token (i.e., a `@...'). Output to |
2886 | STRING_OBSTACK a reference to this location. |
2887 `------------------------------------------------------*/
2890 handle_action_at (char *text
, location_t location
)
2892 char *cp
= text
+ 1;
2897 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
2899 else if (('0' <= *cp
&& *cp
<= '9') || *cp
== '-')
2901 int n
= strtol (cp
, &cp
, 10);
2903 if (n
> rule_length
)
2904 complain_at (location
, _("invalid value: %s%d"), "@", n
);
2906 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
2911 complain_at (location
, _("%s is invalid"), quote (text
));
2916 /*---------------------------------------------------------------.
2917 | TEXT is expexted tp be @$ in some code associated to a symbol: |
2918 | destructor or printer. |
2919 `---------------------------------------------------------------*/
2922 handle_symbol_code_at (char *text
, location_t location
)
2924 char *cp
= text
+ 1;
2926 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
2928 complain_at (location
, _("%s is invalid"), quote (text
));
2932 /*-------------------------------------------------------------------.
2933 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
2935 `-------------------------------------------------------------------*/
2938 handle_at (braced_code_t braced_code_kind
,
2939 char *text
, location_t location
)
2941 switch (braced_code_kind
)
2943 case action_braced_code
:
2944 handle_action_at (text
, location
);
2947 case destructor_braced_code
:
2948 case printer_braced_code
:
2949 handle_symbol_code_at (text
, location
);
2955 /*-------------------------.
2956 | Initialize the scanner. |
2957 `-------------------------*/
2960 scanner_initialize (void)
2962 obstack_init (&string_obstack
);
2966 /*-----------------------------------------------.
2967 | Free all the memory allocated to the scanner. |
2968 `-----------------------------------------------*/
2973 obstack_free (&string_obstack
, 0);
2974 /* Reclaim Flex's buffers. */
2975 yy_delete_buffer (YY_CURRENT_BUFFER
);