1 #define yy_create_buffer gram__create_buffer
2 #define yy_delete_buffer gram__delete_buffer
3 #define yy_scan_buffer gram__scan_buffer
4 #define yy_scan_string gram__scan_string
5 #define yy_scan_bytes gram__scan_bytes
6 #define yy_flex_debug gram__flex_debug
7 #define yy_init_buffer gram__init_buffer
8 #define yy_flush_buffer gram__flush_buffer
9 #define yy_load_buffer_state gram__load_buffer_state
10 #define yy_switch_to_buffer gram__switch_to_buffer
12 #define yyleng gram_leng
13 #define yylex gram_lex
14 #define yyout gram_out
15 #define yyrestart gram_restart
16 #define yytext gram_text
18 #line 19 "scan-gram.c"
19 /* A lexical scanner generated by flex */
21 /* Scanner skeleton version:
26 #define YY_FLEX_MAJOR_VERSION 2
27 #define YY_FLEX_MINOR_VERSION 5
32 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
45 /* Use prototypes in function declarations. */
48 /* The "const" storage-class-modifier is valid. */
51 #else /* ! __cplusplus */
59 #endif /* ! __cplusplus */
78 #define YY_PROTO(proto) proto
80 #define YY_PROTO(proto) ()
83 /* Returned upon end-of-file. */
86 /* Promotes a possibly negative, possibly signed char to an unsigned
87 * integer for use as an array index. If the signed char is negative,
88 * we want to instead treat it as an 8-bit unsigned char, hence the
91 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
93 /* Enter a start condition. This macro really ought to take a parameter,
94 * but we do it the disgusting crufty way forced on us by the ()-less
95 * definition of BEGIN.
97 #define BEGIN yy_start = 1 + 2 *
99 /* Translate the current start state into a value that can be later handed
100 * to BEGIN to return to the state. The YYSTATE alias is for lex
103 #define YY_START ((yy_start - 1) / 2)
104 #define YYSTATE YY_START
106 /* Action number for EOF rule of a given start state. */
107 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
109 /* Special action meaning "start processing a new file". */
110 #define YY_NEW_FILE yyrestart( yyin )
112 #define YY_END_OF_BUFFER_CHAR 0
114 /* Size of default input buffer. */
115 #define YY_BUF_SIZE 16384
117 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
120 extern FILE *yyin
, *yyout
;
122 #define EOB_ACT_CONTINUE_SCAN 0
123 #define EOB_ACT_END_OF_FILE 1
124 #define EOB_ACT_LAST_MATCH 2
126 /* The funky do-while in the following #define is used to turn the definition
127 * int a single C statement (which needs a semi-colon terminator). This
128 * avoids problems with code like:
130 * if ( condition_holds )
133 * do_something_else();
135 * Prior to using the do-while the compiler would get upset at the
136 * "else" because it interpreted the "if" statement as being all
137 * done when it reached the ';' after the yyless() call.
140 /* Return all but the first 'n' matched characters back to the input stream. */
145 /* Undo effects of setting up yytext. */ \
146 *yy_cp = yy_hold_char; \
147 YY_RESTORE_YY_MORE_OFFSET \
148 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
149 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
153 #define unput(c) yyunput( c, yytext_ptr )
155 /* The following is because we cannot portably get our hands on size_t
156 * (without autoconf's help, which isn't available because we want
157 * flex-generated scanners to compile on their own).
159 typedef unsigned int yy_size_t
;
162 struct yy_buffer_state
166 char *yy_ch_buf
; /* input buffer */
167 char *yy_buf_pos
; /* current position in input buffer */
169 /* Size of input buffer in bytes, not including room for EOB
172 yy_size_t yy_buf_size
;
174 /* Number of characters read into yy_ch_buf, not including EOB
179 /* Whether we "own" the buffer - i.e., we know we created it,
180 * and can realloc() it to grow it, and should free() it to
183 int yy_is_our_buffer
;
185 /* Whether this is an "interactive" input source; if so, and
186 * if we're using stdio for input, then we want to use getc()
187 * instead of fread(), to make sure we stop fetching input after
190 int yy_is_interactive
;
192 /* Whether we're considered to be at the beginning of a line.
193 * If so, '^' rules will be active on the next match, otherwise
198 /* Whether to try to fill the input buffer when we reach the
203 int yy_buffer_status
;
204 #define YY_BUFFER_NEW 0
205 #define YY_BUFFER_NORMAL 1
206 /* When an EOF's been seen but there's still some text to process
207 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
208 * shouldn't try reading from the input source any more. We might
209 * still have a bunch of tokens to match, though, because of
210 * possible backing-up.
212 * When we actually see the EOF, we change the status to "new"
213 * (via yyrestart()), so that the user can continue scanning by
214 * just pointing yyin at a new input file.
216 #define YY_BUFFER_EOF_PENDING 2
219 static YY_BUFFER_STATE yy_current_buffer
= 0;
221 /* We provide macros for accessing buffer states in case in the
222 * future we want to put the buffer states in a more general
225 #define YY_CURRENT_BUFFER yy_current_buffer
228 /* yy_hold_char holds the character lost when yytext is formed. */
229 static char yy_hold_char
;
231 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
236 /* Points to current character in buffer. */
237 static char *yy_c_buf_p
= (char *) 0;
238 static int yy_init
= 1; /* whether we need to initialize */
239 static int yy_start
= 0; /* start state number */
241 /* Flag which is used to allow yywrap()'s to do buffer switches
242 * instead of setting up a fresh yyin. A bit of a hack ...
244 static int yy_did_buffer_switch_on_eof
;
246 void yyrestart
YY_PROTO(( FILE *input_file
));
248 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
249 void yy_load_buffer_state
YY_PROTO(( void ));
250 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
251 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
252 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
253 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
254 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
256 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
257 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
258 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
260 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
261 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
));
262 static void yy_flex_free
YY_PROTO(( void * ));
264 #define yy_new_buffer yy_create_buffer
266 #define yy_set_interactive(is_interactive) \
268 if ( ! yy_current_buffer ) \
269 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
270 yy_current_buffer->yy_is_interactive = is_interactive; \
273 #define yy_set_bol(at_bol) \
275 if ( ! yy_current_buffer ) \
276 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
277 yy_current_buffer->yy_at_bol = at_bol; \
280 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
284 #define YY_SKIP_YYWRAP
287 typedef unsigned char YY_CHAR
;
288 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
289 typedef int yy_state_type
;
293 #define yytext_ptr yytext
295 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
296 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
297 static int yy_get_next_buffer
YY_PROTO(( void ));
298 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
300 /* Done after the current pattern has been matched and before the
301 * corresponding action - sets up yytext.
303 #define YY_DO_BEFORE_ACTION \
304 yytext_ptr = yy_bp; \
305 yyleng = (int) (yy_cp - yy_bp); \
306 yy_hold_char = *yy_cp; \
310 #define YY_NUM_RULES 101
311 #define YY_END_OF_BUFFER 102
312 static yyconst
short int yy_accept
[380] =
314 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
315 0, 0, 0, 0, 0, 0, 0, 0, 102, 49,
316 38, 37, 37, 42, 49, 41, 39, 49, 40, 34,
317 36, 49, 33, 46, 35, 53, 54, 54, 55, 50,
318 51, 80, 83, 83, 79, 50, 82, 51, 75, 78,
319 78, 74, 77, 57, 58, 58, 56, 73, 60, 61,
320 61, 59, 93, 94, 94, 85, 95, 84, 88, 95,
321 50, 51, 90, 89, 97, 99, 99, 85, 98, 84,
322 88, 100, 100, 100, 85, 84, 88, 38, 37, 37,
323 37, 37, 48, 0, 0, 0, 0, 0, 0, 0,
325 0, 0, 0, 0, 0, 0, 0, 0, 0, 45,
326 39, 43, 44, 40, 0, 53, 54, 54, 54, 54,
327 52, 80, 83, 83, 83, 83, 81, 75, 78, 78,
328 78, 78, 76, 57, 58, 58, 58, 58, 72, 71,
329 72, 64, 65, 66, 67, 68, 69, 70, 72, 61,
330 61, 61, 61, 93, 94, 94, 94, 94, 91, 0,
331 91, 0, 86, 87, 92, 0, 92, 97, 99, 99,
332 99, 99, 96, 100, 100, 100, 100, 100, 86, 87,
333 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
334 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
336 0, 0, 0, 0, 0, 44, 47, 0, 0, 0,
337 87, 87, 87, 0, 0, 0, 0, 0, 0, 0,
338 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
339 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
340 0, 0, 0, 62, 63, 0, 0, 0, 0, 0,
341 0, 0, 0, 0, 0, 0, 12, 0, 0, 0,
342 0, 0, 0, 0, 20, 0, 0, 0, 0, 0,
343 26, 0, 29, 0, 0, 32, 0, 2, 0, 0,
344 6, 0, 0, 0, 0, 0, 0, 14, 0, 0,
345 0, 18, 0, 0, 0, 23, 0, 25, 27, 30,
347 0, 1, 3, 0, 0, 8, 0, 0, 0, 0,
348 0, 0, 0, 19, 0, 0, 0, 0, 0, 4,
349 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
350 0, 0, 0, 31, 0, 0, 0, 0, 0, 0,
351 0, 16, 17, 0, 24, 0, 0, 0, 0, 0,
352 0, 13, 0, 0, 0, 5, 0, 0, 0, 11,
353 0, 0, 0, 0, 9, 0, 15, 22, 28, 0,
354 0, 7, 0, 0, 0, 0, 0, 10, 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
[406] =
400 0, 0, 48, 51, 58, 61, 83, 86, 73, 94,
401 108, 110, 131, 179, 227, 249, 116, 142, 839, 840,
402 836, 55, 64, 840, 267, 840, 0, 44, 79, 840,
403 840, 0, 840, 840, 840, 0, 97, 99, 825, 840,
404 840, 0, 119, 122, 840, 840, 0, 840, 0, 126,
405 138, 840, 0, 0, 145, 153, 840, 311, 840, 155,
406 157, 840, 0, 159, 164, 840, 159, 840, 62, 164,
407 840, 840, 840, 840, 0, 185, 189, 840, 786, 840,
408 185, 192, 201, 203, 205, 207, 209, 833, 211, 213,
409 216, 219, 840, 800, 39, 86, 799, 796, 65, 801,
411 198, 786, 184, 795, 109, 203, 790, 797, 800, 840,
412 0, 840, 0, 230, 806, 0, 242, 244, 255, 259,
413 840, 0, 261, 263, 265, 272, 840, 0, 274, 276,
414 278, 280, 840, 0, 282, 284, 286, 288, 840, 840,
415 811, 840, 840, 840, 840, 840, 840, 840, 0, 297,
416 314, 316, 318, 0, 322, 324, 326, 328, 840, 322,
417 326, 0, 840, 0, 840, 330, 332, 0, 344, 347,
418 355, 357, 840, 359, 361, 363, 365, 367, 369, 371,
419 785, 144, 781, 780, 780, 144, 778, 787, 789, 775,
420 778, 366, 784, 770, 168, 771, 779, 780, 783, 767,
422 772, 766, 771, 763, 775, 0, 840, 789, 0, 782,
423 0, 374, 377, 774, 755, 764, 754, 766, 756, 764,
424 763, 762, 230, 748, 764, 757, 758, 751, 760, 744,
425 744, 755, 744, 751, 747, 743, 737, 740, 746, 745,
426 735, 746, 744, 840, 840, 373, 730, 738, 731, 727,
427 739, 725, 737, 754, 734, 722, 840, 718, 730, 372,
428 725, 716, 720, 712, 840, 712, 375, 711, 723, 709,
429 840, 713, 840, 712, 710, 840, 701, 840, 717, 702,
430 840, 378, 702, 704, 380, 717, 708, 840, 701, 702,
431 697, 840, 695, 707, 696, 840, 692, 840, 382, 840,
433 692, 840, 691, 704, 686, 840, 689, 690, 687, 688,
434 659, 666, 633, 840, 628, 629, 613, 606, 618, 840,
435 603, 615, 614, 597, 596, 597, 603, 590, 603, 840,
436 589, 567, 578, 840, 564, 541, 547, 534, 523, 510,
437 520, 840, 840, 506, 840, 516, 497, 510, 499, 368,
438 365, 840, 368, 359, 348, 840, 316, 307, 297, 840,
439 287, 282, 283, 260, 840, 252, 840, 840, 840, 263,
440 384, 840, 241, 236, 224, 196, 158, 840, 840, 409,
441 423, 437, 451, 465, 479, 493, 507, 227, 521, 535,
442 549, 561, 575, 587, 601, 614, 628, 642, 656, 670,
444 104, 684, 698, 712, 77
447 static yyconst
short int yy_def
[406] =
449 379, 1, 380, 380, 381, 381, 382, 382, 383, 383,
450 384, 384, 385, 385, 386, 386, 387, 387, 379, 379,
451 379, 379, 379, 379, 379, 379, 388, 379, 379, 379,
452 379, 389, 379, 379, 379, 390, 379, 379, 379, 379,
453 379, 391, 379, 379, 379, 379, 392, 379, 393, 379,
454 379, 379, 394, 395, 379, 379, 379, 396, 379, 379,
455 379, 379, 397, 379, 379, 379, 379, 379, 379, 379,
456 379, 379, 379, 379, 398, 379, 379, 379, 379, 379,
457 379, 399, 399, 399, 399, 399, 399, 379, 379, 379,
458 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
460 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
461 388, 379, 400, 379, 389, 390, 379, 379, 379, 379,
462 379, 391, 379, 379, 379, 379, 379, 393, 379, 379,
463 379, 379, 379, 395, 379, 379, 379, 379, 379, 379,
464 379, 379, 379, 379, 379, 379, 379, 379, 401, 379,
465 379, 379, 379, 397, 379, 379, 379, 379, 379, 379,
466 379, 402, 379, 403, 379, 379, 379, 398, 379, 379,
467 379, 379, 379, 399, 399, 399, 399, 399, 399, 404,
468 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
469 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
471 379, 379, 379, 379, 379, 400, 379, 379, 405, 402,
472 403, 404, 404, 379, 379, 379, 379, 379, 379, 379,
473 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
474 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
475 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
476 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
477 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
478 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
479 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
480 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
482 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
483 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
484 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
485 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
486 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
487 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
488 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
489 379, 379, 379, 379, 379, 379, 379, 379, 0, 379,
490 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
491 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
493 379, 379, 379, 379, 379
496 static yyconst
short int yy_nxt
[891] =
498 20, 21, 22, 23, 24, 20, 25, 26, 20, 20,
499 27, 28, 29, 29, 30, 31, 32, 33, 20, 20,
500 27, 20, 20, 20, 27, 27, 27, 27, 27, 27,
501 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
502 27, 27, 27, 27, 27, 27, 27, 34, 35, 20,
503 37, 38, 112, 37, 38, 113, 39, 89, 90, 39,
504 43, 44, 45, 43, 44, 45, 91, 92, 182, 40,
505 163, 41, 40, 164, 41, 55, 56, 57, 183, 46,
506 47, 48, 46, 47, 48, 50, 51, 245, 50, 51,
507 52, 114, 114, 52, 188, 58, 55, 56, 57, 117,
509 118, 119, 120, 189, 46, 53, 48, 46, 53, 48,
510 60, 61, 60, 61, 209, 62, 58, 62, 83, 84,
511 85, 123, 124, 86, 125, 126, 184, 87, 129, 130,
512 58, 185, 58, 64, 65, 66, 67, 46, 68, 48,
513 131, 132, 69, 198, 83, 84, 85, 135, 136, 86,
514 70, 199, 71, 87, 72, 137, 138, 150, 151, 152,
515 153, 155, 156, 46, 159, 48, 157, 158, 160, 165,
516 215, 161, 161, 166, 216, 162, 167, 167, 73, 221,
517 74, 64, 65, 66, 67, 217, 68, 169, 170, 222,
518 69, 171, 172, 163, 175, 176, 164, 232, 70, 378,
520 71, 233, 72, 175, 177, 178, 176, 175, 176, 175,
521 176, 175, 176, 89, 90, 91, 92, 179, 89, 90,
522 180, 91, 92, 191, 195, 377, 73, 196, 74, 76,
523 77, 78, 200, 79, 80, 111, 192, 111, 81, 256,
524 193, 201, 114, 114, 117, 118, 119, 120, 46, 202,
525 48, 76, 77, 78, 256, 79, 80, 117, 118, 376,
526 81, 119, 120, 123, 124, 125, 126, 123, 124, 375,
527 46, 374, 48, 93, 125, 126, 129, 130, 131, 132,
528 129, 130, 131, 132, 135, 136, 137, 138, 135, 136,
529 137, 138, 372, 94, 371, 95, 96, 97, 98, 150,
531 151, 370, 99, 100, 101, 102, 103, 104, 105, 106,
532 107, 108, 369, 109, 110, 140, 152, 153, 150, 151,
533 152, 153, 368, 141, 155, 156, 157, 158, 155, 156,
534 157, 158, 367, 140, 161, 161, 142, 143, 161, 161,
535 366, 144, 167, 167, 167, 167, 169, 170, 145, 171,
536 172, 146, 365, 147, 364, 148, 149, 169, 170, 171,
537 172, 175, 176, 175, 177, 178, 176, 178, 176, 175,
538 177, 175, 176, 175, 213, 228, 175, 213, 159, 178,
539 213, 289, 160, 363, 295, 161, 161, 305, 362, 308,
540 228, 318, 211, 373, 211, 211, 289, 211, 211, 295,
542 211, 361, 305, 229, 308, 360, 318, 359, 373, 36,
543 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
544 36, 36, 36, 42, 42, 42, 42, 42, 42, 42,
545 42, 42, 42, 42, 42, 42, 42, 49, 49, 49,
546 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
547 49, 54, 54, 54, 54, 54, 54, 54, 54, 54,
548 54, 54, 54, 54, 54, 59, 59, 59, 59, 59,
549 59, 59, 59, 59, 59, 59, 59, 59, 59, 63,
550 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
551 63, 63, 63, 75, 75, 75, 75, 75, 75, 75,
553 75, 75, 75, 75, 75, 75, 75, 82, 82, 82,
554 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
555 82, 115, 115, 115, 115, 115, 115, 115, 115, 115,
556 115, 115, 358, 115, 115, 116, 357, 356, 116, 116,
557 116, 116, 355, 116, 116, 116, 116, 354, 116, 122,
558 353, 352, 351, 122, 122, 122, 122, 122, 122, 122,
559 122, 127, 127, 127, 127, 127, 127, 127, 127, 127,
560 127, 127, 127, 127, 127, 128, 350, 349, 128, 128,
561 128, 348, 128, 128, 128, 128, 128, 133, 133, 133,
562 133, 133, 133, 133, 133, 133, 133, 133, 133, 133,
564 133, 134, 347, 346, 345, 134, 134, 134, 134, 134,
565 134, 134, 134, 134, 139, 139, 139, 139, 139, 139,
566 139, 139, 139, 139, 139, 139, 139, 139, 154, 344,
567 343, 342, 341, 154, 340, 154, 154, 339, 154, 154,
568 338, 154, 168, 337, 336, 335, 168, 334, 333, 168,
569 168, 332, 168, 168, 331, 168, 174, 174, 174, 174,
570 174, 174, 174, 174, 174, 174, 174, 174, 330, 174,
571 206, 329, 206, 206, 206, 206, 206, 206, 206, 206,
572 206, 206, 206, 206, 210, 210, 210, 210, 210, 210,
573 210, 210, 210, 210, 210, 328, 210, 210, 211, 327,
575 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
576 211, 211, 212, 212, 212, 212, 212, 212, 212, 212,
577 212, 212, 212, 212, 212, 212, 326, 325, 324, 323,
578 322, 321, 320, 319, 317, 316, 315, 314, 313, 312,
579 311, 310, 309, 307, 306, 304, 303, 302, 301, 300,
580 299, 298, 297, 296, 294, 293, 292, 291, 290, 288,
581 287, 286, 285, 284, 283, 282, 281, 280, 279, 278,
582 277, 276, 275, 274, 273, 272, 271, 270, 269, 268,
583 267, 266, 265, 264, 263, 262, 261, 260, 259, 258,
584 257, 255, 254, 253, 252, 251, 250, 249, 248, 247,
586 246, 244, 243, 242, 241, 240, 239, 238, 237, 236,
587 235, 234, 231, 230, 227, 226, 225, 224, 223, 220,
588 219, 218, 214, 208, 207, 205, 204, 203, 197, 194,
589 190, 187, 186, 181, 88, 173, 121, 88, 379, 19,
590 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
591 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
592 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
593 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
594 379, 379, 379, 379, 379, 379, 379, 379, 379, 379
597 static yyconst
short int yy_chk
[891] =
599 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
600 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
601 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
602 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
603 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
604 3, 3, 28, 4, 4, 28, 3, 22, 22, 4,
605 5, 5, 5, 6, 6, 6, 23, 23, 95, 3,
606 69, 3, 4, 69, 4, 9, 9, 9, 95, 5,
607 5, 5, 6, 6, 6, 7, 7, 405, 8, 8,
608 7, 29, 29, 8, 99, 9, 10, 10, 10, 37,
610 37, 38, 38, 99, 7, 7, 7, 8, 8, 8,
611 11, 11, 12, 12, 401, 11, 10, 12, 17, 17,
612 17, 43, 43, 17, 44, 44, 96, 17, 50, 50,
613 11, 96, 12, 13, 13, 13, 13, 17, 13, 17,
614 51, 51, 13, 105, 18, 18, 18, 55, 55, 18,
615 13, 105, 13, 18, 13, 56, 56, 60, 60, 61,
616 61, 64, 64, 18, 67, 18, 65, 65, 67, 70,
617 182, 67, 67, 70, 182, 67, 70, 70, 13, 186,
618 13, 14, 14, 14, 14, 182, 14, 76, 76, 186,
619 14, 77, 77, 81, 82, 82, 81, 195, 14, 377,
621 14, 195, 14, 83, 83, 84, 84, 85, 85, 86,
622 86, 87, 87, 89, 89, 90, 90, 87, 91, 91,
623 87, 92, 92, 101, 103, 376, 14, 103, 14, 15,
624 15, 15, 106, 15, 15, 388, 101, 388, 15, 223,
625 101, 106, 114, 114, 117, 117, 118, 118, 15, 106,
626 15, 16, 16, 16, 223, 16, 16, 119, 119, 375,
627 16, 120, 120, 123, 123, 124, 124, 125, 125, 374,
628 16, 373, 16, 25, 126, 126, 129, 129, 130, 130,
629 131, 131, 132, 132, 135, 135, 136, 136, 137, 137,
630 138, 138, 370, 25, 366, 25, 25, 25, 25, 150,
632 150, 364, 25, 25, 25, 25, 25, 25, 25, 25,
633 25, 25, 363, 25, 25, 58, 151, 151, 152, 152,
634 153, 153, 362, 58, 155, 155, 156, 156, 157, 157,
635 158, 158, 361, 58, 160, 160, 58, 58, 161, 161,
636 359, 58, 166, 166, 167, 167, 169, 169, 58, 170,
637 170, 58, 358, 58, 357, 58, 58, 171, 171, 172,
638 172, 174, 174, 175, 175, 176, 176, 177, 177, 178,
639 178, 179, 179, 180, 180, 192, 212, 212, 246, 213,
640 213, 260, 246, 355, 267, 246, 246, 282, 354, 285,
641 192, 299, 180, 371, 180, 212, 260, 212, 213, 267,
643 213, 353, 282, 192, 285, 351, 299, 350, 371, 380,
644 380, 380, 380, 380, 380, 380, 380, 380, 380, 380,
645 380, 380, 380, 381, 381, 381, 381, 381, 381, 381,
646 381, 381, 381, 381, 381, 381, 381, 382, 382, 382,
647 382, 382, 382, 382, 382, 382, 382, 382, 382, 382,
648 382, 383, 383, 383, 383, 383, 383, 383, 383, 383,
649 383, 383, 383, 383, 383, 384, 384, 384, 384, 384,
650 384, 384, 384, 384, 384, 384, 384, 384, 384, 385,
651 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
652 385, 385, 385, 386, 386, 386, 386, 386, 386, 386,
654 386, 386, 386, 386, 386, 386, 386, 387, 387, 387,
655 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
656 387, 389, 389, 389, 389, 389, 389, 389, 389, 389,
657 389, 389, 349, 389, 389, 390, 348, 347, 390, 390,
658 390, 390, 346, 390, 390, 390, 390, 344, 390, 391,
659 341, 340, 339, 391, 391, 391, 391, 391, 391, 391,
660 391, 392, 392, 392, 392, 392, 392, 392, 392, 392,
661 392, 392, 392, 392, 392, 393, 338, 337, 393, 393,
662 393, 336, 393, 393, 393, 393, 393, 394, 394, 394,
663 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
665 394, 395, 335, 333, 332, 395, 395, 395, 395, 395,
666 395, 395, 395, 395, 396, 396, 396, 396, 396, 396,
667 396, 396, 396, 396, 396, 396, 396, 396, 397, 331,
668 329, 328, 327, 397, 326, 397, 397, 325, 397, 397,
669 324, 397, 398, 323, 322, 321, 398, 319, 318, 398,
670 398, 317, 398, 398, 316, 398, 399, 399, 399, 399,
671 399, 399, 399, 399, 399, 399, 399, 399, 315, 399,
672 400, 313, 400, 400, 400, 400, 400, 400, 400, 400,
673 400, 400, 400, 400, 402, 402, 402, 402, 402, 402,
674 402, 402, 402, 402, 402, 312, 402, 402, 403, 311,
676 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
677 403, 403, 404, 404, 404, 404, 404, 404, 404, 404,
678 404, 404, 404, 404, 404, 404, 310, 309, 308, 307,
679 305, 304, 303, 301, 297, 295, 294, 293, 291, 290,
680 289, 287, 286, 284, 283, 280, 279, 277, 275, 274,
681 272, 270, 269, 268, 266, 264, 263, 262, 261, 259,
682 258, 256, 255, 254, 253, 252, 251, 250, 249, 248,
683 247, 243, 242, 241, 240, 239, 238, 237, 236, 235,
684 234, 233, 232, 231, 230, 229, 228, 227, 226, 225,
685 224, 222, 221, 220, 219, 218, 217, 216, 215, 214,
687 210, 208, 205, 204, 203, 202, 201, 200, 199, 198,
688 197, 196, 194, 193, 191, 190, 189, 188, 187, 185,
689 184, 183, 181, 141, 115, 109, 108, 107, 104, 102,
690 100, 98, 97, 94, 88, 79, 39, 21, 19, 379,
691 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
692 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
693 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
694 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
695 379, 379, 379, 379, 379, 379, 379, 379, 379, 379
698 static yy_state_type yy_last_accepting_state
;
699 static char *yy_last_accepting_cpos
;
701 extern int yy_flex_debug
;
702 int yy_flex_debug
= 1;
704 static yyconst
short int yy_rule_linenum
[101] =
706 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
707 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
708 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
709 152, 153, 155, 156, 157, 158, 160, 161, 162, 167,
710 170, 173, 176, 177, 180, 183, 186, 194, 200, 216,
711 217, 228, 240, 241, 242, 259, 268, 270, 290, 305,
712 307, 327, 339, 343, 344, 345, 346, 347, 348, 349,
713 350, 351, 357, 368, 374, 375, 377, 379, 397, 403,
714 404, 406, 408, 426, 429, 432, 433, 436, 447, 458,
715 460, 462, 465, 466, 469, 489, 496, 497, 498, 518
719 /* The intent behind this definition is that it'll catch
720 * any uses of REJECT which flex missed.
722 #define REJECT reject_used_but_not_detected
723 #define yymore() yymore_used_but_not_detected
724 #define YY_MORE_ADJ 0
725 #define YY_RESTORE_YY_MORE_OFFSET
727 #line 1 "scan-gram.l"
729 /* Bison Grammar Scanner -*- C -*-
730 Copyright (C) 2002 Free Software Foundation, Inc.
732 This file is part of Bison, the GNU Compiler Compiler.
734 This program is free software; you can redistribute it and/or modify
735 it under the terms of the GNU General Public License as published by
736 the Free Software Foundation; either version 2 of the License, or
737 (at your option) any later version.
739 This program is distributed in the hope that it will be useful,
740 but WITHOUT ANY WARRANTY; without even the implied warranty of
741 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
742 GNU General Public License for more details.
744 You should have received a copy of the GNU General Public License
745 along with this program; if not, write to the Free Software
746 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
749 #define YY_NO_UNPUT 1
750 #define YY_NEVER_INTERACTIVE 1
751 #define YY_STACK_USED 1
752 #line 26 "scan-gram.l"
754 #include "complain.h"
760 /* Each time we match a string, move the end cursor to its end. */
761 #define YY_USER_INIT \
763 LOCATION_RESET (*yylloc); \
764 yylloc->file = infile; \
765 /* This is only to avoid GCC warnings. */ \
766 if (yycontrol) {;}; \
769 #define YY_USER_ACTION LOCATION_COLUMNS (*yylloc, yyleng);
770 #define YY_LINES LOCATION_LINES (*yylloc, yyleng);
771 #define YY_STEP LOCATION_STEP (*yylloc);
773 /* STRING_OBSTACK -- Used to store all the characters that we need to
774 keep (to construct ID, STRINGS etc.). Use the following macros to
777 Use YY_OBS_GROW to append what has just been matched, and
778 YY_OBS_FINISH to end the string (it puts the ending 0).
779 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
780 used, and which is used by YY_OBS_FREE to free the last string. */
782 static struct obstack string_obstack
;
785 #define YY_OBS_GROW \
786 obstack_grow (&string_obstack, yytext, yyleng)
788 #define YY_OBS_FINISH \
790 obstack_1grow (&string_obstack, '\0'); \
791 last_string = obstack_finish (&string_obstack); \
794 #define YY_OBS_FREE \
796 obstack_free (&string_obstack, last_string); \
800 scanner_last_string_free (void)
806 static int braces_level
= 0;
807 static int percent_percent_count
= 0;
809 static void handle_dollar
PARAMS ((braced_code_t code_kind
,
810 char *cp
, location_t location
));
811 static void handle_at
PARAMS ((braced_code_t code_kind
,
812 char *cp
, location_t location
));
817 #define SC_CHARACTER 3
819 #define SC_ESCAPED_STRING 4
820 #define SC_ESCAPED_CHARACTER 5
822 #define SC_BRACED_CODE 6
823 #define SC_PROLOGUE 7
824 #define SC_EPILOGUE 8
826 #line 827 "scan-gram.c"
828 /* Macros after this point can all be overridden by user definitions in
832 #ifndef YY_SKIP_YYWRAP
834 extern "C" int yywrap
YY_PROTO(( void ));
836 extern int yywrap
YY_PROTO(( void ));
841 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
845 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
848 #ifdef YY_NEED_STRLEN
849 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
854 static int yyinput
YY_PROTO(( void ));
856 static int input
YY_PROTO(( void ));
861 static int yy_start_stack_ptr
= 0;
862 static int yy_start_stack_depth
= 0;
863 static int *yy_start_stack
= 0;
864 #ifndef YY_NO_PUSH_STATE
865 static void yy_push_state
YY_PROTO(( int new_state
));
867 #ifndef YY_NO_POP_STATE
868 static void yy_pop_state
YY_PROTO(( void ));
870 #ifndef YY_NO_TOP_STATE
871 static int yy_top_state
YY_PROTO(( void ));
875 #define YY_NO_PUSH_STATE 1
876 #define YY_NO_POP_STATE 1
877 #define YY_NO_TOP_STATE 1
880 #ifdef YY_MALLOC_DECL
888 /* Just try to get by without declaring the routines. This will fail
889 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
890 * or sizeof(void*) != sizeof(int).
895 /* Amount of stuff to slurp up with each read. */
896 #ifndef YY_READ_BUF_SIZE
897 #define YY_READ_BUF_SIZE 8192
900 /* Copy whatever the last rule matched to the standard output. */
903 /* This used to be an fputs(), but since the string might contain NUL's,
904 * we now use fwrite().
906 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
909 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
910 * is returned in "result".
913 #define YY_INPUT(buf,result,max_size) \
914 if ( yy_current_buffer->yy_is_interactive ) \
917 for ( n = 0; n < max_size && \
918 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
921 buf[n++] = (char) c; \
922 if ( c == EOF && ferror( yyin ) ) \
923 YY_FATAL_ERROR( "input in flex scanner failed" ); \
926 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
927 && ferror( yyin ) ) \
928 YY_FATAL_ERROR( "input in flex scanner failed" );
931 /* No semi-colon after return; correct usage is to write "yyterminate();" -
932 * we don't want an extra ';' after the "return" because that will cause
933 * some compilers to complain about unreachable statements.
936 #define yyterminate() return YY_NULL
939 /* Number of entries by which start-condition stack grows. */
940 #ifndef YY_START_STACK_INCR
941 #define YY_START_STACK_INCR 25
944 /* Report a fatal error. */
945 #ifndef YY_FATAL_ERROR
946 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
949 /* Default declaration of generated scanner - a define so the user can
950 * easily add parameters.
953 #define YY_DECL int yylex YY_PROTO(( void ))
956 /* Code executed at the beginning of each rule, after yytext and yyleng
959 #ifndef YY_USER_ACTION
960 #define YY_USER_ACTION
963 /* Code executed at the end of each rule. */
965 #define YY_BREAK break;
968 #define YY_RULE_SETUP \
973 register yy_state_type yy_current_state
;
974 register char *yy_cp
, *yy_bp
;
977 #line 98 "scan-gram.l"
980 /* At each yylex invocation, mark the current position as the
981 start of the next token. */
984 fprintf (stderr
, "FOO1: %p: ", yylloc
);
985 LOCATION_PRINT (stderr
, *yylloc
);
986 fprintf (stderr
, "\n");
990 fprintf (stderr
, "BAR1: ");
991 LOCATION_PRINT (stderr
, *yylloc
);
992 fprintf (stderr
, "\n");
997 /*----------------------------.
998 | Scanning Bison directives. |
999 `----------------------------*/
1000 #line 1001 "scan-gram.c"
1011 yy_start
= 1; /* first start state */
1019 if ( ! yy_current_buffer
)
1021 yy_create_buffer( yyin
, YY_BUF_SIZE
);
1023 yy_load_buffer_state();
1026 while ( 1 ) /* loops until end-of-file is reached */
1030 /* Support of yytext. */
1031 *yy_cp
= yy_hold_char
;
1033 /* yy_bp points to the position in yy_ch_buf of the start of
1038 yy_current_state
= yy_start
;
1042 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
1043 if ( yy_accept
[yy_current_state
] )
1045 yy_last_accepting_state
= yy_current_state
;
1046 yy_last_accepting_cpos
= yy_cp
;
1048 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1050 yy_current_state
= (int) yy_def
[yy_current_state
];
1051 if ( yy_current_state
>= 380 )
1052 yy_c
= yy_meta
[(unsigned int) yy_c
];
1054 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1057 while ( yy_base
[yy_current_state
] != 840 );
1060 yy_act
= yy_accept
[yy_current_state
];
1062 { /* have to back up */
1063 yy_cp
= yy_last_accepting_cpos
;
1064 yy_current_state
= yy_last_accepting_state
;
1065 yy_act
= yy_accept
[yy_current_state
];
1068 YY_DO_BEFORE_ACTION
;
1071 do_action
: /* This label is used only to access EOF actions. */
1073 if ( yy_flex_debug
)
1076 fprintf( stderr
, "--scanner backing up\n" );
1077 else if ( yy_act
< 101 )
1078 fprintf( stderr
, "--accepting rule at line %d (\"%s\")\n",
1079 yy_rule_linenum
[yy_act
], yytext
);
1080 else if ( yy_act
== 101 )
1081 fprintf( stderr
, "--accepting default rule (\"%s\")\n",
1083 else if ( yy_act
== 102 )
1084 fprintf( stderr
, "--(end of buffer or a NUL)\n" );
1086 fprintf( stderr
, "--EOF (start condition %d)\n", YY_START
);
1090 { /* beginning of action switch */
1091 case 0: /* must back up */
1092 /* undo the effects of YY_DO_BEFORE_ACTION */
1093 *yy_cp
= yy_hold_char
;
1094 yy_cp
= yy_last_accepting_cpos
;
1095 yy_current_state
= yy_last_accepting_state
;
1096 goto yy_find_action
;
1102 #line 122 "scan-gram.l"
1103 return PERCENT_NONASSOC
;
1107 #line 123 "scan-gram.l"
1108 return PERCENT_DEBUG
;
1112 #line 124 "scan-gram.l"
1113 return PERCENT_DEFINE
;
1117 #line 125 "scan-gram.l"
1118 return PERCENT_DEFINES
;
1122 #line 126 "scan-gram.l"
1123 return PERCENT_DESTRUCTOR
;
1127 #line 127 "scan-gram.l"
1128 return PERCENT_DPREC
;
1132 #line 128 "scan-gram.l"
1133 return PERCENT_ERROR_VERBOSE
;
1137 #line 129 "scan-gram.l"
1138 return PERCENT_EXPECT
;
1142 #line 130 "scan-gram.l"
1143 return PERCENT_FILE_PREFIX
;
1147 #line 131 "scan-gram.l"
1148 return PERCENT_YACC
;
1152 #line 132 "scan-gram.l"
1153 return PERCENT_GLR_PARSER
;
1157 #line 133 "scan-gram.l"
1158 return PERCENT_LEFT
;
1162 #line 134 "scan-gram.l"
1163 return PERCENT_LOCATIONS
;
1167 #line 135 "scan-gram.l"
1168 return PERCENT_MERGE
;
1172 #line 136 "scan-gram.l"
1173 return PERCENT_NAME_PREFIX
;
1177 #line 137 "scan-gram.l"
1178 return PERCENT_NO_LINES
;
1182 #line 138 "scan-gram.l"
1183 return PERCENT_NONASSOC
;
1187 #line 139 "scan-gram.l"
1188 return PERCENT_NTERM
;
1192 #line 140 "scan-gram.l"
1193 return PERCENT_OUTPUT
;
1197 #line 141 "scan-gram.l"
1198 return PERCENT_PREC
;
1202 #line 142 "scan-gram.l"
1203 return PERCENT_PRINTER
;
1207 #line 143 "scan-gram.l"
1208 return PERCENT_PURE_PARSER
;
1212 #line 144 "scan-gram.l"
1213 return PERCENT_RIGHT
;
1217 #line 145 "scan-gram.l"
1218 return PERCENT_SKELETON
;
1222 #line 146 "scan-gram.l"
1223 return PERCENT_START
;
1227 #line 147 "scan-gram.l"
1228 return PERCENT_TOKEN
;
1232 #line 148 "scan-gram.l"
1233 return PERCENT_TOKEN
;
1237 #line 149 "scan-gram.l"
1238 return PERCENT_TOKEN_TABLE
;
1242 #line 150 "scan-gram.l"
1243 return PERCENT_TYPE
;
1247 #line 151 "scan-gram.l"
1248 return PERCENT_UNION
;
1252 #line 152 "scan-gram.l"
1253 return PERCENT_VERBOSE
;
1257 #line 153 "scan-gram.l"
1258 return PERCENT_YACC
;
1262 #line 155 "scan-gram.l"
1267 #line 156 "scan-gram.l"
1272 #line 157 "scan-gram.l"
1277 #line 158 "scan-gram.l"
1282 #line 160 "scan-gram.l"
1287 #line 161 "scan-gram.l"
1292 #line 162 "scan-gram.l"
1294 yylval
->symbol
= symbol_get (yytext
, *yylloc
);
1300 #line 167 "scan-gram.l"
1301 yylval
->integer
= strtol (yytext
, 0, 10); return INT
;
1303 /* Characters. We don't check there is only one. */
1306 #line 170 "scan-gram.l"
1307 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_CHARACTER
);
1312 #line 173 "scan-gram.l"
1313 YY_OBS_GROW
; yy_push_state (SC_ESCAPED_STRING
);
1318 #line 176 "scan-gram.l"
1319 yy_push_state (SC_COMMENT
);
1323 #line 177 "scan-gram.l"
1329 #line 180 "scan-gram.l"
1330 yy_push_state (SC_PROLOGUE
);
1332 /* Code in between braces. */
1335 #line 183 "scan-gram.l"
1336 YY_OBS_GROW
; ++braces_level
; yy_push_state (SC_BRACED_CODE
);
1341 #line 186 "scan-gram.l"
1343 obstack_grow (&string_obstack
, yytext
+ 1, yyleng
- 2);
1345 yylval
->string
= last_string
;
1351 #line 194 "scan-gram.l"
1353 if (++percent_percent_count
== 2)
1354 yy_push_state (SC_EPILOGUE
);
1355 return PERCENT_PERCENT
;
1360 #line 200 "scan-gram.l"
1362 LOCATION_PRINT (stderr
, *yylloc
);
1363 fprintf (stderr
, _(": invalid character: `%c'\n"), *yytext
);
1368 /*------------------------------------------------------------.
1369 | Whatever the start condition (but those which correspond to |
1370 | entity `swallowed' by Bison: SC_ESCAPED_STRING and |
1371 | SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1372 `------------------------------------------------------------*/
1377 #line 216 "scan-gram.l"
1378 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@<:@");
1382 #line 217 "scan-gram.l"
1383 if (YY_START
!= SC_COMMENT
) obstack_sgrow (&string_obstack
, "@:>@");
1386 /*-----------------------------------------------------------.
1387 | Scanning a C comment. The initial `/ *' is already eaten. |
1388 `-----------------------------------------------------------*/
1393 #line 228 "scan-gram.l"
1394 { /* End of the comment. */
1395 if (yy_top_state () == INITIAL
)
1408 #line 240 "scan-gram.l"
1409 if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1413 #line 241 "scan-gram.l"
1414 if (yy_top_state () != INITIAL
) YY_OBS_GROW
; YY_LINES
;
1418 #line 242 "scan-gram.l"
1419 /* Stray `*'. */if (yy_top_state () != INITIAL
) YY_OBS_GROW
;
1421 case YY_STATE_EOF(SC_COMMENT
):
1422 #line 244 "scan-gram.l"
1424 LOCATION_PRINT (stderr
, *yylloc
);
1425 fprintf (stderr
, _(": unexpected end of file in a comment\n"));
1430 /*----------------------------------------------------------------.
1431 | Scanning a C string, including its escapes. The initial `"' is |
1433 `----------------------------------------------------------------*/
1438 #line 259 "scan-gram.l"
1440 assert (yy_top_state () == INITIAL
);
1443 yylval
->string
= last_string
;
1450 #line 268 "scan-gram.l"
1455 #line 270 "scan-gram.l"
1456 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1458 case YY_STATE_EOF(SC_ESCAPED_STRING
):
1459 #line 272 "scan-gram.l"
1461 LOCATION_PRINT (stderr
, *yylloc
);
1462 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1463 assert (yy_top_state () == INITIAL
);
1465 yylval
->string
= last_string
;
1471 /*---------------------------------------------------------------.
1472 | Scanning a C character, decoding its escapes. The initial "'" |
1473 | is already eaten. |
1474 `---------------------------------------------------------------*/
1479 #line 290 "scan-gram.l"
1482 assert (yy_top_state () == INITIAL
);
1485 yylval
->symbol
= symbol_get (last_string
, *yylloc
);
1486 symbol_class_set (yylval
->symbol
, token_sym
, *yylloc
);
1487 symbol_user_token_number_set (yylval
->symbol
,
1488 (unsigned char) last_string
[1], *yylloc
);
1497 #line 305 "scan-gram.l"
1502 #line 307 "scan-gram.l"
1503 obstack_1grow (&string_obstack
, '\n'); YY_LINES
;
1505 case YY_STATE_EOF(SC_ESCAPED_CHARACTER
):
1506 #line 309 "scan-gram.l"
1508 LOCATION_PRINT (stderr
, *yylloc
);
1509 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1510 assert (yy_top_state () == INITIAL
);
1512 yylval
->string
= last_string
;
1518 /*----------------------------.
1519 | Decode escaped characters. |
1520 `----------------------------*/
1525 #line 327 "scan-gram.l"
1527 long c
= strtol (yytext
+ 1, 0, 8);
1530 LOCATION_PRINT (stderr
, *yylloc
);
1531 fprintf (stderr
, _(": invalid escape: %s\n"), quote (yytext
));
1535 obstack_1grow (&string_obstack
, c
);
1540 #line 339 "scan-gram.l"
1542 obstack_1grow (&string_obstack
, strtol (yytext
+ 2, 0, 16));
1547 #line 343 "scan-gram.l"
1548 obstack_1grow (&string_obstack
, '\a');
1552 #line 344 "scan-gram.l"
1553 obstack_1grow (&string_obstack
, '\b');
1557 #line 345 "scan-gram.l"
1558 obstack_1grow (&string_obstack
, '\f');
1562 #line 346 "scan-gram.l"
1563 obstack_1grow (&string_obstack
, '\n');
1567 #line 347 "scan-gram.l"
1568 obstack_1grow (&string_obstack
, '\r');
1572 #line 348 "scan-gram.l"
1573 obstack_1grow (&string_obstack
, '\t');
1577 #line 349 "scan-gram.l"
1578 obstack_1grow (&string_obstack
, '\v');
1582 #line 350 "scan-gram.l"
1583 obstack_1grow (&string_obstack
, yytext
[1]);
1587 #line 351 "scan-gram.l"
1589 LOCATION_PRINT (stderr
, *yylloc
);
1590 fprintf (stderr
, _(": unrecognized escape: %s\n"), quote (yytext
));
1594 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1597 #line 357 "scan-gram.l"
1601 /*----------------------------------------------------------.
1602 | Scanning a C character without decoding its escapes. The |
1603 | initial "'" is already eaten. |
1604 `----------------------------------------------------------*/
1609 #line 368 "scan-gram.l"
1612 assert (yy_top_state () != INITIAL
);
1618 #line 374 "scan-gram.l"
1623 #line 375 "scan-gram.l"
1626 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1629 #line 377 "scan-gram.l"
1634 #line 379 "scan-gram.l"
1635 YY_OBS_GROW
; YY_LINES
;
1637 case YY_STATE_EOF(SC_CHARACTER
):
1638 #line 381 "scan-gram.l"
1640 LOCATION_PRINT (stderr
, *yylloc
);
1641 fprintf (stderr
, _(": unexpected end of file in a character\n"));
1642 assert (yy_top_state () != INITIAL
);
1647 /*----------------------------------------------------------------.
1648 | Scanning a C string, without decoding its escapes. The initial |
1649 | `"' is already eaten. |
1650 `----------------------------------------------------------------*/
1655 #line 397 "scan-gram.l"
1657 assert (yy_top_state () != INITIAL
);
1664 #line 403 "scan-gram.l"
1669 #line 404 "scan-gram.l"
1672 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1675 #line 406 "scan-gram.l"
1680 #line 408 "scan-gram.l"
1681 YY_OBS_GROW
; YY_LINES
;
1683 case YY_STATE_EOF(SC_STRING
):
1684 #line 410 "scan-gram.l"
1686 LOCATION_PRINT (stderr
, *yylloc
);
1687 fprintf (stderr
, _(": unexpected end of file in a string\n"));
1688 assert (yy_top_state () != INITIAL
);
1693 /*---------------------------------------------------.
1694 | Strings, comments etc. can be found in user code. |
1695 `---------------------------------------------------*/
1698 /* Characters. We don't check there is only one. */
1701 #line 426 "scan-gram.l"
1702 YY_OBS_GROW
; yy_push_state (SC_CHARACTER
);
1707 #line 429 "scan-gram.l"
1708 YY_OBS_GROW
; yy_push_state (SC_STRING
);
1713 #line 432 "scan-gram.l"
1714 YY_OBS_GROW
; yy_push_state (SC_COMMENT
);
1718 #line 433 "scan-gram.l"
1724 #line 436 "scan-gram.l"
1728 /*---------------------------------------------------------------.
1729 | Scanning some code in braces (%union and actions). The initial |
1730 | "{" is already eaten. |
1731 `---------------------------------------------------------------*/
1736 #line 447 "scan-gram.l"
1739 if (--braces_level
== 0)
1743 yylval
->string
= last_string
;
1750 #line 458 "scan-gram.l"
1751 YY_OBS_GROW
; braces_level
++;
1755 #line 460 "scan-gram.l"
1756 { handle_dollar (current_braced_code
,
1761 #line 462 "scan-gram.l"
1762 { handle_at (current_braced_code
,
1767 #line 465 "scan-gram.l"
1772 #line 466 "scan-gram.l"
1773 YY_OBS_GROW
; YY_LINES
;
1775 /* A lose $, or /, or etc. */
1778 #line 469 "scan-gram.l"
1781 case YY_STATE_EOF(SC_BRACED_CODE
):
1782 #line 471 "scan-gram.l"
1784 LOCATION_PRINT (stderr
, *yylloc
);
1785 fprintf (stderr
, _(": unexpected end of file in a braced code\n"));
1788 yylval
->string
= last_string
;
1793 /*--------------------------------------------------------------.
1794 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1795 `--------------------------------------------------------------*/
1800 #line 489 "scan-gram.l"
1804 yylval
->string
= last_string
;
1810 #line 496 "scan-gram.l"
1815 #line 497 "scan-gram.l"
1820 #line 498 "scan-gram.l"
1821 YY_OBS_GROW
; YY_LINES
;
1823 case YY_STATE_EOF(SC_PROLOGUE
):
1824 #line 500 "scan-gram.l"
1826 LOCATION_PRINT (stderr
, *yylloc
);
1827 fprintf (stderr
, _(": unexpected end of file in a prologue\n"));
1830 yylval
->string
= last_string
;
1835 /*---------------------------------------------------------------.
1836 | Scanning the epilogue (everything after the second "%%", which |
1837 | has already been eaten. |
1838 `---------------------------------------------------------------*/
1843 #line 518 "scan-gram.l"
1846 case YY_STATE_EOF(SC_EPILOGUE
):
1847 #line 520 "scan-gram.l"
1851 yylval
->string
= last_string
;
1858 #line 529 "scan-gram.l"
1859 YY_FATAL_ERROR( "flex scanner jammed" );
1861 #line 1862 "scan-gram.c"
1862 case YY_STATE_EOF(INITIAL
):
1865 case YY_END_OF_BUFFER
:
1867 /* Amount of text matched not including the EOB char. */
1868 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
1870 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1871 *yy_cp
= yy_hold_char
;
1872 YY_RESTORE_YY_MORE_OFFSET
1874 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
1876 /* We're scanning a new file or input source. It's
1877 * possible that this happened because the user
1878 * just pointed yyin at a new source and called
1879 * yylex(). If so, then we have to assure
1880 * consistency between yy_current_buffer and our
1881 * globals. Here is the right place to do so, because
1882 * this is the first action (other than possibly a
1883 * back-up) that will match for the new input source.
1885 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1886 yy_current_buffer
->yy_input_file
= yyin
;
1887 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
1890 /* Note that here we test for yy_c_buf_p "<=" to the position
1891 * of the first EOB in the buffer, since yy_c_buf_p will
1892 * already have been incremented past the NUL character
1893 * (since all states make transitions on EOB to the
1894 * end-of-buffer state). Contrast this with the test
1897 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1898 { /* This was really a NUL. */
1899 yy_state_type yy_next_state
;
1901 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
1903 yy_current_state
= yy_get_previous_state();
1905 /* Okay, we're now positioned to make the NUL
1906 * transition. We couldn't have
1907 * yy_get_previous_state() go ahead and do it
1908 * for us because it doesn't know how to deal
1909 * with the possibility of jamming (and we don't
1910 * want to build jamming into it because then it
1911 * will run more slowly).
1914 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
1916 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1918 if ( yy_next_state
)
1920 /* Consume the NUL. */
1921 yy_cp
= ++yy_c_buf_p
;
1922 yy_current_state
= yy_next_state
;
1929 goto yy_find_action
;
1933 else switch ( yy_get_next_buffer() )
1935 case EOB_ACT_END_OF_FILE
:
1937 yy_did_buffer_switch_on_eof
= 0;
1941 /* Note: because we've taken care in
1942 * yy_get_next_buffer() to have set up
1943 * yytext, we can now set up
1944 * yy_c_buf_p so that if some total
1945 * hoser (like flex itself) wants to
1946 * call the scanner after we return the
1947 * YY_NULL, it'll still work - another
1948 * YY_NULL will get returned.
1950 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
1952 yy_act
= YY_STATE_EOF(YY_START
);
1958 if ( ! yy_did_buffer_switch_on_eof
)
1964 case EOB_ACT_CONTINUE_SCAN
:
1966 yytext_ptr
+ yy_amount_of_matched_text
;
1968 yy_current_state
= yy_get_previous_state();
1971 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1974 case EOB_ACT_LAST_MATCH
:
1976 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
1978 yy_current_state
= yy_get_previous_state();
1981 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
1982 goto yy_find_action
;
1989 "fatal flex scanner internal error--no action found" );
1990 } /* end of action switch */
1991 } /* end of scanning one token */
1992 } /* end of yylex */
1995 /* yy_get_next_buffer - try to read in a new buffer
1997 * Returns a code representing an action:
1998 * EOB_ACT_LAST_MATCH -
1999 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2000 * EOB_ACT_END_OF_FILE - end of file
2003 static int yy_get_next_buffer()
2005 register char *dest
= yy_current_buffer
->yy_ch_buf
;
2006 register char *source
= yytext_ptr
;
2007 register int number_to_move
, i
;
2010 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
2012 "fatal flex scanner internal error--end of buffer missed" );
2014 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
2015 { /* Don't try to fill the buffer, so this is an EOF. */
2016 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
2018 /* We matched a single character, the EOB, so
2019 * treat this as a final EOF.
2021 return EOB_ACT_END_OF_FILE
;
2026 /* We matched some text prior to the EOB, first
2029 return EOB_ACT_LAST_MATCH
;
2033 /* Try to read more data. */
2035 /* First move last chars to start of buffer. */
2036 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
2038 for ( i
= 0; i
< number_to_move
; ++i
)
2039 *(dest
++) = *(source
++);
2041 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
2042 /* don't do the read, it's not guaranteed to return an EOF,
2045 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
2050 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
2052 while ( num_to_read
<= 0 )
2053 { /* Not enough room in the buffer - grow it. */
2054 #ifdef YY_USES_REJECT
2056 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2059 /* just a shorter name for the current buffer */
2060 YY_BUFFER_STATE b
= yy_current_buffer
;
2062 int yy_c_buf_p_offset
=
2063 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
2065 if ( b
->yy_is_our_buffer
)
2067 int new_size
= b
->yy_buf_size
* 2;
2069 if ( new_size
<= 0 )
2070 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
2072 b
->yy_buf_size
*= 2;
2074 b
->yy_ch_buf
= (char *)
2075 /* Include room in for 2 EOB chars. */
2076 yy_flex_realloc( (void *) b
->yy_ch_buf
,
2077 b
->yy_buf_size
+ 2 );
2080 /* Can't grow it, we don't own it. */
2083 if ( ! b
->yy_ch_buf
)
2085 "fatal error - scanner input buffer overflow" );
2087 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
2089 num_to_read
= yy_current_buffer
->yy_buf_size
-
2094 if ( num_to_read
> YY_READ_BUF_SIZE
)
2095 num_to_read
= YY_READ_BUF_SIZE
;
2097 /* Read in more data. */
2098 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
2099 yy_n_chars
, num_to_read
);
2101 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2104 if ( yy_n_chars
== 0 )
2106 if ( number_to_move
== YY_MORE_ADJ
)
2108 ret_val
= EOB_ACT_END_OF_FILE
;
2114 ret_val
= EOB_ACT_LAST_MATCH
;
2115 yy_current_buffer
->yy_buffer_status
=
2116 YY_BUFFER_EOF_PENDING
;
2121 ret_val
= EOB_ACT_CONTINUE_SCAN
;
2123 yy_n_chars
+= number_to_move
;
2124 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
2125 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
2127 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
2133 /* yy_get_previous_state - get the state just before the EOB char was reached */
2135 static yy_state_type
yy_get_previous_state()
2137 register yy_state_type yy_current_state
;
2138 register char *yy_cp
;
2140 yy_current_state
= yy_start
;
2142 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
2144 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
2145 if ( yy_accept
[yy_current_state
] )
2147 yy_last_accepting_state
= yy_current_state
;
2148 yy_last_accepting_cpos
= yy_cp
;
2150 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2152 yy_current_state
= (int) yy_def
[yy_current_state
];
2153 if ( yy_current_state
>= 380 )
2154 yy_c
= yy_meta
[(unsigned int) yy_c
];
2156 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2159 return yy_current_state
;
2163 /* yy_try_NUL_trans - try to make a transition on the NUL character
2166 * next_state = yy_try_NUL_trans( current_state );
2169 #ifdef YY_USE_PROTOS
2170 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
2172 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
2173 yy_state_type yy_current_state
;
2176 register int yy_is_jam
;
2177 register char *yy_cp
= yy_c_buf_p
;
2179 register YY_CHAR yy_c
= 1;
2180 if ( yy_accept
[yy_current_state
] )
2182 yy_last_accepting_state
= yy_current_state
;
2183 yy_last_accepting_cpos
= yy_cp
;
2185 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
2187 yy_current_state
= (int) yy_def
[yy_current_state
];
2188 if ( yy_current_state
>= 380 )
2189 yy_c
= yy_meta
[(unsigned int) yy_c
];
2191 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
2192 yy_is_jam
= (yy_current_state
== 379);
2194 return yy_is_jam
? 0 : yy_current_state
;
2199 #ifdef YY_USE_PROTOS
2200 static void yyunput( int c
, register char *yy_bp
)
2202 static void yyunput( c
, yy_bp
)
2204 register char *yy_bp
;
2207 register char *yy_cp
= yy_c_buf_p
;
2209 /* undo effects of setting up yytext */
2210 *yy_cp
= yy_hold_char
;
2212 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2213 { /* need to shift things up to make room */
2214 /* +2 for EOB chars. */
2215 register int number_to_move
= yy_n_chars
+ 2;
2216 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
2217 yy_current_buffer
->yy_buf_size
+ 2];
2218 register char *source
=
2219 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
2221 while ( source
> yy_current_buffer
->yy_ch_buf
)
2222 *--dest
= *--source
;
2224 yy_cp
+= (int) (dest
- source
);
2225 yy_bp
+= (int) (dest
- source
);
2226 yy_current_buffer
->yy_n_chars
=
2227 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
2229 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
2230 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2233 *--yy_cp
= (char) c
;
2237 yy_hold_char
= *yy_cp
;
2240 #endif /* ifndef YY_NO_UNPUT */
2244 static int yyinput()
2251 *yy_c_buf_p
= yy_hold_char
;
2253 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
2255 /* yy_c_buf_p now points to the character we want to return.
2256 * If this occurs *before* the EOB characters, then it's a
2257 * valid NUL; if not, then we've hit the end of the buffer.
2259 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
2260 /* This was really a NUL. */
2264 { /* need more input */
2265 int offset
= yy_c_buf_p
- yytext_ptr
;
2268 switch ( yy_get_next_buffer() )
2270 case EOB_ACT_LAST_MATCH
:
2271 /* This happens because yy_g_n_b()
2272 * sees that we've accumulated a
2273 * token and flags that we need to
2274 * try matching the token before
2275 * proceeding. But for input(),
2276 * there's no matching to consider.
2277 * So convert the EOB_ACT_LAST_MATCH
2278 * to EOB_ACT_END_OF_FILE.
2281 /* Reset buffer status. */
2286 case EOB_ACT_END_OF_FILE
:
2291 if ( ! yy_did_buffer_switch_on_eof
)
2300 case EOB_ACT_CONTINUE_SCAN
:
2301 yy_c_buf_p
= yytext_ptr
+ offset
;
2307 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
2308 *yy_c_buf_p
= '\0'; /* preserve yytext */
2309 yy_hold_char
= *++yy_c_buf_p
;
2316 #ifdef YY_USE_PROTOS
2317 void yyrestart( FILE *input_file
)
2319 void yyrestart( input_file
)
2323 if ( ! yy_current_buffer
)
2324 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
2326 yy_init_buffer( yy_current_buffer
, input_file
);
2327 yy_load_buffer_state();
2331 #ifdef YY_USE_PROTOS
2332 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
2334 void yy_switch_to_buffer( new_buffer
)
2335 YY_BUFFER_STATE new_buffer
;
2338 if ( yy_current_buffer
== new_buffer
)
2341 if ( yy_current_buffer
)
2343 /* Flush out information for old buffer. */
2344 *yy_c_buf_p
= yy_hold_char
;
2345 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
2346 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
2349 yy_current_buffer
= new_buffer
;
2350 yy_load_buffer_state();
2352 /* We don't actually know whether we did this switch during
2353 * EOF (yywrap()) processing, but the only time this flag
2354 * is looked at is after yywrap() is called, so it's safe
2355 * to go ahead and always set it.
2357 yy_did_buffer_switch_on_eof
= 1;
2361 #ifdef YY_USE_PROTOS
2362 void yy_load_buffer_state( void )
2364 void yy_load_buffer_state()
2367 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
2368 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
2369 yyin
= yy_current_buffer
->yy_input_file
;
2370 yy_hold_char
= *yy_c_buf_p
;
2374 #ifdef YY_USE_PROTOS
2375 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
2377 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
2384 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2386 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2388 b
->yy_buf_size
= size
;
2390 /* yy_ch_buf has to be 2 characters longer than the size given because
2391 * we need to put in 2 end-of-buffer characters.
2393 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
2394 if ( ! b
->yy_ch_buf
)
2395 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2397 b
->yy_is_our_buffer
= 1;
2399 yy_init_buffer( b
, file
);
2405 #ifdef YY_USE_PROTOS
2406 void yy_delete_buffer( YY_BUFFER_STATE b
)
2408 void yy_delete_buffer( b
)
2415 if ( b
== yy_current_buffer
)
2416 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
2418 if ( b
->yy_is_our_buffer
)
2419 yy_flex_free( (void *) b
->yy_ch_buf
);
2421 yy_flex_free( (void *) b
);
2425 #ifndef YY_ALWAYS_INTERACTIVE
2426 #ifndef YY_NEVER_INTERACTIVE
2427 extern int isatty
YY_PROTO(( int ));
2431 #ifdef YY_USE_PROTOS
2432 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
2434 void yy_init_buffer( b
, file
)
2441 yy_flush_buffer( b
);
2443 b
->yy_input_file
= file
;
2444 b
->yy_fill_buffer
= 1;
2446 #if YY_ALWAYS_INTERACTIVE
2447 b
->yy_is_interactive
= 1;
2449 #if YY_NEVER_INTERACTIVE
2450 b
->yy_is_interactive
= 0;
2452 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
2458 #ifdef YY_USE_PROTOS
2459 void yy_flush_buffer( YY_BUFFER_STATE b
)
2461 void yy_flush_buffer( b
)
2471 /* We always need two end-of-buffer characters. The first causes
2472 * a transition to the end-of-buffer state. The second causes
2473 * a jam in that state.
2475 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
2476 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
2478 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
2481 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2483 if ( b
== yy_current_buffer
)
2484 yy_load_buffer_state();
2488 #ifndef YY_NO_SCAN_BUFFER
2489 #ifdef YY_USE_PROTOS
2490 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
2492 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
2500 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
2501 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
2502 /* They forgot to leave room for the EOB's. */
2505 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
2507 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2509 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
2510 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
2511 b
->yy_is_our_buffer
= 0;
2512 b
->yy_input_file
= 0;
2513 b
->yy_n_chars
= b
->yy_buf_size
;
2514 b
->yy_is_interactive
= 0;
2516 b
->yy_fill_buffer
= 0;
2517 b
->yy_buffer_status
= YY_BUFFER_NEW
;
2519 yy_switch_to_buffer( b
);
2526 #ifndef YY_NO_SCAN_STRING
2527 #ifdef YY_USE_PROTOS
2528 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
2530 YY_BUFFER_STATE
yy_scan_string( yy_str
)
2531 yyconst
char *yy_str
;
2535 for ( len
= 0; yy_str
[len
]; ++len
)
2538 return yy_scan_bytes( yy_str
, len
);
2543 #ifndef YY_NO_SCAN_BYTES
2544 #ifdef YY_USE_PROTOS
2545 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
2547 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
2548 yyconst
char *bytes
;
2557 /* Get memory for full buffer, including space for trailing EOB's. */
2559 buf
= (char *) yy_flex_alloc( n
);
2561 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2563 for ( i
= 0; i
< len
; ++i
)
2566 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
2568 b
= yy_scan_buffer( buf
, n
);
2570 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2572 /* It's okay to grow etc. this buffer, and we should throw it
2573 * away when we're done.
2575 b
->yy_is_our_buffer
= 1;
2582 #ifndef YY_NO_PUSH_STATE
2583 #ifdef YY_USE_PROTOS
2584 static void yy_push_state( int new_state
)
2586 static void yy_push_state( new_state
)
2590 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
2594 yy_start_stack_depth
+= YY_START_STACK_INCR
;
2595 new_size
= yy_start_stack_depth
* sizeof( int );
2597 if ( ! yy_start_stack
)
2598 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
2601 yy_start_stack
= (int *) yy_flex_realloc(
2602 (void *) yy_start_stack
, new_size
);
2604 if ( ! yy_start_stack
)
2606 "out of memory expanding start-condition stack" );
2609 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
2616 #ifndef YY_NO_POP_STATE
2617 static void yy_pop_state()
2619 if ( --yy_start_stack_ptr
< 0 )
2620 YY_FATAL_ERROR( "start-condition stack underflow" );
2622 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
2627 #ifndef YY_NO_TOP_STATE
2628 static int yy_top_state()
2630 return yy_start_stack
[yy_start_stack_ptr
- 1];
2634 #ifndef YY_EXIT_FAILURE
2635 #define YY_EXIT_FAILURE 2
2638 #ifdef YY_USE_PROTOS
2639 static void yy_fatal_error( yyconst
char msg
[] )
2641 static void yy_fatal_error( msg
)
2645 (void) fprintf( stderr
, "%s\n", msg
);
2646 exit( YY_EXIT_FAILURE
);
2651 /* Redefine yyless() so it works in section 3 code. */
2657 /* Undo effects of setting up yytext. */ \
2658 yytext[yyleng] = yy_hold_char; \
2659 yy_c_buf_p = yytext + n; \
2660 yy_hold_char = *yy_c_buf_p; \
2661 *yy_c_buf_p = '\0'; \
2667 /* Internal utility routines. */
2670 #ifdef YY_USE_PROTOS
2671 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
2673 static void yy_flex_strncpy( s1
, s2
, n
)
2680 for ( i
= 0; i
< n
; ++i
)
2685 #ifdef YY_NEED_STRLEN
2686 #ifdef YY_USE_PROTOS
2687 static int yy_flex_strlen( yyconst
char *s
)
2689 static int yy_flex_strlen( s
)
2694 for ( n
= 0; s
[n
]; ++n
)
2702 #ifdef YY_USE_PROTOS
2703 static void *yy_flex_alloc( yy_size_t size
)
2705 static void *yy_flex_alloc( size
)
2709 return (void *) malloc( size
);
2712 #ifdef YY_USE_PROTOS
2713 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
2715 static void *yy_flex_realloc( ptr
, size
)
2720 /* The cast to (char *) in the following accommodates both
2721 * implementations that use char* generic pointers, and those
2722 * that use void* generic pointers. It works with the latter
2723 * because both ANSI C and C++ allow castless assignment from
2724 * any pointer type to void*, and deal with argument conversions
2725 * as though doing an assignment.
2727 return (void *) realloc( (char *) ptr
, size
);
2730 #ifdef YY_USE_PROTOS
2731 static void yy_flex_free( void *ptr
)
2733 static void yy_flex_free( ptr
)
2747 #line 529 "scan-gram.l"
2750 /*------------------------------------------------------------------.
2751 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2753 | Possible inputs: $[<TYPENAME>]($|integer) |
2755 | Output to the STRING_OBSTACK a reference to this semantic value. |
2756 `------------------------------------------------------------------*/
2759 handle_action_dollar (char *text
, location_t location
)
2761 const char *type_name
= NULL
;
2762 char *cp
= text
+ 1;
2764 /* Get the type name if explicit. */
2777 type_name
= symbol_list_n_type_name_get (current_rule
, location
, 0);
2778 if (!type_name
&& typed
)
2779 complain_at (location
, _("$$ of `%s' has no declared type"),
2780 current_rule
->sym
->tag
);
2783 obstack_fgrow1 (&string_obstack
,
2784 "]b4_lhs_value([%s])[", type_name
);
2786 else if (('0' <= *cp
&& *cp
<= '9') || *cp
== '-')
2788 /* RULE_LENGTH is the number of values in the current rule so
2789 far, which says where to find `$0' with respect to the top of
2790 the stack. It is not the same as the rule->length in the
2791 case of mid rule actions. */
2792 int rule_length
= symbol_list_length (current_rule
->next
);
2793 int n
= strtol (cp
, &cp
, 10);
2795 if (n
> rule_length
)
2796 complain_at (location
, _("invalid value: %s%d"), "$", n
);
2799 if (!type_name
&& n
> 0)
2800 type_name
= symbol_list_n_type_name_get (current_rule
, location
,
2802 if (!type_name
&& typed
)
2803 complain_at (location
, _("$%d of `%s' has no declared type"),
2804 n
, current_rule
->sym
->tag
);
2807 obstack_fgrow3 (&string_obstack
,
2808 "]b4_rhs_value([%d], [%d], [%s])[",
2809 rule_length
, n
, type_name
);
2814 complain_at (location
, _("%s is invalid"), quote (text
));
2819 /*---------------------------------------------------------------.
2820 | TEXT is expexted tp be $$ in some code associated to a symbol: |
2821 | destructor or printer. |
2822 `---------------------------------------------------------------*/
2825 handle_symbol_code_dollar (char *text
, location_t location
)
2827 char *cp
= text
+ 1;
2829 obstack_sgrow (&string_obstack
, "]b4_dollar_dollar[");
2831 complain_at (location
, _("%s is invalid"), quote (text
));
2835 /*-----------------------------------------------------------------.
2836 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2837 | depending upon CODE_KIND. |
2838 `-----------------------------------------------------------------*/
2841 handle_dollar (braced_code_t braced_code_kind
,
2842 char *text
, location_t location
)
2844 switch (braced_code_kind
)
2846 case action_braced_code
:
2847 handle_action_dollar (text
, location
);
2850 case destructor_braced_code
:
2851 case printer_braced_code
:
2852 handle_symbol_code_dollar (text
, location
);
2858 /*------------------------------------------------------.
2859 | TEXT is a location token (i.e., a `@...'). Output to |
2860 | STRING_OBSTACK a reference to this location. |
2861 `------------------------------------------------------*/
2864 handle_action_at (char *text
, location_t location
)
2866 char *cp
= text
+ 1;
2871 obstack_sgrow (&string_obstack
, "]b4_lhs_location[");
2873 else if (('0' <= *cp
&& *cp
<= '9') || *cp
== '-')
2875 /* RULE_LENGTH is the number of values in the current rule so
2876 far, which says where to find `$0' with respect to the top of
2877 the stack. It is not the same as the rule->length in the
2878 case of mid rule actions. */
2879 int rule_length
= symbol_list_length (current_rule
->next
);
2880 int n
= strtol (cp
, &cp
, 10);
2882 if (n
> rule_length
)
2883 complain_at (location
, _("invalid value: %s%d"), "@", n
);
2885 obstack_fgrow2 (&string_obstack
, "]b4_rhs_location([%d], [%d])[",
2890 complain_at (location
, _("%s is invalid"), quote (text
));
2895 /*---------------------------------------------------------------.
2896 | TEXT is expexted tp be @$ in some code associated to a symbol: |
2897 | destructor or printer. |
2898 `---------------------------------------------------------------*/
2901 handle_symbol_code_at (char *text
, location_t location
)
2903 char *cp
= text
+ 1;
2905 obstack_sgrow (&string_obstack
, "]b4_at_dollar[");
2907 complain_at (location
, _("%s is invalid"), quote (text
));
2911 /*-------------------------------------------------------------------.
2912 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
2914 `-------------------------------------------------------------------*/
2917 handle_at (braced_code_t braced_code_kind
,
2918 char *text
, location_t location
)
2920 switch (braced_code_kind
)
2922 case action_braced_code
:
2923 handle_action_at (text
, location
);
2926 case destructor_braced_code
:
2927 case printer_braced_code
:
2928 handle_symbol_code_at (text
, location
);
2934 /*-------------------------.
2935 | Initialize the scanner. |
2936 `-------------------------*/
2939 scanner_initialize (void)
2941 obstack_init (&string_obstack
);
2945 /*-----------------------------------------------.
2946 | Free all the memory allocated to the scanner. |
2947 `-----------------------------------------------*/
2952 obstack_free (&string_obstack
, 0);
2953 /* Reclaim Flex's buffers. */
2954 yy_delete_buffer (YY_CURRENT_BUFFER
);