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 97
313 #define YY_END_OF_BUFFER 98
314 static yyconst
short int yy_accept
[356] =
316 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
317 0, 0, 0, 0, 0, 0, 0, 0, 98, 45,
318 34, 33, 33, 38, 45, 37, 35, 45, 36, 30,
319 32, 45, 29, 42, 31, 49, 50, 50, 51, 46,
320 47, 76, 79, 79, 75, 46, 78, 47, 71, 74,
321 74, 70, 73, 53, 54, 54, 52, 69, 56, 57,
322 57, 55, 89, 90, 90, 81, 91, 80, 84, 91,
323 46, 47, 86, 85, 93, 95, 95, 81, 94, 80,
324 84, 96, 96, 96, 81, 80, 84, 34, 33, 33,
325 33, 33, 44, 0, 0, 0, 0, 0, 0, 0,
327 0, 0, 0, 0, 0, 0, 0, 41, 35, 39,
328 40, 36, 0, 49, 50, 50, 50, 50, 48, 76,
329 79, 79, 79, 79, 77, 71, 74, 74, 74, 74,
330 72, 53, 54, 54, 54, 54, 68, 67, 68, 60,
331 61, 62, 63, 64, 65, 66, 68, 57, 57, 57,
332 57, 89, 90, 90, 90, 90, 87, 0, 87, 0,
333 82, 83, 88, 0, 88, 93, 95, 95, 95, 95,
334 92, 96, 96, 96, 96, 96, 82, 83, 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 40, 43, 0, 0, 0, 83, 83, 83, 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, 58, 59, 0, 0, 0, 0,
342 0, 0, 0, 0, 0, 10, 0, 0, 0, 0,
343 0, 0, 17, 0, 0, 0, 0, 22, 0, 25,
344 0, 0, 28, 0, 2, 0, 0, 0, 0, 0,
345 0, 0, 0, 0, 0, 15, 0, 0, 19, 0,
346 21, 23, 26, 0, 1, 3, 0, 0, 7, 0,
347 0, 0, 0, 0, 0, 16, 0, 0, 0, 0,
349 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
350 0, 0, 27, 0, 0, 0, 0, 0, 0, 13,
351 14, 0, 20, 0, 0, 0, 0, 0, 11, 0,
352 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,
353 8, 0, 12, 18, 24, 0, 0, 6, 0, 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
[382] =
400 0, 0, 48, 51, 58, 61, 83, 86, 73, 94,
401 108, 110, 131, 179, 227, 249, 116, 142, 814, 815,
402 811, 55, 64, 815, 267, 815, 0, 44, 79, 815,
403 815, 0, 815, 815, 815, 0, 97, 99, 800, 815,
404 815, 0, 119, 122, 815, 815, 0, 815, 0, 126,
405 138, 815, 0, 0, 145, 153, 815, 311, 815, 155,
406 157, 815, 0, 159, 164, 815, 159, 815, 62, 164,
407 815, 815, 815, 815, 0, 185, 189, 815, 761, 815,
408 185, 192, 201, 203, 205, 207, 209, 808, 211, 213,
409 216, 219, 815, 775, 778, 86, 773, 49, 198, 762,
411 184, 771, 109, 203, 766, 773, 776, 815, 0, 815,
412 0, 230, 782, 0, 242, 244, 255, 259, 815, 0,
413 261, 263, 265, 272, 815, 0, 274, 276, 278, 280,
414 815, 0, 282, 284, 286, 288, 815, 815, 787, 815,
415 815, 815, 815, 815, 815, 815, 0, 296, 298, 314,
416 316, 0, 318, 322, 324, 326, 815, 318, 322, 0,
417 815, 0, 815, 326, 330, 0, 342, 344, 347, 355,
418 815, 357, 359, 361, 363, 365, 367, 369, 761, 144,
419 757, 757, 144, 765, 767, 757, 364, 763, 749, 761,
420 749, 757, 758, 761, 745, 750, 744, 749, 741, 753,
422 0, 815, 767, 0, 760, 0, 372, 375, 752, 733,
423 742, 732, 735, 743, 742, 741, 727, 743, 738, 731,
424 740, 724, 724, 735, 732, 728, 724, 718, 721, 727,
425 726, 716, 727, 725, 815, 815, 371, 711, 719, 712,
426 708, 707, 719, 736, 716, 815, 701, 230, 709, 700,
427 704, 696, 815, 370, 696, 708, 694, 815, 698, 815,
428 697, 695, 815, 686, 815, 702, 687, 373, 687, 689,
429 376, 694, 687, 688, 683, 815, 681, 683, 815, 653,
430 815, 378, 815, 650, 815, 626, 637, 606, 815, 607,
431 606, 605, 601, 611, 601, 815, 611, 595, 588, 599,
433 815, 585, 597, 596, 557, 562, 569, 536, 546, 532,
434 511, 522, 815, 508, 503, 508, 491, 491, 498, 815,
435 815, 362, 815, 373, 351, 360, 348, 315, 815, 319,
436 311, 297, 815, 284, 267, 260, 249, 252, 242, 228,
437 815, 217, 815, 815, 815, 208, 380, 815, 205, 192,
438 166, 85, 62, 815, 815, 405, 419, 433, 447, 461,
439 475, 489, 503, 189, 517, 531, 545, 557, 571, 583,
440 597, 610, 624, 638, 652, 666, 84, 680, 694, 708,
444 static yyconst
short int yy_def
[382] =
446 355, 1, 356, 356, 357, 357, 358, 358, 359, 359,
447 360, 360, 361, 361, 362, 362, 363, 363, 355, 355,
448 355, 355, 355, 355, 355, 355, 364, 355, 355, 355,
449 355, 365, 355, 355, 355, 366, 355, 355, 355, 355,
450 355, 367, 355, 355, 355, 355, 368, 355, 369, 355,
451 355, 355, 370, 371, 355, 355, 355, 372, 355, 355,
452 355, 355, 373, 355, 355, 355, 355, 355, 355, 355,
453 355, 355, 355, 355, 374, 355, 355, 355, 355, 355,
454 355, 375, 375, 375, 375, 375, 375, 355, 355, 355,
455 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
457 355, 355, 355, 355, 355, 355, 355, 355, 364, 355,
458 376, 355, 365, 366, 355, 355, 355, 355, 355, 367,
459 355, 355, 355, 355, 355, 369, 355, 355, 355, 355,
460 355, 371, 355, 355, 355, 355, 355, 355, 355, 355,
461 355, 355, 355, 355, 355, 355, 377, 355, 355, 355,
462 355, 373, 355, 355, 355, 355, 355, 355, 355, 378,
463 355, 379, 355, 355, 355, 374, 355, 355, 355, 355,
464 355, 375, 375, 375, 375, 375, 375, 380, 355, 355,
465 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
466 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
468 376, 355, 355, 381, 378, 379, 380, 380, 355, 355,
469 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
470 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
471 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
472 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
473 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
474 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
475 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
476 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
477 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
479 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
480 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
481 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
482 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
483 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
484 355, 355, 355, 355, 0, 355, 355, 355, 355, 355,
485 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
486 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
490 static yyconst
short int yy_nxt
[866] =
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, 236, 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, 354, 46, 53, 48, 46, 53, 48,
504 60, 61, 60, 61, 353, 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, 109, 70, 109,
514 71, 352, 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, 351, 73, 191, 74, 76,
517 77, 78, 195, 79, 80, 350, 187, 348, 81, 273,
518 188, 196, 112, 112, 115, 116, 117, 118, 46, 197,
519 48, 76, 77, 78, 273, 79, 80, 115, 116, 347,
520 81, 117, 118, 121, 122, 123, 124, 121, 122, 346,
521 46, 345, 48, 93, 123, 124, 127, 128, 129, 130,
522 127, 128, 129, 130, 133, 134, 135, 136, 133, 134,
523 135, 136, 344, 94, 343, 95, 96, 97, 148, 149,
525 150, 151, 98, 342, 99, 100, 101, 102, 103, 104,
526 105, 106, 341, 107, 108, 138, 148, 149, 150, 151,
527 153, 154, 340, 139, 155, 156, 153, 154, 155, 156,
528 159, 159, 339, 138, 159, 159, 140, 141, 165, 165,
529 338, 142, 165, 165, 167, 168, 169, 170, 143, 167,
530 168, 144, 337, 145, 336, 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, 278,
533 158, 335, 288, 159, 159, 291, 334, 299, 220, 349,
534 206, 333, 206, 206, 278, 206, 206, 288, 206, 332,
536 291, 221, 299, 331, 349, 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, 330, 113,
550 113, 114, 329, 328, 114, 114, 114, 114, 327, 114,
551 114, 114, 114, 326, 114, 120, 325, 324, 323, 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, 322, 321, 126, 126, 126, 320, 126, 126,
555 126, 126, 126, 131, 131, 131, 131, 131, 131, 131,
556 131, 131, 131, 131, 131, 131, 131, 132, 319, 318,
558 317, 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, 316, 315, 314, 313, 152,
561 312, 152, 152, 311, 152, 152, 310, 152, 166, 309,
562 308, 307, 166, 306, 305, 166, 166, 304, 166, 166,
563 303, 166, 172, 172, 172, 172, 172, 172, 172, 172,
564 172, 172, 172, 172, 302, 172, 201, 301, 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, 300, 205, 205, 206, 298, 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, 297, 296, 295, 294, 293, 292, 290, 289,
572 287, 286, 285, 284, 283, 282, 281, 280, 279, 277,
573 276, 275, 274, 272, 271, 270, 269, 268, 267, 266,
574 265, 264, 263, 262, 261, 260, 259, 258, 257, 256,
575 255, 254, 253, 252, 251, 250, 249, 248, 247, 246,
576 245, 244, 243, 242, 241, 240, 239, 238, 237, 235,
577 234, 233, 232, 231, 230, 229, 228, 227, 226, 225,
578 224, 223, 222, 219, 218, 217, 214, 213, 209, 203,
580 202, 200, 199, 198, 192, 189, 183, 180, 179, 88,
581 171, 119, 88, 355, 19, 355, 355, 355, 355, 355,
582 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
583 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
584 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
585 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
586 355, 355, 355, 355, 355
589 static yyconst
short int yy_chk
[866] =
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, 381, 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, 377, 9, 10, 10, 10, 37,
602 37, 38, 38, 353, 7, 7, 7, 8, 8, 8,
603 11, 11, 12, 12, 352, 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, 364, 14, 364,
613 14, 351, 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, 350, 14, 101, 14, 15,
616 15, 15, 104, 15, 15, 349, 99, 346, 15, 248,
617 99, 104, 112, 112, 115, 115, 116, 116, 15, 104,
618 15, 16, 16, 16, 248, 16, 16, 117, 117, 342,
619 16, 118, 118, 121, 121, 122, 122, 123, 123, 340,
620 16, 339, 16, 25, 124, 124, 127, 127, 128, 128,
621 129, 129, 130, 130, 133, 133, 134, 134, 135, 135,
622 136, 136, 338, 25, 337, 25, 25, 25, 148, 148,
624 149, 149, 25, 336, 25, 25, 25, 25, 25, 25,
625 25, 25, 335, 25, 25, 58, 150, 150, 151, 151,
626 153, 153, 334, 58, 154, 154, 155, 155, 156, 156,
627 158, 158, 332, 58, 159, 159, 58, 58, 164, 164,
628 331, 58, 165, 165, 167, 167, 168, 168, 58, 169,
629 169, 58, 330, 58, 328, 58, 58, 170, 170, 172,
630 172, 173, 173, 174, 174, 175, 175, 176, 176, 177,
631 177, 178, 178, 187, 207, 207, 237, 208, 208, 254,
632 237, 327, 268, 237, 237, 271, 326, 282, 187, 347,
633 178, 325, 178, 207, 254, 207, 208, 268, 208, 324,
635 271, 187, 282, 322, 347, 356, 356, 356, 356, 356,
636 356, 356, 356, 356, 356, 356, 356, 356, 356, 357,
637 357, 357, 357, 357, 357, 357, 357, 357, 357, 357,
638 357, 357, 357, 358, 358, 358, 358, 358, 358, 358,
639 358, 358, 358, 358, 358, 358, 358, 359, 359, 359,
640 359, 359, 359, 359, 359, 359, 359, 359, 359, 359,
641 359, 360, 360, 360, 360, 360, 360, 360, 360, 360,
642 360, 360, 360, 360, 360, 361, 361, 361, 361, 361,
643 361, 361, 361, 361, 361, 361, 361, 361, 361, 362,
644 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
646 362, 362, 362, 363, 363, 363, 363, 363, 363, 363,
647 363, 363, 363, 363, 363, 363, 363, 365, 365, 365,
648 365, 365, 365, 365, 365, 365, 365, 365, 319, 365,
649 365, 366, 318, 317, 366, 366, 366, 366, 316, 366,
650 366, 366, 366, 315, 366, 367, 314, 312, 311, 367,
651 367, 367, 367, 367, 367, 367, 367, 368, 368, 368,
652 368, 368, 368, 368, 368, 368, 368, 368, 368, 368,
653 368, 369, 310, 309, 369, 369, 369, 308, 369, 369,
654 369, 369, 369, 370, 370, 370, 370, 370, 370, 370,
655 370, 370, 370, 370, 370, 370, 370, 371, 307, 306,
657 305, 371, 371, 371, 371, 371, 371, 371, 371, 371,
658 372, 372, 372, 372, 372, 372, 372, 372, 372, 372,
659 372, 372, 372, 372, 373, 304, 303, 302, 300, 373,
660 299, 373, 373, 298, 373, 373, 297, 373, 374, 295,
661 294, 293, 374, 292, 291, 374, 374, 290, 374, 374,
662 288, 374, 375, 375, 375, 375, 375, 375, 375, 375,
663 375, 375, 375, 375, 287, 375, 376, 286, 376, 376,
664 376, 376, 376, 376, 376, 376, 376, 376, 376, 376,
665 378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
666 378, 284, 378, 378, 379, 280, 379, 379, 379, 379,
668 379, 379, 379, 379, 379, 379, 379, 379, 380, 380,
669 380, 380, 380, 380, 380, 380, 380, 380, 380, 380,
670 380, 380, 278, 277, 275, 274, 273, 272, 270, 269,
671 267, 266, 264, 262, 261, 259, 257, 256, 255, 252,
672 251, 250, 249, 247, 245, 244, 243, 242, 241, 240,
673 239, 238, 234, 233, 232, 231, 230, 229, 228, 227,
674 226, 225, 224, 223, 222, 221, 220, 219, 218, 217,
675 216, 215, 214, 213, 212, 211, 210, 209, 205, 203,
676 200, 199, 198, 197, 196, 195, 194, 193, 192, 191,
677 190, 189, 188, 186, 185, 184, 182, 181, 179, 139,
679 113, 107, 106, 105, 102, 100, 97, 95, 94, 88,
680 79, 39, 21, 19, 355, 355, 355, 355, 355, 355,
681 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
682 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
683 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
684 355, 355, 355, 355, 355, 355, 355, 355, 355, 355,
685 355, 355, 355, 355, 355
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
[97] =
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, 151, 152,
699 153, 154, 156, 157, 158, 163, 166, 169, 172, 173,
700 176, 179, 182, 190, 196, 212, 213, 224, 236, 237,
701 238, 255, 264, 266, 286, 300, 302, 322, 334, 338,
702 339, 340, 341, 342, 343, 344, 345, 346, 352, 363,
703 369, 370, 372, 374, 392, 398, 399, 401, 403, 421,
704 424, 427, 428, 431, 442, 453, 455, 457, 460, 461,
705 464, 484, 491, 492, 493, 513
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
>= 356 )
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
] != 815 );
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
< 97 )
1079 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1080 yy_rule_linenum
[yy_act
], yytext
);
1081 else if ( yy_act
== 97 )
1082 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1084 else if ( yy_act
== 98 )
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_PURE_PARSER
;
1193 #line 140 "scan-gram.l"
1194 return PERCENT_RIGHT
;
1198 #line 141 "scan-gram.l"
1199 return PERCENT_SKELETON
;
1203 #line 142 "scan-gram.l"
1204 return PERCENT_START
;
1208 #line 143 "scan-gram.l"
1209 return PERCENT_TOKEN
;
1213 #line 144 "scan-gram.l"
1214 return PERCENT_TOKEN
;
1218 #line 145 "scan-gram.l"
1219 return PERCENT_TOKEN_TABLE
;
1223 #line 146 "scan-gram.l"
1224 return PERCENT_TYPE
;
1228 #line 147 "scan-gram.l"
1229 return PERCENT_UNION
;
1233 #line 148 "scan-gram.l"
1234 return PERCENT_VERBOSE
;
1238 #line 149 "scan-gram.l"
1239 return PERCENT_YACC
;
1243 #line 151 "scan-gram.l"
1248 #line 152 "scan-gram.l"
1253 #line 153 "scan-gram.l"
1258 #line 154 "scan-gram.l"
1263 #line 156 "scan-gram.l"
1268 #line 157 "scan-gram.l"
1273 #line 158 "scan-gram.l"
1275 yylval
->symbol
= getsym (yytext
, *yylloc
);
1281 #line 163 "scan-gram.l"
1282 yylval
->integer
= strtol (yytext
, 0, 10); return INT
;
1284 /* Characters. We don't check there is only one. */
1287 #line 166 "scan-gram.l"
1288 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1293 #line 169 "scan-gram.l"
1294 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1299 #line 172 "scan-gram.l"
1300 yy_push_state (SC_COMMENT
);
1304 #line 173 "scan-gram.l"
1310 #line 176 "scan-gram.l"
1311 yy_push_state (SC_PROLOGUE
);
1313 /* Code in between braces. */
1316 #line 179 "scan-gram.l"
1317 YY_OBS_GROW
; ++braces_level
; yy_push_state (SC_BRACED_CODE
);
1322 #line 182 "scan-gram.l"
1324 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1326 yylval
->string
= last_string
;
1332 #line 190 "scan-gram.l"
1334 if (++percent_percent_count
== 2)
1335 yy_push_state (SC_EPILOGUE
);
1336 return PERCENT_PERCENT
;
1341 #line 196 "scan-gram.l"
1343 LOCATION_PRINT (stderr
, *yylloc
);
1344 fprintf (stderr
, ": invalid character: `%c'\n", *yytext
);
1349 /*------------------------------------------------------------.
1350 | Whatever the start condition (but those which correspond to |
1351 | entity `swallowed' by Bison: SC_ESCAPED_STRING and |
1352 | SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1353 `------------------------------------------------------------*/
1358 #line 212 "scan-gram.l"
1359 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@<:@");
1363 #line 213 "scan-gram.l"
1364 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@:>@");
1367 /*-----------------------------------------------------------.
1368 | Scanning a C comment. The initial `/ *' is already eaten. |
1369 `-----------------------------------------------------------*/
1374 #line 224 "scan-gram.l"
1375 { /* End of the comment. */
1376 if (yy_top_state () == INITIAL
)
1389 #line 236 "scan-gram.l"
1390 if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1394 #line 237 "scan-gram.l"
1395 if (yy_top_state () != INITIAL
) YY_OBS_GROW
; YY_LINES
;
1399 #line 238 "scan-gram.l"
1400 /* Stray `*'. */if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1402 case YY_STATE_EOF(SC_COMMENT
):
1403 #line 240 "scan-gram.l"
1405 LOCATION_PRINT (stderr
, *yylloc
);
1406 fprintf (stderr
, ": unexpected end of file in a comment\n");
1411 /*----------------------------------------------------------------.
1412 | Scanning a C string, including its escapes. The initial `"' is |
1414 `----------------------------------------------------------------*/
1419 #line 255 "scan-gram.l"
1421 assert (yy_top_state () == INITIAL
);
1424 yylval
->string
= last_string
;
1431 #line 264 "scan-gram.l"
1436 #line 266 "scan-gram.l"
1437 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1439 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1440 #line 268 "scan-gram.l"
1442 LOCATION_PRINT (stderr
, *yylloc
);
1443 fprintf (stderr
, ": unexpected end of file in a string\n");
1444 assert (yy_top_state () == INITIAL
);
1446 yylval
->string
= last_string
;
1452 /*---------------------------------------------------------------.
1453 | Scanning a C character, decoding its escapes. The initial "'" |
1454 | is already eaten. |
1455 `---------------------------------------------------------------*/
1460 #line 286 "scan-gram.l"
1463 assert (yy_top_state () == INITIAL
);
1466 yylval
->symbol
= getsym (last_string
, *yylloc
);
1467 symbol_class_set (yylval
->symbol
, token_sym
);
1468 symbol_user_token_number_set (yylval
->symbol
, last_string
[1]);
1477 #line 300 "scan-gram.l"
1482 #line 302 "scan-gram.l"
1483 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1485 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1486 #line 304 "scan-gram.l"
1488 LOCATION_PRINT (stderr
, *yylloc
);
1489 fprintf (stderr
, ": unexpected end of file in a character\n");
1490 assert (yy_top_state () == INITIAL
);
1492 yylval
->string
= last_string
;
1498 /*----------------------------.
1499 | Decode escaped characters. |
1500 `----------------------------*/
1505 #line 322 "scan-gram.l"
1507 long c
= strtol (yytext
+ 1, 0, 8);
1510 LOCATION_PRINT (stderr
, *yylloc
);
1511 fprintf (stderr
, ": invalid escape: %s\n", quote (yytext
));
1515 obstack_1grow (&string_obstack
, c
);
1520 #line 334 "scan-gram.l"
1522 obstack_1grow (&string_obstack
, strtol (yytext
+ 2, 0, 16));
1527 #line 338 "scan-gram.l"
1528 obstack_1grow (&string_obstack
, '\a');
1532 #line 339 "scan-gram.l"
1533 obstack_1grow (&string_obstack
, '\b');
1537 #line 340 "scan-gram.l"
1538 obstack_1grow (&string_obstack
, '\f');
1542 #line 341 "scan-gram.l"
1543 obstack_1grow (&string_obstack
, '\n');
1547 #line 342 "scan-gram.l"
1548 obstack_1grow (&string_obstack
, '\r');
1552 #line 343 "scan-gram.l"
1553 obstack_1grow (&string_obstack
, '\t');
1557 #line 344 "scan-gram.l"
1558 obstack_1grow (&string_obstack
, '\v');
1562 #line 345 "scan-gram.l"
1563 obstack_1grow (&string_obstack
, yytext
[1]);
1567 #line 346 "scan-gram.l"
1569 LOCATION_PRINT (stderr
, *yylloc
);
1570 fprintf (stderr
, ": unrecognized escape: %s\n", quote (yytext
));
1574 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1577 #line 352 "scan-gram.l"
1581 /*----------------------------------------------------------.
1582 | Scanning a C character without decoding its escapes. The |
1583 | initial "'" is already eaten. |
1584 `----------------------------------------------------------*/
1589 #line 363 "scan-gram.l"
1592 assert (yy_top_state () != INITIAL
);
1598 #line 369 "scan-gram.l"
1603 #line 370 "scan-gram.l"
1606 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1609 #line 372 "scan-gram.l"
1614 #line 374 "scan-gram.l"
1615 YY_OBS_GROW
; YY_LINES
;
1617 case YY_STATE_EOF(SC_CHARACTER
):
1618 #line 376 "scan-gram.l"
1620 LOCATION_PRINT (stderr
, *yylloc
);
1621 fprintf (stderr
, ": unexpected end of file in a character\n");
1622 assert (yy_top_state () != INITIAL
);
1627 /*----------------------------------------------------------------.
1628 | Scanning a C string, without decoding its escapes. The initial |
1629 | `"' is already eaten. |
1630 `----------------------------------------------------------------*/
1635 #line 392 "scan-gram.l"
1637 assert (yy_top_state () != INITIAL
);
1644 #line 398 "scan-gram.l"
1649 #line 399 "scan-gram.l"
1652 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1655 #line 401 "scan-gram.l"
1660 #line 403 "scan-gram.l"
1661 YY_OBS_GROW
; YY_LINES
;
1663 case YY_STATE_EOF(SC_STRING
):
1664 #line 405 "scan-gram.l"
1666 LOCATION_PRINT (stderr
, *yylloc
);
1667 fprintf (stderr
, ": unexpected end of file in a string\n");
1668 assert (yy_top_state () != INITIAL
);
1673 /*---------------------------------------------------.
1674 | Strings, comments etc. can be found in user code. |
1675 `---------------------------------------------------*/
1678 /* Characters. We don't check there is only one. */
1681 #line 421 "scan-gram.l"
1682 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1687 #line 424 "scan-gram.l"
1688 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1693 #line 427 "scan-gram.l"
1694 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1698 #line 428 "scan-gram.l"
1704 #line 431 "scan-gram.l"
1708 /*---------------------------------------------------------------.
1709 | Scanning some code in braces (%union and actions). The initial |
1710 | "{" is already eaten. |
1711 `---------------------------------------------------------------*/
1716 #line 442 "scan-gram.l"
1719 if (--braces_level
== 0)
1723 yylval
->string
= last_string
;
1730 #line 453 "scan-gram.l"
1731 YY_OBS_GROW
; braces_level
++;
1735 #line 455 "scan-gram.l"
1736 { handle_dollar (current_braced_code
,
1741 #line 457 "scan-gram.l"
1742 { handle_at (current_braced_code
,
1747 #line 460 "scan-gram.l"
1752 #line 461 "scan-gram.l"
1753 YY_OBS_GROW
; YY_LINES
;
1755 /* A lose $, or /, or etc. */
1758 #line 464 "scan-gram.l"
1761 case YY_STATE_EOF(SC_BRACED_CODE
):
1762 #line 466 "scan-gram.l"
1764 LOCATION_PRINT (stderr
, *yylloc
);
1765 fprintf (stderr
, ": unexpected end of file in a braced code\n");
1768 yylval
->string
= last_string
;
1773 /*--------------------------------------------------------------.
1774 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1775 `--------------------------------------------------------------*/
1780 #line 484 "scan-gram.l"
1784 yylval
->string
= last_string
;
1790 #line 491 "scan-gram.l"
1795 #line 492 "scan-gram.l"
1800 #line 493 "scan-gram.l"
1801 YY_OBS_GROW
; YY_LINES
;
1803 case YY_STATE_EOF(SC_PROLOGUE
):
1804 #line 495 "scan-gram.l"
1806 LOCATION_PRINT (stderr
, *yylloc
);
1807 fprintf (stderr
, ": unexpected end of file in a prologue\n");
1810 yylval
->string
= last_string
;
1815 /*---------------------------------------------------------------.
1816 | Scanning the epilogue (everything after the second "%%", which |
1817 | has already been eaten. |
1818 `---------------------------------------------------------------*/
1823 #line 513 "scan-gram.l"
1826 case YY_STATE_EOF(SC_EPILOGUE
):
1827 #line 515 "scan-gram.l"
1831 yylval
->string
= last_string
;
1838 #line 524 "scan-gram.l"
1839 YY_FATAL_ERROR( "flex scanner jammed" );
1841 #line 1842 "lex.yy.c"
1842 case YY_STATE_EOF(INITIAL
):
1845 case YY_END_OF_BUFFER
:
1847 /* Amount of text matched not including the EOB char. */
1848 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
1850 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1851 *yy_cp
= yy_hold_char
;
1852 YY_RESTORE_YY_MORE_OFFSET
1854 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1856 /* We're scanning a new file or input source. It's
1857 * possible that this happened because the user
1858 * just pointed yyin at a new source and called
1859 * yylex(). If so, then we have to assure
1860 * consistency between yy_current_buffer and our
1861 * globals. Here is the right place to do so, because
1862 * this is the first action (other than possibly a
1863 * back-up) that will match for the new input source.
1865 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1866 yy_current_buffer
->yy_input_file
= yyin
;
1867 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1870 /* Note that here we test for yy_c_buf_p "<=" to the position
1871 * of the first EOB in the buffer, since yy_c_buf_p will
1872 * already have been incremented past the NUL character
1873 * (since all states make transitions on EOB to the
1874 * end-of-buffer state). Contrast this with the test
1877 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1878 { /* This was really a NUL. */
1879 yy_state_type yy_next_state
;
1881 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1883 yy_current_state
= yy_get_previous_state();
1885 /* Okay, we're now positioned to make the NUL
1886 * transition. We couldn't have
1887 * yy_get_previous_state() go ahead and do it
1888 * for us because it doesn't know how to deal
1889 * with the possibility of jamming (and we don't
1890 * want to build jamming into it because then it
1891 * will run more slowly).
1894 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1896 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1898 if ( yy_next_state
)
1900 /* Consume the NUL. */
1901 yy_cp
= ++yy_c_buf_p
;
1902 yy_current_state
= yy_next_state
;
1909 goto yy_find_action
;
1913 else switch ( yy_get_next_buffer() )
1915 case EOB_ACT_END_OF_FILE
:
1917 yy_did_buffer_switch_on_eof
= 0;
1921 /* Note: because we've taken care in
1922 * yy_get_next_buffer() to have set up
1923 * yytext, we can now set up
1924 * yy_c_buf_p so that if some total
1925 * hoser (like flex itself) wants to
1926 * call the scanner after we return the
1927 * YY_NULL, it'll still work - another
1928 * YY_NULL will get returned.
1930 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
1932 yy_act
= YY_STATE_EOF(YY_START
);
1938 if ( ! yy_did_buffer_switch_on_eof
)
1944 case EOB_ACT_CONTINUE_SCAN
:
1946 yytext_ptr
+ yy_amount_of_matched_text
;
1948 yy_current_state
= yy_get_previous_state();
1951 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1954 case EOB_ACT_LAST_MATCH
:
1956 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
1958 yy_current_state
= yy_get_previous_state();
1961 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1962 goto yy_find_action
;
1969 "fatal flex scanner internal error--no action found" );
1970 } /* end of action switch */
1971 } /* end of scanning one token */
1972 } /* end of yylex */
1975 /* yy_get_next_buffer - try to read in a new buffer
1977 * Returns a code representing an action:
1978 * EOB_ACT_LAST_MATCH -
1979 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1980 * EOB_ACT_END_OF_FILE - end of file
1983 static int yy_get_next_buffer()
1985 register char *dest
= yy_current_buffer
->yy_ch_buf
;
1986 register char *source
= yytext_ptr
;
1987 register int number_to_move
, i
;
1990 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
1992 "fatal flex scanner internal error--end of buffer missed" );
1994 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
1995 { /* Don't try to fill the buffer, so this is an EOF. */
1996 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
1998 /* We matched a single character, the EOB, so
1999 * treat this as a final EOF.
2001 return EOB_ACT_END_OF_FILE
;
2006 /* We matched some text prior to the EOB, first
2009 return EOB_ACT_LAST_MATCH
;
2013 /* Try to read more data. */
2015 /* First move last chars to start of buffer. */
2016 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2018 for ( i
= 0; i
< number_to_move
; ++i
)
2019 *(dest
++) = *(source
++);
2021 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2022 /* don't do the read, it's not guaranteed to return an EOF,
2025 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2030 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2032 while ( num_to_read
<= 0 )
2033 { /* Not enough room in the buffer - grow it. */
2034 #ifdef YY_USES_REJECT
2036 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2039 /* just a shorter name for the current buffer */
2040 YY_BUFFER_STATE b
= yy_current_buffer
;
2042 int yy_c_buf_p_offset
=
2043 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2045 if ( b
->yy_is_our_buffer
)
2047 int new_size
= b
->yy_buf_size
* 2;
2049 if ( new_size
<= 0 )
2050 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2052 b
->yy_buf_size
*= 2;
2054 b
->yy_ch_buf
= (char *)
2055 /* Include room in for 2 EOB chars. */
2056 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2057 b
->yy_buf_size
+ 2 );
2060 /* Can't grow it, we don't own it. */
2063 if ( ! b
->yy_ch_buf
)
2065 "fatal error - scanner input buffer overflow" );
2067 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2069 num_to_read
= yy_current_buffer
->yy_buf_size
-
2074 if ( num_to_read
> YY_READ_BUF_SIZE
)
2075 num_to_read
= YY_READ_BUF_SIZE
;
2077 /* Read in more data. */
2078 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2079 yy_n_chars
, num_to_read
);
2081 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2084 if ( yy_n_chars
== 0 )
2086 if ( number_to_move
== YY_MORE_ADJ
)
2088 ret_val
= EOB_ACT_END_OF_FILE
;
2094 ret_val
= EOB_ACT_LAST_MATCH
;
2095 yy_current_buffer
->yy_buffer_status
=
2096 YY_BUFFER_EOF_PENDING
;
2101 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2103 yy_n_chars
+= number_to_move
;
2104 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2105 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2107 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2113 /* yy_get_previous_state - get the state just before the EOB char was reached */
2115 static yy_state_type
yy_get_previous_state()
2117 register yy_state_type yy_current_state
;
2118 register char *yy_cp
;
2120 yy_current_state
= yy_start
;
2122 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2124 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2125 if ( yy_accept
[yy_current_state
] )
2127 yy_last_accepting_state
= yy_current_state
;
2128 yy_last_accepting_cpos
= yy_cp
;
2130 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2132 yy_current_state
= (int) yy_def
[yy_current_state
];
2133 if ( yy_current_state
>= 356 )
2134 yy_c
= yy_meta
[(unsigned int) yy_c
];
2136 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2139 return yy_current_state
;
2143 /* yy_try_NUL_trans - try to make a transition on the NUL character
2146 * next_state = yy_try_NUL_trans( current_state );
2149 #ifdef YY_USE_PROTOS
2150 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2152 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2153 yy_state_type yy_current_state
;
2156 register int yy_is_jam
;
2157 register char *yy_cp
= yy_c_buf_p
;
2159 register YY_CHAR yy_c
= 1;
2160 if ( yy_accept
[yy_current_state
] )
2162 yy_last_accepting_state
= yy_current_state
;
2163 yy_last_accepting_cpos
= yy_cp
;
2165 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2167 yy_current_state
= (int) yy_def
[yy_current_state
];
2168 if ( yy_current_state
>= 356 )
2169 yy_c
= yy_meta
[(unsigned int) yy_c
];
2171 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2172 yy_is_jam
= (yy_current_state
== 355);
2174 return yy_is_jam
? 0 : yy_current_state
;
2179 #ifdef YY_USE_PROTOS
2180 static void yyunput( int c
, register char *yy_bp
)
2182 static void yyunput( c
, yy_bp
)
2184 register char *yy_bp
;
2187 register char *yy_cp
= yy_c_buf_p
;
2189 /* undo effects of setting up yytext */
2190 *yy_cp
= yy_hold_char
;
2192 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2193 { /* need to shift things up to make room */
2194 /* +2 for EOB chars. */
2195 register int number_to_move
= yy_n_chars
+ 2;
2196 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2197 yy_current_buffer
->yy_buf_size
+ 2];
2198 register char *source
=
2199 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2201 while ( source
> yy_current_buffer
->yy_ch_buf
)
2202 *--dest
= *--source
;
2204 yy_cp
+= (int) (dest
- source
);
2205 yy_bp
+= (int) (dest
- source
);
2206 yy_current_buffer
->yy_n_chars
=
2207 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2209 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2210 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2213 *--yy_cp
= (char) c
;
2217 yy_hold_char
= *yy_cp
;
2220 #endif /* ifndef YY_NO_UNPUT */
2224 static int yyinput()
2231 *yy_c_buf_p
= yy_hold_char
;
2233 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2235 /* yy_c_buf_p now points to the character we want to return.
2236 * If this occurs *before* the EOB characters, then it's a
2237 * valid NUL; if not, then we've hit the end of the buffer.
2239 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2240 /* This was really a NUL. */
2244 { /* need more input */
2245 int offset
= yy_c_buf_p
- yytext_ptr
;
2248 switch ( yy_get_next_buffer() )
2250 case EOB_ACT_LAST_MATCH
:
2251 /* This happens because yy_g_n_b()
2252 * sees that we've accumulated a
2253 * token and flags that we need to
2254 * try matching the token before
2255 * proceeding. But for input(),
2256 * there's no matching to consider.
2257 * So convert the EOB_ACT_LAST_MATCH
2258 * to EOB_ACT_END_OF_FILE.
2261 /* Reset buffer status. */
2266 case EOB_ACT_END_OF_FILE
:
2271 if ( ! yy_did_buffer_switch_on_eof
)
2280 case EOB_ACT_CONTINUE_SCAN
:
2281 yy_c_buf_p
= yytext_ptr
+ offset
;
2287 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2288 *yy_c_buf_p
= '\0'; /* preserve yytext */
2289 yy_hold_char
= *++yy_c_buf_p
;
2296 #ifdef YY_USE_PROTOS
2297 void yyrestart( FILE *input_file
)
2299 void yyrestart( input_file
)
2303 if ( ! yy_current_buffer
)
2304 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2306 yy_init_buffer( yy_current_buffer
, input_file
);
2307 yy_load_buffer_state();
2311 #ifdef YY_USE_PROTOS
2312 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2314 void yy_switch_to_buffer( new_buffer
)
2315 YY_BUFFER_STATE new_buffer
;
2318 if ( yy_current_buffer
== new_buffer
)
2321 if ( yy_current_buffer
)
2323 /* Flush out information for old buffer. */
2324 *yy_c_buf_p
= yy_hold_char
;
2325 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2326 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2329 yy_current_buffer
= new_buffer
;
2330 yy_load_buffer_state();
2332 /* We don't actually know whether we did this switch during
2333 * EOF (yywrap()) processing, but the only time this flag
2334 * is looked at is after yywrap() is called, so it's safe
2335 * to go ahead and always set it.
2337 yy_did_buffer_switch_on_eof
= 1;
2341 #ifdef YY_USE_PROTOS
2342 void yy_load_buffer_state( void )
2344 void yy_load_buffer_state()
2347 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2348 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2349 yyin
= yy_current_buffer
->yy_input_file
;
2350 yy_hold_char
= *yy_c_buf_p
;
2354 #ifdef YY_USE_PROTOS
2355 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2357 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2364 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2366 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2368 b
->yy_buf_size
= size
;
2370 /* yy_ch_buf has to be 2 characters longer than the size given because
2371 * we need to put in 2 end-of-buffer characters.
2373 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2374 if ( ! b
->yy_ch_buf
)
2375 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2377 b
->yy_is_our_buffer
= 1;
2379 yy_init_buffer( b
, file
);
2385 #ifdef YY_USE_PROTOS
2386 void yy_delete_buffer( YY_BUFFER_STATE b
)
2388 void yy_delete_buffer( b
)
2395 if ( b
== yy_current_buffer
)
2396 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2398 if ( b
->yy_is_our_buffer
)
2399 yy_flex_free( (void *) b
->yy_ch_buf
);
2401 yy_flex_free( (void *) b
);
2408 #ifndef YY_ALWAYS_INTERACTIVE
2409 #ifndef YY_NEVER_INTERACTIVE
2410 extern int isatty
YY_PROTO(( int ));
2415 #ifdef YY_USE_PROTOS
2416 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2418 void yy_init_buffer( b
, file
)
2425 yy_flush_buffer( b
);
2427 b
->yy_input_file
= file
;
2428 b
->yy_fill_buffer
= 1;
2430 #if YY_ALWAYS_INTERACTIVE
2431 b
->yy_is_interactive
= 1;
2433 #if YY_NEVER_INTERACTIVE
2434 b
->yy_is_interactive
= 0;
2436 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2442 #ifdef YY_USE_PROTOS
2443 void yy_flush_buffer( YY_BUFFER_STATE b
)
2445 void yy_flush_buffer( b
)
2455 /* We always need two end-of-buffer characters. The first causes
2456 * a transition to the end-of-buffer state. The second causes
2457 * a jam in that state.
2459 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2460 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2462 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2465 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2467 if ( b
== yy_current_buffer
)
2468 yy_load_buffer_state();
2472 #ifndef YY_NO_SCAN_BUFFER
2473 #ifdef YY_USE_PROTOS
2474 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2476 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2484 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2485 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2486 /* They forgot to leave room for the EOB's. */
2489 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2491 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2493 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2494 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2495 b
->yy_is_our_buffer
= 0;
2496 b
->yy_input_file
= 0;
2497 b
->yy_n_chars
= b
->yy_buf_size
;
2498 b
->yy_is_interactive
= 0;
2500 b
->yy_fill_buffer
= 0;
2501 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2503 yy_switch_to_buffer( b
);
2510 #ifndef YY_NO_SCAN_STRING
2511 #ifdef YY_USE_PROTOS
2512 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2514 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2515 yyconst
char *yy_str
;
2519 for ( len
= 0; yy_str
[len
]; ++len
)
2522 return yy_scan_bytes( yy_str
, len
);
2527 #ifndef YY_NO_SCAN_BYTES
2528 #ifdef YY_USE_PROTOS
2529 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2531 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2532 yyconst
char *bytes
;
2541 /* Get memory for full buffer, including space for trailing EOB's. */
2543 buf
= (char *) yy_flex_alloc( n
);
2545 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2547 for ( i
= 0; i
< len
; ++i
)
2550 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2552 b
= yy_scan_buffer( buf
, n
);
2554 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2556 /* It's okay to grow etc. this buffer, and we should throw it
2557 * away when we're done.
2559 b
->yy_is_our_buffer
= 1;
2566 #ifndef YY_NO_PUSH_STATE
2567 #ifdef YY_USE_PROTOS
2568 static void yy_push_state( int new_state
)
2570 static void yy_push_state( new_state
)
2574 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2578 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2579 new_size
= yy_start_stack_depth
* sizeof( int );
2581 if ( ! yy_start_stack
)
2582 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2585 yy_start_stack
= (int *) yy_flex_realloc(
2586 (void *) yy_start_stack
, new_size
);
2588 if ( ! yy_start_stack
)
2590 "out of memory expanding start-condition stack" );
2593 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2600 #ifndef YY_NO_POP_STATE
2601 static void yy_pop_state()
2603 if ( --yy_start_stack_ptr
< 0 )
2604 YY_FATAL_ERROR( "start-condition stack underflow" );
2606 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2611 #ifndef YY_NO_TOP_STATE
2612 static int yy_top_state()
2614 return yy_start_stack
[yy_start_stack_ptr
- 1];
2618 #ifndef YY_EXIT_FAILURE
2619 #define YY_EXIT_FAILURE 2
2622 #ifdef YY_USE_PROTOS
2623 static void yy_fatal_error( yyconst
char msg
[] )
2625 static void yy_fatal_error( msg
)
2629 (void) fprintf( stderr
, "%s\n", msg
);
2630 exit( YY_EXIT_FAILURE
);
2635 /* Redefine yyless() so it works in section 3 code. */
2641 /* Undo effects of setting up yytext. */ \
2642 yytext[yyleng] = yy_hold_char; \
2643 yy_c_buf_p = yytext + n; \
2644 yy_hold_char = *yy_c_buf_p; \
2645 *yy_c_buf_p = '\0'; \
2651 /* Internal utility routines. */
2654 #ifdef YY_USE_PROTOS
2655 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2657 static void yy_flex_strncpy( s1
, s2
, n
)
2664 for ( i
= 0; i
< n
; ++i
)
2669 #ifdef YY_NEED_STRLEN
2670 #ifdef YY_USE_PROTOS
2671 static int yy_flex_strlen( yyconst
char *s
)
2673 static int yy_flex_strlen( s
)
2678 for ( n
= 0; s
[n
]; ++n
)
2686 #ifdef YY_USE_PROTOS
2687 static void *yy_flex_alloc( yy_size_t size
)
2689 static void *yy_flex_alloc( size
)
2693 return (void *) malloc( size
);
2696 #ifdef YY_USE_PROTOS
2697 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2699 static void *yy_flex_realloc( ptr
, size
)
2704 /* The cast to (char *) in the following accommodates both
2705 * implementations that use char* generic pointers, and those
2706 * that use void* generic pointers. It works with the latter
2707 * because both ANSI C and C++ allow castless assignment from
2708 * any pointer type to void*, and deal with argument conversions
2709 * as though doing an assignment.
2711 return (void *) realloc( (char *) ptr
, size
);
2714 #ifdef YY_USE_PROTOS
2715 static void yy_flex_free( void *ptr
)
2717 static void yy_flex_free( ptr
)
2731 #line 524 "scan-gram.l"
2734 /*------------------------------------------------------------------.
2735 | CP is pointing to a wannabee semantic value (i.e., a `$'). |
2737 | Possible inputs: $[<TYPENAME>]($|integer) |
2739 | Output to the STRING_OBSTACK a reference to this semantic value. |
2740 `------------------------------------------------------------------*/
2743 handle_action_dollar (char *cp
, location_t location
)
2745 const char *type_name
= NULL
;
2749 /* Get the type name if explicit. */
2762 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2763 if (!type_name
&& typed
)
2764 complain_at (location
, _("$$ of `%s' has no declared type"),
2765 symbol_tag_get (current_rule
->sym
));
2768 obstack_fgrow1 (&string_obstack
,
2769 "]b4_lhs_value([%s])[", type_name
);
2771 else if (isdigit (*cp
) || *cp
== '-')
2773 /* RULE_LENGTH is the number of values in the current rule so
2774 far, which says where to find `$0' with respect to the top of
2775 the stack. It is not the same as the rule->length in the
2776 case of mid rule actions. */
2777 int rule_length
= symbol_list_length (current_rule
->next
);
2778 int n
= strtol (cp
, &cp
, 10);
2780 if (n
> rule_length
)
2781 complain_at (location
, _("invalid value: %s%d"), "$", n
);
2784 if (!type_name
&& n
> 0)
2785 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
2787 if (!type_name
&& typed
)
2788 complain_at (location
, _("$%d of `%s' has no declared type"),
2789 n
, symbol_tag_get (current_rule
->sym
));
2792 obstack_fgrow3 (&string_obstack
,
2793 "]b4_rhs_value([%d], [%d], [%s])[",
2794 rule_length
, n
, type_name
);
2801 complain_at (location
, _("%s is invalid"), quote (buf
));
2806 /*---------------------------------------.
2807 | CP is pointing to $$ in a destructor. |
2808 `---------------------------------------*/
2811 handle_destructor_dollar (char *cp
, location_t location
)
2816 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
2822 complain_at (location
, _("%s is invalid"), quote (buf
));
2827 /*-----------------------------------------------------------------.
2828 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2829 | depending upon CODE_KIND. |
2830 `-----------------------------------------------------------------*/
2833 handle_dollar (braced_code_t braced_code_kind
,
2834 char *text
, location_t location
)
2836 switch (braced_code_kind
)
2838 case action_braced_code
:
2839 handle_action_dollar (text
, location
);
2842 case destructor_braced_code
:
2843 handle_destructor_dollar (text
, location
);
2849 /*------------------------------------------------------.
2850 | TEXT is a location token (i.e., a `@...'). Output to |
2851 | STRING_OBSTACK a reference to this location. |
2852 `------------------------------------------------------*/
2855 handle_action_at (char *text
, location_t location
)
2862 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
2864 else if (isdigit (*text
) || *text
== '-')
2866 /* RULE_LENGTH is the number of values in the current rule so
2867 far, which says where to find `$0' with respect to the top of
2868 the stack. It is not the same as the rule->length in the
2869 case of mid rule actions. */
2870 int rule_length
= symbol_list_length (current_rule
->next
);
2871 int n
= strtol (text
, &text
, 10);
2873 if (n
> rule_length
)
2874 complain_at (location
, _("invalid value: %s%d"), "@", n
);
2876 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
2883 complain_at (location
, _("%s is invalid"), quote (buf
));
2888 /*--------------------------------------------.
2889 | TEXT is expexted tp be @$ in a destructor. |
2890 `--------------------------------------------*/
2893 handle_destructor_at (char *text
, location_t location
)
2898 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
2904 complain_at (location
, _("%s is invalid"), quote (buf
));
2909 /*-------------------------------------------------------------------.
2910 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
2912 `-------------------------------------------------------------------*/
2915 handle_at (braced_code_t braced_code_kind
,
2916 char *text
, location_t location
)
2918 switch (braced_code_kind
)
2920 case action_braced_code
:
2921 handle_action_at (text
, location
);
2924 case destructor_braced_code
:
2925 handle_destructor_at (text
, location
);
2931 /*-------------------------.
2932 | Initialize the scanner. |
2933 `-------------------------*/
2936 scanner_initialize (void)
2938 obstack_init (&string_obstack
);
2942 /*-----------------------------------------------.
2943 | Free all the memory allocated to the scanner. |
2944 `-----------------------------------------------*/
2949 obstack_free (&string_obstack
, 0);