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 103
311 #define YY_END_OF_BUFFER 104
312 static yyconst
short int yy_accept
[399] =
314 0, 0, 0, 0, 60, 60, 0, 0, 86, 86,
315 81, 81, 0, 0, 0, 0, 0, 0, 0, 0,
316 0, 0, 104, 52, 41, 41, 45, 52, 44, 39,
317 42, 52, 43, 37, 40, 52, 36, 49, 38, 58,
318 58, 53, 54, 60, 59, 60, 56, 56, 84, 83,
319 87, 79, 78, 82, 62, 61, 77, 64, 63, 98,
320 89, 98, 98, 88, 92, 98, 98, 93, 95, 100,
321 101, 92, 102, 89, 88, 92, 41, 51, 35, 35,
322 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
323 35, 35, 35, 35, 35, 48, 42, 46, 47, 43,
325 0, 58, 57, 0, 60, 60, 60, 60, 56, 55,
326 84, 85, 85, 85, 85, 79, 80, 80, 80, 80,
327 62, 76, 74, 65, 76, 67, 68, 69, 70, 71,
328 72, 76, 73, 76, 64, 98, 96, 0, 96, 0,
329 94, 0, 90, 91, 0, 93, 98, 0, 97, 0,
330 97, 100, 99, 102, 90, 91, 102, 35, 35, 35,
331 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
332 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
333 35, 35, 35, 35, 47, 50, 0, 0, 0, 86,
334 0, 0, 0, 0, 81, 0, 0, 0, 65, 0,
336 0, 66, 0, 0, 0, 0, 0, 0, 0, 102,
337 102, 35, 35, 35, 35, 35, 35, 35, 35, 35,
338 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
339 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
340 35, 35, 35, 65, 0, 0, 0, 35, 35, 35,
341 35, 35, 35, 35, 35, 35, 35, 12, 35, 35,
342 35, 35, 35, 35, 35, 35, 35, 21, 35, 35,
343 35, 35, 35, 28, 35, 31, 35, 35, 34, 0,
344 0, 35, 2, 35, 35, 6, 35, 35, 35, 35,
345 35, 35, 35, 14, 35, 35, 35, 18, 35, 35,
347 35, 35, 24, 35, 27, 29, 32, 35, 0, 75,
348 1, 3, 35, 35, 8, 35, 35, 35, 35, 35,
349 35, 35, 35, 19, 35, 35, 35, 35, 35, 35,
350 4, 35, 35, 35, 35, 35, 35, 35, 35, 35,
351 35, 35, 22, 35, 35, 35, 33, 35, 35, 35,
352 35, 35, 35, 35, 35, 16, 17, 35, 35, 26,
353 35, 35, 35, 35, 35, 35, 25, 13, 35, 35,
354 35, 35, 5, 35, 35, 35, 11, 35, 35, 35,
355 35, 35, 9, 35, 15, 20, 23, 30, 35, 35,
356 7, 35, 35, 35, 35, 35, 10, 0
360 static yyconst
int yy_ec
[256] =
362 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
363 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
365 1, 2, 1, 4, 1, 5, 6, 1, 7, 1,
366 1, 8, 1, 9, 10, 11, 12, 13, 13, 13,
367 13, 13, 13, 13, 13, 14, 14, 15, 16, 17,
368 18, 19, 20, 21, 22, 22, 22, 22, 22, 22,
369 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
370 11, 11, 11, 11, 23, 11, 11, 11, 11, 11,
371 24, 25, 26, 1, 27, 1, 28, 29, 30, 31,
373 32, 33, 34, 35, 36, 11, 37, 38, 39, 40,
374 41, 42, 11, 43, 44, 45, 46, 47, 11, 48,
375 49, 11, 50, 51, 52, 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
[54] =
394 1, 1, 2, 3, 4, 5, 6, 7, 1, 8,
395 9, 5, 10, 10, 1, 1, 4, 1, 11, 1,
396 4, 10, 9, 12, 13, 12, 9, 10, 10, 10,
397 10, 10, 10, 9, 9, 9, 9, 9, 9, 9,
398 9, 9, 9, 9, 9, 9, 9, 9, 9, 4,
402 static yyconst
short int yy_base
[436] =
404 0, 0, 46, 47, 53, 56, 836, 835, 59, 62,
405 50, 82, 65, 87, 85, 86, 109, 158, 93, 116,
406 120, 127, 842, 845, 58, 62, 845, 205, 845, 845,
407 0, 50, 54, 845, 845, 0, 845, 845, 845, 0,
408 84, 845, 845, 816, 845, 100, 0, 828, 0, 845,
409 135, 0, 845, 146, 0, 845, 252, 0, 845, 0,
410 845, 163, 76, 845, 133, 130, 173, 845, 845, 0,
411 787, 142, 0, 0, 0, 144, 186, 845, 0, 802,
412 62, 142, 801, 798, 125, 803, 153, 788, 163, 797,
413 155, 163, 792, 799, 802, 845, 0, 845, 0, 183,
415 810, 0, 845, 199, 803, 258, 261, 802, 0, 845,
416 0, 845, 211, 801, 215, 0, 845, 217, 800, 219,
417 0, 845, 845, 811, 0, 845, 845, 845, 845, 845,
418 845, 0, 845, 0, 0, 0, 845, 210, 212, 0,
419 845, 227, 845, 845, 255, 845, 845, 264, 845, 255,
420 257, 0, 845, 0, 0, 0, 271, 0, 783, 249,
421 779, 778, 778, 155, 776, 243, 788, 774, 777, 269,
422 783, 769, 770, 252, 769, 777, 778, 781, 765, 770,
423 764, 769, 761, 773, 0, 845, 287, 282, 299, 777,
424 301, 303, 776, 308, 775, 310, 312, 774, 785, 0,
426 0, 0, 778, 314, 180, 316, 312, 319, 317, 323,
427 319, 768, 749, 758, 748, 760, 750, 758, 757, 756,
428 777, 741, 775, 756, 749, 750, 743, 752, 736, 736,
429 733, 746, 735, 742, 738, 734, 728, 731, 737, 736,
430 726, 737, 735, 845, 0, 0, 325, 721, 729, 722,
431 718, 730, 716, 728, 747, 725, 713, 0, 712, 708,
432 720, 318, 715, 706, 710, 702, 715, 0, 701, 319,
433 700, 712, 698, 0, 702, 0, 701, 699, 0, 0,
434 0, 690, 0, 706, 691, 0, 322, 691, 693, 323,
435 706, 705, 696, 0, 689, 690, 685, 0, 683, 717,
437 694, 683, 0, 679, 0, 326, 0, 679, 0, 845,
438 0, 678, 691, 673, 0, 676, 677, 674, 673, 674,
439 671, 681, 671, 0, 669, 667, 681, 667, 662, 674,
440 0, 660, 672, 671, 656, 657, 672, 659, 666, 653,
441 666, 667, 0, 649, 643, 642, 0, 623, 608, 612,
442 599, 610, 599, 588, 598, 0, 0, 587, 585, 0,
443 591, 549, 559, 535, 522, 501, 0, 0, 499, 499,
444 485, 476, 0, 468, 452, 445, 0, 308, 316, 311,
445 320, 307, 0, 303, 0, 0, 0, 0, 315, 330,
446 0, 310, 305, 270, 255, 218, 0, 845, 357, 370,
448 383, 396, 409, 422, 435, 448, 461, 474, 479, 489,
449 502, 515, 528, 541, 552, 565, 576, 589, 601, 614,
450 626, 639, 652, 658, 668, 221, 205, 197, 681, 164,
451 162, 133, 119, 108, 88
454 static yyconst
short int yy_def
[436] =
456 398, 1, 399, 399, 400, 400, 401, 401, 402, 402,
457 403, 403, 404, 404, 405, 405, 406, 406, 407, 407,
458 408, 408, 398, 398, 398, 398, 398, 398, 398, 398,
459 409, 398, 398, 398, 398, 410, 398, 398, 398, 411,
460 398, 398, 398, 412, 398, 412, 413, 398, 414, 398,
461 415, 416, 398, 417, 418, 398, 419, 420, 398, 421,
462 398, 398, 398, 398, 398, 398, 398, 398, 398, 422,
463 398, 398, 423, 423, 423, 423, 398, 398, 424, 424,
464 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
465 424, 424, 424, 424, 424, 398, 409, 398, 425, 398,
467 410, 411, 398, 398, 412, 412, 412, 412, 413, 398,
468 414, 398, 398, 398, 398, 416, 398, 398, 398, 398,
469 418, 398, 398, 398, 426, 398, 398, 398, 398, 398,
470 398, 427, 398, 428, 420, 421, 398, 398, 398, 429,
471 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
472 398, 422, 398, 423, 423, 423, 423, 424, 424, 424,
473 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
474 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
475 424, 424, 424, 424, 425, 398, 398, 398, 398, 398,
476 398, 398, 415, 398, 398, 398, 398, 417, 398, 430,
478 431, 428, 429, 398, 398, 398, 398, 398, 398, 423,
479 423, 424, 424, 424, 424, 424, 424, 424, 424, 424,
480 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
481 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
482 424, 424, 424, 398, 432, 433, 398, 424, 424, 424,
483 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
484 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
485 424, 424, 424, 424, 424, 424, 424, 424, 424, 434,
486 435, 424, 424, 424, 424, 424, 424, 424, 424, 424,
487 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
489 424, 424, 424, 424, 424, 424, 424, 424, 427, 398,
490 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
491 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
492 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
493 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
494 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
495 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
496 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
497 424, 424, 424, 424, 424, 424, 424, 424, 424, 424,
498 424, 424, 424, 424, 424, 424, 424, 0, 398, 398,
500 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
501 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
502 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
503 398, 398, 398, 398, 398
506 static yyconst
short int yy_nxt
[899] =
508 24, 25, 26, 27, 24, 28, 29, 24, 30, 24,
509 31, 32, 33, 33, 34, 35, 36, 37, 24, 24,
510 24, 31, 31, 24, 24, 24, 31, 31, 31, 31,
511 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
512 31, 31, 31, 31, 31, 31, 31, 31, 31, 38,
513 39, 24, 24, 41, 41, 45, 53, 98, 45, 77,
514 77, 99, 50, 77, 77, 50, 100, 100, 56, 42,
515 42, 43, 43, 42, 54, 43, 42, 46, 43, 42,
516 46, 43, 42, 51, 43, 42, 51, 43, 53, 57,
517 56, 59, 59, 160, 141, 103, 61, 310, 71, 64,
519 142, 107, 108, 161, 72, 42, 54, 43, 104, 57,
520 57, 57, 61, 62, 63, 64, 42, 309, 43, 61,
521 65, 71, 64, 74, 106, 66, 75, 72, 281, 67,
522 74, 76, 42, 75, 43, 146, 113, 114, 76, 42,
523 143, 43, 280, 42, 144, 43, 147, 118, 119, 143,
524 42, 155, 43, 144, 148, 156, 166, 145, 68, 115,
525 69, 61, 62, 63, 64, 167, 145, 137, 157, 65,
526 120, 246, 138, 245, 66, 139, 139, 149, 67, 140,
527 169, 42, 150, 43, 162, 151, 151, 77, 77, 163,
528 173, 177, 219, 170, 179, 100, 100, 171, 141, 178,
530 187, 188, 220, 180, 142, 174, 202, 68, 175, 69,
531 78, 181, 189, 190, 201, 79, 192, 193, 194, 195,
532 197, 198, 139, 139, 139, 139, 79, 79, 204, 205,
533 200, 79, 79, 80, 79, 81, 82, 83, 84, 79,
534 79, 79, 85, 86, 87, 88, 89, 90, 91, 92,
535 93, 94, 79, 95, 96, 123, 206, 207, 123, 107,
536 108, 397, 107, 108, 124, 208, 209, 151, 151, 151,
537 151, 123, 210, 211, 125, 222, 123, 213, 227, 126,
538 127, 214, 106, 232, 128, 106, 396, 233, 187, 188,
539 223, 129, 215, 103, 130, 227, 131, 132, 133, 134,
541 189, 190, 189, 190, 192, 193, 104, 395, 228, 194,
542 195, 194, 195, 197, 198, 204, 205, 206, 207, 143,
543 208, 209, 146, 144, 210, 211, 155, 295, 302, 137,
544 156, 314, 317, 147, 138, 329, 145, 139, 139, 392,
545 394, 148, 393, 157, 295, 302, 391, 390, 314, 317,
546 389, 388, 329, 387, 386, 385, 392, 40, 40, 40,
547 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
548 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
549 44, 44, 44, 47, 47, 47, 47, 47, 47, 47,
550 47, 47, 47, 47, 47, 47, 49, 49, 49, 49,
552 49, 49, 49, 49, 49, 49, 49, 49, 49, 52,
553 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
554 52, 52, 55, 55, 55, 55, 55, 55, 55, 55,
555 55, 55, 55, 55, 55, 58, 58, 58, 58, 58,
556 58, 58, 58, 58, 58, 58, 58, 58, 60, 60,
557 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
558 60, 70, 70, 70, 70, 70, 70, 70, 70, 70,
559 70, 70, 70, 70, 73, 73, 73, 73, 73, 73,
560 73, 73, 73, 73, 73, 73, 73, 97, 97, 101,
561 384, 101, 101, 101, 101, 101, 101, 101, 101, 383,
563 101, 101, 102, 102, 102, 102, 102, 102, 382, 102,
564 102, 102, 102, 381, 102, 105, 380, 105, 105, 105,
565 105, 105, 105, 105, 105, 105, 379, 105, 109, 109,
566 109, 109, 109, 109, 378, 109, 109, 109, 109, 109,
567 109, 111, 111, 377, 111, 111, 111, 111, 111, 111,
568 111, 111, 112, 112, 112, 112, 112, 112, 112, 112,
569 112, 112, 112, 376, 112, 116, 116, 116, 116, 116,
570 375, 116, 116, 116, 116, 116, 117, 117, 117, 117,
571 117, 117, 117, 117, 117, 117, 117, 374, 117, 121,
572 121, 373, 121, 121, 121, 121, 121, 121, 121, 121,
574 121, 122, 122, 122, 122, 122, 122, 122, 122, 122,
575 122, 122, 122, 122, 135, 135, 135, 135, 135, 372,
576 135, 135, 135, 135, 135, 135, 136, 136, 371, 370,
577 369, 368, 136, 136, 136, 136, 136, 367, 136, 152,
578 152, 366, 152, 365, 364, 152, 152, 152, 152, 152,
579 363, 152, 154, 154, 154, 154, 154, 154, 154, 154,
580 154, 154, 154, 362, 154, 158, 158, 158, 185, 361,
581 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
582 185, 203, 360, 203, 203, 203, 203, 203, 203, 203,
583 203, 359, 203, 203, 358, 357, 356, 355, 354, 353,
585 352, 351, 350, 349, 348, 347, 346, 345, 344, 343,
586 342, 341, 340, 339, 338, 337, 336, 335, 334, 333,
587 332, 331, 330, 328, 327, 326, 325, 324, 323, 322,
588 321, 320, 319, 318, 316, 315, 313, 312, 311, 308,
589 307, 306, 305, 304, 303, 301, 300, 299, 298, 297,
590 296, 294, 293, 292, 291, 290, 289, 288, 287, 286,
591 285, 284, 283, 282, 279, 278, 277, 276, 275, 274,
592 273, 272, 271, 270, 269, 268, 267, 266, 265, 264,
593 263, 262, 261, 260, 259, 258, 257, 256, 255, 254,
594 253, 252, 251, 250, 249, 248, 247, 244, 120, 196,
596 115, 191, 243, 242, 241, 240, 239, 238, 237, 236,
597 235, 234, 231, 230, 229, 226, 225, 224, 221, 218,
598 217, 216, 212, 199, 196, 191, 106, 106, 186, 184,
599 183, 182, 176, 172, 168, 165, 164, 159, 153, 110,
600 106, 398, 48, 48, 23, 398, 398, 398, 398, 398,
601 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
602 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
603 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
604 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
605 398, 398, 398, 398, 398, 398, 398, 398
609 static yyconst
short int yy_chk
[899] =
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, 1, 1, 1, 1, 1, 1, 1, 1, 1,
616 1, 1, 1, 3, 4, 5, 11, 32, 6, 25,
617 25, 32, 9, 26, 26, 10, 33, 33, 13, 3,
618 4, 3, 4, 11, 11, 11, 5, 5, 5, 6,
619 6, 6, 9, 9, 9, 10, 10, 10, 12, 13,
620 14, 15, 16, 81, 63, 41, 19, 435, 19, 19,
622 63, 46, 46, 81, 19, 12, 12, 12, 41, 15,
623 16, 14, 17, 17, 17, 17, 19, 434, 19, 20,
624 17, 20, 20, 21, 46, 17, 21, 20, 433, 17,
625 22, 21, 17, 22, 17, 66, 51, 51, 22, 20,
626 65, 20, 432, 21, 65, 21, 66, 54, 54, 72,
627 22, 76, 22, 72, 66, 76, 85, 65, 17, 51,
628 17, 18, 18, 18, 18, 85, 72, 62, 76, 18,
629 54, 431, 62, 430, 18, 62, 62, 67, 18, 62,
630 87, 18, 67, 18, 82, 67, 67, 77, 77, 82,
631 89, 91, 164, 87, 92, 100, 100, 87, 205, 91,
633 104, 104, 164, 92, 205, 89, 428, 18, 89, 18,
634 28, 92, 113, 113, 427, 28, 115, 115, 118, 118,
635 120, 120, 138, 138, 139, 139, 28, 28, 142, 142,
636 426, 28, 28, 28, 28, 28, 28, 28, 28, 28,
637 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
638 28, 28, 28, 28, 28, 57, 145, 145, 57, 106,
639 106, 396, 107, 107, 57, 148, 148, 150, 150, 151,
640 151, 57, 157, 157, 57, 166, 57, 160, 170, 57,
641 57, 160, 106, 174, 57, 107, 395, 174, 187, 187,
642 166, 57, 160, 188, 57, 170, 57, 57, 57, 57,
644 189, 189, 191, 191, 192, 192, 188, 394, 170, 194,
645 194, 196, 196, 197, 197, 204, 204, 206, 206, 207,
646 208, 208, 209, 207, 210, 210, 211, 262, 270, 247,
647 211, 287, 290, 209, 247, 306, 207, 247, 247, 390,
648 393, 209, 392, 211, 262, 270, 389, 384, 287, 290,
649 382, 381, 306, 380, 379, 378, 390, 399, 399, 399,
650 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
651 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
652 400, 400, 400, 401, 401, 401, 401, 401, 401, 401,
653 401, 401, 401, 401, 401, 401, 402, 402, 402, 402,
655 402, 402, 402, 402, 402, 402, 402, 402, 402, 403,
656 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
657 403, 403, 404, 404, 404, 404, 404, 404, 404, 404,
658 404, 404, 404, 404, 404, 405, 405, 405, 405, 405,
659 405, 405, 405, 405, 405, 405, 405, 405, 406, 406,
660 406, 406, 406, 406, 406, 406, 406, 406, 406, 406,
661 406, 407, 407, 407, 407, 407, 407, 407, 407, 407,
662 407, 407, 407, 407, 408, 408, 408, 408, 408, 408,
663 408, 408, 408, 408, 408, 408, 408, 409, 409, 410,
664 376, 410, 410, 410, 410, 410, 410, 410, 410, 375,
666 410, 410, 411, 411, 411, 411, 411, 411, 374, 411,
667 411, 411, 411, 372, 411, 412, 371, 412, 412, 412,
668 412, 412, 412, 412, 412, 412, 370, 412, 413, 413,
669 413, 413, 413, 413, 369, 413, 413, 413, 413, 413,
670 413, 414, 414, 366, 414, 414, 414, 414, 414, 414,
671 414, 414, 415, 415, 415, 415, 415, 415, 415, 415,
672 415, 415, 415, 365, 415, 416, 416, 416, 416, 416,
673 364, 416, 416, 416, 416, 416, 417, 417, 417, 417,
674 417, 417, 417, 417, 417, 417, 417, 363, 417, 418,
675 418, 362, 418, 418, 418, 418, 418, 418, 418, 418,
677 418, 419, 419, 419, 419, 419, 419, 419, 419, 419,
678 419, 419, 419, 419, 420, 420, 420, 420, 420, 361,
679 420, 420, 420, 420, 420, 420, 421, 421, 359, 358,
680 355, 354, 421, 421, 421, 421, 421, 353, 421, 422,
681 422, 352, 422, 351, 350, 422, 422, 422, 422, 422,
682 349, 422, 423, 423, 423, 423, 423, 423, 423, 423,
683 423, 423, 423, 348, 423, 424, 424, 424, 425, 346,
684 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
685 425, 429, 345, 429, 429, 429, 429, 429, 429, 429,
686 429, 344, 429, 429, 342, 341, 340, 339, 338, 337,
688 336, 335, 334, 333, 332, 330, 329, 328, 327, 326,
689 325, 323, 322, 321, 320, 319, 318, 317, 316, 314,
690 313, 312, 308, 304, 302, 301, 300, 299, 297, 296,
691 295, 293, 292, 291, 289, 288, 285, 284, 282, 278,
692 277, 275, 273, 272, 271, 269, 267, 266, 265, 264,
693 263, 261, 260, 259, 257, 256, 255, 254, 253, 252,
694 251, 250, 249, 248, 243, 242, 241, 240, 239, 238,
695 237, 236, 235, 234, 233, 232, 231, 230, 229, 228,
696 227, 226, 225, 224, 223, 222, 221, 220, 219, 218,
697 217, 216, 215, 214, 213, 212, 203, 199, 198, 195,
699 193, 190, 184, 183, 182, 181, 180, 179, 178, 177,
700 176, 175, 173, 172, 171, 169, 168, 167, 165, 163,
701 162, 161, 159, 124, 119, 114, 108, 105, 101, 95,
702 94, 93, 90, 88, 86, 84, 83, 80, 71, 48,
703 44, 23, 8, 7, 398, 398, 398, 398, 398, 398,
704 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
705 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
706 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
707 398, 398, 398, 398, 398, 398, 398, 398, 398, 398,
708 398, 398, 398, 398, 398, 398, 398, 398
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
[103] =
720 217, 218, 219, 220, 221, 222, 223, 224, 225, 226,
721 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
722 237, 238, 239, 240, 241, 242, 243, 244, 245, 246,
723 247, 248, 249, 250, 252, 257, 258, 259, 260, 261,
724 263, 265, 271, 285, 288, 291, 292, 295, 298, 301,
725 309, 315, 330, 331, 341, 346, 361, 362, 377, 378,
726 390, 400, 419, 435, 454, 465, 478, 479, 480, 481,
727 482, 483, 484, 485, 486, 496, 501, 512, 518, 519,
728 520, 522, 539, 545, 546, 547, 549, 566, 569, 572,
729 573, 576, 587, 588, 589, 602, 604, 609, 628, 635,
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 "mbswidth.h"
770 #include "complain.h"
776 /* Each time we match a string, move the end cursor to its end. */
777 #define YY_USER_INIT \
779 LOCATION_RESET (*yylloc); \
780 yylloc->file = infile; \
781 /* This is only to avoid GCC warnings. */ \
782 if (yycontrol) {;}; \
785 #define YY_USER_ACTION extend_location (yylloc, yytext, yyleng);
786 #define YY_STEP LOCATION_STEP (*yylloc)
788 #define YY_INPUT(buf, result, size) ((result) = no_cr_read (yyin, buf, size))
791 /* Read bytes from FP into buffer BUF of size SIZE. Return the
792 number of bytes read. Remove '\r' from input, treating \r\n
793 and isolated \r as \n. */
796 no_cr_read (FILE *fp
, char *buf
, size_t size
)
798 size_t s
= fread (buf
, 1, size
, fp
);
801 char *w
= memchr (buf
, '\r', s
);
805 char const *lim
= buf
+ s
;
809 /* Found an '\r'. Treat it like '\n', but ignore any
810 '\n' that immediately follows. */
815 if (ch
!= '\n' && ungetc (ch
, fp
) != ch
)
821 /* Copy until the next '\r'. */
827 while ((*w
++ = *r
++) != '\r');
838 /* Extend *LOC to account for token TOKEN of size SIZE. */
841 extend_location (location_t
*loc
, char const *token
, int size
)
843 int line
= loc
->last_line
;
844 int column
= loc
->last_column
;
845 char const *p0
= token
;
846 char const *p
= token
;
847 char const *lim
= token
+ size
;
849 for (p
= token
; p
< lim
; p
++)
853 /* \r shouldn't survive no_cr_read. */
863 column
+= mbsnwidth (p0
, p
- p0
, 0);
864 column
+= 8 - ((column
- 1) & 7);
869 loc
->last_line
= line
;
870 loc
->last_column
= column
+ mbsnwidth (p0
, p
- p0
, 0);
875 /* STRING_OBSTACK -- Used to store all the characters that we need to
876 keep (to construct ID, STRINGS etc.). Use the following macros to
879 Use YY_OBS_GROW to append what has just been matched, and
880 YY_OBS_FINISH to end the string (it puts the ending 0).
881 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
882 used, and which is used by YY_OBS_FREE to free the last string. */
884 static struct obstack string_obstack
;
887 #define YY_OBS_GROW \
888 obstack_grow (&string_obstack, yytext, yyleng)
890 #define YY_OBS_FINISH \
892 obstack_1grow (&string_obstack, '\0'); \
893 last_string = obstack_finish (&string_obstack); \
896 #define YY_OBS_FREE \
898 obstack_free (&string_obstack, last_string); \
902 scanner_last_string_free (void)
908 static int percent_percent_count
= 0;
910 /* Within well-formed rules, RULE_LENGTH is the number of values in
911 the current rule so far, which says where to find `$0' with respect
912 to the top of the stack. It is not the same as the rule->length in
913 the case of mid rule actions.
915 Outside of well-formed rules, RULE_LENGTH has an undefined value. */
916 static int rule_length
;
918 static void handle_dollar (braced_code_t code_kind
,
919 char *cp
, location_t location
);
920 static void handle_at (braced_code_t code_kind
,
921 char *cp
, location_t location
);
922 static int convert_ucn_to_byte (char const *hex_text
);
925 #define SC_LINE_COMMENT 2
926 #define SC_YACC_COMMENT 3
929 #define SC_CHARACTER 5
931 #define SC_ESCAPED_STRING 6
932 #define SC_ESCAPED_CHARACTER 7
934 #define SC_BRACED_CODE 8
935 #define SC_PROLOGUE 9
936 #define SC_EPILOGUE 10
938 /* POSIX says that a tag must be both an id and a C union member, but
939 historically almost any character is allowed in a tag. We disallow
940 NUL and newline, as this simplifies our implementation. */
941 /* Zero or more instances of backslash-newline. Following GCC, allow
942 white space between the backslash and the newline. */
943 #line 944 "scan-gram.c"
945 /* Macros after this point can all be overridden by user definitions in
949 #ifndef YY_SKIP_YYWRAP
951 extern "C" int yywrap
YY_PROTO(( void ));
953 extern int yywrap
YY_PROTO(( void ));
958 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
962 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
965 #ifdef YY_NEED_STRLEN
966 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
971 static int yyinput
YY_PROTO(( void ));
973 static int input
YY_PROTO(( void ));
978 static int yy_start_stack_ptr
= 0;
979 static int yy_start_stack_depth
= 0;
980 static int *yy_start_stack
= 0;
981 #ifndef YY_NO_PUSH_STATE
982 static void yy_push_state
YY_PROTO(( int new_state
));
984 #ifndef YY_NO_POP_STATE
985 static void yy_pop_state
YY_PROTO(( void ));
987 #ifndef YY_NO_TOP_STATE
988 static int yy_top_state
YY_PROTO(( void ));
992 #define YY_NO_PUSH_STATE 1
993 #define YY_NO_POP_STATE 1
994 #define YY_NO_TOP_STATE 1
997 #ifdef YY_MALLOC_DECL
1005 /* Just try to get by without declaring the routines. This will fail
1006 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1007 * or sizeof(void*) != sizeof(int).
1012 /* Amount of stuff to slurp up with each read. */
1013 #ifndef YY_READ_BUF_SIZE
1014 #define YY_READ_BUF_SIZE 8192
1017 /* Copy whatever the last rule matched to the standard output. */
1020 /* This used to be an fputs(), but since the string might contain NUL's,
1021 * we now use fwrite().
1023 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1026 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1027 * is returned in "result".
1030 #define YY_INPUT(buf,result,max_size) \
1031 if ( yy_current_buffer->yy_is_interactive ) \
1034 for ( n = 0; n < max_size && \
1035 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1036 buf[n] = (char) c; \
1038 buf[n++] = (char) c; \
1039 if ( c == EOF && ferror( yyin ) ) \
1040 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1043 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1044 && ferror( yyin ) ) \
1045 YY_FATAL_ERROR( "input in flex scanner failed" );
1048 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1049 * we don't want an extra ';' after the "return" because that will cause
1050 * some compilers to complain about unreachable statements.
1053 #define yyterminate() return YY_NULL
1056 /* Number of entries by which start-condition stack grows. */
1057 #ifndef YY_START_STACK_INCR
1058 #define YY_START_STACK_INCR 25
1061 /* Report a fatal error. */
1062 #ifndef YY_FATAL_ERROR
1063 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1066 /* Default declaration of generated scanner - a define so the user can
1067 * easily add parameters.
1070 #define YY_DECL int yylex YY_PROTO(( void ))
1073 /* Code executed at the beginning of each rule, after yytext and yyleng
1076 #ifndef YY_USER_ACTION
1077 #define YY_USER_ACTION
1080 /* Code executed at the end of each rule. */
1082 #define YY_BREAK break;
1085 #define YY_RULE_SETUP \
1090 register yy_state_type yy_current_state
;
1091 register char *yy_cp
, *yy_bp
;
1092 register int yy_act
;
1094 #line 202 "scan-gram.l"
1097 int braces_level
IF_LINT (= 0);
1099 /* At each yylex invocation, mark the current position as the
1100 start of the next token. */
1105 /*----------------------------.
1106 | Scanning Bison directives. |
1107 `----------------------------*/
1108 #line 1109 "scan-gram.c"
1119 yy_start
= 1; /* first start state */
1127 if ( ! yy_current_buffer
)
1129 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1131 yy_load_buffer_state();
1134 while ( 1 ) /* loops until end-of-file is reached */
1138 /* Support of yytext. */
1139 *yy_cp
= yy_hold_char
;
1141 /* yy_bp points to the position in yy_ch_buf of the start of
1146 yy_current_state
= yy_start
;
1150 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1151 if ( yy_accept
[yy_current_state
] )
1153 yy_last_accepting_state
= yy_current_state
;
1154 yy_last_accepting_cpos
= yy_cp
;
1156 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1158 yy_current_state
= (int) yy_def
[yy_current_state
];
1159 if ( yy_current_state
>= 399 )
1160 yy_c
= yy_meta
[(unsigned int) yy_c
];
1162 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1165 while ( yy_base
[yy_current_state
] != 845 );
1168 yy_act
= yy_accept
[yy_current_state
];
1170 { /* have to back up */
1171 yy_cp
= yy_last_accepting_cpos
;
1172 yy_current_state
= yy_last_accepting_state
;
1173 yy_act
= yy_accept
[yy_current_state
];
1176 YY_DO_BEFORE_ACTION
;
1179 do_action
: /* This label is used only to access EOF actions. */
1181 if ( yy_flex_debug
)
1184 fprintf( stderr
, "--scanner backing up\n" );
1185 else if ( yy_act
< 103 )
1186 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1187 yy_rule_linenum
[yy_act
], yytext
);
1188 else if ( yy_act
== 103 )
1189 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1191 else if ( yy_act
== 104 )
1192 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1194 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1198 { /* beginning of action switch */
1199 case 0: /* must back up */
1200 /* undo the effects of YY_DO_BEFORE_ACTION */
1201 *yy_cp
= yy_hold_char
;
1202 yy_cp
= yy_last_accepting_cpos
;
1203 yy_current_state
= yy_last_accepting_state
;
1204 goto yy_find_action
;
1210 #line 217 "scan-gram.l"
1211 return PERCENT_NONASSOC
;
1215 #line 218 "scan-gram.l"
1216 return PERCENT_DEBUG
;
1220 #line 219 "scan-gram.l"
1221 return PERCENT_DEFINE
;
1225 #line 220 "scan-gram.l"
1226 return PERCENT_DEFINES
;
1230 #line 221 "scan-gram.l"
1231 return PERCENT_DESTRUCTOR
;
1235 #line 222 "scan-gram.l"
1236 return PERCENT_DPREC
;
1240 #line 223 "scan-gram.l"
1241 return PERCENT_ERROR_VERBOSE
;
1245 #line 224 "scan-gram.l"
1246 return PERCENT_EXPECT
;
1250 #line 225 "scan-gram.l"
1251 return PERCENT_FILE_PREFIX
;
1255 #line 226 "scan-gram.l"
1256 return PERCENT_YACC
;
1260 #line 227 "scan-gram.l"
1261 return PERCENT_GLR_PARSER
;
1265 #line 228 "scan-gram.l"
1266 return PERCENT_LEFT
;
1270 #line 229 "scan-gram.l"
1271 return PERCENT_LOCATIONS
;
1275 #line 230 "scan-gram.l"
1276 return PERCENT_MERGE
;
1280 #line 231 "scan-gram.l"
1281 return PERCENT_NAME_PREFIX
;
1285 #line 232 "scan-gram.l"
1286 return PERCENT_NO_LINES
;
1290 #line 233 "scan-gram.l"
1291 return PERCENT_NONASSOC
;
1295 #line 234 "scan-gram.l"
1296 return PERCENT_NTERM
;
1300 #line 235 "scan-gram.l"
1301 return PERCENT_OUTPUT
;
1305 #line 236 "scan-gram.l"
1306 return PERCENT_PARSE_PARAM
;
1310 #line 237 "scan-gram.l"
1311 rule_length
--; return PERCENT_PREC
;
1315 #line 238 "scan-gram.l"
1316 return PERCENT_PRINTER
;
1320 #line 239 "scan-gram.l"
1321 return PERCENT_PURE_PARSER
;
1325 #line 240 "scan-gram.l"
1326 return PERCENT_RIGHT
;
1330 #line 241 "scan-gram.l"
1331 return PERCENT_LEX_PARAM
;
1335 #line 242 "scan-gram.l"
1336 return PERCENT_SKELETON
;
1340 #line 243 "scan-gram.l"
1341 return PERCENT_START
;
1345 #line 244 "scan-gram.l"
1346 return PERCENT_TOKEN
;
1350 #line 245 "scan-gram.l"
1351 return PERCENT_TOKEN
;
1355 #line 246 "scan-gram.l"
1356 return PERCENT_TOKEN_TABLE
;
1360 #line 247 "scan-gram.l"
1361 return PERCENT_TYPE
;
1365 #line 248 "scan-gram.l"
1366 return PERCENT_UNION
;
1370 #line 249 "scan-gram.l"
1371 return PERCENT_VERBOSE
;
1375 #line 250 "scan-gram.l"
1376 return PERCENT_YACC
;
1380 #line 252 "scan-gram.l"
1382 complain_at (*yylloc
, _("invalid directive: %s"), quote (yytext
));
1388 #line 257 "scan-gram.l"
1393 #line 258 "scan-gram.l"
1394 rule_length
= 0; return COLON
;
1398 #line 259 "scan-gram.l"
1399 rule_length
= 0; return PIPE
;
1403 #line 260 "scan-gram.l"
1408 #line 261 "scan-gram.l"
1413 #line 263 "scan-gram.l"
1418 #line 265 "scan-gram.l"
1420 yylval
->symbol
= symbol_get (yytext
, *yylloc
);
1427 #line 271 "scan-gram.l"
1431 num
= strtoul (yytext
, 0, 10);
1432 if (INT_MAX
< num
|| errno
)
1434 complain_at (*yylloc
, _("invalid value: %s"), quote (yytext
));
1437 yylval
->integer
= num
;
1441 /* Characters. We don't check there is only one. */
1444 #line 285 "scan-gram.l"
1445 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1450 #line 288 "scan-gram.l"
1451 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1456 #line 291 "scan-gram.l"
1457 BEGIN SC_YACC_COMMENT
;
1461 #line 292 "scan-gram.l"
1467 #line 295 "scan-gram.l"
1468 yy_push_state (SC_PROLOGUE
);
1470 /* Code in between braces. */
1473 #line 298 "scan-gram.l"
1474 YY_OBS_GROW
; braces_level
= 0; yy_push_state (SC_BRACED_CODE
);
1479 #line 301 "scan-gram.l"
1481 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1483 yylval
->string
= last_string
;
1489 #line 309 "scan-gram.l"
1491 if (++percent_percent_count
== 2)
1492 yy_push_state (SC_EPILOGUE
);
1493 return PERCENT_PERCENT
;
1498 #line 315 "scan-gram.l"
1500 complain_at (*yylloc
, _("invalid character: %s"), quote (yytext
));
1505 /*-------------------------------------------------------------------.
1506 | Whatever the start condition (but those which correspond to |
1507 | entities `swallowed' by Bison: SC_YACC_COMMENT, SC_ESCAPED_STRING, |
1508 | and SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1509 `-------------------------------------------------------------------*/
1514 #line 330 "scan-gram.l"
1515 obstack_sgrow (&string_obstack
, "@<:@");
1519 #line 331 "scan-gram.l"
1520 obstack_sgrow (&string_obstack
, "@:>@");
1523 /*---------------------------------------------------------------.
1524 | Scanning a Yacc comment. The initial `/ *' is already eaten. |
1525 `---------------------------------------------------------------*/
1530 #line 341 "scan-gram.l"
1538 #line 346 "scan-gram.l"
1541 case YY_STATE_EOF(SC_YACC_COMMENT
):
1542 #line 348 "scan-gram.l"
1544 complain_at (*yylloc
, _("unexpected end of file in a comment"));
1549 /*------------------------------------------------------------.
1550 | Scanning a C comment. The initial `/ *' is already eaten. |
1551 `------------------------------------------------------------*/
1556 #line 361 "scan-gram.l"
1557 YY_OBS_GROW
; yy_pop_state ();
1561 #line 362 "scan-gram.l"
1564 case YY_STATE_EOF(SC_COMMENT
):
1565 #line 364 "scan-gram.l"
1567 complain_at (*yylloc
, _("unexpected end of file in a comment"));
1572 /*--------------------------------------------------------------.
1573 | Scanning a line comment. The initial `//' is already eaten. |
1574 `--------------------------------------------------------------*/
1579 #line 377 "scan-gram.l"
1580 YY_OBS_GROW
; yy_pop_state ();
1584 #line 378 "scan-gram.l"
1587 case YY_STATE_EOF(SC_LINE_COMMENT
):
1588 #line 379 "scan-gram.l"
1592 /*----------------------------------------------------------------.
1593 | Scanning a C string, including its escapes. The initial `"' is |
1595 `----------------------------------------------------------------*/
1600 #line 390 "scan-gram.l"
1602 assert (yy_top_state () == INITIAL
);
1605 yylval
->string
= last_string
;
1613 #line 400 "scan-gram.l"
1616 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1617 #line 402 "scan-gram.l"
1619 complain_at (*yylloc
, _("unexpected end of file in a string"));
1620 assert (yy_top_state () == INITIAL
);
1622 yylval
->string
= last_string
;
1628 /*---------------------------------------------------------------.
1629 | Scanning a C character, decoding its escapes. The initial "'" |
1630 | is already eaten. |
1631 `---------------------------------------------------------------*/
1636 #line 419 "scan-gram.l"
1639 assert (yy_top_state () == INITIAL
);
1642 yylval
->symbol
= symbol_get (last_string
, *yylloc
);
1643 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1644 symbol_user_token_number_set (yylval
->symbol
,
1645 (unsigned char) last_string
[1], *yylloc
);
1655 #line 435 "scan-gram.l"
1658 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1659 #line 437 "scan-gram.l"
1661 complain_at (*yylloc
, _("unexpected end of file in a character"));
1662 assert (yy_top_state () == INITIAL
);
1664 yylval
->string
= last_string
;
1670 /*----------------------------.
1671 | Decode escaped characters. |
1672 `----------------------------*/
1677 #line 454 "scan-gram.l"
1679 unsigned long c
= strtoul (yytext
+ 1, 0, 8);
1682 complain_at (*yylloc
, _("invalid escape: %s"), quote (yytext
));
1686 obstack_1grow (&string_obstack
, c
);
1691 #line 465 "scan-gram.l"
1695 c
= strtoul (yytext
+ 2, 0, 16);
1696 if (UCHAR_MAX
< c
|| errno
)
1698 complain_at (*yylloc
, _("invalid escape: %s"), quote (yytext
));
1702 obstack_1grow (&string_obstack
, c
);
1707 #line 478 "scan-gram.l"
1708 obstack_1grow (&string_obstack
, '\a');
1712 #line 479 "scan-gram.l"
1713 obstack_1grow (&string_obstack
, '\b');
1717 #line 480 "scan-gram.l"
1718 obstack_1grow (&string_obstack
, '\f');
1722 #line 481 "scan-gram.l"
1723 obstack_1grow (&string_obstack
, '\n');
1727 #line 482 "scan-gram.l"
1728 obstack_1grow (&string_obstack
, '\r');
1732 #line 483 "scan-gram.l"
1733 obstack_1grow (&string_obstack
, '\t');
1737 #line 484 "scan-gram.l"
1738 obstack_1grow (&string_obstack
, '\v');
1742 #line 485 "scan-gram.l"
1743 obstack_1grow (&string_obstack
, yytext
[1]);
1747 #line 486 "scan-gram.l"
1749 int c
= convert_ucn_to_byte (yytext
);
1752 complain_at (*yylloc
, _("invalid escape: %s"), quote (yytext
));
1756 obstack_1grow (&string_obstack
, c
);
1761 #line 496 "scan-gram.l"
1763 complain_at (*yylloc
, _("unrecognized escape: %s"), quote (yytext
));
1767 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1770 #line 501 "scan-gram.l"
1774 /*----------------------------------------------------------.
1775 | Scanning a C character without decoding its escapes. The |
1776 | initial "'" is already eaten. |
1777 `----------------------------------------------------------*/
1782 #line 512 "scan-gram.l"
1785 assert (yy_top_state () != INITIAL
);
1791 #line 518 "scan-gram.l"
1796 #line 519 "scan-gram.l"
1801 #line 520 "scan-gram.l"
1804 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1807 #line 522 "scan-gram.l"
1810 case YY_STATE_EOF(SC_CHARACTER
):
1811 #line 524 "scan-gram.l"
1813 complain_at (*yylloc
, _("unexpected end of file in a character"));
1814 assert (yy_top_state () != INITIAL
);
1819 /*----------------------------------------------------------------.
1820 | Scanning a C string, without decoding its escapes. The initial |
1821 | `"' is already eaten. |
1822 `----------------------------------------------------------------*/
1827 #line 539 "scan-gram.l"
1829 assert (yy_top_state () != INITIAL
);
1836 #line 545 "scan-gram.l"
1841 #line 546 "scan-gram.l"
1846 #line 547 "scan-gram.l"
1849 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1852 #line 549 "scan-gram.l"
1855 case YY_STATE_EOF(SC_STRING
):
1856 #line 551 "scan-gram.l"
1858 complain_at (*yylloc
, _("unexpected end of file in a string"));
1859 assert (yy_top_state () != INITIAL
);
1864 /*---------------------------------------------------.
1865 | Strings, comments etc. can be found in user code. |
1866 `---------------------------------------------------*/
1869 /* Characters. We don't check there is only one. */
1872 #line 566 "scan-gram.l"
1873 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1878 #line 569 "scan-gram.l"
1879 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1884 #line 572 "scan-gram.l"
1885 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1889 #line 573 "scan-gram.l"
1890 YY_OBS_GROW
; yy_push_state (SC_LINE_COMMENT
);
1895 #line 576 "scan-gram.l"
1899 /*---------------------------------------------------------------.
1900 | Scanning some code in braces (%union and actions). The initial |
1901 | "{" is already eaten. |
1902 `---------------------------------------------------------------*/
1907 #line 587 "scan-gram.l"
1908 YY_OBS_GROW
; braces_level
++;
1912 #line 588 "scan-gram.l"
1913 YY_OBS_GROW
; braces_level
--;
1917 #line 589 "scan-gram.l"
1921 if (braces_level
< 0)
1925 yylval
->string
= last_string
;
1933 #line 602 "scan-gram.l"
1934 { handle_dollar (current_braced_code
,
1939 #line 604 "scan-gram.l"
1940 { handle_at (current_braced_code
,
1943 /* `"<"{splice}"<"' tokenizes `<<%' correctly (as `<<' `%') rather
1944 than incorrrectly (as `<' `<%'). */
1947 #line 609 "scan-gram.l"
1950 case YY_STATE_EOF(SC_BRACED_CODE
):
1951 #line 611 "scan-gram.l"
1953 complain_at (*yylloc
, _("unexpected end of file in a braced code"));
1956 yylval
->string
= last_string
;
1961 /*--------------------------------------------------------------.
1962 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1963 `--------------------------------------------------------------*/
1968 #line 628 "scan-gram.l"
1972 yylval
->string
= last_string
;
1978 #line 635 "scan-gram.l"
1983 #line 636 "scan-gram.l"
1986 case YY_STATE_EOF(SC_PROLOGUE
):
1987 #line 638 "scan-gram.l"
1989 complain_at (*yylloc
, _("unexpected end of file in a prologue"));
1992 yylval
->string
= last_string
;
1997 /*---------------------------------------------------------------.
1998 | Scanning the epilogue (everything after the second "%%", which |
1999 | has already been eaten). |
2000 `---------------------------------------------------------------*/
2005 #line 655 "scan-gram.l"
2008 case YY_STATE_EOF(SC_EPILOGUE
):
2009 #line 657 "scan-gram.l"
2013 yylval
->string
= last_string
;
2020 #line 666 "scan-gram.l"
2021 YY_FATAL_ERROR( "flex scanner jammed" );
2023 #line 2024 "scan-gram.c"
2024 case YY_STATE_EOF(INITIAL
):
2027 case YY_END_OF_BUFFER
:
2029 /* Amount of text matched not including the EOB char. */
2030 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
2032 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2033 *yy_cp
= yy_hold_char
;
2034 YY_RESTORE_YY_MORE_OFFSET
2036 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
2038 /* We're scanning a new file or input source. It's
2039 * possible that this happened because the user
2040 * just pointed yyin at a new source and called
2041 * yylex(). If so, then we have to assure
2042 * consistency between yy_current_buffer and our
2043 * globals. Here is the right place to do so, because
2044 * this is the first action (other than possibly a
2045 * back-up) that will match for the new input source.
2047 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2048 yy_current_buffer
->yy_input_file
= yyin
;
2049 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2052 /* Note that here we test for yy_c_buf_p "<=" to the position
2053 * of the first EOB in the buffer, since yy_c_buf_p will
2054 * already have been incremented past the NUL character
2055 * (since all states make transitions on EOB to the
2056 * end-of-buffer state). Contrast this with the test
2059 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2060 { /* This was really a NUL. */
2061 yy_state_type yy_next_state
;
2063 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
2065 yy_current_state
= yy_get_previous_state();
2067 /* Okay, we're now positioned to make the NUL
2068 * transition. We couldn't have
2069 * yy_get_previous_state() go ahead and do it
2070 * for us because it doesn't know how to deal
2071 * with the possibility of jamming (and we don't
2072 * want to build jamming into it because then it
2073 * will run more slowly).
2076 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
2078 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2080 if ( yy_next_state
)
2082 /* Consume the NUL. */
2083 yy_cp
= ++yy_c_buf_p
;
2084 yy_current_state
= yy_next_state
;
2091 goto yy_find_action
;
2095 else switch ( yy_get_next_buffer() )
2097 case EOB_ACT_END_OF_FILE
:
2099 yy_did_buffer_switch_on_eof
= 0;
2103 /* Note: because we've taken care in
2104 * yy_get_next_buffer() to have set up
2105 * yytext, we can now set up
2106 * yy_c_buf_p so that if some total
2107 * hoser (like flex itself) wants to
2108 * call the scanner after we return the
2109 * YY_NULL, it'll still work - another
2110 * YY_NULL will get returned.
2112 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
2114 yy_act
= YY_STATE_EOF(YY_START
);
2120 if ( ! yy_did_buffer_switch_on_eof
)
2126 case EOB_ACT_CONTINUE_SCAN
:
2128 yytext_ptr
+ yy_amount_of_matched_text
;
2130 yy_current_state
= yy_get_previous_state();
2133 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2136 case EOB_ACT_LAST_MATCH
:
2138 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
2140 yy_current_state
= yy_get_previous_state();
2143 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2144 goto yy_find_action
;
2151 "fatal flex scanner internal error--no action found" );
2152 } /* end of action switch */
2153 } /* end of scanning one token */
2154 } /* end of yylex */
2157 /* yy_get_next_buffer - try to read in a new buffer
2159 * Returns a code representing an action:
2160 * EOB_ACT_LAST_MATCH -
2161 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2162 * EOB_ACT_END_OF_FILE - end of file
2165 static int yy_get_next_buffer()
2167 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2168 register char *source
= yytext_ptr
;
2169 register int number_to_move
, i
;
2172 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2174 "fatal flex scanner internal error--end of buffer missed" );
2176 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2177 { /* Don't try to fill the buffer, so this is an EOF. */
2178 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2180 /* We matched a single character, the EOB, so
2181 * treat this as a final EOF.
2183 return EOB_ACT_END_OF_FILE
;
2188 /* We matched some text prior to the EOB, first
2191 return EOB_ACT_LAST_MATCH
;
2195 /* Try to read more data. */
2197 /* First move last chars to start of buffer. */
2198 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2200 for ( i
= 0; i
< number_to_move
; ++i
)
2201 *(dest
++) = *(source
++);
2203 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2204 /* don't do the read, it's not guaranteed to return an EOF,
2207 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2212 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2214 while ( num_to_read
<= 0 )
2215 { /* Not enough room in the buffer - grow it. */
2216 #ifdef YY_USES_REJECT
2218 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2221 /* just a shorter name for the current buffer */
2222 YY_BUFFER_STATE b
= yy_current_buffer
;
2224 int yy_c_buf_p_offset
=
2225 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2227 if ( b
->yy_is_our_buffer
)
2229 int new_size
= b
->yy_buf_size
* 2;
2231 if ( new_size
<= 0 )
2232 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2234 b
->yy_buf_size
*= 2;
2236 b
->yy_ch_buf
= (char *)
2237 /* Include room in for 2 EOB chars. */
2238 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2239 b
->yy_buf_size
+ 2 );
2242 /* Can't grow it, we don't own it. */
2245 if ( ! b
->yy_ch_buf
)
2247 "fatal error - scanner input buffer overflow" );
2249 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2251 num_to_read
= yy_current_buffer
->yy_buf_size
-
2256 if ( num_to_read
> YY_READ_BUF_SIZE
)
2257 num_to_read
= YY_READ_BUF_SIZE
;
2259 /* Read in more data. */
2260 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2261 yy_n_chars
, num_to_read
);
2263 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2266 if ( yy_n_chars
== 0 )
2268 if ( number_to_move
== YY_MORE_ADJ
)
2270 ret_val
= EOB_ACT_END_OF_FILE
;
2276 ret_val
= EOB_ACT_LAST_MATCH
;
2277 yy_current_buffer
->yy_buffer_status
=
2278 YY_BUFFER_EOF_PENDING
;
2283 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2285 yy_n_chars
+= number_to_move
;
2286 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2287 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2289 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2295 /* yy_get_previous_state - get the state just before the EOB char was reached */
2297 static yy_state_type
yy_get_previous_state()
2299 register yy_state_type yy_current_state
;
2300 register char *yy_cp
;
2302 yy_current_state
= yy_start
;
2304 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2306 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 53);
2307 if ( yy_accept
[yy_current_state
] )
2309 yy_last_accepting_state
= yy_current_state
;
2310 yy_last_accepting_cpos
= yy_cp
;
2312 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2314 yy_current_state
= (int) yy_def
[yy_current_state
];
2315 if ( yy_current_state
>= 399 )
2316 yy_c
= yy_meta
[(unsigned int) yy_c
];
2318 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2321 return yy_current_state
;
2325 /* yy_try_NUL_trans - try to make a transition on the NUL character
2328 * next_state = yy_try_NUL_trans( current_state );
2331 #ifdef YY_USE_PROTOS
2332 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2334 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2335 yy_state_type yy_current_state
;
2338 register int yy_is_jam
;
2339 register char *yy_cp
= yy_c_buf_p
;
2341 register YY_CHAR yy_c
= 53;
2342 if ( yy_accept
[yy_current_state
] )
2344 yy_last_accepting_state
= yy_current_state
;
2345 yy_last_accepting_cpos
= yy_cp
;
2347 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2349 yy_current_state
= (int) yy_def
[yy_current_state
];
2350 if ( yy_current_state
>= 399 )
2351 yy_c
= yy_meta
[(unsigned int) yy_c
];
2353 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2354 yy_is_jam
= (yy_current_state
== 398);
2356 return yy_is_jam
? 0 : yy_current_state
;
2361 #ifdef YY_USE_PROTOS
2362 static void yyunput( int c
, register char *yy_bp
)
2364 static void yyunput( c
, yy_bp
)
2366 register char *yy_bp
;
2369 register char *yy_cp
= yy_c_buf_p
;
2371 /* undo effects of setting up yytext */
2372 *yy_cp
= yy_hold_char
;
2374 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2375 { /* need to shift things up to make room */
2376 /* +2 for EOB chars. */
2377 register int number_to_move
= yy_n_chars
+ 2;
2378 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2379 yy_current_buffer
->yy_buf_size
+ 2];
2380 register char *source
=
2381 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2383 while ( source
> yy_current_buffer
->yy_ch_buf
)
2384 *--dest
= *--source
;
2386 yy_cp
+= (int) (dest
- source
);
2387 yy_bp
+= (int) (dest
- source
);
2388 yy_current_buffer
->yy_n_chars
=
2389 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2391 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2392 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2395 *--yy_cp
= (char) c
;
2399 yy_hold_char
= *yy_cp
;
2402 #endif /* ifndef YY_NO_UNPUT */
2406 static int yyinput()
2413 *yy_c_buf_p
= yy_hold_char
;
2415 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2417 /* yy_c_buf_p now points to the character we want to return.
2418 * If this occurs *before* the EOB characters, then it's a
2419 * valid NUL; if not, then we've hit the end of the buffer.
2421 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2422 /* This was really a NUL. */
2426 { /* need more input */
2427 int offset
= yy_c_buf_p
- yytext_ptr
;
2430 switch ( yy_get_next_buffer() )
2432 case EOB_ACT_LAST_MATCH
:
2433 /* This happens because yy_g_n_b()
2434 * sees that we've accumulated a
2435 * token and flags that we need to
2436 * try matching the token before
2437 * proceeding. But for input(),
2438 * there's no matching to consider.
2439 * So convert the EOB_ACT_LAST_MATCH
2440 * to EOB_ACT_END_OF_FILE.
2443 /* Reset buffer status. */
2448 case EOB_ACT_END_OF_FILE
:
2453 if ( ! yy_did_buffer_switch_on_eof
)
2462 case EOB_ACT_CONTINUE_SCAN
:
2463 yy_c_buf_p
= yytext_ptr
+ offset
;
2469 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2470 *yy_c_buf_p
= '\0'; /* preserve yytext */
2471 yy_hold_char
= *++yy_c_buf_p
;
2478 #ifdef YY_USE_PROTOS
2479 void yyrestart( FILE *input_file
)
2481 void yyrestart( input_file
)
2485 if ( ! yy_current_buffer
)
2486 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2488 yy_init_buffer( yy_current_buffer
, input_file
);
2489 yy_load_buffer_state();
2493 #ifdef YY_USE_PROTOS
2494 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2496 void yy_switch_to_buffer( new_buffer
)
2497 YY_BUFFER_STATE new_buffer
;
2500 if ( yy_current_buffer
== new_buffer
)
2503 if ( yy_current_buffer
)
2505 /* Flush out information for old buffer. */
2506 *yy_c_buf_p
= yy_hold_char
;
2507 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2508 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2511 yy_current_buffer
= new_buffer
;
2512 yy_load_buffer_state();
2514 /* We don't actually know whether we did this switch during
2515 * EOF (yywrap()) processing, but the only time this flag
2516 * is looked at is after yywrap() is called, so it's safe
2517 * to go ahead and always set it.
2519 yy_did_buffer_switch_on_eof
= 1;
2523 #ifdef YY_USE_PROTOS
2524 void yy_load_buffer_state( void )
2526 void yy_load_buffer_state()
2529 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2530 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2531 yyin
= yy_current_buffer
->yy_input_file
;
2532 yy_hold_char
= *yy_c_buf_p
;
2536 #ifdef YY_USE_PROTOS
2537 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2539 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2546 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2548 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2550 b
->yy_buf_size
= size
;
2552 /* yy_ch_buf has to be 2 characters longer than the size given because
2553 * we need to put in 2 end-of-buffer characters.
2555 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2556 if ( ! b
->yy_ch_buf
)
2557 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2559 b
->yy_is_our_buffer
= 1;
2561 yy_init_buffer( b
, file
);
2567 #ifdef YY_USE_PROTOS
2568 void yy_delete_buffer( YY_BUFFER_STATE b
)
2570 void yy_delete_buffer( b
)
2577 if ( b
== yy_current_buffer
)
2578 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2580 if ( b
->yy_is_our_buffer
)
2581 yy_flex_free( (void *) b
->yy_ch_buf
);
2583 yy_flex_free( (void *) b
);
2587 #ifndef YY_ALWAYS_INTERACTIVE
2588 #ifndef YY_NEVER_INTERACTIVE
2589 extern int isatty
YY_PROTO(( int ));
2593 #ifdef YY_USE_PROTOS
2594 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2596 void yy_init_buffer( b
, file
)
2603 yy_flush_buffer( b
);
2605 b
->yy_input_file
= file
;
2606 b
->yy_fill_buffer
= 1;
2608 #if YY_ALWAYS_INTERACTIVE
2609 b
->yy_is_interactive
= 1;
2611 #if YY_NEVER_INTERACTIVE
2612 b
->yy_is_interactive
= 0;
2614 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2620 #ifdef YY_USE_PROTOS
2621 void yy_flush_buffer( YY_BUFFER_STATE b
)
2623 void yy_flush_buffer( b
)
2633 /* We always need two end-of-buffer characters. The first causes
2634 * a transition to the end-of-buffer state. The second causes
2635 * a jam in that state.
2637 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2638 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2640 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2643 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2645 if ( b
== yy_current_buffer
)
2646 yy_load_buffer_state();
2650 #ifndef YY_NO_SCAN_BUFFER
2651 #ifdef YY_USE_PROTOS
2652 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2654 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2662 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2663 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2664 /* They forgot to leave room for the EOB's. */
2667 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2669 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2671 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2672 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2673 b
->yy_is_our_buffer
= 0;
2674 b
->yy_input_file
= 0;
2675 b
->yy_n_chars
= b
->yy_buf_size
;
2676 b
->yy_is_interactive
= 0;
2678 b
->yy_fill_buffer
= 0;
2679 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2681 yy_switch_to_buffer( b
);
2688 #ifndef YY_NO_SCAN_STRING
2689 #ifdef YY_USE_PROTOS
2690 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2692 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2693 yyconst
char *yy_str
;
2697 for ( len
= 0; yy_str
[len
]; ++len
)
2700 return yy_scan_bytes( yy_str
, len
);
2705 #ifndef YY_NO_SCAN_BYTES
2706 #ifdef YY_USE_PROTOS
2707 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2709 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2710 yyconst
char *bytes
;
2719 /* Get memory for full buffer, including space for trailing EOB's. */
2721 buf
= (char *) yy_flex_alloc( n
);
2723 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2725 for ( i
= 0; i
< len
; ++i
)
2728 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2730 b
= yy_scan_buffer( buf
, n
);
2732 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2734 /* It's okay to grow etc. this buffer, and we should throw it
2735 * away when we're done.
2737 b
->yy_is_our_buffer
= 1;
2744 #ifndef YY_NO_PUSH_STATE
2745 #ifdef YY_USE_PROTOS
2746 static void yy_push_state( int new_state
)
2748 static void yy_push_state( new_state
)
2752 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2756 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2757 new_size
= yy_start_stack_depth
* sizeof( int );
2759 if ( ! yy_start_stack
)
2760 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2763 yy_start_stack
= (int *) yy_flex_realloc(
2764 (void *) yy_start_stack
, new_size
);
2766 if ( ! yy_start_stack
)
2768 "out of memory expanding start-condition stack" );
2771 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2778 #ifndef YY_NO_POP_STATE
2779 static void yy_pop_state()
2781 if ( --yy_start_stack_ptr
< 0 )
2782 YY_FATAL_ERROR( "start-condition stack underflow" );
2784 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2789 #ifndef YY_NO_TOP_STATE
2790 static int yy_top_state()
2792 return yy_start_stack
[yy_start_stack_ptr
- 1];
2796 #ifndef YY_EXIT_FAILURE
2797 #define YY_EXIT_FAILURE 2
2800 #ifdef YY_USE_PROTOS
2801 static void yy_fatal_error( yyconst
char msg
[] )
2803 static void yy_fatal_error( msg
)
2807 (void) fprintf( stderr
, "%s\n", msg
);
2808 exit( YY_EXIT_FAILURE
);
2813 /* Redefine yyless() so it works in section 3 code. */
2819 /* Undo effects of setting up yytext. */ \
2820 yytext[yyleng] = yy_hold_char; \
2821 yy_c_buf_p = yytext + n; \
2822 yy_hold_char = *yy_c_buf_p; \
2823 *yy_c_buf_p = '\0'; \
2829 /* Internal utility routines. */
2832 #ifdef YY_USE_PROTOS
2833 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2835 static void yy_flex_strncpy( s1
, s2
, n
)
2842 for ( i
= 0; i
< n
; ++i
)
2847 #ifdef YY_NEED_STRLEN
2848 #ifdef YY_USE_PROTOS
2849 static int yy_flex_strlen( yyconst
char *s
)
2851 static int yy_flex_strlen( s
)
2856 for ( n
= 0; s
[n
]; ++n
)
2864 #ifdef YY_USE_PROTOS
2865 static void *yy_flex_alloc( yy_size_t size
)
2867 static void *yy_flex_alloc( size
)
2871 return (void *) malloc( size
);
2874 #ifdef YY_USE_PROTOS
2875 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2877 static void *yy_flex_realloc( ptr
, size
)
2882 /* The cast to (char *) in the following accommodates both
2883 * implementations that use char* generic pointers, and those
2884 * that use void* generic pointers. It works with the latter
2885 * because both ANSI C and C++ allow castless assignment from
2886 * any pointer type to void*, and deal with argument conversions
2887 * as though doing an assignment.
2889 return (void *) realloc( (char *) ptr
, size
);
2892 #ifdef YY_USE_PROTOS
2893 static void yy_flex_free( void *ptr
)
2895 static void yy_flex_free( ptr
)
2909 #line 666 "scan-gram.l"
2912 /*------------------------------------------------------------------.
2913 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2915 | Possible inputs: $[<TYPENAME>]($|integer) |
2917 | Output to the STRING_OBSTACK a reference to this semantic value. |
2918 `------------------------------------------------------------------*/
2921 handle_action_dollar (char *text
, location_t location
)
2923 const char *type_name
= NULL
;
2924 char *cp
= text
+ 1;
2926 /* Get the type name if explicit. */
2939 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2940 if (!type_name
&& typed
)
2941 complain_at (location
, _("$$ of `%s' has no declared type"),
2942 current_rule
->sym
->tag
);
2945 obstack_fgrow1 (&string_obstack
,
2946 "]b4_lhs_value([%s])[", type_name
);
2952 num
= strtol (cp
, 0, 10);
2954 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
2957 if (!type_name
&& n
> 0)
2958 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
2960 if (!type_name
&& typed
)
2961 complain_at (location
, _("$%d of `%s' has no declared type"),
2962 n
, current_rule
->sym
->tag
);
2965 obstack_fgrow3 (&string_obstack
,
2966 "]b4_rhs_value([%d], [%d], [%s])[",
2967 rule_length
, n
, type_name
);
2970 complain_at (location
, _("invalid value: %s"), quote (text
));
2975 /*---------------------------------------------------------------.
2976 | TEXT is expected to be $$ in some code associated to a symbol: |
2977 | destructor or printer. |
2978 `---------------------------------------------------------------*/
2981 handle_symbol_code_dollar (char *text
, location_t location
)
2983 char *cp
= text
+ 1;
2985 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
2987 complain_at (location
, _("invalid value: %s"), quote (text
));
2991 /*-----------------------------------------------------------------.
2992 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2993 | depending upon CODE_KIND. |
2994 `-----------------------------------------------------------------*/
2997 handle_dollar (braced_code_t braced_code_kind
,
2998 char *text
, location_t location
)
3000 switch (braced_code_kind
)
3002 case action_braced_code
:
3003 handle_action_dollar (text
, location
);
3006 case destructor_braced_code
:
3007 case printer_braced_code
:
3008 handle_symbol_code_dollar (text
, location
);
3014 /*------------------------------------------------------.
3015 | TEXT is a location token (i.e., a `@...'). Output to |
3016 | STRING_OBSTACK a reference to this location. |
3017 `------------------------------------------------------*/
3020 handle_action_at (char *text
, location_t location
)
3022 char *cp
= text
+ 1;
3027 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
3033 num
= strtol (cp
, 0, 10);
3035 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
3038 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
3042 complain_at (location
, _("invalid value: %s"), quote (text
));
3047 /*---------------------------------------------------------------.
3048 | TEXT is expected to be @$ in some code associated to a symbol: |
3049 | destructor or printer. |
3050 `---------------------------------------------------------------*/
3053 handle_symbol_code_at (char *text
, location_t location
)
3055 char *cp
= text
+ 1;
3057 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
3059 complain_at (location
, _("invalid value: %s"), quote (text
));
3063 /*-------------------------------------------------------------------.
3064 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
3066 `-------------------------------------------------------------------*/
3069 handle_at (braced_code_t braced_code_kind
,
3070 char *text
, location_t location
)
3072 switch (braced_code_kind
)
3074 case action_braced_code
:
3075 handle_action_at (text
, location
);
3078 case destructor_braced_code
:
3079 case printer_braced_code
:
3080 handle_symbol_code_at (text
, location
);
3086 /*------------------------------------------------------------------.
3087 | Convert universal character name UCN to a single-byte character, |
3088 | and return that character. Return -1 if UCN does not correspond |
3089 | to a single-byte character. |
3090 `------------------------------------------------------------------*/
3093 convert_ucn_to_byte (char const *ucn
)
3095 unsigned long code
= strtoul (ucn
+ 2, 0, 16);
3097 /* FIXME: Currently we assume Unicode-compatible unibyte characters
3098 on ASCII hosts (i.e., Latin-1 on hosts with 8-bit bytes). On
3099 non-ASCII hosts we support only the portable C character set.
3100 These limitations should be removed once we add support for
3101 multibyte characters. */
3103 if (UCHAR_MAX
< code
)
3106 #if ! ('$' == 0x24 && '@' == 0x40 && '`' == 0x60 && '~' == 0x7e)
3108 /* A non-ASCII host. Use CODE to index into a table of the C
3109 basic execution character set, which is guaranteed to exist on
3110 all Standard C platforms. This table also includes '$', '@',
3111 and '`', which not in the basic execution character set but
3112 which are unibyte characters on all the platforms that we know
3114 static signed char const table
[] =
3116 '\0', -1, -1, -1, -1, -1, -1, '\a',
3117 '\b', '\t', '\n', '\v', '\f', '\r', -1, -1,
3118 -1, -1, -1, -1, -1, -1, -1, -1,
3119 -1, -1, -1, -1, -1, -1, -1, -1,
3120 ' ', '!', '"', '#', '$', '%', '&', '\'',
3121 '(', ')', '*', '+', ',', '-', '.', '/',
3122 '0', '1', '2', '3', '4', '5', '6', '7',
3123 '8', '9', ':', ';', '<', '=', '>', '?',
3124 '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
3125 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
3126 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
3127 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
3128 '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
3129 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
3130 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
3131 'x', 'y', 'z', '{', '|', '}', '~'
3134 code
= code
< sizeof table
? table
[code
] : -1;
3142 /*-------------------------.
3143 | Initialize the scanner. |
3144 `-------------------------*/
3147 scanner_initialize (void)
3149 obstack_init (&string_obstack
);
3153 /*-----------------------------------------------.
3154 | Free all the memory allocated to the scanner. |
3155 `-----------------------------------------------*/
3160 obstack_free (&string_obstack
, 0);
3161 /* Reclaim Flex's buffers. */
3162 yy_delete_buffer (YY_CURRENT_BUFFER
);