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
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 98
313 #define YY_END_OF_BUFFER 99
314 static yyconst
short int yy_accept
[361] =
316 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
317 0, 0, 0, 0, 0, 0, 0, 0, 99, 46,
318 35, 34, 34, 39, 46, 38, 36, 46, 37, 31,
319 33, 46, 30, 43, 32, 50, 51, 51, 52, 47,
320 48, 77, 80, 80, 76, 47, 79, 48, 72, 75,
321 75, 71, 74, 54, 55, 55, 53, 70, 57, 58,
322 58, 56, 90, 91, 91, 82, 92, 81, 85, 92,
323 47, 48, 87, 86, 94, 96, 96, 82, 95, 81,
324 85, 97, 97, 97, 82, 81, 85, 35, 34, 34,
325 34, 34, 45, 0, 0, 0, 0, 0, 0, 0,
327 0, 0, 0, 0, 0, 0, 0, 42, 36, 40,
328 41, 37, 0, 50, 51, 51, 51, 51, 49, 77,
329 80, 80, 80, 80, 78, 72, 75, 75, 75, 75,
330 73, 54, 55, 55, 55, 55, 69, 68, 69, 61,
331 62, 63, 64, 65, 66, 67, 69, 58, 58, 58,
332 58, 90, 91, 91, 91, 91, 88, 0, 88, 0,
333 83, 84, 89, 0, 89, 94, 96, 96, 96, 96,
334 93, 97, 97, 97, 97, 97, 83, 84, 0, 0,
335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
336 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
338 41, 44, 0, 0, 0, 84, 84, 84, 0, 0,
339 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
340 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
341 0, 0, 0, 0, 0, 59, 60, 0, 0, 0,
342 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
343 0, 0, 0, 17, 0, 0, 0, 0, 0, 23,
344 0, 26, 0, 0, 29, 0, 2, 0, 0, 0,
345 0, 0, 0, 0, 0, 0, 0, 15, 0, 0,
346 0, 20, 0, 22, 24, 27, 0, 1, 3, 0,
347 0, 7, 0, 0, 0, 0, 0, 0, 16, 0,
349 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
350 0, 0, 0, 18, 0, 0, 0, 28, 0, 0,
351 0, 0, 0, 0, 13, 14, 0, 21, 0, 0,
352 0, 0, 0, 11, 0, 0, 0, 5, 0, 0,
353 0, 0, 0, 0, 0, 8, 0, 12, 19, 25,
354 0, 0, 6, 0, 0, 0, 0, 0, 9, 0
357 static yyconst
int yy_ec
[256] =
359 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
360 1, 2, 4, 1, 1, 1, 1, 1, 1, 1,
361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 2, 1, 5, 1, 6, 7, 1, 8, 1,
363 1, 9, 1, 1, 10, 11, 12, 13, 13, 13,
364 13, 13, 13, 13, 13, 14, 14, 15, 16, 17,
365 18, 19, 1, 20, 21, 21, 21, 21, 21, 21,
366 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
367 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
368 22, 23, 24, 1, 25, 1, 26, 27, 28, 29,
370 30, 31, 32, 33, 34, 11, 35, 36, 37, 38,
371 39, 40, 11, 41, 42, 43, 44, 45, 11, 46,
372 47, 11, 48, 49, 50, 1, 1, 1, 1, 1,
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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,
389 static yyconst
int yy_meta
[51] =
391 1, 1, 2, 3, 4, 5, 6, 7, 8, 1,
392 9, 10, 11, 11, 1, 1, 1, 1, 12, 5,
393 11, 13, 14, 13, 9, 11, 11, 11, 11, 11,
394 11, 9, 9, 9, 9, 9, 9, 9, 9, 9,
395 9, 9, 9, 9, 9, 9, 9, 5, 1, 5
398 static yyconst
short int yy_base
[387] =
400 0, 0, 48, 51, 58, 61, 83, 86, 73, 94,
401 108, 110, 131, 179, 227, 249, 116, 142, 819, 820,
402 816, 55, 64, 820, 267, 820, 0, 44, 79, 820,
403 820, 0, 820, 820, 820, 0, 97, 99, 805, 820,
404 820, 0, 119, 122, 820, 820, 0, 820, 0, 126,
405 138, 820, 0, 0, 145, 153, 820, 311, 820, 155,
406 157, 820, 0, 159, 164, 820, 159, 820, 62, 164,
407 820, 820, 820, 820, 0, 185, 189, 820, 766, 820,
408 185, 192, 201, 203, 205, 207, 209, 813, 211, 213,
409 216, 219, 820, 780, 783, 86, 778, 49, 198, 767,
411 184, 776, 109, 203, 771, 778, 781, 820, 0, 820,
412 0, 230, 787, 0, 242, 244, 255, 259, 820, 0,
413 261, 263, 265, 272, 820, 0, 274, 276, 278, 280,
414 820, 0, 282, 284, 286, 288, 820, 820, 792, 820,
415 820, 820, 820, 820, 820, 820, 0, 296, 298, 314,
416 316, 0, 318, 322, 324, 326, 820, 318, 322, 0,
417 820, 0, 820, 326, 330, 0, 342, 344, 347, 355,
418 820, 357, 359, 361, 363, 365, 367, 369, 766, 144,
419 762, 762, 144, 770, 772, 762, 364, 768, 754, 168,
420 755, 763, 764, 767, 751, 756, 750, 755, 747, 759,
422 0, 820, 773, 0, 766, 0, 372, 375, 758, 739,
423 748, 738, 741, 749, 748, 747, 733, 749, 744, 737,
424 746, 730, 730, 741, 730, 737, 733, 729, 723, 726,
425 732, 731, 721, 732, 730, 820, 820, 371, 716, 724,
426 717, 713, 712, 724, 741, 721, 820, 706, 230, 714,
427 705, 709, 701, 820, 701, 370, 700, 712, 698, 820,
428 702, 820, 701, 699, 820, 690, 820, 706, 691, 373,
429 691, 693, 376, 698, 691, 692, 687, 820, 685, 697,
430 686, 820, 682, 820, 378, 820, 682, 820, 681, 668,
431 647, 820, 627, 626, 612, 607, 615, 605, 820, 601,
433 615, 601, 594, 604, 820, 588, 599, 598, 583, 588,
434 571, 558, 571, 820, 537, 536, 547, 820, 510, 507,
435 516, 501, 497, 503, 820, 820, 491, 820, 502, 363,
436 373, 358, 347, 820, 348, 325, 317, 820, 302, 287,
437 279, 267, 263, 265, 251, 820, 229, 820, 820, 820,
438 240, 380, 820, 229, 192, 164, 85, 62, 820, 820,
439 405, 419, 433, 447, 461, 475, 489, 503, 227, 517,
440 531, 545, 557, 571, 583, 597, 610, 624, 638, 652,
441 666, 84, 680, 694, 708, 58
444 static yyconst
short int yy_def
[387] =
446 360, 1, 361, 361, 362, 362, 363, 363, 364, 364,
447 365, 365, 366, 366, 367, 367, 368, 368, 360, 360,
448 360, 360, 360, 360, 360, 360, 369, 360, 360, 360,
449 360, 370, 360, 360, 360, 371, 360, 360, 360, 360,
450 360, 372, 360, 360, 360, 360, 373, 360, 374, 360,
451 360, 360, 375, 376, 360, 360, 360, 377, 360, 360,
452 360, 360, 378, 360, 360, 360, 360, 360, 360, 360,
453 360, 360, 360, 360, 379, 360, 360, 360, 360, 360,
454 360, 380, 380, 380, 380, 380, 380, 360, 360, 360,
455 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
457 360, 360, 360, 360, 360, 360, 360, 360, 369, 360,
458 381, 360, 370, 371, 360, 360, 360, 360, 360, 372,
459 360, 360, 360, 360, 360, 374, 360, 360, 360, 360,
460 360, 376, 360, 360, 360, 360, 360, 360, 360, 360,
461 360, 360, 360, 360, 360, 360, 382, 360, 360, 360,
462 360, 378, 360, 360, 360, 360, 360, 360, 360, 383,
463 360, 384, 360, 360, 360, 379, 360, 360, 360, 360,
464 360, 380, 380, 380, 380, 380, 380, 385, 360, 360,
465 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
466 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
468 381, 360, 360, 386, 383, 384, 385, 385, 360, 360,
469 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
470 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
471 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
472 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
473 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
474 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
475 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
476 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
477 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
479 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
480 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
481 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
482 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
483 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
484 360, 360, 360, 360, 360, 360, 360, 360, 360, 0,
485 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
486 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
487 360, 360, 360, 360, 360, 360
490 static yyconst
short int yy_nxt
[871] =
492 20, 21, 22, 23, 24, 20, 25, 26, 20, 20,
493 27, 28, 29, 29, 30, 31, 32, 33, 20, 20,
494 27, 20, 20, 20, 20, 27, 27, 27, 27, 27,
495 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
496 27, 27, 27, 27, 27, 27, 27, 34, 35, 20,
497 37, 38, 110, 37, 38, 111, 39, 89, 90, 39,
498 43, 44, 45, 43, 44, 45, 91, 92, 237, 40,
499 161, 41, 40, 162, 41, 55, 56, 57, 184, 46,
500 47, 48, 46, 47, 48, 50, 51, 185, 50, 51,
501 52, 112, 112, 52, 204, 58, 55, 56, 57, 115,
503 116, 117, 118, 359, 46, 53, 48, 46, 53, 48,
504 60, 61, 60, 61, 358, 62, 58, 62, 83, 84,
505 85, 121, 122, 86, 123, 124, 181, 87, 127, 128,
506 58, 182, 58, 64, 65, 66, 67, 46, 68, 48,
507 129, 130, 69, 193, 83, 84, 85, 133, 134, 86,
508 70, 194, 71, 87, 72, 135, 136, 148, 149, 150,
509 151, 153, 154, 46, 157, 48, 155, 156, 158, 163,
510 210, 159, 159, 164, 211, 160, 165, 165, 73, 215,
511 74, 64, 65, 66, 67, 212, 68, 167, 168, 216,
512 69, 169, 170, 161, 173, 174, 162, 224, 70, 357,
514 71, 225, 72, 173, 175, 176, 174, 173, 174, 173,
515 174, 173, 174, 89, 90, 91, 92, 177, 89, 90,
516 178, 91, 92, 186, 190, 356, 73, 191, 74, 76,
517 77, 78, 195, 79, 80, 109, 187, 109, 81, 275,
518 188, 196, 112, 112, 115, 116, 117, 118, 46, 197,
519 48, 76, 77, 78, 275, 79, 80, 115, 116, 355,
520 81, 117, 118, 121, 122, 123, 124, 121, 122, 353,
521 46, 352, 48, 93, 123, 124, 127, 128, 129, 130,
522 127, 128, 129, 130, 133, 134, 135, 136, 133, 134,
523 135, 136, 351, 94, 350, 95, 96, 97, 148, 149,
525 150, 151, 98, 349, 99, 100, 101, 102, 103, 104,
526 105, 106, 348, 107, 108, 138, 148, 149, 150, 151,
527 153, 154, 347, 139, 155, 156, 153, 154, 155, 156,
528 159, 159, 346, 138, 159, 159, 140, 141, 165, 165,
529 345, 142, 165, 165, 167, 168, 169, 170, 143, 167,
530 168, 144, 344, 145, 343, 146, 147, 169, 170, 173,
531 174, 173, 175, 176, 174, 176, 174, 173, 175, 173,
532 174, 173, 208, 220, 173, 208, 157, 176, 208, 281,
533 158, 342, 291, 159, 159, 294, 341, 303, 220, 354,
534 206, 340, 206, 206, 281, 206, 206, 291, 206, 339,
536 294, 221, 303, 338, 354, 36, 36, 36, 36, 36,
537 36, 36, 36, 36, 36, 36, 36, 36, 36, 42,
538 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
539 42, 42, 42, 49, 49, 49, 49, 49, 49, 49,
540 49, 49, 49, 49, 49, 49, 49, 54, 54, 54,
541 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
542 54, 59, 59, 59, 59, 59, 59, 59, 59, 59,
543 59, 59, 59, 59, 59, 63, 63, 63, 63, 63,
544 63, 63, 63, 63, 63, 63, 63, 63, 63, 75,
545 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
547 75, 75, 75, 82, 82, 82, 82, 82, 82, 82,
548 82, 82, 82, 82, 82, 82, 82, 113, 113, 113,
549 113, 113, 113, 113, 113, 113, 113, 113, 337, 113,
550 113, 114, 336, 335, 114, 114, 114, 114, 334, 114,
551 114, 114, 114, 333, 114, 120, 332, 331, 330, 120,
552 120, 120, 120, 120, 120, 120, 120, 125, 125, 125,
553 125, 125, 125, 125, 125, 125, 125, 125, 125, 125,
554 125, 126, 329, 328, 126, 126, 126, 327, 126, 126,
555 126, 126, 126, 131, 131, 131, 131, 131, 131, 131,
556 131, 131, 131, 131, 131, 131, 131, 132, 326, 325,
558 324, 132, 132, 132, 132, 132, 132, 132, 132, 132,
559 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
560 137, 137, 137, 137, 152, 323, 322, 321, 320, 152,
561 319, 152, 152, 318, 152, 152, 317, 152, 166, 316,
562 315, 314, 166, 313, 312, 166, 166, 311, 166, 166,
563 310, 166, 172, 172, 172, 172, 172, 172, 172, 172,
564 172, 172, 172, 172, 309, 172, 201, 308, 201, 201,
565 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
566 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
567 205, 307, 205, 205, 206, 306, 206, 206, 206, 206,
569 206, 206, 206, 206, 206, 206, 206, 206, 207, 207,
570 207, 207, 207, 207, 207, 207, 207, 207, 207, 207,
571 207, 207, 305, 304, 302, 301, 300, 299, 298, 297,
572 296, 295, 293, 292, 290, 289, 288, 287, 286, 285,
573 284, 283, 282, 280, 279, 278, 277, 276, 274, 273,
574 272, 271, 270, 269, 268, 267, 266, 265, 264, 263,
575 262, 261, 260, 259, 258, 257, 256, 255, 254, 253,
576 252, 251, 250, 249, 248, 247, 246, 245, 244, 243,
577 242, 241, 240, 239, 238, 236, 235, 234, 233, 232,
578 231, 230, 229, 228, 227, 226, 223, 222, 219, 218,
580 217, 214, 213, 209, 203, 202, 200, 199, 198, 192,
581 189, 183, 180, 179, 88, 171, 119, 88, 360, 19,
582 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
583 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
584 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
585 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
586 360, 360, 360, 360, 360, 360, 360, 360, 360, 360
589 static yyconst
short int yy_chk
[871] =
591 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
592 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
593 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
594 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
595 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
596 3, 3, 28, 4, 4, 28, 3, 22, 22, 4,
597 5, 5, 5, 6, 6, 6, 23, 23, 386, 3,
598 69, 3, 4, 69, 4, 9, 9, 9, 98, 5,
599 5, 5, 6, 6, 6, 7, 7, 98, 8, 8,
600 7, 29, 29, 8, 382, 9, 10, 10, 10, 37,
602 37, 38, 38, 358, 7, 7, 7, 8, 8, 8,
603 11, 11, 12, 12, 357, 11, 10, 12, 17, 17,
604 17, 43, 43, 17, 44, 44, 96, 17, 50, 50,
605 11, 96, 12, 13, 13, 13, 13, 17, 13, 17,
606 51, 51, 13, 103, 18, 18, 18, 55, 55, 18,
607 13, 103, 13, 18, 13, 56, 56, 60, 60, 61,
608 61, 64, 64, 18, 67, 18, 65, 65, 67, 70,
609 180, 67, 67, 70, 180, 67, 70, 70, 13, 183,
610 13, 14, 14, 14, 14, 180, 14, 76, 76, 183,
611 14, 77, 77, 81, 82, 82, 81, 190, 14, 356,
613 14, 190, 14, 83, 83, 84, 84, 85, 85, 86,
614 86, 87, 87, 89, 89, 90, 90, 87, 91, 91,
615 87, 92, 92, 99, 101, 355, 14, 101, 14, 15,
616 15, 15, 104, 15, 15, 369, 99, 369, 15, 249,
617 99, 104, 112, 112, 115, 115, 116, 116, 15, 104,
618 15, 16, 16, 16, 249, 16, 16, 117, 117, 354,
619 16, 118, 118, 121, 121, 122, 122, 123, 123, 351,
620 16, 347, 16, 25, 124, 124, 127, 127, 128, 128,
621 129, 129, 130, 130, 133, 133, 134, 134, 135, 135,
622 136, 136, 345, 25, 344, 25, 25, 25, 148, 148,
624 149, 149, 25, 343, 25, 25, 25, 25, 25, 25,
625 25, 25, 342, 25, 25, 58, 150, 150, 151, 151,
626 153, 153, 341, 58, 154, 154, 155, 155, 156, 156,
627 158, 158, 340, 58, 159, 159, 58, 58, 164, 164,
628 339, 58, 165, 165, 167, 167, 168, 168, 58, 169,
629 169, 58, 337, 58, 336, 58, 58, 170, 170, 172,
630 172, 173, 173, 174, 174, 175, 175, 176, 176, 177,
631 177, 178, 178, 187, 207, 207, 238, 208, 208, 256,
632 238, 335, 270, 238, 238, 273, 333, 285, 187, 352,
633 178, 332, 178, 207, 256, 207, 208, 270, 208, 331,
635 273, 187, 285, 330, 352, 361, 361, 361, 361, 361,
636 361, 361, 361, 361, 361, 361, 361, 361, 361, 362,
637 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
638 362, 362, 362, 363, 363, 363, 363, 363, 363, 363,
639 363, 363, 363, 363, 363, 363, 363, 364, 364, 364,
640 364, 364, 364, 364, 364, 364, 364, 364, 364, 364,
641 364, 365, 365, 365, 365, 365, 365, 365, 365, 365,
642 365, 365, 365, 365, 365, 366, 366, 366, 366, 366,
643 366, 366, 366, 366, 366, 366, 366, 366, 366, 367,
644 367, 367, 367, 367, 367, 367, 367, 367, 367, 367,
646 367, 367, 367, 368, 368, 368, 368, 368, 368, 368,
647 368, 368, 368, 368, 368, 368, 368, 370, 370, 370,
648 370, 370, 370, 370, 370, 370, 370, 370, 329, 370,
649 370, 371, 327, 324, 371, 371, 371, 371, 323, 371,
650 371, 371, 371, 322, 371, 372, 321, 320, 319, 372,
651 372, 372, 372, 372, 372, 372, 372, 373, 373, 373,
652 373, 373, 373, 373, 373, 373, 373, 373, 373, 373,
653 373, 374, 317, 316, 374, 374, 374, 315, 374, 374,
654 374, 374, 374, 375, 375, 375, 375, 375, 375, 375,
655 375, 375, 375, 375, 375, 375, 375, 376, 313, 312,
657 311, 376, 376, 376, 376, 376, 376, 376, 376, 376,
658 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
659 377, 377, 377, 377, 378, 310, 309, 308, 307, 378,
660 306, 378, 378, 304, 378, 378, 303, 378, 379, 302,
661 301, 300, 379, 298, 297, 379, 379, 296, 379, 379,
662 295, 379, 380, 380, 380, 380, 380, 380, 380, 380,
663 380, 380, 380, 380, 294, 380, 381, 293, 381, 381,
664 381, 381, 381, 381, 381, 381, 381, 381, 381, 381,
665 383, 383, 383, 383, 383, 383, 383, 383, 383, 383,
666 383, 291, 383, 383, 384, 290, 384, 384, 384, 384,
668 384, 384, 384, 384, 384, 384, 384, 384, 385, 385,
669 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
670 385, 385, 289, 287, 283, 281, 280, 279, 277, 276,
671 275, 274, 272, 271, 269, 268, 266, 264, 263, 261,
672 259, 258, 257, 255, 253, 252, 251, 250, 248, 246,
673 245, 244, 243, 242, 241, 240, 239, 235, 234, 233,
674 232, 231, 230, 229, 228, 227, 226, 225, 224, 223,
675 222, 221, 220, 219, 218, 217, 216, 215, 214, 213,
676 212, 211, 210, 209, 205, 203, 200, 199, 198, 197,
677 196, 195, 194, 193, 192, 191, 189, 188, 186, 185,
679 184, 182, 181, 179, 139, 113, 107, 106, 105, 102,
680 100, 97, 95, 94, 88, 79, 39, 21, 19, 360,
681 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
682 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
683 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
684 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
685 360, 360, 360, 360, 360, 360, 360, 360, 360, 360
688 static yy_state_type yy_last_accepting_state
;
689 static char *yy_last_accepting_cpos
;
691 extern int yy_flex_debug
;
692 int yy_flex_debug
= 1;
694 static yyconst
short int yy_rule_linenum
[98] =
696 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
697 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
698 142, 143, 144, 145, 146, 147, 148, 149, 150, 152,
699 153, 154, 155, 157, 158, 159, 164, 167, 170, 173,
700 174, 177, 180, 183, 191, 197, 213, 214, 225, 237,
701 238, 239, 256, 265, 267, 287, 301, 303, 323, 335,
702 339, 340, 341, 342, 343, 344, 345, 346, 347, 353,
703 364, 370, 371, 373, 375, 393, 399, 400, 402, 404,
704 422, 425, 428, 429, 432, 443, 454, 456, 458, 461,
705 462, 465, 485, 492, 493, 494, 514
709 /* The intent behind this definition is that it'll catch
710 * any uses of REJECT which flex missed.
712 #define REJECT reject_used_but_not_detected
713 #define yymore() yymore_used_but_not_detected
714 #define YY_MORE_ADJ 0
715 #define YY_RESTORE_YY_MORE_OFFSET
717 #line 1 "scan-gram.l"
719 /* Bison Grammar Scanner -*- C -*-
720 Copyright (C) 2002 Free Software Foundation, Inc.
722 This file is part of Bison, the GNU Compiler Compiler.
724 This program is free software; you can redistribute it and/or modify
725 it under the terms of the GNU General Public License as published by
726 the Free Software Foundation; either version 2 of the License, or
727 (at your option) any later version.
729 This program is distributed in the hope that it will be useful,
730 but WITHOUT ANY WARRANTY; without even the implied warranty of
731 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
732 GNU General Public License for more details.
734 You should have received a copy of the GNU General Public License
735 along with this program; if not, write to the Free Software
736 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
739 #define YY_NO_UNPUT 1
740 #define YY_NEVER_INTERACTIVE 1
741 #define YY_STACK_USED 1
742 #line 26 "scan-gram.l"
744 #include "complain.h"
750 /* Each time we match a string, move the end cursor to its end. */
751 #define YY_USER_INIT \
753 LOCATION_RESET (*yylloc); \
754 /* This is only to avoid GCC warnings. */ \
755 if (yycontrol) {;}; \
758 #define YY_USER_ACTION LOCATION_COLUMNS (*yylloc, yyleng)
759 #define YY_LINES LOCATION_LINES (*yylloc, yyleng); lineno += yyleng;
760 #define YY_STEP LOCATION_STEP (*yylloc)
763 /* STRING_OBSTACK -- Used to store all the characters that we need to
764 keep (to construct ID, STRINGS etc.). Use the following macros to
767 Use YY_OBS_GROW to append what has just been matched, and
768 YY_OBS_FINISH to end the string (it puts the ending 0).
769 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
770 used, and which is used by YY_OBS_FREE to free the last string. */
772 static struct obstack string_obstack
;
775 #define YY_OBS_GROW \
776 obstack_grow (&string_obstack, yytext, yyleng)
778 #define YY_OBS_FINISH \
780 obstack_1grow (&string_obstack, '\0'); \
781 last_string = obstack_finish (&string_obstack); \
784 #define YY_OBS_FREE \
786 obstack_free (&string_obstack, last_string); \
790 scanner_last_string_free (void)
796 static int braces_level
= 0;
797 static int percent_percent_count
= 0;
799 static void handle_dollar
PARAMS ((braced_code_t code_kind
,
800 char *cp
, location_t location
));
801 static void handle_at
PARAMS ((braced_code_t code_kind
,
802 char *cp
, location_t location
));
807 #define SC_CHARACTER 3
809 #define SC_ESCAPED_STRING 4
810 #define SC_ESCAPED_CHARACTER 5
812 #define SC_BRACED_CODE 6
813 #define SC_PROLOGUE 7
814 #define SC_EPILOGUE 8
818 /* Macros after this point can all be overridden by user definitions in
822 #ifndef YY_SKIP_YYWRAP
824 extern "C" int yywrap
YY_PROTO(( void ));
826 extern int yywrap
YY_PROTO(( void ));
831 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
835 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
838 #ifdef YY_NEED_STRLEN
839 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
844 static int yyinput
YY_PROTO(( void ));
846 static int input
YY_PROTO(( void ));
851 static int yy_start_stack_ptr
= 0;
852 static int yy_start_stack_depth
= 0;
853 static int *yy_start_stack
= 0;
854 #ifndef YY_NO_PUSH_STATE
855 static void yy_push_state
YY_PROTO(( int new_state
));
857 #ifndef YY_NO_POP_STATE
858 static void yy_pop_state
YY_PROTO(( void ));
860 #ifndef YY_NO_TOP_STATE
861 static int yy_top_state
YY_PROTO(( void ));
865 #define YY_NO_PUSH_STATE 1
866 #define YY_NO_POP_STATE 1
867 #define YY_NO_TOP_STATE 1
870 #ifdef YY_MALLOC_DECL
878 /* Just try to get by without declaring the routines. This will fail
879 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
880 * or sizeof(void*) != sizeof(int).
885 /* Amount of stuff to slurp up with each read. */
886 #ifndef YY_READ_BUF_SIZE
887 #define YY_READ_BUF_SIZE 8192
890 /* Copy whatever the last rule matched to the standard output. */
893 /* This used to be an fputs(), but since the string might contain NUL's,
894 * we now use fwrite().
896 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
899 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
900 * is returned in "result".
903 #define YY_INPUT(buf,result,max_size) \
904 if ( yy_current_buffer->yy_is_interactive ) \
907 for ( n = 0; n < max_size && \
908 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
911 buf[n++] = (char) c; \
912 if ( c == EOF && ferror( yyin ) ) \
913 YY_FATAL_ERROR( "input in flex scanner failed" ); \
919 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
921 if( errno != EINTR) \
923 YY_FATAL_ERROR( "input in flex scanner failed" ); \
932 /* No semi-colon after return; correct usage is to write "yyterminate();" -
933 * we don't want an extra ';' after the "return" because that will cause
934 * some compilers to complain about unreachable statements.
937 #define yyterminate() return YY_NULL
940 /* Number of entries by which start-condition stack grows. */
941 #ifndef YY_START_STACK_INCR
942 #define YY_START_STACK_INCR 25
945 /* Report a fatal error. */
946 #ifndef YY_FATAL_ERROR
947 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
950 /* Default declaration of generated scanner - a define so the user can
951 * easily add parameters.
954 #define YY_DECL int yylex YY_PROTO(( void ))
957 /* Code executed at the beginning of each rule, after yytext and yyleng
960 #ifndef YY_USER_ACTION
961 #define YY_USER_ACTION
964 /* Code executed at the end of each rule. */
966 #define YY_BREAK break;
969 #define YY_RULE_SETUP \
974 register yy_state_type yy_current_state
;
975 register char *yy_cp
, *yy_bp
;
978 #line 98 "scan-gram.l"
981 /* At each yylex invocation, mark the current position as the
982 start of the next token. */
985 fprintf (stderr
, "FOO1: %p: ", yylloc
);
986 LOCATION_PRINT (stderr
, *yylloc
);
987 fprintf (stderr
, "\n");
991 fprintf (stderr
, "BAR1: ");
992 LOCATION_PRINT (stderr
, *yylloc
);
993 fprintf (stderr
, "\n");
998 /*----------------------------.
999 | Scanning Bison directives. |
1000 `----------------------------*/
1001 #line 1002 "lex.yy.c"
1012 yy_start
= 1; /* first start state */
1020 if ( ! yy_current_buffer
)
1022 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1024 yy_load_buffer_state();
1027 while ( 1 ) /* loops until end-of-file is reached */
1031 /* Support of yytext. */
1032 *yy_cp
= yy_hold_char
;
1034 /* yy_bp points to the position in yy_ch_buf of the start of
1039 yy_current_state
= yy_start
;
1043 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1044 if ( yy_accept
[yy_current_state
] )
1046 yy_last_accepting_state
= yy_current_state
;
1047 yy_last_accepting_cpos
= yy_cp
;
1049 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1051 yy_current_state
= (int) yy_def
[yy_current_state
];
1052 if ( yy_current_state
>= 361 )
1053 yy_c
= yy_meta
[(unsigned int) yy_c
];
1055 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1058 while ( yy_base
[yy_current_state
] != 820 );
1061 yy_act
= yy_accept
[yy_current_state
];
1063 { /* have to back up */
1064 yy_cp
= yy_last_accepting_cpos
;
1065 yy_current_state
= yy_last_accepting_state
;
1066 yy_act
= yy_accept
[yy_current_state
];
1069 YY_DO_BEFORE_ACTION
;
1072 do_action
: /* This label is used only to access EOF actions. */
1074 if ( yy_flex_debug
)
1077 fprintf( stderr
, "--scanner backing up\n" );
1078 else if ( yy_act
< 98 )
1079 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1080 yy_rule_linenum
[yy_act
], yytext
);
1081 else if ( yy_act
== 98 )
1082 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1084 else if ( yy_act
== 99 )
1085 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1087 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1091 { /* beginning of action switch */
1092 case 0: /* must back up */
1093 /* undo the effects of YY_DO_BEFORE_ACTION */
1094 *yy_cp
= yy_hold_char
;
1095 yy_cp
= yy_last_accepting_cpos
;
1096 yy_current_state
= yy_last_accepting_state
;
1097 goto yy_find_action
;
1103 #line 122 "scan-gram.l"
1104 return PERCENT_NONASSOC
;
1108 #line 123 "scan-gram.l"
1109 return PERCENT_DEBUG
;
1113 #line 124 "scan-gram.l"
1114 return PERCENT_DEFINE
;
1118 #line 125 "scan-gram.l"
1119 return PERCENT_DEFINES
;
1123 #line 126 "scan-gram.l"
1124 return PERCENT_DESTRUCTOR
;
1128 #line 127 "scan-gram.l"
1129 return PERCENT_ERROR_VERBOSE
;
1133 #line 128 "scan-gram.l"
1134 return PERCENT_EXPECT
;
1138 #line 129 "scan-gram.l"
1139 return PERCENT_FILE_PREFIX
;
1143 #line 130 "scan-gram.l"
1144 return PERCENT_YACC
;
1148 #line 131 "scan-gram.l"
1149 return PERCENT_LEFT
;
1153 #line 132 "scan-gram.l"
1154 return PERCENT_LOCATIONS
;
1158 #line 133 "scan-gram.l"
1159 return PERCENT_NAME_PREFIX
;
1163 #line 134 "scan-gram.l"
1164 return PERCENT_NO_LINES
;
1168 #line 135 "scan-gram.l"
1169 return PERCENT_NONASSOC
;
1173 #line 136 "scan-gram.l"
1174 return PERCENT_NTERM
;
1178 #line 137 "scan-gram.l"
1179 return PERCENT_OUTPUT
;
1183 #line 138 "scan-gram.l"
1184 return PERCENT_PREC
;
1188 #line 139 "scan-gram.l"
1189 return PERCENT_PRINTER
;
1193 #line 140 "scan-gram.l"
1194 return PERCENT_PURE_PARSER
;
1198 #line 141 "scan-gram.l"
1199 return PERCENT_RIGHT
;
1203 #line 142 "scan-gram.l"
1204 return PERCENT_SKELETON
;
1208 #line 143 "scan-gram.l"
1209 return PERCENT_START
;
1213 #line 144 "scan-gram.l"
1214 return PERCENT_TOKEN
;
1218 #line 145 "scan-gram.l"
1219 return PERCENT_TOKEN
;
1223 #line 146 "scan-gram.l"
1224 return PERCENT_TOKEN_TABLE
;
1228 #line 147 "scan-gram.l"
1229 return PERCENT_TYPE
;
1233 #line 148 "scan-gram.l"
1234 return PERCENT_UNION
;
1238 #line 149 "scan-gram.l"
1239 return PERCENT_VERBOSE
;
1243 #line 150 "scan-gram.l"
1244 return PERCENT_YACC
;
1248 #line 152 "scan-gram.l"
1253 #line 153 "scan-gram.l"
1258 #line 154 "scan-gram.l"
1263 #line 155 "scan-gram.l"
1268 #line 157 "scan-gram.l"
1273 #line 158 "scan-gram.l"
1278 #line 159 "scan-gram.l"
1280 yylval
->symbol
= getsym (yytext
, *yylloc
);
1286 #line 164 "scan-gram.l"
1287 yylval
->integer
= strtol (yytext
, 0, 10); return INT
;
1289 /* Characters. We don't check there is only one. */
1292 #line 167 "scan-gram.l"
1293 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1298 #line 170 "scan-gram.l"
1299 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1304 #line 173 "scan-gram.l"
1305 yy_push_state (SC_COMMENT
);
1309 #line 174 "scan-gram.l"
1315 #line 177 "scan-gram.l"
1316 yy_push_state (SC_PROLOGUE
);
1318 /* Code in between braces. */
1321 #line 180 "scan-gram.l"
1322 YY_OBS_GROW
; ++braces_level
; yy_push_state (SC_BRACED_CODE
);
1327 #line 183 "scan-gram.l"
1329 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1331 yylval
->string
= last_string
;
1337 #line 191 "scan-gram.l"
1339 if (++percent_percent_count
== 2)
1340 yy_push_state (SC_EPILOGUE
);
1341 return PERCENT_PERCENT
;
1346 #line 197 "scan-gram.l"
1348 LOCATION_PRINT (stderr
, *yylloc
);
1349 fprintf (stderr
, ": invalid character: `%c'\n", *yytext
);
1354 /*------------------------------------------------------------.
1355 | Whatever the start condition (but those which correspond to |
1356 | entity `swallowed' by Bison: SC_ESCAPED_STRING and |
1357 | SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1358 `------------------------------------------------------------*/
1363 #line 213 "scan-gram.l"
1364 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@<:@");
1368 #line 214 "scan-gram.l"
1369 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@:>@");
1372 /*-----------------------------------------------------------.
1373 | Scanning a C comment. The initial `/ *' is already eaten. |
1374 `-----------------------------------------------------------*/
1379 #line 225 "scan-gram.l"
1380 { /* End of the comment. */
1381 if (yy_top_state () == INITIAL
)
1394 #line 237 "scan-gram.l"
1395 if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1399 #line 238 "scan-gram.l"
1400 if (yy_top_state () != INITIAL
) YY_OBS_GROW
; YY_LINES
;
1404 #line 239 "scan-gram.l"
1405 /* Stray `*'. */if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1407 case YY_STATE_EOF(SC_COMMENT
):
1408 #line 241 "scan-gram.l"
1410 LOCATION_PRINT (stderr
, *yylloc
);
1411 fprintf (stderr
, ": unexpected end of file in a comment\n");
1416 /*----------------------------------------------------------------.
1417 | Scanning a C string, including its escapes. The initial `"' is |
1419 `----------------------------------------------------------------*/
1424 #line 256 "scan-gram.l"
1426 assert (yy_top_state () == INITIAL
);
1429 yylval
->string
= last_string
;
1436 #line 265 "scan-gram.l"
1441 #line 267 "scan-gram.l"
1442 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1444 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1445 #line 269 "scan-gram.l"
1447 LOCATION_PRINT (stderr
, *yylloc
);
1448 fprintf (stderr
, ": unexpected end of file in a string\n");
1449 assert (yy_top_state () == INITIAL
);
1451 yylval
->string
= last_string
;
1457 /*---------------------------------------------------------------.
1458 | Scanning a C character, decoding its escapes. The initial "'" |
1459 | is already eaten. |
1460 `---------------------------------------------------------------*/
1465 #line 287 "scan-gram.l"
1468 assert (yy_top_state () == INITIAL
);
1471 yylval
->symbol
= getsym (last_string
, *yylloc
);
1472 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1473 symbol_user_token_number_set (yylval
->symbol
, last_string
[1], *yylloc
);
1482 #line 301 "scan-gram.l"
1487 #line 303 "scan-gram.l"
1488 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1490 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1491 #line 305 "scan-gram.l"
1493 LOCATION_PRINT (stderr
, *yylloc
);
1494 fprintf (stderr
, ": unexpected end of file in a character\n");
1495 assert (yy_top_state () == INITIAL
);
1497 yylval
->string
= last_string
;
1503 /*----------------------------.
1504 | Decode escaped characters. |
1505 `----------------------------*/
1510 #line 323 "scan-gram.l"
1512 long c
= strtol (yytext
+ 1, 0, 8);
1515 LOCATION_PRINT (stderr
, *yylloc
);
1516 fprintf (stderr
, ": invalid escape: %s\n", quote (yytext
));
1520 obstack_1grow (&string_obstack
, c
);
1525 #line 335 "scan-gram.l"
1527 obstack_1grow (&string_obstack
, strtol (yytext
+ 2, 0, 16));
1532 #line 339 "scan-gram.l"
1533 obstack_1grow (&string_obstack
, '\a');
1537 #line 340 "scan-gram.l"
1538 obstack_1grow (&string_obstack
, '\b');
1542 #line 341 "scan-gram.l"
1543 obstack_1grow (&string_obstack
, '\f');
1547 #line 342 "scan-gram.l"
1548 obstack_1grow (&string_obstack
, '\n');
1552 #line 343 "scan-gram.l"
1553 obstack_1grow (&string_obstack
, '\r');
1557 #line 344 "scan-gram.l"
1558 obstack_1grow (&string_obstack
, '\t');
1562 #line 345 "scan-gram.l"
1563 obstack_1grow (&string_obstack
, '\v');
1567 #line 346 "scan-gram.l"
1568 obstack_1grow (&string_obstack
, yytext
[1]);
1572 #line 347 "scan-gram.l"
1574 LOCATION_PRINT (stderr
, *yylloc
);
1575 fprintf (stderr
, ": unrecognized escape: %s\n", quote (yytext
));
1579 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1582 #line 353 "scan-gram.l"
1586 /*----------------------------------------------------------.
1587 | Scanning a C character without decoding its escapes. The |
1588 | initial "'" is already eaten. |
1589 `----------------------------------------------------------*/
1594 #line 364 "scan-gram.l"
1597 assert (yy_top_state () != INITIAL
);
1603 #line 370 "scan-gram.l"
1608 #line 371 "scan-gram.l"
1611 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1614 #line 373 "scan-gram.l"
1619 #line 375 "scan-gram.l"
1620 YY_OBS_GROW
; YY_LINES
;
1622 case YY_STATE_EOF(SC_CHARACTER
):
1623 #line 377 "scan-gram.l"
1625 LOCATION_PRINT (stderr
, *yylloc
);
1626 fprintf (stderr
, ": unexpected end of file in a character\n");
1627 assert (yy_top_state () != INITIAL
);
1632 /*----------------------------------------------------------------.
1633 | Scanning a C string, without decoding its escapes. The initial |
1634 | `"' is already eaten. |
1635 `----------------------------------------------------------------*/
1640 #line 393 "scan-gram.l"
1642 assert (yy_top_state () != INITIAL
);
1649 #line 399 "scan-gram.l"
1654 #line 400 "scan-gram.l"
1657 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1660 #line 402 "scan-gram.l"
1665 #line 404 "scan-gram.l"
1666 YY_OBS_GROW
; YY_LINES
;
1668 case YY_STATE_EOF(SC_STRING
):
1669 #line 406 "scan-gram.l"
1671 LOCATION_PRINT (stderr
, *yylloc
);
1672 fprintf (stderr
, ": unexpected end of file in a string\n");
1673 assert (yy_top_state () != INITIAL
);
1678 /*---------------------------------------------------.
1679 | Strings, comments etc. can be found in user code. |
1680 `---------------------------------------------------*/
1683 /* Characters. We don't check there is only one. */
1686 #line 422 "scan-gram.l"
1687 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1692 #line 425 "scan-gram.l"
1693 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1698 #line 428 "scan-gram.l"
1699 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1703 #line 429 "scan-gram.l"
1709 #line 432 "scan-gram.l"
1713 /*---------------------------------------------------------------.
1714 | Scanning some code in braces (%union and actions). The initial |
1715 | "{" is already eaten. |
1716 `---------------------------------------------------------------*/
1721 #line 443 "scan-gram.l"
1724 if (--braces_level
== 0)
1728 yylval
->string
= last_string
;
1735 #line 454 "scan-gram.l"
1736 YY_OBS_GROW
; braces_level
++;
1740 #line 456 "scan-gram.l"
1741 { handle_dollar (current_braced_code
,
1746 #line 458 "scan-gram.l"
1747 { handle_at (current_braced_code
,
1752 #line 461 "scan-gram.l"
1757 #line 462 "scan-gram.l"
1758 YY_OBS_GROW
; YY_LINES
;
1760 /* A lose $, or /, or etc. */
1763 #line 465 "scan-gram.l"
1766 case YY_STATE_EOF(SC_BRACED_CODE
):
1767 #line 467 "scan-gram.l"
1769 LOCATION_PRINT (stderr
, *yylloc
);
1770 fprintf (stderr
, ": unexpected end of file in a braced code\n");
1773 yylval
->string
= last_string
;
1778 /*--------------------------------------------------------------.
1779 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1780 `--------------------------------------------------------------*/
1785 #line 485 "scan-gram.l"
1789 yylval
->string
= last_string
;
1795 #line 492 "scan-gram.l"
1800 #line 493 "scan-gram.l"
1805 #line 494 "scan-gram.l"
1806 YY_OBS_GROW
; YY_LINES
;
1808 case YY_STATE_EOF(SC_PROLOGUE
):
1809 #line 496 "scan-gram.l"
1811 LOCATION_PRINT (stderr
, *yylloc
);
1812 fprintf (stderr
, ": unexpected end of file in a prologue\n");
1815 yylval
->string
= last_string
;
1820 /*---------------------------------------------------------------.
1821 | Scanning the epilogue (everything after the second "%%", which |
1822 | has already been eaten. |
1823 `---------------------------------------------------------------*/
1828 #line 514 "scan-gram.l"
1831 case YY_STATE_EOF(SC_EPILOGUE
):
1832 #line 516 "scan-gram.l"
1836 yylval
->string
= last_string
;
1843 #line 525 "scan-gram.l"
1844 YY_FATAL_ERROR( "flex scanner jammed" );
1846 #line 1847 "lex.yy.c"
1847 case YY_STATE_EOF(INITIAL
):
1850 case YY_END_OF_BUFFER
:
1852 /* Amount of text matched not including the EOB char. */
1853 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
1855 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1856 *yy_cp
= yy_hold_char
;
1857 YY_RESTORE_YY_MORE_OFFSET
1859 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1861 /* We're scanning a new file or input source. It's
1862 * possible that this happened because the user
1863 * just pointed yyin at a new source and called
1864 * yylex(). If so, then we have to assure
1865 * consistency between yy_current_buffer and our
1866 * globals. Here is the right place to do so, because
1867 * this is the first action (other than possibly a
1868 * back-up) that will match for the new input source.
1870 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1871 yy_current_buffer
->yy_input_file
= yyin
;
1872 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1875 /* Note that here we test for yy_c_buf_p "<=" to the position
1876 * of the first EOB in the buffer, since yy_c_buf_p will
1877 * already have been incremented past the NUL character
1878 * (since all states make transitions on EOB to the
1879 * end-of-buffer state). Contrast this with the test
1882 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1883 { /* This was really a NUL. */
1884 yy_state_type yy_next_state
;
1886 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1888 yy_current_state
= yy_get_previous_state();
1890 /* Okay, we're now positioned to make the NUL
1891 * transition. We couldn't have
1892 * yy_get_previous_state() go ahead and do it
1893 * for us because it doesn't know how to deal
1894 * with the possibility of jamming (and we don't
1895 * want to build jamming into it because then it
1896 * will run more slowly).
1899 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1901 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1903 if ( yy_next_state
)
1905 /* Consume the NUL. */
1906 yy_cp
= ++yy_c_buf_p
;
1907 yy_current_state
= yy_next_state
;
1914 goto yy_find_action
;
1918 else switch ( yy_get_next_buffer() )
1920 case EOB_ACT_END_OF_FILE
:
1922 yy_did_buffer_switch_on_eof
= 0;
1926 /* Note: because we've taken care in
1927 * yy_get_next_buffer() to have set up
1928 * yytext, we can now set up
1929 * yy_c_buf_p so that if some total
1930 * hoser (like flex itself) wants to
1931 * call the scanner after we return the
1932 * YY_NULL, it'll still work - another
1933 * YY_NULL will get returned.
1935 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
1937 yy_act
= YY_STATE_EOF(YY_START
);
1943 if ( ! yy_did_buffer_switch_on_eof
)
1949 case EOB_ACT_CONTINUE_SCAN
:
1951 yytext_ptr
+ yy_amount_of_matched_text
;
1953 yy_current_state
= yy_get_previous_state();
1956 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1959 case EOB_ACT_LAST_MATCH
:
1961 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
1963 yy_current_state
= yy_get_previous_state();
1966 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1967 goto yy_find_action
;
1974 "fatal flex scanner internal error--no action found" );
1975 } /* end of action switch */
1976 } /* end of scanning one token */
1977 } /* end of yylex */
1980 /* yy_get_next_buffer - try to read in a new buffer
1982 * Returns a code representing an action:
1983 * EOB_ACT_LAST_MATCH -
1984 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1985 * EOB_ACT_END_OF_FILE - end of file
1988 static int yy_get_next_buffer()
1990 register char *dest
= yy_current_buffer
->yy_ch_buf
;
1991 register char *source
= yytext_ptr
;
1992 register int number_to_move
, i
;
1995 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
1997 "fatal flex scanner internal error--end of buffer missed" );
1999 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2000 { /* Don't try to fill the buffer, so this is an EOF. */
2001 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2003 /* We matched a single character, the EOB, so
2004 * treat this as a final EOF.
2006 return EOB_ACT_END_OF_FILE
;
2011 /* We matched some text prior to the EOB, first
2014 return EOB_ACT_LAST_MATCH
;
2018 /* Try to read more data. */
2020 /* First move last chars to start of buffer. */
2021 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2023 for ( i
= 0; i
< number_to_move
; ++i
)
2024 *(dest
++) = *(source
++);
2026 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2027 /* don't do the read, it's not guaranteed to return an EOF,
2030 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2035 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2037 while ( num_to_read
<= 0 )
2038 { /* Not enough room in the buffer - grow it. */
2039 #ifdef YY_USES_REJECT
2041 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2044 /* just a shorter name for the current buffer */
2045 YY_BUFFER_STATE b
= yy_current_buffer
;
2047 int yy_c_buf_p_offset
=
2048 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2050 if ( b
->yy_is_our_buffer
)
2052 int new_size
= b
->yy_buf_size
* 2;
2054 if ( new_size
<= 0 )
2055 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2057 b
->yy_buf_size
*= 2;
2059 b
->yy_ch_buf
= (char *)
2060 /* Include room in for 2 EOB chars. */
2061 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2062 b
->yy_buf_size
+ 2 );
2065 /* Can't grow it, we don't own it. */
2068 if ( ! b
->yy_ch_buf
)
2070 "fatal error - scanner input buffer overflow" );
2072 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2074 num_to_read
= yy_current_buffer
->yy_buf_size
-
2079 if ( num_to_read
> YY_READ_BUF_SIZE
)
2080 num_to_read
= YY_READ_BUF_SIZE
;
2082 /* Read in more data. */
2083 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2084 yy_n_chars
, num_to_read
);
2086 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2089 if ( yy_n_chars
== 0 )
2091 if ( number_to_move
== YY_MORE_ADJ
)
2093 ret_val
= EOB_ACT_END_OF_FILE
;
2099 ret_val
= EOB_ACT_LAST_MATCH
;
2100 yy_current_buffer
->yy_buffer_status
=
2101 YY_BUFFER_EOF_PENDING
;
2106 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2108 yy_n_chars
+= number_to_move
;
2109 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2110 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2112 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2118 /* yy_get_previous_state - get the state just before the EOB char was reached */
2120 static yy_state_type
yy_get_previous_state()
2122 register yy_state_type yy_current_state
;
2123 register char *yy_cp
;
2125 yy_current_state
= yy_start
;
2127 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2129 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2130 if ( yy_accept
[yy_current_state
] )
2132 yy_last_accepting_state
= yy_current_state
;
2133 yy_last_accepting_cpos
= yy_cp
;
2135 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2137 yy_current_state
= (int) yy_def
[yy_current_state
];
2138 if ( yy_current_state
>= 361 )
2139 yy_c
= yy_meta
[(unsigned int) yy_c
];
2141 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2144 return yy_current_state
;
2148 /* yy_try_NUL_trans - try to make a transition on the NUL character
2151 * next_state = yy_try_NUL_trans( current_state );
2154 #ifdef YY_USE_PROTOS
2155 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2157 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2158 yy_state_type yy_current_state
;
2161 register int yy_is_jam
;
2162 register char *yy_cp
= yy_c_buf_p
;
2164 register YY_CHAR yy_c
= 1;
2165 if ( yy_accept
[yy_current_state
] )
2167 yy_last_accepting_state
= yy_current_state
;
2168 yy_last_accepting_cpos
= yy_cp
;
2170 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2172 yy_current_state
= (int) yy_def
[yy_current_state
];
2173 if ( yy_current_state
>= 361 )
2174 yy_c
= yy_meta
[(unsigned int) yy_c
];
2176 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2177 yy_is_jam
= (yy_current_state
== 360);
2179 return yy_is_jam
? 0 : yy_current_state
;
2184 #ifdef YY_USE_PROTOS
2185 static void yyunput( int c
, register char *yy_bp
)
2187 static void yyunput( c
, yy_bp
)
2189 register char *yy_bp
;
2192 register char *yy_cp
= yy_c_buf_p
;
2194 /* undo effects of setting up yytext */
2195 *yy_cp
= yy_hold_char
;
2197 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2198 { /* need to shift things up to make room */
2199 /* +2 for EOB chars. */
2200 register int number_to_move
= yy_n_chars
+ 2;
2201 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2202 yy_current_buffer
->yy_buf_size
+ 2];
2203 register char *source
=
2204 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2206 while ( source
> yy_current_buffer
->yy_ch_buf
)
2207 *--dest
= *--source
;
2209 yy_cp
+= (int) (dest
- source
);
2210 yy_bp
+= (int) (dest
- source
);
2211 yy_current_buffer
->yy_n_chars
=
2212 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2214 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2215 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2218 *--yy_cp
= (char) c
;
2222 yy_hold_char
= *yy_cp
;
2225 #endif /* ifndef YY_NO_UNPUT */
2229 static int yyinput()
2236 *yy_c_buf_p
= yy_hold_char
;
2238 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2240 /* yy_c_buf_p now points to the character we want to return.
2241 * If this occurs *before* the EOB characters, then it's a
2242 * valid NUL; if not, then we've hit the end of the buffer.
2244 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2245 /* This was really a NUL. */
2249 { /* need more input */
2250 int offset
= yy_c_buf_p
- yytext_ptr
;
2253 switch ( yy_get_next_buffer() )
2255 case EOB_ACT_LAST_MATCH
:
2256 /* This happens because yy_g_n_b()
2257 * sees that we've accumulated a
2258 * token and flags that we need to
2259 * try matching the token before
2260 * proceeding. But for input(),
2261 * there's no matching to consider.
2262 * So convert the EOB_ACT_LAST_MATCH
2263 * to EOB_ACT_END_OF_FILE.
2266 /* Reset buffer status. */
2271 case EOB_ACT_END_OF_FILE
:
2276 if ( ! yy_did_buffer_switch_on_eof
)
2285 case EOB_ACT_CONTINUE_SCAN
:
2286 yy_c_buf_p
= yytext_ptr
+ offset
;
2292 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2293 *yy_c_buf_p
= '\0'; /* preserve yytext */
2294 yy_hold_char
= *++yy_c_buf_p
;
2301 #ifdef YY_USE_PROTOS
2302 void yyrestart( FILE *input_file
)
2304 void yyrestart( input_file
)
2308 if ( ! yy_current_buffer
)
2309 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2311 yy_init_buffer( yy_current_buffer
, input_file
);
2312 yy_load_buffer_state();
2316 #ifdef YY_USE_PROTOS
2317 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2319 void yy_switch_to_buffer( new_buffer
)
2320 YY_BUFFER_STATE new_buffer
;
2323 if ( yy_current_buffer
== new_buffer
)
2326 if ( yy_current_buffer
)
2328 /* Flush out information for old buffer. */
2329 *yy_c_buf_p
= yy_hold_char
;
2330 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2331 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2334 yy_current_buffer
= new_buffer
;
2335 yy_load_buffer_state();
2337 /* We don't actually know whether we did this switch during
2338 * EOF (yywrap()) processing, but the only time this flag
2339 * is looked at is after yywrap() is called, so it's safe
2340 * to go ahead and always set it.
2342 yy_did_buffer_switch_on_eof
= 1;
2346 #ifdef YY_USE_PROTOS
2347 void yy_load_buffer_state( void )
2349 void yy_load_buffer_state()
2352 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2353 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2354 yyin
= yy_current_buffer
->yy_input_file
;
2355 yy_hold_char
= *yy_c_buf_p
;
2359 #ifdef YY_USE_PROTOS
2360 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2362 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2369 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2371 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2373 b
->yy_buf_size
= size
;
2375 /* yy_ch_buf has to be 2 characters longer than the size given because
2376 * we need to put in 2 end-of-buffer characters.
2378 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2379 if ( ! b
->yy_ch_buf
)
2380 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2382 b
->yy_is_our_buffer
= 1;
2384 yy_init_buffer( b
, file
);
2390 #ifdef YY_USE_PROTOS
2391 void yy_delete_buffer( YY_BUFFER_STATE b
)
2393 void yy_delete_buffer( b
)
2400 if ( b
== yy_current_buffer
)
2401 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2403 if ( b
->yy_is_our_buffer
)
2404 yy_flex_free( (void *) b
->yy_ch_buf
);
2406 yy_flex_free( (void *) b
);
2413 #ifndef YY_ALWAYS_INTERACTIVE
2414 #ifndef YY_NEVER_INTERACTIVE
2415 extern int isatty
YY_PROTO(( int ));
2420 #ifdef YY_USE_PROTOS
2421 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2423 void yy_init_buffer( b
, file
)
2430 yy_flush_buffer( b
);
2432 b
->yy_input_file
= file
;
2433 b
->yy_fill_buffer
= 1;
2435 #if YY_ALWAYS_INTERACTIVE
2436 b
->yy_is_interactive
= 1;
2438 #if YY_NEVER_INTERACTIVE
2439 b
->yy_is_interactive
= 0;
2441 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2447 #ifdef YY_USE_PROTOS
2448 void yy_flush_buffer( YY_BUFFER_STATE b
)
2450 void yy_flush_buffer( b
)
2460 /* We always need two end-of-buffer characters. The first causes
2461 * a transition to the end-of-buffer state. The second causes
2462 * a jam in that state.
2464 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2465 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2467 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2470 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2472 if ( b
== yy_current_buffer
)
2473 yy_load_buffer_state();
2477 #ifndef YY_NO_SCAN_BUFFER
2478 #ifdef YY_USE_PROTOS
2479 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2481 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2489 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2490 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2491 /* They forgot to leave room for the EOB's. */
2494 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2496 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2498 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2499 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2500 b
->yy_is_our_buffer
= 0;
2501 b
->yy_input_file
= 0;
2502 b
->yy_n_chars
= b
->yy_buf_size
;
2503 b
->yy_is_interactive
= 0;
2505 b
->yy_fill_buffer
= 0;
2506 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2508 yy_switch_to_buffer( b
);
2515 #ifndef YY_NO_SCAN_STRING
2516 #ifdef YY_USE_PROTOS
2517 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2519 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2520 yyconst
char *yy_str
;
2524 for ( len
= 0; yy_str
[len
]; ++len
)
2527 return yy_scan_bytes( yy_str
, len
);
2532 #ifndef YY_NO_SCAN_BYTES
2533 #ifdef YY_USE_PROTOS
2534 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2536 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2537 yyconst
char *bytes
;
2546 /* Get memory for full buffer, including space for trailing EOB's. */
2548 buf
= (char *) yy_flex_alloc( n
);
2550 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2552 for ( i
= 0; i
< len
; ++i
)
2555 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2557 b
= yy_scan_buffer( buf
, n
);
2559 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2561 /* It's okay to grow etc. this buffer, and we should throw it
2562 * away when we're done.
2564 b
->yy_is_our_buffer
= 1;
2571 #ifndef YY_NO_PUSH_STATE
2572 #ifdef YY_USE_PROTOS
2573 static void yy_push_state( int new_state
)
2575 static void yy_push_state( new_state
)
2579 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2583 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2584 new_size
= yy_start_stack_depth
* sizeof( int );
2586 if ( ! yy_start_stack
)
2587 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2590 yy_start_stack
= (int *) yy_flex_realloc(
2591 (void *) yy_start_stack
, new_size
);
2593 if ( ! yy_start_stack
)
2595 "out of memory expanding start-condition stack" );
2598 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2605 #ifndef YY_NO_POP_STATE
2606 static void yy_pop_state()
2608 if ( --yy_start_stack_ptr
< 0 )
2609 YY_FATAL_ERROR( "start-condition stack underflow" );
2611 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2616 #ifndef YY_NO_TOP_STATE
2617 static int yy_top_state()
2619 return yy_start_stack
[yy_start_stack_ptr
- 1];
2623 #ifndef YY_EXIT_FAILURE
2624 #define YY_EXIT_FAILURE 2
2627 #ifdef YY_USE_PROTOS
2628 static void yy_fatal_error( yyconst
char msg
[] )
2630 static void yy_fatal_error( msg
)
2634 (void) fprintf( stderr
, "%s\n", msg
);
2635 exit( YY_EXIT_FAILURE
);
2640 /* Redefine yyless() so it works in section 3 code. */
2646 /* Undo effects of setting up yytext. */ \
2647 yytext[yyleng] = yy_hold_char; \
2648 yy_c_buf_p = yytext + n; \
2649 yy_hold_char = *yy_c_buf_p; \
2650 *yy_c_buf_p = '\0'; \
2656 /* Internal utility routines. */
2659 #ifdef YY_USE_PROTOS
2660 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2662 static void yy_flex_strncpy( s1
, s2
, n
)
2669 for ( i
= 0; i
< n
; ++i
)
2674 #ifdef YY_NEED_STRLEN
2675 #ifdef YY_USE_PROTOS
2676 static int yy_flex_strlen( yyconst
char *s
)
2678 static int yy_flex_strlen( s
)
2683 for ( n
= 0; s
[n
]; ++n
)
2691 #ifdef YY_USE_PROTOS
2692 static void *yy_flex_alloc( yy_size_t size
)
2694 static void *yy_flex_alloc( size
)
2698 return (void *) malloc( size
);
2701 #ifdef YY_USE_PROTOS
2702 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2704 static void *yy_flex_realloc( ptr
, size
)
2709 /* The cast to (char *) in the following accommodates both
2710 * implementations that use char* generic pointers, and those
2711 * that use void* generic pointers. It works with the latter
2712 * because both ANSI C and C++ allow castless assignment from
2713 * any pointer type to void*, and deal with argument conversions
2714 * as though doing an assignment.
2716 return (void *) realloc( (char *) ptr
, size
);
2719 #ifdef YY_USE_PROTOS
2720 static void yy_flex_free( void *ptr
)
2722 static void yy_flex_free( ptr
)
2736 #line 525 "scan-gram.l"
2739 /*------------------------------------------------------------------.
2740 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2742 | Possible inputs: $[<TYPENAME>]($|integer) |
2744 | Output to the STRING_OBSTACK a reference to this semantic value. |
2745 `------------------------------------------------------------------*/
2748 handle_action_dollar (char *text
, location_t location
)
2750 const char *type_name
= NULL
;
2751 char *cp
= text
+ 1;
2753 /* Get the type name if explicit. */
2766 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2767 if (!type_name
&& typed
)
2768 complain_at (location
, _("$$ of `%s' has no declared type"),
2769 symbol_tag_get (current_rule
->sym
));
2772 obstack_fgrow1 (&string_obstack
,
2773 "]b4_lhs_value([%s])[", type_name
);
2775 else if (isdigit (*cp
) || *cp
== '-')
2777 /* RULE_LENGTH is the number of values in the current rule so
2778 far, which says where to find `$0' with respect to the top of
2779 the stack. It is not the same as the rule->length in the
2780 case of mid rule actions. */
2781 int rule_length
= symbol_list_length (current_rule
->next
);
2782 int n
= strtol (cp
, &cp
, 10);
2784 if (n
> rule_length
)
2785 complain_at (location
, _("invalid value: %s%d"), "$", n
);
2788 if (!type_name
&& n
> 0)
2789 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
2791 if (!type_name
&& typed
)
2792 complain_at (location
, _("$%d of `%s' has no declared type"),
2793 n
, symbol_tag_get (current_rule
->sym
));
2796 obstack_fgrow3 (&string_obstack
,
2797 "]b4_rhs_value([%d], [%d], [%s])[",
2798 rule_length
, n
, type_name
);
2803 complain_at (location
, _("%s is invalid"), quote (text
));
2808 /*---------------------------------------------------------------.
2809 | TEXT is expexted tp be $$ in some code associated to a symbol: |
2810 | destructor or printer. |
2811 `---------------------------------------------------------------*/
2814 handle_symbol_code_dollar (char *text
, location_t location
)
2816 char *cp
= text
+ 1;
2818 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
2820 complain_at (location
, _("%s is invalid"), quote (text
));
2824 /*-----------------------------------------------------------------.
2825 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2826 | depending upon CODE_KIND. |
2827 `-----------------------------------------------------------------*/
2830 handle_dollar (braced_code_t braced_code_kind
,
2831 char *text
, location_t location
)
2833 switch (braced_code_kind
)
2835 case action_braced_code
:
2836 handle_action_dollar (text
, location
);
2839 case destructor_braced_code
:
2840 case printer_braced_code
:
2841 handle_symbol_code_dollar (text
, location
);
2847 /*------------------------------------------------------.
2848 | TEXT is a location token (i.e., a `@...'). Output to |
2849 | STRING_OBSTACK a reference to this location. |
2850 `------------------------------------------------------*/
2853 handle_action_at (char *text
, location_t location
)
2855 char *cp
= text
+ 1;
2860 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
2862 else if (isdigit (*cp
) || *cp
== '-')
2864 /* RULE_LENGTH is the number of values in the current rule so
2865 far, which says where to find `$0' with respect to the top of
2866 the stack. It is not the same as the rule->length in the
2867 case of mid rule actions. */
2868 int rule_length
= symbol_list_length (current_rule
->next
);
2869 int n
= strtol (cp
, &cp
, 10);
2871 if (n
> rule_length
)
2872 complain_at (location
, _("invalid value: %s%d"), "@", n
);
2874 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
2879 complain_at (location
, _("%s is invalid"), quote (text
));
2884 /*---------------------------------------------------------------.
2885 | TEXT is expexted tp be @$ in some code associated to a symbol: |
2886 | destructor or printer. |
2887 `---------------------------------------------------------------*/
2890 handle_symbol_code_at (char *text
, location_t location
)
2892 char *cp
= text
+ 1;
2894 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
2896 complain_at (location
, _("%s is invalid"), quote (text
));
2900 /*-------------------------------------------------------------------.
2901 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
2903 `-------------------------------------------------------------------*/
2906 handle_at (braced_code_t braced_code_kind
,
2907 char *text
, location_t location
)
2909 switch (braced_code_kind
)
2911 case action_braced_code
:
2912 handle_action_at (text
, location
);
2915 case destructor_braced_code
:
2916 case printer_braced_code
:
2917 handle_symbol_code_at (text
, location
);
2923 /*-------------------------.
2924 | Initialize the scanner. |
2925 `-------------------------*/
2928 scanner_initialize (void)
2930 obstack_init (&string_obstack
);
2934 /*-----------------------------------------------.
2935 | Free all the memory allocated to the scanner. |
2936 `-----------------------------------------------*/
2941 obstack_free (&string_obstack
, 0);