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