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