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 102
311 #define YY_END_OF_BUFFER 103
312 static yyconst
short int yy_accept
[391] =
314 0, 0, 0, 0, 59, 59, 0, 0, 85, 85,
315 80, 80, 0, 0, 0, 0, 0, 0, 0, 0,
316 0, 0, 103, 51, 40, 40, 44, 51, 43, 38,
317 41, 51, 42, 36, 39, 51, 35, 48, 37, 57,
318 57, 52, 53, 59, 58, 59, 55, 55, 83, 82,
319 86, 78, 77, 81, 61, 60, 76, 63, 62, 96,
320 96, 88, 97, 87, 91, 97, 52, 53, 93, 92,
321 99, 88, 100, 87, 91, 101, 88, 87, 91, 40,
322 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,
323 0, 0, 0, 0, 0, 0, 0, 47, 41, 45,
325 46, 42, 0, 57, 56, 0, 59, 59, 59, 59,
326 55, 54, 83, 84, 84, 84, 84, 78, 79, 79,
327 79, 79, 61, 75, 73, 64, 75, 66, 67, 68,
328 69, 70, 71, 75, 72, 75, 63, 96, 94, 0,
329 94, 0, 89, 90, 0, 95, 0, 95, 99, 98,
330 101, 89, 90, 101, 0, 0, 0, 0, 0, 0,
331 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
333 46, 49, 0, 0, 0, 85, 0, 0, 0, 0,
334 80, 0, 0, 0, 64, 0, 0, 65, 0, 0,
336 0, 101, 101, 0, 0, 0, 0, 0, 0, 0,
337 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
338 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
339 0, 0, 0, 0, 0, 64, 0, 0, 0, 0,
340 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
341 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
342 0, 0, 0, 0, 0, 28, 0, 31, 0, 0,
343 34, 0, 0, 0, 2, 0, 0, 6, 0, 0,
344 0, 0, 0, 0, 0, 14, 0, 0, 0, 18,
345 0, 0, 0, 0, 24, 0, 27, 29, 32, 0,
347 0, 74, 1, 3, 0, 0, 8, 0, 0, 0,
348 0, 0, 0, 0, 0, 19, 0, 0, 0, 0,
349 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
350 0, 0, 0, 0, 22, 0, 0, 0, 33, 0,
351 0, 0, 0, 0, 0, 0, 0, 16, 17, 0,
352 0, 26, 0, 0, 0, 0, 0, 0, 25, 13,
353 0, 0, 0, 0, 5, 0, 0, 0, 11, 0,
354 0, 0, 0, 0, 9, 0, 15, 20, 23, 30,
355 0, 0, 7, 0, 0, 0, 0, 0, 10, 0
358 static yyconst
int yy_ec
[256] =
360 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
361 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363 1, 2, 1, 4, 1, 5, 6, 1, 7, 1,
364 1, 8, 1, 9, 10, 11, 12, 13, 13, 13,
365 13, 13, 13, 13, 13, 14, 14, 15, 16, 17,
366 18, 19, 20, 21, 22, 22, 22, 22, 22, 22,
367 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
368 11, 11, 11, 11, 23, 11, 11, 11, 11, 11,
369 24, 25, 26, 1, 27, 1, 28, 29, 30, 31,
371 32, 33, 34, 35, 36, 11, 37, 38, 39, 40,
372 41, 42, 11, 43, 44, 45, 46, 47, 11, 48,
373 49, 11, 50, 51, 52, 1, 1, 1, 1, 1,
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 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,
382 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383 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,
390 static yyconst
int yy_meta
[54] =
392 1, 1, 2, 3, 4, 5, 6, 7, 1, 1,
393 8, 9, 10, 10, 1, 1, 1, 1, 11, 1,
394 4, 10, 8, 12, 13, 12, 8, 10, 10, 10,
395 10, 10, 10, 8, 8, 8, 8, 8, 8, 8,
396 8, 8, 8, 8, 8, 8, 8, 8, 8, 4,
400 static yyconst
short int yy_base
[427] =
402 0, 0, 46, 47, 53, 56, 802, 801, 59, 62,
403 50, 82, 65, 87, 85, 86, 110, 160, 92, 117,
404 121, 128, 808, 811, 58, 62, 811, 207, 811, 811,
405 0, 50, 54, 811, 811, 0, 811, 811, 811, 0,
406 114, 811, 811, 782, 811, 117, 0, 794, 0, 811,
407 146, 0, 811, 148, 0, 811, 254, 0, 811, 0,
408 0, 811, 165, 811, 149, 175, 811, 811, 811, 811,
409 0, 811, 753, 811, 175, 0, 0, 0, 182, 92,
410 811, 768, 95, 54, 767, 764, 68, 769, 163, 754,
411 110, 763, 121, 127, 758, 765, 768, 811, 0, 811,
413 0, 179, 776, 0, 811, 193, 769, 195, 199, 768,
414 0, 811, 0, 811, 203, 767, 212, 0, 811, 214,
415 766, 216, 0, 811, 811, 777, 0, 811, 811, 811,
416 811, 811, 811, 0, 811, 0, 0, 0, 811, 208,
417 212, 0, 811, 811, 225, 811, 216, 218, 0, 811,
418 0, 0, 0, 231, 749, 226, 745, 744, 744, 161,
419 742, 227, 754, 740, 743, 253, 749, 735, 736, 69,
420 735, 743, 744, 747, 731, 736, 730, 735, 727, 739,
421 0, 811, 240, 253, 266, 743, 269, 282, 742, 286,
422 741, 288, 293, 740, 751, 0, 0, 0, 744, 301,
424 297, 304, 300, 734, 715, 724, 714, 726, 716, 724,
425 723, 722, 743, 707, 741, 722, 715, 716, 709, 718,
426 702, 702, 699, 712, 701, 708, 704, 700, 694, 697,
427 703, 702, 692, 703, 701, 811, 0, 0, 305, 687,
428 695, 688, 684, 696, 682, 694, 713, 691, 679, 811,
429 678, 674, 686, 254, 681, 672, 676, 668, 681, 811,
430 667, 301, 666, 678, 664, 811, 668, 811, 667, 665,
431 811, 0, 0, 656, 811, 672, 657, 811, 303, 657,
432 659, 304, 672, 671, 662, 811, 655, 656, 651, 811,
433 649, 683, 660, 649, 811, 645, 811, 306, 811, 645,
435 0, 811, 811, 644, 657, 639, 811, 642, 643, 640,
436 639, 640, 637, 647, 637, 811, 635, 633, 647, 633,
437 628, 640, 811, 626, 638, 635, 612, 601, 614, 589,
438 594, 579, 592, 592, 811, 573, 573, 582, 811, 567,
439 564, 565, 525, 534, 510, 498, 489, 811, 811, 470,
440 461, 811, 466, 449, 458, 442, 427, 423, 811, 811,
441 296, 301, 295, 288, 811, 283, 275, 275, 811, 272,
442 259, 249, 254, 232, 811, 228, 811, 811, 811, 811,
443 234, 307, 811, 229, 208, 199, 203, 179, 811, 811,
444 334, 347, 360, 373, 386, 399, 412, 425, 438, 451,
446 457, 467, 480, 493, 506, 519, 530, 543, 554, 567,
447 579, 592, 604, 617, 630, 643, 201, 193, 167, 656,
448 159, 145, 136, 134, 120, 93
451 static yyconst
short int yy_def
[427] =
453 390, 1, 391, 391, 392, 392, 393, 393, 394, 394,
454 395, 395, 396, 396, 397, 397, 398, 398, 399, 399,
455 400, 400, 390, 390, 390, 390, 390, 390, 390, 390,
456 401, 390, 390, 390, 390, 402, 390, 390, 390, 403,
457 390, 390, 390, 404, 390, 404, 405, 390, 406, 390,
458 407, 408, 390, 409, 410, 390, 411, 412, 390, 413,
459 413, 390, 390, 390, 390, 390, 390, 390, 390, 390,
460 414, 390, 390, 390, 390, 415, 415, 415, 415, 390,
461 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
462 390, 390, 390, 390, 390, 390, 390, 390, 401, 390,
464 416, 390, 402, 403, 390, 390, 404, 404, 404, 404,
465 405, 390, 406, 390, 390, 390, 390, 408, 390, 390,
466 390, 390, 410, 390, 390, 390, 417, 390, 390, 390,
467 390, 390, 390, 418, 390, 419, 412, 413, 390, 390,
468 390, 420, 390, 390, 390, 390, 390, 390, 414, 390,
469 415, 415, 415, 415, 390, 390, 390, 390, 390, 390,
470 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
471 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
472 416, 390, 390, 390, 390, 390, 390, 390, 407, 390,
473 390, 390, 390, 409, 390, 421, 422, 419, 420, 390,
475 390, 415, 415, 390, 390, 390, 390, 390, 390, 390,
476 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
477 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
478 390, 390, 390, 390, 390, 390, 423, 424, 390, 390,
479 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
480 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
481 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
482 390, 425, 426, 390, 390, 390, 390, 390, 390, 390,
483 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
484 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
486 418, 390, 390, 390, 390, 390, 390, 390, 390, 390,
487 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
488 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
489 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
490 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
491 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
492 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
493 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
494 390, 390, 390, 390, 390, 390, 390, 390, 390, 0,
495 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
497 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
498 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
499 390, 390, 390, 390, 390, 390
502 static yyconst
short int yy_nxt
[865] =
504 24, 25, 26, 27, 24, 28, 29, 24, 30, 24,
505 31, 32, 33, 33, 34, 35, 36, 37, 24, 24,
506 24, 31, 31, 24, 24, 24, 31, 31, 31, 31,
507 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
508 31, 31, 31, 31, 31, 31, 31, 31, 31, 38,
509 39, 24, 24, 41, 41, 45, 53, 100, 45, 80,
510 80, 101, 50, 80, 80, 50, 102, 102, 56, 42,
511 42, 43, 43, 42, 54, 43, 42, 46, 43, 42,
512 46, 43, 42, 51, 43, 42, 51, 43, 53, 57,
513 56, 59, 59, 80, 80, 72, 158, 73, 74, 162,
515 224, 159, 302, 75, 225, 42, 54, 43, 163, 57,
516 57, 57, 61, 62, 63, 42, 64, 43, 109, 110,
517 72, 65, 73, 74, 77, 105, 156, 78, 75, 301,
518 66, 77, 79, 67, 78, 68, 157, 169, 106, 79,
519 42, 108, 43, 273, 42, 272, 43, 115, 116, 120,
520 121, 42, 170, 43, 238, 171, 143, 173, 175, 69,
521 144, 70, 61, 62, 63, 174, 64, 176, 237, 139,
522 117, 65, 122, 145, 140, 177, 198, 141, 141, 146,
523 66, 142, 143, 67, 147, 68, 144, 148, 148, 152,
524 165, 102, 102, 153, 183, 184, 109, 110, 211, 145,
526 109, 110, 197, 166, 185, 186, 154, 167, 212, 69,
527 196, 70, 81, 188, 189, 190, 191, 193, 194, 108,
528 141, 141, 389, 108, 141, 141, 200, 201, 148, 148,
529 148, 148, 202, 203, 388, 82, 387, 83, 84, 85,
530 86, 183, 184, 386, 87, 88, 89, 90, 91, 92,
531 93, 94, 95, 96, 205, 97, 98, 125, 206, 214,
532 125, 385, 219, 287, 105, 383, 126, 185, 186, 207,
533 185, 186, 382, 125, 215, 381, 127, 106, 125, 219,
534 287, 128, 129, 188, 189, 380, 130, 190, 191, 190,
535 191, 379, 220, 131, 193, 194, 132, 378, 133, 134,
537 135, 136, 200, 201, 143, 202, 203, 152, 144, 139,
538 294, 153, 306, 309, 140, 321, 384, 141, 141, 377,
539 376, 145, 375, 374, 154, 373, 372, 294, 371, 306,
540 309, 370, 321, 384, 40, 40, 40, 40, 40, 40,
541 40, 40, 40, 40, 40, 40, 40, 44, 44, 44,
542 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
543 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
544 47, 47, 47, 49, 49, 49, 49, 49, 49, 49,
545 49, 49, 49, 49, 49, 49, 52, 52, 52, 52,
546 52, 52, 52, 52, 52, 52, 52, 52, 52, 55,
548 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
549 55, 55, 58, 58, 58, 58, 58, 58, 58, 58,
550 58, 58, 58, 58, 58, 60, 60, 60, 60, 60,
551 60, 60, 60, 60, 60, 60, 60, 60, 71, 71,
552 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
553 71, 76, 76, 76, 76, 76, 76, 76, 76, 76,
554 76, 76, 76, 76, 99, 369, 99, 103, 368, 103,
555 103, 103, 103, 103, 103, 103, 103, 367, 103, 103,
556 104, 104, 104, 104, 104, 104, 366, 104, 104, 104,
557 104, 365, 104, 107, 364, 107, 107, 107, 107, 107,
559 107, 107, 107, 107, 363, 107, 111, 111, 111, 111,
560 111, 111, 362, 111, 111, 111, 111, 111, 111, 113,
561 113, 361, 113, 113, 113, 113, 113, 113, 113, 113,
562 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
563 114, 360, 114, 118, 118, 118, 118, 118, 359, 118,
564 118, 118, 118, 118, 119, 119, 119, 119, 119, 119,
565 119, 119, 119, 119, 119, 358, 119, 123, 123, 357,
566 123, 123, 123, 123, 123, 123, 123, 123, 123, 124,
567 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
568 124, 124, 137, 137, 137, 137, 137, 356, 137, 137,
570 137, 137, 137, 137, 138, 138, 355, 354, 138, 353,
571 138, 138, 352, 138, 138, 351, 138, 149, 149, 350,
572 149, 349, 348, 149, 149, 347, 149, 149, 346, 149,
573 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
574 151, 345, 151, 181, 344, 181, 181, 181, 181, 181,
575 181, 181, 181, 181, 181, 181, 199, 343, 199, 199,
576 199, 199, 199, 199, 199, 199, 342, 199, 199, 341,
577 340, 339, 338, 337, 336, 335, 334, 333, 332, 331,
578 330, 329, 328, 327, 326, 325, 324, 323, 322, 320,
579 319, 318, 317, 316, 315, 314, 313, 312, 311, 310,
581 308, 307, 305, 304, 303, 300, 299, 298, 297, 296,
582 295, 293, 292, 291, 290, 289, 288, 286, 285, 284,
583 283, 282, 281, 280, 279, 278, 277, 276, 275, 274,
584 271, 270, 269, 268, 267, 266, 265, 264, 263, 262,
585 261, 260, 259, 258, 257, 256, 255, 254, 253, 252,
586 251, 250, 249, 248, 247, 246, 245, 244, 243, 242,
587 241, 240, 239, 236, 122, 192, 117, 187, 235, 234,
588 233, 232, 231, 230, 229, 228, 227, 226, 223, 222,
589 221, 218, 217, 216, 213, 210, 209, 208, 204, 195,
590 192, 187, 108, 108, 182, 180, 179, 178, 172, 168,
592 164, 161, 160, 155, 150, 112, 108, 390, 48, 48,
593 23, 390, 390, 390, 390, 390, 390, 390, 390, 390,
594 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
595 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
596 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
597 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
601 static yyconst
short int yy_chk
[865] =
603 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
604 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
605 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
606 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
607 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
608 1, 1, 1, 3, 4, 5, 11, 32, 6, 25,
609 25, 32, 9, 26, 26, 10, 33, 33, 13, 3,
610 4, 3, 4, 11, 11, 11, 5, 5, 5, 6,
611 6, 6, 9, 9, 9, 10, 10, 10, 12, 13,
612 14, 15, 16, 80, 80, 19, 84, 19, 19, 87,
614 170, 84, 426, 19, 170, 12, 12, 12, 87, 15,
615 16, 14, 17, 17, 17, 19, 17, 19, 46, 46,
616 20, 17, 20, 20, 21, 41, 83, 21, 20, 425,
617 17, 22, 21, 17, 22, 17, 83, 91, 41, 22,
618 20, 46, 20, 424, 21, 423, 21, 51, 51, 54,
619 54, 22, 91, 22, 422, 91, 65, 93, 94, 17,
620 65, 17, 18, 18, 18, 93, 18, 94, 421, 63,
621 51, 18, 54, 65, 63, 94, 419, 63, 63, 66,
622 18, 63, 75, 18, 66, 18, 75, 66, 66, 79,
623 89, 102, 102, 79, 106, 106, 108, 108, 160, 75,
625 109, 109, 418, 89, 115, 115, 79, 89, 160, 18,
626 417, 18, 28, 117, 117, 120, 120, 122, 122, 108,
627 140, 140, 388, 109, 141, 141, 145, 145, 147, 147,
628 148, 148, 154, 154, 387, 28, 386, 28, 28, 28,
629 28, 183, 183, 385, 28, 28, 28, 28, 28, 28,
630 28, 28, 28, 28, 156, 28, 28, 57, 156, 162,
631 57, 384, 166, 254, 184, 381, 57, 185, 185, 156,
632 187, 187, 376, 57, 162, 374, 57, 184, 57, 166,
633 254, 57, 57, 188, 188, 373, 57, 190, 190, 192,
634 192, 372, 166, 57, 193, 193, 57, 371, 57, 57,
636 57, 57, 200, 200, 201, 202, 202, 203, 201, 239,
637 262, 203, 279, 282, 239, 298, 382, 239, 239, 370,
638 368, 201, 367, 366, 203, 364, 363, 262, 362, 279,
639 282, 361, 298, 382, 391, 391, 391, 391, 391, 391,
640 391, 391, 391, 391, 391, 391, 391, 392, 392, 392,
641 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
642 393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
643 393, 393, 393, 394, 394, 394, 394, 394, 394, 394,
644 394, 394, 394, 394, 394, 394, 395, 395, 395, 395,
645 395, 395, 395, 395, 395, 395, 395, 395, 395, 396,
647 396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
648 396, 396, 397, 397, 397, 397, 397, 397, 397, 397,
649 397, 397, 397, 397, 397, 398, 398, 398, 398, 398,
650 398, 398, 398, 398, 398, 398, 398, 398, 399, 399,
651 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
652 399, 400, 400, 400, 400, 400, 400, 400, 400, 400,
653 400, 400, 400, 400, 401, 358, 401, 402, 357, 402,
654 402, 402, 402, 402, 402, 402, 402, 356, 402, 402,
655 403, 403, 403, 403, 403, 403, 355, 403, 403, 403,
656 403, 354, 403, 404, 353, 404, 404, 404, 404, 404,
658 404, 404, 404, 404, 351, 404, 405, 405, 405, 405,
659 405, 405, 350, 405, 405, 405, 405, 405, 405, 406,
660 406, 347, 406, 406, 406, 406, 406, 406, 406, 406,
661 407, 407, 407, 407, 407, 407, 407, 407, 407, 407,
662 407, 346, 407, 408, 408, 408, 408, 408, 345, 408,
663 408, 408, 408, 408, 409, 409, 409, 409, 409, 409,
664 409, 409, 409, 409, 409, 344, 409, 410, 410, 343,
665 410, 410, 410, 410, 410, 410, 410, 410, 410, 411,
666 411, 411, 411, 411, 411, 411, 411, 411, 411, 411,
667 411, 411, 412, 412, 412, 412, 412, 342, 412, 412,
669 412, 412, 412, 412, 413, 413, 341, 340, 413, 338,
670 413, 413, 337, 413, 413, 336, 413, 414, 414, 334,
671 414, 333, 332, 414, 414, 331, 414, 414, 330, 414,
672 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
673 415, 329, 415, 416, 328, 416, 416, 416, 416, 416,
674 416, 416, 416, 416, 416, 416, 420, 327, 420, 420,
675 420, 420, 420, 420, 420, 420, 326, 420, 420, 325,
676 324, 322, 321, 320, 319, 318, 317, 315, 314, 313,
677 312, 311, 310, 309, 308, 306, 305, 304, 300, 296,
678 294, 293, 292, 291, 289, 288, 287, 285, 284, 283,
680 281, 280, 277, 276, 274, 270, 269, 267, 265, 264,
681 263, 261, 259, 258, 257, 256, 255, 253, 252, 251,
682 249, 248, 247, 246, 245, 244, 243, 242, 241, 240,
683 235, 234, 233, 232, 231, 230, 229, 228, 227, 226,
684 225, 224, 223, 222, 221, 220, 219, 218, 217, 216,
685 215, 214, 213, 212, 211, 210, 209, 208, 207, 206,
686 205, 204, 199, 195, 194, 191, 189, 186, 180, 179,
687 178, 177, 176, 175, 174, 173, 172, 171, 169, 168,
688 167, 165, 164, 163, 161, 159, 158, 157, 155, 126,
689 121, 116, 110, 107, 103, 97, 96, 95, 92, 90,
691 88, 86, 85, 82, 73, 48, 44, 23, 8, 7,
692 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
693 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
694 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
695 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
696 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
700 static yy_state_type yy_last_accepting_state
;
701 static char *yy_last_accepting_cpos
;
703 extern int yy_flex_debug
;
704 int yy_flex_debug
= 1;
706 static yyconst
short int yy_rule_linenum
[102] =
708 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
709 225, 226, 227, 228, 229, 230, 231, 232, 233, 234,
710 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
711 245, 246, 247, 248, 250, 251, 252, 253, 254, 256,
712 258, 264, 278, 281, 284, 285, 288, 291, 294, 302,
713 308, 324, 325, 335, 340, 356, 357, 373, 374, 386,
714 396, 416, 432, 452, 464, 478, 479, 480, 481, 482,
715 483, 484, 485, 486, 497, 503, 514, 520, 521, 522,
716 524, 542, 548, 549, 550, 552, 570, 573, 576, 577,
717 580, 591, 603, 605, 607, 610, 613, 633, 640, 641,
722 /* The intent behind this definition is that it'll catch
723 * any uses of REJECT which flex missed.
725 #define REJECT reject_used_but_not_detected
726 #define yymore() yymore_used_but_not_detected
727 #define YY_MORE_ADJ 0
728 #define YY_RESTORE_YY_MORE_OFFSET
730 #line 1 "scan-gram.l"
732 /* Bison Grammar Scanner -*- C -*-
733 Copyright (C) 2002 Free Software Foundation, Inc.
735 This file is part of Bison, the GNU Compiler Compiler.
737 This program is free software; you can redistribute it and/or modify
738 it under the terms of the GNU General Public License as published by
739 the Free Software Foundation; either version 2 of the License, or
740 (at your option) any later version.
742 This program is distributed in the hope that it will be useful,
743 but WITHOUT ANY WARRANTY; without even the implied warranty of
744 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
745 GNU General Public License for more details.
747 You should have received a copy of the GNU General Public License
748 along with this program; if not, write to the Free Software
749 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
752 #define YY_NO_UNPUT 1
753 #define YY_NEVER_INTERACTIVE 1
754 #define YY_STACK_USED 1
755 #line 26 "scan-gram.l"
757 #include "mbswidth.h"
758 #include "complain.h"
764 /* Each time we match a string, move the end cursor to its end. */
765 #define YY_USER_INIT \
767 LOCATION_RESET (*yylloc); \
768 yylloc->file = infile; \
769 /* This is only to avoid GCC warnings. */ \
770 if (yycontrol) {;}; \
773 #define YY_USER_ACTION extend_location (yylloc, yytext, yyleng);
774 #define YY_STEP LOCATION_STEP (*yylloc)
776 #define YY_INPUT(buf, result, size) ((result) = no_cr_read (yyin, buf, size))
779 /* Read bytes from FP into buffer BUF of size SIZE. Return the
780 number of bytes read. Remove '\r' from input, treating \r\n
781 and isolated \r as \n. */
784 no_cr_read (FILE *fp
, char *buf
, size_t size
)
786 size_t s
= fread (buf
, 1, size
, fp
);
789 char *w
= memchr (buf
, '\r', s
);
793 char const *lim
= buf
+ s
;
797 /* Found an '\r'. Treat it like '\n', but ignore any
798 '\n' that immediately follows. */
803 if (ch
!= '\n' && ungetc (ch
, fp
) != ch
)
809 /* Copy until the next '\r'. */
815 while ((*w
++ = *r
++) != '\r');
826 /* Extend *LOC to account for token TOKEN of size SIZE. */
829 extend_location (location_t
*loc
, char const *token
, int size
)
831 int line
= loc
->last_line
;
832 int column
= loc
->last_column
;
833 char const *p0
= token
;
834 char const *p
= token
;
835 char const *lim
= token
+ size
;
837 for (p
= token
; p
< lim
; p
++)
841 /* \r shouldn't survive no_cr_read. */
851 column
+= mbsnwidth (p0
, p
- p0
, 0);
852 column
+= 8 - ((column
- 1) & 7);
857 loc
->last_line
= line
;
858 loc
->last_column
= column
+ mbsnwidth (p0
, p
- p0
, 0);
863 /* STRING_OBSTACK -- Used to store all the characters that we need to
864 keep (to construct ID, STRINGS etc.). Use the following macros to
867 Use YY_OBS_GROW to append what has just been matched, and
868 YY_OBS_FINISH to end the string (it puts the ending 0).
869 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
870 used, and which is used by YY_OBS_FREE to free the last string. */
872 static struct obstack string_obstack
;
875 #define YY_OBS_GROW \
876 obstack_grow (&string_obstack, yytext, yyleng)
878 #define YY_OBS_FINISH \
880 obstack_1grow (&string_obstack, '\0'); \
881 last_string = obstack_finish (&string_obstack); \
884 #define YY_OBS_FREE \
886 obstack_free (&string_obstack, last_string); \
890 scanner_last_string_free (void)
896 static int braces_level
= 0;
897 static int percent_percent_count
= 0;
899 /* Within well-formed rules, RULE_LENGTH is the number of values in
900 the current rule so far, which says where to find `$0' with respect
901 to the top of the stack. It is not the same as the rule->length in
902 the case of mid rule actions.
904 Outside of well-formed rules, RULE_LENGTH has an undefined value. */
905 static int rule_length
;
907 static void handle_dollar (braced_code_t code_kind
,
908 char *cp
, location_t location
);
909 static void handle_at (braced_code_t code_kind
,
910 char *cp
, location_t location
);
911 static int convert_ucn_to_byte (char const *hex_text
);
914 #define SC_LINE_COMMENT 2
915 #define SC_YACC_COMMENT 3
918 #define SC_CHARACTER 5
920 #define SC_ESCAPED_STRING 6
921 #define SC_ESCAPED_CHARACTER 7
923 #define SC_BRACED_CODE 8
924 #define SC_PROLOGUE 9
925 #define SC_EPILOGUE 10
927 /* POSIX says that a tag must be both an id and a C union member, but
928 historically almost any character is allowed in a tag. We disallow
929 NUL and newline, as this simplifies our implementation. */
930 /* Zero or more instances of backslash-newline. Following GCC, allow
931 white space between the backslash and the newline. */
932 #line 933 "scan-gram.c"
934 /* Macros after this point can all be overridden by user definitions in
938 #ifndef YY_SKIP_YYWRAP
940 extern "C" int yywrap
YY_PROTO(( void ));
942 extern int yywrap
YY_PROTO(( void ));
947 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
951 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
954 #ifdef YY_NEED_STRLEN
955 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
960 static int yyinput
YY_PROTO(( void ));
962 static int input
YY_PROTO(( void ));
967 static int yy_start_stack_ptr
= 0;
968 static int yy_start_stack_depth
= 0;
969 static int *yy_start_stack
= 0;
970 #ifndef YY_NO_PUSH_STATE
971 static void yy_push_state
YY_PROTO(( int new_state
));
973 #ifndef YY_NO_POP_STATE
974 static void yy_pop_state
YY_PROTO(( void ));
976 #ifndef YY_NO_TOP_STATE
977 static int yy_top_state
YY_PROTO(( void ));
981 #define YY_NO_PUSH_STATE 1
982 #define YY_NO_POP_STATE 1
983 #define YY_NO_TOP_STATE 1
986 #ifdef YY_MALLOC_DECL
994 /* Just try to get by without declaring the routines. This will fail
995 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
996 * or sizeof(void*) != sizeof(int).
1001 /* Amount of stuff to slurp up with each read. */
1002 #ifndef YY_READ_BUF_SIZE
1003 #define YY_READ_BUF_SIZE 8192
1006 /* Copy whatever the last rule matched to the standard output. */
1009 /* This used to be an fputs(), but since the string might contain NUL's,
1010 * we now use fwrite().
1012 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1015 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1016 * is returned in "result".
1019 #define YY_INPUT(buf,result,max_size) \
1020 if ( yy_current_buffer->yy_is_interactive ) \
1023 for ( n = 0; n < max_size && \
1024 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1025 buf[n] = (char) c; \
1027 buf[n++] = (char) c; \
1028 if ( c == EOF && ferror( yyin ) ) \
1029 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1032 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1033 && ferror( yyin ) ) \
1034 YY_FATAL_ERROR( "input in flex scanner failed" );
1037 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1038 * we don't want an extra ';' after the "return" because that will cause
1039 * some compilers to complain about unreachable statements.
1042 #define yyterminate() return YY_NULL
1045 /* Number of entries by which start-condition stack grows. */
1046 #ifndef YY_START_STACK_INCR
1047 #define YY_START_STACK_INCR 25
1050 /* Report a fatal error. */
1051 #ifndef YY_FATAL_ERROR
1052 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1055 /* Default declaration of generated scanner - a define so the user can
1056 * easily add parameters.
1059 #define YY_DECL int yylex YY_PROTO(( void ))
1062 /* Code executed at the beginning of each rule, after yytext and yyleng
1065 #ifndef YY_USER_ACTION
1066 #define YY_USER_ACTION
1069 /* Code executed at the end of each rule. */
1071 #define YY_BREAK break;
1074 #define YY_RULE_SETUP \
1079 register yy_state_type yy_current_state
;
1080 register char *yy_cp
, *yy_bp
;
1081 register int yy_act
;
1083 #line 202 "scan-gram.l"
1086 /* At each yylex invocation, mark the current position as the
1087 start of the next token. */
1092 /*----------------------------.
1093 | Scanning Bison directives. |
1094 `----------------------------*/
1095 #line 1096 "scan-gram.c"
1106 yy_start
= 1; /* first start state */
1114 if ( ! yy_current_buffer
)
1116 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1118 yy_load_buffer_state();
1121 while ( 1 ) /* loops until end-of-file is reached */
1125 /* Support of yytext. */
1126 *yy_cp
= yy_hold_char
;
1128 /* yy_bp points to the position in yy_ch_buf of the start of
1133 yy_current_state
= yy_start
;
1137 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1138 if ( yy_accept
[yy_current_state
] )
1140 yy_last_accepting_state
= yy_current_state
;
1141 yy_last_accepting_cpos
= yy_cp
;
1143 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1145 yy_current_state
= (int) yy_def
[yy_current_state
];
1146 if ( yy_current_state
>= 391 )
1147 yy_c
= yy_meta
[(unsigned int) yy_c
];
1149 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1152 while ( yy_base
[yy_current_state
] != 811 );
1155 yy_act
= yy_accept
[yy_current_state
];
1157 { /* have to back up */
1158 yy_cp
= yy_last_accepting_cpos
;
1159 yy_current_state
= yy_last_accepting_state
;
1160 yy_act
= yy_accept
[yy_current_state
];
1163 YY_DO_BEFORE_ACTION
;
1166 do_action
: /* This label is used only to access EOF actions. */
1168 if ( yy_flex_debug
)
1171 fprintf( stderr
, "--scanner backing up\n" );
1172 else if ( yy_act
< 102 )
1173 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1174 yy_rule_linenum
[yy_act
], yytext
);
1175 else if ( yy_act
== 102 )
1176 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1178 else if ( yy_act
== 103 )
1179 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1181 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1185 { /* beginning of action switch */
1186 case 0: /* must back up */
1187 /* undo the effects of YY_DO_BEFORE_ACTION */
1188 *yy_cp
= yy_hold_char
;
1189 yy_cp
= yy_last_accepting_cpos
;
1190 yy_current_state
= yy_last_accepting_state
;
1191 goto yy_find_action
;
1197 #line 215 "scan-gram.l"
1198 return PERCENT_NONASSOC
;
1202 #line 216 "scan-gram.l"
1203 return PERCENT_DEBUG
;
1207 #line 217 "scan-gram.l"
1208 return PERCENT_DEFINE
;
1212 #line 218 "scan-gram.l"
1213 return PERCENT_DEFINES
;
1217 #line 219 "scan-gram.l"
1218 return PERCENT_DESTRUCTOR
;
1222 #line 220 "scan-gram.l"
1223 return PERCENT_DPREC
;
1227 #line 221 "scan-gram.l"
1228 return PERCENT_ERROR_VERBOSE
;
1232 #line 222 "scan-gram.l"
1233 return PERCENT_EXPECT
;
1237 #line 223 "scan-gram.l"
1238 return PERCENT_FILE_PREFIX
;
1242 #line 224 "scan-gram.l"
1243 return PERCENT_YACC
;
1247 #line 225 "scan-gram.l"
1248 return PERCENT_GLR_PARSER
;
1252 #line 226 "scan-gram.l"
1253 return PERCENT_LEFT
;
1257 #line 227 "scan-gram.l"
1258 return PERCENT_LOCATIONS
;
1262 #line 228 "scan-gram.l"
1263 return PERCENT_MERGE
;
1267 #line 229 "scan-gram.l"
1268 return PERCENT_NAME_PREFIX
;
1272 #line 230 "scan-gram.l"
1273 return PERCENT_NO_LINES
;
1277 #line 231 "scan-gram.l"
1278 return PERCENT_NONASSOC
;
1282 #line 232 "scan-gram.l"
1283 return PERCENT_NTERM
;
1287 #line 233 "scan-gram.l"
1288 return PERCENT_OUTPUT
;
1292 #line 234 "scan-gram.l"
1293 return PERCENT_PARSE_PARAM
;
1297 #line 235 "scan-gram.l"
1298 rule_length
--; return PERCENT_PREC
;
1302 #line 236 "scan-gram.l"
1303 return PERCENT_PRINTER
;
1307 #line 237 "scan-gram.l"
1308 return PERCENT_PURE_PARSER
;
1312 #line 238 "scan-gram.l"
1313 return PERCENT_RIGHT
;
1317 #line 239 "scan-gram.l"
1318 return PERCENT_LEX_PARAM
;
1322 #line 240 "scan-gram.l"
1323 return PERCENT_SKELETON
;
1327 #line 241 "scan-gram.l"
1328 return PERCENT_START
;
1332 #line 242 "scan-gram.l"
1333 return PERCENT_TOKEN
;
1337 #line 243 "scan-gram.l"
1338 return PERCENT_TOKEN
;
1342 #line 244 "scan-gram.l"
1343 return PERCENT_TOKEN_TABLE
;
1347 #line 245 "scan-gram.l"
1348 return PERCENT_TYPE
;
1352 #line 246 "scan-gram.l"
1353 return PERCENT_UNION
;
1357 #line 247 "scan-gram.l"
1358 return PERCENT_VERBOSE
;
1362 #line 248 "scan-gram.l"
1363 return PERCENT_YACC
;
1367 #line 250 "scan-gram.l"
1372 #line 251 "scan-gram.l"
1373 rule_length
= 0; return COLON
;
1377 #line 252 "scan-gram.l"
1378 rule_length
= 0; return PIPE
;
1382 #line 253 "scan-gram.l"
1387 #line 254 "scan-gram.l"
1392 #line 256 "scan-gram.l"
1397 #line 258 "scan-gram.l"
1399 yylval
->symbol
= symbol_get (yytext
, *yylloc
);
1406 #line 264 "scan-gram.l"
1410 num
= strtoul (yytext
, 0, 10);
1411 if (INT_MAX
< num
|| errno
)
1413 complain_at (*yylloc
, _("%s is invalid"), yytext
);
1416 yylval
->integer
= num
;
1420 /* Characters. We don't check there is only one. */
1423 #line 278 "scan-gram.l"
1424 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1429 #line 281 "scan-gram.l"
1430 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1435 #line 284 "scan-gram.l"
1436 BEGIN SC_YACC_COMMENT
;
1440 #line 285 "scan-gram.l"
1446 #line 288 "scan-gram.l"
1447 yy_push_state (SC_PROLOGUE
);
1449 /* Code in between braces. */
1452 #line 291 "scan-gram.l"
1453 YY_OBS_GROW
; ++braces_level
; yy_push_state (SC_BRACED_CODE
);
1458 #line 294 "scan-gram.l"
1460 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1462 yylval
->string
= last_string
;
1468 #line 302 "scan-gram.l"
1470 if (++percent_percent_count
== 2)
1471 yy_push_state (SC_EPILOGUE
);
1472 return PERCENT_PERCENT
;
1477 #line 308 "scan-gram.l"
1479 LOCATION_PRINT (stderr
, *yylloc
);
1480 fprintf (stderr
, _(": invalid character: `%c'\n"), *yytext
);
1485 /*-------------------------------------------------------------------.
1486 | Whatever the start condition (but those which correspond to |
1487 | entities `swallowed' by Bison: SC_YACC_COMMENT, SC_ESCAPED_STRING, |
1488 | and SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1489 `-------------------------------------------------------------------*/
1494 #line 324 "scan-gram.l"
1495 obstack_sgrow (&string_obstack
, "@<:@");
1499 #line 325 "scan-gram.l"
1500 obstack_sgrow (&string_obstack
, "@:>@");
1503 /*---------------------------------------------------------------.
1504 | Scanning a Yacc comment. The initial `/ *' is already eaten. |
1505 `---------------------------------------------------------------*/
1510 #line 335 "scan-gram.l"
1518 #line 340 "scan-gram.l"
1521 case YY_STATE_EOF(SC_YACC_COMMENT
):
1522 #line 342 "scan-gram.l"
1524 LOCATION_PRINT (stderr
, *yylloc
);
1525 fprintf (stderr
, _(": unexpected end of file in a comment\n"));
1530 /*------------------------------------------------------------.
1531 | Scanning a C comment. The initial `/ *' is already eaten. |
1532 `------------------------------------------------------------*/
1537 #line 356 "scan-gram.l"
1538 YY_OBS_GROW
; yy_pop_state ();
1542 #line 357 "scan-gram.l"
1545 case YY_STATE_EOF(SC_COMMENT
):
1546 #line 359 "scan-gram.l"
1548 LOCATION_PRINT (stderr
, *yylloc
);
1549 fprintf (stderr
, _(": unexpected end of file in a comment\n"));
1554 /*--------------------------------------------------------------.
1555 | Scanning a line comment. The initial `//' is already eaten. |
1556 `--------------------------------------------------------------*/
1561 #line 373 "scan-gram.l"
1562 YY_OBS_GROW
; yy_pop_state ();
1566 #line 374 "scan-gram.l"
1569 case YY_STATE_EOF(SC_LINE_COMMENT
):
1570 #line 375 "scan-gram.l"
1574 /*----------------------------------------------------------------.
1575 | Scanning a C string, including its escapes. The initial `"' is |
1577 `----------------------------------------------------------------*/
1582 #line 386 "scan-gram.l"
1584 assert (yy_top_state () == INITIAL
);
1587 yylval
->string
= last_string
;
1595 #line 396 "scan-gram.l"
1598 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1599 #line 398 "scan-gram.l"
1601 LOCATION_PRINT (stderr
, *yylloc
);
1602 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1603 assert (yy_top_state () == INITIAL
);
1605 yylval
->string
= last_string
;
1611 /*---------------------------------------------------------------.
1612 | Scanning a C character, decoding its escapes. The initial "'" |
1613 | is already eaten. |
1614 `---------------------------------------------------------------*/
1619 #line 416 "scan-gram.l"
1622 assert (yy_top_state () == INITIAL
);
1625 yylval
->symbol
= symbol_get (last_string
, *yylloc
);
1626 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1627 symbol_user_token_number_set (yylval
->symbol
,
1628 (unsigned char) last_string
[1], *yylloc
);
1638 #line 432 "scan-gram.l"
1641 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1642 #line 434 "scan-gram.l"
1644 LOCATION_PRINT (stderr
, *yylloc
);
1645 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1646 assert (yy_top_state () == INITIAL
);
1648 yylval
->string
= last_string
;
1654 /*----------------------------.
1655 | Decode escaped characters. |
1656 `----------------------------*/
1661 #line 452 "scan-gram.l"
1663 unsigned long c
= strtoul (yytext
+ 1, 0, 8);
1666 LOCATION_PRINT (stderr
, *yylloc
);
1667 fprintf (stderr
, _(": invalid escape: %s\n"), quote (yytext
));
1671 obstack_1grow (&string_obstack
, c
);
1676 #line 464 "scan-gram.l"
1680 c
= strtoul (yytext
+ 2, 0, 16);
1681 if (UCHAR_MAX
< c
|| errno
)
1683 LOCATION_PRINT (stderr
, *yylloc
);
1684 fprintf (stderr
, _(": invalid escape: %s\n"), quote (yytext
));
1688 obstack_1grow (&string_obstack
, c
);
1693 #line 478 "scan-gram.l"
1694 obstack_1grow (&string_obstack
, '\a');
1698 #line 479 "scan-gram.l"
1699 obstack_1grow (&string_obstack
, '\b');
1703 #line 480 "scan-gram.l"
1704 obstack_1grow (&string_obstack
, '\f');
1708 #line 481 "scan-gram.l"
1709 obstack_1grow (&string_obstack
, '\n');
1713 #line 482 "scan-gram.l"
1714 obstack_1grow (&string_obstack
, '\r');
1718 #line 483 "scan-gram.l"
1719 obstack_1grow (&string_obstack
, '\t');
1723 #line 484 "scan-gram.l"
1724 obstack_1grow (&string_obstack
, '\v');
1728 #line 485 "scan-gram.l"
1729 obstack_1grow (&string_obstack
, yytext
[1]);
1733 #line 486 "scan-gram.l"
1735 int c
= convert_ucn_to_byte (yytext
);
1738 LOCATION_PRINT (stderr
, *yylloc
);
1739 fprintf (stderr
, _(": invalid escape: %s\n"), quote (yytext
));
1743 obstack_1grow (&string_obstack
, c
);
1748 #line 497 "scan-gram.l"
1750 LOCATION_PRINT (stderr
, *yylloc
);
1751 fprintf (stderr
, _(": unrecognized escape: %s\n"), quote (yytext
));
1755 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1758 #line 503 "scan-gram.l"
1762 /*----------------------------------------------------------.
1763 | Scanning a C character without decoding its escapes. The |
1764 | initial "'" is already eaten. |
1765 `----------------------------------------------------------*/
1770 #line 514 "scan-gram.l"
1773 assert (yy_top_state () != INITIAL
);
1779 #line 520 "scan-gram.l"
1784 #line 521 "scan-gram.l"
1789 #line 522 "scan-gram.l"
1792 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1795 #line 524 "scan-gram.l"
1798 case YY_STATE_EOF(SC_CHARACTER
):
1799 #line 526 "scan-gram.l"
1801 LOCATION_PRINT (stderr
, *yylloc
);
1802 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1803 assert (yy_top_state () != INITIAL
);
1808 /*----------------------------------------------------------------.
1809 | Scanning a C string, without decoding its escapes. The initial |
1810 | `"' is already eaten. |
1811 `----------------------------------------------------------------*/
1816 #line 542 "scan-gram.l"
1818 assert (yy_top_state () != INITIAL
);
1825 #line 548 "scan-gram.l"
1830 #line 549 "scan-gram.l"
1835 #line 550 "scan-gram.l"
1838 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1841 #line 552 "scan-gram.l"
1844 case YY_STATE_EOF(SC_STRING
):
1845 #line 554 "scan-gram.l"
1847 LOCATION_PRINT (stderr
, *yylloc
);
1848 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1849 assert (yy_top_state () != INITIAL
);
1854 /*---------------------------------------------------.
1855 | Strings, comments etc. can be found in user code. |
1856 `---------------------------------------------------*/
1859 /* Characters. We don't check there is only one. */
1862 #line 570 "scan-gram.l"
1863 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1868 #line 573 "scan-gram.l"
1869 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1874 #line 576 "scan-gram.l"
1875 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1879 #line 577 "scan-gram.l"
1880 YY_OBS_GROW
; yy_push_state (SC_LINE_COMMENT
);
1885 #line 580 "scan-gram.l"
1889 /*---------------------------------------------------------------.
1890 | Scanning some code in braces (%union and actions). The initial |
1891 | "{" is already eaten. |
1892 `---------------------------------------------------------------*/
1897 #line 591 "scan-gram.l"
1900 if (--braces_level
== 0)
1904 yylval
->string
= last_string
;
1912 #line 603 "scan-gram.l"
1913 YY_OBS_GROW
; braces_level
++;
1917 #line 605 "scan-gram.l"
1918 { handle_dollar (current_braced_code
,
1923 #line 607 "scan-gram.l"
1924 { handle_at (current_braced_code
,
1929 #line 610 "scan-gram.l"
1932 /* A stray $, or /, or etc. */
1935 #line 613 "scan-gram.l"
1938 case YY_STATE_EOF(SC_BRACED_CODE
):
1939 #line 615 "scan-gram.l"
1941 LOCATION_PRINT (stderr
, *yylloc
);
1942 fprintf (stderr
, _(": unexpected end of file in a braced code\n"));
1945 yylval
->string
= last_string
;
1950 /*--------------------------------------------------------------.
1951 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1952 `--------------------------------------------------------------*/
1957 #line 633 "scan-gram.l"
1961 yylval
->string
= last_string
;
1967 #line 640 "scan-gram.l"
1972 #line 641 "scan-gram.l"
1975 case YY_STATE_EOF(SC_PROLOGUE
):
1976 #line 643 "scan-gram.l"
1978 LOCATION_PRINT (stderr
, *yylloc
);
1979 fprintf (stderr
, _(": unexpected end of file in a prologue\n"));
1982 yylval
->string
= last_string
;
1987 /*---------------------------------------------------------------.
1988 | Scanning the epilogue (everything after the second "%%", which |
1989 | has already been eaten). |
1990 `---------------------------------------------------------------*/
1995 #line 661 "scan-gram.l"
1998 case YY_STATE_EOF(SC_EPILOGUE
):
1999 #line 663 "scan-gram.l"
2003 yylval
->string
= last_string
;
2010 #line 672 "scan-gram.l"
2011 YY_FATAL_ERROR( "flex scanner jammed" );
2013 #line 2014 "scan-gram.c"
2014 case YY_STATE_EOF(INITIAL
):
2017 case YY_END_OF_BUFFER
:
2019 /* Amount of text matched not including the EOB char. */
2020 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
2022 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2023 *yy_cp
= yy_hold_char
;
2024 YY_RESTORE_YY_MORE_OFFSET
2026 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
2028 /* We're scanning a new file or input source. It's
2029 * possible that this happened because the user
2030 * just pointed yyin at a new source and called
2031 * yylex(). If so, then we have to assure
2032 * consistency between yy_current_buffer and our
2033 * globals. Here is the right place to do so, because
2034 * this is the first action (other than possibly a
2035 * back-up) that will match for the new input source.
2037 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2038 yy_current_buffer
->yy_input_file
= yyin
;
2039 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2042 /* Note that here we test for yy_c_buf_p "<=" to the position
2043 * of the first EOB in the buffer, since yy_c_buf_p will
2044 * already have been incremented past the NUL character
2045 * (since all states make transitions on EOB to the
2046 * end-of-buffer state). Contrast this with the test
2049 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2050 { /* This was really a NUL. */
2051 yy_state_type yy_next_state
;
2053 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
2055 yy_current_state
= yy_get_previous_state();
2057 /* Okay, we're now positioned to make the NUL
2058 * transition. We couldn't have
2059 * yy_get_previous_state() go ahead and do it
2060 * for us because it doesn't know how to deal
2061 * with the possibility of jamming (and we don't
2062 * want to build jamming into it because then it
2063 * will run more slowly).
2066 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
2068 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2070 if ( yy_next_state
)
2072 /* Consume the NUL. */
2073 yy_cp
= ++yy_c_buf_p
;
2074 yy_current_state
= yy_next_state
;
2081 goto yy_find_action
;
2085 else switch ( yy_get_next_buffer() )
2087 case EOB_ACT_END_OF_FILE
:
2089 yy_did_buffer_switch_on_eof
= 0;
2093 /* Note: because we've taken care in
2094 * yy_get_next_buffer() to have set up
2095 * yytext, we can now set up
2096 * yy_c_buf_p so that if some total
2097 * hoser (like flex itself) wants to
2098 * call the scanner after we return the
2099 * YY_NULL, it'll still work - another
2100 * YY_NULL will get returned.
2102 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
2104 yy_act
= YY_STATE_EOF(YY_START
);
2110 if ( ! yy_did_buffer_switch_on_eof
)
2116 case EOB_ACT_CONTINUE_SCAN
:
2118 yytext_ptr
+ yy_amount_of_matched_text
;
2120 yy_current_state
= yy_get_previous_state();
2123 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2126 case EOB_ACT_LAST_MATCH
:
2128 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
2130 yy_current_state
= yy_get_previous_state();
2133 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2134 goto yy_find_action
;
2141 "fatal flex scanner internal error--no action found" );
2142 } /* end of action switch */
2143 } /* end of scanning one token */
2144 } /* end of yylex */
2147 /* yy_get_next_buffer - try to read in a new buffer
2149 * Returns a code representing an action:
2150 * EOB_ACT_LAST_MATCH -
2151 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2152 * EOB_ACT_END_OF_FILE - end of file
2155 static int yy_get_next_buffer()
2157 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2158 register char *source
= yytext_ptr
;
2159 register int number_to_move
, i
;
2162 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2164 "fatal flex scanner internal error--end of buffer missed" );
2166 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2167 { /* Don't try to fill the buffer, so this is an EOF. */
2168 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2170 /* We matched a single character, the EOB, so
2171 * treat this as a final EOF.
2173 return EOB_ACT_END_OF_FILE
;
2178 /* We matched some text prior to the EOB, first
2181 return EOB_ACT_LAST_MATCH
;
2185 /* Try to read more data. */
2187 /* First move last chars to start of buffer. */
2188 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2190 for ( i
= 0; i
< number_to_move
; ++i
)
2191 *(dest
++) = *(source
++);
2193 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2194 /* don't do the read, it's not guaranteed to return an EOF,
2197 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2202 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2204 while ( num_to_read
<= 0 )
2205 { /* Not enough room in the buffer - grow it. */
2206 #ifdef YY_USES_REJECT
2208 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2211 /* just a shorter name for the current buffer */
2212 YY_BUFFER_STATE b
= yy_current_buffer
;
2214 int yy_c_buf_p_offset
=
2215 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2217 if ( b
->yy_is_our_buffer
)
2219 int new_size
= b
->yy_buf_size
* 2;
2221 if ( new_size
<= 0 )
2222 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2224 b
->yy_buf_size
*= 2;
2226 b
->yy_ch_buf
= (char *)
2227 /* Include room in for 2 EOB chars. */
2228 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2229 b
->yy_buf_size
+ 2 );
2232 /* Can't grow it, we don't own it. */
2235 if ( ! b
->yy_ch_buf
)
2237 "fatal error - scanner input buffer overflow" );
2239 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2241 num_to_read
= yy_current_buffer
->yy_buf_size
-
2246 if ( num_to_read
> YY_READ_BUF_SIZE
)
2247 num_to_read
= YY_READ_BUF_SIZE
;
2249 /* Read in more data. */
2250 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2251 yy_n_chars
, num_to_read
);
2253 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2256 if ( yy_n_chars
== 0 )
2258 if ( number_to_move
== YY_MORE_ADJ
)
2260 ret_val
= EOB_ACT_END_OF_FILE
;
2266 ret_val
= EOB_ACT_LAST_MATCH
;
2267 yy_current_buffer
->yy_buffer_status
=
2268 YY_BUFFER_EOF_PENDING
;
2273 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2275 yy_n_chars
+= number_to_move
;
2276 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2277 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2279 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2285 /* yy_get_previous_state - get the state just before the EOB char was reached */
2287 static yy_state_type
yy_get_previous_state()
2289 register yy_state_type yy_current_state
;
2290 register char *yy_cp
;
2292 yy_current_state
= yy_start
;
2294 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2296 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 53);
2297 if ( yy_accept
[yy_current_state
] )
2299 yy_last_accepting_state
= yy_current_state
;
2300 yy_last_accepting_cpos
= yy_cp
;
2302 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2304 yy_current_state
= (int) yy_def
[yy_current_state
];
2305 if ( yy_current_state
>= 391 )
2306 yy_c
= yy_meta
[(unsigned int) yy_c
];
2308 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2311 return yy_current_state
;
2315 /* yy_try_NUL_trans - try to make a transition on the NUL character
2318 * next_state = yy_try_NUL_trans( current_state );
2321 #ifdef YY_USE_PROTOS
2322 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2324 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2325 yy_state_type yy_current_state
;
2328 register int yy_is_jam
;
2329 register char *yy_cp
= yy_c_buf_p
;
2331 register YY_CHAR yy_c
= 53;
2332 if ( yy_accept
[yy_current_state
] )
2334 yy_last_accepting_state
= yy_current_state
;
2335 yy_last_accepting_cpos
= yy_cp
;
2337 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2339 yy_current_state
= (int) yy_def
[yy_current_state
];
2340 if ( yy_current_state
>= 391 )
2341 yy_c
= yy_meta
[(unsigned int) yy_c
];
2343 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2344 yy_is_jam
= (yy_current_state
== 390);
2346 return yy_is_jam
? 0 : yy_current_state
;
2351 #ifdef YY_USE_PROTOS
2352 static void yyunput( int c
, register char *yy_bp
)
2354 static void yyunput( c
, yy_bp
)
2356 register char *yy_bp
;
2359 register char *yy_cp
= yy_c_buf_p
;
2361 /* undo effects of setting up yytext */
2362 *yy_cp
= yy_hold_char
;
2364 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2365 { /* need to shift things up to make room */
2366 /* +2 for EOB chars. */
2367 register int number_to_move
= yy_n_chars
+ 2;
2368 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2369 yy_current_buffer
->yy_buf_size
+ 2];
2370 register char *source
=
2371 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2373 while ( source
> yy_current_buffer
->yy_ch_buf
)
2374 *--dest
= *--source
;
2376 yy_cp
+= (int) (dest
- source
);
2377 yy_bp
+= (int) (dest
- source
);
2378 yy_current_buffer
->yy_n_chars
=
2379 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2381 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2382 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2385 *--yy_cp
= (char) c
;
2389 yy_hold_char
= *yy_cp
;
2392 #endif /* ifndef YY_NO_UNPUT */
2396 static int yyinput()
2403 *yy_c_buf_p
= yy_hold_char
;
2405 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2407 /* yy_c_buf_p now points to the character we want to return.
2408 * If this occurs *before* the EOB characters, then it's a
2409 * valid NUL; if not, then we've hit the end of the buffer.
2411 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2412 /* This was really a NUL. */
2416 { /* need more input */
2417 int offset
= yy_c_buf_p
- yytext_ptr
;
2420 switch ( yy_get_next_buffer() )
2422 case EOB_ACT_LAST_MATCH
:
2423 /* This happens because yy_g_n_b()
2424 * sees that we've accumulated a
2425 * token and flags that we need to
2426 * try matching the token before
2427 * proceeding. But for input(),
2428 * there's no matching to consider.
2429 * So convert the EOB_ACT_LAST_MATCH
2430 * to EOB_ACT_END_OF_FILE.
2433 /* Reset buffer status. */
2438 case EOB_ACT_END_OF_FILE
:
2443 if ( ! yy_did_buffer_switch_on_eof
)
2452 case EOB_ACT_CONTINUE_SCAN
:
2453 yy_c_buf_p
= yytext_ptr
+ offset
;
2459 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2460 *yy_c_buf_p
= '\0'; /* preserve yytext */
2461 yy_hold_char
= *++yy_c_buf_p
;
2468 #ifdef YY_USE_PROTOS
2469 void yyrestart( FILE *input_file
)
2471 void yyrestart( input_file
)
2475 if ( ! yy_current_buffer
)
2476 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2478 yy_init_buffer( yy_current_buffer
, input_file
);
2479 yy_load_buffer_state();
2483 #ifdef YY_USE_PROTOS
2484 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2486 void yy_switch_to_buffer( new_buffer
)
2487 YY_BUFFER_STATE new_buffer
;
2490 if ( yy_current_buffer
== new_buffer
)
2493 if ( yy_current_buffer
)
2495 /* Flush out information for old buffer. */
2496 *yy_c_buf_p
= yy_hold_char
;
2497 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2498 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2501 yy_current_buffer
= new_buffer
;
2502 yy_load_buffer_state();
2504 /* We don't actually know whether we did this switch during
2505 * EOF (yywrap()) processing, but the only time this flag
2506 * is looked at is after yywrap() is called, so it's safe
2507 * to go ahead and always set it.
2509 yy_did_buffer_switch_on_eof
= 1;
2513 #ifdef YY_USE_PROTOS
2514 void yy_load_buffer_state( void )
2516 void yy_load_buffer_state()
2519 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2520 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2521 yyin
= yy_current_buffer
->yy_input_file
;
2522 yy_hold_char
= *yy_c_buf_p
;
2526 #ifdef YY_USE_PROTOS
2527 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2529 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2536 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2538 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2540 b
->yy_buf_size
= size
;
2542 /* yy_ch_buf has to be 2 characters longer than the size given because
2543 * we need to put in 2 end-of-buffer characters.
2545 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2546 if ( ! b
->yy_ch_buf
)
2547 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2549 b
->yy_is_our_buffer
= 1;
2551 yy_init_buffer( b
, file
);
2557 #ifdef YY_USE_PROTOS
2558 void yy_delete_buffer( YY_BUFFER_STATE b
)
2560 void yy_delete_buffer( b
)
2567 if ( b
== yy_current_buffer
)
2568 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2570 if ( b
->yy_is_our_buffer
)
2571 yy_flex_free( (void *) b
->yy_ch_buf
);
2573 yy_flex_free( (void *) b
);
2577 #ifndef YY_ALWAYS_INTERACTIVE
2578 #ifndef YY_NEVER_INTERACTIVE
2579 extern int isatty
YY_PROTO(( int ));
2583 #ifdef YY_USE_PROTOS
2584 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2586 void yy_init_buffer( b
, file
)
2593 yy_flush_buffer( b
);
2595 b
->yy_input_file
= file
;
2596 b
->yy_fill_buffer
= 1;
2598 #if YY_ALWAYS_INTERACTIVE
2599 b
->yy_is_interactive
= 1;
2601 #if YY_NEVER_INTERACTIVE
2602 b
->yy_is_interactive
= 0;
2604 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2610 #ifdef YY_USE_PROTOS
2611 void yy_flush_buffer( YY_BUFFER_STATE b
)
2613 void yy_flush_buffer( b
)
2623 /* We always need two end-of-buffer characters. The first causes
2624 * a transition to the end-of-buffer state. The second causes
2625 * a jam in that state.
2627 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2628 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2630 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2633 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2635 if ( b
== yy_current_buffer
)
2636 yy_load_buffer_state();
2640 #ifndef YY_NO_SCAN_BUFFER
2641 #ifdef YY_USE_PROTOS
2642 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2644 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2652 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2653 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2654 /* They forgot to leave room for the EOB's. */
2657 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2659 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2661 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2662 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2663 b
->yy_is_our_buffer
= 0;
2664 b
->yy_input_file
= 0;
2665 b
->yy_n_chars
= b
->yy_buf_size
;
2666 b
->yy_is_interactive
= 0;
2668 b
->yy_fill_buffer
= 0;
2669 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2671 yy_switch_to_buffer( b
);
2678 #ifndef YY_NO_SCAN_STRING
2679 #ifdef YY_USE_PROTOS
2680 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2682 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2683 yyconst
char *yy_str
;
2687 for ( len
= 0; yy_str
[len
]; ++len
)
2690 return yy_scan_bytes( yy_str
, len
);
2695 #ifndef YY_NO_SCAN_BYTES
2696 #ifdef YY_USE_PROTOS
2697 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2699 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2700 yyconst
char *bytes
;
2709 /* Get memory for full buffer, including space for trailing EOB's. */
2711 buf
= (char *) yy_flex_alloc( n
);
2713 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2715 for ( i
= 0; i
< len
; ++i
)
2718 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2720 b
= yy_scan_buffer( buf
, n
);
2722 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2724 /* It's okay to grow etc. this buffer, and we should throw it
2725 * away when we're done.
2727 b
->yy_is_our_buffer
= 1;
2734 #ifndef YY_NO_PUSH_STATE
2735 #ifdef YY_USE_PROTOS
2736 static void yy_push_state( int new_state
)
2738 static void yy_push_state( new_state
)
2742 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2746 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2747 new_size
= yy_start_stack_depth
* sizeof( int );
2749 if ( ! yy_start_stack
)
2750 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2753 yy_start_stack
= (int *) yy_flex_realloc(
2754 (void *) yy_start_stack
, new_size
);
2756 if ( ! yy_start_stack
)
2758 "out of memory expanding start-condition stack" );
2761 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2768 #ifndef YY_NO_POP_STATE
2769 static void yy_pop_state()
2771 if ( --yy_start_stack_ptr
< 0 )
2772 YY_FATAL_ERROR( "start-condition stack underflow" );
2774 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2779 #ifndef YY_NO_TOP_STATE
2780 static int yy_top_state()
2782 return yy_start_stack
[yy_start_stack_ptr
- 1];
2786 #ifndef YY_EXIT_FAILURE
2787 #define YY_EXIT_FAILURE 2
2790 #ifdef YY_USE_PROTOS
2791 static void yy_fatal_error( yyconst
char msg
[] )
2793 static void yy_fatal_error( msg
)
2797 (void) fprintf( stderr
, "%s\n", msg
);
2798 exit( YY_EXIT_FAILURE
);
2803 /* Redefine yyless() so it works in section 3 code. */
2809 /* Undo effects of setting up yytext. */ \
2810 yytext[yyleng] = yy_hold_char; \
2811 yy_c_buf_p = yytext + n; \
2812 yy_hold_char = *yy_c_buf_p; \
2813 *yy_c_buf_p = '\0'; \
2819 /* Internal utility routines. */
2822 #ifdef YY_USE_PROTOS
2823 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2825 static void yy_flex_strncpy( s1
, s2
, n
)
2832 for ( i
= 0; i
< n
; ++i
)
2837 #ifdef YY_NEED_STRLEN
2838 #ifdef YY_USE_PROTOS
2839 static int yy_flex_strlen( yyconst
char *s
)
2841 static int yy_flex_strlen( s
)
2846 for ( n
= 0; s
[n
]; ++n
)
2854 #ifdef YY_USE_PROTOS
2855 static void *yy_flex_alloc( yy_size_t size
)
2857 static void *yy_flex_alloc( size
)
2861 return (void *) malloc( size
);
2864 #ifdef YY_USE_PROTOS
2865 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2867 static void *yy_flex_realloc( ptr
, size
)
2872 /* The cast to (char *) in the following accommodates both
2873 * implementations that use char* generic pointers, and those
2874 * that use void* generic pointers. It works with the latter
2875 * because both ANSI C and C++ allow castless assignment from
2876 * any pointer type to void*, and deal with argument conversions
2877 * as though doing an assignment.
2879 return (void *) realloc( (char *) ptr
, size
);
2882 #ifdef YY_USE_PROTOS
2883 static void yy_flex_free( void *ptr
)
2885 static void yy_flex_free( ptr
)
2899 #line 672 "scan-gram.l"
2902 /*------------------------------------------------------------------.
2903 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2905 | Possible inputs: $[<TYPENAME>]($|integer) |
2907 | Output to the STRING_OBSTACK a reference to this semantic value. |
2908 `------------------------------------------------------------------*/
2911 handle_action_dollar (char *text
, location_t location
)
2913 const char *type_name
= NULL
;
2914 char *cp
= text
+ 1;
2916 /* Get the type name if explicit. */
2929 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2930 if (!type_name
&& typed
)
2931 complain_at (location
, _("$$ of `%s' has no declared type"),
2932 current_rule
->sym
->tag
);
2935 obstack_fgrow1 (&string_obstack
,
2936 "]b4_lhs_value([%s])[", type_name
);
2942 num
= strtol (cp
, 0, 10);
2944 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
2947 if (!type_name
&& n
> 0)
2948 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
2950 if (!type_name
&& typed
)
2951 complain_at (location
, _("$%d of `%s' has no declared type"),
2952 n
, current_rule
->sym
->tag
);
2955 obstack_fgrow3 (&string_obstack
,
2956 "]b4_rhs_value([%d], [%d], [%s])[",
2957 rule_length
, n
, type_name
);
2960 complain_at (location
, _("invalid value: %s"), text
);
2965 /*---------------------------------------------------------------.
2966 | TEXT is expected to be $$ in some code associated to a symbol: |
2967 | destructor or printer. |
2968 `---------------------------------------------------------------*/
2971 handle_symbol_code_dollar (char *text
, location_t location
)
2973 char *cp
= text
+ 1;
2975 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
2977 complain_at (location
, _("%s is invalid"), quote_n (1, text
));
2981 /*-----------------------------------------------------------------.
2982 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2983 | depending upon CODE_KIND. |
2984 `-----------------------------------------------------------------*/
2987 handle_dollar (braced_code_t braced_code_kind
,
2988 char *text
, location_t location
)
2990 switch (braced_code_kind
)
2992 case action_braced_code
:
2993 handle_action_dollar (text
, location
);
2996 case destructor_braced_code
:
2997 case printer_braced_code
:
2998 handle_symbol_code_dollar (text
, location
);
3004 /*------------------------------------------------------.
3005 | TEXT is a location token (i.e., a `@...'). Output to |
3006 | STRING_OBSTACK a reference to this location. |
3007 `------------------------------------------------------*/
3010 handle_action_at (char *text
, location_t location
)
3012 char *cp
= text
+ 1;
3017 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
3023 num
= strtol (cp
, 0, 10);
3025 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
3028 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
3032 complain_at (location
, _("invalid value: %s"), text
);
3037 /*---------------------------------------------------------------.
3038 | TEXT is expected to be @$ in some code associated to a symbol: |
3039 | destructor or printer. |
3040 `---------------------------------------------------------------*/
3043 handle_symbol_code_at (char *text
, location_t location
)
3045 char *cp
= text
+ 1;
3047 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
3049 complain_at (location
, _("%s is invalid"), quote_n (1, text
));
3053 /*-------------------------------------------------------------------.
3054 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
3056 `-------------------------------------------------------------------*/
3059 handle_at (braced_code_t braced_code_kind
,
3060 char *text
, location_t location
)
3062 switch (braced_code_kind
)
3064 case action_braced_code
:
3065 handle_action_at (text
, location
);
3068 case destructor_braced_code
:
3069 case printer_braced_code
:
3070 handle_symbol_code_at (text
, location
);
3076 /*------------------------------------------------------------------.
3077 | Convert universal character name UCN to a single-byte character, |
3078 | and return that character. Return -1 if UCN does not correspond |
3079 | to a single-byte character. |
3080 `------------------------------------------------------------------*/
3083 convert_ucn_to_byte (char const *ucn
)
3085 unsigned long code
= strtoul (ucn
+ 2, 0, 16);
3087 /* FIXME: Currently we assume Unicode-compatible unibyte characters
3088 on ASCII hosts (i.e., Latin-1 on hosts with 8-bit bytes). On
3089 non-ASCII hosts we support only the portable C character set.
3090 These limitations should be removed once we add support for
3091 multibyte characters. */
3093 if (UCHAR_MAX
< code
)
3096 #if ! ('$' == 0x24 && '@' == 0x40 && '`' == 0x60 && '~' == 0x7e)
3098 /* A non-ASCII host. Use CODE to index into a table of the C
3099 basic execution character set, which is guaranteed to exist on
3100 all Standard C platforms. This table also includes '$', '@',
3101 and '`', which not in the basic execution character set but
3102 which are unibyte characters on all the platforms that we know
3104 static signed char const table
[] =
3106 '\0', -1, -1, -1, -1, -1, -1, '\a',
3107 '\b', '\t', '\n', '\v', '\f', '\r', -1, -1,
3108 -1, -1, -1, -1, -1, -1, -1, -1,
3109 -1, -1, -1, -1, -1, -1, -1, -1,
3110 ' ', '!', '"', '#', '$', '%', '&', '\'',
3111 '(', ')', '*', '+', ',', '-', '.', '/',
3112 '0', '1', '2', '3', '4', '5', '6', '7',
3113 '8', '9', ':', ';', '<', '=', '>', '?',
3114 '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
3115 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
3116 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
3117 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
3118 '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
3119 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
3120 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
3121 'x', 'y', 'z', '{', '|', '}', '~'
3124 code
= code
< sizeof table
? table
[code
] : -1;
3132 /*-------------------------.
3133 | Initialize the scanner. |
3134 `-------------------------*/
3137 scanner_initialize (void)
3139 obstack_init (&string_obstack
);
3143 /*-----------------------------------------------.
3144 | Free all the memory allocated to the scanner. |
3145 `-----------------------------------------------*/
3150 obstack_free (&string_obstack
, 0);
3151 /* Reclaim Flex's buffers. */
3152 yy_delete_buffer (YY_CURRENT_BUFFER
);