1 #define yy_create_buffer gram__create_buffer
2 #define yy_delete_buffer gram__delete_buffer
3 #define yy_scan_buffer gram__scan_buffer
4 #define yy_scan_string gram__scan_string
5 #define yy_scan_bytes gram__scan_bytes
6 #define yy_flex_debug gram__flex_debug
7 #define yy_init_buffer gram__init_buffer
8 #define yy_flush_buffer gram__flush_buffer
9 #define yy_load_buffer_state gram__load_buffer_state
10 #define yy_switch_to_buffer gram__switch_to_buffer
12 #define yyleng gram_leng
13 #define yylex gram_lex
14 #define yyout gram_out
15 #define yyrestart gram_restart
16 #define yytext gram_text
18 #line 19 "scan-gram.c"
19 /* A lexical scanner generated by flex */
21 /* Scanner skeleton version:
26 #define YY_FLEX_MAJOR_VERSION 2
27 #define YY_FLEX_MINOR_VERSION 5
32 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
46 #ifndef YY_ALWAYS_INTERACTIVE
47 #ifndef YY_NEVER_INTERACTIVE
48 extern int isatty
YY_PROTO(( int ));
53 /* Use prototypes in function declarations. */
56 /* The "const" storage-class-modifier is valid. */
59 #else /* ! __cplusplus */
67 #endif /* ! __cplusplus */
86 #define YY_PROTO(proto) proto
88 #define YY_PROTO(proto) ()
91 /* Returned upon end-of-file. */
94 /* Promotes a possibly negative, possibly signed char to an unsigned
95 * integer for use as an array index. If the signed char is negative,
96 * we want to instead treat it as an 8-bit unsigned char, hence the
99 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
101 /* Enter a start condition. This macro really ought to take a parameter,
102 * but we do it the disgusting crufty way forced on us by the ()-less
103 * definition of BEGIN.
105 #define BEGIN yy_start = 1 + 2 *
107 /* Translate the current start state into a value that can be later handed
108 * to BEGIN to return to the state. The YYSTATE alias is for lex
111 #define YY_START ((yy_start - 1) / 2)
112 #define YYSTATE YY_START
114 /* Action number for EOF rule of a given start state. */
115 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
117 /* Special action meaning "start processing a new file". */
118 #define YY_NEW_FILE yyrestart( yyin )
120 #define YY_END_OF_BUFFER_CHAR 0
122 /* Size of default input buffer. */
123 #define YY_BUF_SIZE 16384
125 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
128 extern FILE *yyin
, *yyout
;
130 #define EOB_ACT_CONTINUE_SCAN 0
131 #define EOB_ACT_END_OF_FILE 1
132 #define EOB_ACT_LAST_MATCH 2
134 /* The funky do-while in the following #define is used to turn the definition
135 * int a single C statement (which needs a semi-colon terminator). This
136 * avoids problems with code like:
138 * if ( condition_holds )
141 * do_something_else();
143 * Prior to using the do-while the compiler would get upset at the
144 * "else" because it interpreted the "if" statement as being all
145 * done when it reached the ';' after the yyless() call.
148 /* Return all but the first 'n' matched characters back to the input stream. */
153 /* Undo effects of setting up yytext. */ \
154 *yy_cp = yy_hold_char; \
155 YY_RESTORE_YY_MORE_OFFSET \
156 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
157 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
161 #define unput(c) yyunput( c, yytext_ptr )
163 /* The following is because we cannot portably get our hands on size_t
164 * (without autoconf's help, which isn't available because we want
165 * flex-generated scanners to compile on their own).
167 typedef unsigned int yy_size_t
;
170 struct yy_buffer_state
174 char *yy_ch_buf
; /* input buffer */
175 char *yy_buf_pos
; /* current position in input buffer */
177 /* Size of input buffer in bytes, not including room for EOB
180 yy_size_t yy_buf_size
;
182 /* Number of characters read into yy_ch_buf, not including EOB
187 /* Whether we "own" the buffer - i.e., we know we created it,
188 * and can realloc() it to grow it, and should free() it to
191 int yy_is_our_buffer
;
193 /* Whether this is an "interactive" input source; if so, and
194 * if we're using stdio for input, then we want to use getc()
195 * instead of fread(), to make sure we stop fetching input after
198 int yy_is_interactive
;
200 /* Whether we're considered to be at the beginning of a line.
201 * If so, '^' rules will be active on the next match, otherwise
206 /* Whether to try to fill the input buffer when we reach the
211 int yy_buffer_status
;
212 #define YY_BUFFER_NEW 0
213 #define YY_BUFFER_NORMAL 1
214 /* When an EOF's been seen but there's still some text to process
215 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
216 * shouldn't try reading from the input source any more. We might
217 * still have a bunch of tokens to match, though, because of
218 * possible backing-up.
220 * When we actually see the EOF, we change the status to "new"
221 * (via yyrestart()), so that the user can continue scanning by
222 * just pointing yyin at a new input file.
224 #define YY_BUFFER_EOF_PENDING 2
227 static YY_BUFFER_STATE yy_current_buffer
= 0;
229 /* We provide macros for accessing buffer states in case in the
230 * future we want to put the buffer states in a more general
233 #define YY_CURRENT_BUFFER yy_current_buffer
236 /* yy_hold_char holds the character lost when yytext is formed. */
237 static char yy_hold_char
;
239 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
244 /* Points to current character in buffer. */
245 static char *yy_c_buf_p
= (char *) 0;
246 static int yy_init
= 1; /* whether we need to initialize */
247 static int yy_start
= 0; /* start state number */
249 /* Flag which is used to allow yywrap()'s to do buffer switches
250 * instead of setting up a fresh yyin. A bit of a hack ...
252 static int yy_did_buffer_switch_on_eof
;
254 void yyrestart
YY_PROTO(( FILE *input_file
));
256 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
257 void yy_load_buffer_state
YY_PROTO(( void ));
258 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
259 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
260 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
261 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
262 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
264 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
265 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
266 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
268 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
269 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
));
270 static void yy_flex_free
YY_PROTO(( void * ));
272 #define yy_new_buffer yy_create_buffer
274 #define yy_set_interactive(is_interactive) \
276 if ( ! yy_current_buffer ) \
277 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
278 yy_current_buffer->yy_is_interactive = is_interactive; \
281 #define yy_set_bol(at_bol) \
283 if ( ! yy_current_buffer ) \
284 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
285 yy_current_buffer->yy_at_bol = at_bol; \
288 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
292 #define YY_SKIP_YYWRAP
295 typedef unsigned char YY_CHAR
;
296 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
297 typedef int yy_state_type
;
301 #define yytext_ptr yytext
303 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
304 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
305 static int yy_get_next_buffer
YY_PROTO(( void ));
306 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
308 /* Done after the current pattern has been matched and before the
309 * corresponding action - sets up yytext.
311 #define YY_DO_BEFORE_ACTION \
312 yytext_ptr = yy_bp; \
313 yyleng = (int) (yy_cp - yy_bp); \
314 yy_hold_char = *yy_cp; \
318 #define YY_NUM_RULES 101
319 #define YY_END_OF_BUFFER 102
320 static yyconst
short int yy_accept
[380] =
322 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
323 0, 0, 0, 0, 0, 0, 0, 0, 102, 49,
324 38, 37, 37, 42, 49, 41, 39, 49, 40, 34,
325 36, 49, 33, 46, 35, 53, 54, 54, 55, 50,
326 51, 80, 83, 83, 79, 50, 82, 51, 75, 78,
327 78, 74, 77, 57, 58, 58, 56, 73, 60, 61,
328 61, 59, 93, 94, 94, 85, 95, 84, 88, 95,
329 50, 51, 90, 89, 97, 99, 99, 85, 98, 84,
330 88, 100, 100, 100, 85, 84, 88, 38, 37, 37,
331 37, 37, 48, 0, 0, 0, 0, 0, 0, 0,
333 0, 0, 0, 0, 0, 0, 0, 0, 0, 45,
334 39, 43, 44, 40, 0, 53, 54, 54, 54, 54,
335 52, 80, 83, 83, 83, 83, 81, 75, 78, 78,
336 78, 78, 76, 57, 58, 58, 58, 58, 72, 71,
337 72, 64, 65, 66, 67, 68, 69, 70, 72, 61,
338 61, 61, 61, 93, 94, 94, 94, 94, 91, 0,
339 91, 0, 86, 87, 92, 0, 92, 97, 99, 99,
340 99, 99, 96, 100, 100, 100, 100, 100, 86, 87,
341 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
342 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
344 0, 0, 0, 0, 0, 44, 47, 0, 0, 0,
345 87, 87, 87, 0, 0, 0, 0, 0, 0, 0,
346 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
347 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
348 0, 0, 0, 62, 63, 0, 0, 0, 0, 0,
349 0, 0, 0, 0, 0, 0, 12, 0, 0, 0,
350 0, 0, 0, 0, 20, 0, 0, 0, 0, 0,
351 26, 0, 29, 0, 0, 32, 0, 2, 0, 0,
352 6, 0, 0, 0, 0, 0, 0, 14, 0, 0,
353 0, 18, 0, 0, 0, 23, 0, 25, 27, 30,
355 0, 1, 3, 0, 0, 8, 0, 0, 0, 0,
356 0, 0, 0, 19, 0, 0, 0, 0, 0, 4,
357 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
358 0, 0, 0, 31, 0, 0, 0, 0, 0, 0,
359 0, 16, 17, 0, 24, 0, 0, 0, 0, 0,
360 0, 13, 0, 0, 0, 5, 0, 0, 0, 11,
361 0, 0, 0, 0, 9, 0, 15, 22, 28, 0,
362 0, 7, 0, 0, 0, 0, 0, 10, 0
365 static yyconst
int yy_ec
[256] =
367 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
368 1, 2, 4, 1, 1, 1, 1, 1, 1, 1,
369 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
370 1, 2, 1, 5, 1, 6, 7, 1, 8, 1,
371 1, 9, 1, 1, 10, 11, 12, 13, 13, 13,
372 13, 13, 13, 13, 13, 14, 14, 15, 16, 17,
373 18, 19, 1, 20, 21, 21, 21, 21, 21, 21,
374 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
375 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
376 22, 23, 24, 1, 25, 1, 26, 27, 28, 29,
378 30, 31, 32, 33, 34, 11, 35, 36, 37, 38,
379 39, 40, 11, 41, 42, 43, 44, 45, 11, 46,
380 47, 11, 48, 49, 50, 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,
386 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 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,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 static yyconst
int yy_meta
[51] =
399 1, 1, 2, 3, 4, 5, 6, 7, 8, 1,
400 9, 10, 11, 11, 1, 1, 1, 1, 12, 5,
401 11, 13, 14, 13, 9, 11, 11, 11, 11, 11,
402 11, 9, 9, 9, 9, 9, 9, 9, 9, 9,
403 9, 9, 9, 9, 9, 9, 9, 5, 1, 5
406 static yyconst
short int yy_base
[406] =
408 0, 0, 48, 51, 58, 61, 83, 86, 73, 94,
409 108, 110, 131, 179, 227, 249, 116, 142, 840, 841,
410 837, 55, 64, 841, 267, 841, 0, 44, 79, 841,
411 841, 0, 841, 841, 841, 0, 97, 99, 826, 841,
412 841, 0, 119, 122, 841, 841, 0, 841, 0, 126,
413 138, 841, 0, 0, 145, 153, 841, 311, 841, 155,
414 157, 841, 0, 159, 164, 841, 159, 841, 62, 164,
415 841, 841, 841, 841, 0, 185, 189, 841, 787, 841,
416 185, 192, 201, 203, 205, 207, 209, 834, 211, 213,
417 216, 219, 841, 801, 39, 86, 800, 797, 65, 802,
419 198, 787, 184, 796, 109, 203, 791, 798, 801, 841,
420 0, 841, 0, 230, 807, 0, 242, 244, 255, 259,
421 841, 0, 261, 263, 265, 272, 841, 0, 274, 276,
422 278, 280, 841, 0, 282, 284, 286, 288, 841, 841,
423 812, 841, 841, 841, 841, 841, 841, 841, 0, 297,
424 314, 317, 319, 0, 322, 324, 326, 328, 841, 322,
425 326, 0, 841, 0, 841, 330, 332, 0, 344, 347,
426 355, 357, 841, 359, 361, 363, 365, 367, 369, 371,
427 786, 144, 782, 781, 781, 144, 779, 788, 790, 776,
428 779, 366, 785, 771, 168, 772, 780, 781, 784, 768,
430 773, 767, 772, 764, 776, 0, 841, 790, 0, 783,
431 0, 374, 377, 775, 756, 765, 755, 767, 757, 765,
432 764, 763, 230, 749, 765, 758, 759, 752, 761, 745,
433 745, 756, 745, 752, 748, 744, 738, 741, 747, 746,
434 736, 747, 745, 841, 841, 373, 731, 739, 732, 728,
435 740, 726, 738, 755, 735, 723, 841, 719, 731, 372,
436 726, 717, 721, 713, 841, 713, 375, 712, 724, 710,
437 841, 714, 841, 713, 711, 841, 702, 841, 718, 703,
438 841, 378, 703, 705, 380, 718, 709, 841, 702, 703,
439 698, 841, 696, 708, 697, 841, 693, 841, 382, 841,
441 693, 841, 692, 705, 687, 841, 690, 691, 688, 689,
442 686, 670, 657, 841, 631, 643, 616, 609, 619, 841,
443 605, 616, 615, 600, 599, 600, 605, 591, 604, 841,
444 590, 592, 579, 841, 565, 562, 551, 535, 547, 511,
445 521, 841, 841, 509, 841, 521, 502, 511, 503, 493,
446 367, 841, 372, 372, 353, 841, 345, 309, 309, 841,
447 295, 292, 283, 260, 841, 252, 841, 841, 841, 263,
448 384, 841, 241, 236, 224, 196, 158, 841, 841, 409,
449 423, 437, 451, 465, 479, 493, 507, 227, 521, 535,
450 549, 561, 575, 587, 601, 614, 628, 642, 656, 670,
452 104, 684, 698, 712, 77
455 static yyconst
short int yy_def
[406] =
457 379, 1, 380, 380, 381, 381, 382, 382, 383, 383,
458 384, 384, 385, 385, 386, 386, 387, 387, 379, 379,
459 379, 379, 379, 379, 379, 379, 388, 379, 379, 379,
460 379, 389, 379, 379, 379, 390, 379, 379, 379, 379,
461 379, 391, 379, 379, 379, 379, 392, 379, 393, 379,
462 379, 379, 394, 395, 379, 379, 379, 396, 379, 379,
463 379, 379, 397, 379, 379, 379, 379, 379, 379, 379,
464 379, 379, 379, 379, 398, 379, 379, 379, 379, 379,
465 379, 399, 399, 399, 399, 399, 399, 379, 379, 379,
466 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
468 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
469 388, 379, 400, 379, 389, 390, 379, 379, 379, 379,
470 379, 391, 379, 379, 379, 379, 379, 393, 379, 379,
471 379, 379, 379, 395, 379, 379, 379, 379, 379, 379,
472 379, 379, 379, 379, 379, 379, 379, 379, 401, 379,
473 379, 379, 379, 397, 379, 379, 379, 379, 379, 379,
474 379, 402, 379, 403, 379, 379, 379, 398, 379, 379,
475 379, 379, 379, 399, 399, 399, 399, 399, 399, 404,
476 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
477 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
479 379, 379, 379, 379, 379, 400, 379, 379, 405, 402,
480 403, 404, 404, 379, 379, 379, 379, 379, 379, 379,
481 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
482 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
483 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
484 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
485 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
486 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
487 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
488 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
490 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
491 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
492 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
493 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
494 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
495 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
496 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
497 379, 379, 379, 379, 379, 379, 379, 379, 0, 379,
498 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
499 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
501 379, 379, 379, 379, 379
504 static yyconst
short int yy_nxt
[892] =
506 20, 21, 22, 23, 24, 20, 25, 26, 20, 20,
507 27, 28, 29, 29, 30, 31, 32, 33, 20, 20,
508 27, 20, 20, 20, 27, 27, 27, 27, 27, 27,
509 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
510 27, 27, 27, 27, 27, 27, 27, 34, 35, 20,
511 37, 38, 112, 37, 38, 113, 39, 89, 90, 39,
512 43, 44, 45, 43, 44, 45, 91, 92, 182, 40,
513 163, 41, 40, 164, 41, 55, 56, 57, 183, 46,
514 47, 48, 46, 47, 48, 50, 51, 245, 50, 51,
515 52, 114, 114, 52, 188, 58, 55, 56, 57, 117,
517 118, 119, 120, 189, 46, 53, 48, 46, 53, 48,
518 60, 61, 60, 61, 209, 62, 58, 62, 83, 84,
519 85, 123, 124, 86, 125, 126, 184, 87, 129, 130,
520 58, 185, 58, 64, 65, 66, 67, 46, 68, 48,
521 131, 132, 69, 198, 83, 84, 85, 135, 136, 86,
522 70, 199, 71, 87, 72, 137, 138, 150, 151, 152,
523 153, 155, 156, 46, 159, 48, 157, 158, 160, 165,
524 215, 161, 161, 166, 216, 162, 167, 167, 73, 221,
525 74, 64, 65, 66, 67, 217, 68, 169, 170, 222,
526 69, 171, 172, 163, 175, 176, 164, 232, 70, 378,
528 71, 233, 72, 175, 177, 178, 176, 175, 176, 175,
529 176, 175, 176, 89, 90, 91, 92, 179, 89, 90,
530 180, 91, 92, 191, 195, 377, 73, 196, 74, 76,
531 77, 78, 200, 79, 80, 111, 192, 111, 81, 256,
532 193, 201, 114, 114, 117, 118, 119, 120, 46, 202,
533 48, 76, 77, 78, 256, 79, 80, 117, 118, 376,
534 81, 119, 120, 123, 124, 125, 126, 123, 124, 375,
535 46, 374, 48, 93, 125, 126, 129, 130, 131, 132,
536 129, 130, 131, 132, 135, 136, 137, 138, 135, 136,
537 137, 138, 372, 94, 371, 95, 96, 97, 98, 150,
539 151, 370, 99, 100, 101, 102, 103, 104, 105, 106,
540 107, 108, 369, 109, 110, 140, 152, 153, 140, 150,
541 151, 152, 153, 141, 155, 156, 157, 158, 155, 156,
542 157, 158, 368, 140, 161, 161, 142, 143, 161, 161,
543 367, 144, 167, 167, 167, 167, 169, 170, 145, 171,
544 172, 146, 366, 147, 365, 148, 149, 169, 170, 171,
545 172, 175, 176, 175, 177, 178, 176, 178, 176, 175,
546 177, 175, 176, 175, 213, 228, 175, 213, 159, 178,
547 213, 289, 160, 364, 295, 161, 161, 305, 363, 308,
548 228, 318, 211, 373, 211, 211, 289, 211, 211, 295,
550 211, 362, 305, 229, 308, 361, 318, 360, 373, 36,
551 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
552 36, 36, 36, 42, 42, 42, 42, 42, 42, 42,
553 42, 42, 42, 42, 42, 42, 42, 49, 49, 49,
554 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
555 49, 54, 54, 54, 54, 54, 54, 54, 54, 54,
556 54, 54, 54, 54, 54, 59, 59, 59, 59, 59,
557 59, 59, 59, 59, 59, 59, 59, 59, 59, 63,
558 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
559 63, 63, 63, 75, 75, 75, 75, 75, 75, 75,
561 75, 75, 75, 75, 75, 75, 75, 82, 82, 82,
562 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
563 82, 115, 115, 115, 115, 115, 115, 115, 115, 115,
564 115, 115, 359, 115, 115, 116, 358, 357, 116, 116,
565 116, 116, 356, 116, 116, 116, 116, 355, 116, 122,
566 354, 353, 352, 122, 122, 122, 122, 122, 122, 122,
567 122, 127, 127, 127, 127, 127, 127, 127, 127, 127,
568 127, 127, 127, 127, 127, 128, 351, 350, 128, 128,
569 128, 349, 128, 128, 128, 128, 128, 133, 133, 133,
570 133, 133, 133, 133, 133, 133, 133, 133, 133, 133,
572 133, 134, 348, 347, 346, 134, 134, 134, 134, 134,
573 134, 134, 134, 134, 139, 139, 139, 139, 139, 139,
574 139, 139, 139, 139, 139, 139, 139, 139, 154, 345,
575 344, 343, 342, 154, 341, 154, 154, 340, 154, 154,
576 339, 154, 168, 338, 337, 336, 168, 335, 334, 168,
577 168, 333, 168, 168, 332, 168, 174, 174, 174, 174,
578 174, 174, 174, 174, 174, 174, 174, 174, 331, 174,
579 206, 330, 206, 206, 206, 206, 206, 206, 206, 206,
580 206, 206, 206, 206, 210, 210, 210, 210, 210, 210,
581 210, 210, 210, 210, 210, 329, 210, 210, 211, 328,
583 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
584 211, 211, 212, 212, 212, 212, 212, 212, 212, 212,
585 212, 212, 212, 212, 212, 212, 327, 326, 325, 324,
586 323, 322, 321, 320, 319, 317, 316, 315, 314, 313,
587 312, 311, 310, 309, 307, 306, 304, 303, 302, 301,
588 300, 299, 298, 297, 296, 294, 293, 292, 291, 290,
589 288, 287, 286, 285, 284, 283, 282, 281, 280, 279,
590 278, 277, 276, 275, 274, 273, 272, 271, 270, 269,
591 268, 267, 266, 265, 264, 263, 262, 261, 260, 259,
592 258, 257, 255, 254, 253, 252, 251, 250, 249, 248,
594 247, 246, 244, 243, 242, 241, 240, 239, 238, 237,
595 236, 235, 234, 231, 230, 227, 226, 225, 224, 223,
596 220, 219, 218, 214, 208, 207, 205, 204, 203, 197,
597 194, 190, 187, 186, 181, 88, 173, 121, 88, 379,
598 19, 379, 379, 379, 379, 379, 379, 379, 379, 379,
599 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
600 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
601 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
602 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
607 static yyconst
short int yy_chk
[892] =
609 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
610 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
611 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
612 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
613 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
614 3, 3, 28, 4, 4, 28, 3, 22, 22, 4,
615 5, 5, 5, 6, 6, 6, 23, 23, 95, 3,
616 69, 3, 4, 69, 4, 9, 9, 9, 95, 5,
617 5, 5, 6, 6, 6, 7, 7, 405, 8, 8,
618 7, 29, 29, 8, 99, 9, 10, 10, 10, 37,
620 37, 38, 38, 99, 7, 7, 7, 8, 8, 8,
621 11, 11, 12, 12, 401, 11, 10, 12, 17, 17,
622 17, 43, 43, 17, 44, 44, 96, 17, 50, 50,
623 11, 96, 12, 13, 13, 13, 13, 17, 13, 17,
624 51, 51, 13, 105, 18, 18, 18, 55, 55, 18,
625 13, 105, 13, 18, 13, 56, 56, 60, 60, 61,
626 61, 64, 64, 18, 67, 18, 65, 65, 67, 70,
627 182, 67, 67, 70, 182, 67, 70, 70, 13, 186,
628 13, 14, 14, 14, 14, 182, 14, 76, 76, 186,
629 14, 77, 77, 81, 82, 82, 81, 195, 14, 377,
631 14, 195, 14, 83, 83, 84, 84, 85, 85, 86,
632 86, 87, 87, 89, 89, 90, 90, 87, 91, 91,
633 87, 92, 92, 101, 103, 376, 14, 103, 14, 15,
634 15, 15, 106, 15, 15, 388, 101, 388, 15, 223,
635 101, 106, 114, 114, 117, 117, 118, 118, 15, 106,
636 15, 16, 16, 16, 223, 16, 16, 119, 119, 375,
637 16, 120, 120, 123, 123, 124, 124, 125, 125, 374,
638 16, 373, 16, 25, 126, 126, 129, 129, 130, 130,
639 131, 131, 132, 132, 135, 135, 136, 136, 137, 137,
640 138, 138, 370, 25, 366, 25, 25, 25, 25, 150,
642 150, 364, 25, 25, 25, 25, 25, 25, 25, 25,
643 25, 25, 363, 25, 25, 58, 151, 151, 58, 152,
644 152, 153, 153, 58, 155, 155, 156, 156, 157, 157,
645 158, 158, 362, 58, 160, 160, 58, 58, 161, 161,
646 361, 58, 166, 166, 167, 167, 169, 169, 58, 170,
647 170, 58, 359, 58, 358, 58, 58, 171, 171, 172,
648 172, 174, 174, 175, 175, 176, 176, 177, 177, 178,
649 178, 179, 179, 180, 180, 192, 212, 212, 246, 213,
650 213, 260, 246, 357, 267, 246, 246, 282, 355, 285,
651 192, 299, 180, 371, 180, 212, 260, 212, 213, 267,
653 213, 354, 282, 192, 285, 353, 299, 351, 371, 380,
654 380, 380, 380, 380, 380, 380, 380, 380, 380, 380,
655 380, 380, 380, 381, 381, 381, 381, 381, 381, 381,
656 381, 381, 381, 381, 381, 381, 381, 382, 382, 382,
657 382, 382, 382, 382, 382, 382, 382, 382, 382, 382,
658 382, 383, 383, 383, 383, 383, 383, 383, 383, 383,
659 383, 383, 383, 383, 383, 384, 384, 384, 384, 384,
660 384, 384, 384, 384, 384, 384, 384, 384, 384, 385,
661 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
662 385, 385, 385, 386, 386, 386, 386, 386, 386, 386,
664 386, 386, 386, 386, 386, 386, 386, 387, 387, 387,
665 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
666 387, 389, 389, 389, 389, 389, 389, 389, 389, 389,
667 389, 389, 350, 389, 389, 390, 349, 348, 390, 390,
668 390, 390, 347, 390, 390, 390, 390, 346, 390, 391,
669 344, 341, 340, 391, 391, 391, 391, 391, 391, 391,
670 391, 392, 392, 392, 392, 392, 392, 392, 392, 392,
671 392, 392, 392, 392, 392, 393, 339, 338, 393, 393,
672 393, 337, 393, 393, 393, 393, 393, 394, 394, 394,
673 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
675 394, 395, 336, 335, 333, 395, 395, 395, 395, 395,
676 395, 395, 395, 395, 396, 396, 396, 396, 396, 396,
677 396, 396, 396, 396, 396, 396, 396, 396, 397, 332,
678 331, 329, 328, 397, 327, 397, 397, 326, 397, 397,
679 325, 397, 398, 324, 323, 322, 398, 321, 319, 398,
680 398, 318, 398, 398, 317, 398, 399, 399, 399, 399,
681 399, 399, 399, 399, 399, 399, 399, 399, 316, 399,
682 400, 315, 400, 400, 400, 400, 400, 400, 400, 400,
683 400, 400, 400, 400, 402, 402, 402, 402, 402, 402,
684 402, 402, 402, 402, 402, 313, 402, 402, 403, 312,
686 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
687 403, 403, 404, 404, 404, 404, 404, 404, 404, 404,
688 404, 404, 404, 404, 404, 404, 311, 310, 309, 308,
689 307, 305, 304, 303, 301, 297, 295, 294, 293, 291,
690 290, 289, 287, 286, 284, 283, 280, 279, 277, 275,
691 274, 272, 270, 269, 268, 266, 264, 263, 262, 261,
692 259, 258, 256, 255, 254, 253, 252, 251, 250, 249,
693 248, 247, 243, 242, 241, 240, 239, 238, 237, 236,
694 235, 234, 233, 232, 231, 230, 229, 228, 227, 226,
695 225, 224, 222, 221, 220, 219, 218, 217, 216, 215,
697 214, 210, 208, 205, 204, 203, 202, 201, 200, 199,
698 198, 197, 196, 194, 193, 191, 190, 189, 188, 187,
699 185, 184, 183, 181, 141, 115, 109, 108, 107, 104,
700 102, 100, 98, 97, 94, 88, 79, 39, 21, 19,
701 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
702 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
703 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
704 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
705 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
710 static yy_state_type yy_last_accepting_state
;
711 static char *yy_last_accepting_cpos
;
713 extern int yy_flex_debug
;
714 int yy_flex_debug
= 1;
716 static yyconst
short int yy_rule_linenum
[101] =
718 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
719 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
720 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
721 149, 150, 152, 153, 154, 155, 157, 158, 159, 165,
722 168, 171, 174, 175, 178, 181, 184, 192, 198, 214,
723 215, 226, 238, 239, 240, 257, 267, 269, 289, 305,
724 307, 327, 339, 343, 344, 345, 346, 347, 348, 349,
725 350, 351, 357, 368, 374, 375, 377, 379, 397, 403,
726 404, 406, 408, 426, 429, 432, 433, 436, 447, 459,
727 461, 463, 466, 467, 470, 490, 497, 498, 499, 519
731 /* The intent behind this definition is that it'll catch
732 * any uses of REJECT which flex missed.
734 #define REJECT reject_used_but_not_detected
735 #define yymore() yymore_used_but_not_detected
736 #define YY_MORE_ADJ 0
737 #define YY_RESTORE_YY_MORE_OFFSET
739 #line 1 "scan-gram.l"
741 /* Bison Grammar Scanner -*- C -*-
742 Copyright (C) 2002 Free Software Foundation, Inc.
744 This file is part of Bison, the GNU Compiler Compiler.
746 This program is free software; you can redistribute it and/or modify
747 it under the terms of the GNU General Public License as published by
748 the Free Software Foundation; either version 2 of the License, or
749 (at your option) any later version.
751 This program is distributed in the hope that it will be useful,
752 but WITHOUT ANY WARRANTY; without even the implied warranty of
753 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
754 GNU General Public License for more details.
756 You should have received a copy of the GNU General Public License
757 along with this program; if not, write to the Free Software
758 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
761 #define YY_NO_UNPUT 1
762 #define YY_NEVER_INTERACTIVE 1
763 #define YY_STACK_USED 1
764 #line 26 "scan-gram.l"
766 #include "complain.h"
772 /* Each time we match a string, move the end cursor to its end. */
773 #define YY_USER_INIT \
775 LOCATION_RESET (*yylloc); \
776 yylloc->file = infile; \
777 /* This is only to avoid GCC warnings. */ \
778 if (yycontrol) {;}; \
781 #define YY_USER_ACTION LOCATION_COLUMNS (*yylloc, yyleng);
782 #define YY_LINES LOCATION_LINES (*yylloc, yyleng);
783 #define YY_STEP LOCATION_STEP (*yylloc);
785 /* STRING_OBSTACK -- Used to store all the characters that we need to
786 keep (to construct ID, STRINGS etc.). Use the following macros to
789 Use YY_OBS_GROW to append what has just been matched, and
790 YY_OBS_FINISH to end the string (it puts the ending 0).
791 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
792 used, and which is used by YY_OBS_FREE to free the last string. */
794 static struct obstack string_obstack
;
797 #define YY_OBS_GROW \
798 obstack_grow (&string_obstack, yytext, yyleng)
800 #define YY_OBS_FINISH \
802 obstack_1grow (&string_obstack, '\0'); \
803 last_string = obstack_finish (&string_obstack); \
806 #define YY_OBS_FREE \
808 obstack_free (&string_obstack, last_string); \
812 scanner_last_string_free (void)
818 static int braces_level
= 0;
819 static int percent_percent_count
= 0;
821 /* Within well-formed rules, RULE_LENGTH is the number of values in
822 the current rule so far, which says where to find `$0' with respect
823 to the top of the stack. It is not the same as the rule->length in
824 the case of mid rule actions.
826 Outside of well-formed rules, RULE_LENGTH has an undefined value. */
827 static int rule_length
;
829 static void handle_dollar
PARAMS ((braced_code_t code_kind
,
830 char *cp
, location_t location
));
831 static void handle_at
PARAMS ((braced_code_t code_kind
,
832 char *cp
, location_t location
));
837 #define SC_CHARACTER 3
839 #define SC_ESCAPED_STRING 4
840 #define SC_ESCAPED_CHARACTER 5
842 #define SC_BRACED_CODE 6
843 #define SC_PROLOGUE 7
844 #define SC_EPILOGUE 8
846 #line 847 "scan-gram.c"
848 /* Macros after this point can all be overridden by user definitions in
852 #ifndef YY_SKIP_YYWRAP
854 extern "C" int yywrap
YY_PROTO(( void ));
856 extern int yywrap
YY_PROTO(( void ));
861 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
865 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
868 #ifdef YY_NEED_STRLEN
869 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
874 static int yyinput
YY_PROTO(( void ));
876 static int input
YY_PROTO(( void ));
881 static int yy_start_stack_ptr
= 0;
882 static int yy_start_stack_depth
= 0;
883 static int *yy_start_stack
= 0;
884 #ifndef YY_NO_PUSH_STATE
885 static void yy_push_state
YY_PROTO(( int new_state
));
887 #ifndef YY_NO_POP_STATE
888 static void yy_pop_state
YY_PROTO(( void ));
890 #ifndef YY_NO_TOP_STATE
891 static int yy_top_state
YY_PROTO(( void ));
895 #define YY_NO_PUSH_STATE 1
896 #define YY_NO_POP_STATE 1
897 #define YY_NO_TOP_STATE 1
900 #ifdef YY_MALLOC_DECL
908 /* Just try to get by without declaring the routines. This will fail
909 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
910 * or sizeof(void*) != sizeof(int).
915 /* Amount of stuff to slurp up with each read. */
916 #ifndef YY_READ_BUF_SIZE
917 #define YY_READ_BUF_SIZE 8192
920 /* Copy whatever the last rule matched to the standard output. */
923 /* This used to be an fputs(), but since the string might contain NUL's,
924 * we now use fwrite().
926 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
929 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
930 * is returned in "result".
933 #define YY_INPUT(buf,result,max_size) \
934 if ( yy_current_buffer->yy_is_interactive ) \
937 for ( n = 0; n < max_size && \
938 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
941 buf[n++] = (char) c; \
942 if ( c == EOF && ferror( yyin ) ) \
943 YY_FATAL_ERROR( "input in flex scanner failed" ); \
949 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
951 if( errno != EINTR) \
953 YY_FATAL_ERROR( "input in flex scanner failed" ); \
962 /* No semi-colon after return; correct usage is to write "yyterminate();" -
963 * we don't want an extra ';' after the "return" because that will cause
964 * some compilers to complain about unreachable statements.
967 #define yyterminate() return YY_NULL
970 /* Number of entries by which start-condition stack grows. */
971 #ifndef YY_START_STACK_INCR
972 #define YY_START_STACK_INCR 25
975 /* Report a fatal error. */
976 #ifndef YY_FATAL_ERROR
977 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
980 /* Default declaration of generated scanner - a define so the user can
981 * easily add parameters.
984 #define YY_DECL int yylex YY_PROTO(( void ))
987 /* Code executed at the beginning of each rule, after yytext and yyleng
990 #ifndef YY_USER_ACTION
991 #define YY_USER_ACTION
994 /* Code executed at the end of each rule. */
996 #define YY_BREAK break;
999 #define YY_RULE_SETUP \
1004 register yy_state_type yy_current_state
;
1005 register char *yy_cp
, *yy_bp
;
1006 register int yy_act
;
1008 #line 106 "scan-gram.l"
1011 /* At each yylex invocation, mark the current position as the
1012 start of the next token. */
1017 /*----------------------------.
1018 | Scanning Bison directives. |
1019 `----------------------------*/
1020 #line 1021 "scan-gram.c"
1031 yy_start
= 1; /* first start state */
1039 if ( ! yy_current_buffer
)
1041 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1043 yy_load_buffer_state();
1046 while ( 1 ) /* loops until end-of-file is reached */
1050 /* Support of yytext. */
1051 *yy_cp
= yy_hold_char
;
1053 /* yy_bp points to the position in yy_ch_buf of the start of
1058 yy_current_state
= yy_start
;
1062 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1063 if ( yy_accept
[yy_current_state
] )
1065 yy_last_accepting_state
= yy_current_state
;
1066 yy_last_accepting_cpos
= yy_cp
;
1068 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1070 yy_current_state
= (int) yy_def
[yy_current_state
];
1071 if ( yy_current_state
>= 380 )
1072 yy_c
= yy_meta
[(unsigned int) yy_c
];
1074 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1077 while ( yy_base
[yy_current_state
] != 841 );
1080 yy_act
= yy_accept
[yy_current_state
];
1082 { /* have to back up */
1083 yy_cp
= yy_last_accepting_cpos
;
1084 yy_current_state
= yy_last_accepting_state
;
1085 yy_act
= yy_accept
[yy_current_state
];
1088 YY_DO_BEFORE_ACTION
;
1091 do_action
: /* This label is used only to access EOF actions. */
1093 if ( yy_flex_debug
)
1096 fprintf( stderr
, "--scanner backing up\n" );
1097 else if ( yy_act
< 101 )
1098 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1099 yy_rule_linenum
[yy_act
], yytext
);
1100 else if ( yy_act
== 101 )
1101 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1103 else if ( yy_act
== 102 )
1104 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1106 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1110 { /* beginning of action switch */
1111 case 0: /* must back up */
1112 /* undo the effects of YY_DO_BEFORE_ACTION */
1113 *yy_cp
= yy_hold_char
;
1114 yy_cp
= yy_last_accepting_cpos
;
1115 yy_current_state
= yy_last_accepting_state
;
1116 goto yy_find_action
;
1122 #line 119 "scan-gram.l"
1123 return PERCENT_NONASSOC
;
1127 #line 120 "scan-gram.l"
1128 return PERCENT_DEBUG
;
1132 #line 121 "scan-gram.l"
1133 return PERCENT_DEFINE
;
1137 #line 122 "scan-gram.l"
1138 return PERCENT_DEFINES
;
1142 #line 123 "scan-gram.l"
1143 return PERCENT_DESTRUCTOR
;
1147 #line 124 "scan-gram.l"
1148 return PERCENT_DPREC
;
1152 #line 125 "scan-gram.l"
1153 return PERCENT_ERROR_VERBOSE
;
1157 #line 126 "scan-gram.l"
1158 return PERCENT_EXPECT
;
1162 #line 127 "scan-gram.l"
1163 return PERCENT_FILE_PREFIX
;
1167 #line 128 "scan-gram.l"
1168 return PERCENT_YACC
;
1172 #line 129 "scan-gram.l"
1173 return PERCENT_GLR_PARSER
;
1177 #line 130 "scan-gram.l"
1178 return PERCENT_LEFT
;
1182 #line 131 "scan-gram.l"
1183 return PERCENT_LOCATIONS
;
1187 #line 132 "scan-gram.l"
1188 return PERCENT_MERGE
;
1192 #line 133 "scan-gram.l"
1193 return PERCENT_NAME_PREFIX
;
1197 #line 134 "scan-gram.l"
1198 return PERCENT_NO_LINES
;
1202 #line 135 "scan-gram.l"
1203 return PERCENT_NONASSOC
;
1207 #line 136 "scan-gram.l"
1208 return PERCENT_NTERM
;
1212 #line 137 "scan-gram.l"
1213 return PERCENT_OUTPUT
;
1217 #line 138 "scan-gram.l"
1218 { rule_length
--; return PERCENT_PREC
; }
1222 #line 139 "scan-gram.l"
1223 return PERCENT_PRINTER
;
1227 #line 140 "scan-gram.l"
1228 return PERCENT_PURE_PARSER
;
1232 #line 141 "scan-gram.l"
1233 return PERCENT_RIGHT
;
1237 #line 142 "scan-gram.l"
1238 return PERCENT_SKELETON
;
1242 #line 143 "scan-gram.l"
1243 return PERCENT_START
;
1247 #line 144 "scan-gram.l"
1248 return PERCENT_TOKEN
;
1252 #line 145 "scan-gram.l"
1253 return PERCENT_TOKEN
;
1257 #line 146 "scan-gram.l"
1258 return PERCENT_TOKEN_TABLE
;
1262 #line 147 "scan-gram.l"
1263 return PERCENT_TYPE
;
1267 #line 148 "scan-gram.l"
1268 return PERCENT_UNION
;
1272 #line 149 "scan-gram.l"
1273 return PERCENT_VERBOSE
;
1277 #line 150 "scan-gram.l"
1278 return PERCENT_YACC
;
1282 #line 152 "scan-gram.l"
1287 #line 153 "scan-gram.l"
1288 { rule_length
= 0; return COLON
; }
1292 #line 154 "scan-gram.l"
1293 { rule_length
= 0; return PIPE
; }
1297 #line 155 "scan-gram.l"
1302 #line 157 "scan-gram.l"
1307 #line 158 "scan-gram.l"
1312 #line 159 "scan-gram.l"
1314 yylval
->symbol
= symbol_get (yytext
, *yylloc
);
1321 #line 165 "scan-gram.l"
1322 yylval
->integer
= strtol (yytext
, 0, 10); return INT
;
1324 /* Characters. We don't check there is only one. */
1327 #line 168 "scan-gram.l"
1328 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1333 #line 171 "scan-gram.l"
1334 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1339 #line 174 "scan-gram.l"
1340 yy_push_state (SC_COMMENT
);
1344 #line 175 "scan-gram.l"
1350 #line 178 "scan-gram.l"
1351 yy_push_state (SC_PROLOGUE
);
1353 /* Code in between braces. */
1356 #line 181 "scan-gram.l"
1357 YY_OBS_GROW
; ++braces_level
; yy_push_state (SC_BRACED_CODE
);
1362 #line 184 "scan-gram.l"
1364 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1366 yylval
->string
= last_string
;
1372 #line 192 "scan-gram.l"
1374 if (++percent_percent_count
== 2)
1375 yy_push_state (SC_EPILOGUE
);
1376 return PERCENT_PERCENT
;
1381 #line 198 "scan-gram.l"
1383 LOCATION_PRINT (stderr
, *yylloc
);
1384 fprintf (stderr
, _(": invalid character: `%c'\n"), *yytext
);
1389 /*------------------------------------------------------------.
1390 | Whatever the start condition (but those which correspond to |
1391 | entity `swallowed' by Bison: SC_ESCAPED_STRING and |
1392 | SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1393 `------------------------------------------------------------*/
1398 #line 214 "scan-gram.l"
1399 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@<:@");
1403 #line 215 "scan-gram.l"
1404 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@:>@");
1407 /*-----------------------------------------------------------.
1408 | Scanning a C comment. The initial `/ *' is already eaten. |
1409 `-----------------------------------------------------------*/
1414 #line 226 "scan-gram.l"
1415 { /* End of the comment. */
1416 if (yy_top_state () == INITIAL
)
1429 #line 238 "scan-gram.l"
1430 if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1434 #line 239 "scan-gram.l"
1435 if (yy_top_state () != INITIAL
) YY_OBS_GROW
; YY_LINES
;
1439 #line 240 "scan-gram.l"
1440 /* Stray `*'. */if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1442 case YY_STATE_EOF(SC_COMMENT
):
1443 #line 242 "scan-gram.l"
1445 LOCATION_PRINT (stderr
, *yylloc
);
1446 fprintf (stderr
, _(": unexpected end of file in a comment\n"));
1451 /*----------------------------------------------------------------.
1452 | Scanning a C string, including its escapes. The initial `"' is |
1454 `----------------------------------------------------------------*/
1459 #line 257 "scan-gram.l"
1461 assert (yy_top_state () == INITIAL
);
1464 yylval
->string
= last_string
;
1472 #line 267 "scan-gram.l"
1477 #line 269 "scan-gram.l"
1478 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1480 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1481 #line 271 "scan-gram.l"
1483 LOCATION_PRINT (stderr
, *yylloc
);
1484 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1485 assert (yy_top_state () == INITIAL
);
1487 yylval
->string
= last_string
;
1493 /*---------------------------------------------------------------.
1494 | Scanning a C character, decoding its escapes. The initial "'" |
1495 | is already eaten. |
1496 `---------------------------------------------------------------*/
1501 #line 289 "scan-gram.l"
1504 assert (yy_top_state () == INITIAL
);
1507 yylval
->symbol
= symbol_get (last_string
, *yylloc
);
1508 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1509 symbol_user_token_number_set (yylval
->symbol
,
1510 (unsigned char) last_string
[1], *yylloc
);
1520 #line 305 "scan-gram.l"
1525 #line 307 "scan-gram.l"
1526 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1528 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1529 #line 309 "scan-gram.l"
1531 LOCATION_PRINT (stderr
, *yylloc
);
1532 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1533 assert (yy_top_state () == INITIAL
);
1535 yylval
->string
= last_string
;
1541 /*----------------------------.
1542 | Decode escaped characters. |
1543 `----------------------------*/
1548 #line 327 "scan-gram.l"
1550 long c
= strtol (yytext
+ 1, 0, 8);
1553 LOCATION_PRINT (stderr
, *yylloc
);
1554 fprintf (stderr
, _(": invalid escape: %s\n"), quote (yytext
));
1558 obstack_1grow (&string_obstack
, c
);
1563 #line 339 "scan-gram.l"
1565 obstack_1grow (&string_obstack
, strtol (yytext
+ 2, 0, 16));
1570 #line 343 "scan-gram.l"
1571 obstack_1grow (&string_obstack
, '\a');
1575 #line 344 "scan-gram.l"
1576 obstack_1grow (&string_obstack
, '\b');
1580 #line 345 "scan-gram.l"
1581 obstack_1grow (&string_obstack
, '\f');
1585 #line 346 "scan-gram.l"
1586 obstack_1grow (&string_obstack
, '\n');
1590 #line 347 "scan-gram.l"
1591 obstack_1grow (&string_obstack
, '\r');
1595 #line 348 "scan-gram.l"
1596 obstack_1grow (&string_obstack
, '\t');
1600 #line 349 "scan-gram.l"
1601 obstack_1grow (&string_obstack
, '\v');
1605 #line 350 "scan-gram.l"
1606 obstack_1grow (&string_obstack
, yytext
[1]);
1610 #line 351 "scan-gram.l"
1612 LOCATION_PRINT (stderr
, *yylloc
);
1613 fprintf (stderr
, _(": unrecognized escape: %s\n"), quote (yytext
));
1617 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1620 #line 357 "scan-gram.l"
1624 /*----------------------------------------------------------.
1625 | Scanning a C character without decoding its escapes. The |
1626 | initial "'" is already eaten. |
1627 `----------------------------------------------------------*/
1632 #line 368 "scan-gram.l"
1635 assert (yy_top_state () != INITIAL
);
1641 #line 374 "scan-gram.l"
1646 #line 375 "scan-gram.l"
1649 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1652 #line 377 "scan-gram.l"
1657 #line 379 "scan-gram.l"
1658 YY_OBS_GROW
; YY_LINES
;
1660 case YY_STATE_EOF(SC_CHARACTER
):
1661 #line 381 "scan-gram.l"
1663 LOCATION_PRINT (stderr
, *yylloc
);
1664 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1665 assert (yy_top_state () != INITIAL
);
1670 /*----------------------------------------------------------------.
1671 | Scanning a C string, without decoding its escapes. The initial |
1672 | `"' is already eaten. |
1673 `----------------------------------------------------------------*/
1678 #line 397 "scan-gram.l"
1680 assert (yy_top_state () != INITIAL
);
1687 #line 403 "scan-gram.l"
1692 #line 404 "scan-gram.l"
1695 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1698 #line 406 "scan-gram.l"
1703 #line 408 "scan-gram.l"
1704 YY_OBS_GROW
; YY_LINES
;
1706 case YY_STATE_EOF(SC_STRING
):
1707 #line 410 "scan-gram.l"
1709 LOCATION_PRINT (stderr
, *yylloc
);
1710 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1711 assert (yy_top_state () != INITIAL
);
1716 /*---------------------------------------------------.
1717 | Strings, comments etc. can be found in user code. |
1718 `---------------------------------------------------*/
1721 /* Characters. We don't check there is only one. */
1724 #line 426 "scan-gram.l"
1725 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1730 #line 429 "scan-gram.l"
1731 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1736 #line 432 "scan-gram.l"
1737 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1741 #line 433 "scan-gram.l"
1747 #line 436 "scan-gram.l"
1751 /*---------------------------------------------------------------.
1752 | Scanning some code in braces (%union and actions). The initial |
1753 | "{" is already eaten. |
1754 `---------------------------------------------------------------*/
1759 #line 447 "scan-gram.l"
1762 if (--braces_level
== 0)
1766 yylval
->string
= last_string
;
1774 #line 459 "scan-gram.l"
1775 YY_OBS_GROW
; braces_level
++;
1779 #line 461 "scan-gram.l"
1780 { handle_dollar (current_braced_code
,
1785 #line 463 "scan-gram.l"
1786 { handle_at (current_braced_code
,
1791 #line 466 "scan-gram.l"
1796 #line 467 "scan-gram.l"
1797 YY_OBS_GROW
; YY_LINES
;
1799 /* A lose $, or /, or etc. */
1802 #line 470 "scan-gram.l"
1805 case YY_STATE_EOF(SC_BRACED_CODE
):
1806 #line 472 "scan-gram.l"
1808 LOCATION_PRINT (stderr
, *yylloc
);
1809 fprintf (stderr
, _(": unexpected end of file in a braced code\n"));
1812 yylval
->string
= last_string
;
1817 /*--------------------------------------------------------------.
1818 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1819 `--------------------------------------------------------------*/
1824 #line 490 "scan-gram.l"
1828 yylval
->string
= last_string
;
1834 #line 497 "scan-gram.l"
1839 #line 498 "scan-gram.l"
1844 #line 499 "scan-gram.l"
1845 YY_OBS_GROW
; YY_LINES
;
1847 case YY_STATE_EOF(SC_PROLOGUE
):
1848 #line 501 "scan-gram.l"
1850 LOCATION_PRINT (stderr
, *yylloc
);
1851 fprintf (stderr
, _(": unexpected end of file in a prologue\n"));
1854 yylval
->string
= last_string
;
1859 /*---------------------------------------------------------------.
1860 | Scanning the epilogue (everything after the second "%%", which |
1861 | has already been eaten. |
1862 `---------------------------------------------------------------*/
1867 #line 519 "scan-gram.l"
1870 case YY_STATE_EOF(SC_EPILOGUE
):
1871 #line 521 "scan-gram.l"
1875 yylval
->string
= last_string
;
1882 #line 530 "scan-gram.l"
1883 YY_FATAL_ERROR( "flex scanner jammed" );
1885 #line 1886 "scan-gram.c"
1886 case YY_STATE_EOF(INITIAL
):
1889 case YY_END_OF_BUFFER
:
1891 /* Amount of text matched not including the EOB char. */
1892 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
1894 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1895 *yy_cp
= yy_hold_char
;
1896 YY_RESTORE_YY_MORE_OFFSET
1898 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1900 /* We're scanning a new file or input source. It's
1901 * possible that this happened because the user
1902 * just pointed yyin at a new source and called
1903 * yylex(). If so, then we have to assure
1904 * consistency between yy_current_buffer and our
1905 * globals. Here is the right place to do so, because
1906 * this is the first action (other than possibly a
1907 * back-up) that will match for the new input source.
1909 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1910 yy_current_buffer
->yy_input_file
= yyin
;
1911 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1914 /* Note that here we test for yy_c_buf_p "<=" to the position
1915 * of the first EOB in the buffer, since yy_c_buf_p will
1916 * already have been incremented past the NUL character
1917 * (since all states make transitions on EOB to the
1918 * end-of-buffer state). Contrast this with the test
1921 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1922 { /* This was really a NUL. */
1923 yy_state_type yy_next_state
;
1925 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1927 yy_current_state
= yy_get_previous_state();
1929 /* Okay, we're now positioned to make the NUL
1930 * transition. We couldn't have
1931 * yy_get_previous_state() go ahead and do it
1932 * for us because it doesn't know how to deal
1933 * with the possibility of jamming (and we don't
1934 * want to build jamming into it because then it
1935 * will run more slowly).
1938 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1940 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1942 if ( yy_next_state
)
1944 /* Consume the NUL. */
1945 yy_cp
= ++yy_c_buf_p
;
1946 yy_current_state
= yy_next_state
;
1953 goto yy_find_action
;
1957 else switch ( yy_get_next_buffer() )
1959 case EOB_ACT_END_OF_FILE
:
1961 yy_did_buffer_switch_on_eof
= 0;
1965 /* Note: because we've taken care in
1966 * yy_get_next_buffer() to have set up
1967 * yytext, we can now set up
1968 * yy_c_buf_p so that if some total
1969 * hoser (like flex itself) wants to
1970 * call the scanner after we return the
1971 * YY_NULL, it'll still work - another
1972 * YY_NULL will get returned.
1974 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
1976 yy_act
= YY_STATE_EOF(YY_START
);
1982 if ( ! yy_did_buffer_switch_on_eof
)
1988 case EOB_ACT_CONTINUE_SCAN
:
1990 yytext_ptr
+ yy_amount_of_matched_text
;
1992 yy_current_state
= yy_get_previous_state();
1995 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1998 case EOB_ACT_LAST_MATCH
:
2000 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
2002 yy_current_state
= yy_get_previous_state();
2005 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
2006 goto yy_find_action
;
2013 "fatal flex scanner internal error--no action found" );
2014 } /* end of action switch */
2015 } /* end of scanning one token */
2016 } /* end of yylex */
2019 /* yy_get_next_buffer - try to read in a new buffer
2021 * Returns a code representing an action:
2022 * EOB_ACT_LAST_MATCH -
2023 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2024 * EOB_ACT_END_OF_FILE - end of file
2027 static int yy_get_next_buffer()
2029 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2030 register char *source
= yytext_ptr
;
2031 register int number_to_move
, i
;
2034 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2036 "fatal flex scanner internal error--end of buffer missed" );
2038 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2039 { /* Don't try to fill the buffer, so this is an EOF. */
2040 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2042 /* We matched a single character, the EOB, so
2043 * treat this as a final EOF.
2045 return EOB_ACT_END_OF_FILE
;
2050 /* We matched some text prior to the EOB, first
2053 return EOB_ACT_LAST_MATCH
;
2057 /* Try to read more data. */
2059 /* First move last chars to start of buffer. */
2060 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2062 for ( i
= 0; i
< number_to_move
; ++i
)
2063 *(dest
++) = *(source
++);
2065 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2066 /* don't do the read, it's not guaranteed to return an EOF,
2069 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2074 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2076 while ( num_to_read
<= 0 )
2077 { /* Not enough room in the buffer - grow it. */
2078 #ifdef YY_USES_REJECT
2080 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2083 /* just a shorter name for the current buffer */
2084 YY_BUFFER_STATE b
= yy_current_buffer
;
2086 int yy_c_buf_p_offset
=
2087 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2089 if ( b
->yy_is_our_buffer
)
2091 int new_size
= b
->yy_buf_size
* 2;
2093 if ( new_size
<= 0 )
2094 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2096 b
->yy_buf_size
*= 2;
2098 b
->yy_ch_buf
= (char *)
2099 /* Include room in for 2 EOB chars. */
2100 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2101 b
->yy_buf_size
+ 2 );
2104 /* Can't grow it, we don't own it. */
2107 if ( ! b
->yy_ch_buf
)
2109 "fatal error - scanner input buffer overflow" );
2111 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2113 num_to_read
= yy_current_buffer
->yy_buf_size
-
2118 if ( num_to_read
> YY_READ_BUF_SIZE
)
2119 num_to_read
= YY_READ_BUF_SIZE
;
2121 /* Read in more data. */
2122 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2123 yy_n_chars
, num_to_read
);
2125 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2128 if ( yy_n_chars
== 0 )
2130 if ( number_to_move
== YY_MORE_ADJ
)
2132 ret_val
= EOB_ACT_END_OF_FILE
;
2138 ret_val
= EOB_ACT_LAST_MATCH
;
2139 yy_current_buffer
->yy_buffer_status
=
2140 YY_BUFFER_EOF_PENDING
;
2145 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2147 yy_n_chars
+= number_to_move
;
2148 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2149 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2151 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2157 /* yy_get_previous_state - get the state just before the EOB char was reached */
2159 static yy_state_type
yy_get_previous_state()
2161 register yy_state_type yy_current_state
;
2162 register char *yy_cp
;
2164 yy_current_state
= yy_start
;
2166 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2168 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2169 if ( yy_accept
[yy_current_state
] )
2171 yy_last_accepting_state
= yy_current_state
;
2172 yy_last_accepting_cpos
= yy_cp
;
2174 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2176 yy_current_state
= (int) yy_def
[yy_current_state
];
2177 if ( yy_current_state
>= 380 )
2178 yy_c
= yy_meta
[(unsigned int) yy_c
];
2180 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2183 return yy_current_state
;
2187 /* yy_try_NUL_trans - try to make a transition on the NUL character
2190 * next_state = yy_try_NUL_trans( current_state );
2193 #ifdef YY_USE_PROTOS
2194 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2196 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2197 yy_state_type yy_current_state
;
2200 register int yy_is_jam
;
2201 register char *yy_cp
= yy_c_buf_p
;
2203 register YY_CHAR yy_c
= 1;
2204 if ( yy_accept
[yy_current_state
] )
2206 yy_last_accepting_state
= yy_current_state
;
2207 yy_last_accepting_cpos
= yy_cp
;
2209 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2211 yy_current_state
= (int) yy_def
[yy_current_state
];
2212 if ( yy_current_state
>= 380 )
2213 yy_c
= yy_meta
[(unsigned int) yy_c
];
2215 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2216 yy_is_jam
= (yy_current_state
== 379);
2218 return yy_is_jam
? 0 : yy_current_state
;
2223 #ifdef YY_USE_PROTOS
2224 static void yyunput( int c
, register char *yy_bp
)
2226 static void yyunput( c
, yy_bp
)
2228 register char *yy_bp
;
2231 register char *yy_cp
= yy_c_buf_p
;
2233 /* undo effects of setting up yytext */
2234 *yy_cp
= yy_hold_char
;
2236 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2237 { /* need to shift things up to make room */
2238 /* +2 for EOB chars. */
2239 register int number_to_move
= yy_n_chars
+ 2;
2240 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2241 yy_current_buffer
->yy_buf_size
+ 2];
2242 register char *source
=
2243 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2245 while ( source
> yy_current_buffer
->yy_ch_buf
)
2246 *--dest
= *--source
;
2248 yy_cp
+= (int) (dest
- source
);
2249 yy_bp
+= (int) (dest
- source
);
2250 yy_current_buffer
->yy_n_chars
=
2251 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2253 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2254 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2257 *--yy_cp
= (char) c
;
2261 yy_hold_char
= *yy_cp
;
2264 #endif /* ifndef YY_NO_UNPUT */
2268 static int yyinput()
2275 *yy_c_buf_p
= yy_hold_char
;
2277 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2279 /* yy_c_buf_p now points to the character we want to return.
2280 * If this occurs *before* the EOB characters, then it's a
2281 * valid NUL; if not, then we've hit the end of the buffer.
2283 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2284 /* This was really a NUL. */
2288 { /* need more input */
2289 int offset
= yy_c_buf_p
- yytext_ptr
;
2292 switch ( yy_get_next_buffer() )
2294 case EOB_ACT_LAST_MATCH
:
2295 /* This happens because yy_g_n_b()
2296 * sees that we've accumulated a
2297 * token and flags that we need to
2298 * try matching the token before
2299 * proceeding. But for input(),
2300 * there's no matching to consider.
2301 * So convert the EOB_ACT_LAST_MATCH
2302 * to EOB_ACT_END_OF_FILE.
2305 /* Reset buffer status. */
2310 case EOB_ACT_END_OF_FILE
:
2315 if ( ! yy_did_buffer_switch_on_eof
)
2324 case EOB_ACT_CONTINUE_SCAN
:
2325 yy_c_buf_p
= yytext_ptr
+ offset
;
2331 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2332 *yy_c_buf_p
= '\0'; /* preserve yytext */
2333 yy_hold_char
= *++yy_c_buf_p
;
2340 #ifdef YY_USE_PROTOS
2341 void yyrestart( FILE *input_file
)
2343 void yyrestart( input_file
)
2347 if ( ! yy_current_buffer
)
2348 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2350 yy_init_buffer( yy_current_buffer
, input_file
);
2351 yy_load_buffer_state();
2355 #ifdef YY_USE_PROTOS
2356 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2358 void yy_switch_to_buffer( new_buffer
)
2359 YY_BUFFER_STATE new_buffer
;
2362 if ( yy_current_buffer
== new_buffer
)
2365 if ( yy_current_buffer
)
2367 /* Flush out information for old buffer. */
2368 *yy_c_buf_p
= yy_hold_char
;
2369 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2370 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2373 yy_current_buffer
= new_buffer
;
2374 yy_load_buffer_state();
2376 /* We don't actually know whether we did this switch during
2377 * EOF (yywrap()) processing, but the only time this flag
2378 * is looked at is after yywrap() is called, so it's safe
2379 * to go ahead and always set it.
2381 yy_did_buffer_switch_on_eof
= 1;
2385 #ifdef YY_USE_PROTOS
2386 void yy_load_buffer_state( void )
2388 void yy_load_buffer_state()
2391 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2392 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2393 yyin
= yy_current_buffer
->yy_input_file
;
2394 yy_hold_char
= *yy_c_buf_p
;
2398 #ifdef YY_USE_PROTOS
2399 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2401 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2408 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2410 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2412 b
->yy_buf_size
= size
;
2414 /* yy_ch_buf has to be 2 characters longer than the size given because
2415 * we need to put in 2 end-of-buffer characters.
2417 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2418 if ( ! b
->yy_ch_buf
)
2419 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2421 b
->yy_is_our_buffer
= 1;
2423 yy_init_buffer( b
, file
);
2429 #ifdef YY_USE_PROTOS
2430 void yy_delete_buffer( YY_BUFFER_STATE b
)
2432 void yy_delete_buffer( b
)
2439 if ( b
== yy_current_buffer
)
2440 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2442 if ( b
->yy_is_our_buffer
)
2443 yy_flex_free( (void *) b
->yy_ch_buf
);
2445 yy_flex_free( (void *) b
);
2452 #ifndef YY_ALWAYS_INTERACTIVE
2453 #ifndef YY_NEVER_INTERACTIVE
2454 extern int isatty
YY_PROTO(( int ));
2459 #ifdef YY_USE_PROTOS
2460 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2462 void yy_init_buffer( b
, file
)
2469 yy_flush_buffer( b
);
2471 b
->yy_input_file
= file
;
2472 b
->yy_fill_buffer
= 1;
2474 #if YY_ALWAYS_INTERACTIVE
2475 b
->yy_is_interactive
= 1;
2477 #if YY_NEVER_INTERACTIVE
2478 b
->yy_is_interactive
= 0;
2480 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2486 #ifdef YY_USE_PROTOS
2487 void yy_flush_buffer( YY_BUFFER_STATE b
)
2489 void yy_flush_buffer( b
)
2499 /* We always need two end-of-buffer characters. The first causes
2500 * a transition to the end-of-buffer state. The second causes
2501 * a jam in that state.
2503 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2504 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2506 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2509 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2511 if ( b
== yy_current_buffer
)
2512 yy_load_buffer_state();
2516 #ifndef YY_NO_SCAN_BUFFER
2517 #ifdef YY_USE_PROTOS
2518 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2520 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2528 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2529 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2530 /* They forgot to leave room for the EOB's. */
2533 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2535 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2537 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2538 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2539 b
->yy_is_our_buffer
= 0;
2540 b
->yy_input_file
= 0;
2541 b
->yy_n_chars
= b
->yy_buf_size
;
2542 b
->yy_is_interactive
= 0;
2544 b
->yy_fill_buffer
= 0;
2545 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2547 yy_switch_to_buffer( b
);
2554 #ifndef YY_NO_SCAN_STRING
2555 #ifdef YY_USE_PROTOS
2556 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2558 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2559 yyconst
char *yy_str
;
2563 for ( len
= 0; yy_str
[len
]; ++len
)
2566 return yy_scan_bytes( yy_str
, len
);
2571 #ifndef YY_NO_SCAN_BYTES
2572 #ifdef YY_USE_PROTOS
2573 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2575 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2576 yyconst
char *bytes
;
2585 /* Get memory for full buffer, including space for trailing EOB's. */
2587 buf
= (char *) yy_flex_alloc( n
);
2589 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2591 for ( i
= 0; i
< len
; ++i
)
2594 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2596 b
= yy_scan_buffer( buf
, n
);
2598 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2600 /* It's okay to grow etc. this buffer, and we should throw it
2601 * away when we're done.
2603 b
->yy_is_our_buffer
= 1;
2610 #ifndef YY_NO_PUSH_STATE
2611 #ifdef YY_USE_PROTOS
2612 static void yy_push_state( int new_state
)
2614 static void yy_push_state( new_state
)
2618 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2622 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2623 new_size
= yy_start_stack_depth
* sizeof( int );
2625 if ( ! yy_start_stack
)
2626 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2629 yy_start_stack
= (int *) yy_flex_realloc(
2630 (void *) yy_start_stack
, new_size
);
2632 if ( ! yy_start_stack
)
2634 "out of memory expanding start-condition stack" );
2637 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2644 #ifndef YY_NO_POP_STATE
2645 static void yy_pop_state()
2647 if ( --yy_start_stack_ptr
< 0 )
2648 YY_FATAL_ERROR( "start-condition stack underflow" );
2650 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2655 #ifndef YY_NO_TOP_STATE
2656 static int yy_top_state()
2658 return yy_start_stack
[yy_start_stack_ptr
- 1];
2662 #ifndef YY_EXIT_FAILURE
2663 #define YY_EXIT_FAILURE 2
2666 #ifdef YY_USE_PROTOS
2667 static void yy_fatal_error( yyconst
char msg
[] )
2669 static void yy_fatal_error( msg
)
2673 (void) fprintf( stderr
, "%s\n", msg
);
2674 exit( YY_EXIT_FAILURE
);
2679 /* Redefine yyless() so it works in section 3 code. */
2685 /* Undo effects of setting up yytext. */ \
2686 yytext[yyleng] = yy_hold_char; \
2687 yy_c_buf_p = yytext + n; \
2688 yy_hold_char = *yy_c_buf_p; \
2689 *yy_c_buf_p = '\0'; \
2695 /* Internal utility routines. */
2698 #ifdef YY_USE_PROTOS
2699 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2701 static void yy_flex_strncpy( s1
, s2
, n
)
2708 for ( i
= 0; i
< n
; ++i
)
2713 #ifdef YY_NEED_STRLEN
2714 #ifdef YY_USE_PROTOS
2715 static int yy_flex_strlen( yyconst
char *s
)
2717 static int yy_flex_strlen( s
)
2722 for ( n
= 0; s
[n
]; ++n
)
2730 #ifdef YY_USE_PROTOS
2731 static void *yy_flex_alloc( yy_size_t size
)
2733 static void *yy_flex_alloc( size
)
2737 return (void *) malloc( size
);
2740 #ifdef YY_USE_PROTOS
2741 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2743 static void *yy_flex_realloc( ptr
, size
)
2748 /* The cast to (char *) in the following accommodates both
2749 * implementations that use char* generic pointers, and those
2750 * that use void* generic pointers. It works with the latter
2751 * because both ANSI C and C++ allow castless assignment from
2752 * any pointer type to void*, and deal with argument conversions
2753 * as though doing an assignment.
2755 return (void *) realloc( (char *) ptr
, size
);
2758 #ifdef YY_USE_PROTOS
2759 static void yy_flex_free( void *ptr
)
2761 static void yy_flex_free( ptr
)
2775 #line 530 "scan-gram.l"
2778 /*------------------------------------------------------------------.
2779 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2781 | Possible inputs: $[<TYPENAME>]($|integer) |
2783 | Output to the STRING_OBSTACK a reference to this semantic value. |
2784 `------------------------------------------------------------------*/
2787 handle_action_dollar (char *text
, location_t location
)
2789 const char *type_name
= NULL
;
2790 char *cp
= text
+ 1;
2792 /* Get the type name if explicit. */
2805 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2806 if (!type_name
&& typed
)
2807 complain_at (location
, _("$$ of `%s' has no declared type"),
2808 current_rule
->sym
->tag
);
2811 obstack_fgrow1 (&string_obstack
,
2812 "]b4_lhs_value([%s])[", type_name
);
2814 else if (('0' <= *cp
&& *cp
<= '9') || *cp
== '-')
2816 int n
= strtol (cp
, &cp
, 10);
2818 if (n
> rule_length
)
2819 complain_at (location
, _("invalid value: %s%d"), "$", n
);
2822 if (!type_name
&& n
> 0)
2823 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
2825 if (!type_name
&& typed
)
2826 complain_at (location
, _("$%d of `%s' has no declared type"),
2827 n
, current_rule
->sym
->tag
);
2830 obstack_fgrow3 (&string_obstack
,
2831 "]b4_rhs_value([%d], [%d], [%s])[",
2832 rule_length
, n
, type_name
);
2837 complain_at (location
, _("%s is invalid"), quote (text
));
2842 /*---------------------------------------------------------------.
2843 | TEXT is expexted tp be $$ in some code associated to a symbol: |
2844 | destructor or printer. |
2845 `---------------------------------------------------------------*/
2848 handle_symbol_code_dollar (char *text
, location_t location
)
2850 char *cp
= text
+ 1;
2852 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
2854 complain_at (location
, _("%s is invalid"), quote (text
));
2858 /*-----------------------------------------------------------------.
2859 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2860 | depending upon CODE_KIND. |
2861 `-----------------------------------------------------------------*/
2864 handle_dollar (braced_code_t braced_code_kind
,
2865 char *text
, location_t location
)
2867 switch (braced_code_kind
)
2869 case action_braced_code
:
2870 handle_action_dollar (text
, location
);
2873 case destructor_braced_code
:
2874 case printer_braced_code
:
2875 handle_symbol_code_dollar (text
, location
);
2881 /*------------------------------------------------------.
2882 | TEXT is a location token (i.e., a `@...'). Output to |
2883 | STRING_OBSTACK a reference to this location. |
2884 `------------------------------------------------------*/
2887 handle_action_at (char *text
, location_t location
)
2889 char *cp
= text
+ 1;
2894 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
2896 else if (('0' <= *cp
&& *cp
<= '9') || *cp
== '-')
2898 int n
= strtol (cp
, &cp
, 10);
2900 if (n
> rule_length
)
2901 complain_at (location
, _("invalid value: %s%d"), "@", n
);
2903 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
2908 complain_at (location
, _("%s is invalid"), quote (text
));
2913 /*---------------------------------------------------------------.
2914 | TEXT is expexted tp be @$ in some code associated to a symbol: |
2915 | destructor or printer. |
2916 `---------------------------------------------------------------*/
2919 handle_symbol_code_at (char *text
, location_t location
)
2921 char *cp
= text
+ 1;
2923 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
2925 complain_at (location
, _("%s is invalid"), quote (text
));
2929 /*-------------------------------------------------------------------.
2930 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
2932 `-------------------------------------------------------------------*/
2935 handle_at (braced_code_t braced_code_kind
,
2936 char *text
, location_t location
)
2938 switch (braced_code_kind
)
2940 case action_braced_code
:
2941 handle_action_at (text
, location
);
2944 case destructor_braced_code
:
2945 case printer_braced_code
:
2946 handle_symbol_code_at (text
, location
);
2952 /*-------------------------.
2953 | Initialize the scanner. |
2954 `-------------------------*/
2957 scanner_initialize (void)
2959 obstack_init (&string_obstack
);
2963 /*-----------------------------------------------.
2964 | Free all the memory allocated to the scanner. |
2965 `-----------------------------------------------*/
2970 obstack_free (&string_obstack
, 0);
2971 /* Reclaim Flex's buffers. */
2972 yy_delete_buffer (YY_CURRENT_BUFFER
);