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