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