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