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" */
47 /* Use prototypes in function declarations. */
50 /* The "const" storage-class-modifier is valid. */
53 #else /* ! __cplusplus */
61 #endif /* ! __cplusplus */
80 #define YY_PROTO(proto) proto
82 #define YY_PROTO(proto) ()
85 /* Returned upon end-of-file. */
88 /* Promotes a possibly negative, possibly signed char to an unsigned
89 * integer for use as an array index. If the signed char is negative,
90 * we want to instead treat it as an 8-bit unsigned char, hence the
93 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
95 /* Enter a start condition. This macro really ought to take a parameter,
96 * but we do it the disgusting crufty way forced on us by the ()-less
97 * definition of BEGIN.
99 #define BEGIN yy_start = 1 + 2 *
101 /* Translate the current start state into a value that can be later handed
102 * to BEGIN to return to the state. The YYSTATE alias is for lex
105 #define YY_START ((yy_start - 1) / 2)
106 #define YYSTATE YY_START
108 /* Action number for EOF rule of a given start state. */
109 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
111 /* Special action meaning "start processing a new file". */
112 #define YY_NEW_FILE yyrestart( yyin )
114 #define YY_END_OF_BUFFER_CHAR 0
116 /* Size of default input buffer. */
117 #define YY_BUF_SIZE 16384
119 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
122 extern FILE *yyin
, *yyout
;
124 #define EOB_ACT_CONTINUE_SCAN 0
125 #define EOB_ACT_END_OF_FILE 1
126 #define EOB_ACT_LAST_MATCH 2
128 /* The funky do-while in the following #define is used to turn the definition
129 * int a single C statement (which needs a semi-colon terminator). This
130 * avoids problems with code like:
132 * if ( condition_holds )
135 * do_something_else();
137 * Prior to using the do-while the compiler would get upset at the
138 * "else" because it interpreted the "if" statement as being all
139 * done when it reached the ';' after the yyless() call.
142 /* Return all but the first 'n' matched characters back to the input stream. */
147 /* Undo effects of setting up yytext. */ \
148 *yy_cp = yy_hold_char; \
149 YY_RESTORE_YY_MORE_OFFSET \
150 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
151 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
155 #define unput(c) yyunput( c, yytext_ptr )
157 /* The following is because we cannot portably get our hands on size_t
158 * (without autoconf's help, which isn't available because we want
159 * flex-generated scanners to compile on their own).
161 typedef unsigned int yy_size_t
;
164 struct yy_buffer_state
168 char *yy_ch_buf
; /* input buffer */
169 char *yy_buf_pos
; /* current position in input buffer */
171 /* Size of input buffer in bytes, not including room for EOB
174 yy_size_t yy_buf_size
;
176 /* Number of characters read into yy_ch_buf, not including EOB
181 /* Whether we "own" the buffer - i.e., we know we created it,
182 * and can realloc() it to grow it, and should free() it to
185 int yy_is_our_buffer
;
187 /* Whether this is an "interactive" input source; if so, and
188 * if we're using stdio for input, then we want to use getc()
189 * instead of fread(), to make sure we stop fetching input after
192 int yy_is_interactive
;
194 /* Whether we're considered to be at the beginning of a line.
195 * If so, '^' rules will be active on the next match, otherwise
200 /* Whether to try to fill the input buffer when we reach the
205 int yy_buffer_status
;
206 #define YY_BUFFER_NEW 0
207 #define YY_BUFFER_NORMAL 1
208 /* When an EOF's been seen but there's still some text to process
209 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
210 * shouldn't try reading from the input source any more. We might
211 * still have a bunch of tokens to match, though, because of
212 * possible backing-up.
214 * When we actually see the EOF, we change the status to "new"
215 * (via yyrestart()), so that the user can continue scanning by
216 * just pointing yyin at a new input file.
218 #define YY_BUFFER_EOF_PENDING 2
221 static YY_BUFFER_STATE yy_current_buffer
= 0;
223 /* We provide macros for accessing buffer states in case in the
224 * future we want to put the buffer states in a more general
227 #define YY_CURRENT_BUFFER yy_current_buffer
230 /* yy_hold_char holds the character lost when yytext is formed. */
231 static char yy_hold_char
;
233 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
238 /* Points to current character in buffer. */
239 static char *yy_c_buf_p
= (char *) 0;
240 static int yy_init
= 1; /* whether we need to initialize */
241 static int yy_start
= 0; /* start state number */
243 /* Flag which is used to allow yywrap()'s to do buffer switches
244 * instead of setting up a fresh yyin. A bit of a hack ...
246 static int yy_did_buffer_switch_on_eof
;
248 void yyrestart
YY_PROTO(( FILE *input_file
));
250 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
251 void yy_load_buffer_state
YY_PROTO(( void ));
252 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
253 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
254 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
255 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
256 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
258 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
259 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
260 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
262 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
263 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
));
264 static void yy_flex_free
YY_PROTO(( void * ));
266 #define yy_new_buffer yy_create_buffer
268 #define yy_set_interactive(is_interactive) \
270 if ( ! yy_current_buffer ) \
271 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
272 yy_current_buffer->yy_is_interactive = is_interactive; \
275 #define yy_set_bol(at_bol) \
277 if ( ! yy_current_buffer ) \
278 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
279 yy_current_buffer->yy_at_bol = at_bol; \
282 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
286 #define YY_SKIP_YYWRAP
289 typedef unsigned char YY_CHAR
;
290 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
291 typedef int yy_state_type
;
295 #define yytext_ptr yytext
297 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
298 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
299 static int yy_get_next_buffer
YY_PROTO(( void ));
300 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
302 /* Done after the current pattern has been matched and before the
303 * corresponding action - sets up yytext.
305 #define YY_DO_BEFORE_ACTION \
306 yytext_ptr = yy_bp; \
307 yyleng = (int) (yy_cp - yy_bp); \
308 yy_hold_char = *yy_cp; \
312 #define YY_NUM_RULES 102
313 #define YY_END_OF_BUFFER 103
314 static yyconst
short int yy_accept
[391] =
316 0, 0, 0, 0, 59, 59, 0, 0, 85, 85,
317 80, 80, 0, 0, 0, 0, 0, 0, 0, 0,
318 0, 0, 103, 51, 40, 40, 44, 51, 43, 38,
319 41, 51, 42, 36, 39, 51, 35, 48, 37, 57,
320 57, 52, 53, 59, 58, 59, 55, 55, 83, 82,
321 86, 78, 77, 81, 61, 60, 76, 63, 62, 96,
322 96, 88, 97, 87, 91, 97, 52, 53, 93, 92,
323 99, 88, 100, 87, 91, 101, 88, 87, 91, 40,
324 50, 0, 0, 0, 0, 0, 0, 0, 0, 0,
325 0, 0, 0, 0, 0, 0, 0, 47, 41, 45,
327 46, 42, 0, 57, 56, 0, 59, 59, 59, 59,
328 55, 54, 83, 84, 84, 84, 84, 78, 79, 79,
329 79, 79, 61, 75, 73, 64, 75, 66, 67, 68,
330 69, 70, 71, 75, 72, 75, 63, 96, 94, 0,
331 94, 0, 89, 90, 0, 95, 0, 95, 99, 98,
332 101, 89, 90, 101, 0, 0, 0, 0, 0, 0,
333 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
334 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
335 46, 49, 0, 0, 0, 85, 0, 0, 0, 0,
336 80, 0, 0, 0, 64, 0, 0, 65, 0, 0,
338 0, 101, 101, 0, 0, 0, 0, 0, 0, 0,
339 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
340 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
341 0, 0, 0, 0, 0, 64, 0, 0, 0, 0,
342 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
343 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
344 0, 0, 0, 0, 0, 28, 0, 31, 0, 0,
345 34, 0, 0, 0, 2, 0, 0, 6, 0, 0,
346 0, 0, 0, 0, 0, 14, 0, 0, 0, 18,
347 0, 0, 0, 0, 24, 0, 27, 29, 32, 0,
349 0, 74, 1, 3, 0, 0, 8, 0, 0, 0,
350 0, 0, 0, 0, 0, 19, 0, 0, 0, 0,
351 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
352 0, 0, 0, 0, 22, 0, 0, 0, 33, 0,
353 0, 0, 0, 0, 0, 0, 0, 16, 17, 0,
354 0, 26, 0, 0, 0, 0, 0, 0, 25, 13,
355 0, 0, 0, 0, 5, 0, 0, 0, 11, 0,
356 0, 0, 0, 0, 9, 0, 15, 20, 23, 30,
357 0, 0, 7, 0, 0, 0, 0, 0, 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, 1,
395 8, 9, 10, 10, 1, 1, 1, 1, 11, 1,
396 4, 10, 8, 12, 13, 12, 8, 10, 10, 10,
397 10, 10, 10, 8, 8, 8, 8, 8, 8, 8,
398 8, 8, 8, 8, 8, 8, 8, 8, 8, 4,
402 static yyconst
short int yy_base
[427] =
404 0, 0, 46, 47, 53, 56, 802, 801, 59, 62,
405 50, 82, 65, 87, 85, 86, 110, 160, 92, 117,
406 121, 128, 808, 811, 58, 62, 811, 207, 811, 811,
407 0, 50, 54, 811, 811, 0, 811, 811, 811, 0,
408 114, 811, 811, 782, 811, 117, 0, 794, 0, 811,
409 146, 0, 811, 148, 0, 811, 254, 0, 811, 0,
410 0, 811, 165, 811, 149, 175, 811, 811, 811, 811,
411 0, 811, 753, 811, 175, 0, 0, 0, 182, 92,
412 811, 768, 95, 54, 767, 764, 68, 769, 163, 754,
413 110, 763, 121, 127, 758, 765, 768, 811, 0, 811,
415 0, 179, 776, 0, 811, 193, 769, 195, 199, 768,
416 0, 811, 0, 811, 203, 767, 212, 0, 811, 214,
417 766, 216, 0, 811, 811, 777, 0, 811, 811, 811,
418 811, 811, 811, 0, 811, 0, 0, 0, 811, 208,
419 212, 0, 811, 811, 225, 811, 216, 218, 0, 811,
420 0, 0, 0, 231, 749, 226, 745, 744, 744, 161,
421 742, 227, 754, 740, 743, 253, 749, 735, 736, 69,
422 735, 743, 744, 747, 731, 736, 730, 735, 727, 739,
423 0, 811, 240, 253, 266, 743, 269, 282, 742, 286,
424 741, 288, 293, 740, 751, 0, 0, 0, 744, 301,
426 297, 304, 300, 734, 715, 724, 714, 726, 716, 724,
427 723, 722, 743, 707, 741, 722, 715, 716, 709, 718,
428 702, 702, 699, 712, 701, 708, 704, 700, 694, 697,
429 703, 702, 692, 703, 701, 811, 0, 0, 305, 687,
430 695, 688, 684, 696, 682, 694, 713, 691, 679, 811,
431 678, 674, 686, 254, 681, 672, 676, 668, 681, 811,
432 667, 301, 666, 678, 664, 811, 668, 811, 667, 665,
433 811, 0, 0, 656, 811, 672, 657, 811, 303, 657,
434 659, 304, 672, 671, 662, 811, 655, 656, 651, 811,
435 649, 683, 660, 649, 811, 645, 811, 306, 811, 645,
437 0, 811, 811, 644, 657, 639, 811, 642, 643, 640,
438 639, 640, 637, 647, 637, 811, 635, 633, 647, 633,
439 628, 640, 811, 626, 638, 635, 612, 601, 614, 589,
440 594, 579, 592, 592, 811, 573, 573, 582, 811, 567,
441 564, 565, 525, 534, 510, 498, 489, 811, 811, 470,
442 461, 811, 466, 449, 458, 442, 427, 423, 811, 811,
443 296, 301, 295, 288, 811, 283, 275, 275, 811, 272,
444 259, 249, 254, 232, 811, 228, 811, 811, 811, 811,
445 234, 307, 811, 229, 208, 199, 203, 179, 811, 811,
446 334, 347, 360, 373, 386, 399, 412, 425, 438, 451,
448 457, 467, 480, 493, 506, 519, 530, 543, 554, 567,
449 579, 592, 604, 617, 630, 643, 201, 193, 167, 656,
450 159, 145, 136, 134, 120, 93
453 static yyconst
short int yy_def
[427] =
455 390, 1, 391, 391, 392, 392, 393, 393, 394, 394,
456 395, 395, 396, 396, 397, 397, 398, 398, 399, 399,
457 400, 400, 390, 390, 390, 390, 390, 390, 390, 390,
458 401, 390, 390, 390, 390, 402, 390, 390, 390, 403,
459 390, 390, 390, 404, 390, 404, 405, 390, 406, 390,
460 407, 408, 390, 409, 410, 390, 411, 412, 390, 413,
461 413, 390, 390, 390, 390, 390, 390, 390, 390, 390,
462 414, 390, 390, 390, 390, 415, 415, 415, 415, 390,
463 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
464 390, 390, 390, 390, 390, 390, 390, 390, 401, 390,
466 416, 390, 402, 403, 390, 390, 404, 404, 404, 404,
467 405, 390, 406, 390, 390, 390, 390, 408, 390, 390,
468 390, 390, 410, 390, 390, 390, 417, 390, 390, 390,
469 390, 390, 390, 418, 390, 419, 412, 413, 390, 390,
470 390, 420, 390, 390, 390, 390, 390, 390, 414, 390,
471 415, 415, 415, 415, 390, 390, 390, 390, 390, 390,
472 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
473 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
474 416, 390, 390, 390, 390, 390, 390, 390, 407, 390,
475 390, 390, 390, 409, 390, 421, 422, 419, 420, 390,
477 390, 415, 415, 390, 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 390, 390, 390, 390, 390, 390, 423, 424, 390, 390,
481 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
482 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
483 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
484 390, 425, 426, 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, 390, 390, 390, 390,
488 418, 390, 390, 390, 390, 390, 390, 390, 390, 390,
489 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
490 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
491 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
492 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
493 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
494 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
495 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
496 390, 390, 390, 390, 390, 390, 390, 390, 390, 0,
497 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
504 static yyconst
short int yy_nxt
[865] =
506 24, 25, 26, 27, 24, 28, 29, 24, 30, 24,
507 31, 32, 33, 33, 34, 35, 36, 37, 24, 24,
508 24, 31, 31, 24, 24, 24, 31, 31, 31, 31,
509 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
510 31, 31, 31, 31, 31, 31, 31, 31, 31, 38,
511 39, 24, 24, 41, 41, 45, 53, 100, 45, 80,
512 80, 101, 50, 80, 80, 50, 102, 102, 56, 42,
513 42, 43, 43, 42, 54, 43, 42, 46, 43, 42,
514 46, 43, 42, 51, 43, 42, 51, 43, 53, 57,
515 56, 59, 59, 80, 80, 72, 158, 73, 74, 162,
517 224, 159, 302, 75, 225, 42, 54, 43, 163, 57,
518 57, 57, 61, 62, 63, 42, 64, 43, 109, 110,
519 72, 65, 73, 74, 77, 105, 156, 78, 75, 301,
520 66, 77, 79, 67, 78, 68, 157, 169, 106, 79,
521 42, 108, 43, 273, 42, 272, 43, 115, 116, 120,
522 121, 42, 170, 43, 238, 171, 143, 173, 175, 69,
523 144, 70, 61, 62, 63, 174, 64, 176, 237, 139,
524 117, 65, 122, 145, 140, 177, 198, 141, 141, 146,
525 66, 142, 143, 67, 147, 68, 144, 148, 148, 152,
526 165, 102, 102, 153, 183, 184, 109, 110, 211, 145,
528 109, 110, 197, 166, 185, 186, 154, 167, 212, 69,
529 196, 70, 81, 188, 189, 190, 191, 193, 194, 108,
530 141, 141, 389, 108, 141, 141, 200, 201, 148, 148,
531 148, 148, 202, 203, 388, 82, 387, 83, 84, 85,
532 86, 183, 184, 386, 87, 88, 89, 90, 91, 92,
533 93, 94, 95, 96, 205, 97, 98, 125, 206, 214,
534 125, 385, 219, 287, 105, 383, 126, 185, 186, 207,
535 185, 186, 382, 125, 215, 381, 127, 106, 125, 219,
536 287, 128, 129, 188, 189, 380, 130, 190, 191, 190,
537 191, 379, 220, 131, 193, 194, 132, 378, 133, 134,
539 135, 136, 200, 201, 143, 202, 203, 152, 144, 139,
540 294, 153, 306, 309, 140, 321, 384, 141, 141, 377,
541 376, 145, 375, 374, 154, 373, 372, 294, 371, 306,
542 309, 370, 321, 384, 40, 40, 40, 40, 40, 40,
543 40, 40, 40, 40, 40, 40, 40, 44, 44, 44,
544 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
545 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
546 47, 47, 47, 49, 49, 49, 49, 49, 49, 49,
547 49, 49, 49, 49, 49, 49, 52, 52, 52, 52,
548 52, 52, 52, 52, 52, 52, 52, 52, 52, 55,
550 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
551 55, 55, 58, 58, 58, 58, 58, 58, 58, 58,
552 58, 58, 58, 58, 58, 60, 60, 60, 60, 60,
553 60, 60, 60, 60, 60, 60, 60, 60, 71, 71,
554 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
555 71, 76, 76, 76, 76, 76, 76, 76, 76, 76,
556 76, 76, 76, 76, 99, 369, 99, 103, 368, 103,
557 103, 103, 103, 103, 103, 103, 103, 367, 103, 103,
558 104, 104, 104, 104, 104, 104, 366, 104, 104, 104,
559 104, 365, 104, 107, 364, 107, 107, 107, 107, 107,
561 107, 107, 107, 107, 363, 107, 111, 111, 111, 111,
562 111, 111, 362, 111, 111, 111, 111, 111, 111, 113,
563 113, 361, 113, 113, 113, 113, 113, 113, 113, 113,
564 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
565 114, 360, 114, 118, 118, 118, 118, 118, 359, 118,
566 118, 118, 118, 118, 119, 119, 119, 119, 119, 119,
567 119, 119, 119, 119, 119, 358, 119, 123, 123, 357,
568 123, 123, 123, 123, 123, 123, 123, 123, 123, 124,
569 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
570 124, 124, 137, 137, 137, 137, 137, 356, 137, 137,
572 137, 137, 137, 137, 138, 138, 355, 354, 138, 353,
573 138, 138, 352, 138, 138, 351, 138, 149, 149, 350,
574 149, 349, 348, 149, 149, 347, 149, 149, 346, 149,
575 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
576 151, 345, 151, 181, 344, 181, 181, 181, 181, 181,
577 181, 181, 181, 181, 181, 181, 199, 343, 199, 199,
578 199, 199, 199, 199, 199, 199, 342, 199, 199, 341,
579 340, 339, 338, 337, 336, 335, 334, 333, 332, 331,
580 330, 329, 328, 327, 326, 325, 324, 323, 322, 320,
581 319, 318, 317, 316, 315, 314, 313, 312, 311, 310,
583 308, 307, 305, 304, 303, 300, 299, 298, 297, 296,
584 295, 293, 292, 291, 290, 289, 288, 286, 285, 284,
585 283, 282, 281, 280, 279, 278, 277, 276, 275, 274,
586 271, 270, 269, 268, 267, 266, 265, 264, 263, 262,
587 261, 260, 259, 258, 257, 256, 255, 254, 253, 252,
588 251, 250, 249, 248, 247, 246, 245, 244, 243, 242,
589 241, 240, 239, 236, 122, 192, 117, 187, 235, 234,
590 233, 232, 231, 230, 229, 228, 227, 226, 223, 222,
591 221, 218, 217, 216, 213, 210, 209, 208, 204, 195,
592 192, 187, 108, 108, 182, 180, 179, 178, 172, 168,
594 164, 161, 160, 155, 150, 112, 108, 390, 48, 48,
595 23, 390, 390, 390, 390, 390, 390, 390, 390, 390,
596 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
597 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
598 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
599 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
603 static yyconst
short int yy_chk
[865] =
605 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
606 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
607 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
608 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
609 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
610 1, 1, 1, 3, 4, 5, 11, 32, 6, 25,
611 25, 32, 9, 26, 26, 10, 33, 33, 13, 3,
612 4, 3, 4, 11, 11, 11, 5, 5, 5, 6,
613 6, 6, 9, 9, 9, 10, 10, 10, 12, 13,
614 14, 15, 16, 80, 80, 19, 84, 19, 19, 87,
616 170, 84, 426, 19, 170, 12, 12, 12, 87, 15,
617 16, 14, 17, 17, 17, 19, 17, 19, 46, 46,
618 20, 17, 20, 20, 21, 41, 83, 21, 20, 425,
619 17, 22, 21, 17, 22, 17, 83, 91, 41, 22,
620 20, 46, 20, 424, 21, 423, 21, 51, 51, 54,
621 54, 22, 91, 22, 422, 91, 65, 93, 94, 17,
622 65, 17, 18, 18, 18, 93, 18, 94, 421, 63,
623 51, 18, 54, 65, 63, 94, 419, 63, 63, 66,
624 18, 63, 75, 18, 66, 18, 75, 66, 66, 79,
625 89, 102, 102, 79, 106, 106, 108, 108, 160, 75,
627 109, 109, 418, 89, 115, 115, 79, 89, 160, 18,
628 417, 18, 28, 117, 117, 120, 120, 122, 122, 108,
629 140, 140, 388, 109, 141, 141, 145, 145, 147, 147,
630 148, 148, 154, 154, 387, 28, 386, 28, 28, 28,
631 28, 183, 183, 385, 28, 28, 28, 28, 28, 28,
632 28, 28, 28, 28, 156, 28, 28, 57, 156, 162,
633 57, 384, 166, 254, 184, 381, 57, 185, 185, 156,
634 187, 187, 376, 57, 162, 374, 57, 184, 57, 166,
635 254, 57, 57, 188, 188, 373, 57, 190, 190, 192,
636 192, 372, 166, 57, 193, 193, 57, 371, 57, 57,
638 57, 57, 200, 200, 201, 202, 202, 203, 201, 239,
639 262, 203, 279, 282, 239, 298, 382, 239, 239, 370,
640 368, 201, 367, 366, 203, 364, 363, 262, 362, 279,
641 282, 361, 298, 382, 391, 391, 391, 391, 391, 391,
642 391, 391, 391, 391, 391, 391, 391, 392, 392, 392,
643 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
644 393, 393, 393, 393, 393, 393, 393, 393, 393, 393,
645 393, 393, 393, 394, 394, 394, 394, 394, 394, 394,
646 394, 394, 394, 394, 394, 394, 395, 395, 395, 395,
647 395, 395, 395, 395, 395, 395, 395, 395, 395, 396,
649 396, 396, 396, 396, 396, 396, 396, 396, 396, 396,
650 396, 396, 397, 397, 397, 397, 397, 397, 397, 397,
651 397, 397, 397, 397, 397, 398, 398, 398, 398, 398,
652 398, 398, 398, 398, 398, 398, 398, 398, 399, 399,
653 399, 399, 399, 399, 399, 399, 399, 399, 399, 399,
654 399, 400, 400, 400, 400, 400, 400, 400, 400, 400,
655 400, 400, 400, 400, 401, 358, 401, 402, 357, 402,
656 402, 402, 402, 402, 402, 402, 402, 356, 402, 402,
657 403, 403, 403, 403, 403, 403, 355, 403, 403, 403,
658 403, 354, 403, 404, 353, 404, 404, 404, 404, 404,
660 404, 404, 404, 404, 351, 404, 405, 405, 405, 405,
661 405, 405, 350, 405, 405, 405, 405, 405, 405, 406,
662 406, 347, 406, 406, 406, 406, 406, 406, 406, 406,
663 407, 407, 407, 407, 407, 407, 407, 407, 407, 407,
664 407, 346, 407, 408, 408, 408, 408, 408, 345, 408,
665 408, 408, 408, 408, 409, 409, 409, 409, 409, 409,
666 409, 409, 409, 409, 409, 344, 409, 410, 410, 343,
667 410, 410, 410, 410, 410, 410, 410, 410, 410, 411,
668 411, 411, 411, 411, 411, 411, 411, 411, 411, 411,
669 411, 411, 412, 412, 412, 412, 412, 342, 412, 412,
671 412, 412, 412, 412, 413, 413, 341, 340, 413, 338,
672 413, 413, 337, 413, 413, 336, 413, 414, 414, 334,
673 414, 333, 332, 414, 414, 331, 414, 414, 330, 414,
674 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
675 415, 329, 415, 416, 328, 416, 416, 416, 416, 416,
676 416, 416, 416, 416, 416, 416, 420, 327, 420, 420,
677 420, 420, 420, 420, 420, 420, 326, 420, 420, 325,
678 324, 322, 321, 320, 319, 318, 317, 315, 314, 313,
679 312, 311, 310, 309, 308, 306, 305, 304, 300, 296,
680 294, 293, 292, 291, 289, 288, 287, 285, 284, 283,
682 281, 280, 277, 276, 274, 270, 269, 267, 265, 264,
683 263, 261, 259, 258, 257, 256, 255, 253, 252, 251,
684 249, 248, 247, 246, 245, 244, 243, 242, 241, 240,
685 235, 234, 233, 232, 231, 230, 229, 228, 227, 226,
686 225, 224, 223, 222, 221, 220, 219, 218, 217, 216,
687 215, 214, 213, 212, 211, 210, 209, 208, 207, 206,
688 205, 204, 199, 195, 194, 191, 189, 186, 180, 179,
689 178, 177, 176, 175, 174, 173, 172, 171, 169, 168,
690 167, 165, 164, 163, 161, 159, 158, 157, 155, 126,
691 121, 116, 110, 107, 103, 97, 96, 95, 92, 90,
693 88, 86, 85, 82, 73, 48, 44, 23, 8, 7,
694 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
695 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
696 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
697 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
698 390, 390, 390, 390, 390, 390, 390, 390, 390, 390,
702 static yy_state_type yy_last_accepting_state
;
703 static char *yy_last_accepting_cpos
;
705 extern int yy_flex_debug
;
706 int yy_flex_debug
= 1;
708 static yyconst
short int yy_rule_linenum
[102] =
710 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
711 225, 226, 227, 228, 229, 230, 231, 232, 233, 234,
712 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
713 245, 246, 247, 248, 250, 251, 252, 253, 254, 256,
714 258, 264, 278, 281, 284, 285, 288, 291, 294, 302,
715 308, 323, 324, 334, 339, 354, 355, 370, 371, 383,
716 393, 412, 428, 447, 458, 471, 472, 473, 474, 475,
717 476, 477, 478, 479, 489, 494, 505, 511, 512, 513,
718 515, 532, 538, 539, 540, 542, 559, 562, 565, 566,
719 569, 580, 592, 594, 596, 599, 602, 621, 628, 629,
724 /* The intent behind this definition is that it'll catch
725 * any uses of REJECT which flex missed.
727 #define REJECT reject_used_but_not_detected
728 #define yymore() yymore_used_but_not_detected
729 #define YY_MORE_ADJ 0
730 #define YY_RESTORE_YY_MORE_OFFSET
732 #line 1 "scan-gram.l"
734 /* Bison Grammar Scanner -*- C -*-
735 Copyright (C) 2002 Free Software Foundation, Inc.
737 This file is part of Bison, the GNU Compiler Compiler.
739 This program is free software; you can redistribute it and/or modify
740 it under the terms of the GNU General Public License as published by
741 the Free Software Foundation; either version 2 of the License, or
742 (at your option) any later version.
744 This program is distributed in the hope that it will be useful,
745 but WITHOUT ANY WARRANTY; without even the implied warranty of
746 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
747 GNU General Public License for more details.
749 You should have received a copy of the GNU General Public License
750 along with this program; if not, write to the Free Software
751 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
754 #define YY_NO_UNPUT 1
755 #define YY_NEVER_INTERACTIVE 1
756 #define YY_STACK_USED 1
757 #line 26 "scan-gram.l"
759 #include "mbswidth.h"
760 #include "complain.h"
766 /* Each time we match a string, move the end cursor to its end. */
767 #define YY_USER_INIT \
769 LOCATION_RESET (*yylloc); \
770 yylloc->file = infile; \
771 /* This is only to avoid GCC warnings. */ \
772 if (yycontrol) {;}; \
775 #define YY_USER_ACTION extend_location (yylloc, yytext, yyleng);
776 #define YY_STEP LOCATION_STEP (*yylloc)
778 #define YY_INPUT(buf, result, size) ((result) = no_cr_read (yyin, buf, size))
781 /* Read bytes from FP into buffer BUF of size SIZE. Return the
782 number of bytes read. Remove '\r' from input, treating \r\n
783 and isolated \r as \n. */
786 no_cr_read (FILE *fp
, char *buf
, size_t size
)
788 size_t s
= fread (buf
, 1, size
, fp
);
791 char *w
= memchr (buf
, '\r', s
);
795 char const *lim
= buf
+ s
;
799 /* Found an '\r'. Treat it like '\n', but ignore any
800 '\n' that immediately follows. */
805 if (ch
!= '\n' && ungetc (ch
, fp
) != ch
)
811 /* Copy until the next '\r'. */
817 while ((*w
++ = *r
++) != '\r');
828 /* Extend *LOC to account for token TOKEN of size SIZE. */
831 extend_location (location_t
*loc
, char const *token
, int size
)
833 int line
= loc
->last_line
;
834 int column
= loc
->last_column
;
835 char const *p0
= token
;
836 char const *p
= token
;
837 char const *lim
= token
+ size
;
839 for (p
= token
; p
< lim
; p
++)
843 /* \r shouldn't survive no_cr_read. */
853 column
+= mbsnwidth (p0
, p
- p0
, 0);
854 column
+= 8 - ((column
- 1) & 7);
859 loc
->last_line
= line
;
860 loc
->last_column
= column
+ mbsnwidth (p0
, p
- p0
, 0);
865 /* STRING_OBSTACK -- Used to store all the characters that we need to
866 keep (to construct ID, STRINGS etc.). Use the following macros to
869 Use YY_OBS_GROW to append what has just been matched, and
870 YY_OBS_FINISH to end the string (it puts the ending 0).
871 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
872 used, and which is used by YY_OBS_FREE to free the last string. */
874 static struct obstack string_obstack
;
877 #define YY_OBS_GROW \
878 obstack_grow (&string_obstack, yytext, yyleng)
880 #define YY_OBS_FINISH \
882 obstack_1grow (&string_obstack, '\0'); \
883 last_string = obstack_finish (&string_obstack); \
886 #define YY_OBS_FREE \
888 obstack_free (&string_obstack, last_string); \
892 scanner_last_string_free (void)
898 static int braces_level
= 0;
899 static int percent_percent_count
= 0;
901 /* Within well-formed rules, RULE_LENGTH is the number of values in
902 the current rule so far, which says where to find `$0' with respect
903 to the top of the stack. It is not the same as the rule->length in
904 the case of mid rule actions.
906 Outside of well-formed rules, RULE_LENGTH has an undefined value. */
907 static int rule_length
;
909 static void handle_dollar (braced_code_t code_kind
,
910 char *cp
, location_t location
);
911 static void handle_at (braced_code_t code_kind
,
912 char *cp
, location_t location
);
913 static int convert_ucn_to_byte (char const *hex_text
);
916 #define SC_LINE_COMMENT 2
917 #define SC_YACC_COMMENT 3
920 #define SC_CHARACTER 5
922 #define SC_ESCAPED_STRING 6
923 #define SC_ESCAPED_CHARACTER 7
925 #define SC_BRACED_CODE 8
926 #define SC_PROLOGUE 9
927 #define SC_EPILOGUE 10
929 /* POSIX says that a tag must be both an id and a C union member, but
930 historically almost any character is allowed in a tag. We disallow
931 NUL and newline, as this simplifies our implementation. */
932 /* Zero or more instances of backslash-newline. Following GCC, allow
933 white space between the backslash and the newline. */
934 #line 935 "scan-gram.c"
936 /* Macros after this point can all be overridden by user definitions in
940 #ifndef YY_SKIP_YYWRAP
942 extern "C" int yywrap
YY_PROTO(( void ));
944 extern int yywrap
YY_PROTO(( void ));
949 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
953 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
956 #ifdef YY_NEED_STRLEN
957 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
962 static int yyinput
YY_PROTO(( void ));
964 static int input
YY_PROTO(( void ));
969 static int yy_start_stack_ptr
= 0;
970 static int yy_start_stack_depth
= 0;
971 static int *yy_start_stack
= 0;
972 #ifndef YY_NO_PUSH_STATE
973 static void yy_push_state
YY_PROTO(( int new_state
));
975 #ifndef YY_NO_POP_STATE
976 static void yy_pop_state
YY_PROTO(( void ));
978 #ifndef YY_NO_TOP_STATE
979 static int yy_top_state
YY_PROTO(( void ));
983 #define YY_NO_PUSH_STATE 1
984 #define YY_NO_POP_STATE 1
985 #define YY_NO_TOP_STATE 1
988 #ifdef YY_MALLOC_DECL
996 /* Just try to get by without declaring the routines. This will fail
997 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
998 * or sizeof(void*) != sizeof(int).
1003 /* Amount of stuff to slurp up with each read. */
1004 #ifndef YY_READ_BUF_SIZE
1005 #define YY_READ_BUF_SIZE 8192
1008 /* Copy whatever the last rule matched to the standard output. */
1011 /* This used to be an fputs(), but since the string might contain NUL's,
1012 * we now use fwrite().
1014 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1017 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1018 * is returned in "result".
1021 #define YY_INPUT(buf,result,max_size) \
1022 if ( yy_current_buffer->yy_is_interactive ) \
1025 for ( n = 0; n < max_size && \
1026 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1027 buf[n] = (char) c; \
1029 buf[n++] = (char) c; \
1030 if ( c == EOF && ferror( yyin ) ) \
1031 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1037 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1039 if( errno != EINTR) \
1041 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1050 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1051 * we don't want an extra ';' after the "return" because that will cause
1052 * some compilers to complain about unreachable statements.
1055 #define yyterminate() return YY_NULL
1058 /* Number of entries by which start-condition stack grows. */
1059 #ifndef YY_START_STACK_INCR
1060 #define YY_START_STACK_INCR 25
1063 /* Report a fatal error. */
1064 #ifndef YY_FATAL_ERROR
1065 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1068 /* Default declaration of generated scanner - a define so the user can
1069 * easily add parameters.
1072 #define YY_DECL int yylex YY_PROTO(( void ))
1075 /* Code executed at the beginning of each rule, after yytext and yyleng
1078 #ifndef YY_USER_ACTION
1079 #define YY_USER_ACTION
1082 /* Code executed at the end of each rule. */
1084 #define YY_BREAK break;
1087 #define YY_RULE_SETUP \
1092 register yy_state_type yy_current_state
;
1093 register char *yy_cp
, *yy_bp
;
1094 register int yy_act
;
1096 #line 202 "scan-gram.l"
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
>= 391 )
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
] != 811 );
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
< 102 )
1186 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1187 yy_rule_linenum
[yy_act
], yytext
);
1188 else if ( yy_act
== 102 )
1189 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1191 else if ( yy_act
== 103 )
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 215 "scan-gram.l"
1211 return PERCENT_NONASSOC
;
1215 #line 216 "scan-gram.l"
1216 return PERCENT_DEBUG
;
1220 #line 217 "scan-gram.l"
1221 return PERCENT_DEFINE
;
1225 #line 218 "scan-gram.l"
1226 return PERCENT_DEFINES
;
1230 #line 219 "scan-gram.l"
1231 return PERCENT_DESTRUCTOR
;
1235 #line 220 "scan-gram.l"
1236 return PERCENT_DPREC
;
1240 #line 221 "scan-gram.l"
1241 return PERCENT_ERROR_VERBOSE
;
1245 #line 222 "scan-gram.l"
1246 return PERCENT_EXPECT
;
1250 #line 223 "scan-gram.l"
1251 return PERCENT_FILE_PREFIX
;
1255 #line 224 "scan-gram.l"
1256 return PERCENT_YACC
;
1260 #line 225 "scan-gram.l"
1261 return PERCENT_GLR_PARSER
;
1265 #line 226 "scan-gram.l"
1266 return PERCENT_LEFT
;
1270 #line 227 "scan-gram.l"
1271 return PERCENT_LOCATIONS
;
1275 #line 228 "scan-gram.l"
1276 return PERCENT_MERGE
;
1280 #line 229 "scan-gram.l"
1281 return PERCENT_NAME_PREFIX
;
1285 #line 230 "scan-gram.l"
1286 return PERCENT_NO_LINES
;
1290 #line 231 "scan-gram.l"
1291 return PERCENT_NONASSOC
;
1295 #line 232 "scan-gram.l"
1296 return PERCENT_NTERM
;
1300 #line 233 "scan-gram.l"
1301 return PERCENT_OUTPUT
;
1305 #line 234 "scan-gram.l"
1306 return PERCENT_PARSE_PARAM
;
1310 #line 235 "scan-gram.l"
1311 rule_length
--; return PERCENT_PREC
;
1315 #line 236 "scan-gram.l"
1316 return PERCENT_PRINTER
;
1320 #line 237 "scan-gram.l"
1321 return PERCENT_PURE_PARSER
;
1325 #line 238 "scan-gram.l"
1326 return PERCENT_RIGHT
;
1330 #line 239 "scan-gram.l"
1331 return PERCENT_LEX_PARAM
;
1335 #line 240 "scan-gram.l"
1336 return PERCENT_SKELETON
;
1340 #line 241 "scan-gram.l"
1341 return PERCENT_START
;
1345 #line 242 "scan-gram.l"
1346 return PERCENT_TOKEN
;
1350 #line 243 "scan-gram.l"
1351 return PERCENT_TOKEN
;
1355 #line 244 "scan-gram.l"
1356 return PERCENT_TOKEN_TABLE
;
1360 #line 245 "scan-gram.l"
1361 return PERCENT_TYPE
;
1365 #line 246 "scan-gram.l"
1366 return PERCENT_UNION
;
1370 #line 247 "scan-gram.l"
1371 return PERCENT_VERBOSE
;
1375 #line 248 "scan-gram.l"
1376 return PERCENT_YACC
;
1380 #line 250 "scan-gram.l"
1385 #line 251 "scan-gram.l"
1386 rule_length
= 0; return COLON
;
1390 #line 252 "scan-gram.l"
1391 rule_length
= 0; return PIPE
;
1395 #line 253 "scan-gram.l"
1400 #line 254 "scan-gram.l"
1405 #line 256 "scan-gram.l"
1410 #line 258 "scan-gram.l"
1412 yylval
->symbol
= symbol_get (yytext
, *yylloc
);
1419 #line 264 "scan-gram.l"
1423 num
= strtoul (yytext
, 0, 10);
1424 if (INT_MAX
< num
|| errno
)
1426 complain_at (*yylloc
, _("invalid value: %s"), quote (yytext
));
1429 yylval
->integer
= num
;
1433 /* Characters. We don't check there is only one. */
1436 #line 278 "scan-gram.l"
1437 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1442 #line 281 "scan-gram.l"
1443 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1448 #line 284 "scan-gram.l"
1449 BEGIN SC_YACC_COMMENT
;
1453 #line 285 "scan-gram.l"
1459 #line 288 "scan-gram.l"
1460 yy_push_state (SC_PROLOGUE
);
1462 /* Code in between braces. */
1465 #line 291 "scan-gram.l"
1466 YY_OBS_GROW
; ++braces_level
; yy_push_state (SC_BRACED_CODE
);
1471 #line 294 "scan-gram.l"
1473 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1475 yylval
->string
= last_string
;
1481 #line 302 "scan-gram.l"
1483 if (++percent_percent_count
== 2)
1484 yy_push_state (SC_EPILOGUE
);
1485 return PERCENT_PERCENT
;
1490 #line 308 "scan-gram.l"
1492 complain_at (*yylloc
, _("invalid character: %s"), quote (yytext
));
1497 /*-------------------------------------------------------------------.
1498 | Whatever the start condition (but those which correspond to |
1499 | entities `swallowed' by Bison: SC_YACC_COMMENT, SC_ESCAPED_STRING, |
1500 | and SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1501 `-------------------------------------------------------------------*/
1506 #line 323 "scan-gram.l"
1507 obstack_sgrow (&string_obstack
, "@<:@");
1511 #line 324 "scan-gram.l"
1512 obstack_sgrow (&string_obstack
, "@:>@");
1515 /*---------------------------------------------------------------.
1516 | Scanning a Yacc comment. The initial `/ *' is already eaten. |
1517 `---------------------------------------------------------------*/
1522 #line 334 "scan-gram.l"
1530 #line 339 "scan-gram.l"
1533 case YY_STATE_EOF(SC_YACC_COMMENT
):
1534 #line 341 "scan-gram.l"
1536 complain_at (*yylloc
, _("unexpected end of file in a comment"));
1541 /*------------------------------------------------------------.
1542 | Scanning a C comment. The initial `/ *' is already eaten. |
1543 `------------------------------------------------------------*/
1548 #line 354 "scan-gram.l"
1549 YY_OBS_GROW
; yy_pop_state ();
1553 #line 355 "scan-gram.l"
1556 case YY_STATE_EOF(SC_COMMENT
):
1557 #line 357 "scan-gram.l"
1559 complain_at (*yylloc
, _("unexpected end of file in a comment"));
1564 /*--------------------------------------------------------------.
1565 | Scanning a line comment. The initial `//' is already eaten. |
1566 `--------------------------------------------------------------*/
1571 #line 370 "scan-gram.l"
1572 YY_OBS_GROW
; yy_pop_state ();
1576 #line 371 "scan-gram.l"
1579 case YY_STATE_EOF(SC_LINE_COMMENT
):
1580 #line 372 "scan-gram.l"
1584 /*----------------------------------------------------------------.
1585 | Scanning a C string, including its escapes. The initial `"' is |
1587 `----------------------------------------------------------------*/
1592 #line 383 "scan-gram.l"
1594 assert (yy_top_state () == INITIAL
);
1597 yylval
->string
= last_string
;
1605 #line 393 "scan-gram.l"
1608 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1609 #line 395 "scan-gram.l"
1611 complain_at (*yylloc
, _("unexpected end of file in a string"));
1612 assert (yy_top_state () == INITIAL
);
1614 yylval
->string
= last_string
;
1620 /*---------------------------------------------------------------.
1621 | Scanning a C character, decoding its escapes. The initial "'" |
1622 | is already eaten. |
1623 `---------------------------------------------------------------*/
1628 #line 412 "scan-gram.l"
1631 assert (yy_top_state () == INITIAL
);
1634 yylval
->symbol
= symbol_get (last_string
, *yylloc
);
1635 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1636 symbol_user_token_number_set (yylval
->symbol
,
1637 (unsigned char) last_string
[1], *yylloc
);
1647 #line 428 "scan-gram.l"
1650 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1651 #line 430 "scan-gram.l"
1653 complain_at (*yylloc
, _("unexpected end of file in a character"));
1654 assert (yy_top_state () == INITIAL
);
1656 yylval
->string
= last_string
;
1662 /*----------------------------.
1663 | Decode escaped characters. |
1664 `----------------------------*/
1669 #line 447 "scan-gram.l"
1671 unsigned long c
= strtoul (yytext
+ 1, 0, 8);
1674 complain_at (*yylloc
, _("invalid escape: %s"), quote (yytext
));
1678 obstack_1grow (&string_obstack
, c
);
1683 #line 458 "scan-gram.l"
1687 c
= strtoul (yytext
+ 2, 0, 16);
1688 if (UCHAR_MAX
< c
|| errno
)
1690 complain_at (*yylloc
, _("invalid escape: %s"), quote (yytext
));
1694 obstack_1grow (&string_obstack
, c
);
1699 #line 471 "scan-gram.l"
1700 obstack_1grow (&string_obstack
, '\a');
1704 #line 472 "scan-gram.l"
1705 obstack_1grow (&string_obstack
, '\b');
1709 #line 473 "scan-gram.l"
1710 obstack_1grow (&string_obstack
, '\f');
1714 #line 474 "scan-gram.l"
1715 obstack_1grow (&string_obstack
, '\n');
1719 #line 475 "scan-gram.l"
1720 obstack_1grow (&string_obstack
, '\r');
1724 #line 476 "scan-gram.l"
1725 obstack_1grow (&string_obstack
, '\t');
1729 #line 477 "scan-gram.l"
1730 obstack_1grow (&string_obstack
, '\v');
1734 #line 478 "scan-gram.l"
1735 obstack_1grow (&string_obstack
, yytext
[1]);
1739 #line 479 "scan-gram.l"
1741 int c
= convert_ucn_to_byte (yytext
);
1744 complain_at (*yylloc
, _("invalid escape: %s"), quote (yytext
));
1748 obstack_1grow (&string_obstack
, c
);
1753 #line 489 "scan-gram.l"
1755 complain_at (*yylloc
, _("unrecognized escape: %s"), quote (yytext
));
1759 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1762 #line 494 "scan-gram.l"
1766 /*----------------------------------------------------------.
1767 | Scanning a C character without decoding its escapes. The |
1768 | initial "'" is already eaten. |
1769 `----------------------------------------------------------*/
1774 #line 505 "scan-gram.l"
1777 assert (yy_top_state () != INITIAL
);
1783 #line 511 "scan-gram.l"
1788 #line 512 "scan-gram.l"
1793 #line 513 "scan-gram.l"
1796 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1799 #line 515 "scan-gram.l"
1802 case YY_STATE_EOF(SC_CHARACTER
):
1803 #line 517 "scan-gram.l"
1805 complain_at (*yylloc
, _("unexpected end of file in a character"));
1806 assert (yy_top_state () != INITIAL
);
1811 /*----------------------------------------------------------------.
1812 | Scanning a C string, without decoding its escapes. The initial |
1813 | `"' is already eaten. |
1814 `----------------------------------------------------------------*/
1819 #line 532 "scan-gram.l"
1821 assert (yy_top_state () != INITIAL
);
1828 #line 538 "scan-gram.l"
1833 #line 539 "scan-gram.l"
1838 #line 540 "scan-gram.l"
1841 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1844 #line 542 "scan-gram.l"
1847 case YY_STATE_EOF(SC_STRING
):
1848 #line 544 "scan-gram.l"
1850 complain_at (*yylloc
, _("unexpected end of file in a string"));
1851 assert (yy_top_state () != INITIAL
);
1856 /*---------------------------------------------------.
1857 | Strings, comments etc. can be found in user code. |
1858 `---------------------------------------------------*/
1861 /* Characters. We don't check there is only one. */
1864 #line 559 "scan-gram.l"
1865 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1870 #line 562 "scan-gram.l"
1871 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1876 #line 565 "scan-gram.l"
1877 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1881 #line 566 "scan-gram.l"
1882 YY_OBS_GROW
; yy_push_state (SC_LINE_COMMENT
);
1887 #line 569 "scan-gram.l"
1891 /*---------------------------------------------------------------.
1892 | Scanning some code in braces (%union and actions). The initial |
1893 | "{" is already eaten. |
1894 `---------------------------------------------------------------*/
1899 #line 580 "scan-gram.l"
1902 if (--braces_level
== 0)
1906 yylval
->string
= last_string
;
1914 #line 592 "scan-gram.l"
1915 YY_OBS_GROW
; braces_level
++;
1919 #line 594 "scan-gram.l"
1920 { handle_dollar (current_braced_code
,
1925 #line 596 "scan-gram.l"
1926 { handle_at (current_braced_code
,
1931 #line 599 "scan-gram.l"
1934 /* A stray $, or /, or etc. */
1937 #line 602 "scan-gram.l"
1940 case YY_STATE_EOF(SC_BRACED_CODE
):
1941 #line 604 "scan-gram.l"
1943 complain_at (*yylloc
, _("unexpected end of file in a braced code"));
1946 yylval
->string
= last_string
;
1951 /*--------------------------------------------------------------.
1952 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1953 `--------------------------------------------------------------*/
1958 #line 621 "scan-gram.l"
1962 yylval
->string
= last_string
;
1968 #line 628 "scan-gram.l"
1973 #line 629 "scan-gram.l"
1976 case YY_STATE_EOF(SC_PROLOGUE
):
1977 #line 631 "scan-gram.l"
1979 complain_at (*yylloc
, _("unexpected end of file in a prologue"));
1982 yylval
->string
= last_string
;
1987 /*---------------------------------------------------------------.
1988 | Scanning the epilogue (everything after the second "%%", which |
1989 | has already been eaten). |
1990 `---------------------------------------------------------------*/
1995 #line 648 "scan-gram.l"
1998 case YY_STATE_EOF(SC_EPILOGUE
):
1999 #line 650 "scan-gram.l"
2003 yylval
->string
= last_string
;
2010 #line 659 "scan-gram.l"
2011 YY_FATAL_ERROR( "flex scanner jammed" );
2013 #line 2014 "scan-gram.c"
2014 case YY_STATE_EOF(INITIAL
):
2017 case YY_END_OF_BUFFER
:
2019 /* Amount of text matched not including the EOB char. */
2020 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
2022 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2023 *yy_cp
= yy_hold_char
;
2024 YY_RESTORE_YY_MORE_OFFSET
2026 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
2028 /* We're scanning a new file or input source. It's
2029 * possible that this happened because the user
2030 * just pointed yyin at a new source and called
2031 * yylex(). If so, then we have to assure
2032 * consistency between yy_current_buffer and our
2033 * globals. Here is the right place to do so, because
2034 * this is the first action (other than possibly a
2035 * back-up) that will match for the new input source.
2037 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2038 yy_current_buffer
->yy_input_file
= yyin
;
2039 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2042 /* Note that here we test for yy_c_buf_p "<=" to the position
2043 * of the first EOB in the buffer, since yy_c_buf_p will
2044 * already have been incremented past the NUL character
2045 * (since all states make transitions on EOB to the
2046 * end-of-buffer state). Contrast this with the test
2049 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2050 { /* This was really a NUL. */
2051 yy_state_type yy_next_state
;
2053 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
2055 yy_current_state
= yy_get_previous_state();
2057 /* Okay, we're now positioned to make the NUL
2058 * transition. We couldn't have
2059 * yy_get_previous_state() go ahead and do it
2060 * for us because it doesn't know how to deal
2061 * with the possibility of jamming (and we don't
2062 * want to build jamming into it because then it
2063 * will run more slowly).
2066 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
2068 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2070 if ( yy_next_state
)
2072 /* Consume the NUL. */
2073 yy_cp
= ++yy_c_buf_p
;
2074 yy_current_state
= yy_next_state
;
2081 goto yy_find_action
;
2085 else switch ( yy_get_next_buffer() )
2087 case EOB_ACT_END_OF_FILE
:
2089 yy_did_buffer_switch_on_eof
= 0;
2093 /* Note: because we've taken care in
2094 * yy_get_next_buffer() to have set up
2095 * yytext, we can now set up
2096 * yy_c_buf_p so that if some total
2097 * hoser (like flex itself) wants to
2098 * call the scanner after we return the
2099 * YY_NULL, it'll still work - another
2100 * YY_NULL will get returned.
2102 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
2104 yy_act
= YY_STATE_EOF(YY_START
);
2110 if ( ! yy_did_buffer_switch_on_eof
)
2116 case EOB_ACT_CONTINUE_SCAN
:
2118 yytext_ptr
+ yy_amount_of_matched_text
;
2120 yy_current_state
= yy_get_previous_state();
2123 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2126 case EOB_ACT_LAST_MATCH
:
2128 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
2130 yy_current_state
= yy_get_previous_state();
2133 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2134 goto yy_find_action
;
2141 "fatal flex scanner internal error--no action found" );
2142 } /* end of action switch */
2143 } /* end of scanning one token */
2144 } /* end of yylex */
2147 /* yy_get_next_buffer - try to read in a new buffer
2149 * Returns a code representing an action:
2150 * EOB_ACT_LAST_MATCH -
2151 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2152 * EOB_ACT_END_OF_FILE - end of file
2155 static int yy_get_next_buffer()
2157 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2158 register char *source
= yytext_ptr
;
2159 register int number_to_move
, i
;
2162 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2164 "fatal flex scanner internal error--end of buffer missed" );
2166 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2167 { /* Don't try to fill the buffer, so this is an EOF. */
2168 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2170 /* We matched a single character, the EOB, so
2171 * treat this as a final EOF.
2173 return EOB_ACT_END_OF_FILE
;
2178 /* We matched some text prior to the EOB, first
2181 return EOB_ACT_LAST_MATCH
;
2185 /* Try to read more data. */
2187 /* First move last chars to start of buffer. */
2188 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2190 for ( i
= 0; i
< number_to_move
; ++i
)
2191 *(dest
++) = *(source
++);
2193 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2194 /* don't do the read, it's not guaranteed to return an EOF,
2197 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2202 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2204 while ( num_to_read
<= 0 )
2205 { /* Not enough room in the buffer - grow it. */
2206 #ifdef YY_USES_REJECT
2208 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2211 /* just a shorter name for the current buffer */
2212 YY_BUFFER_STATE b
= yy_current_buffer
;
2214 int yy_c_buf_p_offset
=
2215 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2217 if ( b
->yy_is_our_buffer
)
2219 int new_size
= b
->yy_buf_size
* 2;
2221 if ( new_size
<= 0 )
2222 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2224 b
->yy_buf_size
*= 2;
2226 b
->yy_ch_buf
= (char *)
2227 /* Include room in for 2 EOB chars. */
2228 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2229 b
->yy_buf_size
+ 2 );
2232 /* Can't grow it, we don't own it. */
2235 if ( ! b
->yy_ch_buf
)
2237 "fatal error - scanner input buffer overflow" );
2239 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2241 num_to_read
= yy_current_buffer
->yy_buf_size
-
2246 if ( num_to_read
> YY_READ_BUF_SIZE
)
2247 num_to_read
= YY_READ_BUF_SIZE
;
2249 /* Read in more data. */
2250 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2251 yy_n_chars
, num_to_read
);
2253 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2256 if ( yy_n_chars
== 0 )
2258 if ( number_to_move
== YY_MORE_ADJ
)
2260 ret_val
= EOB_ACT_END_OF_FILE
;
2266 ret_val
= EOB_ACT_LAST_MATCH
;
2267 yy_current_buffer
->yy_buffer_status
=
2268 YY_BUFFER_EOF_PENDING
;
2273 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2275 yy_n_chars
+= number_to_move
;
2276 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2277 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2279 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2285 /* yy_get_previous_state - get the state just before the EOB char was reached */
2287 static yy_state_type
yy_get_previous_state()
2289 register yy_state_type yy_current_state
;
2290 register char *yy_cp
;
2292 yy_current_state
= yy_start
;
2294 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2296 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 53);
2297 if ( yy_accept
[yy_current_state
] )
2299 yy_last_accepting_state
= yy_current_state
;
2300 yy_last_accepting_cpos
= yy_cp
;
2302 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2304 yy_current_state
= (int) yy_def
[yy_current_state
];
2305 if ( yy_current_state
>= 391 )
2306 yy_c
= yy_meta
[(unsigned int) yy_c
];
2308 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2311 return yy_current_state
;
2315 /* yy_try_NUL_trans - try to make a transition on the NUL character
2318 * next_state = yy_try_NUL_trans( current_state );
2321 #ifdef YY_USE_PROTOS
2322 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2324 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2325 yy_state_type yy_current_state
;
2328 register int yy_is_jam
;
2329 register char *yy_cp
= yy_c_buf_p
;
2331 register YY_CHAR yy_c
= 53;
2332 if ( yy_accept
[yy_current_state
] )
2334 yy_last_accepting_state
= yy_current_state
;
2335 yy_last_accepting_cpos
= yy_cp
;
2337 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2339 yy_current_state
= (int) yy_def
[yy_current_state
];
2340 if ( yy_current_state
>= 391 )
2341 yy_c
= yy_meta
[(unsigned int) yy_c
];
2343 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2344 yy_is_jam
= (yy_current_state
== 390);
2346 return yy_is_jam
? 0 : yy_current_state
;
2351 #ifdef YY_USE_PROTOS
2352 static void yyunput( int c
, register char *yy_bp
)
2354 static void yyunput( c
, yy_bp
)
2356 register char *yy_bp
;
2359 register char *yy_cp
= yy_c_buf_p
;
2361 /* undo effects of setting up yytext */
2362 *yy_cp
= yy_hold_char
;
2364 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2365 { /* need to shift things up to make room */
2366 /* +2 for EOB chars. */
2367 register int number_to_move
= yy_n_chars
+ 2;
2368 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2369 yy_current_buffer
->yy_buf_size
+ 2];
2370 register char *source
=
2371 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2373 while ( source
> yy_current_buffer
->yy_ch_buf
)
2374 *--dest
= *--source
;
2376 yy_cp
+= (int) (dest
- source
);
2377 yy_bp
+= (int) (dest
- source
);
2378 yy_current_buffer
->yy_n_chars
=
2379 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2381 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2382 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2385 *--yy_cp
= (char) c
;
2389 yy_hold_char
= *yy_cp
;
2392 #endif /* ifndef YY_NO_UNPUT */
2396 static int yyinput()
2403 *yy_c_buf_p
= yy_hold_char
;
2405 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2407 /* yy_c_buf_p now points to the character we want to return.
2408 * If this occurs *before* the EOB characters, then it's a
2409 * valid NUL; if not, then we've hit the end of the buffer.
2411 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2412 /* This was really a NUL. */
2416 { /* need more input */
2417 int offset
= yy_c_buf_p
- yytext_ptr
;
2420 switch ( yy_get_next_buffer() )
2422 case EOB_ACT_LAST_MATCH
:
2423 /* This happens because yy_g_n_b()
2424 * sees that we've accumulated a
2425 * token and flags that we need to
2426 * try matching the token before
2427 * proceeding. But for input(),
2428 * there's no matching to consider.
2429 * So convert the EOB_ACT_LAST_MATCH
2430 * to EOB_ACT_END_OF_FILE.
2433 /* Reset buffer status. */
2438 case EOB_ACT_END_OF_FILE
:
2443 if ( ! yy_did_buffer_switch_on_eof
)
2452 case EOB_ACT_CONTINUE_SCAN
:
2453 yy_c_buf_p
= yytext_ptr
+ offset
;
2459 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2460 *yy_c_buf_p
= '\0'; /* preserve yytext */
2461 yy_hold_char
= *++yy_c_buf_p
;
2468 #ifdef YY_USE_PROTOS
2469 void yyrestart( FILE *input_file
)
2471 void yyrestart( input_file
)
2475 if ( ! yy_current_buffer
)
2476 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2478 yy_init_buffer( yy_current_buffer
, input_file
);
2479 yy_load_buffer_state();
2483 #ifdef YY_USE_PROTOS
2484 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2486 void yy_switch_to_buffer( new_buffer
)
2487 YY_BUFFER_STATE new_buffer
;
2490 if ( yy_current_buffer
== new_buffer
)
2493 if ( yy_current_buffer
)
2495 /* Flush out information for old buffer. */
2496 *yy_c_buf_p
= yy_hold_char
;
2497 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2498 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2501 yy_current_buffer
= new_buffer
;
2502 yy_load_buffer_state();
2504 /* We don't actually know whether we did this switch during
2505 * EOF (yywrap()) processing, but the only time this flag
2506 * is looked at is after yywrap() is called, so it's safe
2507 * to go ahead and always set it.
2509 yy_did_buffer_switch_on_eof
= 1;
2513 #ifdef YY_USE_PROTOS
2514 void yy_load_buffer_state( void )
2516 void yy_load_buffer_state()
2519 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2520 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2521 yyin
= yy_current_buffer
->yy_input_file
;
2522 yy_hold_char
= *yy_c_buf_p
;
2526 #ifdef YY_USE_PROTOS
2527 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2529 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2536 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2538 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2540 b
->yy_buf_size
= size
;
2542 /* yy_ch_buf has to be 2 characters longer than the size given because
2543 * we need to put in 2 end-of-buffer characters.
2545 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2546 if ( ! b
->yy_ch_buf
)
2547 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2549 b
->yy_is_our_buffer
= 1;
2551 yy_init_buffer( b
, file
);
2557 #ifdef YY_USE_PROTOS
2558 void yy_delete_buffer( YY_BUFFER_STATE b
)
2560 void yy_delete_buffer( b
)
2567 if ( b
== yy_current_buffer
)
2568 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2570 if ( b
->yy_is_our_buffer
)
2571 yy_flex_free( (void *) b
->yy_ch_buf
);
2573 yy_flex_free( (void *) b
);
2580 #ifndef YY_ALWAYS_INTERACTIVE
2581 #ifndef YY_NEVER_INTERACTIVE
2582 extern int isatty
YY_PROTO(( int ));
2587 #ifdef YY_USE_PROTOS
2588 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2590 void yy_init_buffer( b
, file
)
2597 yy_flush_buffer( b
);
2599 b
->yy_input_file
= file
;
2600 b
->yy_fill_buffer
= 1;
2602 #if YY_ALWAYS_INTERACTIVE
2603 b
->yy_is_interactive
= 1;
2605 #if YY_NEVER_INTERACTIVE
2606 b
->yy_is_interactive
= 0;
2608 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2614 #ifdef YY_USE_PROTOS
2615 void yy_flush_buffer( YY_BUFFER_STATE b
)
2617 void yy_flush_buffer( b
)
2627 /* We always need two end-of-buffer characters. The first causes
2628 * a transition to the end-of-buffer state. The second causes
2629 * a jam in that state.
2631 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2632 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2634 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2637 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2639 if ( b
== yy_current_buffer
)
2640 yy_load_buffer_state();
2644 #ifndef YY_NO_SCAN_BUFFER
2645 #ifdef YY_USE_PROTOS
2646 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2648 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2656 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2657 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2658 /* They forgot to leave room for the EOB's. */
2661 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2663 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2665 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2666 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2667 b
->yy_is_our_buffer
= 0;
2668 b
->yy_input_file
= 0;
2669 b
->yy_n_chars
= b
->yy_buf_size
;
2670 b
->yy_is_interactive
= 0;
2672 b
->yy_fill_buffer
= 0;
2673 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2675 yy_switch_to_buffer( b
);
2682 #ifndef YY_NO_SCAN_STRING
2683 #ifdef YY_USE_PROTOS
2684 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2686 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2687 yyconst
char *yy_str
;
2691 for ( len
= 0; yy_str
[len
]; ++len
)
2694 return yy_scan_bytes( yy_str
, len
);
2699 #ifndef YY_NO_SCAN_BYTES
2700 #ifdef YY_USE_PROTOS
2701 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2703 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2704 yyconst
char *bytes
;
2713 /* Get memory for full buffer, including space for trailing EOB's. */
2715 buf
= (char *) yy_flex_alloc( n
);
2717 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2719 for ( i
= 0; i
< len
; ++i
)
2722 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2724 b
= yy_scan_buffer( buf
, n
);
2726 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2728 /* It's okay to grow etc. this buffer, and we should throw it
2729 * away when we're done.
2731 b
->yy_is_our_buffer
= 1;
2738 #ifndef YY_NO_PUSH_STATE
2739 #ifdef YY_USE_PROTOS
2740 static void yy_push_state( int new_state
)
2742 static void yy_push_state( new_state
)
2746 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2750 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2751 new_size
= yy_start_stack_depth
* sizeof( int );
2753 if ( ! yy_start_stack
)
2754 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2757 yy_start_stack
= (int *) yy_flex_realloc(
2758 (void *) yy_start_stack
, new_size
);
2760 if ( ! yy_start_stack
)
2762 "out of memory expanding start-condition stack" );
2765 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2772 #ifndef YY_NO_POP_STATE
2773 static void yy_pop_state()
2775 if ( --yy_start_stack_ptr
< 0 )
2776 YY_FATAL_ERROR( "start-condition stack underflow" );
2778 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2783 #ifndef YY_NO_TOP_STATE
2784 static int yy_top_state()
2786 return yy_start_stack
[yy_start_stack_ptr
- 1];
2790 #ifndef YY_EXIT_FAILURE
2791 #define YY_EXIT_FAILURE 2
2794 #ifdef YY_USE_PROTOS
2795 static void yy_fatal_error( yyconst
char msg
[] )
2797 static void yy_fatal_error( msg
)
2801 (void) fprintf( stderr
, "%s\n", msg
);
2802 exit( YY_EXIT_FAILURE
);
2807 /* Redefine yyless() so it works in section 3 code. */
2813 /* Undo effects of setting up yytext. */ \
2814 yytext[yyleng] = yy_hold_char; \
2815 yy_c_buf_p = yytext + n; \
2816 yy_hold_char = *yy_c_buf_p; \
2817 *yy_c_buf_p = '\0'; \
2823 /* Internal utility routines. */
2826 #ifdef YY_USE_PROTOS
2827 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2829 static void yy_flex_strncpy( s1
, s2
, n
)
2836 for ( i
= 0; i
< n
; ++i
)
2841 #ifdef YY_NEED_STRLEN
2842 #ifdef YY_USE_PROTOS
2843 static int yy_flex_strlen( yyconst
char *s
)
2845 static int yy_flex_strlen( s
)
2850 for ( n
= 0; s
[n
]; ++n
)
2858 #ifdef YY_USE_PROTOS
2859 static void *yy_flex_alloc( yy_size_t size
)
2861 static void *yy_flex_alloc( size
)
2865 return (void *) malloc( size
);
2868 #ifdef YY_USE_PROTOS
2869 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2871 static void *yy_flex_realloc( ptr
, size
)
2876 /* The cast to (char *) in the following accommodates both
2877 * implementations that use char* generic pointers, and those
2878 * that use void* generic pointers. It works with the latter
2879 * because both ANSI C and C++ allow castless assignment from
2880 * any pointer type to void*, and deal with argument conversions
2881 * as though doing an assignment.
2883 return (void *) realloc( (char *) ptr
, size
);
2886 #ifdef YY_USE_PROTOS
2887 static void yy_flex_free( void *ptr
)
2889 static void yy_flex_free( ptr
)
2903 #line 659 "scan-gram.l"
2906 /*------------------------------------------------------------------.
2907 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2909 | Possible inputs: $[<TYPENAME>]($|integer) |
2911 | Output to the STRING_OBSTACK a reference to this semantic value. |
2912 `------------------------------------------------------------------*/
2915 handle_action_dollar (char *text
, location_t location
)
2917 const char *type_name
= NULL
;
2918 char *cp
= text
+ 1;
2920 /* Get the type name if explicit. */
2933 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2934 if (!type_name
&& typed
)
2935 complain_at (location
, _("$$ of `%s' has no declared type"),
2936 current_rule
->sym
->tag
);
2939 obstack_fgrow1 (&string_obstack
,
2940 "]b4_lhs_value([%s])[", type_name
);
2946 num
= strtol (cp
, 0, 10);
2948 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
2951 if (!type_name
&& n
> 0)
2952 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
2954 if (!type_name
&& typed
)
2955 complain_at (location
, _("$%d of `%s' has no declared type"),
2956 n
, current_rule
->sym
->tag
);
2959 obstack_fgrow3 (&string_obstack
,
2960 "]b4_rhs_value([%d], [%d], [%s])[",
2961 rule_length
, n
, type_name
);
2964 complain_at (location
, _("invalid value: %s"), quote (text
));
2969 /*---------------------------------------------------------------.
2970 | TEXT is expected to be $$ in some code associated to a symbol: |
2971 | destructor or printer. |
2972 `---------------------------------------------------------------*/
2975 handle_symbol_code_dollar (char *text
, location_t location
)
2977 char *cp
= text
+ 1;
2979 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
2981 complain_at (location
, _("invalid value: %s"), quote (text
));
2985 /*-----------------------------------------------------------------.
2986 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2987 | depending upon CODE_KIND. |
2988 `-----------------------------------------------------------------*/
2991 handle_dollar (braced_code_t braced_code_kind
,
2992 char *text
, location_t location
)
2994 switch (braced_code_kind
)
2996 case action_braced_code
:
2997 handle_action_dollar (text
, location
);
3000 case destructor_braced_code
:
3001 case printer_braced_code
:
3002 handle_symbol_code_dollar (text
, location
);
3008 /*------------------------------------------------------.
3009 | TEXT is a location token (i.e., a `@...'). Output to |
3010 | STRING_OBSTACK a reference to this location. |
3011 `------------------------------------------------------*/
3014 handle_action_at (char *text
, location_t location
)
3016 char *cp
= text
+ 1;
3021 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
3027 num
= strtol (cp
, 0, 10);
3029 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
3032 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
3036 complain_at (location
, _("invalid value: %s"), quote (text
));
3041 /*---------------------------------------------------------------.
3042 | TEXT is expected to be @$ in some code associated to a symbol: |
3043 | destructor or printer. |
3044 `---------------------------------------------------------------*/
3047 handle_symbol_code_at (char *text
, location_t location
)
3049 char *cp
= text
+ 1;
3051 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
3053 complain_at (location
, _("invalid value: %s"), quote (text
));
3057 /*-------------------------------------------------------------------.
3058 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
3060 `-------------------------------------------------------------------*/
3063 handle_at (braced_code_t braced_code_kind
,
3064 char *text
, location_t location
)
3066 switch (braced_code_kind
)
3068 case action_braced_code
:
3069 handle_action_at (text
, location
);
3072 case destructor_braced_code
:
3073 case printer_braced_code
:
3074 handle_symbol_code_at (text
, location
);
3080 /*------------------------------------------------------------------.
3081 | Convert universal character name UCN to a single-byte character, |
3082 | and return that character. Return -1 if UCN does not correspond |
3083 | to a single-byte character. |
3084 `------------------------------------------------------------------*/
3087 convert_ucn_to_byte (char const *ucn
)
3089 unsigned long code
= strtoul (ucn
+ 2, 0, 16);
3091 /* FIXME: Currently we assume Unicode-compatible unibyte characters
3092 on ASCII hosts (i.e., Latin-1 on hosts with 8-bit bytes). On
3093 non-ASCII hosts we support only the portable C character set.
3094 These limitations should be removed once we add support for
3095 multibyte characters. */
3097 if (UCHAR_MAX
< code
)
3100 #if ! ('$' == 0x24 && '@' == 0x40 && '`' == 0x60 && '~' == 0x7e)
3102 /* A non-ASCII host. Use CODE to index into a table of the C
3103 basic execution character set, which is guaranteed to exist on
3104 all Standard C platforms. This table also includes '$', '@',
3105 and '`', which not in the basic execution character set but
3106 which are unibyte characters on all the platforms that we know
3108 static signed char const table
[] =
3110 '\0', -1, -1, -1, -1, -1, -1, '\a',
3111 '\b', '\t', '\n', '\v', '\f', '\r', -1, -1,
3112 -1, -1, -1, -1, -1, -1, -1, -1,
3113 -1, -1, -1, -1, -1, -1, -1, -1,
3114 ' ', '!', '"', '#', '$', '%', '&', '\'',
3115 '(', ')', '*', '+', ',', '-', '.', '/',
3116 '0', '1', '2', '3', '4', '5', '6', '7',
3117 '8', '9', ':', ';', '<', '=', '>', '?',
3118 '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
3119 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
3120 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
3121 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
3122 '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
3123 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
3124 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
3125 'x', 'y', 'z', '{', '|', '}', '~'
3128 code
= code
< sizeof table
? table
[code
] : -1;
3136 /*-------------------------.
3137 | Initialize the scanner. |
3138 `-------------------------*/
3141 scanner_initialize (void)
3143 obstack_init (&string_obstack
);
3147 /*-----------------------------------------------.
3148 | Free all the memory allocated to the scanner. |
3149 `-----------------------------------------------*/
3154 obstack_free (&string_obstack
, 0);
3155 /* Reclaim Flex's buffers. */
3156 yy_delete_buffer (YY_CURRENT_BUFFER
);