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 218, 219, 220, 221, 222, 223, 224, 225, 226, 227,
738 228, 229, 230, 231, 232, 233, 234, 235, 236, 237,
739 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
740 248, 249, 250, 251, 253, 258, 260, 261, 262, 263,
741 264, 266, 268, 274, 288, 291, 294, 295, 298, 301,
742 304, 312, 318, 333, 334, 344, 349, 364, 365, 380,
743 381, 393, 403, 422, 438, 457, 469, 483, 484, 485,
744 486, 487, 488, 489, 490, 491, 502, 508, 519, 525,
745 526, 527, 529, 546, 552, 553, 554, 556, 573, 576,
746 579, 580, 583, 594, 595, 596, 609, 611, 616, 635,
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);
892 /* STRING_OBSTACK -- Used to store all the characters that we need to
893 keep (to construct ID, STRINGS etc.). Use the following macros to
896 Use YY_OBS_GROW to append what has just been matched, and
897 YY_OBS_FINISH to end the string (it puts the ending 0).
898 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
899 used, and which is used by YY_OBS_FREE to free the last string. */
901 static struct obstack string_obstack
;
904 #define YY_OBS_GROW \
905 obstack_grow (&string_obstack, yytext, yyleng)
907 #define YY_OBS_FINISH \
909 obstack_1grow (&string_obstack, '\0'); \
910 last_string = obstack_finish (&string_obstack); \
913 #define YY_OBS_FREE \
915 obstack_free (&string_obstack, last_string); \
919 scanner_last_string_free (void)
925 static int percent_percent_count
= 0;
927 /* Within well-formed rules, RULE_LENGTH is the number of values in
928 the current rule so far, which says where to find `$0' with respect
929 to the top of the stack. It is not the same as the rule->length in
930 the case of mid rule actions.
932 Outside of well-formed rules, RULE_LENGTH has an undefined value. */
933 static int rule_length
;
935 static void handle_dollar (braced_code_t code_kind
,
936 char *cp
, location_t location
);
937 static void handle_at (braced_code_t code_kind
,
938 char *cp
, location_t location
);
939 static void handle_syncline (char *args
, location_t
*location
);
940 static int convert_ucn_to_byte (char const *hex_text
);
943 #define SC_LINE_COMMENT 2
944 #define SC_YACC_COMMENT 3
947 #define SC_CHARACTER 5
949 #define SC_ESCAPED_STRING 6
950 #define SC_ESCAPED_CHARACTER 7
952 #define SC_BRACED_CODE 8
953 #define SC_PROLOGUE 9
954 #define SC_EPILOGUE 10
956 /* POSIX says that a tag must be both an id and a C union member, but
957 historically almost any character is allowed in a tag. We disallow
958 NUL and newline, as this simplifies our implementation. */
959 /* Zero or more instances of backslash-newline. Following GCC, allow
960 white space between the backslash and the newline. */
961 #line 962 "scan-gram.c"
963 /* Macros after this point can all be overridden by user definitions in
967 #ifndef YY_SKIP_YYWRAP
969 extern "C" int yywrap
YY_PROTO(( void ));
971 extern int yywrap
YY_PROTO(( void ));
976 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
980 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
983 #ifdef YY_NEED_STRLEN
984 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
989 static int yyinput
YY_PROTO(( void ));
991 static int input
YY_PROTO(( void ));
996 static int yy_start_stack_ptr
= 0;
997 static int yy_start_stack_depth
= 0;
998 static int *yy_start_stack
= 0;
999 #ifndef YY_NO_PUSH_STATE
1000 static void yy_push_state
YY_PROTO(( int new_state
));
1002 #ifndef YY_NO_POP_STATE
1003 static void yy_pop_state
YY_PROTO(( void ));
1005 #ifndef YY_NO_TOP_STATE
1006 static int yy_top_state
YY_PROTO(( void ));
1010 #define YY_NO_PUSH_STATE 1
1011 #define YY_NO_POP_STATE 1
1012 #define YY_NO_TOP_STATE 1
1015 #ifdef YY_MALLOC_DECL
1023 /* Just try to get by without declaring the routines. This will fail
1024 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
1025 * or sizeof(void*) != sizeof(int).
1030 /* Amount of stuff to slurp up with each read. */
1031 #ifndef YY_READ_BUF_SIZE
1032 #define YY_READ_BUF_SIZE 8192
1035 /* Copy whatever the last rule matched to the standard output. */
1038 /* This used to be an fputs(), but since the string might contain NUL's,
1039 * we now use fwrite().
1041 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1044 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1045 * is returned in "result".
1048 #define YY_INPUT(buf,result,max_size) \
1049 if ( yy_current_buffer->yy_is_interactive ) \
1052 for ( n = 0; n < max_size && \
1053 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1054 buf[n] = (char) c; \
1056 buf[n++] = (char) c; \
1057 if ( c == EOF && ferror( yyin ) ) \
1058 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1064 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1066 if( errno != EINTR) \
1068 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1077 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1078 * we don't want an extra ';' after the "return" because that will cause
1079 * some compilers to complain about unreachable statements.
1082 #define yyterminate() return YY_NULL
1085 /* Number of entries by which start-condition stack grows. */
1086 #ifndef YY_START_STACK_INCR
1087 #define YY_START_STACK_INCR 25
1090 /* Report a fatal error. */
1091 #ifndef YY_FATAL_ERROR
1092 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1095 /* Default declaration of generated scanner - a define so the user can
1096 * easily add parameters.
1099 #define YY_DECL int yylex YY_PROTO(( void ))
1102 /* Code executed at the beginning of each rule, after yytext and yyleng
1105 #ifndef YY_USER_ACTION
1106 #define YY_USER_ACTION
1109 /* Code executed at the end of each rule. */
1111 #define YY_BREAK break;
1114 #define YY_RULE_SETUP \
1116 yy_current_buffer->yy_at_bol = \
1117 (yytext[yyleng - 1] == '\n'); \
1122 register yy_state_type yy_current_state
;
1123 register char *yy_cp
, *yy_bp
;
1124 register int yy_act
;
1126 #line 203 "scan-gram.l"
1129 int braces_level
IF_LINT (= 0);
1131 /* At each yylex invocation, mark the current position as the
1132 start of the next token. */
1137 /*----------------------------.
1138 | Scanning Bison directives. |
1139 `----------------------------*/
1140 #line 1141 "scan-gram.c"
1151 yy_start
= 1; /* first start state */
1159 if ( ! yy_current_buffer
)
1161 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1163 yy_load_buffer_state();
1166 while ( 1 ) /* loops until end-of-file is reached */
1170 /* Support of yytext. */
1171 *yy_cp
= yy_hold_char
;
1173 /* yy_bp points to the position in yy_ch_buf of the start of
1178 yy_current_state
= yy_start
;
1179 yy_current_state
+= YY_AT_BOL();
1183 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1184 if ( yy_accept
[yy_current_state
] )
1186 yy_last_accepting_state
= yy_current_state
;
1187 yy_last_accepting_cpos
= yy_cp
;
1189 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1191 yy_current_state
= (int) yy_def
[yy_current_state
];
1192 if ( yy_current_state
>= 411 )
1193 yy_c
= yy_meta
[(unsigned int) yy_c
];
1195 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1198 while ( yy_base
[yy_current_state
] != 903 );
1201 yy_act
= yy_accept
[yy_current_state
];
1203 { /* have to back up */
1204 yy_cp
= yy_last_accepting_cpos
;
1205 yy_current_state
= yy_last_accepting_state
;
1206 yy_act
= yy_accept
[yy_current_state
];
1209 YY_DO_BEFORE_ACTION
;
1212 do_action
: /* This label is used only to access EOF actions. */
1214 if ( yy_flex_debug
)
1217 fprintf( stderr
, "--scanner backing up\n" );
1218 else if ( yy_act
< 104 )
1219 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1220 yy_rule_linenum
[yy_act
], yytext
);
1221 else if ( yy_act
== 104 )
1222 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1224 else if ( yy_act
== 105 )
1225 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1227 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1231 { /* beginning of action switch */
1232 case 0: /* must back up */
1233 /* undo the effects of YY_DO_BEFORE_ACTION */
1234 *yy_cp
= yy_hold_char
;
1235 yy_cp
= yy_last_accepting_cpos
;
1236 yy_current_state
= yy_last_accepting_state
;
1237 goto yy_find_action
;
1243 #line 218 "scan-gram.l"
1244 return PERCENT_NONASSOC
;
1248 #line 219 "scan-gram.l"
1249 return PERCENT_DEBUG
;
1253 #line 220 "scan-gram.l"
1254 return PERCENT_DEFINE
;
1258 #line 221 "scan-gram.l"
1259 return PERCENT_DEFINES
;
1263 #line 222 "scan-gram.l"
1264 return PERCENT_DESTRUCTOR
;
1268 #line 223 "scan-gram.l"
1269 return PERCENT_DPREC
;
1273 #line 224 "scan-gram.l"
1274 return PERCENT_ERROR_VERBOSE
;
1278 #line 225 "scan-gram.l"
1279 return PERCENT_EXPECT
;
1283 #line 226 "scan-gram.l"
1284 return PERCENT_FILE_PREFIX
;
1288 #line 227 "scan-gram.l"
1289 return PERCENT_YACC
;
1293 #line 228 "scan-gram.l"
1294 return PERCENT_GLR_PARSER
;
1298 #line 229 "scan-gram.l"
1299 return PERCENT_LEFT
;
1303 #line 230 "scan-gram.l"
1304 return PERCENT_LOCATIONS
;
1308 #line 231 "scan-gram.l"
1309 return PERCENT_MERGE
;
1313 #line 232 "scan-gram.l"
1314 return PERCENT_NAME_PREFIX
;
1318 #line 233 "scan-gram.l"
1319 return PERCENT_NO_LINES
;
1323 #line 234 "scan-gram.l"
1324 return PERCENT_NONASSOC
;
1328 #line 235 "scan-gram.l"
1329 return PERCENT_NTERM
;
1333 #line 236 "scan-gram.l"
1334 return PERCENT_OUTPUT
;
1338 #line 237 "scan-gram.l"
1339 return PERCENT_PARSE_PARAM
;
1343 #line 238 "scan-gram.l"
1344 rule_length
--; return PERCENT_PREC
;
1348 #line 239 "scan-gram.l"
1349 return PERCENT_PRINTER
;
1353 #line 240 "scan-gram.l"
1354 return PERCENT_PURE_PARSER
;
1358 #line 241 "scan-gram.l"
1359 return PERCENT_RIGHT
;
1363 #line 242 "scan-gram.l"
1364 return PERCENT_LEX_PARAM
;
1368 #line 243 "scan-gram.l"
1369 return PERCENT_SKELETON
;
1373 #line 244 "scan-gram.l"
1374 return PERCENT_START
;
1378 #line 245 "scan-gram.l"
1379 return PERCENT_TOKEN
;
1383 #line 246 "scan-gram.l"
1384 return PERCENT_TOKEN
;
1388 #line 247 "scan-gram.l"
1389 return PERCENT_TOKEN_TABLE
;
1393 #line 248 "scan-gram.l"
1394 return PERCENT_TYPE
;
1398 #line 249 "scan-gram.l"
1399 return PERCENT_UNION
;
1403 #line 250 "scan-gram.l"
1404 return PERCENT_VERBOSE
;
1408 #line 251 "scan-gram.l"
1409 return PERCENT_YACC
;
1413 #line 253 "scan-gram.l"
1415 complain_at (*yylloc
, _("invalid directive: %s"), quote (yytext
));
1421 #line 258 "scan-gram.l"
1422 handle_syncline (yytext
+ strlen ("#line "), yylloc
); YY_STEP
;
1426 #line 260 "scan-gram.l"
1431 #line 261 "scan-gram.l"
1432 rule_length
= 0; return COLON
;
1436 #line 262 "scan-gram.l"
1437 rule_length
= 0; return PIPE
;
1441 #line 263 "scan-gram.l"
1446 #line 264 "scan-gram.l"
1451 #line 266 "scan-gram.l"
1456 #line 268 "scan-gram.l"
1458 yylval
->symbol
= symbol_get (yytext
, *yylloc
);
1465 #line 274 "scan-gram.l"
1469 num
= strtoul (yytext
, 0, 10);
1470 if (INT_MAX
< num
|| errno
)
1472 complain_at (*yylloc
, _("integer out of range: %s"), quote (yytext
));
1475 yylval
->integer
= num
;
1479 /* Characters. We don't check there is only one. */
1482 #line 288 "scan-gram.l"
1483 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1488 #line 291 "scan-gram.l"
1489 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1494 #line 294 "scan-gram.l"
1495 BEGIN SC_YACC_COMMENT
;
1499 #line 295 "scan-gram.l"
1505 #line 298 "scan-gram.l"
1506 yy_push_state (SC_PROLOGUE
);
1508 /* Code in between braces. */
1511 #line 301 "scan-gram.l"
1512 YY_OBS_GROW
; braces_level
= 0; yy_push_state (SC_BRACED_CODE
);
1517 #line 304 "scan-gram.l"
1519 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1521 yylval
->string
= last_string
;
1527 #line 312 "scan-gram.l"
1529 if (++percent_percent_count
== 2)
1530 yy_push_state (SC_EPILOGUE
);
1531 return PERCENT_PERCENT
;
1536 #line 318 "scan-gram.l"
1538 complain_at (*yylloc
, _("invalid character: %s"), quote (yytext
));
1543 /*-------------------------------------------------------------------.
1544 | Whatever the start condition (but those which correspond to |
1545 | entities `swallowed' by Bison: SC_YACC_COMMENT, SC_ESCAPED_STRING, |
1546 | and SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1547 `-------------------------------------------------------------------*/
1552 #line 333 "scan-gram.l"
1553 obstack_sgrow (&string_obstack
, "@<:@");
1557 #line 334 "scan-gram.l"
1558 obstack_sgrow (&string_obstack
, "@:>@");
1561 /*---------------------------------------------------------------.
1562 | Scanning a Yacc comment. The initial `/ *' is already eaten. |
1563 `---------------------------------------------------------------*/
1568 #line 344 "scan-gram.l"
1576 #line 349 "scan-gram.l"
1579 case YY_STATE_EOF(SC_YACC_COMMENT
):
1580 #line 351 "scan-gram.l"
1582 complain_at (*yylloc
, _("unexpected end of file in a comment"));
1587 /*------------------------------------------------------------.
1588 | Scanning a C comment. The initial `/ *' is already eaten. |
1589 `------------------------------------------------------------*/
1594 #line 364 "scan-gram.l"
1595 YY_OBS_GROW
; yy_pop_state ();
1599 #line 365 "scan-gram.l"
1602 case YY_STATE_EOF(SC_COMMENT
):
1603 #line 367 "scan-gram.l"
1605 complain_at (*yylloc
, _("unexpected end of file in a comment"));
1610 /*--------------------------------------------------------------.
1611 | Scanning a line comment. The initial `//' is already eaten. |
1612 `--------------------------------------------------------------*/
1617 #line 380 "scan-gram.l"
1618 YY_OBS_GROW
; yy_pop_state ();
1622 #line 381 "scan-gram.l"
1625 case YY_STATE_EOF(SC_LINE_COMMENT
):
1626 #line 382 "scan-gram.l"
1630 /*----------------------------------------------------------------.
1631 | Scanning a C string, including its escapes. The initial `"' is |
1633 `----------------------------------------------------------------*/
1638 #line 393 "scan-gram.l"
1640 assert (yy_top_state () == INITIAL
);
1643 yylval
->string
= last_string
;
1651 #line 403 "scan-gram.l"
1654 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1655 #line 405 "scan-gram.l"
1657 complain_at (*yylloc
, _("unexpected end of file in a string"));
1658 assert (yy_top_state () == INITIAL
);
1660 yylval
->string
= last_string
;
1666 /*---------------------------------------------------------------.
1667 | Scanning a C character, decoding its escapes. The initial "'" |
1668 | is already eaten. |
1669 `---------------------------------------------------------------*/
1674 #line 422 "scan-gram.l"
1677 assert (yy_top_state () == INITIAL
);
1680 yylval
->symbol
= symbol_get (last_string
, *yylloc
);
1681 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1682 symbol_user_token_number_set (yylval
->symbol
,
1683 (unsigned char) last_string
[1], *yylloc
);
1693 #line 438 "scan-gram.l"
1696 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1697 #line 440 "scan-gram.l"
1699 complain_at (*yylloc
, _("unexpected end of file in a character literal"));
1700 assert (yy_top_state () == INITIAL
);
1702 yylval
->string
= last_string
;
1708 /*----------------------------.
1709 | Decode escaped characters. |
1710 `----------------------------*/
1715 #line 457 "scan-gram.l"
1717 unsigned long c
= strtoul (yytext
+ 1, 0, 8);
1720 complain_at (*yylloc
, _("invalid escape sequence: %s"),
1725 obstack_1grow (&string_obstack
, c
);
1730 #line 469 "scan-gram.l"
1734 c
= strtoul (yytext
+ 2, 0, 16);
1735 if (UCHAR_MAX
< c
|| errno
)
1737 complain_at (*yylloc
, _("invalid escape sequence: %s"),
1742 obstack_1grow (&string_obstack
, c
);
1747 #line 483 "scan-gram.l"
1748 obstack_1grow (&string_obstack
, '\a');
1752 #line 484 "scan-gram.l"
1753 obstack_1grow (&string_obstack
, '\b');
1757 #line 485 "scan-gram.l"
1758 obstack_1grow (&string_obstack
, '\f');
1762 #line 486 "scan-gram.l"
1763 obstack_1grow (&string_obstack
, '\n');
1767 #line 487 "scan-gram.l"
1768 obstack_1grow (&string_obstack
, '\r');
1772 #line 488 "scan-gram.l"
1773 obstack_1grow (&string_obstack
, '\t');
1777 #line 489 "scan-gram.l"
1778 obstack_1grow (&string_obstack
, '\v');
1782 #line 490 "scan-gram.l"
1783 obstack_1grow (&string_obstack
, yytext
[1]);
1787 #line 491 "scan-gram.l"
1789 int c
= convert_ucn_to_byte (yytext
);
1792 complain_at (*yylloc
, _("invalid escape sequence: %s"),
1797 obstack_1grow (&string_obstack
, c
);
1802 #line 502 "scan-gram.l"
1804 complain_at (*yylloc
, _("unrecognized escape sequence: %s"),
1809 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1812 #line 508 "scan-gram.l"
1816 /*----------------------------------------------------------.
1817 | Scanning a C character without decoding its escapes. The |
1818 | initial "'" is already eaten. |
1819 `----------------------------------------------------------*/
1824 #line 519 "scan-gram.l"
1827 assert (yy_top_state () != INITIAL
);
1833 #line 525 "scan-gram.l"
1838 #line 526 "scan-gram.l"
1843 #line 527 "scan-gram.l"
1846 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1849 #line 529 "scan-gram.l"
1852 case YY_STATE_EOF(SC_CHARACTER
):
1853 #line 531 "scan-gram.l"
1855 complain_at (*yylloc
, _("unexpected end of file in a character literal"));
1856 assert (yy_top_state () != INITIAL
);
1861 /*----------------------------------------------------------------.
1862 | Scanning a C string, without decoding its escapes. The initial |
1863 | `"' is already eaten. |
1864 `----------------------------------------------------------------*/
1869 #line 546 "scan-gram.l"
1871 assert (yy_top_state () != INITIAL
);
1878 #line 552 "scan-gram.l"
1883 #line 553 "scan-gram.l"
1888 #line 554 "scan-gram.l"
1891 /* Needed for `\<<EOF>>', `\\<<newline>>[', and `\\<<newline>>]'. */
1894 #line 556 "scan-gram.l"
1897 case YY_STATE_EOF(SC_STRING
):
1898 #line 558 "scan-gram.l"
1900 complain_at (*yylloc
, _("unexpected end of file in a string"));
1901 assert (yy_top_state () != INITIAL
);
1906 /*---------------------------------------------------.
1907 | Strings, comments etc. can be found in user code. |
1908 `---------------------------------------------------*/
1911 /* Characters. We don't check there is only one. */
1914 #line 573 "scan-gram.l"
1915 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1920 #line 576 "scan-gram.l"
1921 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1926 #line 579 "scan-gram.l"
1927 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1931 #line 580 "scan-gram.l"
1932 YY_OBS_GROW
; yy_push_state (SC_LINE_COMMENT
);
1937 #line 583 "scan-gram.l"
1941 /*---------------------------------------------------------------.
1942 | Scanning some code in braces (%union and actions). The initial |
1943 | "{" is already eaten. |
1944 `---------------------------------------------------------------*/
1949 #line 594 "scan-gram.l"
1950 YY_OBS_GROW
; braces_level
++;
1954 #line 595 "scan-gram.l"
1955 YY_OBS_GROW
; braces_level
--;
1959 #line 596 "scan-gram.l"
1963 if (braces_level
< 0)
1967 yylval
->string
= last_string
;
1975 #line 609 "scan-gram.l"
1976 { handle_dollar (current_braced_code
,
1981 #line 611 "scan-gram.l"
1982 { handle_at (current_braced_code
,
1985 /* `"<"{splice}"<"' tokenizes `<<%' correctly (as `<<' `%') rather
1986 than incorrrectly (as `<' `<%'). */
1989 #line 616 "scan-gram.l"
1992 case YY_STATE_EOF(SC_BRACED_CODE
):
1993 #line 618 "scan-gram.l"
1995 complain_at (*yylloc
, _("unexpected end of file in `{ ... }'"));
1998 yylval
->string
= last_string
;
2003 /*--------------------------------------------------------------.
2004 | Scanning some prologue: from "%{" (already scanned) to "%}". |
2005 `--------------------------------------------------------------*/
2010 #line 635 "scan-gram.l"
2014 yylval
->string
= last_string
;
2020 #line 642 "scan-gram.l"
2025 #line 643 "scan-gram.l"
2028 case YY_STATE_EOF(SC_PROLOGUE
):
2029 #line 645 "scan-gram.l"
2031 complain_at (*yylloc
, _("unexpected end of file in `%%{ ... %%}'"));
2034 yylval
->string
= last_string
;
2039 /*---------------------------------------------------------------.
2040 | Scanning the epilogue (everything after the second "%%", which |
2041 | has already been eaten). |
2042 `---------------------------------------------------------------*/
2047 #line 662 "scan-gram.l"
2050 case YY_STATE_EOF(SC_EPILOGUE
):
2051 #line 664 "scan-gram.l"
2055 yylval
->string
= last_string
;
2062 #line 673 "scan-gram.l"
2063 YY_FATAL_ERROR( "flex scanner jammed" );
2065 #line 2066 "scan-gram.c"
2066 case YY_STATE_EOF(INITIAL
):
2069 case YY_END_OF_BUFFER
:
2071 /* Amount of text matched not including the EOB char. */
2072 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
2074 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2075 *yy_cp
= yy_hold_char
;
2076 YY_RESTORE_YY_MORE_OFFSET
2078 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
2080 /* We're scanning a new file or input source. It's
2081 * possible that this happened because the user
2082 * just pointed yyin at a new source and called
2083 * yylex(). If so, then we have to assure
2084 * consistency between yy_current_buffer and our
2085 * globals. Here is the right place to do so, because
2086 * this is the first action (other than possibly a
2087 * back-up) that will match for the new input source.
2089 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2090 yy_current_buffer
->yy_input_file
= yyin
;
2091 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
2094 /* Note that here we test for yy_c_buf_p "<=" to the position
2095 * of the first EOB in the buffer, since yy_c_buf_p will
2096 * already have been incremented past the NUL character
2097 * (since all states make transitions on EOB to the
2098 * end-of-buffer state). Contrast this with the test
2101 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2102 { /* This was really a NUL. */
2103 yy_state_type yy_next_state
;
2105 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
2107 yy_current_state
= yy_get_previous_state();
2109 /* Okay, we're now positioned to make the NUL
2110 * transition. We couldn't have
2111 * yy_get_previous_state() go ahead and do it
2112 * for us because it doesn't know how to deal
2113 * with the possibility of jamming (and we don't
2114 * want to build jamming into it because then it
2115 * will run more slowly).
2118 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
2120 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2122 if ( yy_next_state
)
2124 /* Consume the NUL. */
2125 yy_cp
= ++yy_c_buf_p
;
2126 yy_current_state
= yy_next_state
;
2133 goto yy_find_action
;
2137 else switch ( yy_get_next_buffer() )
2139 case EOB_ACT_END_OF_FILE
:
2141 yy_did_buffer_switch_on_eof
= 0;
2145 /* Note: because we've taken care in
2146 * yy_get_next_buffer() to have set up
2147 * yytext, we can now set up
2148 * yy_c_buf_p so that if some total
2149 * hoser (like flex itself) wants to
2150 * call the scanner after we return the
2151 * YY_NULL, it'll still work - another
2152 * YY_NULL will get returned.
2154 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
2156 yy_act
= YY_STATE_EOF(YY_START
);
2162 if ( ! yy_did_buffer_switch_on_eof
)
2168 case EOB_ACT_CONTINUE_SCAN
:
2170 yytext_ptr
+ yy_amount_of_matched_text
;
2172 yy_current_state
= yy_get_previous_state();
2175 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2178 case EOB_ACT_LAST_MATCH
:
2180 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
2182 yy_current_state
= yy_get_previous_state();
2185 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2186 goto yy_find_action
;
2193 "fatal flex scanner internal error--no action found" );
2194 } /* end of action switch */
2195 } /* end of scanning one token */
2196 } /* end of yylex */
2199 /* yy_get_next_buffer - try to read in a new buffer
2201 * Returns a code representing an action:
2202 * EOB_ACT_LAST_MATCH -
2203 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2204 * EOB_ACT_END_OF_FILE - end of file
2207 static int yy_get_next_buffer()
2209 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2210 register char *source
= yytext_ptr
;
2211 register int number_to_move
, i
;
2214 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2216 "fatal flex scanner internal error--end of buffer missed" );
2218 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2219 { /* Don't try to fill the buffer, so this is an EOF. */
2220 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2222 /* We matched a single character, the EOB, so
2223 * treat this as a final EOF.
2225 return EOB_ACT_END_OF_FILE
;
2230 /* We matched some text prior to the EOB, first
2233 return EOB_ACT_LAST_MATCH
;
2237 /* Try to read more data. */
2239 /* First move last chars to start of buffer. */
2240 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2242 for ( i
= 0; i
< number_to_move
; ++i
)
2243 *(dest
++) = *(source
++);
2245 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2246 /* don't do the read, it's not guaranteed to return an EOF,
2249 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2254 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2256 while ( num_to_read
<= 0 )
2257 { /* Not enough room in the buffer - grow it. */
2258 #ifdef YY_USES_REJECT
2260 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2263 /* just a shorter name for the current buffer */
2264 YY_BUFFER_STATE b
= yy_current_buffer
;
2266 int yy_c_buf_p_offset
=
2267 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2269 if ( b
->yy_is_our_buffer
)
2271 int new_size
= b
->yy_buf_size
* 2;
2273 if ( new_size
<= 0 )
2274 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2276 b
->yy_buf_size
*= 2;
2278 b
->yy_ch_buf
= (char *)
2279 /* Include room in for 2 EOB chars. */
2280 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2281 b
->yy_buf_size
+ 2 );
2284 /* Can't grow it, we don't own it. */
2287 if ( ! b
->yy_ch_buf
)
2289 "fatal error - scanner input buffer overflow" );
2291 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2293 num_to_read
= yy_current_buffer
->yy_buf_size
-
2298 if ( num_to_read
> YY_READ_BUF_SIZE
)
2299 num_to_read
= YY_READ_BUF_SIZE
;
2301 /* Read in more data. */
2302 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2303 yy_n_chars
, num_to_read
);
2305 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2308 if ( yy_n_chars
== 0 )
2310 if ( number_to_move
== YY_MORE_ADJ
)
2312 ret_val
= EOB_ACT_END_OF_FILE
;
2318 ret_val
= EOB_ACT_LAST_MATCH
;
2319 yy_current_buffer
->yy_buffer_status
=
2320 YY_BUFFER_EOF_PENDING
;
2325 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2327 yy_n_chars
+= number_to_move
;
2328 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2329 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2331 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2337 /* yy_get_previous_state - get the state just before the EOB char was reached */
2339 static yy_state_type
yy_get_previous_state()
2341 register yy_state_type yy_current_state
;
2342 register char *yy_cp
;
2344 yy_current_state
= yy_start
;
2345 yy_current_state
+= YY_AT_BOL();
2347 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2349 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 55);
2350 if ( yy_accept
[yy_current_state
] )
2352 yy_last_accepting_state
= yy_current_state
;
2353 yy_last_accepting_cpos
= yy_cp
;
2355 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2357 yy_current_state
= (int) yy_def
[yy_current_state
];
2358 if ( yy_current_state
>= 411 )
2359 yy_c
= yy_meta
[(unsigned int) yy_c
];
2361 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2364 return yy_current_state
;
2368 /* yy_try_NUL_trans - try to make a transition on the NUL character
2371 * next_state = yy_try_NUL_trans( current_state );
2374 #ifdef YY_USE_PROTOS
2375 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2377 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2378 yy_state_type yy_current_state
;
2381 register int yy_is_jam
;
2382 register char *yy_cp
= yy_c_buf_p
;
2384 register YY_CHAR yy_c
= 55;
2385 if ( yy_accept
[yy_current_state
] )
2387 yy_last_accepting_state
= yy_current_state
;
2388 yy_last_accepting_cpos
= yy_cp
;
2390 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2392 yy_current_state
= (int) yy_def
[yy_current_state
];
2393 if ( yy_current_state
>= 411 )
2394 yy_c
= yy_meta
[(unsigned int) yy_c
];
2396 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2397 yy_is_jam
= (yy_current_state
== 410);
2399 return yy_is_jam
? 0 : yy_current_state
;
2404 #ifdef YY_USE_PROTOS
2405 static void yyunput( int c
, register char *yy_bp
)
2407 static void yyunput( c
, yy_bp
)
2409 register char *yy_bp
;
2412 register char *yy_cp
= yy_c_buf_p
;
2414 /* undo effects of setting up yytext */
2415 *yy_cp
= yy_hold_char
;
2417 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2418 { /* need to shift things up to make room */
2419 /* +2 for EOB chars. */
2420 register int number_to_move
= yy_n_chars
+ 2;
2421 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2422 yy_current_buffer
->yy_buf_size
+ 2];
2423 register char *source
=
2424 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2426 while ( source
> yy_current_buffer
->yy_ch_buf
)
2427 *--dest
= *--source
;
2429 yy_cp
+= (int) (dest
- source
);
2430 yy_bp
+= (int) (dest
- source
);
2431 yy_current_buffer
->yy_n_chars
=
2432 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2434 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2435 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2438 *--yy_cp
= (char) c
;
2442 yy_hold_char
= *yy_cp
;
2445 #endif /* ifndef YY_NO_UNPUT */
2449 static int yyinput()
2456 *yy_c_buf_p
= yy_hold_char
;
2458 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2460 /* yy_c_buf_p now points to the character we want to return.
2461 * If this occurs *before* the EOB characters, then it's a
2462 * valid NUL; if not, then we've hit the end of the buffer.
2464 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2465 /* This was really a NUL. */
2469 { /* need more input */
2470 int offset
= yy_c_buf_p
- yytext_ptr
;
2473 switch ( yy_get_next_buffer() )
2475 case EOB_ACT_LAST_MATCH
:
2476 /* This happens because yy_g_n_b()
2477 * sees that we've accumulated a
2478 * token and flags that we need to
2479 * try matching the token before
2480 * proceeding. But for input(),
2481 * there's no matching to consider.
2482 * So convert the EOB_ACT_LAST_MATCH
2483 * to EOB_ACT_END_OF_FILE.
2486 /* Reset buffer status. */
2491 case EOB_ACT_END_OF_FILE
:
2496 if ( ! yy_did_buffer_switch_on_eof
)
2505 case EOB_ACT_CONTINUE_SCAN
:
2506 yy_c_buf_p
= yytext_ptr
+ offset
;
2512 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2513 *yy_c_buf_p
= '\0'; /* preserve yytext */
2514 yy_hold_char
= *++yy_c_buf_p
;
2516 yy_current_buffer
->yy_at_bol
= (c
== '\n');
2522 #ifdef YY_USE_PROTOS
2523 void yyrestart( FILE *input_file
)
2525 void yyrestart( input_file
)
2529 if ( ! yy_current_buffer
)
2530 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2532 yy_init_buffer( yy_current_buffer
, input_file
);
2533 yy_load_buffer_state();
2537 #ifdef YY_USE_PROTOS
2538 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2540 void yy_switch_to_buffer( new_buffer
)
2541 YY_BUFFER_STATE new_buffer
;
2544 if ( yy_current_buffer
== new_buffer
)
2547 if ( yy_current_buffer
)
2549 /* Flush out information for old buffer. */
2550 *yy_c_buf_p
= yy_hold_char
;
2551 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2552 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2555 yy_current_buffer
= new_buffer
;
2556 yy_load_buffer_state();
2558 /* We don't actually know whether we did this switch during
2559 * EOF (yywrap()) processing, but the only time this flag
2560 * is looked at is after yywrap() is called, so it's safe
2561 * to go ahead and always set it.
2563 yy_did_buffer_switch_on_eof
= 1;
2567 #ifdef YY_USE_PROTOS
2568 void yy_load_buffer_state( void )
2570 void yy_load_buffer_state()
2573 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2574 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2575 yyin
= yy_current_buffer
->yy_input_file
;
2576 yy_hold_char
= *yy_c_buf_p
;
2580 #ifdef YY_USE_PROTOS
2581 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2583 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2590 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2592 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2594 b
->yy_buf_size
= size
;
2596 /* yy_ch_buf has to be 2 characters longer than the size given because
2597 * we need to put in 2 end-of-buffer characters.
2599 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2600 if ( ! b
->yy_ch_buf
)
2601 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2603 b
->yy_is_our_buffer
= 1;
2605 yy_init_buffer( b
, file
);
2611 #ifdef YY_USE_PROTOS
2612 void yy_delete_buffer( YY_BUFFER_STATE b
)
2614 void yy_delete_buffer( b
)
2621 if ( b
== yy_current_buffer
)
2622 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2624 if ( b
->yy_is_our_buffer
)
2625 yy_flex_free( (void *) b
->yy_ch_buf
);
2627 yy_flex_free( (void *) b
);
2634 #ifndef YY_ALWAYS_INTERACTIVE
2635 #ifndef YY_NEVER_INTERACTIVE
2636 extern int isatty
YY_PROTO(( int ));
2641 #ifdef YY_USE_PROTOS
2642 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2644 void yy_init_buffer( b
, file
)
2651 yy_flush_buffer( b
);
2653 b
->yy_input_file
= file
;
2654 b
->yy_fill_buffer
= 1;
2656 #if YY_ALWAYS_INTERACTIVE
2657 b
->yy_is_interactive
= 1;
2659 #if YY_NEVER_INTERACTIVE
2660 b
->yy_is_interactive
= 0;
2662 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2668 #ifdef YY_USE_PROTOS
2669 void yy_flush_buffer( YY_BUFFER_STATE b
)
2671 void yy_flush_buffer( b
)
2681 /* We always need two end-of-buffer characters. The first causes
2682 * a transition to the end-of-buffer state. The second causes
2683 * a jam in that state.
2685 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2686 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2688 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2691 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2693 if ( b
== yy_current_buffer
)
2694 yy_load_buffer_state();
2698 #ifndef YY_NO_SCAN_BUFFER
2699 #ifdef YY_USE_PROTOS
2700 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2702 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2710 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2711 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2712 /* They forgot to leave room for the EOB's. */
2715 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2717 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2719 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2720 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2721 b
->yy_is_our_buffer
= 0;
2722 b
->yy_input_file
= 0;
2723 b
->yy_n_chars
= b
->yy_buf_size
;
2724 b
->yy_is_interactive
= 0;
2726 b
->yy_fill_buffer
= 0;
2727 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2729 yy_switch_to_buffer( b
);
2736 #ifndef YY_NO_SCAN_STRING
2737 #ifdef YY_USE_PROTOS
2738 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2740 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2741 yyconst
char *yy_str
;
2745 for ( len
= 0; yy_str
[len
]; ++len
)
2748 return yy_scan_bytes( yy_str
, len
);
2753 #ifndef YY_NO_SCAN_BYTES
2754 #ifdef YY_USE_PROTOS
2755 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2757 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2758 yyconst
char *bytes
;
2767 /* Get memory for full buffer, including space for trailing EOB's. */
2769 buf
= (char *) yy_flex_alloc( n
);
2771 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2773 for ( i
= 0; i
< len
; ++i
)
2776 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2778 b
= yy_scan_buffer( buf
, n
);
2780 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2782 /* It's okay to grow etc. this buffer, and we should throw it
2783 * away when we're done.
2785 b
->yy_is_our_buffer
= 1;
2792 #ifndef YY_NO_PUSH_STATE
2793 #ifdef YY_USE_PROTOS
2794 static void yy_push_state( int new_state
)
2796 static void yy_push_state( new_state
)
2800 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2804 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2805 new_size
= yy_start_stack_depth
* sizeof( int );
2807 if ( ! yy_start_stack
)
2808 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2811 yy_start_stack
= (int *) yy_flex_realloc(
2812 (void *) yy_start_stack
, new_size
);
2814 if ( ! yy_start_stack
)
2816 "out of memory expanding start-condition stack" );
2819 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2826 #ifndef YY_NO_POP_STATE
2827 static void yy_pop_state()
2829 if ( --yy_start_stack_ptr
< 0 )
2830 YY_FATAL_ERROR( "start-condition stack underflow" );
2832 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2837 #ifndef YY_NO_TOP_STATE
2838 static int yy_top_state()
2840 return yy_start_stack
[yy_start_stack_ptr
- 1];
2844 #ifndef YY_EXIT_FAILURE
2845 #define YY_EXIT_FAILURE 2
2848 #ifdef YY_USE_PROTOS
2849 static void yy_fatal_error( yyconst
char msg
[] )
2851 static void yy_fatal_error( msg
)
2855 (void) fprintf( stderr
, "%s\n", msg
);
2856 exit( YY_EXIT_FAILURE
);
2861 /* Redefine yyless() so it works in section 3 code. */
2867 /* Undo effects of setting up yytext. */ \
2868 yytext[yyleng] = yy_hold_char; \
2869 yy_c_buf_p = yytext + n; \
2870 yy_hold_char = *yy_c_buf_p; \
2871 *yy_c_buf_p = '\0'; \
2877 /* Internal utility routines. */
2880 #ifdef YY_USE_PROTOS
2881 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2883 static void yy_flex_strncpy( s1
, s2
, n
)
2890 for ( i
= 0; i
< n
; ++i
)
2895 #ifdef YY_NEED_STRLEN
2896 #ifdef YY_USE_PROTOS
2897 static int yy_flex_strlen( yyconst
char *s
)
2899 static int yy_flex_strlen( s
)
2904 for ( n
= 0; s
[n
]; ++n
)
2912 #ifdef YY_USE_PROTOS
2913 static void *yy_flex_alloc( yy_size_t size
)
2915 static void *yy_flex_alloc( size
)
2919 return (void *) malloc( size
);
2922 #ifdef YY_USE_PROTOS
2923 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2925 static void *yy_flex_realloc( ptr
, size
)
2930 /* The cast to (char *) in the following accommodates both
2931 * implementations that use char* generic pointers, and those
2932 * that use void* generic pointers. It works with the latter
2933 * because both ANSI C and C++ allow castless assignment from
2934 * any pointer type to void*, and deal with argument conversions
2935 * as though doing an assignment.
2937 return (void *) realloc( (char *) ptr
, size
);
2940 #ifdef YY_USE_PROTOS
2941 static void yy_flex_free( void *ptr
)
2943 static void yy_flex_free( ptr
)
2957 #line 673 "scan-gram.l"
2960 /*------------------------------------------------------------------.
2961 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2963 | Possible inputs: $[<TYPENAME>]($|integer) |
2965 | Output to the STRING_OBSTACK a reference to this semantic value. |
2966 `------------------------------------------------------------------*/
2969 handle_action_dollar (char *text
, location_t location
)
2971 const char *type_name
= NULL
;
2972 char *cp
= text
+ 1;
2974 /* Get the type name if explicit. */
2987 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2988 if (!type_name
&& typed
)
2989 complain_at (location
, _("$$ of `%s' has no declared type"),
2990 current_rule
->sym
->tag
);
2993 obstack_fgrow1 (&string_obstack
,
2994 "]b4_lhs_value([%s])[", type_name
);
3000 num
= strtol (cp
, 0, 10);
3002 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
3005 if (!type_name
&& n
> 0)
3006 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
3008 if (!type_name
&& typed
)
3009 complain_at (location
, _("$%d of `%s' has no declared type"),
3010 n
, current_rule
->sym
->tag
);
3013 obstack_fgrow3 (&string_obstack
,
3014 "]b4_rhs_value([%d], [%d], [%s])[",
3015 rule_length
, n
, type_name
);
3018 complain_at (location
, _("integer out of range: %s"), quote (text
));
3023 /*---------------------------------------------------------------.
3024 | TEXT is expected to be $$ in some code associated to a symbol: |
3025 | destructor or printer. |
3026 `---------------------------------------------------------------*/
3029 handle_symbol_code_dollar (char *text
, location_t location
)
3031 char *cp
= text
+ 1;
3033 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
3035 complain_at (location
, _("invalid value: %s"), quote (text
));
3039 /*-----------------------------------------------------------------.
3040 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
3041 | depending upon CODE_KIND. |
3042 `-----------------------------------------------------------------*/
3045 handle_dollar (braced_code_t braced_code_kind
,
3046 char *text
, location_t location
)
3048 switch (braced_code_kind
)
3050 case action_braced_code
:
3051 handle_action_dollar (text
, location
);
3054 case destructor_braced_code
:
3055 case printer_braced_code
:
3056 handle_symbol_code_dollar (text
, location
);
3062 /*------------------------------------------------------.
3063 | TEXT is a location token (i.e., a `@...'). Output to |
3064 | STRING_OBSTACK a reference to this location. |
3065 `------------------------------------------------------*/
3068 handle_action_at (char *text
, location_t location
)
3070 char *cp
= text
+ 1;
3075 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
3081 num
= strtol (cp
, 0, 10);
3083 if (INT_MIN
<= num
&& num
<= rule_length
&& ! errno
)
3086 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
3090 complain_at (location
, _("integer out of range: %s"), quote (text
));
3095 /*---------------------------------------------------------------.
3096 | TEXT is expected to be @$ in some code associated to a symbol: |
3097 | destructor or printer. |
3098 `---------------------------------------------------------------*/
3101 handle_symbol_code_at (char *text
, location_t location
)
3103 char *cp
= text
+ 1;
3105 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
3107 complain_at (location
, _("invalid value: %s"), quote (text
));
3111 /*-------------------------------------------------------------------.
3112 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
3114 `-------------------------------------------------------------------*/
3117 handle_at (braced_code_t braced_code_kind
,
3118 char *text
, location_t location
)
3120 switch (braced_code_kind
)
3122 case action_braced_code
:
3123 handle_action_at (text
, location
);
3126 case destructor_braced_code
:
3127 case printer_braced_code
:
3128 handle_symbol_code_at (text
, location
);
3134 /*------------------------------------------------------------------.
3135 | Convert universal character name UCN to a single-byte character, |
3136 | and return that character. Return -1 if UCN does not correspond |
3137 | to a single-byte character. |
3138 `------------------------------------------------------------------*/
3141 convert_ucn_to_byte (char const *ucn
)
3143 unsigned long code
= strtoul (ucn
+ 2, 0, 16);
3145 /* FIXME: Currently we assume Unicode-compatible unibyte characters
3146 on ASCII hosts (i.e., Latin-1 on hosts with 8-bit bytes). On
3147 non-ASCII hosts we support only the portable C character set.
3148 These limitations should be removed once we add support for
3149 multibyte characters. */
3151 if (UCHAR_MAX
< code
)
3154 #if ! ('$' == 0x24 && '@' == 0x40 && '`' == 0x60 && '~' == 0x7e)
3156 /* A non-ASCII host. Use CODE to index into a table of the C
3157 basic execution character set, which is guaranteed to exist on
3158 all Standard C platforms. This table also includes '$', '@',
3159 and '`', which not in the basic execution character set but
3160 which are unibyte characters on all the platforms that we know
3162 static signed char const table
[] =
3164 '\0', -1, -1, -1, -1, -1, -1, '\a',
3165 '\b', '\t', '\n', '\v', '\f', '\r', -1, -1,
3166 -1, -1, -1, -1, -1, -1, -1, -1,
3167 -1, -1, -1, -1, -1, -1, -1, -1,
3168 ' ', '!', '"', '#', '$', '%', '&', '\'',
3169 '(', ')', '*', '+', ',', '-', '.', '/',
3170 '0', '1', '2', '3', '4', '5', '6', '7',
3171 '8', '9', ':', ';', '<', '=', '>', '?',
3172 '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
3173 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
3174 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
3175 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
3176 '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
3177 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
3178 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
3179 'x', 'y', 'z', '{', '|', '}', '~'
3182 code
= code
< sizeof table
? table
[code
] : -1;
3190 /*----------------------------------------------------------------.
3191 | Handle `#line INT "FILE"'. ARGS has already skipped `#line '. |
3192 `----------------------------------------------------------------*/
3195 handle_syncline (char *args
, location_t
*location
)
3197 int lineno
= strtol (args
, &args
, 10);
3198 const char *file
= NULL
;
3199 file
= strchr (args
, '"') + 1;
3200 *strchr (file
, '"') = 0;
3201 /* FIXME: Leaking... Can't free, as some locations are still
3202 pointing to the old file name. */
3203 infile
= xstrdup (file
);
3204 location
->file
= infile
;
3205 location
->last_line
= lineno
;
3208 /*-------------------------.
3209 | Initialize the scanner. |
3210 `-------------------------*/
3213 scanner_initialize (void)
3215 obstack_init (&string_obstack
);
3219 /*-----------------------------------------------.
3220 | Free all the memory allocated to the scanner. |
3221 `-----------------------------------------------*/
3226 obstack_free (&string_obstack
, 0);
3227 /* Reclaim Flex's buffers. */
3228 yy_delete_buffer (YY_CURRENT_BUFFER
);