]> git.saurik.com Git - bison.git/blob - src/scan-gram.c
f8875c363c563fb1289dc33a7ce4432e20716d54
[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 98
313 #define YY_END_OF_BUFFER 99
314 static yyconst short int yy_accept[361] =
315 { 0,
316 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
317 0, 0, 0, 0, 0, 0, 0, 0, 99, 46,
318 35, 34, 34, 39, 46, 38, 36, 46, 37, 31,
319 33, 46, 30, 43, 32, 50, 51, 51, 52, 47,
320 48, 77, 80, 80, 76, 47, 79, 48, 72, 75,
321 75, 71, 74, 54, 55, 55, 53, 70, 57, 58,
322 58, 56, 90, 91, 91, 82, 92, 81, 85, 92,
323 47, 48, 87, 86, 94, 96, 96, 82, 95, 81,
324 85, 97, 97, 97, 82, 81, 85, 35, 34, 34,
325 34, 34, 45, 0, 0, 0, 0, 0, 0, 0,
326
327 0, 0, 0, 0, 0, 0, 0, 42, 36, 40,
328 41, 37, 0, 50, 51, 51, 51, 51, 49, 77,
329 80, 80, 80, 80, 78, 72, 75, 75, 75, 75,
330 73, 54, 55, 55, 55, 55, 69, 68, 69, 61,
331 62, 63, 64, 65, 66, 67, 69, 58, 58, 58,
332 58, 90, 91, 91, 91, 91, 88, 0, 88, 0,
333 83, 84, 89, 0, 89, 94, 96, 96, 96, 96,
334 93, 97, 97, 97, 97, 97, 83, 84, 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 41, 44, 0, 0, 0, 84, 84, 84, 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, 0, 59, 60, 0, 0, 0,
342 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,
343 0, 0, 0, 17, 0, 0, 0, 0, 0, 23,
344 0, 26, 0, 0, 29, 0, 2, 0, 0, 0,
345 0, 0, 0, 0, 0, 0, 0, 15, 0, 0,
346 0, 20, 0, 22, 24, 27, 0, 1, 3, 0,
347 0, 7, 0, 0, 0, 0, 0, 0, 16, 0,
348
349 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
350 0, 0, 0, 18, 0, 0, 0, 28, 0, 0,
351 0, 0, 0, 0, 13, 14, 0, 21, 0, 0,
352 0, 0, 0, 11, 0, 0, 0, 5, 0, 0,
353 0, 0, 0, 0, 0, 8, 0, 12, 19, 25,
354 0, 0, 6, 0, 0, 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[387] =
399 { 0,
400 0, 0, 48, 51, 58, 61, 83, 86, 73, 94,
401 108, 110, 131, 179, 227, 249, 116, 142, 819, 820,
402 816, 55, 64, 820, 267, 820, 0, 44, 79, 820,
403 820, 0, 820, 820, 820, 0, 97, 99, 805, 820,
404 820, 0, 119, 122, 820, 820, 0, 820, 0, 126,
405 138, 820, 0, 0, 145, 153, 820, 311, 820, 155,
406 157, 820, 0, 159, 164, 820, 159, 820, 62, 164,
407 820, 820, 820, 820, 0, 185, 189, 820, 766, 820,
408 185, 192, 201, 203, 205, 207, 209, 813, 211, 213,
409 216, 219, 820, 780, 783, 86, 778, 49, 198, 767,
410
411 184, 776, 109, 203, 771, 778, 781, 820, 0, 820,
412 0, 230, 787, 0, 242, 244, 255, 259, 820, 0,
413 261, 263, 265, 272, 820, 0, 274, 276, 278, 280,
414 820, 0, 282, 284, 286, 288, 820, 820, 792, 820,
415 820, 820, 820, 820, 820, 820, 0, 296, 298, 314,
416 316, 0, 318, 322, 324, 326, 820, 318, 322, 0,
417 820, 0, 820, 326, 330, 0, 342, 344, 347, 355,
418 820, 357, 359, 361, 363, 365, 367, 369, 766, 144,
419 762, 762, 144, 770, 772, 762, 364, 768, 754, 168,
420 755, 763, 764, 767, 751, 756, 750, 755, 747, 759,
421
422 0, 820, 773, 0, 766, 0, 372, 375, 758, 739,
423 748, 738, 741, 749, 748, 747, 733, 749, 744, 737,
424 746, 730, 730, 741, 730, 737, 733, 729, 723, 726,
425 732, 731, 721, 732, 730, 820, 820, 371, 716, 724,
426 717, 713, 712, 724, 741, 721, 820, 706, 230, 714,
427 705, 709, 701, 820, 701, 370, 700, 712, 698, 820,
428 702, 820, 701, 699, 820, 690, 820, 706, 691, 373,
429 691, 693, 376, 698, 691, 692, 687, 820, 685, 697,
430 686, 820, 682, 820, 378, 820, 682, 820, 681, 668,
431 647, 820, 627, 626, 612, 607, 615, 605, 820, 601,
432
433 615, 601, 594, 604, 820, 588, 599, 598, 583, 588,
434 571, 558, 571, 820, 537, 536, 547, 820, 510, 507,
435 516, 501, 497, 503, 820, 820, 491, 820, 502, 363,
436 373, 358, 347, 820, 348, 325, 317, 820, 302, 287,
437 279, 267, 263, 265, 251, 820, 229, 820, 820, 820,
438 240, 380, 820, 229, 192, 164, 85, 62, 820, 820,
439 405, 419, 433, 447, 461, 475, 489, 503, 227, 517,
440 531, 545, 557, 571, 583, 597, 610, 624, 638, 652,
441 666, 84, 680, 694, 708, 58
442 } ;
443
444 static yyconst short int yy_def[387] =
445 { 0,
446 360, 1, 361, 361, 362, 362, 363, 363, 364, 364,
447 365, 365, 366, 366, 367, 367, 368, 368, 360, 360,
448 360, 360, 360, 360, 360, 360, 369, 360, 360, 360,
449 360, 370, 360, 360, 360, 371, 360, 360, 360, 360,
450 360, 372, 360, 360, 360, 360, 373, 360, 374, 360,
451 360, 360, 375, 376, 360, 360, 360, 377, 360, 360,
452 360, 360, 378, 360, 360, 360, 360, 360, 360, 360,
453 360, 360, 360, 360, 379, 360, 360, 360, 360, 360,
454 360, 380, 380, 380, 380, 380, 380, 360, 360, 360,
455 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
456
457 360, 360, 360, 360, 360, 360, 360, 360, 369, 360,
458 381, 360, 370, 371, 360, 360, 360, 360, 360, 372,
459 360, 360, 360, 360, 360, 374, 360, 360, 360, 360,
460 360, 376, 360, 360, 360, 360, 360, 360, 360, 360,
461 360, 360, 360, 360, 360, 360, 382, 360, 360, 360,
462 360, 378, 360, 360, 360, 360, 360, 360, 360, 383,
463 360, 384, 360, 360, 360, 379, 360, 360, 360, 360,
464 360, 380, 380, 380, 380, 380, 380, 385, 360, 360,
465 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
466 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
467
468 381, 360, 360, 386, 383, 384, 385, 385, 360, 360,
469 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
470 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
471 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
472 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
473 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
474 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
475 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
476 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
477 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
478
479 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
480 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
481 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
482 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
483 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
484 360, 360, 360, 360, 360, 360, 360, 360, 360, 0,
485 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
486 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
487 360, 360, 360, 360, 360, 360
488 } ;
489
490 static yyconst short int yy_nxt[871] =
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, 237, 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, 359, 46, 53, 48, 46, 53, 48,
504 60, 61, 60, 61, 358, 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, 224, 70, 357,
513
514 71, 225, 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, 356, 73, 191, 74, 76,
517 77, 78, 195, 79, 80, 109, 187, 109, 81, 275,
518 188, 196, 112, 112, 115, 116, 117, 118, 46, 197,
519 48, 76, 77, 78, 275, 79, 80, 115, 116, 355,
520 81, 117, 118, 121, 122, 123, 124, 121, 122, 353,
521 46, 352, 48, 93, 123, 124, 127, 128, 129, 130,
522 127, 128, 129, 130, 133, 134, 135, 136, 133, 134,
523 135, 136, 351, 94, 350, 95, 96, 97, 148, 149,
524
525 150, 151, 98, 349, 99, 100, 101, 102, 103, 104,
526 105, 106, 348, 107, 108, 138, 148, 149, 150, 151,
527 153, 154, 347, 139, 155, 156, 153, 154, 155, 156,
528 159, 159, 346, 138, 159, 159, 140, 141, 165, 165,
529 345, 142, 165, 165, 167, 168, 169, 170, 143, 167,
530 168, 144, 344, 145, 343, 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, 281,
533 158, 342, 291, 159, 159, 294, 341, 303, 220, 354,
534 206, 340, 206, 206, 281, 206, 206, 291, 206, 339,
535
536 294, 221, 303, 338, 354, 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, 337, 113,
550 113, 114, 336, 335, 114, 114, 114, 114, 334, 114,
551 114, 114, 114, 333, 114, 120, 332, 331, 330, 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, 329, 328, 126, 126, 126, 327, 126, 126,
555 126, 126, 126, 131, 131, 131, 131, 131, 131, 131,
556 131, 131, 131, 131, 131, 131, 131, 132, 326, 325,
557
558 324, 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, 323, 322, 321, 320, 152,
561 319, 152, 152, 318, 152, 152, 317, 152, 166, 316,
562 315, 314, 166, 313, 312, 166, 166, 311, 166, 166,
563 310, 166, 172, 172, 172, 172, 172, 172, 172, 172,
564 172, 172, 172, 172, 309, 172, 201, 308, 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, 307, 205, 205, 206, 306, 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, 305, 304, 302, 301, 300, 299, 298, 297,
572 296, 295, 293, 292, 290, 289, 288, 287, 286, 285,
573 284, 283, 282, 280, 279, 278, 277, 276, 274, 273,
574 272, 271, 270, 269, 268, 267, 266, 265, 264, 263,
575 262, 261, 260, 259, 258, 257, 256, 255, 254, 253,
576 252, 251, 250, 249, 248, 247, 246, 245, 244, 243,
577 242, 241, 240, 239, 238, 236, 235, 234, 233, 232,
578 231, 230, 229, 228, 227, 226, 223, 222, 219, 218,
579
580 217, 214, 213, 209, 203, 202, 200, 199, 198, 192,
581 189, 183, 180, 179, 88, 171, 119, 88, 360, 19,
582 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
583 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
584 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
585 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
586 360, 360, 360, 360, 360, 360, 360, 360, 360, 360
587 } ;
588
589 static yyconst short int yy_chk[871] =
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, 386, 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, 382, 9, 10, 10, 10, 37,
601
602 37, 38, 38, 358, 7, 7, 7, 8, 8, 8,
603 11, 11, 12, 12, 357, 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, 190, 14, 356,
612
613 14, 190, 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, 355, 14, 101, 14, 15,
616 15, 15, 104, 15, 15, 369, 99, 369, 15, 249,
617 99, 104, 112, 112, 115, 115, 116, 116, 15, 104,
618 15, 16, 16, 16, 249, 16, 16, 117, 117, 354,
619 16, 118, 118, 121, 121, 122, 122, 123, 123, 351,
620 16, 347, 16, 25, 124, 124, 127, 127, 128, 128,
621 129, 129, 130, 130, 133, 133, 134, 134, 135, 135,
622 136, 136, 345, 25, 344, 25, 25, 25, 148, 148,
623
624 149, 149, 25, 343, 25, 25, 25, 25, 25, 25,
625 25, 25, 342, 25, 25, 58, 150, 150, 151, 151,
626 153, 153, 341, 58, 154, 154, 155, 155, 156, 156,
627 158, 158, 340, 58, 159, 159, 58, 58, 164, 164,
628 339, 58, 165, 165, 167, 167, 168, 168, 58, 169,
629 169, 58, 337, 58, 336, 58, 58, 170, 170, 172,
630 172, 173, 173, 174, 174, 175, 175, 176, 176, 177,
631 177, 178, 178, 187, 207, 207, 238, 208, 208, 256,
632 238, 335, 270, 238, 238, 273, 333, 285, 187, 352,
633 178, 332, 178, 207, 256, 207, 208, 270, 208, 331,
634
635 273, 187, 285, 330, 352, 361, 361, 361, 361, 361,
636 361, 361, 361, 361, 361, 361, 361, 361, 361, 362,
637 362, 362, 362, 362, 362, 362, 362, 362, 362, 362,
638 362, 362, 362, 363, 363, 363, 363, 363, 363, 363,
639 363, 363, 363, 363, 363, 363, 363, 364, 364, 364,
640 364, 364, 364, 364, 364, 364, 364, 364, 364, 364,
641 364, 365, 365, 365, 365, 365, 365, 365, 365, 365,
642 365, 365, 365, 365, 365, 366, 366, 366, 366, 366,
643 366, 366, 366, 366, 366, 366, 366, 366, 366, 367,
644 367, 367, 367, 367, 367, 367, 367, 367, 367, 367,
645
646 367, 367, 367, 368, 368, 368, 368, 368, 368, 368,
647 368, 368, 368, 368, 368, 368, 368, 370, 370, 370,
648 370, 370, 370, 370, 370, 370, 370, 370, 329, 370,
649 370, 371, 327, 324, 371, 371, 371, 371, 323, 371,
650 371, 371, 371, 322, 371, 372, 321, 320, 319, 372,
651 372, 372, 372, 372, 372, 372, 372, 373, 373, 373,
652 373, 373, 373, 373, 373, 373, 373, 373, 373, 373,
653 373, 374, 317, 316, 374, 374, 374, 315, 374, 374,
654 374, 374, 374, 375, 375, 375, 375, 375, 375, 375,
655 375, 375, 375, 375, 375, 375, 375, 376, 313, 312,
656
657 311, 376, 376, 376, 376, 376, 376, 376, 376, 376,
658 377, 377, 377, 377, 377, 377, 377, 377, 377, 377,
659 377, 377, 377, 377, 378, 310, 309, 308, 307, 378,
660 306, 378, 378, 304, 378, 378, 303, 378, 379, 302,
661 301, 300, 379, 298, 297, 379, 379, 296, 379, 379,
662 295, 379, 380, 380, 380, 380, 380, 380, 380, 380,
663 380, 380, 380, 380, 294, 380, 381, 293, 381, 381,
664 381, 381, 381, 381, 381, 381, 381, 381, 381, 381,
665 383, 383, 383, 383, 383, 383, 383, 383, 383, 383,
666 383, 291, 383, 383, 384, 290, 384, 384, 384, 384,
667
668 384, 384, 384, 384, 384, 384, 384, 384, 385, 385,
669 385, 385, 385, 385, 385, 385, 385, 385, 385, 385,
670 385, 385, 289, 287, 283, 281, 280, 279, 277, 276,
671 275, 274, 272, 271, 269, 268, 266, 264, 263, 261,
672 259, 258, 257, 255, 253, 252, 251, 250, 248, 246,
673 245, 244, 243, 242, 241, 240, 239, 235, 234, 233,
674 232, 231, 230, 229, 228, 227, 226, 225, 224, 223,
675 222, 221, 220, 219, 218, 217, 216, 215, 214, 213,
676 212, 211, 210, 209, 205, 203, 200, 199, 198, 197,
677 196, 195, 194, 193, 192, 191, 189, 188, 186, 185,
678
679 184, 182, 181, 179, 139, 113, 107, 106, 105, 102,
680 100, 97, 95, 94, 88, 79, 39, 21, 19, 360,
681 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
682 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
683 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
684 360, 360, 360, 360, 360, 360, 360, 360, 360, 360,
685 360, 360, 360, 360, 360, 360, 360, 360, 360, 360
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[98] =
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, 150, 152,
699 153, 154, 155, 157, 158, 159, 164, 167, 170, 173,
700 174, 177, 180, 183, 191, 197, 213, 214, 225, 237,
701 238, 239, 256, 265, 267, 287, 301, 303, 323, 335,
702 339, 340, 341, 342, 343, 344, 345, 346, 347, 353,
703 364, 370, 371, 373, 375, 393, 399, 400, 402, 404,
704 422, 425, 428, 429, 432, 443, 454, 456, 458, 461,
705 462, 465, 485, 492, 493, 494, 514
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 >= 361 )
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] != 820 );
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 < 98 )
1079 fprintf( stderr, "--accepting rule at line %d (\"%s\")\n",
1080 yy_rule_linenum[yy_act], yytext );
1081 else if ( yy_act == 98 )
1082 fprintf( stderr, "--accepting default rule (\"%s\")\n",
1083 yytext );
1084 else if ( yy_act == 99 )
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_PRINTER;
1190 YY_BREAK
1191 case 19:
1192 YY_RULE_SETUP
1193 #line 140 "scan-gram.l"
1194 return PERCENT_PURE_PARSER;
1195 YY_BREAK
1196 case 20:
1197 YY_RULE_SETUP
1198 #line 141 "scan-gram.l"
1199 return PERCENT_RIGHT;
1200 YY_BREAK
1201 case 21:
1202 YY_RULE_SETUP
1203 #line 142 "scan-gram.l"
1204 return PERCENT_SKELETON;
1205 YY_BREAK
1206 case 22:
1207 YY_RULE_SETUP
1208 #line 143 "scan-gram.l"
1209 return PERCENT_START;
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;
1220 YY_BREAK
1221 case 25:
1222 YY_RULE_SETUP
1223 #line 146 "scan-gram.l"
1224 return PERCENT_TOKEN_TABLE;
1225 YY_BREAK
1226 case 26:
1227 YY_RULE_SETUP
1228 #line 147 "scan-gram.l"
1229 return PERCENT_TYPE;
1230 YY_BREAK
1231 case 27:
1232 YY_RULE_SETUP
1233 #line 148 "scan-gram.l"
1234 return PERCENT_UNION;
1235 YY_BREAK
1236 case 28:
1237 YY_RULE_SETUP
1238 #line 149 "scan-gram.l"
1239 return PERCENT_VERBOSE;
1240 YY_BREAK
1241 case 29:
1242 YY_RULE_SETUP
1243 #line 150 "scan-gram.l"
1244 return PERCENT_YACC;
1245 YY_BREAK
1246 case 30:
1247 YY_RULE_SETUP
1248 #line 152 "scan-gram.l"
1249 return EQUAL;
1250 YY_BREAK
1251 case 31:
1252 YY_RULE_SETUP
1253 #line 153 "scan-gram.l"
1254 return COLON;
1255 YY_BREAK
1256 case 32:
1257 YY_RULE_SETUP
1258 #line 154 "scan-gram.l"
1259 return PIPE;
1260 YY_BREAK
1261 case 33:
1262 YY_RULE_SETUP
1263 #line 155 "scan-gram.l"
1264 return SEMICOLON;
1265 YY_BREAK
1266 case 34:
1267 YY_RULE_SETUP
1268 #line 157 "scan-gram.l"
1269 YY_LINES; YY_STEP;
1270 YY_BREAK
1271 case 35:
1272 YY_RULE_SETUP
1273 #line 158 "scan-gram.l"
1274 YY_STEP;
1275 YY_BREAK
1276 case 36:
1277 YY_RULE_SETUP
1278 #line 159 "scan-gram.l"
1279 {
1280 yylval->symbol = getsym (yytext, *yylloc);
1281 return ID;
1282 }
1283 YY_BREAK
1284 case 37:
1285 YY_RULE_SETUP
1286 #line 164 "scan-gram.l"
1287 yylval->integer = strtol (yytext, 0, 10); return INT;
1288 YY_BREAK
1289 /* Characters. We don't check there is only one. */
1290 case 38:
1291 YY_RULE_SETUP
1292 #line 167 "scan-gram.l"
1293 YY_OBS_GROW; yy_push_state (SC_ESCAPED_CHARACTER);
1294 YY_BREAK
1295 /* Strings. */
1296 case 39:
1297 YY_RULE_SETUP
1298 #line 170 "scan-gram.l"
1299 YY_OBS_GROW; yy_push_state (SC_ESCAPED_STRING);
1300 YY_BREAK
1301 /* Comments. */
1302 case 40:
1303 YY_RULE_SETUP
1304 #line 173 "scan-gram.l"
1305 yy_push_state (SC_COMMENT);
1306 YY_BREAK
1307 case 41:
1308 YY_RULE_SETUP
1309 #line 174 "scan-gram.l"
1310 YY_STEP;
1311 YY_BREAK
1312 /* Prologue. */
1313 case 42:
1314 YY_RULE_SETUP
1315 #line 177 "scan-gram.l"
1316 yy_push_state (SC_PROLOGUE);
1317 YY_BREAK
1318 /* Code in between braces. */
1319 case 43:
1320 YY_RULE_SETUP
1321 #line 180 "scan-gram.l"
1322 YY_OBS_GROW; ++braces_level; yy_push_state (SC_BRACED_CODE);
1323 YY_BREAK
1324 /* A type. */
1325 case 44:
1326 YY_RULE_SETUP
1327 #line 183 "scan-gram.l"
1328 {
1329 obstack_grow (&string_obstack, yytext + 1, yyleng - 2);
1330 YY_OBS_FINISH;
1331 yylval->string = last_string;
1332 return TYPE;
1333 }
1334 YY_BREAK
1335 case 45:
1336 YY_RULE_SETUP
1337 #line 191 "scan-gram.l"
1338 {
1339 if (++percent_percent_count == 2)
1340 yy_push_state (SC_EPILOGUE);
1341 return PERCENT_PERCENT;
1342 }
1343 YY_BREAK
1344 case 46:
1345 YY_RULE_SETUP
1346 #line 197 "scan-gram.l"
1347 {
1348 LOCATION_PRINT (stderr, *yylloc);
1349 fprintf (stderr, ": invalid character: `%c'\n", *yytext);
1350 YY_STEP;
1351 }
1352 YY_BREAK
1353
1354 /*------------------------------------------------------------.
1355 | Whatever the start condition (but those which correspond to |
1356 | entity `swallowed' by Bison: SC_ESCAPED_STRING and |
1357 | SC_ESCAPED_CHARACTER), no M4 character must escape as is. |
1358 `------------------------------------------------------------*/
1359
1360
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 case 48:
1367 YY_RULE_SETUP
1368 #line 214 "scan-gram.l"
1369 if (YY_START != SC_COMMENT) obstack_sgrow (&string_obstack, "@:>@");
1370 YY_BREAK
1371
1372 /*-----------------------------------------------------------.
1373 | Scanning a C comment. The initial `/ *' is already eaten. |
1374 `-----------------------------------------------------------*/
1375
1376
1377 case 49:
1378 YY_RULE_SETUP
1379 #line 225 "scan-gram.l"
1380 { /* End of the comment. */
1381 if (yy_top_state () == INITIAL)
1382 {
1383 YY_STEP;
1384 }
1385 else
1386 {
1387 YY_OBS_GROW;
1388 }
1389 yy_pop_state ();
1390 }
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;
1396 YY_BREAK
1397 case 51:
1398 YY_RULE_SETUP
1399 #line 238 "scan-gram.l"
1400 if (yy_top_state () != INITIAL) YY_OBS_GROW; YY_LINES;
1401 YY_BREAK
1402 case 52:
1403 YY_RULE_SETUP
1404 #line 239 "scan-gram.l"
1405 /* Stray `*'. */if (yy_top_state () != INITIAL) YY_OBS_GROW;
1406 YY_BREAK
1407 case YY_STATE_EOF(SC_COMMENT):
1408 #line 241 "scan-gram.l"
1409 {
1410 LOCATION_PRINT (stderr, *yylloc);
1411 fprintf (stderr, ": unexpected end of file in a comment\n");
1412 yy_pop_state ();
1413 }
1414 YY_BREAK
1415
1416 /*----------------------------------------------------------------.
1417 | Scanning a C string, including its escapes. The initial `"' is |
1418 | already eaten. |
1419 `----------------------------------------------------------------*/
1420
1421
1422 case 53:
1423 YY_RULE_SETUP
1424 #line 256 "scan-gram.l"
1425 {
1426 assert (yy_top_state () == INITIAL);
1427 YY_OBS_GROW;
1428 YY_OBS_FINISH;
1429 yylval->string = last_string;
1430 yy_pop_state ();
1431 return STRING;
1432 }
1433 YY_BREAK
1434 case 54:
1435 YY_RULE_SETUP
1436 #line 265 "scan-gram.l"
1437 YY_OBS_GROW;
1438 YY_BREAK
1439 case 55:
1440 YY_RULE_SETUP
1441 #line 267 "scan-gram.l"
1442 obstack_1grow (&string_obstack, '\n'); YY_LINES;
1443 YY_BREAK
1444 case YY_STATE_EOF(SC_ESCAPED_STRING):
1445 #line 269 "scan-gram.l"
1446 {
1447 LOCATION_PRINT (stderr, *yylloc);
1448 fprintf (stderr, ": unexpected end of file in a string\n");
1449 assert (yy_top_state () == INITIAL);
1450 YY_OBS_FINISH;
1451 yylval->string = last_string;
1452 yy_pop_state ();
1453 return STRING;
1454 }
1455 YY_BREAK
1456
1457 /*---------------------------------------------------------------.
1458 | Scanning a C character, decoding its escapes. The initial "'" |
1459 | is already eaten. |
1460 `---------------------------------------------------------------*/
1461
1462
1463 case 56:
1464 YY_RULE_SETUP
1465 #line 287 "scan-gram.l"
1466 {
1467 YY_OBS_GROW;
1468 assert (yy_top_state () == INITIAL);
1469 {
1470 YY_OBS_FINISH;
1471 yylval->symbol = getsym (last_string, *yylloc);
1472 symbol_class_set (yylval->symbol, token_sym, *yylloc);
1473 symbol_user_token_number_set (yylval->symbol, last_string[1], *yylloc);
1474 YY_OBS_FREE;
1475 yy_pop_state ();
1476 return ID;
1477 }
1478 }
1479 YY_BREAK
1480 case 57:
1481 YY_RULE_SETUP
1482 #line 301 "scan-gram.l"
1483 YY_OBS_GROW;
1484 YY_BREAK
1485 case 58:
1486 YY_RULE_SETUP
1487 #line 303 "scan-gram.l"
1488 obstack_1grow (&string_obstack, '\n'); YY_LINES;
1489 YY_BREAK
1490 case YY_STATE_EOF(SC_ESCAPED_CHARACTER):
1491 #line 305 "scan-gram.l"
1492 {
1493 LOCATION_PRINT (stderr, *yylloc);
1494 fprintf (stderr, ": unexpected end of file in a character\n");
1495 assert (yy_top_state () == INITIAL);
1496 YY_OBS_FINISH;
1497 yylval->string = last_string;
1498 yy_pop_state ();
1499 return CHARACTER;
1500 }
1501 YY_BREAK
1502
1503 /*----------------------------.
1504 | Decode escaped characters. |
1505 `----------------------------*/
1506
1507
1508 case 59:
1509 YY_RULE_SETUP
1510 #line 323 "scan-gram.l"
1511 {
1512 long c = strtol (yytext + 1, 0, 8);
1513 if (c > 255)
1514 {
1515 LOCATION_PRINT (stderr, *yylloc);
1516 fprintf (stderr, ": invalid escape: %s\n", quote (yytext));
1517 YY_STEP;
1518 }
1519 else
1520 obstack_1grow (&string_obstack, c);
1521 }
1522 YY_BREAK
1523 case 60:
1524 YY_RULE_SETUP
1525 #line 335 "scan-gram.l"
1526 {
1527 obstack_1grow (&string_obstack, strtol (yytext + 2, 0, 16));
1528 }
1529 YY_BREAK
1530 case 61:
1531 YY_RULE_SETUP
1532 #line 339 "scan-gram.l"
1533 obstack_1grow (&string_obstack, '\a');
1534 YY_BREAK
1535 case 62:
1536 YY_RULE_SETUP
1537 #line 340 "scan-gram.l"
1538 obstack_1grow (&string_obstack, '\b');
1539 YY_BREAK
1540 case 63:
1541 YY_RULE_SETUP
1542 #line 341 "scan-gram.l"
1543 obstack_1grow (&string_obstack, '\f');
1544 YY_BREAK
1545 case 64:
1546 YY_RULE_SETUP
1547 #line 342 "scan-gram.l"
1548 obstack_1grow (&string_obstack, '\n');
1549 YY_BREAK
1550 case 65:
1551 YY_RULE_SETUP
1552 #line 343 "scan-gram.l"
1553 obstack_1grow (&string_obstack, '\r');
1554 YY_BREAK
1555 case 66:
1556 YY_RULE_SETUP
1557 #line 344 "scan-gram.l"
1558 obstack_1grow (&string_obstack, '\t');
1559 YY_BREAK
1560 case 67:
1561 YY_RULE_SETUP
1562 #line 345 "scan-gram.l"
1563 obstack_1grow (&string_obstack, '\v');
1564 YY_BREAK
1565 case 68:
1566 YY_RULE_SETUP
1567 #line 346 "scan-gram.l"
1568 obstack_1grow (&string_obstack, yytext[1]);
1569 YY_BREAK
1570 case 69:
1571 YY_RULE_SETUP
1572 #line 347 "scan-gram.l"
1573 {
1574 LOCATION_PRINT (stderr, *yylloc);
1575 fprintf (stderr, ": unrecognized escape: %s\n", quote (yytext));
1576 YY_OBS_GROW;
1577 }
1578 YY_BREAK
1579 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1580 case 70:
1581 YY_RULE_SETUP
1582 #line 353 "scan-gram.l"
1583 YY_OBS_GROW;
1584 YY_BREAK
1585
1586 /*----------------------------------------------------------.
1587 | Scanning a C character without decoding its escapes. The |
1588 | initial "'" is already eaten. |
1589 `----------------------------------------------------------*/
1590
1591
1592 case 71:
1593 YY_RULE_SETUP
1594 #line 364 "scan-gram.l"
1595 {
1596 YY_OBS_GROW;
1597 assert (yy_top_state () != INITIAL);
1598 yy_pop_state ();
1599 }
1600 YY_BREAK
1601 case 72:
1602 YY_RULE_SETUP
1603 #line 370 "scan-gram.l"
1604 YY_OBS_GROW;
1605 YY_BREAK
1606 case 73:
1607 YY_RULE_SETUP
1608 #line 371 "scan-gram.l"
1609 YY_OBS_GROW;
1610 YY_BREAK
1611 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1612 case 74:
1613 YY_RULE_SETUP
1614 #line 373 "scan-gram.l"
1615 YY_OBS_GROW;
1616 YY_BREAK
1617 case 75:
1618 YY_RULE_SETUP
1619 #line 375 "scan-gram.l"
1620 YY_OBS_GROW; YY_LINES;
1621 YY_BREAK
1622 case YY_STATE_EOF(SC_CHARACTER):
1623 #line 377 "scan-gram.l"
1624 {
1625 LOCATION_PRINT (stderr, *yylloc);
1626 fprintf (stderr, ": unexpected end of file in a character\n");
1627 assert (yy_top_state () != INITIAL);
1628 yy_pop_state ();
1629 }
1630 YY_BREAK
1631
1632 /*----------------------------------------------------------------.
1633 | Scanning a C string, without decoding its escapes. The initial |
1634 | `"' is already eaten. |
1635 `----------------------------------------------------------------*/
1636
1637
1638 case 76:
1639 YY_RULE_SETUP
1640 #line 393 "scan-gram.l"
1641 {
1642 assert (yy_top_state () != INITIAL);
1643 YY_OBS_GROW;
1644 yy_pop_state ();
1645 }
1646 YY_BREAK
1647 case 77:
1648 YY_RULE_SETUP
1649 #line 399 "scan-gram.l"
1650 YY_OBS_GROW;
1651 YY_BREAK
1652 case 78:
1653 YY_RULE_SETUP
1654 #line 400 "scan-gram.l"
1655 YY_OBS_GROW;
1656 YY_BREAK
1657 /* FLex wants this rule, in case of a `\<<EOF>>'. */
1658 case 79:
1659 YY_RULE_SETUP
1660 #line 402 "scan-gram.l"
1661 YY_OBS_GROW;
1662 YY_BREAK
1663 case 80:
1664 YY_RULE_SETUP
1665 #line 404 "scan-gram.l"
1666 YY_OBS_GROW; YY_LINES;
1667 YY_BREAK
1668 case YY_STATE_EOF(SC_STRING):
1669 #line 406 "scan-gram.l"
1670 {
1671 LOCATION_PRINT (stderr, *yylloc);
1672 fprintf (stderr, ": unexpected end of file in a string\n");
1673 assert (yy_top_state () != INITIAL);
1674 yy_pop_state ();
1675 }
1676 YY_BREAK
1677
1678 /*---------------------------------------------------.
1679 | Strings, comments etc. can be found in user code. |
1680 `---------------------------------------------------*/
1681
1682
1683 /* Characters. We don't check there is only one. */
1684 case 81:
1685 YY_RULE_SETUP
1686 #line 422 "scan-gram.l"
1687 YY_OBS_GROW; yy_push_state (SC_CHARACTER);
1688 YY_BREAK
1689 /* Strings. */
1690 case 82:
1691 YY_RULE_SETUP
1692 #line 425 "scan-gram.l"
1693 YY_OBS_GROW; yy_push_state (SC_STRING);
1694 YY_BREAK
1695 /* Comments. */
1696 case 83:
1697 YY_RULE_SETUP
1698 #line 428 "scan-gram.l"
1699 YY_OBS_GROW; yy_push_state (SC_COMMENT);
1700 YY_BREAK
1701 case 84:
1702 YY_RULE_SETUP
1703 #line 429 "scan-gram.l"
1704 YY_OBS_GROW;
1705 YY_BREAK
1706 /* Not comments. */
1707 case 85:
1708 YY_RULE_SETUP
1709 #line 432 "scan-gram.l"
1710 YY_OBS_GROW;
1711 YY_BREAK
1712
1713 /*---------------------------------------------------------------.
1714 | Scanning some code in braces (%union and actions). The initial |
1715 | "{" is already eaten. |
1716 `---------------------------------------------------------------*/
1717
1718
1719 case 86:
1720 YY_RULE_SETUP
1721 #line 443 "scan-gram.l"
1722 {
1723 YY_OBS_GROW;
1724 if (--braces_level == 0)
1725 {
1726 yy_pop_state ();
1727 YY_OBS_FINISH;
1728 yylval->string = last_string;
1729 return BRACED_CODE;
1730 }
1731 }
1732 YY_BREAK
1733 case 87:
1734 YY_RULE_SETUP
1735 #line 454 "scan-gram.l"
1736 YY_OBS_GROW; braces_level++;
1737 YY_BREAK
1738 case 88:
1739 YY_RULE_SETUP
1740 #line 456 "scan-gram.l"
1741 { handle_dollar (current_braced_code,
1742 yytext, *yylloc); }
1743 YY_BREAK
1744 case 89:
1745 YY_RULE_SETUP
1746 #line 458 "scan-gram.l"
1747 { handle_at (current_braced_code,
1748 yytext, *yylloc); }
1749 YY_BREAK
1750 case 90:
1751 YY_RULE_SETUP
1752 #line 461 "scan-gram.l"
1753 YY_OBS_GROW;
1754 YY_BREAK
1755 case 91:
1756 YY_RULE_SETUP
1757 #line 462 "scan-gram.l"
1758 YY_OBS_GROW; YY_LINES;
1759 YY_BREAK
1760 /* A lose $, or /, or etc. */
1761 case 92:
1762 YY_RULE_SETUP
1763 #line 465 "scan-gram.l"
1764 YY_OBS_GROW;
1765 YY_BREAK
1766 case YY_STATE_EOF(SC_BRACED_CODE):
1767 #line 467 "scan-gram.l"
1768 {
1769 LOCATION_PRINT (stderr, *yylloc);
1770 fprintf (stderr, ": unexpected end of file in a braced code\n");
1771 yy_pop_state ();
1772 YY_OBS_FINISH;
1773 yylval->string = last_string;
1774 return BRACED_CODE;
1775 }
1776 YY_BREAK
1777
1778 /*--------------------------------------------------------------.
1779 | Scanning some prologue: from "%{" (already scanned) to "%}". |
1780 `--------------------------------------------------------------*/
1781
1782
1783 case 93:
1784 YY_RULE_SETUP
1785 #line 485 "scan-gram.l"
1786 {
1787 yy_pop_state ();
1788 YY_OBS_FINISH;
1789 yylval->string = last_string;
1790 return PROLOGUE;
1791 }
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;
1802 YY_BREAK
1803 case 96:
1804 YY_RULE_SETUP
1805 #line 494 "scan-gram.l"
1806 YY_OBS_GROW; YY_LINES;
1807 YY_BREAK
1808 case YY_STATE_EOF(SC_PROLOGUE):
1809 #line 496 "scan-gram.l"
1810 {
1811 LOCATION_PRINT (stderr, *yylloc);
1812 fprintf (stderr, ": unexpected end of file in a prologue\n");
1813 yy_pop_state ();
1814 YY_OBS_FINISH;
1815 yylval->string = last_string;
1816 return PROLOGUE;
1817 }
1818 YY_BREAK
1819
1820 /*---------------------------------------------------------------.
1821 | Scanning the epilogue (everything after the second "%%", which |
1822 | has already been eaten. |
1823 `---------------------------------------------------------------*/
1824
1825
1826 case 97:
1827 YY_RULE_SETUP
1828 #line 514 "scan-gram.l"
1829 YY_OBS_GROW;
1830 YY_BREAK
1831 case YY_STATE_EOF(SC_EPILOGUE):
1832 #line 516 "scan-gram.l"
1833 {
1834 yy_pop_state ();
1835 YY_OBS_FINISH;
1836 yylval->string = last_string;
1837 return EPILOGUE;
1838 }
1839 YY_BREAK
1840
1841 case 98:
1842 YY_RULE_SETUP
1843 #line 525 "scan-gram.l"
1844 YY_FATAL_ERROR( "flex scanner jammed" );
1845 YY_BREAK
1846 #line 1847 "lex.yy.c"
1847 case YY_STATE_EOF(INITIAL):
1848 yyterminate();
1849
1850 case YY_END_OF_BUFFER:
1851 {
1852 /* Amount of text matched not including the EOB char. */
1853 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1854
1855 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1856 *yy_cp = yy_hold_char;
1857 YY_RESTORE_YY_MORE_OFFSET
1858
1859 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1860 {
1861 /* We're scanning a new file or input source. It's
1862 * possible that this happened because the user
1863 * just pointed yyin at a new source and called
1864 * yylex(). If so, then we have to assure
1865 * consistency between yy_current_buffer and our
1866 * globals. Here is the right place to do so, because
1867 * this is the first action (other than possibly a
1868 * back-up) that will match for the new input source.
1869 */
1870 yy_n_chars = yy_current_buffer->yy_n_chars;
1871 yy_current_buffer->yy_input_file = yyin;
1872 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1873 }
1874
1875 /* Note that here we test for yy_c_buf_p "<=" to the position
1876 * of the first EOB in the buffer, since yy_c_buf_p will
1877 * already have been incremented past the NUL character
1878 * (since all states make transitions on EOB to the
1879 * end-of-buffer state). Contrast this with the test
1880 * in input().
1881 */
1882 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1883 { /* This was really a NUL. */
1884 yy_state_type yy_next_state;
1885
1886 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1887
1888 yy_current_state = yy_get_previous_state();
1889
1890 /* Okay, we're now positioned to make the NUL
1891 * transition. We couldn't have
1892 * yy_get_previous_state() go ahead and do it
1893 * for us because it doesn't know how to deal
1894 * with the possibility of jamming (and we don't
1895 * want to build jamming into it because then it
1896 * will run more slowly).
1897 */
1898
1899 yy_next_state = yy_try_NUL_trans( yy_current_state );
1900
1901 yy_bp = yytext_ptr + YY_MORE_ADJ;
1902
1903 if ( yy_next_state )
1904 {
1905 /* Consume the NUL. */
1906 yy_cp = ++yy_c_buf_p;
1907 yy_current_state = yy_next_state;
1908 goto yy_match;
1909 }
1910
1911 else
1912 {
1913 yy_cp = yy_c_buf_p;
1914 goto yy_find_action;
1915 }
1916 }
1917
1918 else switch ( yy_get_next_buffer() )
1919 {
1920 case EOB_ACT_END_OF_FILE:
1921 {
1922 yy_did_buffer_switch_on_eof = 0;
1923
1924 if ( yywrap() )
1925 {
1926 /* Note: because we've taken care in
1927 * yy_get_next_buffer() to have set up
1928 * yytext, we can now set up
1929 * yy_c_buf_p so that if some total
1930 * hoser (like flex itself) wants to
1931 * call the scanner after we return the
1932 * YY_NULL, it'll still work - another
1933 * YY_NULL will get returned.
1934 */
1935 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1936
1937 yy_act = YY_STATE_EOF(YY_START);
1938 goto do_action;
1939 }
1940
1941 else
1942 {
1943 if ( ! yy_did_buffer_switch_on_eof )
1944 YY_NEW_FILE;
1945 }
1946 break;
1947 }
1948
1949 case EOB_ACT_CONTINUE_SCAN:
1950 yy_c_buf_p =
1951 yytext_ptr + yy_amount_of_matched_text;
1952
1953 yy_current_state = yy_get_previous_state();
1954
1955 yy_cp = yy_c_buf_p;
1956 yy_bp = yytext_ptr + YY_MORE_ADJ;
1957 goto yy_match;
1958
1959 case EOB_ACT_LAST_MATCH:
1960 yy_c_buf_p =
1961 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1962
1963 yy_current_state = yy_get_previous_state();
1964
1965 yy_cp = yy_c_buf_p;
1966 yy_bp = yytext_ptr + YY_MORE_ADJ;
1967 goto yy_find_action;
1968 }
1969 break;
1970 }
1971
1972 default:
1973 YY_FATAL_ERROR(
1974 "fatal flex scanner internal error--no action found" );
1975 } /* end of action switch */
1976 } /* end of scanning one token */
1977 } /* end of yylex */
1978
1979
1980 /* yy_get_next_buffer - try to read in a new buffer
1981 *
1982 * Returns a code representing an action:
1983 * EOB_ACT_LAST_MATCH -
1984 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1985 * EOB_ACT_END_OF_FILE - end of file
1986 */
1987
1988 static int yy_get_next_buffer()
1989 {
1990 register char *dest = yy_current_buffer->yy_ch_buf;
1991 register char *source = yytext_ptr;
1992 register int number_to_move, i;
1993 int ret_val;
1994
1995 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1996 YY_FATAL_ERROR(
1997 "fatal flex scanner internal error--end of buffer missed" );
1998
1999 if ( yy_current_buffer->yy_fill_buffer == 0 )
2000 { /* Don't try to fill the buffer, so this is an EOF. */
2001 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
2002 {
2003 /* We matched a single character, the EOB, so
2004 * treat this as a final EOF.
2005 */
2006 return EOB_ACT_END_OF_FILE;
2007 }
2008
2009 else
2010 {
2011 /* We matched some text prior to the EOB, first
2012 * process it.
2013 */
2014 return EOB_ACT_LAST_MATCH;
2015 }
2016 }
2017
2018 /* Try to read more data. */
2019
2020 /* First move last chars to start of buffer. */
2021 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
2022
2023 for ( i = 0; i < number_to_move; ++i )
2024 *(dest++) = *(source++);
2025
2026 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2027 /* don't do the read, it's not guaranteed to return an EOF,
2028 * just force an EOF
2029 */
2030 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
2031
2032 else
2033 {
2034 int num_to_read =
2035 yy_current_buffer->yy_buf_size - number_to_move - 1;
2036
2037 while ( num_to_read <= 0 )
2038 { /* Not enough room in the buffer - grow it. */
2039 #ifdef YY_USES_REJECT
2040 YY_FATAL_ERROR(
2041 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2042 #else
2043
2044 /* just a shorter name for the current buffer */
2045 YY_BUFFER_STATE b = yy_current_buffer;
2046
2047 int yy_c_buf_p_offset =
2048 (int) (yy_c_buf_p - b->yy_ch_buf);
2049
2050 if ( b->yy_is_our_buffer )
2051 {
2052 int new_size = b->yy_buf_size * 2;
2053
2054 if ( new_size <= 0 )
2055 b->yy_buf_size += b->yy_buf_size / 8;
2056 else
2057 b->yy_buf_size *= 2;
2058
2059 b->yy_ch_buf = (char *)
2060 /* Include room in for 2 EOB chars. */
2061 yy_flex_realloc( (void *) b->yy_ch_buf,
2062 b->yy_buf_size + 2 );
2063 }
2064 else
2065 /* Can't grow it, we don't own it. */
2066 b->yy_ch_buf = 0;
2067
2068 if ( ! b->yy_ch_buf )
2069 YY_FATAL_ERROR(
2070 "fatal error - scanner input buffer overflow" );
2071
2072 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2073
2074 num_to_read = yy_current_buffer->yy_buf_size -
2075 number_to_move - 1;
2076 #endif
2077 }
2078
2079 if ( num_to_read > YY_READ_BUF_SIZE )
2080 num_to_read = YY_READ_BUF_SIZE;
2081
2082 /* Read in more data. */
2083 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
2084 yy_n_chars, num_to_read );
2085
2086 yy_current_buffer->yy_n_chars = yy_n_chars;
2087 }
2088
2089 if ( yy_n_chars == 0 )
2090 {
2091 if ( number_to_move == YY_MORE_ADJ )
2092 {
2093 ret_val = EOB_ACT_END_OF_FILE;
2094 yyrestart( yyin );
2095 }
2096
2097 else
2098 {
2099 ret_val = EOB_ACT_LAST_MATCH;
2100 yy_current_buffer->yy_buffer_status =
2101 YY_BUFFER_EOF_PENDING;
2102 }
2103 }
2104
2105 else
2106 ret_val = EOB_ACT_CONTINUE_SCAN;
2107
2108 yy_n_chars += number_to_move;
2109 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2110 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2111
2112 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
2113
2114 return ret_val;
2115 }
2116
2117
2118 /* yy_get_previous_state - get the state just before the EOB char was reached */
2119
2120 static yy_state_type yy_get_previous_state()
2121 {
2122 register yy_state_type yy_current_state;
2123 register char *yy_cp;
2124
2125 yy_current_state = yy_start;
2126
2127 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
2128 {
2129 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2130 if ( yy_accept[yy_current_state] )
2131 {
2132 yy_last_accepting_state = yy_current_state;
2133 yy_last_accepting_cpos = yy_cp;
2134 }
2135 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2136 {
2137 yy_current_state = (int) yy_def[yy_current_state];
2138 if ( yy_current_state >= 361 )
2139 yy_c = yy_meta[(unsigned int) yy_c];
2140 }
2141 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2142 }
2143
2144 return yy_current_state;
2145 }
2146
2147
2148 /* yy_try_NUL_trans - try to make a transition on the NUL character
2149 *
2150 * synopsis
2151 * next_state = yy_try_NUL_trans( current_state );
2152 */
2153
2154 #ifdef YY_USE_PROTOS
2155 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
2156 #else
2157 static yy_state_type yy_try_NUL_trans( yy_current_state )
2158 yy_state_type yy_current_state;
2159 #endif
2160 {
2161 register int yy_is_jam;
2162 register char *yy_cp = yy_c_buf_p;
2163
2164 register YY_CHAR yy_c = 1;
2165 if ( yy_accept[yy_current_state] )
2166 {
2167 yy_last_accepting_state = yy_current_state;
2168 yy_last_accepting_cpos = yy_cp;
2169 }
2170 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2171 {
2172 yy_current_state = (int) yy_def[yy_current_state];
2173 if ( yy_current_state >= 361 )
2174 yy_c = yy_meta[(unsigned int) yy_c];
2175 }
2176 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2177 yy_is_jam = (yy_current_state == 360);
2178
2179 return yy_is_jam ? 0 : yy_current_state;
2180 }
2181
2182
2183 #ifndef YY_NO_UNPUT
2184 #ifdef YY_USE_PROTOS
2185 static void yyunput( int c, register char *yy_bp )
2186 #else
2187 static void yyunput( c, yy_bp )
2188 int c;
2189 register char *yy_bp;
2190 #endif
2191 {
2192 register char *yy_cp = yy_c_buf_p;
2193
2194 /* undo effects of setting up yytext */
2195 *yy_cp = yy_hold_char;
2196
2197 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2198 { /* need to shift things up to make room */
2199 /* +2 for EOB chars. */
2200 register int number_to_move = yy_n_chars + 2;
2201 register char *dest = &yy_current_buffer->yy_ch_buf[
2202 yy_current_buffer->yy_buf_size + 2];
2203 register char *source =
2204 &yy_current_buffer->yy_ch_buf[number_to_move];
2205
2206 while ( source > yy_current_buffer->yy_ch_buf )
2207 *--dest = *--source;
2208
2209 yy_cp += (int) (dest - source);
2210 yy_bp += (int) (dest - source);
2211 yy_current_buffer->yy_n_chars =
2212 yy_n_chars = yy_current_buffer->yy_buf_size;
2213
2214 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2215 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2216 }
2217
2218 *--yy_cp = (char) c;
2219
2220
2221 yytext_ptr = yy_bp;
2222 yy_hold_char = *yy_cp;
2223 yy_c_buf_p = yy_cp;
2224 }
2225 #endif /* ifndef YY_NO_UNPUT */
2226
2227
2228 #ifdef __cplusplus
2229 static int yyinput()
2230 #else
2231 static int input()
2232 #endif
2233 {
2234 int c;
2235
2236 *yy_c_buf_p = yy_hold_char;
2237
2238 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2239 {
2240 /* yy_c_buf_p now points to the character we want to return.
2241 * If this occurs *before* the EOB characters, then it's a
2242 * valid NUL; if not, then we've hit the end of the buffer.
2243 */
2244 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2245 /* This was really a NUL. */
2246 *yy_c_buf_p = '\0';
2247
2248 else
2249 { /* need more input */
2250 int offset = yy_c_buf_p - yytext_ptr;
2251 ++yy_c_buf_p;
2252
2253 switch ( yy_get_next_buffer() )
2254 {
2255 case EOB_ACT_LAST_MATCH:
2256 /* This happens because yy_g_n_b()
2257 * sees that we've accumulated a
2258 * token and flags that we need to
2259 * try matching the token before
2260 * proceeding. But for input(),
2261 * there's no matching to consider.
2262 * So convert the EOB_ACT_LAST_MATCH
2263 * to EOB_ACT_END_OF_FILE.
2264 */
2265
2266 /* Reset buffer status. */
2267 yyrestart( yyin );
2268
2269 /* fall through */
2270
2271 case EOB_ACT_END_OF_FILE:
2272 {
2273 if ( yywrap() )
2274 return EOF;
2275
2276 if ( ! yy_did_buffer_switch_on_eof )
2277 YY_NEW_FILE;
2278 #ifdef __cplusplus
2279 return yyinput();
2280 #else
2281 return input();
2282 #endif
2283 }
2284
2285 case EOB_ACT_CONTINUE_SCAN:
2286 yy_c_buf_p = yytext_ptr + offset;
2287 break;
2288 }
2289 }
2290 }
2291
2292 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
2293 *yy_c_buf_p = '\0'; /* preserve yytext */
2294 yy_hold_char = *++yy_c_buf_p;
2295
2296
2297 return c;
2298 }
2299
2300
2301 #ifdef YY_USE_PROTOS
2302 void yyrestart( FILE *input_file )
2303 #else
2304 void yyrestart( input_file )
2305 FILE *input_file;
2306 #endif
2307 {
2308 if ( ! yy_current_buffer )
2309 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2310
2311 yy_init_buffer( yy_current_buffer, input_file );
2312 yy_load_buffer_state();
2313 }
2314
2315
2316 #ifdef YY_USE_PROTOS
2317 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2318 #else
2319 void yy_switch_to_buffer( new_buffer )
2320 YY_BUFFER_STATE new_buffer;
2321 #endif
2322 {
2323 if ( yy_current_buffer == new_buffer )
2324 return;
2325
2326 if ( yy_current_buffer )
2327 {
2328 /* Flush out information for old buffer. */
2329 *yy_c_buf_p = yy_hold_char;
2330 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2331 yy_current_buffer->yy_n_chars = yy_n_chars;
2332 }
2333
2334 yy_current_buffer = new_buffer;
2335 yy_load_buffer_state();
2336
2337 /* We don't actually know whether we did this switch during
2338 * EOF (yywrap()) processing, but the only time this flag
2339 * is looked at is after yywrap() is called, so it's safe
2340 * to go ahead and always set it.
2341 */
2342 yy_did_buffer_switch_on_eof = 1;
2343 }
2344
2345
2346 #ifdef YY_USE_PROTOS
2347 void yy_load_buffer_state( void )
2348 #else
2349 void yy_load_buffer_state()
2350 #endif
2351 {
2352 yy_n_chars = yy_current_buffer->yy_n_chars;
2353 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2354 yyin = yy_current_buffer->yy_input_file;
2355 yy_hold_char = *yy_c_buf_p;
2356 }
2357
2358
2359 #ifdef YY_USE_PROTOS
2360 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2361 #else
2362 YY_BUFFER_STATE yy_create_buffer( file, size )
2363 FILE *file;
2364 int size;
2365 #endif
2366 {
2367 YY_BUFFER_STATE b;
2368
2369 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2370 if ( ! b )
2371 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2372
2373 b->yy_buf_size = size;
2374
2375 /* yy_ch_buf has to be 2 characters longer than the size given because
2376 * we need to put in 2 end-of-buffer characters.
2377 */
2378 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2379 if ( ! b->yy_ch_buf )
2380 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2381
2382 b->yy_is_our_buffer = 1;
2383
2384 yy_init_buffer( b, file );
2385
2386 return b;
2387 }
2388
2389
2390 #ifdef YY_USE_PROTOS
2391 void yy_delete_buffer( YY_BUFFER_STATE b )
2392 #else
2393 void yy_delete_buffer( b )
2394 YY_BUFFER_STATE b;
2395 #endif
2396 {
2397 if ( ! b )
2398 return;
2399
2400 if ( b == yy_current_buffer )
2401 yy_current_buffer = (YY_BUFFER_STATE) 0;
2402
2403 if ( b->yy_is_our_buffer )
2404 yy_flex_free( (void *) b->yy_ch_buf );
2405
2406 yy_flex_free( (void *) b );
2407 }
2408
2409
2410 #ifndef _WIN32
2411 #include <unistd.h>
2412 #else
2413 #ifndef YY_ALWAYS_INTERACTIVE
2414 #ifndef YY_NEVER_INTERACTIVE
2415 extern int isatty YY_PROTO(( int ));
2416 #endif
2417 #endif
2418 #endif
2419
2420 #ifdef YY_USE_PROTOS
2421 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2422 #else
2423 void yy_init_buffer( b, file )
2424 YY_BUFFER_STATE b;
2425 FILE *file;
2426 #endif
2427
2428
2429 {
2430 yy_flush_buffer( b );
2431
2432 b->yy_input_file = file;
2433 b->yy_fill_buffer = 1;
2434
2435 #if YY_ALWAYS_INTERACTIVE
2436 b->yy_is_interactive = 1;
2437 #else
2438 #if YY_NEVER_INTERACTIVE
2439 b->yy_is_interactive = 0;
2440 #else
2441 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2442 #endif
2443 #endif
2444 }
2445
2446
2447 #ifdef YY_USE_PROTOS
2448 void yy_flush_buffer( YY_BUFFER_STATE b )
2449 #else
2450 void yy_flush_buffer( b )
2451 YY_BUFFER_STATE b;
2452 #endif
2453
2454 {
2455 if ( ! b )
2456 return;
2457
2458 b->yy_n_chars = 0;
2459
2460 /* We always need two end-of-buffer characters. The first causes
2461 * a transition to the end-of-buffer state. The second causes
2462 * a jam in that state.
2463 */
2464 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2465 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2466
2467 b->yy_buf_pos = &b->yy_ch_buf[0];
2468
2469 b->yy_at_bol = 1;
2470 b->yy_buffer_status = YY_BUFFER_NEW;
2471
2472 if ( b == yy_current_buffer )
2473 yy_load_buffer_state();
2474 }
2475
2476
2477 #ifndef YY_NO_SCAN_BUFFER
2478 #ifdef YY_USE_PROTOS
2479 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2480 #else
2481 YY_BUFFER_STATE yy_scan_buffer( base, size )
2482 char *base;
2483 yy_size_t size;
2484 #endif
2485 {
2486 YY_BUFFER_STATE b;
2487
2488 if ( size < 2 ||
2489 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2490 base[size-1] != YY_END_OF_BUFFER_CHAR )
2491 /* They forgot to leave room for the EOB's. */
2492 return 0;
2493
2494 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2495 if ( ! b )
2496 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2497
2498 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2499 b->yy_buf_pos = b->yy_ch_buf = base;
2500 b->yy_is_our_buffer = 0;
2501 b->yy_input_file = 0;
2502 b->yy_n_chars = b->yy_buf_size;
2503 b->yy_is_interactive = 0;
2504 b->yy_at_bol = 1;
2505 b->yy_fill_buffer = 0;
2506 b->yy_buffer_status = YY_BUFFER_NEW;
2507
2508 yy_switch_to_buffer( b );
2509
2510 return b;
2511 }
2512 #endif
2513
2514
2515 #ifndef YY_NO_SCAN_STRING
2516 #ifdef YY_USE_PROTOS
2517 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2518 #else
2519 YY_BUFFER_STATE yy_scan_string( yy_str )
2520 yyconst char *yy_str;
2521 #endif
2522 {
2523 int len;
2524 for ( len = 0; yy_str[len]; ++len )
2525 ;
2526
2527 return yy_scan_bytes( yy_str, len );
2528 }
2529 #endif
2530
2531
2532 #ifndef YY_NO_SCAN_BYTES
2533 #ifdef YY_USE_PROTOS
2534 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2535 #else
2536 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2537 yyconst char *bytes;
2538 int len;
2539 #endif
2540 {
2541 YY_BUFFER_STATE b;
2542 char *buf;
2543 yy_size_t n;
2544 int i;
2545
2546 /* Get memory for full buffer, including space for trailing EOB's. */
2547 n = len + 2;
2548 buf = (char *) yy_flex_alloc( n );
2549 if ( ! buf )
2550 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2551
2552 for ( i = 0; i < len; ++i )
2553 buf[i] = bytes[i];
2554
2555 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2556
2557 b = yy_scan_buffer( buf, n );
2558 if ( ! b )
2559 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2560
2561 /* It's okay to grow etc. this buffer, and we should throw it
2562 * away when we're done.
2563 */
2564 b->yy_is_our_buffer = 1;
2565
2566 return b;
2567 }
2568 #endif
2569
2570
2571 #ifndef YY_NO_PUSH_STATE
2572 #ifdef YY_USE_PROTOS
2573 static void yy_push_state( int new_state )
2574 #else
2575 static void yy_push_state( new_state )
2576 int new_state;
2577 #endif
2578 {
2579 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2580 {
2581 yy_size_t new_size;
2582
2583 yy_start_stack_depth += YY_START_STACK_INCR;
2584 new_size = yy_start_stack_depth * sizeof( int );
2585
2586 if ( ! yy_start_stack )
2587 yy_start_stack = (int *) yy_flex_alloc( new_size );
2588
2589 else
2590 yy_start_stack = (int *) yy_flex_realloc(
2591 (void *) yy_start_stack, new_size );
2592
2593 if ( ! yy_start_stack )
2594 YY_FATAL_ERROR(
2595 "out of memory expanding start-condition stack" );
2596 }
2597
2598 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2599
2600 BEGIN(new_state);
2601 }
2602 #endif
2603
2604
2605 #ifndef YY_NO_POP_STATE
2606 static void yy_pop_state()
2607 {
2608 if ( --yy_start_stack_ptr < 0 )
2609 YY_FATAL_ERROR( "start-condition stack underflow" );
2610
2611 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2612 }
2613 #endif
2614
2615
2616 #ifndef YY_NO_TOP_STATE
2617 static int yy_top_state()
2618 {
2619 return yy_start_stack[yy_start_stack_ptr - 1];
2620 }
2621 #endif
2622
2623 #ifndef YY_EXIT_FAILURE
2624 #define YY_EXIT_FAILURE 2
2625 #endif
2626
2627 #ifdef YY_USE_PROTOS
2628 static void yy_fatal_error( yyconst char msg[] )
2629 #else
2630 static void yy_fatal_error( msg )
2631 char msg[];
2632 #endif
2633 {
2634 (void) fprintf( stderr, "%s\n", msg );
2635 exit( YY_EXIT_FAILURE );
2636 }
2637
2638
2639
2640 /* Redefine yyless() so it works in section 3 code. */
2641
2642 #undef yyless
2643 #define yyless(n) \
2644 do \
2645 { \
2646 /* Undo effects of setting up yytext. */ \
2647 yytext[yyleng] = yy_hold_char; \
2648 yy_c_buf_p = yytext + n; \
2649 yy_hold_char = *yy_c_buf_p; \
2650 *yy_c_buf_p = '\0'; \
2651 yyleng = n; \
2652 } \
2653 while ( 0 )
2654
2655
2656 /* Internal utility routines. */
2657
2658 #ifndef yytext_ptr
2659 #ifdef YY_USE_PROTOS
2660 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2661 #else
2662 static void yy_flex_strncpy( s1, s2, n )
2663 char *s1;
2664 yyconst char *s2;
2665 int n;
2666 #endif
2667 {
2668 register int i;
2669 for ( i = 0; i < n; ++i )
2670 s1[i] = s2[i];
2671 }
2672 #endif
2673
2674 #ifdef YY_NEED_STRLEN
2675 #ifdef YY_USE_PROTOS
2676 static int yy_flex_strlen( yyconst char *s )
2677 #else
2678 static int yy_flex_strlen( s )
2679 yyconst char *s;
2680 #endif
2681 {
2682 register int n;
2683 for ( n = 0; s[n]; ++n )
2684 ;
2685
2686 return n;
2687 }
2688 #endif
2689
2690
2691 #ifdef YY_USE_PROTOS
2692 static void *yy_flex_alloc( yy_size_t size )
2693 #else
2694 static void *yy_flex_alloc( size )
2695 yy_size_t size;
2696 #endif
2697 {
2698 return (void *) malloc( size );
2699 }
2700
2701 #ifdef YY_USE_PROTOS
2702 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2703 #else
2704 static void *yy_flex_realloc( ptr, size )
2705 void *ptr;
2706 yy_size_t size;
2707 #endif
2708 {
2709 /* The cast to (char *) in the following accommodates both
2710 * implementations that use char* generic pointers, and those
2711 * that use void* generic pointers. It works with the latter
2712 * because both ANSI C and C++ allow castless assignment from
2713 * any pointer type to void*, and deal with argument conversions
2714 * as though doing an assignment.
2715 */
2716 return (void *) realloc( (char *) ptr, size );
2717 }
2718
2719 #ifdef YY_USE_PROTOS
2720 static void yy_flex_free( void *ptr )
2721 #else
2722 static void yy_flex_free( ptr )
2723 void *ptr;
2724 #endif
2725 {
2726 free( ptr );
2727 }
2728
2729 #if YY_MAIN
2730 int main()
2731 {
2732 yylex();
2733 return 0;
2734 }
2735 #endif
2736 #line 525 "scan-gram.l"
2737
2738
2739 /*------------------------------------------------------------------.
2740 | TEXT is pointing to a wannabee semantic value (i.e., a `$'). |
2741 | |
2742 | Possible inputs: $[<TYPENAME>]($|integer) |
2743 | |
2744 | Output to the STRING_OBSTACK a reference to this semantic value. |
2745 `------------------------------------------------------------------*/
2746
2747 static inline void
2748 handle_action_dollar (char *text, location_t location)
2749 {
2750 const char *type_name = NULL;
2751 char *cp = text + 1;
2752
2753 /* Get the type name if explicit. */
2754 if (*cp == '<')
2755 {
2756 type_name = ++cp;
2757 while (*cp != '>')
2758 ++cp;
2759 *cp = '\0';
2760 ++cp;
2761 }
2762
2763 if (*cp == '$')
2764 {
2765 if (!type_name)
2766 type_name = symbol_list_n_type_name_get (current_rule, location, 0);
2767 if (!type_name && typed)
2768 complain_at (location, _("$$ of `%s' has no declared type"),
2769 symbol_tag_get (current_rule->sym));
2770 if (!type_name)
2771 type_name = "";
2772 obstack_fgrow1 (&string_obstack,
2773 "]b4_lhs_value([%s])[", type_name);
2774 }
2775 else if (isdigit (*cp) || *cp == '-')
2776 {
2777 /* RULE_LENGTH is the number of values in the current rule so
2778 far, which says where to find `$0' with respect to the top of
2779 the stack. It is not the same as the rule->length in the
2780 case of mid rule actions. */
2781 int rule_length = symbol_list_length (current_rule->next);
2782 int n = strtol (cp, &cp, 10);
2783
2784 if (n > rule_length)
2785 complain_at (location, _("invalid value: %s%d"), "$", n);
2786 else
2787 {
2788 if (!type_name && n > 0)
2789 type_name = symbol_list_n_type_name_get (current_rule, location,
2790 n);
2791 if (!type_name && typed)
2792 complain_at (location, _("$%d of `%s' has no declared type"),
2793 n, symbol_tag_get (current_rule->sym));
2794 if (!type_name)
2795 type_name = "";
2796 obstack_fgrow3 (&string_obstack,
2797 "]b4_rhs_value([%d], [%d], [%s])[",
2798 rule_length, n, type_name);
2799 }
2800 }
2801 else
2802 {
2803 complain_at (location, _("%s is invalid"), quote (text));
2804 }
2805 }
2806
2807
2808 /*---------------------------------------------------------------.
2809 | TEXT is expexted tp be $$ in some code associated to a symbol: |
2810 | destructor or printer. |
2811 `---------------------------------------------------------------*/
2812
2813 static inline void
2814 handle_symbol_code_dollar (char *text, location_t location)
2815 {
2816 char *cp = text + 1;
2817 if (*cp == '$')
2818 obstack_sgrow (&string_obstack, "]b4_dollar_dollar[");
2819 else
2820 complain_at (location, _("%s is invalid"), quote (text));
2821 }
2822
2823
2824 /*-----------------------------------------------------------------.
2825 | Dispatch onto handle_action_dollar, or handle_destructor_dollar, |
2826 | depending upon CODE_KIND. |
2827 `-----------------------------------------------------------------*/
2828
2829 static void
2830 handle_dollar (braced_code_t braced_code_kind,
2831 char *text, location_t location)
2832 {
2833 switch (braced_code_kind)
2834 {
2835 case action_braced_code:
2836 handle_action_dollar (text, location);
2837 break;
2838
2839 case destructor_braced_code:
2840 case printer_braced_code:
2841 handle_symbol_code_dollar (text, location);
2842 break;
2843 }
2844 }
2845
2846
2847 /*------------------------------------------------------.
2848 | TEXT is a location token (i.e., a `@...'). Output to |
2849 | STRING_OBSTACK a reference to this location. |
2850 `------------------------------------------------------*/
2851
2852 static inline void
2853 handle_action_at (char *text, location_t location)
2854 {
2855 char *cp = text + 1;
2856 locations_flag = 1;
2857
2858 if (*cp == '$')
2859 {
2860 obstack_sgrow (&string_obstack, "]b4_lhs_location[");
2861 }
2862 else if (isdigit (*cp) || *cp == '-')
2863 {
2864 /* RULE_LENGTH is the number of values in the current rule so
2865 far, which says where to find `$0' with respect to the top of
2866 the stack. It is not the same as the rule->length in the
2867 case of mid rule actions. */
2868 int rule_length = symbol_list_length (current_rule->next);
2869 int n = strtol (cp, &cp, 10);
2870
2871 if (n > rule_length)
2872 complain_at (location, _("invalid value: %s%d"), "@", n);
2873 else
2874 obstack_fgrow2 (&string_obstack, "]b4_rhs_location([%d], [%d])[",
2875 rule_length, n);
2876 }
2877 else
2878 {
2879 complain_at (location, _("%s is invalid"), quote (text));
2880 }
2881 }
2882
2883
2884 /*---------------------------------------------------------------.
2885 | TEXT is expexted tp be @$ in some code associated to a symbol: |
2886 | destructor or printer. |
2887 `---------------------------------------------------------------*/
2888
2889 static inline void
2890 handle_symbol_code_at (char *text, location_t location)
2891 {
2892 char *cp = text + 1;
2893 if (*cp == '$')
2894 obstack_sgrow (&string_obstack, "]b4_at_dollar[");
2895 else
2896 complain_at (location, _("%s is invalid"), quote (text));
2897 }
2898
2899
2900 /*-------------------------------------------------------------------.
2901 | Dispatch onto handle_action_at, or handle_destructor_at, depending |
2902 | upon CODE_KIND. |
2903 `-------------------------------------------------------------------*/
2904
2905 static void
2906 handle_at (braced_code_t braced_code_kind,
2907 char *text, location_t location)
2908 {
2909 switch (braced_code_kind)
2910 {
2911 case action_braced_code:
2912 handle_action_at (text, location);
2913 break;
2914
2915 case destructor_braced_code:
2916 case printer_braced_code:
2917 handle_symbol_code_at (text, location);
2918 break;
2919 }
2920 }
2921
2922
2923 /*-------------------------.
2924 | Initialize the scanner. |
2925 `-------------------------*/
2926
2927 void
2928 scanner_initialize (void)
2929 {
2930 obstack_init (&string_obstack);
2931 }
2932
2933
2934 /*-----------------------------------------------.
2935 | Free all the memory allocated to the scanner. |
2936 `-----------------------------------------------*/
2937
2938 void
2939 scanner_free (void)
2940 {
2941 obstack_free (&string_obstack, 0);
2942 }