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