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 104
313 #define YY_END_OF_BUFFER 105
314 static yyconst
short int yy_accept
[411] =
316 0, 0, 0, 0, 61, 61, 0, 0, 87, 87,
317 82, 82, 0, 0, 0, 0, 0, 0, 0, 0,
318 0, 0, 105, 53, 42, 42, 46, 53, 45, 40,
319 43, 53, 44, 38, 41, 53, 37, 50, 39, 53,
320 59, 59, 54, 55, 61, 60, 61, 57, 57, 85,
321 84, 88, 80, 79, 83, 63, 62, 78, 65, 64,
322 99, 90, 99, 99, 89, 93, 99, 99, 94, 96,
323 101, 102, 93, 103, 90, 89, 93, 42, 52, 35,
324 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
325 35, 35, 35, 35, 35, 35, 49, 43, 47, 48,
327 44, 0, 0, 59, 58, 0, 61, 61, 61, 61,
328 57, 56, 85, 86, 86, 86, 86, 80, 81, 81,
329 81, 81, 63, 77, 75, 66, 77, 68, 69, 70,
330 71, 72, 73, 77, 74, 77, 65, 99, 97, 0,
331 97, 0, 95, 0, 91, 92, 0, 94, 99, 0,
332 98, 0, 98, 101, 100, 103, 91, 92, 103, 35,
333 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
334 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
335 35, 35, 35, 35, 35, 35, 48, 51, 0, 0,
336 0, 0, 87, 0, 0, 0, 0, 82, 0, 0,
338 0, 66, 0, 0, 67, 0, 0, 0, 0, 0,
339 0, 0, 103, 103, 35, 35, 35, 35, 35, 35,
340 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
341 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
342 35, 35, 35, 35, 35, 35, 0, 66, 0, 0,
343 0, 35, 35, 35, 35, 35, 35, 35, 35, 35,
344 35, 12, 35, 35, 35, 35, 35, 35, 35, 35,
345 35, 21, 35, 35, 35, 35, 35, 28, 35, 31,
346 35, 35, 34, 0, 0, 0, 35, 2, 35, 35,
347 6, 35, 35, 35, 35, 35, 35, 35, 14, 35,
349 35, 35, 18, 35, 35, 35, 35, 24, 35, 27,
350 29, 32, 35, 0, 0, 76, 1, 3, 35, 35,
351 8, 35, 35, 35, 35, 35, 35, 35, 35, 19,
352 35, 35, 35, 35, 35, 35, 0, 4, 35, 35,
353 35, 35, 35, 35, 35, 35, 35, 35, 35, 22,
354 35, 35, 35, 33, 0, 35, 35, 35, 35, 35,
355 35, 35, 35, 16, 17, 35, 35, 26, 35, 0,
356 35, 35, 35, 35, 35, 25, 13, 35, 35, 35,
357 35, 0, 0, 5, 35, 35, 35, 11, 35, 35,
358 35, 35, 36, 35, 9, 35, 15, 20, 23, 30,
360 35, 35, 7, 35, 35, 35, 35, 35, 10, 0
363 static yyconst
int yy_ec
[256] =
365 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
366 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
367 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
368 1, 4, 1, 5, 6, 7, 8, 1, 9, 1,
369 1, 10, 1, 11, 12, 13, 14, 15, 15, 15,
370 15, 15, 15, 15, 15, 16, 16, 17, 18, 19,
371 20, 21, 22, 23, 24, 24, 24, 24, 24, 24,
372 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
373 13, 13, 13, 13, 25, 13, 13, 13, 13, 13,
374 26, 27, 28, 1, 29, 1, 30, 31, 32, 33,
376 34, 35, 36, 37, 38, 13, 39, 40, 41, 42,
377 43, 44, 13, 45, 46, 47, 48, 49, 13, 50,
378 51, 13, 52, 53, 54, 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,
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,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 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,
395 static yyconst
int yy_meta
[56] =
397 1, 1, 2, 1, 3, 1, 4, 5, 6, 7,
398 1, 8, 9, 5, 10, 10, 1, 1, 4, 1,
399 11, 1, 4, 10, 9, 12, 13, 12, 9, 10,
400 10, 10, 10, 10, 10, 9, 9, 9, 9, 9,
401 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
405 static yyconst
short int yy_base
[449] =
407 0, 896, 46, 47, 55, 58, 891, 890, 61, 64,
408 50, 70, 66, 75, 85, 86, 109, 159, 96, 122,
409 129, 144, 899, 903, 60, 104, 903, 206, 903, 903,
410 0, 89, 52, 903, 903, 0, 903, 903, 903, 858,
411 0, 106, 903, 903, 870, 903, 138, 0, 882, 0,
412 903, 142, 0, 903, 172, 0, 903, 254, 0, 903,
413 0, 903, 174, 88, 903, 169, 92, 144, 903, 903,
414 0, 841, 170, 0, 0, 0, 178, 198, 903, 0,
415 856, 26, 76, 855, 852, 128, 857, 161, 842, 164,
416 851, 100, 164, 846, 853, 856, 903, 0, 903, 0,
418 201, 864, 846, 0, 903, 218, 856, 263, 268, 855,
419 0, 903, 0, 903, 221, 854, 224, 0, 903, 230,
420 853, 258, 0, 903, 903, 864, 0, 903, 903, 903,
421 903, 903, 903, 0, 903, 0, 0, 0, 903, 258,
422 262, 0, 903, 284, 903, 903, 289, 903, 903, 303,
423 903, 267, 282, 0, 903, 0, 0, 0, 306, 0,
424 836, 280, 832, 831, 831, 272, 829, 160, 841, 827,
425 830, 288, 836, 822, 823, 91, 822, 830, 831, 834,
426 818, 823, 817, 822, 814, 826, 0, 903, 815, 316,
427 300, 321, 829, 329, 332, 828, 335, 827, 338, 341,
429 826, 837, 0, 0, 0, 830, 344, 328, 348, 343,
430 356, 346, 359, 354, 820, 801, 810, 800, 812, 802,
431 810, 809, 808, 829, 793, 827, 808, 801, 802, 795,
432 804, 788, 788, 785, 798, 787, 794, 790, 786, 780,
433 783, 789, 788, 778, 789, 787, 784, 903, 0, 0,
434 359, 772, 780, 773, 769, 781, 767, 779, 798, 776,
435 764, 0, 763, 759, 771, 355, 766, 757, 761, 753,
436 766, 0, 752, 357, 751, 763, 749, 0, 753, 0,
437 752, 750, 0, 788, 0, 0, 740, 0, 756, 741,
438 0, 360, 741, 743, 364, 756, 755, 746, 0, 739,
440 740, 735, 0, 733, 767, 744, 733, 0, 729, 0,
441 365, 0, 729, 313, 0, 903, 0, 728, 741, 723,
442 0, 726, 727, 724, 723, 724, 721, 731, 721, 0,
443 719, 717, 731, 717, 712, 724, 375, 0, 710, 722,
444 721, 706, 707, 722, 709, 716, 703, 716, 717, 0,
445 701, 688, 691, 0, 703, 659, 644, 648, 635, 646,
446 635, 624, 634, 0, 0, 623, 621, 0, 627, 625,
447 581, 578, 564, 538, 528, 0, 0, 527, 525, 518,
448 507, 533, 526, 0, 349, 338, 339, 0, 335, 342,
449 337, 346, 903, 310, 0, 274, 0, 0, 0, 0,
451 282, 366, 0, 278, 256, 240, 241, 222, 0, 903,
452 395, 408, 421, 434, 447, 460, 473, 486, 499, 512,
453 517, 527, 540, 553, 566, 579, 590, 603, 614, 627,
454 639, 652, 664, 677, 690, 696, 706, 254, 219, 208,
455 719, 196, 193, 167, 144, 142, 55, 732
458 static yyconst
short int yy_def
[449] =
460 410, 1, 411, 411, 412, 412, 413, 413, 414, 414,
461 415, 415, 416, 416, 417, 417, 418, 418, 419, 419,
462 420, 420, 410, 410, 410, 410, 410, 410, 410, 410,
463 421, 410, 410, 410, 410, 422, 410, 410, 410, 410,
464 423, 410, 410, 410, 424, 410, 424, 425, 410, 426,
465 410, 427, 428, 410, 429, 430, 410, 431, 432, 410,
466 433, 410, 410, 410, 410, 410, 410, 410, 410, 410,
467 434, 410, 410, 435, 435, 435, 435, 410, 410, 436,
468 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
469 436, 436, 436, 436, 436, 436, 410, 421, 410, 437,
471 410, 422, 410, 423, 410, 410, 424, 424, 424, 424,
472 425, 410, 426, 410, 410, 410, 410, 428, 410, 410,
473 410, 410, 430, 410, 410, 410, 438, 410, 410, 410,
474 410, 410, 410, 439, 410, 440, 432, 433, 410, 410,
475 410, 441, 410, 410, 410, 410, 410, 410, 410, 410,
476 410, 410, 410, 434, 410, 435, 435, 435, 435, 436,
477 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
478 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
479 436, 436, 436, 436, 436, 436, 437, 410, 410, 410,
480 410, 410, 410, 410, 410, 427, 410, 410, 410, 410,
482 429, 410, 442, 443, 440, 441, 410, 410, 410, 410,
483 410, 410, 435, 435, 436, 436, 436, 436, 436, 436,
484 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
485 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
486 436, 436, 436, 436, 436, 436, 410, 410, 444, 445,
487 410, 436, 436, 436, 436, 436, 436, 436, 436, 436,
488 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
489 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
490 436, 436, 436, 410, 446, 447, 436, 436, 436, 436,
491 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
493 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
494 436, 436, 436, 410, 439, 410, 436, 436, 436, 436,
495 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
496 436, 436, 436, 436, 436, 436, 410, 436, 436, 436,
497 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
498 436, 436, 436, 436, 410, 436, 436, 436, 436, 436,
499 436, 436, 436, 436, 436, 436, 436, 436, 436, 448,
500 436, 436, 436, 436, 436, 436, 436, 436, 436, 436,
501 436, 448, 410, 436, 436, 436, 436, 436, 436, 436,
502 436, 436, 410, 436, 436, 436, 436, 436, 436, 436,
504 436, 436, 436, 436, 436, 436, 436, 436, 436, 0,
505 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
506 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
507 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
508 410, 410, 410, 410, 410, 410, 410, 410
511 static yyconst
short int yy_nxt
[959] =
513 24, 25, 26, 25, 27, 24, 24, 28, 29, 24,
514 30, 24, 31, 32, 33, 33, 34, 35, 36, 37,
515 24, 24, 24, 31, 31, 24, 24, 24, 31, 31,
516 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
517 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
518 31, 38, 39, 24, 24, 42, 42, 46, 54, 162,
519 46, 78, 78, 78, 316, 51, 101, 101, 51, 163,
520 57, 43, 43, 44, 44, 43, 55, 44, 54, 57,
521 43, 47, 44, 43, 47, 44, 43, 52, 44, 43,
522 52, 44, 58, 60, 60, 43, 55, 44, 99, 148,
524 62, 58, 100, 72, 65, 78, 78, 78, 143, 73,
525 149, 58, 58, 62, 144, 63, 64, 65, 150, 105,
526 164, 43, 66, 44, 235, 165, 62, 67, 236, 72,
527 65, 68, 106, 75, 43, 73, 44, 76, 179, 109,
528 110, 109, 77, 115, 116, 115, 180, 43, 75, 44,
529 151, 315, 76, 286, 43, 152, 44, 77, 153, 153,
530 69, 168, 70, 62, 108, 63, 64, 65, 117, 43,
531 169, 44, 66, 120, 121, 120, 285, 67, 145, 145,
532 139, 68, 146, 146, 43, 140, 44, 157, 141, 141,
533 171, 158, 142, 175, 225, 147, 147, 181, 122, 78,
535 78, 78, 250, 172, 159, 249, 182, 173, 176, 226,
536 69, 177, 70, 79, 183, 101, 101, 205, 80, 190,
537 191, 190, 192, 193, 192, 195, 196, 195, 204, 80,
538 80, 197, 198, 197, 80, 80, 81, 80, 82, 83,
539 84, 85, 80, 80, 80, 86, 87, 88, 89, 90,
540 91, 92, 93, 94, 95, 80, 96, 97, 125, 200,
541 201, 200, 125, 203, 109, 110, 109, 409, 126, 109,
542 110, 109, 141, 141, 408, 125, 141, 141, 127, 407,
543 125, 153, 153, 128, 129, 207, 208, 207, 130, 108,
544 209, 210, 209, 406, 108, 131, 153, 153, 132, 230,
546 133, 134, 135, 136, 211, 212, 211, 213, 214, 213,
547 216, 222, 405, 105, 217, 403, 230, 190, 191, 190,
548 402, 223, 192, 193, 192, 218, 106, 337, 337, 231,
549 192, 193, 192, 195, 196, 195, 197, 198, 197, 197,
550 198, 197, 200, 201, 200, 207, 208, 207, 143, 209,
551 210, 209, 145, 148, 144, 401, 146, 211, 212, 211,
552 213, 214, 213, 157, 149, 139, 300, 158, 307, 147,
553 140, 320, 150, 141, 141, 323, 335, 404, 355, 400,
554 159, 399, 398, 300, 397, 307, 396, 395, 320, 337,
555 337, 394, 323, 335, 404, 41, 41, 41, 41, 41,
557 41, 41, 41, 41, 41, 41, 41, 41, 45, 45,
558 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
559 45, 48, 48, 48, 48, 48, 48, 48, 48, 48,
560 48, 48, 48, 48, 50, 50, 50, 50, 50, 50,
561 50, 50, 50, 50, 50, 50, 50, 53, 53, 53,
562 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
563 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
564 56, 56, 56, 59, 59, 59, 59, 59, 59, 59,
565 59, 59, 59, 59, 59, 59, 61, 61, 61, 61,
566 61, 61, 61, 61, 61, 61, 61, 61, 61, 71,
568 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
569 71, 71, 74, 74, 74, 74, 74, 74, 74, 74,
570 74, 74, 74, 74, 74, 98, 98, 102, 393, 102,
571 102, 102, 102, 102, 102, 102, 102, 383, 102, 102,
572 104, 104, 104, 104, 104, 104, 392, 104, 104, 104,
573 104, 391, 104, 107, 390, 107, 107, 107, 107, 107,
574 107, 107, 107, 107, 389, 107, 111, 111, 111, 111,
575 111, 111, 388, 111, 111, 111, 111, 111, 111, 113,
576 113, 387, 113, 113, 113, 113, 113, 113, 113, 113,
577 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
579 114, 386, 114, 118, 118, 118, 118, 118, 385, 118,
580 118, 118, 118, 118, 119, 119, 119, 119, 119, 119,
581 119, 119, 119, 119, 119, 384, 119, 123, 123, 383,
582 123, 123, 123, 123, 123, 123, 123, 123, 123, 124,
583 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
584 124, 124, 137, 137, 137, 137, 137, 381, 137, 137,
585 137, 137, 137, 137, 138, 138, 380, 379, 378, 377,
586 138, 138, 138, 138, 138, 376, 138, 154, 154, 375,
587 154, 374, 373, 154, 154, 154, 154, 154, 372, 154,
588 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
590 156, 371, 156, 160, 160, 160, 187, 370, 187, 187,
591 187, 187, 187, 187, 187, 187, 187, 187, 187, 206,
592 369, 206, 206, 206, 206, 206, 206, 206, 206, 368,
593 206, 206, 382, 382, 382, 382, 382, 382, 382, 382,
594 382, 382, 382, 382, 382, 367, 366, 365, 364, 363,
595 362, 361, 360, 359, 358, 357, 356, 354, 353, 352,
596 351, 350, 349, 348, 347, 346, 345, 344, 343, 342,
597 341, 340, 339, 338, 336, 334, 333, 332, 331, 330,
598 329, 328, 327, 326, 325, 324, 322, 321, 319, 318,
599 317, 314, 313, 312, 311, 310, 309, 308, 306, 305,
601 304, 303, 302, 301, 299, 298, 297, 296, 295, 294,
602 293, 292, 291, 290, 289, 288, 287, 284, 283, 282,
603 281, 280, 279, 278, 277, 276, 275, 274, 273, 272,
604 271, 270, 269, 268, 267, 266, 265, 264, 263, 262,
605 261, 260, 259, 258, 257, 256, 255, 254, 253, 252,
606 251, 248, 122, 199, 117, 194, 247, 246, 245, 244,
607 243, 242, 241, 240, 239, 238, 237, 234, 233, 232,
608 229, 228, 227, 224, 221, 220, 219, 215, 202, 199,
609 194, 108, 108, 189, 188, 186, 185, 184, 178, 174,
610 170, 167, 166, 161, 155, 112, 108, 103, 410, 49,
612 49, 40, 23, 410, 410, 410, 410, 410, 410, 410,
613 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
614 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
615 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
616 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
617 410, 410, 410, 410, 410, 410, 410, 410
620 static yyconst
short int yy_chk
[959] =
622 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
623 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
624 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
625 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
626 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
627 1, 1, 1, 1, 1, 3, 4, 5, 11, 82,
628 6, 25, 25, 25, 447, 9, 33, 33, 10, 82,
629 13, 3, 4, 3, 4, 11, 11, 11, 12, 14,
630 5, 5, 5, 6, 6, 6, 9, 9, 9, 10,
631 10, 10, 13, 15, 16, 12, 12, 12, 32, 67,
633 19, 14, 32, 19, 19, 26, 26, 26, 64, 19,
634 67, 15, 16, 17, 64, 17, 17, 17, 67, 42,
635 83, 19, 17, 19, 176, 83, 20, 17, 176, 20,
636 20, 17, 42, 21, 17, 20, 17, 21, 92, 47,
637 47, 47, 21, 52, 52, 52, 92, 20, 22, 20,
638 68, 446, 22, 445, 21, 68, 21, 22, 68, 68,
639 17, 86, 17, 18, 47, 18, 18, 18, 52, 22,
640 86, 22, 18, 55, 55, 55, 444, 18, 66, 73,
641 63, 18, 66, 73, 18, 63, 18, 77, 63, 63,
642 88, 77, 63, 90, 168, 66, 73, 93, 55, 78,
644 78, 78, 443, 88, 77, 442, 93, 88, 90, 168,
645 18, 90, 18, 28, 93, 101, 101, 440, 28, 106,
646 106, 106, 115, 115, 115, 117, 117, 117, 439, 28,
647 28, 120, 120, 120, 28, 28, 28, 28, 28, 28,
648 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
649 28, 28, 28, 28, 28, 28, 28, 28, 58, 122,
650 122, 122, 58, 438, 108, 108, 108, 408, 58, 109,
651 109, 109, 140, 140, 407, 58, 141, 141, 58, 406,
652 58, 152, 152, 58, 58, 144, 144, 144, 58, 108,
653 147, 147, 147, 405, 109, 58, 153, 153, 58, 172,
655 58, 58, 58, 58, 150, 150, 150, 159, 159, 159,
656 162, 166, 404, 191, 162, 401, 172, 190, 190, 190,
657 396, 166, 192, 192, 192, 162, 191, 314, 314, 172,
658 194, 194, 194, 195, 195, 195, 197, 197, 197, 199,
659 199, 199, 200, 200, 200, 207, 207, 207, 208, 209,
660 209, 209, 210, 212, 208, 394, 210, 211, 211, 211,
661 213, 213, 213, 214, 212, 251, 266, 214, 274, 210,
662 251, 292, 212, 251, 251, 295, 311, 402, 337, 392,
663 214, 391, 390, 266, 389, 274, 387, 386, 292, 337,
664 337, 385, 295, 311, 402, 411, 411, 411, 411, 411,
666 411, 411, 411, 411, 411, 411, 411, 411, 412, 412,
667 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
668 412, 413, 413, 413, 413, 413, 413, 413, 413, 413,
669 413, 413, 413, 413, 414, 414, 414, 414, 414, 414,
670 414, 414, 414, 414, 414, 414, 414, 415, 415, 415,
671 415, 415, 415, 415, 415, 415, 415, 415, 415, 415,
672 416, 416, 416, 416, 416, 416, 416, 416, 416, 416,
673 416, 416, 416, 417, 417, 417, 417, 417, 417, 417,
674 417, 417, 417, 417, 417, 417, 418, 418, 418, 418,
675 418, 418, 418, 418, 418, 418, 418, 418, 418, 419,
677 419, 419, 419, 419, 419, 419, 419, 419, 419, 419,
678 419, 419, 420, 420, 420, 420, 420, 420, 420, 420,
679 420, 420, 420, 420, 420, 421, 421, 422, 383, 422,
680 422, 422, 422, 422, 422, 422, 422, 382, 422, 422,
681 423, 423, 423, 423, 423, 423, 381, 423, 423, 423,
682 423, 380, 423, 424, 379, 424, 424, 424, 424, 424,
683 424, 424, 424, 424, 378, 424, 425, 425, 425, 425,
684 425, 425, 375, 425, 425, 425, 425, 425, 425, 426,
685 426, 374, 426, 426, 426, 426, 426, 426, 426, 426,
686 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
688 427, 373, 427, 428, 428, 428, 428, 428, 372, 428,
689 428, 428, 428, 428, 429, 429, 429, 429, 429, 429,
690 429, 429, 429, 429, 429, 371, 429, 430, 430, 370,
691 430, 430, 430, 430, 430, 430, 430, 430, 430, 431,
692 431, 431, 431, 431, 431, 431, 431, 431, 431, 431,
693 431, 431, 432, 432, 432, 432, 432, 369, 432, 432,
694 432, 432, 432, 432, 433, 433, 367, 366, 363, 362,
695 433, 433, 433, 433, 433, 361, 433, 434, 434, 360,
696 434, 359, 358, 434, 434, 434, 434, 434, 357, 434,
697 435, 435, 435, 435, 435, 435, 435, 435, 435, 435,
699 435, 356, 435, 436, 436, 436, 437, 355, 437, 437,
700 437, 437, 437, 437, 437, 437, 437, 437, 437, 441,
701 353, 441, 441, 441, 441, 441, 441, 441, 441, 352,
702 441, 441, 448, 448, 448, 448, 448, 448, 448, 448,
703 448, 448, 448, 448, 448, 351, 349, 348, 347, 346,
704 345, 344, 343, 342, 341, 340, 339, 336, 335, 334,
705 333, 332, 331, 329, 328, 327, 326, 325, 324, 323,
706 322, 320, 319, 318, 313, 309, 307, 306, 305, 304,
707 302, 301, 300, 298, 297, 296, 294, 293, 290, 289,
708 287, 284, 282, 281, 279, 277, 276, 275, 273, 271,
710 270, 269, 268, 267, 265, 264, 263, 261, 260, 259,
711 258, 257, 256, 255, 254, 253, 252, 247, 246, 245,
712 244, 243, 242, 241, 240, 239, 238, 237, 236, 235,
713 234, 233, 232, 231, 230, 229, 228, 227, 226, 225,
714 224, 223, 222, 221, 220, 219, 218, 217, 216, 215,
715 206, 202, 201, 198, 196, 193, 189, 186, 185, 184,
716 183, 182, 181, 180, 179, 178, 177, 175, 174, 173,
717 171, 170, 169, 167, 165, 164, 163, 161, 126, 121,
718 116, 110, 107, 103, 102, 96, 95, 94, 91, 89,
719 87, 85, 84, 81, 72, 49, 45, 40, 23, 8,
721 7, 2, 410, 410, 410, 410, 410, 410, 410, 410,
722 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
723 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
724 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
725 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
726 410, 410, 410, 410, 410, 410, 410, 410
729 static yy_state_type yy_last_accepting_state
;
730 static char *yy_last_accepting_cpos
;
732 extern int yy_flex_debug
;
733 int yy_flex_debug
= 1;
735 static yyconst
short int yy_rule_linenum
[104] =
737 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
738 241, 242, 243, 244, 245, 246, 247, 248, 249, 250,
739 251, 252, 253, 254, 255, 256, 257, 258, 259, 260,
740 261, 262, 263, 264, 266, 271, 273, 274, 275, 276,
741 277, 279, 281, 287, 301, 304, 307, 308, 311, 314,
742 317, 325, 331, 346, 347, 357, 362, 377, 378, 393,
743 394, 406, 416, 435, 451, 470, 482, 496, 497, 498,
744 499, 500, 501, 502, 503, 504, 515, 521, 532, 538,
745 539, 540, 542, 559, 565, 566, 567, 569, 586, 589,
746 592, 593, 596, 607, 608, 609, 622, 624, 629, 648,
751 /* The intent behind this definition is that it'll catch
752 * any uses of REJECT which flex missed.
754 #define REJECT reject_used_but_not_detected
755 #define yymore() yymore_used_but_not_detected
756 #define YY_MORE_ADJ 0
757 #define YY_RESTORE_YY_MORE_OFFSET
759 #line 1 "scan-gram.l"
761 /* Bison Grammar Scanner -*- C -*-
762 Copyright (C) 2002 Free Software Foundation, Inc.
764 This file is part of Bison, the GNU Compiler Compiler.
766 This program is free software; you can redistribute it and/or modify
767 it under the terms of the GNU General Public License as published by
768 the Free Software Foundation; either version 2 of the License, or
769 (at your option) any later version.
771 This program is distributed in the hope that it will be useful,
772 but WITHOUT ANY WARRANTY; without even the implied warranty of
773 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
774 GNU General Public License for more details.
776 You should have received a copy of the GNU General Public License
777 along with this program; if not, write to the Free Software
778 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
781 #define YY_NO_UNPUT 1
782 #define YY_NEVER_INTERACTIVE 1
783 #define YY_STACK_USED 1
784 #line 26 "scan-gram.l"
786 #include "mbswidth.h"
787 #include "complain.h"
793 /* Each time we match a string, move the end cursor to its end. */
794 #define YY_USER_INIT \
796 LOCATION_RESET (*yylloc); \
797 yylloc->file = infile; \
798 /* This is only to avoid GCC warnings. */ \
799 if (yycontrol) {;}; \
802 #define YY_USER_ACTION extend_location (yylloc, yytext, yyleng);
803 #define YY_STEP LOCATION_STEP (*yylloc)
805 #define YY_INPUT(buf, result, size) ((result) = no_cr_read (yyin, buf, size))
808 /* Read bytes from FP into buffer BUF of size SIZE. Return the
809 number of bytes read. Remove '\r' from input, treating \r\n
810 and isolated \r as \n. */
813 no_cr_read (FILE *fp
, char *buf
, size_t size
)
815 size_t s
= fread (buf
, 1, size
, fp
);
818 char *w
= memchr (buf
, '\r', s
);
822 char const *lim
= buf
+ s
;
826 /* Found an '\r'. Treat it like '\n', but ignore any
827 '\n' that immediately follows. */
832 if (ch
!= '\n' && ungetc (ch
, fp
) != ch
)
838 /* Copy until the next '\r'. */
844 while ((*w
++ = *r
++) != '\r');
855 /* Extend *LOC to account for token TOKEN of size SIZE. */
858 extend_location (location_t
*loc
, char const *token
, int size
)
860 int line
= loc
->last_line
;
861 int column
= loc
->last_column
;
862 char const *p0
= token
;
863 char const *p
= token
;
864 char const *lim
= token
+ size
;
866 for (p
= token
; p
< lim
; p
++)
870 /* \r shouldn't survive no_cr_read. */
880 column
+= mbsnwidth (p0
, p
- p0
, 0);
881 column
+= 8 - ((column
- 1) & 7);
886 loc
->last_line
= line
;
887 loc
->last_column
= column
+ mbsnwidth (p0
, p
- p0
, 0);
891 /* Report an unexpected end of file at LOC. A token or comment began
892 with TOKEN_START, but an end of file was encountered and the
893 expected TOKEN_END was missing. */
896 unexpected_end_of_file (location_t loc
,
897 char const *token_start
, char const *token_end
)
899 complain_at (loc
, _("unexpected end of file in `%s ... %s'"),
900 token_start
, token_end
);
905 /* STRING_OBSTACK -- Used to store all the characters that we need to
906 keep (to construct ID, STRINGS etc.). Use the following macros to
909 Use YY_OBS_GROW to append what has just been matched, and
910 YY_OBS_FINISH to end the string (it puts the ending 0).
911 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
912 used, and which is used by YY_OBS_FREE to free the last string. */
914 static struct obstack string_obstack
;
917 #define YY_OBS_GROW \
918 obstack_grow (&string_obstack, yytext, yyleng)
920 #define YY_OBS_FINISH \
922 obstack_1grow (&string_obstack, '\0'); \
923 last_string = obstack_finish (&string_obstack); \
926 #define YY_OBS_FREE \
928 obstack_free (&string_obstack, last_string); \
932 scanner_last_string_free (void)
938 static int percent_percent_count
= 0;
940 /* Within well-formed rules, RULE_LENGTH is the number of values in
941 the current rule so far, which says where to find `$0' with respect
942 to the top of the stack. It is not the same as the rule->length in
943 the case of mid rule actions.
945 Outside of well-formed rules, RULE_LENGTH has an undefined value. */
946 static int rule_length
;
948 static void handle_dollar (braced_code_t code_kind
,
949 char *cp
, location_t location
);
950 static void handle_at (braced_code_t code_kind
,
951 char *cp
, location_t location
);
952 static void handle_syncline (char *args
, location_t
*location
);
953 static int convert_ucn_to_byte (char const *hex_text
);
956 #define SC_LINE_COMMENT 2
957 #define SC_YACC_COMMENT 3
960 #define SC_CHARACTER 5
962 #define SC_ESCAPED_STRING 6
963 #define SC_ESCAPED_CHARACTER 7
965 #define SC_BRACED_CODE 8
966 #define SC_PROLOGUE 9
967 #define SC_EPILOGUE 10
969 /* POSIX says that a tag must be both an id and a C union member, but
970 historically almost any character is allowed in a tag. We disallow
971 NUL and newline, as this simplifies our implementation. */
972 /* Zero or more instances of backslash-newline. Following GCC, allow
973 white space between the backslash and the newline. */
974 #line 975 "scan-gram.c"
976 /* Macros after this point can all be overridden by user definitions in
980 #ifndef YY_SKIP_YYWRAP
982 extern "C" int yywrap
YY_PROTO(( void ));
984 extern int yywrap
YY_PROTO(( void ));
989 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
993 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
996 #ifdef YY_NEED_STRLEN
997 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
1002 static int yyinput
YY_PROTO(( void ));
1004 static int input
YY_PROTO(( void ));
1009 static int yy_start_stack_ptr
= 0;
1010 static int yy_start_stack_depth
= 0;
1011 static int *yy_start_stack
= 0;
1012 #ifndef YY_NO_PUSH_STATE
1013 static void yy_push_state
YY_PROTO(( int new_state
));
1015 #ifndef YY_NO_POP_STATE
1016 static void yy_pop_state
YY_PROTO(( void ));
1018 #ifndef YY_NO_TOP_STATE
1019 static int yy_top_state
YY_PROTO(( void ));
1023 #define YY_NO_PUSH_STATE 1
1024 #define YY_NO_POP_STATE 1
1025 #define YY_NO_TOP_STATE 1
1028 #ifdef YY_MALLOC_DECL
1036 /* Just try to get by without declaring the routines. This will fail
1037 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1038 * or sizeof(void*) != sizeof(int).
1043 /* Amount of stuff to slurp up with each read. */
1044 #ifndef YY_READ_BUF_SIZE
1045 #define YY_READ_BUF_SIZE 8192
1048 /* Copy whatever the last rule matched to the standard output. */
1051 /* This used to be an fputs(), but since the string might contain NUL's,
1052 * we now use fwrite().
1054 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1057 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1058 * is returned in "result".
1061 #define YY_INPUT(buf,result,max_size) \
1062 if ( yy_current_buffer->yy_is_interactive ) \
1065 for ( n = 0; n < max_size && \
1066 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1067 buf[n] = (char) c; \
1069 buf[n++] = (char) c; \
1070 if ( c == EOF && ferror( yyin ) ) \
1071 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1077 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1079 if( errno != EINTR) \
1081 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1090 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1091 * we don't want an extra ';' after the "return" because that will cause
1092 * some compilers to complain about unreachable statements.
1095 #define yyterminate() return YY_NULL
1098 /* Number of entries by which start-condition stack grows. */
1099 #ifndef YY_START_STACK_INCR
1100 #define YY_START_STACK_INCR 25
1103 /* Report a fatal error. */
1104 #ifndef YY_FATAL_ERROR
1105 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1108 /* Default declaration of generated scanner - a define so the user can
1109 * easily add parameters.
1112 #define YY_DECL int yylex YY_PROTO(( void ))
1115 /* Code executed at the beginning of each rule, after yytext and yyleng
1118 #ifndef YY_USER_ACTION
1119 #define YY_USER_ACTION
1122 /* Code executed at the end of each rule. */
1124 #define YY_BREAK break;
1127 #define YY_RULE_SETUP \
1129 yy_current_buffer->yy_at_bol = \
1130 (yytext[yyleng - 1] == '\n'); \
1135 register yy_state_type yy_current_state
;
1136 register char *yy_cp
, *yy_bp
;
1137 register int yy_act
;
1139 #line 216 "scan-gram.l"
1142 int braces_level
IF_LINT (= 0);
1144 /* At each yylex invocation, mark the current position as the
1145 start of the next token. */
1150 /*----------------------------.
1151 | Scanning Bison directives. |
1152 `----------------------------*/
1153 #line 1154 "scan-gram.c"
1164 yy_start
= 1; /* first start state */
1172 if ( ! yy_current_buffer
)
1174 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1176 yy_load_buffer_state();
1179 while ( 1 ) /* loops until end-of-file is reached */
1183 /* Support of yytext. */
1184 *yy_cp
= yy_hold_char
;
1186 /* yy_bp points to the position in yy_ch_buf of the start of
1191 yy_current_state
= yy_start
;
1192 yy_current_state
+= YY_AT_BOL();
1196 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1197 if ( yy_accept
[yy_current_state
] )
1199 yy_last_accepting_state
= yy_current_state
;
1200 yy_last_accepting_cpos
= yy_cp
;
1202 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1204 yy_current_state
= (int) yy_def
[yy_current_state
];
1205 if ( yy_current_state
>= 411 )
1206 yy_c
= yy_meta
[(unsigned int) yy_c
];
1208 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1211 while ( yy_base
[yy_current_state
] != 903 );
1214 yy_act
= yy_accept
[yy_current_state
];
1216 { /* have to back up */
1217 yy_cp
= yy_last_accepting_cpos
;
1218 yy_current_state
= yy_last_accepting_state
;
1219 yy_act
= yy_accept
[yy_current_state
];
1222 YY_DO_BEFORE_ACTION
;
1225 do_action
: /* This label is used only to access EOF actions. */
1227 if ( yy_flex_debug
)
1230 fprintf( stderr
, "--scanner backing up\n" );
1231 else if ( yy_act
< 104 )
1232 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1233 yy_rule_linenum
[yy_act
], yytext
);
1234 else if ( yy_act
== 104 )
1235 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1237 else if ( yy_act
== 105 )
1238 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1240 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1244 { /* beginning of action switch */
1245 case 0: /* must back up */
1246 /* undo the effects of YY_DO_BEFORE_ACTION */
1247 *yy_cp
= yy_hold_char
;
1248 yy_cp
= yy_last_accepting_cpos
;
1249 yy_current_state
= yy_last_accepting_state
;
1250 goto yy_find_action
;
1256 #line 231 "scan-gram.l"
1257 return PERCENT_NONASSOC
;
1261 #line 232 "scan-gram.l"
1262 return PERCENT_DEBUG
;
1266 #line 233 "scan-gram.l"
1267 return PERCENT_DEFINE
;
1271 #line 234 "scan-gram.l"
1272 return PERCENT_DEFINES
;
1276 #line 235 "scan-gram.l"
1277 return PERCENT_DESTRUCTOR
;
1281 #line 236 "scan-gram.l"
1282 return PERCENT_DPREC
;
1286 #line 237 "scan-gram.l"
1287 return PERCENT_ERROR_VERBOSE
;
1291 #line 238 "scan-gram.l"
1292 return PERCENT_EXPECT
;
1296 #line 239 "scan-gram.l"
1297 return PERCENT_FILE_PREFIX
;
1301 #line 240 "scan-gram.l"
1302 return PERCENT_YACC
;
1306 #line 241 "scan-gram.l"
1307 return PERCENT_GLR_PARSER
;
1311 #line 242 "scan-gram.l"
1312 return PERCENT_LEFT
;
1316 #line 243 "scan-gram.l"
1317 return PERCENT_LOCATIONS
;
1321 #line 244 "scan-gram.l"
1322 return PERCENT_MERGE
;
1326 #line 245 "scan-gram.l"
1327 return PERCENT_NAME_PREFIX
;
1331 #line 246 "scan-gram.l"
1332 return PERCENT_NO_LINES
;
1336 #line 247 "scan-gram.l"
1337 return PERCENT_NONASSOC
;
1341 #line 248 "scan-gram.l"
1342 return PERCENT_NTERM
;
1346 #line 249 "scan-gram.l"
1347 return PERCENT_OUTPUT
;
1351 #line 250 "scan-gram.l"
1352 return PERCENT_PARSE_PARAM
;
1356 #line 251 "scan-gram.l"
1357 rule_length
--; return PERCENT_PREC
;
1361 #line 252 "scan-gram.l"
1362 return PERCENT_PRINTER
;
1366 #line 253 "scan-gram.l"
1367 return PERCENT_PURE_PARSER
;
1371 #line 254 "scan-gram.l"
1372 return PERCENT_RIGHT
;
1376 #line 255 "scan-gram.l"
1377 return PERCENT_LEX_PARAM
;
1381 #line 256 "scan-gram.l"
1382 return PERCENT_SKELETON
;
1386 #line 257 "scan-gram.l"
1387 return PERCENT_START
;
1391 #line 258 "scan-gram.l"
1392 return PERCENT_TOKEN
;
1396 #line 259 "scan-gram.l"
1397 return PERCENT_TOKEN
;
1401 #line 260 "scan-gram.l"
1402 return PERCENT_TOKEN_TABLE
;
1406 #line 261 "scan-gram.l"
1407 return PERCENT_TYPE
;
1411 #line 262 "scan-gram.l"
1412 return PERCENT_UNION
;
1416 #line 263 "scan-gram.l"
1417 return PERCENT_VERBOSE
;
1421 #line 264 "scan-gram.l"
1422 return PERCENT_YACC
;
1426 #line 266 "scan-gram.l"
1428 complain_at (*yylloc
, _("invalid directive: %s"), quote (yytext
));
1434 #line 271 "scan-gram.l"
1435 handle_syncline (yytext
+ strlen ("#line "), yylloc
); YY_STEP
;
1439 #line 273 "scan-gram.l"
1444 #line 274 "scan-gram.l"
1445 rule_length
= 0; return COLON
;
1449 #line 275 "scan-gram.l"
1450 rule_length
= 0; return PIPE
;
1454 #line 276 "scan-gram.l"
1459 #line 277 "scan-gram.l"
1464 #line 279 "scan-gram.l"
1469 #line 281 "scan-gram.l"
1471 yylval
->symbol
= symbol_get (yytext
, *yylloc
);
1478 #line 287 "scan-gram.l"
1482 num
= strtoul (yytext
, 0, 10);
1483 if (INT_MAX
< num
|| errno
)
1485 complain_at (*yylloc
, _("integer out of range: %s"), quote (yytext
));
1488 yylval
->integer
= num
;
1492 /* Characters. We don't check there is only one. */
1495 #line 301 "scan-gram.l"
1496 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1501 #line 304 "scan-gram.l"
1502 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1507 #line 307 "scan-gram.l"
1508 BEGIN SC_YACC_COMMENT
;
1512 #line 308 "scan-gram.l"
1518 #line 311 "scan-gram.l"
1519 yy_push_state (SC_PROLOGUE
);
1521 /* Code in between braces. */
1524 #line 314 "scan-gram.l"
1525 YY_OBS_GROW
; braces_level
= 0; yy_push_state (SC_BRACED_CODE
);
1530 #line 317 "scan-gram.l"
1532 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1534 yylval
->string
= last_string
;
1540 #line 325 "scan-gram.l"
1542 if (++percent_percent_count
== 2)
1543 yy_push_state (SC_EPILOGUE
);
1544 return PERCENT_PERCENT
;
1549 #line 331 "scan-gram.l"
1551 complain_at (*yylloc
, _("invalid character: %s"), quote (yytext
));
1556 /*-------------------------------------------------------------------.
1557 | Whatever the start condition (but those which correspond to |
1558 | entities `swallowed' by Bison: SC_YACC_COMMENT, SC_ESCAPED_STRING, |
1559 | and SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1560 `-------------------------------------------------------------------*/
1565 #line 346 "scan-gram.l"
1566 obstack_sgrow (&string_obstack
, "@<:@");
1570 #line 347 "scan-gram.l"
1571 obstack_sgrow (&string_obstack
, "@:>@");
1574 /*---------------------------------------------------------------.
1575 | Scanning a Yacc comment. The initial `/ *' is already eaten. |
1576 `---------------------------------------------------------------*/
1581 #line 357 "scan-gram.l"
1589 #line 362 "scan-gram.l"
1592 case YY_STATE_EOF(SC_YACC_COMMENT
):
1593 #line 364 "scan-gram.l"
1595 unexpected_end_of_file (*yylloc
, "/*", "*/");
1600 /*------------------------------------------------------------.
1601 | Scanning a C comment. The initial `/ *' is already eaten. |
1602 `------------------------------------------------------------*/
1607 #line 377 "scan-gram.l"
1608 YY_OBS_GROW
; yy_pop_state ();
1612 #line 378 "scan-gram.l"
1615 case YY_STATE_EOF(SC_COMMENT
):
1616 #line 380 "scan-gram.l"
1618 unexpected_end_of_file (*yylloc
, "/*", "*/");
1623 /*--------------------------------------------------------------.
1624 | Scanning a line comment. The initial `//' is already eaten. |
1625 `--------------------------------------------------------------*/
1630 #line 393 "scan-gram.l"
1631 YY_OBS_GROW
; yy_pop_state ();
1635 #line 394 "scan-gram.l"
1638 case YY_STATE_EOF(SC_LINE_COMMENT
):
1639 #line 395 "scan-gram.l"
1643 /*----------------------------------------------------------------.
1644 | Scanning a C string, including its escapes. The initial `"' is |
1646 `----------------------------------------------------------------*/
1651 #line 406 "scan-gram.l"
1653 assert (yy_top_state () == INITIAL
);
1656 yylval
->string
= last_string
;
1664 #line 416 "scan-gram.l"
1667 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1668 #line 418 "scan-gram.l"
1670 unexpected_end_of_file (*yylloc
, "\"", "\"");
1671 assert (yy_top_state () == INITIAL
);
1673 yylval
->string
= last_string
;
1679 /*---------------------------------------------------------------.
1680 | Scanning a C character, decoding its escapes. The initial "'" |
1681 | is already eaten. |
1682 `---------------------------------------------------------------*/
1687 #line 435 "scan-gram.l"
1690 assert (yy_top_state () == INITIAL
);
1693 yylval
->symbol
= symbol_get (last_string
, *yylloc
);
1694 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1695 symbol_user_token_number_set (yylval
->symbol
,
1696 (unsigned char) last_string
[1], *yylloc
);
1706 #line 451 "scan-gram.l"
1709 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1710 #line 453 "scan-gram.l"
1712 unexpected_end_of_file (*yylloc
, "'", "'");
1713 assert (yy_top_state () == INITIAL
);
1715 yylval
->string
= last_string
;
1721 /*----------------------------.
1722 | Decode escaped characters. |
1723 `----------------------------*/
1728 #line 470 "scan-gram.l"
1730 unsigned long c
= strtoul (yytext
+ 1, 0, 8);
1733 complain_at (*yylloc
, _("invalid escape sequence: %s"),
1738 obstack_1grow (&string_obstack
, c
);
1743 #line 482 "scan-gram.l"
1747 c
= strtoul (yytext
+ 2, 0, 16);
1748 if (UCHAR_MAX
< c
|| errno
)
1750 complain_at (*yylloc
, _("invalid escape sequence: %s"),
1755 obstack_1grow (&string_obstack
, c
);
1760 #line 496 "scan-gram.l"
1761 obstack_1grow (&string_obstack
, '\a');
1765 #line 497 "scan-gram.l"
1766 obstack_1grow (&string_obstack
, '\b');
1770 #line 498 "scan-gram.l"
1771 obstack_1grow (&string_obstack
, '\f');
1775 #line 499 "scan-gram.l"
1776 obstack_1grow (&string_obstack
, '\n');
1780 #line 500 "scan-gram.l"
1781 obstack_1grow (&string_obstack
, '\r');
1785 #line 501 "scan-gram.l"
1786 obstack_1grow (&string_obstack
, '\t');
1790 #line 502 "scan-gram.l"
1791 obstack_1grow (&string_obstack
, '\v');
1795 #line 503 "scan-gram.l"
1796 obstack_1grow (&string_obstack
, yytext
[1]);
1800 #line 504 "scan-gram.l"
1802 int c
= convert_ucn_to_byte (yytext
);
1805 complain_at (*yylloc
, _("invalid escape sequence: %s"),
1810 obstack_1grow (&string_obstack
, c
);
1815 #line 515 "scan-gram.l"
1817 complain_at (*yylloc
, _("unrecognized escape sequence: %s"),
1822 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1825 #line 521 "scan-gram.l"
1829 /*----------------------------------------------------------.
1830 | Scanning a C character without decoding its escapes. The |
1831 | initial "'" is already eaten. |
1832 `----------------------------------------------------------*/
1837 #line 532 "scan-gram.l"
1840 assert (yy_top_state () != INITIAL
);
1846 #line 538 "scan-gram.l"
1851 #line 539 "scan-gram.l"
1856 #line 540 "scan-gram.l"
1859 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1862 #line 542 "scan-gram.l"
1865 case YY_STATE_EOF(SC_CHARACTER
):
1866 #line 544 "scan-gram.l"
1868 unexpected_end_of_file (*yylloc
, "'", "'");
1869 assert (yy_top_state () != INITIAL
);
1874 /*----------------------------------------------------------------.
1875 | Scanning a C string, without decoding its escapes. The initial |
1876 | `"' is already eaten. |
1877 `----------------------------------------------------------------*/
1882 #line 559 "scan-gram.l"
1884 assert (yy_top_state () != INITIAL
);
1891 #line 565 "scan-gram.l"
1896 #line 566 "scan-gram.l"
1901 #line 567 "scan-gram.l"
1904 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1907 #line 569 "scan-gram.l"
1910 case YY_STATE_EOF(SC_STRING
):
1911 #line 571 "scan-gram.l"
1913 unexpected_end_of_file (*yylloc
, "\"", "\"");
1914 assert (yy_top_state () != INITIAL
);
1919 /*---------------------------------------------------.
1920 | Strings, comments etc. can be found in user code. |
1921 `---------------------------------------------------*/
1924 /* Characters. We don't check there is only one. */
1927 #line 586 "scan-gram.l"
1928 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1933 #line 589 "scan-gram.l"
1934 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1939 #line 592 "scan-gram.l"
1940 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1944 #line 593 "scan-gram.l"
1945 YY_OBS_GROW
; yy_push_state (SC_LINE_COMMENT
);
1950 #line 596 "scan-gram.l"
1954 /*---------------------------------------------------------------.
1955 | Scanning some code in braces (%union and actions). The initial |
1956 | "{" is already eaten. |
1957 `---------------------------------------------------------------*/
1962 #line 607 "scan-gram.l"
1963 YY_OBS_GROW
; braces_level
++;
1967 #line 608 "scan-gram.l"
1968 YY_OBS_GROW
; braces_level
--;
1972 #line 609 "scan-gram.l"
1976 if (braces_level
< 0)
1980 yylval
->string
= last_string
;
1988 #line 622 "scan-gram.l"
1989 { handle_dollar (current_braced_code
,
1994 #line 624 "scan-gram.l"
1995 { handle_at (current_braced_code
,
1998 /* `"<"{splice}"<"' tokenizes `<<%' correctly (as `<<' `%') rather
1999 than incorrrectly (as `<' `<%'). */
2002 #line 629 "scan-gram.l"
2005 case YY_STATE_EOF(SC_BRACED_CODE
):
2006 #line 631 "scan-gram.l"
2008 unexpected_end_of_file (*yylloc
, "{", "}");
2011 yylval
->string
= last_string
;
2016 /*--------------------------------------------------------------.
2017 | Scanning some prologue: from "%{" (already scanned) to "%}". |
2018 `--------------------------------------------------------------*/
2023 #line 648 "scan-gram.l"
2027 yylval
->string
= last_string
;
2033 #line 655 "scan-gram.l"
2038 #line 656 "scan-gram.l"
2041 case YY_STATE_EOF(SC_PROLOGUE
):
2042 #line 658 "scan-gram.l"
2044 unexpected_end_of_file (*yylloc
, "%{", "%}");
2047 yylval
->string
= last_string
;
2052 /*---------------------------------------------------------------.
2053 | Scanning the epilogue (everything after the second "%%", which |
2054 | has already been eaten). |
2055 `---------------------------------------------------------------*/
2060 #line 675 "scan-gram.l"
2063 case YY_STATE_EOF(SC_EPILOGUE
):
2064 #line 677 "scan-gram.l"
2068 yylval
->string
= last_string
;
2075 #line 686 "scan-gram.l"
2076 YY_FATAL_ERROR( "flex scanner jammed" );
2078 #line 2079 "scan-gram.c"
2079 case YY_STATE_EOF(INITIAL
):
2082 case YY_END_OF_BUFFER
:
2084 /* Amount of text matched not including the EOB char. */
2085 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
2087 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2088 *yy_cp
= yy_hold_char
;
2089 YY_RESTORE_YY_MORE_OFFSET
2091 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
2093 /* We're scanning a new file or input source. It's
2094 * possible that this happened because the user
2095 * just pointed yyin at a new source and called
2096 * yylex(). If so, then we have to assure
2097 * consistency between yy_current_buffer and our
2098 * globals. Here is the right place to do so, because
2099 * this is the first action (other than possibly a
2100 * back-up) that will match for the new input source.
2102 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2103 yy_current_buffer
->yy_input_file
= yyin
;
2104 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2107 /* Note that here we test for yy_c_buf_p "<=" to the position
2108 * of the first EOB in the buffer, since yy_c_buf_p will
2109 * already have been incremented past the NUL character
2110 * (since all states make transitions on EOB to the
2111 * end-of-buffer state). Contrast this with the test
2114 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2115 { /* This was really a NUL. */
2116 yy_state_type yy_next_state
;
2118 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
2120 yy_current_state
= yy_get_previous_state();
2122 /* Okay, we're now positioned to make the NUL
2123 * transition. We couldn't have
2124 * yy_get_previous_state() go ahead and do it
2125 * for us because it doesn't know how to deal
2126 * with the possibility of jamming (and we don't
2127 * want to build jamming into it because then it
2128 * will run more slowly).
2131 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
2133 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2135 if ( yy_next_state
)
2137 /* Consume the NUL. */
2138 yy_cp
= ++yy_c_buf_p
;
2139 yy_current_state
= yy_next_state
;
2146 goto yy_find_action
;
2150 else switch ( yy_get_next_buffer() )
2152 case EOB_ACT_END_OF_FILE
:
2154 yy_did_buffer_switch_on_eof
= 0;
2158 /* Note: because we've taken care in
2159 * yy_get_next_buffer() to have set up
2160 * yytext, we can now set up
2161 * yy_c_buf_p so that if some total
2162 * hoser (like flex itself) wants to
2163 * call the scanner after we return the
2164 * YY_NULL, it'll still work - another
2165 * YY_NULL will get returned.
2167 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
2169 yy_act
= YY_STATE_EOF(YY_START
);
2175 if ( ! yy_did_buffer_switch_on_eof
)
2181 case EOB_ACT_CONTINUE_SCAN
:
2183 yytext_ptr
+ yy_amount_of_matched_text
;
2185 yy_current_state
= yy_get_previous_state();
2188 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2191 case EOB_ACT_LAST_MATCH
:
2193 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
2195 yy_current_state
= yy_get_previous_state();
2198 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2199 goto yy_find_action
;
2206 "fatal flex scanner internal error--no action found" );
2207 } /* end of action switch */
2208 } /* end of scanning one token */
2209 } /* end of yylex */
2212 /* yy_get_next_buffer - try to read in a new buffer
2214 * Returns a code representing an action:
2215 * EOB_ACT_LAST_MATCH -
2216 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2217 * EOB_ACT_END_OF_FILE - end of file
2220 static int yy_get_next_buffer()
2222 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2223 register char *source
= yytext_ptr
;
2224 register int number_to_move
, i
;
2227 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2229 "fatal flex scanner internal error--end of buffer missed" );
2231 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2232 { /* Don't try to fill the buffer, so this is an EOF. */
2233 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2235 /* We matched a single character, the EOB, so
2236 * treat this as a final EOF.
2238 return EOB_ACT_END_OF_FILE
;
2243 /* We matched some text prior to the EOB, first
2246 return EOB_ACT_LAST_MATCH
;
2250 /* Try to read more data. */
2252 /* First move last chars to start of buffer. */
2253 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2255 for ( i
= 0; i
< number_to_move
; ++i
)
2256 *(dest
++) = *(source
++);
2258 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2259 /* don't do the read, it's not guaranteed to return an EOF,
2262 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2267 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2269 while ( num_to_read
<= 0 )
2270 { /* Not enough room in the buffer - grow it. */
2271 #ifdef YY_USES_REJECT
2273 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2276 /* just a shorter name for the current buffer */
2277 YY_BUFFER_STATE b
= yy_current_buffer
;
2279 int yy_c_buf_p_offset
=
2280 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2282 if ( b
->yy_is_our_buffer
)
2284 int new_size
= b
->yy_buf_size
* 2;
2286 if ( new_size
<= 0 )
2287 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2289 b
->yy_buf_size
*= 2;
2291 b
->yy_ch_buf
= (char *)
2292 /* Include room in for 2 EOB chars. */
2293 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2294 b
->yy_buf_size
+ 2 );
2297 /* Can't grow it, we don't own it. */
2300 if ( ! b
->yy_ch_buf
)
2302 "fatal error - scanner input buffer overflow" );
2304 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2306 num_to_read
= yy_current_buffer
->yy_buf_size
-
2311 if ( num_to_read
> YY_READ_BUF_SIZE
)
2312 num_to_read
= YY_READ_BUF_SIZE
;
2314 /* Read in more data. */
2315 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2316 yy_n_chars
, num_to_read
);
2318 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2321 if ( yy_n_chars
== 0 )
2323 if ( number_to_move
== YY_MORE_ADJ
)
2325 ret_val
= EOB_ACT_END_OF_FILE
;
2331 ret_val
= EOB_ACT_LAST_MATCH
;
2332 yy_current_buffer
->yy_buffer_status
=
2333 YY_BUFFER_EOF_PENDING
;
2338 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2340 yy_n_chars
+= number_to_move
;
2341 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2342 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2344 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2350 /* yy_get_previous_state - get the state just before the EOB char was reached */
2352 static yy_state_type
yy_get_previous_state()
2354 register yy_state_type yy_current_state
;
2355 register char *yy_cp
;
2357 yy_current_state
= yy_start
;
2358 yy_current_state
+= YY_AT_BOL();
2360 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2362 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 55);
2363 if ( yy_accept
[yy_current_state
] )
2365 yy_last_accepting_state
= yy_current_state
;
2366 yy_last_accepting_cpos
= yy_cp
;
2368 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2370 yy_current_state
= (int) yy_def
[yy_current_state
];
2371 if ( yy_current_state
>= 411 )
2372 yy_c
= yy_meta
[(unsigned int) yy_c
];
2374 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2377 return yy_current_state
;
2381 /* yy_try_NUL_trans - try to make a transition on the NUL character
2384 * next_state = yy_try_NUL_trans( current_state );
2387 #ifdef YY_USE_PROTOS
2388 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2390 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2391 yy_state_type yy_current_state
;
2394 register int yy_is_jam
;
2395 register char *yy_cp
= yy_c_buf_p
;
2397 register YY_CHAR yy_c
= 55;
2398 if ( yy_accept
[yy_current_state
] )
2400 yy_last_accepting_state
= yy_current_state
;
2401 yy_last_accepting_cpos
= yy_cp
;
2403 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2405 yy_current_state
= (int) yy_def
[yy_current_state
];
2406 if ( yy_current_state
>= 411 )
2407 yy_c
= yy_meta
[(unsigned int) yy_c
];
2409 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2410 yy_is_jam
= (yy_current_state
== 410);
2412 return yy_is_jam
? 0 : yy_current_state
;
2417 #ifdef YY_USE_PROTOS
2418 static void yyunput( int c
, register char *yy_bp
)
2420 static void yyunput( c
, yy_bp
)
2422 register char *yy_bp
;
2425 register char *yy_cp
= yy_c_buf_p
;
2427 /* undo effects of setting up yytext */
2428 *yy_cp
= yy_hold_char
;
2430 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2431 { /* need to shift things up to make room */
2432 /* +2 for EOB chars. */
2433 register int number_to_move
= yy_n_chars
+ 2;
2434 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2435 yy_current_buffer
->yy_buf_size
+ 2];
2436 register char *source
=
2437 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2439 while ( source
> yy_current_buffer
->yy_ch_buf
)
2440 *--dest
= *--source
;
2442 yy_cp
+= (int) (dest
- source
);
2443 yy_bp
+= (int) (dest
- source
);
2444 yy_current_buffer
->yy_n_chars
=
2445 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2447 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2448 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2451 *--yy_cp
= (char) c
;
2455 yy_hold_char
= *yy_cp
;
2458 #endif /* ifndef YY_NO_UNPUT */
2462 static int yyinput()
2469 *yy_c_buf_p
= yy_hold_char
;
2471 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2473 /* yy_c_buf_p now points to the character we want to return.
2474 * If this occurs *before* the EOB characters, then it's a
2475 * valid NUL; if not, then we've hit the end of the buffer.
2477 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2478 /* This was really a NUL. */
2482 { /* need more input */
2483 int offset
= yy_c_buf_p
- yytext_ptr
;
2486 switch ( yy_get_next_buffer() )
2488 case EOB_ACT_LAST_MATCH
:
2489 /* This happens because yy_g_n_b()
2490 * sees that we've accumulated a
2491 * token and flags that we need to
2492 * try matching the token before
2493 * proceeding. But for input(),
2494 * there's no matching to consider.
2495 * So convert the EOB_ACT_LAST_MATCH
2496 * to EOB_ACT_END_OF_FILE.
2499 /* Reset buffer status. */
2504 case EOB_ACT_END_OF_FILE
:
2509 if ( ! yy_did_buffer_switch_on_eof
)
2518 case EOB_ACT_CONTINUE_SCAN
:
2519 yy_c_buf_p
= yytext_ptr
+ offset
;
2525 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2526 *yy_c_buf_p
= '\0'; /* preserve yytext */
2527 yy_hold_char
= *++yy_c_buf_p
;
2529 yy_current_buffer
->yy_at_bol
= (c
== '\n');
2535 #ifdef YY_USE_PROTOS
2536 void yyrestart( FILE *input_file
)
2538 void yyrestart( input_file
)
2542 if ( ! yy_current_buffer
)
2543 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2545 yy_init_buffer( yy_current_buffer
, input_file
);
2546 yy_load_buffer_state();
2550 #ifdef YY_USE_PROTOS
2551 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2553 void yy_switch_to_buffer( new_buffer
)
2554 YY_BUFFER_STATE new_buffer
;
2557 if ( yy_current_buffer
== new_buffer
)
2560 if ( yy_current_buffer
)
2562 /* Flush out information for old buffer. */
2563 *yy_c_buf_p
= yy_hold_char
;
2564 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2565 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2568 yy_current_buffer
= new_buffer
;
2569 yy_load_buffer_state();
2571 /* We don't actually know whether we did this switch during
2572 * EOF (yywrap()) processing, but the only time this flag
2573 * is looked at is after yywrap() is called, so it's safe
2574 * to go ahead and always set it.
2576 yy_did_buffer_switch_on_eof
= 1;
2580 #ifdef YY_USE_PROTOS
2581 void yy_load_buffer_state( void )
2583 void yy_load_buffer_state()
2586 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2587 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2588 yyin
= yy_current_buffer
->yy_input_file
;
2589 yy_hold_char
= *yy_c_buf_p
;
2593 #ifdef YY_USE_PROTOS
2594 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2596 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2603 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2605 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2607 b
->yy_buf_size
= size
;
2609 /* yy_ch_buf has to be 2 characters longer than the size given because
2610 * we need to put in 2 end-of-buffer characters.
2612 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2613 if ( ! b
->yy_ch_buf
)
2614 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2616 b
->yy_is_our_buffer
= 1;
2618 yy_init_buffer( b
, file
);
2624 #ifdef YY_USE_PROTOS
2625 void yy_delete_buffer( YY_BUFFER_STATE b
)
2627 void yy_delete_buffer( b
)
2634 if ( b
== yy_current_buffer
)
2635 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2637 if ( b
->yy_is_our_buffer
)
2638 yy_flex_free( (void *) b
->yy_ch_buf
);
2640 yy_flex_free( (void *) b
);
2647 #ifndef YY_ALWAYS_INTERACTIVE
2648 #ifndef YY_NEVER_INTERACTIVE
2649 extern int isatty
YY_PROTO(( int ));
2654 #ifdef YY_USE_PROTOS
2655 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2657 void yy_init_buffer( b
, file
)
2664 yy_flush_buffer( b
);
2666 b
->yy_input_file
= file
;
2667 b
->yy_fill_buffer
= 1;
2669 #if YY_ALWAYS_INTERACTIVE
2670 b
->yy_is_interactive
= 1;
2672 #if YY_NEVER_INTERACTIVE
2673 b
->yy_is_interactive
= 0;
2675 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2681 #ifdef YY_USE_PROTOS
2682 void yy_flush_buffer( YY_BUFFER_STATE b
)
2684 void yy_flush_buffer( b
)
2694 /* We always need two end-of-buffer characters. The first causes
2695 * a transition to the end-of-buffer state. The second causes
2696 * a jam in that state.
2698 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2699 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2701 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2704 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2706 if ( b
== yy_current_buffer
)
2707 yy_load_buffer_state();
2711 #ifndef YY_NO_SCAN_BUFFER
2712 #ifdef YY_USE_PROTOS
2713 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2715 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2723 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2724 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2725 /* They forgot to leave room for the EOB's. */
2728 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2730 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2732 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2733 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2734 b
->yy_is_our_buffer
= 0;
2735 b
->yy_input_file
= 0;
2736 b
->yy_n_chars
= b
->yy_buf_size
;
2737 b
->yy_is_interactive
= 0;
2739 b
->yy_fill_buffer
= 0;
2740 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2742 yy_switch_to_buffer( b
);
2749 #ifndef YY_NO_SCAN_STRING
2750 #ifdef YY_USE_PROTOS
2751 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2753 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2754 yyconst
char *yy_str
;
2758 for ( len
= 0; yy_str
[len
]; ++len
)
2761 return yy_scan_bytes( yy_str
, len
);
2766 #ifndef YY_NO_SCAN_BYTES
2767 #ifdef YY_USE_PROTOS
2768 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2770 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2771 yyconst
char *bytes
;
2780 /* Get memory for full buffer, including space for trailing EOB's. */
2782 buf
= (char *) yy_flex_alloc( n
);
2784 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2786 for ( i
= 0; i
< len
; ++i
)
2789 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2791 b
= yy_scan_buffer( buf
, n
);
2793 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2795 /* It's okay to grow etc. this buffer, and we should throw it
2796 * away when we're done.
2798 b
->yy_is_our_buffer
= 1;
2805 #ifndef YY_NO_PUSH_STATE
2806 #ifdef YY_USE_PROTOS
2807 static void yy_push_state( int new_state
)
2809 static void yy_push_state( new_state
)
2813 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2817 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2818 new_size
= yy_start_stack_depth
* sizeof( int );
2820 if ( ! yy_start_stack
)
2821 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2824 yy_start_stack
= (int *) yy_flex_realloc(
2825 (void *) yy_start_stack
, new_size
);
2827 if ( ! yy_start_stack
)
2829 "out of memory expanding start-condition stack" );
2832 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2839 #ifndef YY_NO_POP_STATE
2840 static void yy_pop_state()
2842 if ( --yy_start_stack_ptr
< 0 )
2843 YY_FATAL_ERROR( "start-condition stack underflow" );
2845 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2850 #ifndef YY_NO_TOP_STATE
2851 static int yy_top_state()
2853 return yy_start_stack
[yy_start_stack_ptr
- 1];
2857 #ifndef YY_EXIT_FAILURE
2858 #define YY_EXIT_FAILURE 2
2861 #ifdef YY_USE_PROTOS
2862 static void yy_fatal_error( yyconst
char msg
[] )
2864 static void yy_fatal_error( msg
)
2868 (void) fprintf( stderr
, "%s\n", msg
);
2869 exit( YY_EXIT_FAILURE
);
2874 /* Redefine yyless() so it works in section 3 code. */
2880 /* Undo effects of setting up yytext. */ \
2881 yytext[yyleng] = yy_hold_char; \
2882 yy_c_buf_p = yytext + n; \
2883 yy_hold_char = *yy_c_buf_p; \
2884 *yy_c_buf_p = '\0'; \
2890 /* Internal utility routines. */
2893 #ifdef YY_USE_PROTOS
2894 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2896 static void yy_flex_strncpy( s1
, s2
, n
)
2903 for ( i
= 0; i
< n
; ++i
)
2908 #ifdef YY_NEED_STRLEN
2909 #ifdef YY_USE_PROTOS
2910 static int yy_flex_strlen( yyconst
char *s
)
2912 static int yy_flex_strlen( s
)
2917 for ( n
= 0; s
[n
]; ++n
)
2925 #ifdef YY_USE_PROTOS
2926 static void *yy_flex_alloc( yy_size_t size
)
2928 static void *yy_flex_alloc( size
)
2932 return (void *) malloc( size
);
2935 #ifdef YY_USE_PROTOS
2936 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2938 static void *yy_flex_realloc( ptr
, size
)
2943 /* The cast to (char *) in the following accommodates both
2944 * implementations that use char* generic pointers, and those
2945 * that use void* generic pointers. It works with the latter
2946 * because both ANSI C and C++ allow castless assignment from
2947 * any pointer type to void*, and deal with argument conversions
2948 * as though doing an assignment.
2950 return (void *) realloc( (char *) ptr
, size
);
2953 #ifdef YY_USE_PROTOS
2954 static void yy_flex_free( void *ptr
)
2956 static void yy_flex_free( ptr
)
2970 #line 686 "scan-gram.l"
2973 /*------------------------------------------------------------------.
2974 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2976 | Possible inputs: $[<TYPENAME>]($|integer) |
2978 | Output to the STRING_OBSTACK a reference to this semantic value. |
2979 `------------------------------------------------------------------*/
2982 handle_action_dollar (char *text
, location_t location
)
2984 const char *type_name
= NULL
;
2985 char *cp
= text
+ 1;
2987 /* Get the type name if explicit. */
3000 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
3001 if (!type_name
&& typed
)
3002 complain_at (location
, _("$$ of `%s' has no declared type"),
3003 current_rule
->sym
->tag
);
3006 obstack_fgrow1 (&string_obstack
,
3007 "]b4_lhs_value([%s])[", type_name
);
3013 num
= strtol (cp
, 0, 10);
3015 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
3018 if (!type_name
&& n
> 0)
3019 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
3021 if (!type_name
&& typed
)
3022 complain_at (location
, _("$%d of `%s' has no declared type"),
3023 n
, current_rule
->sym
->tag
);
3026 obstack_fgrow3 (&string_obstack
,
3027 "]b4_rhs_value([%d], [%d], [%s])[",
3028 rule_length
, n
, type_name
);
3031 complain_at (location
, _("integer out of range: %s"), quote (text
));
3036 /*---------------------------------------------------------------.
3037 | TEXT is expected to be $$ in some code associated to a symbol: |
3038 | destructor or printer. |
3039 `---------------------------------------------------------------*/
3042 handle_symbol_code_dollar (char *text
, location_t location
)
3044 char *cp
= text
+ 1;
3046 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
3048 complain_at (location
, _("invalid value: %s"), quote (text
));
3052 /*-----------------------------------------------------------------.
3053 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
3054 | depending upon CODE_KIND. |
3055 `-----------------------------------------------------------------*/
3058 handle_dollar (braced_code_t braced_code_kind
,
3059 char *text
, location_t location
)
3061 switch (braced_code_kind
)
3063 case action_braced_code
:
3064 handle_action_dollar (text
, location
);
3067 case destructor_braced_code
:
3068 case printer_braced_code
:
3069 handle_symbol_code_dollar (text
, location
);
3075 /*------------------------------------------------------.
3076 | TEXT is a location token (i.e., a `@...'). Output to |
3077 | STRING_OBSTACK a reference to this location. |
3078 `------------------------------------------------------*/
3081 handle_action_at (char *text
, location_t location
)
3083 char *cp
= text
+ 1;
3088 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
3094 num
= strtol (cp
, 0, 10);
3096 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
3099 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
3103 complain_at (location
, _("integer out of range: %s"), quote (text
));
3108 /*---------------------------------------------------------------.
3109 | TEXT is expected to be @$ in some code associated to a symbol: |
3110 | destructor or printer. |
3111 `---------------------------------------------------------------*/
3114 handle_symbol_code_at (char *text
, location_t location
)
3116 char *cp
= text
+ 1;
3118 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
3120 complain_at (location
, _("invalid value: %s"), quote (text
));
3124 /*-------------------------------------------------------------------.
3125 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
3127 `-------------------------------------------------------------------*/
3130 handle_at (braced_code_t braced_code_kind
,
3131 char *text
, location_t location
)
3133 switch (braced_code_kind
)
3135 case action_braced_code
:
3136 handle_action_at (text
, location
);
3139 case destructor_braced_code
:
3140 case printer_braced_code
:
3141 handle_symbol_code_at (text
, location
);
3147 /*------------------------------------------------------------------.
3148 | Convert universal character name UCN to a single-byte character, |
3149 | and return that character. Return -1 if UCN does not correspond |
3150 | to a single-byte character. |
3151 `------------------------------------------------------------------*/
3154 convert_ucn_to_byte (char const *ucn
)
3156 unsigned long code
= strtoul (ucn
+ 2, 0, 16);
3158 /* FIXME: Currently we assume Unicode-compatible unibyte characters
3159 on ASCII hosts (i.e., Latin-1 on hosts with 8-bit bytes). On
3160 non-ASCII hosts we support only the portable C character set.
3161 These limitations should be removed once we add support for
3162 multibyte characters. */
3164 if (UCHAR_MAX
< code
)
3167 #if ! ('$' == 0x24 && '@' == 0x40 && '`' == 0x60 && '~' == 0x7e)
3169 /* A non-ASCII host. Use CODE to index into a table of the C
3170 basic execution character set, which is guaranteed to exist on
3171 all Standard C platforms. This table also includes '$', '@',
3172 and '`', which are not in the basic execution character set but
3173 which are unibyte characters on all the platforms that we know
3175 static signed char const table
[] =
3177 '\0', -1, -1, -1, -1, -1, -1, '\a',
3178 '\b', '\t', '\n', '\v', '\f', '\r', -1, -1,
3179 -1, -1, -1, -1, -1, -1, -1, -1,
3180 -1, -1, -1, -1, -1, -1, -1, -1,
3181 ' ', '!', '"', '#', '$', '%', '&', '\'',
3182 '(', ')', '*', '+', ',', '-', '.', '/',
3183 '0', '1', '2', '3', '4', '5', '6', '7',
3184 '8', '9', ':', ';', '<', '=', '>', '?',
3185 '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
3186 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
3187 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
3188 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
3189 '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
3190 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
3191 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
3192 'x', 'y', 'z', '{', '|', '}', '~'
3195 code
= code
< sizeof table
? table
[code
] : -1;
3203 /*----------------------------------------------------------------.
3204 | Handle `#line INT "FILE"'. ARGS has already skipped `#line '. |
3205 `----------------------------------------------------------------*/
3208 handle_syncline (char *args
, location_t
*location
)
3210 int lineno
= strtol (args
, &args
, 10);
3211 const char *file
= NULL
;
3212 file
= strchr (args
, '"') + 1;
3213 *strchr (file
, '"') = 0;
3214 /* FIXME: Leaking... Can't free, as some locations are still
3215 pointing to the old file name. */
3216 infile
= xstrdup (file
);
3217 location
->file
= infile
;
3218 location
->last_line
= lineno
;
3221 /*-------------------------.
3222 | Initialize the scanner. |
3223 `-------------------------*/
3226 scanner_initialize (void)
3228 obstack_init (&string_obstack
);
3232 /*-----------------------------------------------.
3233 | Free all the memory allocated to the scanner. |
3234 `-----------------------------------------------*/
3239 obstack_free (&string_obstack
, 0);
3240 /* Reclaim Flex's buffers. */
3241 yy_delete_buffer (YY_CURRENT_BUFFER
);