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