1 #define yy_create_buffer gram__create_buffer
2 #define yy_delete_buffer gram__delete_buffer
3 #define yy_scan_buffer gram__scan_buffer
4 #define yy_scan_string gram__scan_string
5 #define yy_scan_bytes gram__scan_bytes
6 #define yy_flex_debug gram__flex_debug
7 #define yy_init_buffer gram__init_buffer
8 #define yy_flush_buffer gram__flush_buffer
9 #define yy_load_buffer_state gram__load_buffer_state
10 #define yy_switch_to_buffer gram__switch_to_buffer
12 #define yyleng gram_leng
13 #define yylex gram_lex
14 #define yyout gram_out
15 #define yyrestart gram_restart
16 #define yytext gram_text
18 #line 19 "scan-gram.c"
19 /* A lexical scanner generated by flex */
21 /* Scanner skeleton version:
26 #define YY_FLEX_MAJOR_VERSION 2
27 #define YY_FLEX_MINOR_VERSION 5
32 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
46 #ifndef YY_ALWAYS_INTERACTIVE
47 #ifndef YY_NEVER_INTERACTIVE
48 extern int isatty
YY_PROTO(( int ));
53 /* Use prototypes in function declarations. */
56 /* The "const" storage-class-modifier is valid. */
59 #else /* ! __cplusplus */
67 #endif /* ! __cplusplus */
86 #define YY_PROTO(proto) proto
88 #define YY_PROTO(proto) ()
91 /* Returned upon end-of-file. */
94 /* Promotes a possibly negative, possibly signed char to an unsigned
95 * integer for use as an array index. If the signed char is negative,
96 * we want to instead treat it as an 8-bit unsigned char, hence the
99 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
101 /* Enter a start condition. This macro really ought to take a parameter,
102 * but we do it the disgusting crufty way forced on us by the ()-less
103 * definition of BEGIN.
105 #define BEGIN yy_start = 1 + 2 *
107 /* Translate the current start state into a value that can be later handed
108 * to BEGIN to return to the state. The YYSTATE alias is for lex
111 #define YY_START ((yy_start - 1) / 2)
112 #define YYSTATE YY_START
114 /* Action number for EOF rule of a given start state. */
115 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
117 /* Special action meaning "start processing a new file". */
118 #define YY_NEW_FILE yyrestart( yyin )
120 #define YY_END_OF_BUFFER_CHAR 0
122 /* Size of default input buffer. */
123 #define YY_BUF_SIZE 16384
125 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
128 extern FILE *yyin
, *yyout
;
130 #define EOB_ACT_CONTINUE_SCAN 0
131 #define EOB_ACT_END_OF_FILE 1
132 #define EOB_ACT_LAST_MATCH 2
134 /* The funky do-while in the following #define is used to turn the definition
135 * int a single C statement (which needs a semi-colon terminator). This
136 * avoids problems with code like:
138 * if ( condition_holds )
141 * do_something_else();
143 * Prior to using the do-while the compiler would get upset at the
144 * "else" because it interpreted the "if" statement as being all
145 * done when it reached the ';' after the yyless() call.
148 /* Return all but the first 'n' matched characters back to the input stream. */
153 /* Undo effects of setting up yytext. */ \
154 *yy_cp = yy_hold_char; \
155 YY_RESTORE_YY_MORE_OFFSET \
156 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
157 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
161 #define unput(c) yyunput( c, yytext_ptr )
163 /* The following is because we cannot portably get our hands on size_t
164 * (without autoconf's help, which isn't available because we want
165 * flex-generated scanners to compile on their own).
167 typedef unsigned int yy_size_t
;
170 struct yy_buffer_state
174 char *yy_ch_buf
; /* input buffer */
175 char *yy_buf_pos
; /* current position in input buffer */
177 /* Size of input buffer in bytes, not including room for EOB
180 yy_size_t yy_buf_size
;
182 /* Number of characters read into yy_ch_buf, not including EOB
187 /* Whether we "own" the buffer - i.e., we know we created it,
188 * and can realloc() it to grow it, and should free() it to
191 int yy_is_our_buffer
;
193 /* Whether this is an "interactive" input source; if so, and
194 * if we're using stdio for input, then we want to use getc()
195 * instead of fread(), to make sure we stop fetching input after
198 int yy_is_interactive
;
200 /* Whether we're considered to be at the beginning of a line.
201 * If so, '^' rules will be active on the next match, otherwise
206 /* Whether to try to fill the input buffer when we reach the
211 int yy_buffer_status
;
212 #define YY_BUFFER_NEW 0
213 #define YY_BUFFER_NORMAL 1
214 /* When an EOF's been seen but there's still some text to process
215 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
216 * shouldn't try reading from the input source any more. We might
217 * still have a bunch of tokens to match, though, because of
218 * possible backing-up.
220 * When we actually see the EOF, we change the status to "new"
221 * (via yyrestart()), so that the user can continue scanning by
222 * just pointing yyin at a new input file.
224 #define YY_BUFFER_EOF_PENDING 2
227 static YY_BUFFER_STATE yy_current_buffer
= 0;
229 /* We provide macros for accessing buffer states in case in the
230 * future we want to put the buffer states in a more general
233 #define YY_CURRENT_BUFFER yy_current_buffer
236 /* yy_hold_char holds the character lost when yytext is formed. */
237 static char yy_hold_char
;
239 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
244 /* Points to current character in buffer. */
245 static char *yy_c_buf_p
= (char *) 0;
246 static int yy_init
= 1; /* whether we need to initialize */
247 static int yy_start
= 0; /* start state number */
249 /* Flag which is used to allow yywrap()'s to do buffer switches
250 * instead of setting up a fresh yyin. A bit of a hack ...
252 static int yy_did_buffer_switch_on_eof
;
254 void yyrestart
YY_PROTO(( FILE *input_file
));
256 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
257 void yy_load_buffer_state
YY_PROTO(( void ));
258 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
259 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
260 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
261 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
262 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
264 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
265 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
266 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
268 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
269 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
));
270 static void yy_flex_free
YY_PROTO(( void * ));
272 #define yy_new_buffer yy_create_buffer
274 #define yy_set_interactive(is_interactive) \
276 if ( ! yy_current_buffer ) \
277 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
278 yy_current_buffer->yy_is_interactive = is_interactive; \
281 #define yy_set_bol(at_bol) \
283 if ( ! yy_current_buffer ) \
284 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
285 yy_current_buffer->yy_at_bol = at_bol; \
288 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
292 #define YY_SKIP_YYWRAP
295 typedef unsigned char YY_CHAR
;
296 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
297 typedef int yy_state_type
;
301 #define yytext_ptr yytext
303 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
304 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
305 static int yy_get_next_buffer
YY_PROTO(( void ));
306 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
308 /* Done after the current pattern has been matched and before the
309 * corresponding action - sets up yytext.
311 #define YY_DO_BEFORE_ACTION \
312 yytext_ptr = yy_bp; \
313 yyleng = (int) (yy_cp - yy_bp); \
314 yy_hold_char = *yy_cp; \
318 #define YY_NUM_RULES 102
319 #define YY_END_OF_BUFFER 103
320 static yyconst
short int yy_accept
[391] =
322 0, 0, 0, 0, 59, 59, 0, 0, 85, 85,
323 80, 80, 0, 0, 0, 0, 0, 0, 0, 0,
324 0, 0, 103, 51, 40, 40, 44, 51, 43, 38,
325 41, 51, 42, 36, 39, 51, 35, 48, 37, 57,
326 57, 52, 53, 59, 58, 59, 55, 55, 83, 82,
327 86, 78, 77, 81, 61, 60, 76, 63, 62, 96,
328 96, 88, 97, 87, 91, 97, 52, 53, 93, 92,
329 99, 88, 100, 87, 91, 101, 88, 87, 91, 40,
330 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,
331 0, 0, 0, 0, 0, 0, 0, 47, 41, 45,
333 46, 42, 0, 57, 56, 0, 59, 59, 59, 59,
334 55, 54, 83, 84, 84, 84, 84, 78, 79, 79,
335 79, 79, 61, 75, 73, 64, 75, 66, 67, 68,
336 69, 70, 71, 75, 72, 75, 63, 96, 94, 0,
337 94, 0, 89, 90, 0, 95, 0, 95, 99, 98,
338 101, 89, 90, 101, 0, 0, 0, 0, 0, 0,
339 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
340 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
341 46, 49, 0, 0, 0, 85, 0, 0, 0, 0,
342 80, 0, 0, 0, 64, 0, 0, 65, 0, 0,
344 0, 101, 101, 0, 0, 0, 0, 0, 0, 0,
345 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
346 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
347 0, 0, 0, 0, 0, 64, 0, 0, 0, 0,
348 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
349 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
350 0, 0, 0, 0, 0, 28, 0, 31, 0, 0,
351 34, 0, 0, 0, 2, 0, 0, 6, 0, 0,
352 0, 0, 0, 0, 0, 14, 0, 0, 0, 18,
353 0, 0, 0, 0, 24, 0, 27, 29, 32, 0,
355 0, 74, 1, 3, 0, 0, 8, 0, 0, 0,
356 0, 0, 0, 0, 0, 19, 0, 0, 0, 0,
357 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
358 0, 0, 0, 0, 22, 0, 0, 0, 33, 0,
359 0, 0, 0, 0, 0, 0, 0, 16, 17, 0,
360 0, 26, 0, 0, 0, 0, 0, 0, 25, 13,
361 0, 0, 0, 0, 5, 0, 0, 0, 11, 0,
362 0, 0, 0, 0, 9, 0, 15, 20, 23, 30,
363 0, 0, 7, 0, 0, 0, 0, 0, 10, 0
366 static yyconst
int yy_ec
[256] =
368 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
369 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
370 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
371 1, 2, 1, 4, 1, 5, 6, 1, 7, 1,
372 1, 8, 1, 9, 10, 11, 12, 13, 13, 13,
373 13, 13, 13, 13, 13, 14, 14, 15, 16, 17,
374 18, 19, 20, 21, 22, 22, 22, 22, 22, 22,
375 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
376 11, 11, 11, 11, 23, 11, 11, 11, 11, 11,
377 24, 25, 26, 1, 27, 1, 28, 29, 30, 31,
379 32, 33, 34, 35, 36, 11, 37, 38, 39, 40,
380 41, 42, 11, 43, 44, 45, 46, 47, 11, 48,
381 49, 11, 50, 51, 52, 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,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 static yyconst
int yy_meta
[54] =
400 1, 1, 2, 3, 4, 5, 6, 7, 1, 1,
401 8, 9, 10, 10, 1, 1, 1, 1, 11, 1,
402 4, 10, 8, 12, 13, 12, 8, 10, 10, 10,
403 10, 10, 10, 8, 8, 8, 8, 8, 8, 8,
404 8, 8, 8, 8, 8, 8, 8, 8, 8, 4,
408 static yyconst
short int yy_base
[427] =
410 0, 0, 46, 47, 53, 56, 802, 801, 59, 62,
411 50, 82, 65, 87, 85, 86, 110, 160, 92, 117,
412 121, 128, 808, 811, 58, 62, 811, 207, 811, 811,
413 0, 50, 54, 811, 811, 0, 811, 811, 811, 0,
414 114, 811, 811, 782, 811, 117, 0, 794, 0, 811,
415 146, 0, 811, 148, 0, 811, 254, 0, 811, 0,
416 0, 811, 165, 811, 149, 175, 811, 811, 811, 811,
417 0, 811, 753, 811, 175, 0, 0, 0, 182, 92,
418 811, 768, 95, 54, 767, 764, 68, 769, 163, 754,
419 110, 763, 121, 127, 758, 765, 768, 811, 0, 811,
421 0, 179, 776, 0, 811, 193, 769, 195, 199, 768,
422 0, 811, 0, 811, 203, 767, 212, 0, 811, 214,
423 766, 216, 0, 811, 811, 777, 0, 811, 811, 811,
424 811, 811, 811, 0, 811, 0, 0, 0, 811, 208,
425 212, 0, 811, 811, 225, 811, 216, 218, 0, 811,
426 0, 0, 0, 231, 749, 226, 745, 744, 744, 161,
427 742, 227, 754, 740, 743, 253, 749, 735, 736, 69,
428 735, 743, 744, 747, 731, 736, 730, 735, 727, 739,
429 0, 811, 240, 253, 266, 743, 269, 282, 742, 286,
430 741, 288, 293, 740, 751, 0, 0, 0, 744, 301,
432 297, 304, 300, 734, 715, 724, 714, 726, 716, 724,
433 723, 722, 743, 707, 741, 722, 715, 716, 709, 718,
434 702, 702, 699, 712, 701, 708, 704, 700, 694, 697,
435 703, 702, 692, 703, 701, 811, 0, 0, 305, 687,
436 695, 688, 684, 696, 682, 694, 713, 691, 679, 811,
437 678, 674, 686, 254, 681, 672, 676, 668, 681, 811,
438 667, 301, 666, 678, 664, 811, 668, 811, 667, 665,
439 811, 0, 0, 656, 811, 672, 657, 811, 303, 657,
440 659, 304, 672, 671, 662, 811, 655, 656, 651, 811,
441 649, 683, 660, 649, 811, 645, 811, 306, 811, 645,
443 0, 811, 811, 644, 657, 639, 811, 642, 643, 640,
444 639, 640, 637, 647, 637, 811, 635, 633, 647, 633,
445 628, 640, 811, 626, 638, 635, 612, 601, 614, 589,
446 594, 579, 592, 592, 811, 573, 573, 582, 811, 567,
447 564, 565, 525, 534, 510, 498, 489, 811, 811, 470,
448 461, 811, 466, 449, 458, 442, 427, 423, 811, 811,
449 296, 301, 295, 288, 811, 283, 275, 275, 811, 272,
450 259, 249, 254, 232, 811, 228, 811, 811, 811, 811,
451 234, 307, 811, 229, 208, 199, 203, 179, 811, 811,
452 334, 347, 360, 373, 386, 399, 412, 425, 438, 451,
454 457, 467, 480, 493, 506, 519, 530, 543, 554, 567,
455 579, 592, 604, 617, 630, 643, 201, 193, 167, 656,
456 159, 145, 136, 134, 120, 93
459 static yyconst
short int yy_def
[427] =
461 390, 1, 391, 391, 392, 392, 393, 393, 394, 394,
462 395, 395, 396, 396, 397, 397, 398, 398, 399, 399,
463 400, 400, 390, 390, 390, 390, 390, 390, 390, 390,
464 401, 390, 390, 390, 390, 402, 390, 390, 390, 403,
465 390, 390, 390, 404, 390, 404, 405, 390, 406, 390,
466 407, 408, 390, 409, 410, 390, 411, 412, 390, 413,
467 413, 390, 390, 390, 390, 390, 390, 390, 390, 390,
468 414, 390, 390, 390, 390, 415, 415, 415, 415, 390,
469 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
470 390, 390, 390, 390, 390, 390, 390, 390, 401, 390,
472 416, 390, 402, 403, 390, 390, 404, 404, 404, 404,
473 405, 390, 406, 390, 390, 390, 390, 408, 390, 390,
474 390, 390, 410, 390, 390, 390, 417, 390, 390, 390,
475 390, 390, 390, 418, 390, 419, 412, 413, 390, 390,
476 390, 420, 390, 390, 390, 390, 390, 390, 414, 390,
477 415, 415, 415, 415, 390, 390, 390, 390, 390, 390,
478 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
479 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
480 416, 390, 390, 390, 390, 390, 390, 390, 407, 390,
481 390, 390, 390, 409, 390, 421, 422, 419, 420, 390,
483 390, 415, 415, 390, 390, 390, 390, 390, 390, 390,
484 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
485 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
486 390, 390, 390, 390, 390, 390, 423, 424, 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, 425, 426, 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,
494 418, 390, 390, 390, 390, 390, 390, 390, 390, 390,
495 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
496 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, 390, 390, 390, 390,
500 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
501 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
502 390, 390, 390, 390, 390, 390, 390, 390, 390, 0,
503 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
505 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
506 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
507 390, 390, 390, 390, 390, 390
510 static yyconst
short int yy_nxt
[865] =
512 24, 25, 26, 27, 24, 28, 29, 24, 30, 24,
513 31, 32, 33, 33, 34, 35, 36, 37, 24, 24,
514 24, 31, 31, 24, 24, 24, 31, 31, 31, 31,
515 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
516 31, 31, 31, 31, 31, 31, 31, 31, 31, 38,
517 39, 24, 24, 41, 41, 45, 53, 100, 45, 80,
518 80, 101, 50, 80, 80, 50, 102, 102, 56, 42,
519 42, 43, 43, 42, 54, 43, 42, 46, 43, 42,
520 46, 43, 42, 51, 43, 42, 51, 43, 53, 57,
521 56, 59, 59, 80, 80, 72, 158, 73, 74, 162,
523 224, 159, 302, 75, 225, 42, 54, 43, 163, 57,
524 57, 57, 61, 62, 63, 42, 64, 43, 109, 110,
525 72, 65, 73, 74, 77, 105, 156, 78, 75, 301,
526 66, 77, 79, 67, 78, 68, 157, 169, 106, 79,
527 42, 108, 43, 273, 42, 272, 43, 115, 116, 120,
528 121, 42, 170, 43, 238, 171, 143, 173, 175, 69,
529 144, 70, 61, 62, 63, 174, 64, 176, 237, 139,
530 117, 65, 122, 145, 140, 177, 198, 141, 141, 146,
531 66, 142, 143, 67, 147, 68, 144, 148, 148, 152,
532 165, 102, 102, 153, 183, 184, 109, 110, 211, 145,
534 109, 110, 197, 166, 185, 186, 154, 167, 212, 69,
535 196, 70, 81, 188, 189, 190, 191, 193, 194, 108,
536 141, 141, 389, 108, 141, 141, 200, 201, 148, 148,
537 148, 148, 202, 203, 388, 82, 387, 83, 84, 85,
538 86, 183, 184, 386, 87, 88, 89, 90, 91, 92,
539 93, 94, 95, 96, 205, 97, 98, 125, 206, 214,
540 125, 385, 219, 287, 105, 383, 126, 185, 186, 207,
541 185, 186, 382, 125, 215, 381, 127, 106, 125, 219,
542 287, 128, 129, 188, 189, 380, 130, 190, 191, 190,
543 191, 379, 220, 131, 193, 194, 132, 378, 133, 134,
545 135, 136, 200, 201, 143, 202, 203, 152, 144, 139,
546 294, 153, 306, 309, 140, 321, 384, 141, 141, 377,
547 376, 145, 375, 374, 154, 373, 372, 294, 371, 306,
548 309, 370, 321, 384, 40, 40, 40, 40, 40, 40,
549 40, 40, 40, 40, 40, 40, 40, 44, 44, 44,
550 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
551 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
552 47, 47, 47, 49, 49, 49, 49, 49, 49, 49,
553 49, 49, 49, 49, 49, 49, 52, 52, 52, 52,
554 52, 52, 52, 52, 52, 52, 52, 52, 52, 55,
556 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
557 55, 55, 58, 58, 58, 58, 58, 58, 58, 58,
558 58, 58, 58, 58, 58, 60, 60, 60, 60, 60,
559 60, 60, 60, 60, 60, 60, 60, 60, 71, 71,
560 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
561 71, 76, 76, 76, 76, 76, 76, 76, 76, 76,
562 76, 76, 76, 76, 99, 369, 99, 103, 368, 103,
563 103, 103, 103, 103, 103, 103, 103, 367, 103, 103,
564 104, 104, 104, 104, 104, 104, 366, 104, 104, 104,
565 104, 365, 104, 107, 364, 107, 107, 107, 107, 107,
567 107, 107, 107, 107, 363, 107, 111, 111, 111, 111,
568 111, 111, 362, 111, 111, 111, 111, 111, 111, 113,
569 113, 361, 113, 113, 113, 113, 113, 113, 113, 113,
570 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
571 114, 360, 114, 118, 118, 118, 118, 118, 359, 118,
572 118, 118, 118, 118, 119, 119, 119, 119, 119, 119,
573 119, 119, 119, 119, 119, 358, 119, 123, 123, 357,
574 123, 123, 123, 123, 123, 123, 123, 123, 123, 124,
575 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
576 124, 124, 137, 137, 137, 137, 137, 356, 137, 137,
578 137, 137, 137, 137, 138, 138, 355, 354, 138, 353,
579 138, 138, 352, 138, 138, 351, 138, 149, 149, 350,
580 149, 349, 348, 149, 149, 347, 149, 149, 346, 149,
581 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
582 151, 345, 151, 181, 344, 181, 181, 181, 181, 181,
583 181, 181, 181, 181, 181, 181, 199, 343, 199, 199,
584 199, 199, 199, 199, 199, 199, 342, 199, 199, 341,
585 340, 339, 338, 337, 336, 335, 334, 333, 332, 331,
586 330, 329, 328, 327, 326, 325, 324, 323, 322, 320,
587 319, 318, 317, 316, 315, 314, 313, 312, 311, 310,
589 308, 307, 305, 304, 303, 300, 299, 298, 297, 296,
590 295, 293, 292, 291, 290, 289, 288, 286, 285, 284,
591 283, 282, 281, 280, 279, 278, 277, 276, 275, 274,
592 271, 270, 269, 268, 267, 266, 265, 264, 263, 262,
593 261, 260, 259, 258, 257, 256, 255, 254, 253, 252,
594 251, 250, 249, 248, 247, 246, 245, 244, 243, 242,
595 241, 240, 239, 236, 122, 192, 117, 187, 235, 234,
596 233, 232, 231, 230, 229, 228, 227, 226, 223, 222,
597 221, 218, 217, 216, 213, 210, 209, 208, 204, 195,
598 192, 187, 108, 108, 182, 180, 179, 178, 172, 168,
600 164, 161, 160, 155, 150, 112, 108, 390, 48, 48,
601 23, 390, 390, 390, 390, 390, 390, 390, 390, 390,
602 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
603 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
604 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
605 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
609 static yyconst
short int yy_chk
[865] =
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, 80, 80, 19, 84, 19, 19, 87,
622 170, 84, 426, 19, 170, 12, 12, 12, 87, 15,
623 16, 14, 17, 17, 17, 19, 17, 19, 46, 46,
624 20, 17, 20, 20, 21, 41, 83, 21, 20, 425,
625 17, 22, 21, 17, 22, 17, 83, 91, 41, 22,
626 20, 46, 20, 424, 21, 423, 21, 51, 51, 54,
627 54, 22, 91, 22, 422, 91, 65, 93, 94, 17,
628 65, 17, 18, 18, 18, 93, 18, 94, 421, 63,
629 51, 18, 54, 65, 63, 94, 419, 63, 63, 66,
630 18, 63, 75, 18, 66, 18, 75, 66, 66, 79,
631 89, 102, 102, 79, 106, 106, 108, 108, 160, 75,
633 109, 109, 418, 89, 115, 115, 79, 89, 160, 18,
634 417, 18, 28, 117, 117, 120, 120, 122, 122, 108,
635 140, 140, 388, 109, 141, 141, 145, 145, 147, 147,
636 148, 148, 154, 154, 387, 28, 386, 28, 28, 28,
637 28, 183, 183, 385, 28, 28, 28, 28, 28, 28,
638 28, 28, 28, 28, 156, 28, 28, 57, 156, 162,
639 57, 384, 166, 254, 184, 381, 57, 185, 185, 156,
640 187, 187, 376, 57, 162, 374, 57, 184, 57, 166,
641 254, 57, 57, 188, 188, 373, 57, 190, 190, 192,
642 192, 372, 166, 57, 193, 193, 57, 371, 57, 57,
644 57, 57, 200, 200, 201, 202, 202, 203, 201, 239,
645 262, 203, 279, 282, 239, 298, 382, 239, 239, 370,
646 368, 201, 367, 366, 203, 364, 363, 262, 362, 279,
647 282, 361, 298, 382, 391, 391, 391, 391, 391, 391,
648 391, 391, 391, 391, 391, 391, 391, 392, 392, 392,
649 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
650 393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
651 393, 393, 393, 394, 394, 394, 394, 394, 394, 394,
652 394, 394, 394, 394, 394, 394, 395, 395, 395, 395,
653 395, 395, 395, 395, 395, 395, 395, 395, 395, 396,
655 396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
656 396, 396, 397, 397, 397, 397, 397, 397, 397, 397,
657 397, 397, 397, 397, 397, 398, 398, 398, 398, 398,
658 398, 398, 398, 398, 398, 398, 398, 398, 399, 399,
659 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
660 399, 400, 400, 400, 400, 400, 400, 400, 400, 400,
661 400, 400, 400, 400, 401, 358, 401, 402, 357, 402,
662 402, 402, 402, 402, 402, 402, 402, 356, 402, 402,
663 403, 403, 403, 403, 403, 403, 355, 403, 403, 403,
664 403, 354, 403, 404, 353, 404, 404, 404, 404, 404,
666 404, 404, 404, 404, 351, 404, 405, 405, 405, 405,
667 405, 405, 350, 405, 405, 405, 405, 405, 405, 406,
668 406, 347, 406, 406, 406, 406, 406, 406, 406, 406,
669 407, 407, 407, 407, 407, 407, 407, 407, 407, 407,
670 407, 346, 407, 408, 408, 408, 408, 408, 345, 408,
671 408, 408, 408, 408, 409, 409, 409, 409, 409, 409,
672 409, 409, 409, 409, 409, 344, 409, 410, 410, 343,
673 410, 410, 410, 410, 410, 410, 410, 410, 410, 411,
674 411, 411, 411, 411, 411, 411, 411, 411, 411, 411,
675 411, 411, 412, 412, 412, 412, 412, 342, 412, 412,
677 412, 412, 412, 412, 413, 413, 341, 340, 413, 338,
678 413, 413, 337, 413, 413, 336, 413, 414, 414, 334,
679 414, 333, 332, 414, 414, 331, 414, 414, 330, 414,
680 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
681 415, 329, 415, 416, 328, 416, 416, 416, 416, 416,
682 416, 416, 416, 416, 416, 416, 420, 327, 420, 420,
683 420, 420, 420, 420, 420, 420, 326, 420, 420, 325,
684 324, 322, 321, 320, 319, 318, 317, 315, 314, 313,
685 312, 311, 310, 309, 308, 306, 305, 304, 300, 296,
686 294, 293, 292, 291, 289, 288, 287, 285, 284, 283,
688 281, 280, 277, 276, 274, 270, 269, 267, 265, 264,
689 263, 261, 259, 258, 257, 256, 255, 253, 252, 251,
690 249, 248, 247, 246, 245, 244, 243, 242, 241, 240,
691 235, 234, 233, 232, 231, 230, 229, 228, 227, 226,
692 225, 224, 223, 222, 221, 220, 219, 218, 217, 216,
693 215, 214, 213, 212, 211, 210, 209, 208, 207, 206,
694 205, 204, 199, 195, 194, 191, 189, 186, 180, 179,
695 178, 177, 176, 175, 174, 173, 172, 171, 169, 168,
696 167, 165, 164, 163, 161, 159, 158, 157, 155, 126,
697 121, 116, 110, 107, 103, 97, 96, 95, 92, 90,
699 88, 86, 85, 82, 73, 48, 44, 23, 8, 7,
700 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
701 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
702 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
703 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
704 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
708 static yy_state_type yy_last_accepting_state
;
709 static char *yy_last_accepting_cpos
;
711 extern int yy_flex_debug
;
712 int yy_flex_debug
= 1;
714 static yyconst
short int yy_rule_linenum
[102] =
716 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
717 225, 226, 227, 228, 229, 230, 231, 232, 233, 234,
718 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
719 245, 246, 247, 248, 250, 251, 252, 253, 254, 256,
720 258, 264, 278, 281, 284, 285, 288, 291, 294, 302,
721 308, 324, 325, 335, 340, 356, 357, 373, 374, 386,
722 396, 416, 432, 452, 464, 478, 479, 480, 481, 482,
723 483, 484, 485, 486, 497, 503, 514, 520, 521, 522,
724 524, 542, 548, 549, 550, 552, 570, 573, 576, 577,
725 580, 591, 603, 605, 607, 610, 613, 633, 640, 641,
730 /* The intent behind this definition is that it'll catch
731 * any uses of REJECT which flex missed.
733 #define REJECT reject_used_but_not_detected
734 #define yymore() yymore_used_but_not_detected
735 #define YY_MORE_ADJ 0
736 #define YY_RESTORE_YY_MORE_OFFSET
738 #line 1 "scan-gram.l"
740 /* Bison Grammar Scanner -*- C -*-
741 Copyright (C) 2002 Free Software Foundation, Inc.
743 This file is part of Bison, the GNU Compiler Compiler.
745 This program is free software; you can redistribute it and/or modify
746 it under the terms of the GNU General Public License as published by
747 the Free Software Foundation; either version 2 of the License, or
748 (at your option) any later version.
750 This program is distributed in the hope that it will be useful,
751 but WITHOUT ANY WARRANTY; without even the implied warranty of
752 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
753 GNU General Public License for more details.
755 You should have received a copy of the GNU General Public License
756 along with this program; if not, write to the Free Software
757 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
760 #define YY_NO_UNPUT 1
761 #define YY_NEVER_INTERACTIVE 1
762 #define YY_STACK_USED 1
763 #line 26 "scan-gram.l"
765 #include "mbswidth.h"
766 #include "complain.h"
772 /* Each time we match a string, move the end cursor to its end. */
773 #define YY_USER_INIT \
775 LOCATION_RESET (*yylloc); \
776 yylloc->file = infile; \
777 /* This is only to avoid GCC warnings. */ \
778 if (yycontrol) {;}; \
781 #define YY_USER_ACTION extend_location (yylloc, yytext, yyleng);
782 #define YY_STEP LOCATION_STEP (*yylloc)
784 #define YY_INPUT(buf, result, size) ((result) = no_cr_read (yyin, buf, size))
787 /* Read bytes from FP into buffer BUF of size SIZE. Return the
788 number of bytes read. Remove '\r' from input, treating \r\n
789 and isolated \r as \n. */
792 no_cr_read (FILE *fp
, char *buf
, size_t size
)
794 size_t s
= fread (buf
, 1, size
, fp
);
797 char *w
= memchr (buf
, '\r', s
);
801 char const *lim
= buf
+ s
;
805 /* Found an '\r'. Treat it like '\n', but ignore any
806 '\n' that immediately follows. */
811 if (ch
!= '\n' && ungetc (ch
, fp
) != ch
)
817 /* Copy until the next '\r'. */
823 while ((*w
++ = *r
++) != '\r');
834 /* Extend *LOC to account for token TOKEN of size SIZE. */
837 extend_location (location_t
*loc
, char const *token
, int size
)
839 int line
= loc
->last_line
;
840 int column
= loc
->last_column
;
841 char const *p0
= token
;
842 char const *p
= token
;
843 char const *lim
= token
+ size
;
845 for (p
= token
; p
< lim
; p
++)
849 /* \r shouldn't survive no_cr_read. */
859 column
+= mbsnwidth (p0
, p
- p0
, 0);
860 column
+= 8 - ((column
- 1) & 7);
865 loc
->last_line
= line
;
866 loc
->last_column
= column
+ mbsnwidth (p0
, p
- p0
, 0);
871 /* STRING_OBSTACK -- Used to store all the characters that we need to
872 keep (to construct ID, STRINGS etc.). Use the following macros to
875 Use YY_OBS_GROW to append what has just been matched, and
876 YY_OBS_FINISH to end the string (it puts the ending 0).
877 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
878 used, and which is used by YY_OBS_FREE to free the last string. */
880 static struct obstack string_obstack
;
883 #define YY_OBS_GROW \
884 obstack_grow (&string_obstack, yytext, yyleng)
886 #define YY_OBS_FINISH \
888 obstack_1grow (&string_obstack, '\0'); \
889 last_string = obstack_finish (&string_obstack); \
892 #define YY_OBS_FREE \
894 obstack_free (&string_obstack, last_string); \
898 scanner_last_string_free (void)
904 static int braces_level
= 0;
905 static int percent_percent_count
= 0;
907 /* Within well-formed rules, RULE_LENGTH is the number of values in
908 the current rule so far, which says where to find `$0' with respect
909 to the top of the stack. It is not the same as the rule->length in
910 the case of mid rule actions.
912 Outside of well-formed rules, RULE_LENGTH has an undefined value. */
913 static int rule_length
;
915 static void handle_dollar (braced_code_t code_kind
,
916 char *cp
, location_t location
);
917 static void handle_at (braced_code_t code_kind
,
918 char *cp
, location_t location
);
919 static int convert_ucn_to_byte (char const *hex_text
);
922 #define SC_LINE_COMMENT 2
923 #define SC_YACC_COMMENT 3
926 #define SC_CHARACTER 5
928 #define SC_ESCAPED_STRING 6
929 #define SC_ESCAPED_CHARACTER 7
931 #define SC_BRACED_CODE 8
932 #define SC_PROLOGUE 9
933 #define SC_EPILOGUE 10
935 /* POSIX says that a tag must be both an id and a C union member, but
936 historically almost any character is allowed in a tag. We disallow
937 NUL and newline, as this simplifies our implementation. */
938 /* Zero or more instances of backslash-newline. Following GCC, allow
939 white space between the backslash and the newline. */
940 #line 941 "scan-gram.c"
942 /* Macros after this point can all be overridden by user definitions in
946 #ifndef YY_SKIP_YYWRAP
948 extern "C" int yywrap
YY_PROTO(( void ));
950 extern int yywrap
YY_PROTO(( void ));
955 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
959 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
962 #ifdef YY_NEED_STRLEN
963 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
968 static int yyinput
YY_PROTO(( void ));
970 static int input
YY_PROTO(( void ));
975 static int yy_start_stack_ptr
= 0;
976 static int yy_start_stack_depth
= 0;
977 static int *yy_start_stack
= 0;
978 #ifndef YY_NO_PUSH_STATE
979 static void yy_push_state
YY_PROTO(( int new_state
));
981 #ifndef YY_NO_POP_STATE
982 static void yy_pop_state
YY_PROTO(( void ));
984 #ifndef YY_NO_TOP_STATE
985 static int yy_top_state
YY_PROTO(( void ));
989 #define YY_NO_PUSH_STATE 1
990 #define YY_NO_POP_STATE 1
991 #define YY_NO_TOP_STATE 1
994 #ifdef YY_MALLOC_DECL
1002 /* Just try to get by without declaring the routines. This will fail
1003 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1004 * or sizeof(void*) != sizeof(int).
1009 /* Amount of stuff to slurp up with each read. */
1010 #ifndef YY_READ_BUF_SIZE
1011 #define YY_READ_BUF_SIZE 8192
1014 /* Copy whatever the last rule matched to the standard output. */
1017 /* This used to be an fputs(), but since the string might contain NUL's,
1018 * we now use fwrite().
1020 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1023 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1024 * is returned in "result".
1027 #define YY_INPUT(buf,result,max_size) \
1028 if ( yy_current_buffer->yy_is_interactive ) \
1031 for ( n = 0; n < max_size && \
1032 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1033 buf[n] = (char) c; \
1035 buf[n++] = (char) c; \
1036 if ( c == EOF && ferror( yyin ) ) \
1037 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1043 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1045 if( errno != EINTR) \
1047 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1056 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1057 * we don't want an extra ';' after the "return" because that will cause
1058 * some compilers to complain about unreachable statements.
1061 #define yyterminate() return YY_NULL
1064 /* Number of entries by which start-condition stack grows. */
1065 #ifndef YY_START_STACK_INCR
1066 #define YY_START_STACK_INCR 25
1069 /* Report a fatal error. */
1070 #ifndef YY_FATAL_ERROR
1071 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1074 /* Default declaration of generated scanner - a define so the user can
1075 * easily add parameters.
1078 #define YY_DECL int yylex YY_PROTO(( void ))
1081 /* Code executed at the beginning of each rule, after yytext and yyleng
1084 #ifndef YY_USER_ACTION
1085 #define YY_USER_ACTION
1088 /* Code executed at the end of each rule. */
1090 #define YY_BREAK break;
1093 #define YY_RULE_SETUP \
1098 register yy_state_type yy_current_state
;
1099 register char *yy_cp
, *yy_bp
;
1100 register int yy_act
;
1102 #line 202 "scan-gram.l"
1105 /* At each yylex invocation, mark the current position as the
1106 start of the next token. */
1111 /*----------------------------.
1112 | Scanning Bison directives. |
1113 `----------------------------*/
1114 #line 1115 "scan-gram.c"
1125 yy_start
= 1; /* first start state */
1133 if ( ! yy_current_buffer
)
1135 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1137 yy_load_buffer_state();
1140 while ( 1 ) /* loops until end-of-file is reached */
1144 /* Support of yytext. */
1145 *yy_cp
= yy_hold_char
;
1147 /* yy_bp points to the position in yy_ch_buf of the start of
1152 yy_current_state
= yy_start
;
1156 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1157 if ( yy_accept
[yy_current_state
] )
1159 yy_last_accepting_state
= yy_current_state
;
1160 yy_last_accepting_cpos
= yy_cp
;
1162 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1164 yy_current_state
= (int) yy_def
[yy_current_state
];
1165 if ( yy_current_state
>= 391 )
1166 yy_c
= yy_meta
[(unsigned int) yy_c
];
1168 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1171 while ( yy_base
[yy_current_state
] != 811 );
1174 yy_act
= yy_accept
[yy_current_state
];
1176 { /* have to back up */
1177 yy_cp
= yy_last_accepting_cpos
;
1178 yy_current_state
= yy_last_accepting_state
;
1179 yy_act
= yy_accept
[yy_current_state
];
1182 YY_DO_BEFORE_ACTION
;
1185 do_action
: /* This label is used only to access EOF actions. */
1187 if ( yy_flex_debug
)
1190 fprintf( stderr
, "--scanner backing up\n" );
1191 else if ( yy_act
< 102 )
1192 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1193 yy_rule_linenum
[yy_act
], yytext
);
1194 else if ( yy_act
== 102 )
1195 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1197 else if ( yy_act
== 103 )
1198 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1200 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1204 { /* beginning of action switch */
1205 case 0: /* must back up */
1206 /* undo the effects of YY_DO_BEFORE_ACTION */
1207 *yy_cp
= yy_hold_char
;
1208 yy_cp
= yy_last_accepting_cpos
;
1209 yy_current_state
= yy_last_accepting_state
;
1210 goto yy_find_action
;
1216 #line 215 "scan-gram.l"
1217 return PERCENT_NONASSOC
;
1221 #line 216 "scan-gram.l"
1222 return PERCENT_DEBUG
;
1226 #line 217 "scan-gram.l"
1227 return PERCENT_DEFINE
;
1231 #line 218 "scan-gram.l"
1232 return PERCENT_DEFINES
;
1236 #line 219 "scan-gram.l"
1237 return PERCENT_DESTRUCTOR
;
1241 #line 220 "scan-gram.l"
1242 return PERCENT_DPREC
;
1246 #line 221 "scan-gram.l"
1247 return PERCENT_ERROR_VERBOSE
;
1251 #line 222 "scan-gram.l"
1252 return PERCENT_EXPECT
;
1256 #line 223 "scan-gram.l"
1257 return PERCENT_FILE_PREFIX
;
1261 #line 224 "scan-gram.l"
1262 return PERCENT_YACC
;
1266 #line 225 "scan-gram.l"
1267 return PERCENT_GLR_PARSER
;
1271 #line 226 "scan-gram.l"
1272 return PERCENT_LEFT
;
1276 #line 227 "scan-gram.l"
1277 return PERCENT_LOCATIONS
;
1281 #line 228 "scan-gram.l"
1282 return PERCENT_MERGE
;
1286 #line 229 "scan-gram.l"
1287 return PERCENT_NAME_PREFIX
;
1291 #line 230 "scan-gram.l"
1292 return PERCENT_NO_LINES
;
1296 #line 231 "scan-gram.l"
1297 return PERCENT_NONASSOC
;
1301 #line 232 "scan-gram.l"
1302 return PERCENT_NTERM
;
1306 #line 233 "scan-gram.l"
1307 return PERCENT_OUTPUT
;
1311 #line 234 "scan-gram.l"
1312 return PERCENT_PARSE_PARAM
;
1316 #line 235 "scan-gram.l"
1317 rule_length
--; return PERCENT_PREC
;
1321 #line 236 "scan-gram.l"
1322 return PERCENT_PRINTER
;
1326 #line 237 "scan-gram.l"
1327 return PERCENT_PURE_PARSER
;
1331 #line 238 "scan-gram.l"
1332 return PERCENT_RIGHT
;
1336 #line 239 "scan-gram.l"
1337 return PERCENT_LEX_PARAM
;
1341 #line 240 "scan-gram.l"
1342 return PERCENT_SKELETON
;
1346 #line 241 "scan-gram.l"
1347 return PERCENT_START
;
1351 #line 242 "scan-gram.l"
1352 return PERCENT_TOKEN
;
1356 #line 243 "scan-gram.l"
1357 return PERCENT_TOKEN
;
1361 #line 244 "scan-gram.l"
1362 return PERCENT_TOKEN_TABLE
;
1366 #line 245 "scan-gram.l"
1367 return PERCENT_TYPE
;
1371 #line 246 "scan-gram.l"
1372 return PERCENT_UNION
;
1376 #line 247 "scan-gram.l"
1377 return PERCENT_VERBOSE
;
1381 #line 248 "scan-gram.l"
1382 return PERCENT_YACC
;
1386 #line 250 "scan-gram.l"
1391 #line 251 "scan-gram.l"
1392 rule_length
= 0; return COLON
;
1396 #line 252 "scan-gram.l"
1397 rule_length
= 0; return PIPE
;
1401 #line 253 "scan-gram.l"
1406 #line 254 "scan-gram.l"
1411 #line 256 "scan-gram.l"
1416 #line 258 "scan-gram.l"
1418 yylval
->symbol
= symbol_get (yytext
, *yylloc
);
1425 #line 264 "scan-gram.l"
1429 num
= strtoul (yytext
, 0, 10);
1430 if (INT_MAX
< num
|| errno
)
1432 complain_at (*yylloc
, _("%s is invalid"), yytext
);
1435 yylval
->integer
= num
;
1439 /* Characters. We don't check there is only one. */
1442 #line 278 "scan-gram.l"
1443 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1448 #line 281 "scan-gram.l"
1449 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1454 #line 284 "scan-gram.l"
1455 BEGIN SC_YACC_COMMENT
;
1459 #line 285 "scan-gram.l"
1465 #line 288 "scan-gram.l"
1466 yy_push_state (SC_PROLOGUE
);
1468 /* Code in between braces. */
1471 #line 291 "scan-gram.l"
1472 YY_OBS_GROW
; ++braces_level
; yy_push_state (SC_BRACED_CODE
);
1477 #line 294 "scan-gram.l"
1479 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1481 yylval
->string
= last_string
;
1487 #line 302 "scan-gram.l"
1489 if (++percent_percent_count
== 2)
1490 yy_push_state (SC_EPILOGUE
);
1491 return PERCENT_PERCENT
;
1496 #line 308 "scan-gram.l"
1498 LOCATION_PRINT (stderr
, *yylloc
);
1499 fprintf (stderr
, _(": invalid character: `%c'\n"), *yytext
);
1504 /*-------------------------------------------------------------------.
1505 | Whatever the start condition (but those which correspond to |
1506 | entities `swallowed' by Bison: SC_YACC_COMMENT, SC_ESCAPED_STRING, |
1507 | and SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1508 `-------------------------------------------------------------------*/
1513 #line 324 "scan-gram.l"
1514 obstack_sgrow (&string_obstack
, "@<:@");
1518 #line 325 "scan-gram.l"
1519 obstack_sgrow (&string_obstack
, "@:>@");
1522 /*---------------------------------------------------------------.
1523 | Scanning a Yacc comment. The initial `/ *' is already eaten. |
1524 `---------------------------------------------------------------*/
1529 #line 335 "scan-gram.l"
1537 #line 340 "scan-gram.l"
1540 case YY_STATE_EOF(SC_YACC_COMMENT
):
1541 #line 342 "scan-gram.l"
1543 LOCATION_PRINT (stderr
, *yylloc
);
1544 fprintf (stderr
, _(": unexpected end of file in a comment\n"));
1549 /*------------------------------------------------------------.
1550 | Scanning a C comment. The initial `/ *' is already eaten. |
1551 `------------------------------------------------------------*/
1556 #line 356 "scan-gram.l"
1557 YY_OBS_GROW
; yy_pop_state ();
1561 #line 357 "scan-gram.l"
1564 case YY_STATE_EOF(SC_COMMENT
):
1565 #line 359 "scan-gram.l"
1567 LOCATION_PRINT (stderr
, *yylloc
);
1568 fprintf (stderr
, _(": unexpected end of file in a comment\n"));
1573 /*--------------------------------------------------------------.
1574 | Scanning a line comment. The initial `//' is already eaten. |
1575 `--------------------------------------------------------------*/
1580 #line 373 "scan-gram.l"
1581 YY_OBS_GROW
; yy_pop_state ();
1585 #line 374 "scan-gram.l"
1588 case YY_STATE_EOF(SC_LINE_COMMENT
):
1589 #line 375 "scan-gram.l"
1593 /*----------------------------------------------------------------.
1594 | Scanning a C string, including its escapes. The initial `"' is |
1596 `----------------------------------------------------------------*/
1601 #line 386 "scan-gram.l"
1603 assert (yy_top_state () == INITIAL
);
1606 yylval
->string
= last_string
;
1614 #line 396 "scan-gram.l"
1617 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1618 #line 398 "scan-gram.l"
1620 LOCATION_PRINT (stderr
, *yylloc
);
1621 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1622 assert (yy_top_state () == INITIAL
);
1624 yylval
->string
= last_string
;
1630 /*---------------------------------------------------------------.
1631 | Scanning a C character, decoding its escapes. The initial "'" |
1632 | is already eaten. |
1633 `---------------------------------------------------------------*/
1638 #line 416 "scan-gram.l"
1641 assert (yy_top_state () == INITIAL
);
1644 yylval
->symbol
= symbol_get (last_string
, *yylloc
);
1645 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1646 symbol_user_token_number_set (yylval
->symbol
,
1647 (unsigned char) last_string
[1], *yylloc
);
1657 #line 432 "scan-gram.l"
1660 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1661 #line 434 "scan-gram.l"
1663 LOCATION_PRINT (stderr
, *yylloc
);
1664 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1665 assert (yy_top_state () == INITIAL
);
1667 yylval
->string
= last_string
;
1673 /*----------------------------.
1674 | Decode escaped characters. |
1675 `----------------------------*/
1680 #line 452 "scan-gram.l"
1682 unsigned long c
= strtoul (yytext
+ 1, 0, 8);
1685 LOCATION_PRINT (stderr
, *yylloc
);
1686 fprintf (stderr
, _(": invalid escape: %s\n"), quote (yytext
));
1690 obstack_1grow (&string_obstack
, c
);
1695 #line 464 "scan-gram.l"
1699 c
= strtoul (yytext
+ 2, 0, 16);
1700 if (UCHAR_MAX
< c
|| errno
)
1702 LOCATION_PRINT (stderr
, *yylloc
);
1703 fprintf (stderr
, _(": invalid escape: %s\n"), quote (yytext
));
1707 obstack_1grow (&string_obstack
, c
);
1712 #line 478 "scan-gram.l"
1713 obstack_1grow (&string_obstack
, '\a');
1717 #line 479 "scan-gram.l"
1718 obstack_1grow (&string_obstack
, '\b');
1722 #line 480 "scan-gram.l"
1723 obstack_1grow (&string_obstack
, '\f');
1727 #line 481 "scan-gram.l"
1728 obstack_1grow (&string_obstack
, '\n');
1732 #line 482 "scan-gram.l"
1733 obstack_1grow (&string_obstack
, '\r');
1737 #line 483 "scan-gram.l"
1738 obstack_1grow (&string_obstack
, '\t');
1742 #line 484 "scan-gram.l"
1743 obstack_1grow (&string_obstack
, '\v');
1747 #line 485 "scan-gram.l"
1748 obstack_1grow (&string_obstack
, yytext
[1]);
1752 #line 486 "scan-gram.l"
1754 int c
= convert_ucn_to_byte (yytext
);
1757 LOCATION_PRINT (stderr
, *yylloc
);
1758 fprintf (stderr
, _(": invalid escape: %s\n"), quote (yytext
));
1762 obstack_1grow (&string_obstack
, c
);
1767 #line 497 "scan-gram.l"
1769 LOCATION_PRINT (stderr
, *yylloc
);
1770 fprintf (stderr
, _(": unrecognized escape: %s\n"), quote (yytext
));
1774 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1777 #line 503 "scan-gram.l"
1781 /*----------------------------------------------------------.
1782 | Scanning a C character without decoding its escapes. The |
1783 | initial "'" is already eaten. |
1784 `----------------------------------------------------------*/
1789 #line 514 "scan-gram.l"
1792 assert (yy_top_state () != INITIAL
);
1798 #line 520 "scan-gram.l"
1803 #line 521 "scan-gram.l"
1808 #line 522 "scan-gram.l"
1811 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1814 #line 524 "scan-gram.l"
1817 case YY_STATE_EOF(SC_CHARACTER
):
1818 #line 526 "scan-gram.l"
1820 LOCATION_PRINT (stderr
, *yylloc
);
1821 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1822 assert (yy_top_state () != INITIAL
);
1827 /*----------------------------------------------------------------.
1828 | Scanning a C string, without decoding its escapes. The initial |
1829 | `"' is already eaten. |
1830 `----------------------------------------------------------------*/
1835 #line 542 "scan-gram.l"
1837 assert (yy_top_state () != INITIAL
);
1844 #line 548 "scan-gram.l"
1849 #line 549 "scan-gram.l"
1854 #line 550 "scan-gram.l"
1857 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1860 #line 552 "scan-gram.l"
1863 case YY_STATE_EOF(SC_STRING
):
1864 #line 554 "scan-gram.l"
1866 LOCATION_PRINT (stderr
, *yylloc
);
1867 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1868 assert (yy_top_state () != INITIAL
);
1873 /*---------------------------------------------------.
1874 | Strings, comments etc. can be found in user code. |
1875 `---------------------------------------------------*/
1878 /* Characters. We don't check there is only one. */
1881 #line 570 "scan-gram.l"
1882 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1887 #line 573 "scan-gram.l"
1888 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1893 #line 576 "scan-gram.l"
1894 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1898 #line 577 "scan-gram.l"
1899 YY_OBS_GROW
; yy_push_state (SC_LINE_COMMENT
);
1904 #line 580 "scan-gram.l"
1908 /*---------------------------------------------------------------.
1909 | Scanning some code in braces (%union and actions). The initial |
1910 | "{" is already eaten. |
1911 `---------------------------------------------------------------*/
1916 #line 591 "scan-gram.l"
1919 if (--braces_level
== 0)
1923 yylval
->string
= last_string
;
1931 #line 603 "scan-gram.l"
1932 YY_OBS_GROW
; braces_level
++;
1936 #line 605 "scan-gram.l"
1937 { handle_dollar (current_braced_code
,
1942 #line 607 "scan-gram.l"
1943 { handle_at (current_braced_code
,
1948 #line 610 "scan-gram.l"
1951 /* A stray $, or /, or etc. */
1954 #line 613 "scan-gram.l"
1957 case YY_STATE_EOF(SC_BRACED_CODE
):
1958 #line 615 "scan-gram.l"
1960 LOCATION_PRINT (stderr
, *yylloc
);
1961 fprintf (stderr
, _(": unexpected end of file in a braced code\n"));
1964 yylval
->string
= last_string
;
1969 /*--------------------------------------------------------------.
1970 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1971 `--------------------------------------------------------------*/
1976 #line 633 "scan-gram.l"
1980 yylval
->string
= last_string
;
1986 #line 640 "scan-gram.l"
1991 #line 641 "scan-gram.l"
1994 case YY_STATE_EOF(SC_PROLOGUE
):
1995 #line 643 "scan-gram.l"
1997 LOCATION_PRINT (stderr
, *yylloc
);
1998 fprintf (stderr
, _(": unexpected end of file in a prologue\n"));
2001 yylval
->string
= last_string
;
2006 /*---------------------------------------------------------------.
2007 | Scanning the epilogue (everything after the second "%%", which |
2008 | has already been eaten). |
2009 `---------------------------------------------------------------*/
2014 #line 661 "scan-gram.l"
2017 case YY_STATE_EOF(SC_EPILOGUE
):
2018 #line 663 "scan-gram.l"
2022 yylval
->string
= last_string
;
2029 #line 672 "scan-gram.l"
2030 YY_FATAL_ERROR( "flex scanner jammed" );
2032 #line 2033 "scan-gram.c"
2033 case YY_STATE_EOF(INITIAL
):
2036 case YY_END_OF_BUFFER
:
2038 /* Amount of text matched not including the EOB char. */
2039 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
2041 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2042 *yy_cp
= yy_hold_char
;
2043 YY_RESTORE_YY_MORE_OFFSET
2045 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
2047 /* We're scanning a new file or input source. It's
2048 * possible that this happened because the user
2049 * just pointed yyin at a new source and called
2050 * yylex(). If so, then we have to assure
2051 * consistency between yy_current_buffer and our
2052 * globals. Here is the right place to do so, because
2053 * this is the first action (other than possibly a
2054 * back-up) that will match for the new input source.
2056 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2057 yy_current_buffer
->yy_input_file
= yyin
;
2058 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2061 /* Note that here we test for yy_c_buf_p "<=" to the position
2062 * of the first EOB in the buffer, since yy_c_buf_p will
2063 * already have been incremented past the NUL character
2064 * (since all states make transitions on EOB to the
2065 * end-of-buffer state). Contrast this with the test
2068 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2069 { /* This was really a NUL. */
2070 yy_state_type yy_next_state
;
2072 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
2074 yy_current_state
= yy_get_previous_state();
2076 /* Okay, we're now positioned to make the NUL
2077 * transition. We couldn't have
2078 * yy_get_previous_state() go ahead and do it
2079 * for us because it doesn't know how to deal
2080 * with the possibility of jamming (and we don't
2081 * want to build jamming into it because then it
2082 * will run more slowly).
2085 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
2087 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2089 if ( yy_next_state
)
2091 /* Consume the NUL. */
2092 yy_cp
= ++yy_c_buf_p
;
2093 yy_current_state
= yy_next_state
;
2100 goto yy_find_action
;
2104 else switch ( yy_get_next_buffer() )
2106 case EOB_ACT_END_OF_FILE
:
2108 yy_did_buffer_switch_on_eof
= 0;
2112 /* Note: because we've taken care in
2113 * yy_get_next_buffer() to have set up
2114 * yytext, we can now set up
2115 * yy_c_buf_p so that if some total
2116 * hoser (like flex itself) wants to
2117 * call the scanner after we return the
2118 * YY_NULL, it'll still work - another
2119 * YY_NULL will get returned.
2121 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
2123 yy_act
= YY_STATE_EOF(YY_START
);
2129 if ( ! yy_did_buffer_switch_on_eof
)
2135 case EOB_ACT_CONTINUE_SCAN
:
2137 yytext_ptr
+ yy_amount_of_matched_text
;
2139 yy_current_state
= yy_get_previous_state();
2142 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2145 case EOB_ACT_LAST_MATCH
:
2147 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
2149 yy_current_state
= yy_get_previous_state();
2152 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2153 goto yy_find_action
;
2160 "fatal flex scanner internal error--no action found" );
2161 } /* end of action switch */
2162 } /* end of scanning one token */
2163 } /* end of yylex */
2166 /* yy_get_next_buffer - try to read in a new buffer
2168 * Returns a code representing an action:
2169 * EOB_ACT_LAST_MATCH -
2170 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2171 * EOB_ACT_END_OF_FILE - end of file
2174 static int yy_get_next_buffer()
2176 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2177 register char *source
= yytext_ptr
;
2178 register int number_to_move
, i
;
2181 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2183 "fatal flex scanner internal error--end of buffer missed" );
2185 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2186 { /* Don't try to fill the buffer, so this is an EOF. */
2187 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2189 /* We matched a single character, the EOB, so
2190 * treat this as a final EOF.
2192 return EOB_ACT_END_OF_FILE
;
2197 /* We matched some text prior to the EOB, first
2200 return EOB_ACT_LAST_MATCH
;
2204 /* Try to read more data. */
2206 /* First move last chars to start of buffer. */
2207 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2209 for ( i
= 0; i
< number_to_move
; ++i
)
2210 *(dest
++) = *(source
++);
2212 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2213 /* don't do the read, it's not guaranteed to return an EOF,
2216 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2221 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2223 while ( num_to_read
<= 0 )
2224 { /* Not enough room in the buffer - grow it. */
2225 #ifdef YY_USES_REJECT
2227 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2230 /* just a shorter name for the current buffer */
2231 YY_BUFFER_STATE b
= yy_current_buffer
;
2233 int yy_c_buf_p_offset
=
2234 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2236 if ( b
->yy_is_our_buffer
)
2238 int new_size
= b
->yy_buf_size
* 2;
2240 if ( new_size
<= 0 )
2241 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2243 b
->yy_buf_size
*= 2;
2245 b
->yy_ch_buf
= (char *)
2246 /* Include room in for 2 EOB chars. */
2247 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2248 b
->yy_buf_size
+ 2 );
2251 /* Can't grow it, we don't own it. */
2254 if ( ! b
->yy_ch_buf
)
2256 "fatal error - scanner input buffer overflow" );
2258 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2260 num_to_read
= yy_current_buffer
->yy_buf_size
-
2265 if ( num_to_read
> YY_READ_BUF_SIZE
)
2266 num_to_read
= YY_READ_BUF_SIZE
;
2268 /* Read in more data. */
2269 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2270 yy_n_chars
, num_to_read
);
2272 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2275 if ( yy_n_chars
== 0 )
2277 if ( number_to_move
== YY_MORE_ADJ
)
2279 ret_val
= EOB_ACT_END_OF_FILE
;
2285 ret_val
= EOB_ACT_LAST_MATCH
;
2286 yy_current_buffer
->yy_buffer_status
=
2287 YY_BUFFER_EOF_PENDING
;
2292 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2294 yy_n_chars
+= number_to_move
;
2295 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2296 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2298 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2304 /* yy_get_previous_state - get the state just before the EOB char was reached */
2306 static yy_state_type
yy_get_previous_state()
2308 register yy_state_type yy_current_state
;
2309 register char *yy_cp
;
2311 yy_current_state
= yy_start
;
2313 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2315 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 53);
2316 if ( yy_accept
[yy_current_state
] )
2318 yy_last_accepting_state
= yy_current_state
;
2319 yy_last_accepting_cpos
= yy_cp
;
2321 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2323 yy_current_state
= (int) yy_def
[yy_current_state
];
2324 if ( yy_current_state
>= 391 )
2325 yy_c
= yy_meta
[(unsigned int) yy_c
];
2327 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2330 return yy_current_state
;
2334 /* yy_try_NUL_trans - try to make a transition on the NUL character
2337 * next_state = yy_try_NUL_trans( current_state );
2340 #ifdef YY_USE_PROTOS
2341 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2343 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2344 yy_state_type yy_current_state
;
2347 register int yy_is_jam
;
2348 register char *yy_cp
= yy_c_buf_p
;
2350 register YY_CHAR yy_c
= 53;
2351 if ( yy_accept
[yy_current_state
] )
2353 yy_last_accepting_state
= yy_current_state
;
2354 yy_last_accepting_cpos
= yy_cp
;
2356 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2358 yy_current_state
= (int) yy_def
[yy_current_state
];
2359 if ( yy_current_state
>= 391 )
2360 yy_c
= yy_meta
[(unsigned int) yy_c
];
2362 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2363 yy_is_jam
= (yy_current_state
== 390);
2365 return yy_is_jam
? 0 : yy_current_state
;
2370 #ifdef YY_USE_PROTOS
2371 static void yyunput( int c
, register char *yy_bp
)
2373 static void yyunput( c
, yy_bp
)
2375 register char *yy_bp
;
2378 register char *yy_cp
= yy_c_buf_p
;
2380 /* undo effects of setting up yytext */
2381 *yy_cp
= yy_hold_char
;
2383 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2384 { /* need to shift things up to make room */
2385 /* +2 for EOB chars. */
2386 register int number_to_move
= yy_n_chars
+ 2;
2387 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2388 yy_current_buffer
->yy_buf_size
+ 2];
2389 register char *source
=
2390 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2392 while ( source
> yy_current_buffer
->yy_ch_buf
)
2393 *--dest
= *--source
;
2395 yy_cp
+= (int) (dest
- source
);
2396 yy_bp
+= (int) (dest
- source
);
2397 yy_current_buffer
->yy_n_chars
=
2398 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2400 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2401 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2404 *--yy_cp
= (char) c
;
2408 yy_hold_char
= *yy_cp
;
2411 #endif /* ifndef YY_NO_UNPUT */
2415 static int yyinput()
2422 *yy_c_buf_p
= yy_hold_char
;
2424 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2426 /* yy_c_buf_p now points to the character we want to return.
2427 * If this occurs *before* the EOB characters, then it's a
2428 * valid NUL; if not, then we've hit the end of the buffer.
2430 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2431 /* This was really a NUL. */
2435 { /* need more input */
2436 int offset
= yy_c_buf_p
- yytext_ptr
;
2439 switch ( yy_get_next_buffer() )
2441 case EOB_ACT_LAST_MATCH
:
2442 /* This happens because yy_g_n_b()
2443 * sees that we've accumulated a
2444 * token and flags that we need to
2445 * try matching the token before
2446 * proceeding. But for input(),
2447 * there's no matching to consider.
2448 * So convert the EOB_ACT_LAST_MATCH
2449 * to EOB_ACT_END_OF_FILE.
2452 /* Reset buffer status. */
2457 case EOB_ACT_END_OF_FILE
:
2462 if ( ! yy_did_buffer_switch_on_eof
)
2471 case EOB_ACT_CONTINUE_SCAN
:
2472 yy_c_buf_p
= yytext_ptr
+ offset
;
2478 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2479 *yy_c_buf_p
= '\0'; /* preserve yytext */
2480 yy_hold_char
= *++yy_c_buf_p
;
2487 #ifdef YY_USE_PROTOS
2488 void yyrestart( FILE *input_file
)
2490 void yyrestart( input_file
)
2494 if ( ! yy_current_buffer
)
2495 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2497 yy_init_buffer( yy_current_buffer
, input_file
);
2498 yy_load_buffer_state();
2502 #ifdef YY_USE_PROTOS
2503 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2505 void yy_switch_to_buffer( new_buffer
)
2506 YY_BUFFER_STATE new_buffer
;
2509 if ( yy_current_buffer
== new_buffer
)
2512 if ( yy_current_buffer
)
2514 /* Flush out information for old buffer. */
2515 *yy_c_buf_p
= yy_hold_char
;
2516 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2517 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2520 yy_current_buffer
= new_buffer
;
2521 yy_load_buffer_state();
2523 /* We don't actually know whether we did this switch during
2524 * EOF (yywrap()) processing, but the only time this flag
2525 * is looked at is after yywrap() is called, so it's safe
2526 * to go ahead and always set it.
2528 yy_did_buffer_switch_on_eof
= 1;
2532 #ifdef YY_USE_PROTOS
2533 void yy_load_buffer_state( void )
2535 void yy_load_buffer_state()
2538 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2539 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2540 yyin
= yy_current_buffer
->yy_input_file
;
2541 yy_hold_char
= *yy_c_buf_p
;
2545 #ifdef YY_USE_PROTOS
2546 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2548 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2555 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2557 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2559 b
->yy_buf_size
= size
;
2561 /* yy_ch_buf has to be 2 characters longer than the size given because
2562 * we need to put in 2 end-of-buffer characters.
2564 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2565 if ( ! b
->yy_ch_buf
)
2566 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2568 b
->yy_is_our_buffer
= 1;
2570 yy_init_buffer( b
, file
);
2576 #ifdef YY_USE_PROTOS
2577 void yy_delete_buffer( YY_BUFFER_STATE b
)
2579 void yy_delete_buffer( b
)
2586 if ( b
== yy_current_buffer
)
2587 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2589 if ( b
->yy_is_our_buffer
)
2590 yy_flex_free( (void *) b
->yy_ch_buf
);
2592 yy_flex_free( (void *) b
);
2599 #ifndef YY_ALWAYS_INTERACTIVE
2600 #ifndef YY_NEVER_INTERACTIVE
2601 extern int isatty
YY_PROTO(( int ));
2606 #ifdef YY_USE_PROTOS
2607 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2609 void yy_init_buffer( b
, file
)
2616 yy_flush_buffer( b
);
2618 b
->yy_input_file
= file
;
2619 b
->yy_fill_buffer
= 1;
2621 #if YY_ALWAYS_INTERACTIVE
2622 b
->yy_is_interactive
= 1;
2624 #if YY_NEVER_INTERACTIVE
2625 b
->yy_is_interactive
= 0;
2627 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2633 #ifdef YY_USE_PROTOS
2634 void yy_flush_buffer( YY_BUFFER_STATE b
)
2636 void yy_flush_buffer( b
)
2646 /* We always need two end-of-buffer characters. The first causes
2647 * a transition to the end-of-buffer state. The second causes
2648 * a jam in that state.
2650 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2651 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2653 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2656 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2658 if ( b
== yy_current_buffer
)
2659 yy_load_buffer_state();
2663 #ifndef YY_NO_SCAN_BUFFER
2664 #ifdef YY_USE_PROTOS
2665 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2667 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2675 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2676 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2677 /* They forgot to leave room for the EOB's. */
2680 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2682 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2684 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2685 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2686 b
->yy_is_our_buffer
= 0;
2687 b
->yy_input_file
= 0;
2688 b
->yy_n_chars
= b
->yy_buf_size
;
2689 b
->yy_is_interactive
= 0;
2691 b
->yy_fill_buffer
= 0;
2692 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2694 yy_switch_to_buffer( b
);
2701 #ifndef YY_NO_SCAN_STRING
2702 #ifdef YY_USE_PROTOS
2703 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2705 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2706 yyconst
char *yy_str
;
2710 for ( len
= 0; yy_str
[len
]; ++len
)
2713 return yy_scan_bytes( yy_str
, len
);
2718 #ifndef YY_NO_SCAN_BYTES
2719 #ifdef YY_USE_PROTOS
2720 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2722 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2723 yyconst
char *bytes
;
2732 /* Get memory for full buffer, including space for trailing EOB's. */
2734 buf
= (char *) yy_flex_alloc( n
);
2736 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2738 for ( i
= 0; i
< len
; ++i
)
2741 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2743 b
= yy_scan_buffer( buf
, n
);
2745 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2747 /* It's okay to grow etc. this buffer, and we should throw it
2748 * away when we're done.
2750 b
->yy_is_our_buffer
= 1;
2757 #ifndef YY_NO_PUSH_STATE
2758 #ifdef YY_USE_PROTOS
2759 static void yy_push_state( int new_state
)
2761 static void yy_push_state( new_state
)
2765 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2769 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2770 new_size
= yy_start_stack_depth
* sizeof( int );
2772 if ( ! yy_start_stack
)
2773 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2776 yy_start_stack
= (int *) yy_flex_realloc(
2777 (void *) yy_start_stack
, new_size
);
2779 if ( ! yy_start_stack
)
2781 "out of memory expanding start-condition stack" );
2784 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2791 #ifndef YY_NO_POP_STATE
2792 static void yy_pop_state()
2794 if ( --yy_start_stack_ptr
< 0 )
2795 YY_FATAL_ERROR( "start-condition stack underflow" );
2797 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2802 #ifndef YY_NO_TOP_STATE
2803 static int yy_top_state()
2805 return yy_start_stack
[yy_start_stack_ptr
- 1];
2809 #ifndef YY_EXIT_FAILURE
2810 #define YY_EXIT_FAILURE 2
2813 #ifdef YY_USE_PROTOS
2814 static void yy_fatal_error( yyconst
char msg
[] )
2816 static void yy_fatal_error( msg
)
2820 (void) fprintf( stderr
, "%s\n", msg
);
2821 exit( YY_EXIT_FAILURE
);
2826 /* Redefine yyless() so it works in section 3 code. */
2832 /* Undo effects of setting up yytext. */ \
2833 yytext[yyleng] = yy_hold_char; \
2834 yy_c_buf_p = yytext + n; \
2835 yy_hold_char = *yy_c_buf_p; \
2836 *yy_c_buf_p = '\0'; \
2842 /* Internal utility routines. */
2845 #ifdef YY_USE_PROTOS
2846 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2848 static void yy_flex_strncpy( s1
, s2
, n
)
2855 for ( i
= 0; i
< n
; ++i
)
2860 #ifdef YY_NEED_STRLEN
2861 #ifdef YY_USE_PROTOS
2862 static int yy_flex_strlen( yyconst
char *s
)
2864 static int yy_flex_strlen( s
)
2869 for ( n
= 0; s
[n
]; ++n
)
2877 #ifdef YY_USE_PROTOS
2878 static void *yy_flex_alloc( yy_size_t size
)
2880 static void *yy_flex_alloc( size
)
2884 return (void *) malloc( size
);
2887 #ifdef YY_USE_PROTOS
2888 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2890 static void *yy_flex_realloc( ptr
, size
)
2895 /* The cast to (char *) in the following accommodates both
2896 * implementations that use char* generic pointers, and those
2897 * that use void* generic pointers. It works with the latter
2898 * because both ANSI C and C++ allow castless assignment from
2899 * any pointer type to void*, and deal with argument conversions
2900 * as though doing an assignment.
2902 return (void *) realloc( (char *) ptr
, size
);
2905 #ifdef YY_USE_PROTOS
2906 static void yy_flex_free( void *ptr
)
2908 static void yy_flex_free( ptr
)
2922 #line 672 "scan-gram.l"
2925 /*------------------------------------------------------------------.
2926 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2928 | Possible inputs: $[<TYPENAME>]($|integer) |
2930 | Output to the STRING_OBSTACK a reference to this semantic value. |
2931 `------------------------------------------------------------------*/
2934 handle_action_dollar (char *text
, location_t location
)
2936 const char *type_name
= NULL
;
2937 char *cp
= text
+ 1;
2939 /* Get the type name if explicit. */
2952 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2953 if (!type_name
&& typed
)
2954 complain_at (location
, _("$$ of `%s' has no declared type"),
2955 current_rule
->sym
->tag
);
2958 obstack_fgrow1 (&string_obstack
,
2959 "]b4_lhs_value([%s])[", type_name
);
2965 num
= strtol (cp
, 0, 10);
2967 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
2970 if (!type_name
&& n
> 0)
2971 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
2973 if (!type_name
&& typed
)
2974 complain_at (location
, _("$%d of `%s' has no declared type"),
2975 n
, current_rule
->sym
->tag
);
2978 obstack_fgrow3 (&string_obstack
,
2979 "]b4_rhs_value([%d], [%d], [%s])[",
2980 rule_length
, n
, type_name
);
2983 complain_at (location
, _("invalid value: %s"), text
);
2988 /*---------------------------------------------------------------.
2989 | TEXT is expected to be $$ in some code associated to a symbol: |
2990 | destructor or printer. |
2991 `---------------------------------------------------------------*/
2994 handle_symbol_code_dollar (char *text
, location_t location
)
2996 char *cp
= text
+ 1;
2998 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
3000 complain_at (location
, _("%s is invalid"), quote_n (1, text
));
3004 /*-----------------------------------------------------------------.
3005 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
3006 | depending upon CODE_KIND. |
3007 `-----------------------------------------------------------------*/
3010 handle_dollar (braced_code_t braced_code_kind
,
3011 char *text
, location_t location
)
3013 switch (braced_code_kind
)
3015 case action_braced_code
:
3016 handle_action_dollar (text
, location
);
3019 case destructor_braced_code
:
3020 case printer_braced_code
:
3021 handle_symbol_code_dollar (text
, location
);
3027 /*------------------------------------------------------.
3028 | TEXT is a location token (i.e., a `@...'). Output to |
3029 | STRING_OBSTACK a reference to this location. |
3030 `------------------------------------------------------*/
3033 handle_action_at (char *text
, location_t location
)
3035 char *cp
= text
+ 1;
3040 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
3046 num
= strtol (cp
, 0, 10);
3048 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
3051 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
3055 complain_at (location
, _("invalid value: %s"), text
);
3060 /*---------------------------------------------------------------.
3061 | TEXT is expected to be @$ in some code associated to a symbol: |
3062 | destructor or printer. |
3063 `---------------------------------------------------------------*/
3066 handle_symbol_code_at (char *text
, location_t location
)
3068 char *cp
= text
+ 1;
3070 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
3072 complain_at (location
, _("%s is invalid"), quote_n (1, text
));
3076 /*-------------------------------------------------------------------.
3077 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
3079 `-------------------------------------------------------------------*/
3082 handle_at (braced_code_t braced_code_kind
,
3083 char *text
, location_t location
)
3085 switch (braced_code_kind
)
3087 case action_braced_code
:
3088 handle_action_at (text
, location
);
3091 case destructor_braced_code
:
3092 case printer_braced_code
:
3093 handle_symbol_code_at (text
, location
);
3099 /*------------------------------------------------------------------.
3100 | Convert universal character name UCN to a single-byte character, |
3101 | and return that character. Return -1 if UCN does not correspond |
3102 | to a single-byte character. |
3103 `------------------------------------------------------------------*/
3106 convert_ucn_to_byte (char const *ucn
)
3108 unsigned long code
= strtoul (ucn
+ 2, 0, 16);
3110 /* FIXME: Currently we assume Unicode-compatible unibyte characters
3111 on ASCII hosts (i.e., Latin-1 on hosts with 8-bit bytes). On
3112 non-ASCII hosts we support only the portable C character set.
3113 These limitations should be removed once we add support for
3114 multibyte characters. */
3116 if (UCHAR_MAX
< code
)
3119 #if ! ('$' == 0x24 && '@' == 0x40 && '`' == 0x60 && '~' == 0x7e)
3121 /* A non-ASCII host. Use CODE to index into a table of the C
3122 basic execution character set, which is guaranteed to exist on
3123 all Standard C platforms. This table also includes '$', '@',
3124 and '`', which not in the basic execution character set but
3125 which are unibyte characters on all the platforms that we know
3127 static signed char const table
[] =
3129 '\0', -1, -1, -1, -1, -1, -1, '\a',
3130 '\b', '\t', '\n', '\v', '\f', '\r', -1, -1,
3131 -1, -1, -1, -1, -1, -1, -1, -1,
3132 -1, -1, -1, -1, -1, -1, -1, -1,
3133 ' ', '!', '"', '#', '$', '%', '&', '\'',
3134 '(', ')', '*', '+', ',', '-', '.', '/',
3135 '0', '1', '2', '3', '4', '5', '6', '7',
3136 '8', '9', ':', ';', '<', '=', '>', '?',
3137 '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
3138 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
3139 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
3140 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
3141 '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
3142 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
3143 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
3144 'x', 'y', 'z', '{', '|', '}', '~'
3147 code
= code
< sizeof table
? table
[code
] : -1;
3155 /*-------------------------.
3156 | Initialize the scanner. |
3157 `-------------------------*/
3160 scanner_initialize (void)
3162 obstack_init (&string_obstack
);
3166 /*-----------------------------------------------.
3167 | Free all the memory allocated to the scanner. |
3168 `-----------------------------------------------*/
3173 obstack_free (&string_obstack
, 0);
3174 /* Reclaim Flex's buffers. */
3175 yy_delete_buffer (YY_CURRENT_BUFFER
);