]> git.saurik.com Git - bison.git/blame_incremental - src/scan-gram.c
(grammar_current_rule_check):
[bison.git] / src / scan-gram.c
... / ...
CommitLineData
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
11#define yyin gram_in
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
17
18#line 19 "scan-gram.c"
19/* A lexical scanner generated by flex */
20
21/* Scanner skeleton version:
22 * $Header$
23 */
24
25#define FLEX_SCANNER
26#define YY_FLEX_MAJOR_VERSION 2
27#define YY_FLEX_MINOR_VERSION 5
28
29#include <stdio.h>
30#include <errno.h>
31
32/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
33#ifdef c_plusplus
34#ifndef __cplusplus
35#define __cplusplus
36#endif
37#endif
38
39
40#ifdef __cplusplus
41
42#include <stdlib.h>
43#ifndef _WIN32
44#include <unistd.h>
45#endif
46
47/* Use prototypes in function declarations. */
48#define YY_USE_PROTOS
49
50/* The "const" storage-class-modifier is valid. */
51#define YY_USE_CONST
52
53#else /* ! __cplusplus */
54
55#if __STDC__
56
57#define YY_USE_PROTOS
58#define YY_USE_CONST
59
60#endif /* __STDC__ */
61#endif /* ! __cplusplus */
62
63#ifdef __TURBOC__
64 #pragma warn -rch
65 #pragma warn -use
66#include <io.h>
67#include <stdlib.h>
68#define YY_USE_CONST
69#define YY_USE_PROTOS
70#endif
71
72#ifdef YY_USE_CONST
73#define yyconst const
74#else
75#define yyconst
76#endif
77
78
79#ifdef YY_USE_PROTOS
80#define YY_PROTO(proto) proto
81#else
82#define YY_PROTO(proto) ()
83#endif
84
85/* Returned upon end-of-file. */
86#define YY_NULL 0
87
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
91 * double cast.
92 */
93#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
94
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.
98 */
99#define BEGIN yy_start = 1 + 2 *
100
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
103 * compatibility.
104 */
105#define YY_START ((yy_start - 1) / 2)
106#define YYSTATE YY_START
107
108/* Action number for EOF rule of a given start state. */
109#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
110
111/* Special action meaning "start processing a new file". */
112#define YY_NEW_FILE yyrestart( yyin )
113
114#define YY_END_OF_BUFFER_CHAR 0
115
116/* Size of default input buffer. */
117#define YY_BUF_SIZE 16384
118
119typedef struct yy_buffer_state *YY_BUFFER_STATE;
120
121extern int yyleng;
122extern FILE *yyin, *yyout;
123
124#define EOB_ACT_CONTINUE_SCAN 0
125#define EOB_ACT_END_OF_FILE 1
126#define EOB_ACT_LAST_MATCH 2
127
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:
131 *
132 * if ( condition_holds )
133 * yyless( 5 );
134 * else
135 * do_something_else();
136 *
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.
140 */
141
142/* Return all but the first 'n' matched characters back to the input stream. */
143
144#define yyless(n) \
145 do \
146 { \
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 */ \
152 } \
153 while ( 0 )
154
155#define unput(c) yyunput( c, yytext_ptr )
156
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).
160 */
161typedef unsigned int yy_size_t;
162
163
164struct yy_buffer_state
165 {
166 FILE *yy_input_file;
167
168 char *yy_ch_buf; /* input buffer */
169 char *yy_buf_pos; /* current position in input buffer */
170
171 /* Size of input buffer in bytes, not including room for EOB
172 * characters.
173 */
174 yy_size_t yy_buf_size;
175
176 /* Number of characters read into yy_ch_buf, not including EOB
177 * characters.
178 */
179 int yy_n_chars;
180
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
183 * delete it.
184 */
185 int yy_is_our_buffer;
186
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
190 * each newline.
191 */
192 int yy_is_interactive;
193
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
196 * not.
197 */
198 int yy_at_bol;
199
200 /* Whether to try to fill the input buffer when we reach the
201 * end of it.
202 */
203 int yy_fill_buffer;
204
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.
213 *
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.
217 */
218#define YY_BUFFER_EOF_PENDING 2
219 };
220
221static YY_BUFFER_STATE yy_current_buffer = 0;
222
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
225 * "scanner state".
226 */
227#define YY_CURRENT_BUFFER yy_current_buffer
228
229
230/* yy_hold_char holds the character lost when yytext is formed. */
231static char yy_hold_char;
232
233static int yy_n_chars; /* number of characters read into yy_ch_buf */
234
235
236int yyleng;
237
238/* Points to current character in buffer. */
239static char *yy_c_buf_p = (char *) 0;
240static int yy_init = 1; /* whether we need to initialize */
241static int yy_start = 0; /* start state number */
242
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 ...
245 */
246static int yy_did_buffer_switch_on_eof;
247
248void yyrestart YY_PROTO(( FILE *input_file ));
249
250void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
251void yy_load_buffer_state YY_PROTO(( void ));
252YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
253void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
254void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
255void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
256#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
257
258YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
259YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
260YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
261
262static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
263static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
264static void yy_flex_free YY_PROTO(( void * ));
265
266#define yy_new_buffer yy_create_buffer
267
268#define yy_set_interactive(is_interactive) \
269 { \
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; \
273 }
274
275#define yy_set_bol(at_bol) \
276 { \
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; \
280 }
281
282#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
283
284
285#define yywrap() 1
286#define YY_SKIP_YYWRAP
287
288#define FLEX_DEBUG
289typedef unsigned char YY_CHAR;
290FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
291typedef int yy_state_type;
292
293#define FLEX_DEBUG
294extern char *yytext;
295#define yytext_ptr yytext
296
297static yy_state_type yy_get_previous_state YY_PROTO(( void ));
298static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
299static int yy_get_next_buffer YY_PROTO(( void ));
300static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
301
302/* Done after the current pattern has been matched and before the
303 * corresponding action - sets up yytext.
304 */
305#define YY_DO_BEFORE_ACTION \
306 yytext_ptr = yy_bp; \
307 yyleng = (int) (yy_cp - yy_bp); \
308 yy_hold_char = *yy_cp; \
309 *yy_cp = '\0'; \
310 yy_c_buf_p = yy_cp;
311
312#define YY_NUM_RULES 101
313#define YY_END_OF_BUFFER 102
314static yyconst short int yy_accept[380] =
315 { 0,
316 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
317 0, 0, 0, 0, 0, 0, 0, 0, 102, 49,
318 38, 37, 37, 42, 49, 41, 39, 49, 40, 34,
319 36, 49, 33, 46, 35, 53, 54, 54, 55, 50,
320 51, 80, 83, 83, 79, 50, 82, 51, 75, 78,
321 78, 74, 77, 57, 58, 58, 56, 73, 60, 61,
322 61, 59, 93, 94, 94, 85, 95, 84, 88, 95,
323 50, 51, 90, 89, 97, 99, 99, 85, 98, 84,
324 88, 100, 100, 100, 85, 84, 88, 38, 37, 37,
325 37, 37, 48, 0, 0, 0, 0, 0, 0, 0,
326
327 0, 0, 0, 0, 0, 0, 0, 0, 0, 45,
328 39, 43, 44, 40, 0, 53, 54, 54, 54, 54,
329 52, 80, 83, 83, 83, 83, 81, 75, 78, 78,
330 78, 78, 76, 57, 58, 58, 58, 58, 72, 71,
331 72, 64, 65, 66, 67, 68, 69, 70, 72, 61,
332 61, 61, 61, 93, 94, 94, 94, 94, 91, 0,
333 91, 0, 86, 87, 92, 0, 92, 97, 99, 99,
334 99, 99, 96, 100, 100, 100, 100, 100, 86, 87,
335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
336 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
337
338 0, 0, 0, 0, 0, 44, 47, 0, 0, 0,
339 87, 87, 87, 0, 0, 0, 0, 0, 0, 0,
340 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
341 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
342 0, 0, 0, 62, 63, 0, 0, 0, 0, 0,
343 0, 0, 0, 0, 0, 0, 12, 0, 0, 0,
344 0, 0, 0, 0, 20, 0, 0, 0, 0, 0,
345 26, 0, 29, 0, 0, 32, 0, 2, 0, 0,
346 6, 0, 0, 0, 0, 0, 0, 14, 0, 0,
347 0, 18, 0, 0, 0, 23, 0, 25, 27, 30,
348
349 0, 1, 3, 0, 0, 8, 0, 0, 0, 0,
350 0, 0, 0, 19, 0, 0, 0, 0, 0, 4,
351 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
352 0, 0, 0, 31, 0, 0, 0, 0, 0, 0,
353 0, 16, 17, 0, 24, 0, 0, 0, 0, 0,
354 0, 13, 0, 0, 0, 5, 0, 0, 0, 11,
355 0, 0, 0, 0, 9, 0, 15, 22, 28, 0,
356 0, 7, 0, 0, 0, 0, 0, 10, 0
357 } ;
358
359static yyconst int yy_ec[256] =
360 { 0,
361 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
362 1, 2, 4, 1, 1, 1, 1, 1, 1, 1,
363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
364 1, 2, 1, 5, 1, 6, 7, 1, 8, 1,
365 1, 9, 1, 1, 10, 11, 12, 13, 13, 13,
366 13, 13, 13, 13, 13, 14, 14, 15, 16, 17,
367 18, 19, 1, 20, 21, 21, 21, 21, 21, 21,
368 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
369 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
370 22, 23, 24, 1, 25, 1, 26, 27, 28, 29,
371
372 30, 31, 32, 33, 34, 11, 35, 36, 37, 38,
373 39, 40, 11, 41, 42, 43, 44, 45, 11, 46,
374 47, 11, 48, 49, 50, 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,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
386 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1
389 } ;
390
391static yyconst int yy_meta[51] =
392 { 0,
393 1, 1, 2, 3, 4, 5, 6, 7, 8, 1,
394 9, 10, 11, 11, 1, 1, 1, 1, 12, 5,
395 11, 13, 14, 13, 9, 11, 11, 11, 11, 11,
396 11, 9, 9, 9, 9, 9, 9, 9, 9, 9,
397 9, 9, 9, 9, 9, 9, 9, 5, 1, 5
398 } ;
399
400static yyconst short int yy_base[406] =
401 { 0,
402 0, 0, 48, 51, 58, 61, 83, 86, 73, 94,
403 108, 110, 131, 179, 227, 249, 116, 142, 840, 841,
404 837, 55, 64, 841, 267, 841, 0, 44, 79, 841,
405 841, 0, 841, 841, 841, 0, 97, 99, 826, 841,
406 841, 0, 119, 122, 841, 841, 0, 841, 0, 126,
407 138, 841, 0, 0, 145, 153, 841, 311, 841, 155,
408 157, 841, 0, 159, 164, 841, 159, 841, 62, 164,
409 841, 841, 841, 841, 0, 185, 189, 841, 787, 841,
410 185, 192, 201, 203, 205, 207, 209, 834, 211, 213,
411 216, 219, 841, 801, 39, 86, 800, 797, 65, 802,
412
413 198, 787, 184, 796, 109, 203, 791, 798, 801, 841,
414 0, 841, 0, 230, 807, 0, 242, 244, 255, 259,
415 841, 0, 261, 263, 265, 272, 841, 0, 274, 276,
416 278, 280, 841, 0, 282, 284, 286, 288, 841, 841,
417 812, 841, 841, 841, 841, 841, 841, 841, 0, 297,
418 314, 317, 319, 0, 322, 324, 326, 328, 841, 322,
419 326, 0, 841, 0, 841, 330, 332, 0, 344, 347,
420 355, 357, 841, 359, 361, 363, 365, 367, 369, 371,
421 786, 144, 782, 781, 781, 144, 779, 788, 790, 776,
422 779, 366, 785, 771, 168, 772, 780, 781, 784, 768,
423
424 773, 767, 772, 764, 776, 0, 841, 790, 0, 783,
425 0, 374, 377, 775, 756, 765, 755, 767, 757, 765,
426 764, 763, 230, 749, 765, 758, 759, 752, 761, 745,
427 745, 756, 745, 752, 748, 744, 738, 741, 747, 746,
428 736, 747, 745, 841, 841, 373, 731, 739, 732, 728,
429 740, 726, 738, 755, 735, 723, 841, 719, 731, 372,
430 726, 717, 721, 713, 841, 713, 375, 712, 724, 710,
431 841, 714, 841, 713, 711, 841, 702, 841, 718, 703,
432 841, 378, 703, 705, 380, 718, 709, 841, 702, 703,
433 698, 841, 696, 708, 697, 841, 693, 841, 382, 841,
434
435 693, 841, 692, 705, 687, 841, 690, 691, 688, 689,
436 686, 670, 657, 841, 631, 643, 616, 609, 619, 841,
437 605, 616, 615, 600, 599, 600, 605, 591, 604, 841,
438 590, 592, 579, 841, 565, 562, 551, 535, 547, 511,
439 521, 841, 841, 509, 841, 521, 502, 511, 503, 493,
440 367, 841, 372, 372, 353, 841, 345, 309, 309, 841,
441 295, 292, 283, 260, 841, 252, 841, 841, 841, 263,
442 384, 841, 241, 236, 224, 196, 158, 841, 841, 409,
443 423, 437, 451, 465, 479, 493, 507, 227, 521, 535,
444 549, 561, 575, 587, 601, 614, 628, 642, 656, 670,
445
446 104, 684, 698, 712, 77
447 } ;
448
449static yyconst short int yy_def[406] =
450 { 0,
451 379, 1, 380, 380, 381, 381, 382, 382, 383, 383,
452 384, 384, 385, 385, 386, 386, 387, 387, 379, 379,
453 379, 379, 379, 379, 379, 379, 388, 379, 379, 379,
454 379, 389, 379, 379, 379, 390, 379, 379, 379, 379,
455 379, 391, 379, 379, 379, 379, 392, 379, 393, 379,
456 379, 379, 394, 395, 379, 379, 379, 396, 379, 379,
457 379, 379, 397, 379, 379, 379, 379, 379, 379, 379,
458 379, 379, 379, 379, 398, 379, 379, 379, 379, 379,
459 379, 399, 399, 399, 399, 399, 399, 379, 379, 379,
460 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
461
462 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
463 388, 379, 400, 379, 389, 390, 379, 379, 379, 379,
464 379, 391, 379, 379, 379, 379, 379, 393, 379, 379,
465 379, 379, 379, 395, 379, 379, 379, 379, 379, 379,
466 379, 379, 379, 379, 379, 379, 379, 379, 401, 379,
467 379, 379, 379, 397, 379, 379, 379, 379, 379, 379,
468 379, 402, 379, 403, 379, 379, 379, 398, 379, 379,
469 379, 379, 379, 399, 399, 399, 399, 399, 399, 404,
470 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
471 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
472
473 379, 379, 379, 379, 379, 400, 379, 379, 405, 402,
474 403, 404, 404, 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,
481 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
482 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
483
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, 379, 379,
490 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
491 379, 379, 379, 379, 379, 379, 379, 379, 0, 379,
492 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
493 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
494
495 379, 379, 379, 379, 379
496 } ;
497
498static yyconst short int yy_nxt[892] =
499 { 0,
500 20, 21, 22, 23, 24, 20, 25, 26, 20, 20,
501 27, 28, 29, 29, 30, 31, 32, 33, 20, 20,
502 27, 20, 20, 20, 27, 27, 27, 27, 27, 27,
503 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
504 27, 27, 27, 27, 27, 27, 27, 34, 35, 20,
505 37, 38, 112, 37, 38, 113, 39, 89, 90, 39,
506 43, 44, 45, 43, 44, 45, 91, 92, 182, 40,
507 163, 41, 40, 164, 41, 55, 56, 57, 183, 46,
508 47, 48, 46, 47, 48, 50, 51, 245, 50, 51,
509 52, 114, 114, 52, 188, 58, 55, 56, 57, 117,
510
511 118, 119, 120, 189, 46, 53, 48, 46, 53, 48,
512 60, 61, 60, 61, 209, 62, 58, 62, 83, 84,
513 85, 123, 124, 86, 125, 126, 184, 87, 129, 130,
514 58, 185, 58, 64, 65, 66, 67, 46, 68, 48,
515 131, 132, 69, 198, 83, 84, 85, 135, 136, 86,
516 70, 199, 71, 87, 72, 137, 138, 150, 151, 152,
517 153, 155, 156, 46, 159, 48, 157, 158, 160, 165,
518 215, 161, 161, 166, 216, 162, 167, 167, 73, 221,
519 74, 64, 65, 66, 67, 217, 68, 169, 170, 222,
520 69, 171, 172, 163, 175, 176, 164, 232, 70, 378,
521
522 71, 233, 72, 175, 177, 178, 176, 175, 176, 175,
523 176, 175, 176, 89, 90, 91, 92, 179, 89, 90,
524 180, 91, 92, 191, 195, 377, 73, 196, 74, 76,
525 77, 78, 200, 79, 80, 111, 192, 111, 81, 256,
526 193, 201, 114, 114, 117, 118, 119, 120, 46, 202,
527 48, 76, 77, 78, 256, 79, 80, 117, 118, 376,
528 81, 119, 120, 123, 124, 125, 126, 123, 124, 375,
529 46, 374, 48, 93, 125, 126, 129, 130, 131, 132,
530 129, 130, 131, 132, 135, 136, 137, 138, 135, 136,
531 137, 138, 372, 94, 371, 95, 96, 97, 98, 150,
532
533 151, 370, 99, 100, 101, 102, 103, 104, 105, 106,
534 107, 108, 369, 109, 110, 140, 152, 153, 140, 150,
535 151, 152, 153, 141, 155, 156, 157, 158, 155, 156,
536 157, 158, 368, 140, 161, 161, 142, 143, 161, 161,
537 367, 144, 167, 167, 167, 167, 169, 170, 145, 171,
538 172, 146, 366, 147, 365, 148, 149, 169, 170, 171,
539 172, 175, 176, 175, 177, 178, 176, 178, 176, 175,
540 177, 175, 176, 175, 213, 228, 175, 213, 159, 178,
541 213, 289, 160, 364, 295, 161, 161, 305, 363, 308,
542 228, 318, 211, 373, 211, 211, 289, 211, 211, 295,
543
544 211, 362, 305, 229, 308, 361, 318, 360, 373, 36,
545 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
546 36, 36, 36, 42, 42, 42, 42, 42, 42, 42,
547 42, 42, 42, 42, 42, 42, 42, 49, 49, 49,
548 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
549 49, 54, 54, 54, 54, 54, 54, 54, 54, 54,
550 54, 54, 54, 54, 54, 59, 59, 59, 59, 59,
551 59, 59, 59, 59, 59, 59, 59, 59, 59, 63,
552 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
553 63, 63, 63, 75, 75, 75, 75, 75, 75, 75,
554
555 75, 75, 75, 75, 75, 75, 75, 82, 82, 82,
556 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
557 82, 115, 115, 115, 115, 115, 115, 115, 115, 115,
558 115, 115, 359, 115, 115, 116, 358, 357, 116, 116,
559 116, 116, 356, 116, 116, 116, 116, 355, 116, 122,
560 354, 353, 352, 122, 122, 122, 122, 122, 122, 122,
561 122, 127, 127, 127, 127, 127, 127, 127, 127, 127,
562 127, 127, 127, 127, 127, 128, 351, 350, 128, 128,
563 128, 349, 128, 128, 128, 128, 128, 133, 133, 133,
564 133, 133, 133, 133, 133, 133, 133, 133, 133, 133,
565
566 133, 134, 348, 347, 346, 134, 134, 134, 134, 134,
567 134, 134, 134, 134, 139, 139, 139, 139, 139, 139,
568 139, 139, 139, 139, 139, 139, 139, 139, 154, 345,
569 344, 343, 342, 154, 341, 154, 154, 340, 154, 154,
570 339, 154, 168, 338, 337, 336, 168, 335, 334, 168,
571 168, 333, 168, 168, 332, 168, 174, 174, 174, 174,
572 174, 174, 174, 174, 174, 174, 174, 174, 331, 174,
573 206, 330, 206, 206, 206, 206, 206, 206, 206, 206,
574 206, 206, 206, 206, 210, 210, 210, 210, 210, 210,
575 210, 210, 210, 210, 210, 329, 210, 210, 211, 328,
576
577 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
578 211, 211, 212, 212, 212, 212, 212, 212, 212, 212,
579 212, 212, 212, 212, 212, 212, 327, 326, 325, 324,
580 323, 322, 321, 320, 319, 317, 316, 315, 314, 313,
581 312, 311, 310, 309, 307, 306, 304, 303, 302, 301,
582 300, 299, 298, 297, 296, 294, 293, 292, 291, 290,
583 288, 287, 286, 285, 284, 283, 282, 281, 280, 279,
584 278, 277, 276, 275, 274, 273, 272, 271, 270, 269,
585 268, 267, 266, 265, 264, 263, 262, 261, 260, 259,
586 258, 257, 255, 254, 253, 252, 251, 250, 249, 248,
587
588 247, 246, 244, 243, 242, 241, 240, 239, 238, 237,
589 236, 235, 234, 231, 230, 227, 226, 225, 224, 223,
590 220, 219, 218, 214, 208, 207, 205, 204, 203, 197,
591 194, 190, 187, 186, 181, 88, 173, 121, 88, 379,
592 19, 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,
595 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
596 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
597 379
598
599 } ;
600
601static yyconst short int yy_chk[892] =
602 { 0,
603 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
604 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
605 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
606 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
607 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
608 3, 3, 28, 4, 4, 28, 3, 22, 22, 4,
609 5, 5, 5, 6, 6, 6, 23, 23, 95, 3,
610 69, 3, 4, 69, 4, 9, 9, 9, 95, 5,
611 5, 5, 6, 6, 6, 7, 7, 405, 8, 8,
612 7, 29, 29, 8, 99, 9, 10, 10, 10, 37,
613
614 37, 38, 38, 99, 7, 7, 7, 8, 8, 8,
615 11, 11, 12, 12, 401, 11, 10, 12, 17, 17,
616 17, 43, 43, 17, 44, 44, 96, 17, 50, 50,
617 11, 96, 12, 13, 13, 13, 13, 17, 13, 17,
618 51, 51, 13, 105, 18, 18, 18, 55, 55, 18,
619 13, 105, 13, 18, 13, 56, 56, 60, 60, 61,
620 61, 64, 64, 18, 67, 18, 65, 65, 67, 70,
621 182, 67, 67, 70, 182, 67, 70, 70, 13, 186,
622 13, 14, 14, 14, 14, 182, 14, 76, 76, 186,
623 14, 77, 77, 81, 82, 82, 81, 195, 14, 377,
624
625 14, 195, 14, 83, 83, 84, 84, 85, 85, 86,
626 86, 87, 87, 89, 89, 90, 90, 87, 91, 91,
627 87, 92, 92, 101, 103, 376, 14, 103, 14, 15,
628 15, 15, 106, 15, 15, 388, 101, 388, 15, 223,
629 101, 106, 114, 114, 117, 117, 118, 118, 15, 106,
630 15, 16, 16, 16, 223, 16, 16, 119, 119, 375,
631 16, 120, 120, 123, 123, 124, 124, 125, 125, 374,
632 16, 373, 16, 25, 126, 126, 129, 129, 130, 130,
633 131, 131, 132, 132, 135, 135, 136, 136, 137, 137,
634 138, 138, 370, 25, 366, 25, 25, 25, 25, 150,
635
636 150, 364, 25, 25, 25, 25, 25, 25, 25, 25,
637 25, 25, 363, 25, 25, 58, 151, 151, 58, 152,
638 152, 153, 153, 58, 155, 155, 156, 156, 157, 157,
639 158, 158, 362, 58, 160, 160, 58, 58, 161, 161,
640 361, 58, 166, 166, 167, 167, 169, 169, 58, 170,
641 170, 58, 359, 58, 358, 58, 58, 171, 171, 172,
642 172, 174, 174, 175, 175, 176, 176, 177, 177, 178,
643 178, 179, 179, 180, 180, 192, 212, 212, 246, 213,
644 213, 260, 246, 357, 267, 246, 246, 282, 355, 285,
645 192, 299, 180, 371, 180, 212, 260, 212, 213, 267,
646
647 213, 354, 282, 192, 285, 353, 299, 351, 371, 380,
648 380, 380, 380, 380, 380, 380, 380, 380, 380, 380,
649 380, 380, 380, 381, 381, 381, 381, 381, 381, 381,
650 381, 381, 381, 381, 381, 381, 381, 382, 382, 382,
651 382, 382, 382, 382, 382, 382, 382, 382, 382, 382,
652 382, 383, 383, 383, 383, 383, 383, 383, 383, 383,
653 383, 383, 383, 383, 383, 384, 384, 384, 384, 384,
654 384, 384, 384, 384, 384, 384, 384, 384, 384, 385,
655 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
656 385, 385, 385, 386, 386, 386, 386, 386, 386, 386,
657
658 386, 386, 386, 386, 386, 386, 386, 387, 387, 387,
659 387, 387, 387, 387, 387, 387, 387, 387, 387, 387,
660 387, 389, 389, 389, 389, 389, 389, 389, 389, 389,
661 389, 389, 350, 389, 389, 390, 349, 348, 390, 390,
662 390, 390, 347, 390, 390, 390, 390, 346, 390, 391,
663 344, 341, 340, 391, 391, 391, 391, 391, 391, 391,
664 391, 392, 392, 392, 392, 392, 392, 392, 392, 392,
665 392, 392, 392, 392, 392, 393, 339, 338, 393, 393,
666 393, 337, 393, 393, 393, 393, 393, 394, 394, 394,
667 394, 394, 394, 394, 394, 394, 394, 394, 394, 394,
668
669 394, 395, 336, 335, 333, 395, 395, 395, 395, 395,
670 395, 395, 395, 395, 396, 396, 396, 396, 396, 396,
671 396, 396, 396, 396, 396, 396, 396, 396, 397, 332,
672 331, 329, 328, 397, 327, 397, 397, 326, 397, 397,
673 325, 397, 398, 324, 323, 322, 398, 321, 319, 398,
674 398, 318, 398, 398, 317, 398, 399, 399, 399, 399,
675 399, 399, 399, 399, 399, 399, 399, 399, 316, 399,
676 400, 315, 400, 400, 400, 400, 400, 400, 400, 400,
677 400, 400, 400, 400, 402, 402, 402, 402, 402, 402,
678 402, 402, 402, 402, 402, 313, 402, 402, 403, 312,
679
680 403, 403, 403, 403, 403, 403, 403, 403, 403, 403,
681 403, 403, 404, 404, 404, 404, 404, 404, 404, 404,
682 404, 404, 404, 404, 404, 404, 311, 310, 309, 308,
683 307, 305, 304, 303, 301, 297, 295, 294, 293, 291,
684 290, 289, 287, 286, 284, 283, 280, 279, 277, 275,
685 274, 272, 270, 269, 268, 266, 264, 263, 262, 261,
686 259, 258, 256, 255, 254, 253, 252, 251, 250, 249,
687 248, 247, 243, 242, 241, 240, 239, 238, 237, 236,
688 235, 234, 233, 232, 231, 230, 229, 228, 227, 226,
689 225, 224, 222, 221, 220, 219, 218, 217, 216, 215,
690
691 214, 210, 208, 205, 204, 203, 202, 201, 200, 199,
692 198, 197, 196, 194, 193, 191, 190, 189, 188, 187,
693 185, 184, 183, 181, 141, 115, 109, 108, 107, 104,
694 102, 100, 98, 97, 94, 88, 79, 39, 21, 19,
695 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
696 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
697 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
698 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
699 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,
700 379
701
702 } ;
703
704static yy_state_type yy_last_accepting_state;
705static char *yy_last_accepting_cpos;
706
707extern int yy_flex_debug;
708int yy_flex_debug = 1;
709
710static yyconst short int yy_rule_linenum[101] =
711 { 0,
712 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
713 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
714 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
715 152, 153, 155, 156, 157, 158, 160, 161, 162, 167,
716 170, 173, 176, 177, 180, 183, 186, 194, 200, 216,
717 217, 228, 240, 241, 242, 259, 268, 270, 290, 305,
718 307, 327, 339, 343, 344, 345, 346, 347, 348, 349,
719 350, 351, 357, 368, 374, 375, 377, 379, 397, 403,
720 404, 406, 408, 426, 429, 432, 433, 436, 447, 458,
721 460, 462, 465, 466, 469, 489, 496, 497, 498, 518
722
723 } ;
724
725/* The intent behind this definition is that it'll catch
726 * any uses of REJECT which flex missed.
727 */
728#define REJECT reject_used_but_not_detected
729#define yymore() yymore_used_but_not_detected
730#define YY_MORE_ADJ 0
731#define YY_RESTORE_YY_MORE_OFFSET
732char *yytext;
733#line 1 "scan-gram.l"
734#define INITIAL 0
735/* Bison Grammar Scanner -*- C -*-
736 Copyright (C) 2002 Free Software Foundation, Inc.
737
738 This file is part of Bison, the GNU Compiler Compiler.
739
740 This program is free software; you can redistribute it and/or modify
741 it under the terms of the GNU General Public License as published by
742 the Free Software Foundation; either version 2 of the License, or
743 (at your option) any later version.
744
745 This program is distributed in the hope that it will be useful,
746 but WITHOUT ANY WARRANTY; without even the implied warranty of
747 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
748 GNU General Public License for more details.
749
750 You should have received a copy of the GNU General Public License
751 along with this program; if not, write to the Free Software
752 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
753 02111-1307 USA
754*/
755#define YY_NO_UNPUT 1
756#define YY_NEVER_INTERACTIVE 1
757#define YY_STACK_USED 1
758#line 26 "scan-gram.l"
759#include "system.h"
760#include "complain.h"
761#include "quote.h"
762#include "getargs.h"
763#include "gram.h"
764#include "reader.h"
765
766/* Each time we match a string, move the end cursor to its end. */
767#define YY_USER_INIT \
768do { \
769 LOCATION_RESET (*yylloc); \
770 yylloc->file = infile; \
771 /* This is only to avoid GCC warnings. */ \
772 if (yycontrol) {;}; \
773} while (0)
774
775#define YY_USER_ACTION LOCATION_COLUMNS (*yylloc, yyleng);
776#define YY_LINES LOCATION_LINES (*yylloc, yyleng);
777#define YY_STEP LOCATION_STEP (*yylloc);
778
779/* STRING_OBSTACK -- Used to store all the characters that we need to
780 keep (to construct ID, STRINGS etc.). Use the following macros to
781 use it.
782
783 Use YY_OBS_GROW to append what has just been matched, and
784 YY_OBS_FINISH to end the string (it puts the ending 0).
785 YY_OBS_FINISH also stores this string in LAST_STRING, which can be
786 used, and which is used by YY_OBS_FREE to free the last string. */
787
788static struct obstack string_obstack;
789char *last_string;
790
791#define YY_OBS_GROW \
792 obstack_grow (&string_obstack, yytext, yyleng)
793
794#define YY_OBS_FINISH \
795 do { \
796 obstack_1grow (&string_obstack, '\0'); \
797 last_string = obstack_finish (&string_obstack); \
798 } while (0)
799
800#define YY_OBS_FREE \
801 do { \
802 obstack_free (&string_obstack, last_string); \
803 } while (0)
804
805void
806scanner_last_string_free (void)
807{
808 YY_OBS_FREE;
809}
810
811
812static int braces_level = 0;
813static int percent_percent_count = 0;
814
815static void handle_dollar PARAMS ((braced_code_t code_kind,
816 char *cp, location_t location));
817static void handle_at PARAMS ((braced_code_t code_kind,
818 char *cp, location_t location));
819
820#define SC_COMMENT 1
821
822#define SC_STRING 2
823#define SC_CHARACTER 3
824
825#define SC_ESCAPED_STRING 4
826#define SC_ESCAPED_CHARACTER 5
827
828#define SC_BRACED_CODE 6
829#define SC_PROLOGUE 7
830#define SC_EPILOGUE 8
831
832#line 833 "scan-gram.c"
833
834/* Macros after this point can all be overridden by user definitions in
835 * section 1.
836 */
837
838#ifndef YY_SKIP_YYWRAP
839#ifdef __cplusplus
840extern "C" int yywrap YY_PROTO(( void ));
841#else
842extern int yywrap YY_PROTO(( void ));
843#endif
844#endif
845
846#ifndef YY_NO_UNPUT
847static void yyunput YY_PROTO(( int c, char *buf_ptr ));
848#endif
849
850#ifndef yytext_ptr
851static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
852#endif
853
854#ifdef YY_NEED_STRLEN
855static int yy_flex_strlen YY_PROTO(( yyconst char * ));
856#endif
857
858#ifndef YY_NO_INPUT
859#ifdef __cplusplus
860static int yyinput YY_PROTO(( void ));
861#else
862static int input YY_PROTO(( void ));
863#endif
864#endif
865
866#if YY_STACK_USED
867static int yy_start_stack_ptr = 0;
868static int yy_start_stack_depth = 0;
869static int *yy_start_stack = 0;
870#ifndef YY_NO_PUSH_STATE
871static void yy_push_state YY_PROTO(( int new_state ));
872#endif
873#ifndef YY_NO_POP_STATE
874static void yy_pop_state YY_PROTO(( void ));
875#endif
876#ifndef YY_NO_TOP_STATE
877static int yy_top_state YY_PROTO(( void ));
878#endif
879
880#else
881#define YY_NO_PUSH_STATE 1
882#define YY_NO_POP_STATE 1
883#define YY_NO_TOP_STATE 1
884#endif
885
886#ifdef YY_MALLOC_DECL
887YY_MALLOC_DECL
888#else
889#if __STDC__
890#ifndef __cplusplus
891#include <stdlib.h>
892#endif
893#else
894/* Just try to get by without declaring the routines. This will fail
895 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
896 * or sizeof(void*) != sizeof(int).
897 */
898#endif
899#endif
900
901/* Amount of stuff to slurp up with each read. */
902#ifndef YY_READ_BUF_SIZE
903#define YY_READ_BUF_SIZE 8192
904#endif
905
906/* Copy whatever the last rule matched to the standard output. */
907
908#ifndef ECHO
909/* This used to be an fputs(), but since the string might contain NUL's,
910 * we now use fwrite().
911 */
912#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
913#endif
914
915/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
916 * is returned in "result".
917 */
918#ifndef YY_INPUT
919#define YY_INPUT(buf,result,max_size) \
920 if ( yy_current_buffer->yy_is_interactive ) \
921 { \
922 int c = '*', n; \
923 for ( n = 0; n < max_size && \
924 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
925 buf[n] = (char) c; \
926 if ( c == '\n' ) \
927 buf[n++] = (char) c; \
928 if ( c == EOF && ferror( yyin ) ) \
929 YY_FATAL_ERROR( "input in flex scanner failed" ); \
930 result = n; \
931 } \
932 else \
933 { \
934 errno=0; \
935 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
936 { \
937 if( errno != EINTR) \
938 { \
939 YY_FATAL_ERROR( "input in flex scanner failed" ); \
940 break; \
941 } \
942 errno=0; \
943 clearerr(yyin); \
944 } \
945 }
946#endif
947
948/* No semi-colon after return; correct usage is to write "yyterminate();" -
949 * we don't want an extra ';' after the "return" because that will cause
950 * some compilers to complain about unreachable statements.
951 */
952#ifndef yyterminate
953#define yyterminate() return YY_NULL
954#endif
955
956/* Number of entries by which start-condition stack grows. */
957#ifndef YY_START_STACK_INCR
958#define YY_START_STACK_INCR 25
959#endif
960
961/* Report a fatal error. */
962#ifndef YY_FATAL_ERROR
963#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
964#endif
965
966/* Default declaration of generated scanner - a define so the user can
967 * easily add parameters.
968 */
969#ifndef YY_DECL
970#define YY_DECL int yylex YY_PROTO(( void ))
971#endif
972
973/* Code executed at the beginning of each rule, after yytext and yyleng
974 * have been set up.
975 */
976#ifndef YY_USER_ACTION
977#define YY_USER_ACTION
978#endif
979
980/* Code executed at the end of each rule. */
981#ifndef YY_BREAK
982#define YY_BREAK break;
983#endif
984
985#define YY_RULE_SETUP \
986 YY_USER_ACTION
987
988YY_DECL
989 {
990 register yy_state_type yy_current_state;
991 register char *yy_cp, *yy_bp;
992 register int yy_act;
993
994#line 98 "scan-gram.l"
995
996
997 /* At each yylex invocation, mark the current position as the
998 start of the next token. */
999#define TR_POS 0
1000#if TR_POS
1001 fprintf (stderr, "FOO1: %p: ", yylloc);
1002 LOCATION_PRINT (stderr, *yylloc);
1003 fprintf (stderr, "\n");
1004#endif
1005 YY_STEP;
1006#if TR_POS
1007 fprintf (stderr, "BAR1: ");
1008 LOCATION_PRINT (stderr, *yylloc);
1009 fprintf (stderr, "\n");
1010#endif
1011
1012
1013
1014 /*----------------------------.
1015 | Scanning Bison directives. |
1016 `----------------------------*/
1017#line 1018 "scan-gram.c"
1018
1019 if ( yy_init )
1020 {
1021 yy_init = 0;
1022
1023#ifdef YY_USER_INIT
1024 YY_USER_INIT;
1025#endif
1026
1027 if ( ! yy_start )
1028 yy_start = 1; /* first start state */
1029
1030 if ( ! yyin )
1031 yyin = stdin;
1032
1033 if ( ! yyout )
1034 yyout = stdout;
1035
1036 if ( ! yy_current_buffer )
1037 yy_current_buffer =
1038 yy_create_buffer( yyin, YY_BUF_SIZE );
1039
1040 yy_load_buffer_state();
1041 }
1042
1043 while ( 1 ) /* loops until end-of-file is reached */
1044 {
1045 yy_cp = yy_c_buf_p;
1046
1047 /* Support of yytext. */
1048 *yy_cp = yy_hold_char;
1049
1050 /* yy_bp points to the position in yy_ch_buf of the start of
1051 * the current run.
1052 */
1053 yy_bp = yy_cp;
1054
1055 yy_current_state = yy_start;
1056yy_match:
1057 do
1058 {
1059 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1060 if ( yy_accept[yy_current_state] )
1061 {
1062 yy_last_accepting_state = yy_current_state;
1063 yy_last_accepting_cpos = yy_cp;
1064 }
1065 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1066 {
1067 yy_current_state = (int) yy_def[yy_current_state];
1068 if ( yy_current_state >= 380 )
1069 yy_c = yy_meta[(unsigned int) yy_c];
1070 }
1071 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1072 ++yy_cp;
1073 }
1074 while ( yy_base[yy_current_state] != 841 );
1075
1076yy_find_action:
1077 yy_act = yy_accept[yy_current_state];
1078 if ( yy_act == 0 )
1079 { /* have to back up */
1080 yy_cp = yy_last_accepting_cpos;
1081 yy_current_state = yy_last_accepting_state;
1082 yy_act = yy_accept[yy_current_state];
1083 }
1084
1085 YY_DO_BEFORE_ACTION;
1086
1087
1088do_action: /* This label is used only to access EOF actions. */
1089
1090 if ( yy_flex_debug )
1091 {
1092 if ( yy_act == 0 )
1093 fprintf( stderr, "--scanner backing up\n" );
1094 else if ( yy_act < 101 )
1095 fprintf( stderr, "--accepting rule at line %d (\"%s\")\n",
1096 yy_rule_linenum[yy_act], yytext );
1097 else if ( yy_act == 101 )
1098 fprintf( stderr, "--accepting default rule (\"%s\")\n",
1099 yytext );
1100 else if ( yy_act == 102 )
1101 fprintf( stderr, "--(end of buffer or a NUL)\n" );
1102 else
1103 fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
1104 }
1105
1106 switch ( yy_act )
1107 { /* beginning of action switch */
1108 case 0: /* must back up */
1109 /* undo the effects of YY_DO_BEFORE_ACTION */
1110 *yy_cp = yy_hold_char;
1111 yy_cp = yy_last_accepting_cpos;
1112 yy_current_state = yy_last_accepting_state;
1113 goto yy_find_action;
1114
1115
1116
1117case 1:
1118YY_RULE_SETUP
1119#line 122 "scan-gram.l"
1120return PERCENT_NONASSOC;
1121 YY_BREAK
1122case 2:
1123YY_RULE_SETUP
1124#line 123 "scan-gram.l"
1125return PERCENT_DEBUG;
1126 YY_BREAK
1127case 3:
1128YY_RULE_SETUP
1129#line 124 "scan-gram.l"
1130return PERCENT_DEFINE;
1131 YY_BREAK
1132case 4:
1133YY_RULE_SETUP
1134#line 125 "scan-gram.l"
1135return PERCENT_DEFINES;
1136 YY_BREAK
1137case 5:
1138YY_RULE_SETUP
1139#line 126 "scan-gram.l"
1140return PERCENT_DESTRUCTOR;
1141 YY_BREAK
1142case 6:
1143YY_RULE_SETUP
1144#line 127 "scan-gram.l"
1145return PERCENT_DPREC;
1146 YY_BREAK
1147case 7:
1148YY_RULE_SETUP
1149#line 128 "scan-gram.l"
1150return PERCENT_ERROR_VERBOSE;
1151 YY_BREAK
1152case 8:
1153YY_RULE_SETUP
1154#line 129 "scan-gram.l"
1155return PERCENT_EXPECT;
1156 YY_BREAK
1157case 9:
1158YY_RULE_SETUP
1159#line 130 "scan-gram.l"
1160return PERCENT_FILE_PREFIX;
1161 YY_BREAK
1162case 10:
1163YY_RULE_SETUP
1164#line 131 "scan-gram.l"
1165return PERCENT_YACC;
1166 YY_BREAK
1167case 11:
1168YY_RULE_SETUP
1169#line 132 "scan-gram.l"
1170return PERCENT_GLR_PARSER;
1171 YY_BREAK
1172case 12:
1173YY_RULE_SETUP
1174#line 133 "scan-gram.l"
1175return PERCENT_LEFT;
1176 YY_BREAK
1177case 13:
1178YY_RULE_SETUP
1179#line 134 "scan-gram.l"
1180return PERCENT_LOCATIONS;
1181 YY_BREAK
1182case 14:
1183YY_RULE_SETUP
1184#line 135 "scan-gram.l"
1185return PERCENT_MERGE;
1186 YY_BREAK
1187case 15:
1188YY_RULE_SETUP
1189#line 136 "scan-gram.l"
1190return PERCENT_NAME_PREFIX;
1191 YY_BREAK
1192case 16:
1193YY_RULE_SETUP
1194#line 137 "scan-gram.l"
1195return PERCENT_NO_LINES;
1196 YY_BREAK
1197case 17:
1198YY_RULE_SETUP
1199#line 138 "scan-gram.l"
1200return PERCENT_NONASSOC;
1201 YY_BREAK
1202case 18:
1203YY_RULE_SETUP
1204#line 139 "scan-gram.l"
1205return PERCENT_NTERM;
1206 YY_BREAK
1207case 19:
1208YY_RULE_SETUP
1209#line 140 "scan-gram.l"
1210return PERCENT_OUTPUT;
1211 YY_BREAK
1212case 20:
1213YY_RULE_SETUP
1214#line 141 "scan-gram.l"
1215return PERCENT_PREC;
1216 YY_BREAK
1217case 21:
1218YY_RULE_SETUP
1219#line 142 "scan-gram.l"
1220return PERCENT_PRINTER;
1221 YY_BREAK
1222case 22:
1223YY_RULE_SETUP
1224#line 143 "scan-gram.l"
1225return PERCENT_PURE_PARSER;
1226 YY_BREAK
1227case 23:
1228YY_RULE_SETUP
1229#line 144 "scan-gram.l"
1230return PERCENT_RIGHT;
1231 YY_BREAK
1232case 24:
1233YY_RULE_SETUP
1234#line 145 "scan-gram.l"
1235return PERCENT_SKELETON;
1236 YY_BREAK
1237case 25:
1238YY_RULE_SETUP
1239#line 146 "scan-gram.l"
1240return PERCENT_START;
1241 YY_BREAK
1242case 26:
1243YY_RULE_SETUP
1244#line 147 "scan-gram.l"
1245return PERCENT_TOKEN;
1246 YY_BREAK
1247case 27:
1248YY_RULE_SETUP
1249#line 148 "scan-gram.l"
1250return PERCENT_TOKEN;
1251 YY_BREAK
1252case 28:
1253YY_RULE_SETUP
1254#line 149 "scan-gram.l"
1255return PERCENT_TOKEN_TABLE;
1256 YY_BREAK
1257case 29:
1258YY_RULE_SETUP
1259#line 150 "scan-gram.l"
1260return PERCENT_TYPE;
1261 YY_BREAK
1262case 30:
1263YY_RULE_SETUP
1264#line 151 "scan-gram.l"
1265return PERCENT_UNION;
1266 YY_BREAK
1267case 31:
1268YY_RULE_SETUP
1269#line 152 "scan-gram.l"
1270return PERCENT_VERBOSE;
1271 YY_BREAK
1272case 32:
1273YY_RULE_SETUP
1274#line 153 "scan-gram.l"
1275return PERCENT_YACC;
1276 YY_BREAK
1277case 33:
1278YY_RULE_SETUP
1279#line 155 "scan-gram.l"
1280return EQUAL;
1281 YY_BREAK
1282case 34:
1283YY_RULE_SETUP
1284#line 156 "scan-gram.l"
1285return COLON;
1286 YY_BREAK
1287case 35:
1288YY_RULE_SETUP
1289#line 157 "scan-gram.l"
1290return PIPE;
1291 YY_BREAK
1292case 36:
1293YY_RULE_SETUP
1294#line 158 "scan-gram.l"
1295return SEMICOLON;
1296 YY_BREAK
1297case 37:
1298YY_RULE_SETUP
1299#line 160 "scan-gram.l"
1300YY_LINES; YY_STEP;
1301 YY_BREAK
1302case 38:
1303YY_RULE_SETUP
1304#line 161 "scan-gram.l"
1305YY_STEP;
1306 YY_BREAK
1307case 39:
1308YY_RULE_SETUP
1309#line 162 "scan-gram.l"
1310{
1311 yylval->symbol = symbol_get (yytext, *yylloc);
1312 return ID;
1313 }
1314 YY_BREAK
1315case 40:
1316YY_RULE_SETUP
1317#line 167 "scan-gram.l"
1318yylval->integer = strtol (yytext, 0, 10); return INT;
1319 YY_BREAK
1320/* Characters. We don't check there is only one. */
1321case 41:
1322YY_RULE_SETUP
1323#line 170 "scan-gram.l"
1324YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);
1325 YY_BREAK
1326/* Strings. */
1327case 42:
1328YY_RULE_SETUP
1329#line 173 "scan-gram.l"
1330YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);
1331 YY_BREAK
1332/* Comments. */
1333case 43:
1334YY_RULE_SETUP
1335#line 176 "scan-gram.l"
1336yy_push_state (SC_COMMENT);
1337 YY_BREAK
1338case 44:
1339YY_RULE_SETUP
1340#line 177 "scan-gram.l"
1341YY_STEP;
1342 YY_BREAK
1343/* Prologue. */
1344case 45:
1345YY_RULE_SETUP
1346#line 180 "scan-gram.l"
1347yy_push_state (SC_PROLOGUE);
1348 YY_BREAK
1349/* Code in between braces. */
1350case 46:
1351YY_RULE_SETUP
1352#line 183 "scan-gram.l"
1353YY_OBS_GROW; ++braces_level; yy_push_state (SC_BRACED_CODE);
1354 YY_BREAK
1355/* A type. */
1356case 47:
1357YY_RULE_SETUP
1358#line 186 "scan-gram.l"
1359{
1360 obstack_grow (&string_obstack, yytext + 1, yyleng - 2);
1361 YY_OBS_FINISH;
1362 yylval->string = last_string;
1363 return TYPE;
1364 }
1365 YY_BREAK
1366case 48:
1367YY_RULE_SETUP
1368#line 194 "scan-gram.l"
1369{
1370 if (++percent_percent_count == 2)
1371 yy_push_state (SC_EPILOGUE);
1372 return PERCENT_PERCENT;
1373 }
1374 YY_BREAK
1375case 49:
1376YY_RULE_SETUP
1377#line 200 "scan-gram.l"
1378{
1379 LOCATION_PRINT (stderr, *yylloc);
1380 fprintf (stderr, _(": invalid character: `%c'\n"), *yytext);
1381 YY_STEP;
1382 }
1383 YY_BREAK
1384
1385/*------------------------------------------------------------.
1386 | Whatever the start condition (but those which correspond to |
1387 | entity `swallowed' by Bison: SC_ESCAPED_STRING and |
1388 | SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1389 `------------------------------------------------------------*/
1390
1391
1392case 50:
1393YY_RULE_SETUP
1394#line 216 "scan-gram.l"
1395if (YY_START != SC_COMMENT) obstack_sgrow (&string_obstack, "@<:@");
1396 YY_BREAK
1397case 51:
1398YY_RULE_SETUP
1399#line 217 "scan-gram.l"
1400if (YY_START != SC_COMMENT) obstack_sgrow (&string_obstack, "@:>@");
1401 YY_BREAK
1402
1403/*-----------------------------------------------------------.
1404 | Scanning a C comment. The initial `/ *' is already eaten. |
1405 `-----------------------------------------------------------*/
1406
1407
1408case 52:
1409YY_RULE_SETUP
1410#line 228 "scan-gram.l"
1411{ /* End of the comment. */
1412 if (yy_top_state () == INITIAL)
1413 {
1414 YY_STEP;
1415 }
1416 else
1417 {
1418 YY_OBS_GROW;
1419 }
1420 yy_pop_state ();
1421 }
1422 YY_BREAK
1423case 53:
1424YY_RULE_SETUP
1425#line 240 "scan-gram.l"
1426if (yy_top_state () != INITIAL) YY_OBS_GROW;
1427 YY_BREAK
1428case 54:
1429YY_RULE_SETUP
1430#line 241 "scan-gram.l"
1431if (yy_top_state () != INITIAL) YY_OBS_GROW; YY_LINES;
1432 YY_BREAK
1433case 55:
1434YY_RULE_SETUP
1435#line 242 "scan-gram.l"
1436/* Stray `*'. */if (yy_top_state () != INITIAL) YY_OBS_GROW;
1437 YY_BREAK
1438case YY_STATE_EOF(SC_COMMENT):
1439#line 244 "scan-gram.l"
1440{
1441 LOCATION_PRINT (stderr, *yylloc);
1442 fprintf (stderr, _(": unexpected end of file in a comment\n"));
1443 yy_pop_state ();
1444 }
1445 YY_BREAK
1446
1447/*----------------------------------------------------------------.
1448 | Scanning a C string, including its escapes. The initial `"' is |
1449 | already eaten. |
1450 `----------------------------------------------------------------*/
1451
1452
1453case 56:
1454YY_RULE_SETUP
1455#line 259 "scan-gram.l"
1456{
1457 assert (yy_top_state () == INITIAL);
1458 YY_OBS_GROW;
1459 YY_OBS_FINISH;
1460 yylval->string = last_string;
1461 yy_pop_state ();
1462 return STRING;
1463 }
1464 YY_BREAK
1465case 57:
1466YY_RULE_SETUP
1467#line 268 "scan-gram.l"
1468YY_OBS_GROW;
1469 YY_BREAK
1470case 58:
1471YY_RULE_SETUP
1472#line 270 "scan-gram.l"
1473obstack_1grow (&string_obstack, '\n'); YY_LINES;
1474 YY_BREAK
1475case YY_STATE_EOF(SC_ESCAPED_STRING):
1476#line 272 "scan-gram.l"
1477{
1478 LOCATION_PRINT (stderr, *yylloc);
1479 fprintf (stderr, _(": unexpected end of file in a string\n"));
1480 assert (yy_top_state () == INITIAL);
1481 YY_OBS_FINISH;
1482 yylval->string = last_string;
1483 yy_pop_state ();
1484 return STRING;
1485 }
1486 YY_BREAK
1487
1488/*---------------------------------------------------------------.
1489 | Scanning a C character, decoding its escapes. The initial "'" |
1490 | is already eaten. |
1491 `---------------------------------------------------------------*/
1492
1493
1494case 59:
1495YY_RULE_SETUP
1496#line 290 "scan-gram.l"
1497{
1498 YY_OBS_GROW;
1499 assert (yy_top_state () == INITIAL);
1500 {
1501 YY_OBS_FINISH;
1502 yylval->symbol = symbol_get (last_string, *yylloc);
1503 symbol_class_set (yylval->symbol, token_sym, *yylloc);
1504 symbol_user_token_number_set (yylval->symbol,
1505 (unsigned char) last_string[1], *yylloc);
1506 YY_OBS_FREE;
1507 yy_pop_state ();
1508 return ID;
1509 }
1510 }
1511 YY_BREAK
1512case 60:
1513YY_RULE_SETUP
1514#line 305 "scan-gram.l"
1515YY_OBS_GROW;
1516 YY_BREAK
1517case 61:
1518YY_RULE_SETUP
1519#line 307 "scan-gram.l"
1520obstack_1grow (&string_obstack, '\n'); YY_LINES;
1521 YY_BREAK
1522case YY_STATE_EOF(SC_ESCAPED_CHARACTER):
1523#line 309 "scan-gram.l"
1524{
1525 LOCATION_PRINT (stderr, *yylloc);
1526 fprintf (stderr, _(": unexpected end of file in a character\n"));
1527 assert (yy_top_state () == INITIAL);
1528 YY_OBS_FINISH;
1529 yylval->string = last_string;
1530 yy_pop_state ();
1531 return CHARACTER;
1532 }
1533 YY_BREAK
1534
1535/*----------------------------.
1536 | Decode escaped characters. |
1537 `----------------------------*/
1538
1539
1540case 62:
1541YY_RULE_SETUP
1542#line 327 "scan-gram.l"
1543{
1544 long c = strtol (yytext + 1, 0, 8);
1545 if (c > 255)
1546 {
1547 LOCATION_PRINT (stderr, *yylloc);
1548 fprintf (stderr, _(": invalid escape: %s\n"), quote (yytext));
1549 YY_STEP;
1550 }
1551 else
1552 obstack_1grow (&string_obstack, c);
1553 }
1554 YY_BREAK
1555case 63:
1556YY_RULE_SETUP
1557#line 339 "scan-gram.l"
1558{
1559 obstack_1grow (&string_obstack, strtol (yytext + 2, 0, 16));
1560 }
1561 YY_BREAK
1562case 64:
1563YY_RULE_SETUP
1564#line 343 "scan-gram.l"
1565obstack_1grow (&string_obstack, '\a');
1566 YY_BREAK
1567case 65:
1568YY_RULE_SETUP
1569#line 344 "scan-gram.l"
1570obstack_1grow (&string_obstack, '\b');
1571 YY_BREAK
1572case 66:
1573YY_RULE_SETUP
1574#line 345 "scan-gram.l"
1575obstack_1grow (&string_obstack, '\f');
1576 YY_BREAK
1577case 67:
1578YY_RULE_SETUP
1579#line 346 "scan-gram.l"
1580obstack_1grow (&string_obstack, '\n');
1581 YY_BREAK
1582case 68:
1583YY_RULE_SETUP
1584#line 347 "scan-gram.l"
1585obstack_1grow (&string_obstack, '\r');
1586 YY_BREAK
1587case 69:
1588YY_RULE_SETUP
1589#line 348 "scan-gram.l"
1590obstack_1grow (&string_obstack, '\t');
1591 YY_BREAK
1592case 70:
1593YY_RULE_SETUP
1594#line 349 "scan-gram.l"
1595obstack_1grow (&string_obstack, '\v');
1596 YY_BREAK
1597case 71:
1598YY_RULE_SETUP
1599#line 350 "scan-gram.l"
1600obstack_1grow (&string_obstack, yytext[1]);
1601 YY_BREAK
1602case 72:
1603YY_RULE_SETUP
1604#line 351 "scan-gram.l"
1605{
1606 LOCATION_PRINT (stderr, *yylloc);
1607 fprintf (stderr, _(": unrecognized escape: %s\n"), quote (yytext));
1608 YY_OBS_GROW;
1609 }
1610 YY_BREAK
1611/* FLex wants this rule, in case of a `\<<EOF>>'. */
1612case 73:
1613YY_RULE_SETUP
1614#line 357 "scan-gram.l"
1615YY_OBS_GROW;
1616 YY_BREAK
1617
1618/*----------------------------------------------------------.
1619 | Scanning a C character without decoding its escapes. The |
1620 | initial "'" is already eaten. |
1621 `----------------------------------------------------------*/
1622
1623
1624case 74:
1625YY_RULE_SETUP
1626#line 368 "scan-gram.l"
1627{
1628 YY_OBS_GROW;
1629 assert (yy_top_state () != INITIAL);
1630 yy_pop_state ();
1631 }
1632 YY_BREAK
1633case 75:
1634YY_RULE_SETUP
1635#line 374 "scan-gram.l"
1636YY_OBS_GROW;
1637 YY_BREAK
1638case 76:
1639YY_RULE_SETUP
1640#line 375 "scan-gram.l"
1641YY_OBS_GROW;
1642 YY_BREAK
1643/* FLex wants this rule, in case of a `\<<EOF>>'. */
1644case 77:
1645YY_RULE_SETUP
1646#line 377 "scan-gram.l"
1647YY_OBS_GROW;
1648 YY_BREAK
1649case 78:
1650YY_RULE_SETUP
1651#line 379 "scan-gram.l"
1652YY_OBS_GROW; YY_LINES;
1653 YY_BREAK
1654case YY_STATE_EOF(SC_CHARACTER):
1655#line 381 "scan-gram.l"
1656{
1657 LOCATION_PRINT (stderr, *yylloc);
1658 fprintf (stderr, _(": unexpected end of file in a character\n"));
1659 assert (yy_top_state () != INITIAL);
1660 yy_pop_state ();
1661 }
1662 YY_BREAK
1663
1664/*----------------------------------------------------------------.
1665 | Scanning a C string, without decoding its escapes. The initial |
1666 | `"' is already eaten. |
1667 `----------------------------------------------------------------*/
1668
1669
1670case 79:
1671YY_RULE_SETUP
1672#line 397 "scan-gram.l"
1673{
1674 assert (yy_top_state () != INITIAL);
1675 YY_OBS_GROW;
1676 yy_pop_state ();
1677 }
1678 YY_BREAK
1679case 80:
1680YY_RULE_SETUP
1681#line 403 "scan-gram.l"
1682YY_OBS_GROW;
1683 YY_BREAK
1684case 81:
1685YY_RULE_SETUP
1686#line 404 "scan-gram.l"
1687YY_OBS_GROW;
1688 YY_BREAK
1689/* FLex wants this rule, in case of a `\<<EOF>>'. */
1690case 82:
1691YY_RULE_SETUP
1692#line 406 "scan-gram.l"
1693YY_OBS_GROW;
1694 YY_BREAK
1695case 83:
1696YY_RULE_SETUP
1697#line 408 "scan-gram.l"
1698YY_OBS_GROW; YY_LINES;
1699 YY_BREAK
1700case YY_STATE_EOF(SC_STRING):
1701#line 410 "scan-gram.l"
1702{
1703 LOCATION_PRINT (stderr, *yylloc);
1704 fprintf (stderr, _(": unexpected end of file in a string\n"));
1705 assert (yy_top_state () != INITIAL);
1706 yy_pop_state ();
1707 }
1708 YY_BREAK
1709
1710/*---------------------------------------------------.
1711 | Strings, comments etc. can be found in user code. |
1712 `---------------------------------------------------*/
1713
1714
1715/* Characters. We don't check there is only one. */
1716case 84:
1717YY_RULE_SETUP
1718#line 426 "scan-gram.l"
1719YY_OBS_GROW; yy_push_state (SC_CHARACTER);
1720 YY_BREAK
1721/* Strings. */
1722case 85:
1723YY_RULE_SETUP
1724#line 429 "scan-gram.l"
1725YY_OBS_GROW; yy_push_state (SC_STRING);
1726 YY_BREAK
1727/* Comments. */
1728case 86:
1729YY_RULE_SETUP
1730#line 432 "scan-gram.l"
1731YY_OBS_GROW; yy_push_state (SC_COMMENT);
1732 YY_BREAK
1733case 87:
1734YY_RULE_SETUP
1735#line 433 "scan-gram.l"
1736YY_OBS_GROW;
1737 YY_BREAK
1738/* Not comments. */
1739case 88:
1740YY_RULE_SETUP
1741#line 436 "scan-gram.l"
1742YY_OBS_GROW;
1743 YY_BREAK
1744
1745/*---------------------------------------------------------------.
1746 | Scanning some code in braces (%union and actions). The initial |
1747 | "{" is already eaten. |
1748 `---------------------------------------------------------------*/
1749
1750
1751case 89:
1752YY_RULE_SETUP
1753#line 447 "scan-gram.l"
1754{
1755 YY_OBS_GROW;
1756 if (--braces_level == 0)
1757 {
1758 yy_pop_state ();
1759 YY_OBS_FINISH;
1760 yylval->string = last_string;
1761 return BRACED_CODE;
1762 }
1763 }
1764 YY_BREAK
1765case 90:
1766YY_RULE_SETUP
1767#line 458 "scan-gram.l"
1768YY_OBS_GROW; braces_level++;
1769 YY_BREAK
1770case 91:
1771YY_RULE_SETUP
1772#line 460 "scan-gram.l"
1773{ handle_dollar (current_braced_code,
1774 yytext, *yylloc); }
1775 YY_BREAK
1776case 92:
1777YY_RULE_SETUP
1778#line 462 "scan-gram.l"
1779{ handle_at (current_braced_code,
1780 yytext, *yylloc); }
1781 YY_BREAK
1782case 93:
1783YY_RULE_SETUP
1784#line 465 "scan-gram.l"
1785YY_OBS_GROW;
1786 YY_BREAK
1787case 94:
1788YY_RULE_SETUP
1789#line 466 "scan-gram.l"
1790YY_OBS_GROW; YY_LINES;
1791 YY_BREAK
1792/* A lose $, or /, or etc. */
1793case 95:
1794YY_RULE_SETUP
1795#line 469 "scan-gram.l"
1796YY_OBS_GROW;
1797 YY_BREAK
1798case YY_STATE_EOF(SC_BRACED_CODE):
1799#line 471 "scan-gram.l"
1800{
1801 LOCATION_PRINT (stderr, *yylloc);
1802 fprintf (stderr, _(": unexpected end of file in a braced code\n"));
1803 yy_pop_state ();
1804 YY_OBS_FINISH;
1805 yylval->string = last_string;
1806 return BRACED_CODE;
1807 }
1808 YY_BREAK
1809
1810/*--------------------------------------------------------------.
1811 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1812 `--------------------------------------------------------------*/
1813
1814
1815case 96:
1816YY_RULE_SETUP
1817#line 489 "scan-gram.l"
1818{
1819 yy_pop_state ();
1820 YY_OBS_FINISH;
1821 yylval->string = last_string;
1822 return PROLOGUE;
1823 }
1824 YY_BREAK
1825case 97:
1826YY_RULE_SETUP
1827#line 496 "scan-gram.l"
1828YY_OBS_GROW;
1829 YY_BREAK
1830case 98:
1831YY_RULE_SETUP
1832#line 497 "scan-gram.l"
1833YY_OBS_GROW;
1834 YY_BREAK
1835case 99:
1836YY_RULE_SETUP
1837#line 498 "scan-gram.l"
1838YY_OBS_GROW; YY_LINES;
1839 YY_BREAK
1840case YY_STATE_EOF(SC_PROLOGUE):
1841#line 500 "scan-gram.l"
1842{
1843 LOCATION_PRINT (stderr, *yylloc);
1844 fprintf (stderr, _(": unexpected end of file in a prologue\n"));
1845 yy_pop_state ();
1846 YY_OBS_FINISH;
1847 yylval->string = last_string;
1848 return PROLOGUE;
1849 }
1850 YY_BREAK
1851
1852/*---------------------------------------------------------------.
1853 | Scanning the epilogue (everything after the second "%%", which |
1854 | has already been eaten. |
1855 `---------------------------------------------------------------*/
1856
1857
1858case 100:
1859YY_RULE_SETUP
1860#line 518 "scan-gram.l"
1861YY_OBS_GROW;
1862 YY_BREAK
1863case YY_STATE_EOF(SC_EPILOGUE):
1864#line 520 "scan-gram.l"
1865{
1866 yy_pop_state ();
1867 YY_OBS_FINISH;
1868 yylval->string = last_string;
1869 return EPILOGUE;
1870 }
1871 YY_BREAK
1872
1873case 101:
1874YY_RULE_SETUP
1875#line 529 "scan-gram.l"
1876YY_FATAL_ERROR( "flex scanner jammed" );
1877 YY_BREAK
1878#line 1879 "scan-gram.c"
1879case YY_STATE_EOF(INITIAL):
1880 yyterminate();
1881
1882 case YY_END_OF_BUFFER:
1883 {
1884 /* Amount of text matched not including the EOB char. */
1885 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1886
1887 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1888 *yy_cp = yy_hold_char;
1889 YY_RESTORE_YY_MORE_OFFSET
1890
1891 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1892 {
1893 /* We're scanning a new file or input source. It's
1894 * possible that this happened because the user
1895 * just pointed yyin at a new source and called
1896 * yylex(). If so, then we have to assure
1897 * consistency between yy_current_buffer and our
1898 * globals. Here is the right place to do so, because
1899 * this is the first action (other than possibly a
1900 * back-up) that will match for the new input source.
1901 */
1902 yy_n_chars = yy_current_buffer->yy_n_chars;
1903 yy_current_buffer->yy_input_file = yyin;
1904 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1905 }
1906
1907 /* Note that here we test for yy_c_buf_p "<=" to the position
1908 * of the first EOB in the buffer, since yy_c_buf_p will
1909 * already have been incremented past the NUL character
1910 * (since all states make transitions on EOB to the
1911 * end-of-buffer state). Contrast this with the test
1912 * in input().
1913 */
1914 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1915 { /* This was really a NUL. */
1916 yy_state_type yy_next_state;
1917
1918 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1919
1920 yy_current_state = yy_get_previous_state();
1921
1922 /* Okay, we're now positioned to make the NUL
1923 * transition. We couldn't have
1924 * yy_get_previous_state() go ahead and do it
1925 * for us because it doesn't know how to deal
1926 * with the possibility of jamming (and we don't
1927 * want to build jamming into it because then it
1928 * will run more slowly).
1929 */
1930
1931 yy_next_state = yy_try_NUL_trans( yy_current_state );
1932
1933 yy_bp = yytext_ptr + YY_MORE_ADJ;
1934
1935 if ( yy_next_state )
1936 {
1937 /* Consume the NUL. */
1938 yy_cp = ++yy_c_buf_p;
1939 yy_current_state = yy_next_state;
1940 goto yy_match;
1941 }
1942
1943 else
1944 {
1945 yy_cp = yy_c_buf_p;
1946 goto yy_find_action;
1947 }
1948 }
1949
1950 else switch ( yy_get_next_buffer() )
1951 {
1952 case EOB_ACT_END_OF_FILE:
1953 {
1954 yy_did_buffer_switch_on_eof = 0;
1955
1956 if ( yywrap() )
1957 {
1958 /* Note: because we've taken care in
1959 * yy_get_next_buffer() to have set up
1960 * yytext, we can now set up
1961 * yy_c_buf_p so that if some total
1962 * hoser (like flex itself) wants to
1963 * call the scanner after we return the
1964 * YY_NULL, it'll still work - another
1965 * YY_NULL will get returned.
1966 */
1967 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1968
1969 yy_act = YY_STATE_EOF(YY_START);
1970 goto do_action;
1971 }
1972
1973 else
1974 {
1975 if ( ! yy_did_buffer_switch_on_eof )
1976 YY_NEW_FILE;
1977 }
1978 break;
1979 }
1980
1981 case EOB_ACT_CONTINUE_SCAN:
1982 yy_c_buf_p =
1983 yytext_ptr + yy_amount_of_matched_text;
1984
1985 yy_current_state = yy_get_previous_state();
1986
1987 yy_cp = yy_c_buf_p;
1988 yy_bp = yytext_ptr + YY_MORE_ADJ;
1989 goto yy_match;
1990
1991 case EOB_ACT_LAST_MATCH:
1992 yy_c_buf_p =
1993 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1994
1995 yy_current_state = yy_get_previous_state();
1996
1997 yy_cp = yy_c_buf_p;
1998 yy_bp = yytext_ptr + YY_MORE_ADJ;
1999 goto yy_find_action;
2000 }
2001 break;
2002 }
2003
2004 default:
2005 YY_FATAL_ERROR(
2006 "fatal flex scanner internal error--no action found" );
2007 } /* end of action switch */
2008 } /* end of scanning one token */
2009 } /* end of yylex */
2010
2011
2012/* yy_get_next_buffer - try to read in a new buffer
2013 *
2014 * Returns a code representing an action:
2015 * EOB_ACT_LAST_MATCH -
2016 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2017 * EOB_ACT_END_OF_FILE - end of file
2018 */
2019
2020static int yy_get_next_buffer()
2021 {
2022 register char *dest = yy_current_buffer->yy_ch_buf;
2023 register char *source = yytext_ptr;
2024 register int number_to_move, i;
2025 int ret_val;
2026
2027 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
2028 YY_FATAL_ERROR(
2029 "fatal flex scanner internal error--end of buffer missed" );
2030
2031 if ( yy_current_buffer->yy_fill_buffer == 0 )
2032 { /* Don't try to fill the buffer, so this is an EOF. */
2033 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
2034 {
2035 /* We matched a single character, the EOB, so
2036 * treat this as a final EOF.
2037 */
2038 return EOB_ACT_END_OF_FILE;
2039 }
2040
2041 else
2042 {
2043 /* We matched some text prior to the EOB, first
2044 * process it.
2045 */
2046 return EOB_ACT_LAST_MATCH;
2047 }
2048 }
2049
2050 /* Try to read more data. */
2051
2052 /* First move last chars to start of buffer. */
2053 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
2054
2055 for ( i = 0; i < number_to_move; ++i )
2056 *(dest++) = *(source++);
2057
2058 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2059 /* don't do the read, it's not guaranteed to return an EOF,
2060 * just force an EOF
2061 */
2062 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
2063
2064 else
2065 {
2066 int num_to_read =
2067 yy_current_buffer->yy_buf_size - number_to_move - 1;
2068
2069 while ( num_to_read <= 0 )
2070 { /* Not enough room in the buffer - grow it. */
2071#ifdef YY_USES_REJECT
2072 YY_FATAL_ERROR(
2073"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2074#else
2075
2076 /* just a shorter name for the current buffer */
2077 YY_BUFFER_STATE b = yy_current_buffer;
2078
2079 int yy_c_buf_p_offset =
2080 (int) (yy_c_buf_p - b->yy_ch_buf);
2081
2082 if ( b->yy_is_our_buffer )
2083 {
2084 int new_size = b->yy_buf_size * 2;
2085
2086 if ( new_size <= 0 )
2087 b->yy_buf_size += b->yy_buf_size / 8;
2088 else
2089 b->yy_buf_size *= 2;
2090
2091 b->yy_ch_buf = (char *)
2092 /* Include room in for 2 EOB chars. */
2093 yy_flex_realloc( (void *) b->yy_ch_buf,
2094 b->yy_buf_size + 2 );
2095 }
2096 else
2097 /* Can't grow it, we don't own it. */
2098 b->yy_ch_buf = 0;
2099
2100 if ( ! b->yy_ch_buf )
2101 YY_FATAL_ERROR(
2102 "fatal error - scanner input buffer overflow" );
2103
2104 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2105
2106 num_to_read = yy_current_buffer->yy_buf_size -
2107 number_to_move - 1;
2108#endif
2109 }
2110
2111 if ( num_to_read > YY_READ_BUF_SIZE )
2112 num_to_read = YY_READ_BUF_SIZE;
2113
2114 /* Read in more data. */
2115 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
2116 yy_n_chars, num_to_read );
2117
2118 yy_current_buffer->yy_n_chars = yy_n_chars;
2119 }
2120
2121 if ( yy_n_chars == 0 )
2122 {
2123 if ( number_to_move == YY_MORE_ADJ )
2124 {
2125 ret_val = EOB_ACT_END_OF_FILE;
2126 yyrestart( yyin );
2127 }
2128
2129 else
2130 {
2131 ret_val = EOB_ACT_LAST_MATCH;
2132 yy_current_buffer->yy_buffer_status =
2133 YY_BUFFER_EOF_PENDING;
2134 }
2135 }
2136
2137 else
2138 ret_val = EOB_ACT_CONTINUE_SCAN;
2139
2140 yy_n_chars += number_to_move;
2141 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2142 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2143
2144 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
2145
2146 return ret_val;
2147 }
2148
2149
2150/* yy_get_previous_state - get the state just before the EOB char was reached */
2151
2152static yy_state_type yy_get_previous_state()
2153 {
2154 register yy_state_type yy_current_state;
2155 register char *yy_cp;
2156
2157 yy_current_state = yy_start;
2158
2159 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
2160 {
2161 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2162 if ( yy_accept[yy_current_state] )
2163 {
2164 yy_last_accepting_state = yy_current_state;
2165 yy_last_accepting_cpos = yy_cp;
2166 }
2167 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2168 {
2169 yy_current_state = (int) yy_def[yy_current_state];
2170 if ( yy_current_state >= 380 )
2171 yy_c = yy_meta[(unsigned int) yy_c];
2172 }
2173 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2174 }
2175
2176 return yy_current_state;
2177 }
2178
2179
2180/* yy_try_NUL_trans - try to make a transition on the NUL character
2181 *
2182 * synopsis
2183 * next_state = yy_try_NUL_trans( current_state );
2184 */
2185
2186#ifdef YY_USE_PROTOS
2187static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
2188#else
2189static yy_state_type yy_try_NUL_trans( yy_current_state )
2190yy_state_type yy_current_state;
2191#endif
2192 {
2193 register int yy_is_jam;
2194 register char *yy_cp = yy_c_buf_p;
2195
2196 register YY_CHAR yy_c = 1;
2197 if ( yy_accept[yy_current_state] )
2198 {
2199 yy_last_accepting_state = yy_current_state;
2200 yy_last_accepting_cpos = yy_cp;
2201 }
2202 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2203 {
2204 yy_current_state = (int) yy_def[yy_current_state];
2205 if ( yy_current_state >= 380 )
2206 yy_c = yy_meta[(unsigned int) yy_c];
2207 }
2208 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2209 yy_is_jam = (yy_current_state == 379);
2210
2211 return yy_is_jam ? 0 : yy_current_state;
2212 }
2213
2214
2215#ifndef YY_NO_UNPUT
2216#ifdef YY_USE_PROTOS
2217static void yyunput( int c, register char *yy_bp )
2218#else
2219static void yyunput( c, yy_bp )
2220int c;
2221register char *yy_bp;
2222#endif
2223 {
2224 register char *yy_cp = yy_c_buf_p;
2225
2226 /* undo effects of setting up yytext */
2227 *yy_cp = yy_hold_char;
2228
2229 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2230 { /* need to shift things up to make room */
2231 /* +2 for EOB chars. */
2232 register int number_to_move = yy_n_chars + 2;
2233 register char *dest = &yy_current_buffer->yy_ch_buf[
2234 yy_current_buffer->yy_buf_size + 2];
2235 register char *source =
2236 &yy_current_buffer->yy_ch_buf[number_to_move];
2237
2238 while ( source > yy_current_buffer->yy_ch_buf )
2239 *--dest = *--source;
2240
2241 yy_cp += (int) (dest - source);
2242 yy_bp += (int) (dest - source);
2243 yy_current_buffer->yy_n_chars =
2244 yy_n_chars = yy_current_buffer->yy_buf_size;
2245
2246 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2247 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2248 }
2249
2250 *--yy_cp = (char) c;
2251
2252
2253 yytext_ptr = yy_bp;
2254 yy_hold_char = *yy_cp;
2255 yy_c_buf_p = yy_cp;
2256 }
2257#endif /* ifndef YY_NO_UNPUT */
2258
2259
2260#ifdef __cplusplus
2261static int yyinput()
2262#else
2263static int input()
2264#endif
2265 {
2266 int c;
2267
2268 *yy_c_buf_p = yy_hold_char;
2269
2270 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2271 {
2272 /* yy_c_buf_p now points to the character we want to return.
2273 * If this occurs *before* the EOB characters, then it's a
2274 * valid NUL; if not, then we've hit the end of the buffer.
2275 */
2276 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2277 /* This was really a NUL. */
2278 *yy_c_buf_p = '\0';
2279
2280 else
2281 { /* need more input */
2282 int offset = yy_c_buf_p - yytext_ptr;
2283 ++yy_c_buf_p;
2284
2285 switch ( yy_get_next_buffer() )
2286 {
2287 case EOB_ACT_LAST_MATCH:
2288 /* This happens because yy_g_n_b()
2289 * sees that we've accumulated a
2290 * token and flags that we need to
2291 * try matching the token before
2292 * proceeding. But for input(),
2293 * there's no matching to consider.
2294 * So convert the EOB_ACT_LAST_MATCH
2295 * to EOB_ACT_END_OF_FILE.
2296 */
2297
2298 /* Reset buffer status. */
2299 yyrestart( yyin );
2300
2301 /* fall through */
2302
2303 case EOB_ACT_END_OF_FILE:
2304 {
2305 if ( yywrap() )
2306 return EOF;
2307
2308 if ( ! yy_did_buffer_switch_on_eof )
2309 YY_NEW_FILE;
2310#ifdef __cplusplus
2311 return yyinput();
2312#else
2313 return input();
2314#endif
2315 }
2316
2317 case EOB_ACT_CONTINUE_SCAN:
2318 yy_c_buf_p = yytext_ptr + offset;
2319 break;
2320 }
2321 }
2322 }
2323
2324 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
2325 *yy_c_buf_p = '\0'; /* preserve yytext */
2326 yy_hold_char = *++yy_c_buf_p;
2327
2328
2329 return c;
2330 }
2331
2332
2333#ifdef YY_USE_PROTOS
2334void yyrestart( FILE *input_file )
2335#else
2336void yyrestart( input_file )
2337FILE *input_file;
2338#endif
2339 {
2340 if ( ! yy_current_buffer )
2341 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2342
2343 yy_init_buffer( yy_current_buffer, input_file );
2344 yy_load_buffer_state();
2345 }
2346
2347
2348#ifdef YY_USE_PROTOS
2349void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2350#else
2351void yy_switch_to_buffer( new_buffer )
2352YY_BUFFER_STATE new_buffer;
2353#endif
2354 {
2355 if ( yy_current_buffer == new_buffer )
2356 return;
2357
2358 if ( yy_current_buffer )
2359 {
2360 /* Flush out information for old buffer. */
2361 *yy_c_buf_p = yy_hold_char;
2362 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2363 yy_current_buffer->yy_n_chars = yy_n_chars;
2364 }
2365
2366 yy_current_buffer = new_buffer;
2367 yy_load_buffer_state();
2368
2369 /* We don't actually know whether we did this switch during
2370 * EOF (yywrap()) processing, but the only time this flag
2371 * is looked at is after yywrap() is called, so it's safe
2372 * to go ahead and always set it.
2373 */
2374 yy_did_buffer_switch_on_eof = 1;
2375 }
2376
2377
2378#ifdef YY_USE_PROTOS
2379void yy_load_buffer_state( void )
2380#else
2381void yy_load_buffer_state()
2382#endif
2383 {
2384 yy_n_chars = yy_current_buffer->yy_n_chars;
2385 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2386 yyin = yy_current_buffer->yy_input_file;
2387 yy_hold_char = *yy_c_buf_p;
2388 }
2389
2390
2391#ifdef YY_USE_PROTOS
2392YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2393#else
2394YY_BUFFER_STATE yy_create_buffer( file, size )
2395FILE *file;
2396int size;
2397#endif
2398 {
2399 YY_BUFFER_STATE b;
2400
2401 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2402 if ( ! b )
2403 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2404
2405 b->yy_buf_size = size;
2406
2407 /* yy_ch_buf has to be 2 characters longer than the size given because
2408 * we need to put in 2 end-of-buffer characters.
2409 */
2410 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2411 if ( ! b->yy_ch_buf )
2412 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2413
2414 b->yy_is_our_buffer = 1;
2415
2416 yy_init_buffer( b, file );
2417
2418 return b;
2419 }
2420
2421
2422#ifdef YY_USE_PROTOS
2423void yy_delete_buffer( YY_BUFFER_STATE b )
2424#else
2425void yy_delete_buffer( b )
2426YY_BUFFER_STATE b;
2427#endif
2428 {
2429 if ( ! b )
2430 return;
2431
2432 if ( b == yy_current_buffer )
2433 yy_current_buffer = (YY_BUFFER_STATE) 0;
2434
2435 if ( b->yy_is_our_buffer )
2436 yy_flex_free( (void *) b->yy_ch_buf );
2437
2438 yy_flex_free( (void *) b );
2439 }
2440
2441
2442#ifndef _WIN32
2443#include <unistd.h>
2444#else
2445#ifndef YY_ALWAYS_INTERACTIVE
2446#ifndef YY_NEVER_INTERACTIVE
2447extern int isatty YY_PROTO(( int ));
2448#endif
2449#endif
2450#endif
2451
2452#ifdef YY_USE_PROTOS
2453void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2454#else
2455void yy_init_buffer( b, file )
2456YY_BUFFER_STATE b;
2457FILE *file;
2458#endif
2459
2460
2461 {
2462 yy_flush_buffer( b );
2463
2464 b->yy_input_file = file;
2465 b->yy_fill_buffer = 1;
2466
2467#if YY_ALWAYS_INTERACTIVE
2468 b->yy_is_interactive = 1;
2469#else
2470#if YY_NEVER_INTERACTIVE
2471 b->yy_is_interactive = 0;
2472#else
2473 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2474#endif
2475#endif
2476 }
2477
2478
2479#ifdef YY_USE_PROTOS
2480void yy_flush_buffer( YY_BUFFER_STATE b )
2481#else
2482void yy_flush_buffer( b )
2483YY_BUFFER_STATE b;
2484#endif
2485
2486 {
2487 if ( ! b )
2488 return;
2489
2490 b->yy_n_chars = 0;
2491
2492 /* We always need two end-of-buffer characters. The first causes
2493 * a transition to the end-of-buffer state. The second causes
2494 * a jam in that state.
2495 */
2496 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2497 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2498
2499 b->yy_buf_pos = &b->yy_ch_buf[0];
2500
2501 b->yy_at_bol = 1;
2502 b->yy_buffer_status = YY_BUFFER_NEW;
2503
2504 if ( b == yy_current_buffer )
2505 yy_load_buffer_state();
2506 }
2507
2508
2509#ifndef YY_NO_SCAN_BUFFER
2510#ifdef YY_USE_PROTOS
2511YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2512#else
2513YY_BUFFER_STATE yy_scan_buffer( base, size )
2514char *base;
2515yy_size_t size;
2516#endif
2517 {
2518 YY_BUFFER_STATE b;
2519
2520 if ( size < 2 ||
2521 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2522 base[size-1] != YY_END_OF_BUFFER_CHAR )
2523 /* They forgot to leave room for the EOB's. */
2524 return 0;
2525
2526 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2527 if ( ! b )
2528 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2529
2530 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2531 b->yy_buf_pos = b->yy_ch_buf = base;
2532 b->yy_is_our_buffer = 0;
2533 b->yy_input_file = 0;
2534 b->yy_n_chars = b->yy_buf_size;
2535 b->yy_is_interactive = 0;
2536 b->yy_at_bol = 1;
2537 b->yy_fill_buffer = 0;
2538 b->yy_buffer_status = YY_BUFFER_NEW;
2539
2540 yy_switch_to_buffer( b );
2541
2542 return b;
2543 }
2544#endif
2545
2546
2547#ifndef YY_NO_SCAN_STRING
2548#ifdef YY_USE_PROTOS
2549YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2550#else
2551YY_BUFFER_STATE yy_scan_string( yy_str )
2552yyconst char *yy_str;
2553#endif
2554 {
2555 int len;
2556 for ( len = 0; yy_str[len]; ++len )
2557 ;
2558
2559 return yy_scan_bytes( yy_str, len );
2560 }
2561#endif
2562
2563
2564#ifndef YY_NO_SCAN_BYTES
2565#ifdef YY_USE_PROTOS
2566YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2567#else
2568YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2569yyconst char *bytes;
2570int len;
2571#endif
2572 {
2573 YY_BUFFER_STATE b;
2574 char *buf;
2575 yy_size_t n;
2576 int i;
2577
2578 /* Get memory for full buffer, including space for trailing EOB's. */
2579 n = len + 2;
2580 buf = (char *) yy_flex_alloc( n );
2581 if ( ! buf )
2582 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2583
2584 for ( i = 0; i < len; ++i )
2585 buf[i] = bytes[i];
2586
2587 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2588
2589 b = yy_scan_buffer( buf, n );
2590 if ( ! b )
2591 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2592
2593 /* It's okay to grow etc. this buffer, and we should throw it
2594 * away when we're done.
2595 */
2596 b->yy_is_our_buffer = 1;
2597
2598 return b;
2599 }
2600#endif
2601
2602
2603#ifndef YY_NO_PUSH_STATE
2604#ifdef YY_USE_PROTOS
2605static void yy_push_state( int new_state )
2606#else
2607static void yy_push_state( new_state )
2608int new_state;
2609#endif
2610 {
2611 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2612 {
2613 yy_size_t new_size;
2614
2615 yy_start_stack_depth += YY_START_STACK_INCR;
2616 new_size = yy_start_stack_depth * sizeof( int );
2617
2618 if ( ! yy_start_stack )
2619 yy_start_stack = (int *) yy_flex_alloc( new_size );
2620
2621 else
2622 yy_start_stack = (int *) yy_flex_realloc(
2623 (void *) yy_start_stack, new_size );
2624
2625 if ( ! yy_start_stack )
2626 YY_FATAL_ERROR(
2627 "out of memory expanding start-condition stack" );
2628 }
2629
2630 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2631
2632 BEGIN(new_state);
2633 }
2634#endif
2635
2636
2637#ifndef YY_NO_POP_STATE
2638static void yy_pop_state()
2639 {
2640 if ( --yy_start_stack_ptr < 0 )
2641 YY_FATAL_ERROR( "start-condition stack underflow" );
2642
2643 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2644 }
2645#endif
2646
2647
2648#ifndef YY_NO_TOP_STATE
2649static int yy_top_state()
2650 {
2651 return yy_start_stack[yy_start_stack_ptr - 1];
2652 }
2653#endif
2654
2655#ifndef YY_EXIT_FAILURE
2656#define YY_EXIT_FAILURE 2
2657#endif
2658
2659#ifdef YY_USE_PROTOS
2660static void yy_fatal_error( yyconst char msg[] )
2661#else
2662static void yy_fatal_error( msg )
2663char msg[];
2664#endif
2665 {
2666 (void) fprintf( stderr, "%s\n", msg );
2667 exit( YY_EXIT_FAILURE );
2668 }
2669
2670
2671
2672/* Redefine yyless() so it works in section 3 code. */
2673
2674#undef yyless
2675#define yyless(n) \
2676 do \
2677 { \
2678 /* Undo effects of setting up yytext. */ \
2679 yytext[yyleng] = yy_hold_char; \
2680 yy_c_buf_p = yytext + n; \
2681 yy_hold_char = *yy_c_buf_p; \
2682 *yy_c_buf_p = '\0'; \
2683 yyleng = n; \
2684 } \
2685 while ( 0 )
2686
2687
2688/* Internal utility routines. */
2689
2690#ifndef yytext_ptr
2691#ifdef YY_USE_PROTOS
2692static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2693#else
2694static void yy_flex_strncpy( s1, s2, n )
2695char *s1;
2696yyconst char *s2;
2697int n;
2698#endif
2699 {
2700 register int i;
2701 for ( i = 0; i < n; ++i )
2702 s1[i] = s2[i];
2703 }
2704#endif
2705
2706#ifdef YY_NEED_STRLEN
2707#ifdef YY_USE_PROTOS
2708static int yy_flex_strlen( yyconst char *s )
2709#else
2710static int yy_flex_strlen( s )
2711yyconst char *s;
2712#endif
2713 {
2714 register int n;
2715 for ( n = 0; s[n]; ++n )
2716 ;
2717
2718 return n;
2719 }
2720#endif
2721
2722
2723#ifdef YY_USE_PROTOS
2724static void *yy_flex_alloc( yy_size_t size )
2725#else
2726static void *yy_flex_alloc( size )
2727yy_size_t size;
2728#endif
2729 {
2730 return (void *) malloc( size );
2731 }
2732
2733#ifdef YY_USE_PROTOS
2734static void *yy_flex_realloc( void *ptr, yy_size_t size )
2735#else
2736static void *yy_flex_realloc( ptr, size )
2737void *ptr;
2738yy_size_t size;
2739#endif
2740 {
2741 /* The cast to (char *) in the following accommodates both
2742 * implementations that use char* generic pointers, and those
2743 * that use void* generic pointers. It works with the latter
2744 * because both ANSI C and C++ allow castless assignment from
2745 * any pointer type to void*, and deal with argument conversions
2746 * as though doing an assignment.
2747 */
2748 return (void *) realloc( (char *) ptr, size );
2749 }
2750
2751#ifdef YY_USE_PROTOS
2752static void yy_flex_free( void *ptr )
2753#else
2754static void yy_flex_free( ptr )
2755void *ptr;
2756#endif
2757 {
2758 free( ptr );
2759 }
2760
2761#if YY_MAIN
2762int main()
2763 {
2764 yylex();
2765 return 0;
2766 }
2767#endif
2768#line 529 "scan-gram.l"
2769
2770
2771/*------------------------------------------------------------------.
2772| TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2773| |
2774| Possible inputs: $[<TYPENAME>]($|integer) |
2775| |
2776| Output to the STRING_OBSTACK a reference to this semantic value. |
2777`------------------------------------------------------------------*/
2778
2779static inline void
2780handle_action_dollar (char *text, location_t location)
2781{
2782 const char *type_name = NULL;
2783 char *cp = text + 1;
2784
2785 /* Get the type name if explicit. */
2786 if (*cp == '<')
2787 {
2788 type_name = ++cp;
2789 while (*cp != '>')
2790 ++cp;
2791 *cp = '\0';
2792 ++cp;
2793 }
2794
2795 if (*cp == '$')
2796 {
2797 if (!type_name)
2798 type_name = symbol_list_n_type_name_get (current_rule, location, 0);
2799 if (!type_name && typed)
2800 complain_at (location, _("$$ of `%s' has no declared type"),
2801 current_rule->sym->tag);
2802 if (!type_name)
2803 type_name = "";
2804 obstack_fgrow1 (&string_obstack,
2805 "]b4_lhs_value([%s])[", type_name);
2806 }
2807 else if (('0' <= *cp && *cp <= '9') || *cp == '-')
2808 {
2809 /* RULE_LENGTH is the number of values in the current rule so
2810 far, which says where to find `$0' with respect to the top of
2811 the stack. It is not the same as the rule->length in the
2812 case of mid rule actions. */
2813 int rule_length = symbol_list_length (current_rule->next);
2814 int n = strtol (cp, &cp, 10);
2815
2816 if (n > rule_length)
2817 complain_at (location, _("invalid value: %s%d"), "$", n);
2818 else
2819 {
2820 if (!type_name && n > 0)
2821 type_name = symbol_list_n_type_name_get (current_rule, location,
2822 n);
2823 if (!type_name && typed)
2824 complain_at (location, _("$%d of `%s' has no declared type"),
2825 n, current_rule->sym->tag);
2826 if (!type_name)
2827 type_name = "";
2828 obstack_fgrow3 (&string_obstack,
2829 "]b4_rhs_value([%d], [%d], [%s])[",
2830 rule_length, n, type_name);
2831 }
2832 }
2833 else
2834 {
2835 complain_at (location, _("%s is invalid"), quote (text));
2836 }
2837}
2838
2839
2840/*---------------------------------------------------------------.
2841| TEXT is expexted tp be $$ in some code associated to a symbol: |
2842| destructor or printer. |
2843`---------------------------------------------------------------*/
2844
2845static inline void
2846handle_symbol_code_dollar (char *text, location_t location)
2847{
2848 char *cp = text + 1;
2849 if (*cp == '$')
2850 obstack_sgrow (&string_obstack, "]b4_dollar_dollar[");
2851 else
2852 complain_at (location, _("%s is invalid"), quote (text));
2853}
2854
2855
2856/*-----------------------------------------------------------------.
2857| Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2858| depending upon CODE_KIND. |
2859`-----------------------------------------------------------------*/
2860
2861static void
2862handle_dollar (braced_code_t braced_code_kind,
2863 char *text, location_t location)
2864{
2865 switch (braced_code_kind)
2866 {
2867 case action_braced_code:
2868 handle_action_dollar (text, location);
2869 break;
2870
2871 case destructor_braced_code:
2872 case printer_braced_code:
2873 handle_symbol_code_dollar (text, location);
2874 break;
2875 }
2876}
2877
2878
2879/*------------------------------------------------------.
2880| TEXT is a location token (i.e., a `@...'). Output to |
2881| STRING_OBSTACK a reference to this location. |
2882`------------------------------------------------------*/
2883
2884static inline void
2885handle_action_at (char *text, location_t location)
2886{
2887 char *cp = text + 1;
2888 locations_flag = 1;
2889
2890 if (*cp == '$')
2891 {
2892 obstack_sgrow (&string_obstack, "]b4_lhs_location[");
2893 }
2894 else if (('0' <= *cp && *cp <= '9') || *cp == '-')
2895 {
2896 /* RULE_LENGTH is the number of values in the current rule so
2897 far, which says where to find `$0' with respect to the top of
2898 the stack. It is not the same as the rule->length in the
2899 case of mid rule actions. */
2900 int rule_length = symbol_list_length (current_rule->next);
2901 int n = strtol (cp, &cp, 10);
2902
2903 if (n > rule_length)
2904 complain_at (location, _("invalid value: %s%d"), "@", n);
2905 else
2906 obstack_fgrow2 (&string_obstack, "]b4_rhs_location([%d], [%d])[",
2907 rule_length, n);
2908 }
2909 else
2910 {
2911 complain_at (location, _("%s is invalid"), quote (text));
2912 }
2913}
2914
2915
2916/*---------------------------------------------------------------.
2917| TEXT is expexted tp be @$ in some code associated to a symbol: |
2918| destructor or printer. |
2919`---------------------------------------------------------------*/
2920
2921static inline void
2922handle_symbol_code_at (char *text, location_t location)
2923{
2924 char *cp = text + 1;
2925 if (*cp == '$')
2926 obstack_sgrow (&string_obstack, "]b4_at_dollar[");
2927 else
2928 complain_at (location, _("%s is invalid"), quote (text));
2929}
2930
2931
2932/*-------------------------------------------------------------------.
2933| Dispatch onto handle_action_at, or handle_destructor_at, depending |
2934| upon CODE_KIND. |
2935`-------------------------------------------------------------------*/
2936
2937static void
2938handle_at (braced_code_t braced_code_kind,
2939 char *text, location_t location)
2940{
2941 switch (braced_code_kind)
2942 {
2943 case action_braced_code:
2944 handle_action_at (text, location);
2945 break;
2946
2947 case destructor_braced_code:
2948 case printer_braced_code:
2949 handle_symbol_code_at (text, location);
2950 break;
2951 }
2952}
2953
2954
2955/*-------------------------.
2956| Initialize the scanner. |
2957`-------------------------*/
2958
2959void
2960scanner_initialize (void)
2961{
2962 obstack_init (&string_obstack);
2963}
2964
2965
2966/*-----------------------------------------------.
2967| Free all the memory allocated to the scanner. |
2968`-----------------------------------------------*/
2969
2970void
2971scanner_free (void)
2972{
2973 obstack_free (&string_obstack, 0);
2974 /* Reclaim Flex's buffers. */
2975 yy_delete_buffer (YY_CURRENT_BUFFER);
2976}