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