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