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