1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
4 * $Header: /cvs/src/src/binutils/Attic/rclex.c,v 1.1.12.1 2004/04/09 19:32:15 drow Exp $
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
29 /* Use prototypes in function declarations. */
32 /* The "const" storage-class-modifier is valid. */
35 #else /* ! __cplusplus */
43 #endif /* ! __cplusplus */
62 #define YY_PROTO(proto) proto
64 #define YY_PROTO(proto) ()
68 /* Returned upon end-of-file. */
71 /* Promotes a possibly negative, possibly signed char to an unsigned
72 * integer for use as an array index. If the signed char is negative,
73 * we want to instead treat it as an 8-bit unsigned char, hence the
76 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
78 /* Enter a start condition. This macro really ought to take a parameter,
79 * but we do it the disgusting crufty way forced on us by the ()-less
80 * definition of BEGIN.
82 #define BEGIN yy_start = 1 + 2 *
84 /* Translate the current start state into a value that can be later handed
85 * to BEGIN to return to the state. The YYSTATE alias is for lex
88 #define YY_START ((yy_start - 1) / 2)
89 #define YYSTATE YY_START
91 /* Action number for EOF rule of a given start state. */
92 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
94 /* Special action meaning "start processing a new file". */
95 #define YY_NEW_FILE yyrestart( yyin )
97 #define YY_END_OF_BUFFER_CHAR 0
99 /* Size of default input buffer. */
100 #define YY_BUF_SIZE 16384
102 typedef struct yy_buffer_state *YY_BUFFER_STATE;
105 extern FILE *yyin, *yyout;
107 #define EOB_ACT_CONTINUE_SCAN 0
108 #define EOB_ACT_END_OF_FILE 1
109 #define EOB_ACT_LAST_MATCH 2
111 /* The funky do-while in the following #define is used to turn the definition
112 * int a single C statement (which needs a semi-colon terminator). This
113 * avoids problems with code like:
115 * if ( condition_holds )
118 * do_something_else();
120 * Prior to using the do-while the compiler would get upset at the
121 * "else" because it interpreted the "if" statement as being all
122 * done when it reached the ';' after the yyless() call.
125 /* Return all but the first 'n' matched characters back to the input stream. */
130 /* Undo effects of setting up yytext. */ \
131 *yy_cp = yy_hold_char; \
132 YY_RESTORE_YY_MORE_OFFSET \
133 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
134 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
138 #define unput(c) yyunput( c, yytext_ptr )
140 /* The following is because we cannot portably get our hands on size_t
141 * (without autoconf's help, which isn't available because we want
142 * flex-generated scanners to compile on their own).
144 typedef unsigned int yy_size_t;
147 struct yy_buffer_state
151 char *yy_ch_buf; /* input buffer */
152 char *yy_buf_pos; /* current position in input buffer */
154 /* Size of input buffer in bytes, not including room for EOB
157 yy_size_t yy_buf_size;
159 /* Number of characters read into yy_ch_buf, not including EOB
164 /* Whether we "own" the buffer - i.e., we know we created it,
165 * and can realloc() it to grow it, and should free() it to
168 int yy_is_our_buffer;
170 /* Whether this is an "interactive" input source; if so, and
171 * if we're using stdio for input, then we want to use getc()
172 * instead of fread(), to make sure we stop fetching input after
175 int yy_is_interactive;
177 /* Whether we're considered to be at the beginning of a line.
178 * If so, '^' rules will be active on the next match, otherwise
183 /* Whether to try to fill the input buffer when we reach the
188 int yy_buffer_status;
189 #define YY_BUFFER_NEW 0
190 #define YY_BUFFER_NORMAL 1
191 /* When an EOF's been seen but there's still some text to process
192 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
193 * shouldn't try reading from the input source any more. We might
194 * still have a bunch of tokens to match, though, because of
195 * possible backing-up.
197 * When we actually see the EOF, we change the status to "new"
198 * (via yyrestart()), so that the user can continue scanning by
199 * just pointing yyin at a new input file.
201 #define YY_BUFFER_EOF_PENDING 2
204 static YY_BUFFER_STATE yy_current_buffer = 0;
206 /* We provide macros for accessing buffer states in case in the
207 * future we want to put the buffer states in a more general
210 #define YY_CURRENT_BUFFER yy_current_buffer
213 /* yy_hold_char holds the character lost when yytext is formed. */
214 static char yy_hold_char;
216 static int yy_n_chars; /* number of characters read into yy_ch_buf */
221 /* Points to current character in buffer. */
222 static char *yy_c_buf_p = (char *) 0;
223 static int yy_init = 1; /* whether we need to initialize */
224 static int yy_start = 0; /* start state number */
226 /* Flag which is used to allow yywrap()'s to do buffer switches
227 * instead of setting up a fresh yyin. A bit of a hack ...
229 static int yy_did_buffer_switch_on_eof;
231 void yyrestart YY_PROTO(( FILE *input_file ));
233 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
234 void yy_load_buffer_state YY_PROTO(( void ));
235 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
236 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
237 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
238 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
239 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
241 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
242 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
243 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
245 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
246 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
247 static void yy_flex_free YY_PROTO(( void * ));
249 #define yy_new_buffer yy_create_buffer
251 #define yy_set_interactive(is_interactive) \
253 if ( ! yy_current_buffer ) \
254 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
255 yy_current_buffer->yy_is_interactive = is_interactive; \
258 #define yy_set_bol(at_bol) \
260 if ( ! yy_current_buffer ) \
261 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
262 yy_current_buffer->yy_at_bol = at_bol; \
265 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
267 typedef unsigned char YY_CHAR;
268 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
269 typedef int yy_state_type;
271 #define yytext_ptr yytext
273 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
274 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
275 static int yy_get_next_buffer YY_PROTO(( void ));
276 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
278 /* Done after the current pattern has been matched and before the
279 * corresponding action - sets up yytext.
281 #define YY_DO_BEFORE_ACTION \
282 yytext_ptr = yy_bp; \
283 yyleng = (int) (yy_cp - yy_bp); \
284 yy_hold_char = *yy_cp; \
288 #define YY_NUM_RULES 86
289 #define YY_END_OF_BUFFER 87
290 static yyconst short int yy_accept[470] =
292 0, 0, 87, 85, 84, 83, 85, 78, 80, 82,
293 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
294 82, 82, 82, 82, 82, 82, 82, 2, 4, 84,
295 0, 81, 78, 80, 79, 82, 82, 82, 82, 82,
296 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
297 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
298 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
299 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
300 82, 82, 82, 81, 0, 82, 11, 82, 82, 82,
301 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
303 82, 82, 82, 82, 82, 3, 82, 82, 82, 82,
304 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
305 82, 82, 82, 82, 82, 82, 76, 82, 82, 82,
306 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
307 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
308 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
309 82, 82, 82, 82, 82, 82, 82, 41, 82, 82,
310 82, 53, 42, 82, 82, 82, 82, 82, 82, 82,
311 46, 82, 82, 82, 82, 82, 82, 71, 82, 82,
312 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
314 82, 82, 82, 7, 82, 82, 82, 38, 1, 82,
315 82, 82, 82, 82, 18, 82, 82, 25, 82, 82,
316 82, 82, 82, 82, 82, 82, 82, 82, 82, 70,
317 82, 82, 39, 40, 82, 82, 82, 82, 82, 30,
318 82, 82, 82, 82, 82, 82, 50, 82, 82, 82,
319 82, 82, 34, 82, 82, 9, 82, 82, 19, 82,
320 68, 82, 82, 82, 82, 82, 82, 12, 0, 82,
321 82, 82, 82, 82, 82, 82, 13, 82, 14, 82,
322 82, 82, 82, 65, 82, 82, 82, 52, 82, 72,
323 82, 82, 82, 82, 82, 82, 47, 82, 82, 82,
325 82, 82, 82, 82, 82, 82, 58, 82, 82, 36,
326 82, 82, 82, 82, 82, 82, 82, 82, 0, 82,
327 0, 77, 17, 82, 82, 51, 82, 10, 82, 82,
328 82, 82, 16, 82, 82, 82, 82, 82, 82, 82,
329 29, 82, 82, 82, 82, 82, 82, 82, 73, 82,
330 31, 82, 82, 82, 82, 82, 82, 45, 6, 82,
331 82, 82, 82, 77, 82, 23, 24, 82, 15, 82,
332 27, 82, 82, 66, 82, 28, 54, 43, 82, 82,
333 82, 48, 82, 69, 8, 82, 82, 82, 82, 82,
334 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
336 64, 82, 82, 82, 82, 56, 82, 82, 82, 82,
337 35, 49, 82, 82, 82, 82, 20, 82, 82, 82,
338 82, 82, 82, 82, 82, 74, 82, 82, 82, 32,
339 82, 82, 37, 82, 82, 82, 82, 82, 82, 75,
340 82, 67, 61, 82, 82, 82, 33, 59, 60, 5,
341 21, 82, 82, 82, 82, 55, 57, 82, 82, 82,
342 26, 63, 82, 82, 82, 62, 22, 44, 0
345 static yyconst int yy_ec[256] =
347 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
348 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
351 1, 1, 1, 7, 1, 1, 1, 8, 8, 8,
352 9, 8, 8, 8, 8, 8, 8, 1, 1, 1,
353 1, 1, 1, 1, 10, 11, 12, 13, 14, 15,
354 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
355 19, 26, 27, 28, 29, 30, 19, 31, 32, 19,
356 1, 1, 1, 1, 1, 1, 33, 33, 33, 33,
358 33, 33, 19, 19, 19, 19, 19, 19, 19, 19,
359 19, 19, 19, 19, 19, 19, 19, 19, 19, 33,
360 19, 19, 34, 1, 35, 1, 1, 1, 1, 1,
361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
365 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
366 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
367 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
369 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
370 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
371 1, 1, 1, 1, 1, 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,
377 static yyconst int yy_meta[36] =
379 1, 2, 3, 2, 1, 4, 2, 5, 5, 5,
380 5, 5, 5, 5, 5, 1, 1, 1, 1, 1,
381 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 static yyconst short int yy_base[476] =
387 0, 0, 517, 518, 34, 518, 511, 0, 494, 25,
388 26, 45, 25, 28, 24, 488, 499, 49, 0, 40,
389 43, 488, 51, 66, 67, 484, 35, 518, 518, 81,
390 505, 84, 0, 488, 518, 0, 496, 479, 494, 477,
391 75, 476, 479, 477, 46, 491, 70, 486, 473, 483,
392 55, 479, 483, 468, 69, 471, 86, 84, 469, 479,
393 466, 480, 466, 461, 477, 472, 75, 455, 81, 459,
394 87, 77, 470, 469, 467, 454, 454, 460, 96, 463,
395 455, 449, 448, 110, 468, 458, 0, 453, 446, 451,
396 450, 445, 454, 437, 438, 451, 435, 450, 432, 428,
398 431, 432, 435, 443, 426, 0, 425, 438, 437, 422,
399 417, 419, 429, 421, 422, 426, 414, 430, 425, 412,
400 426, 407, 408, 409, 421, 411, 0, 404, 411, 418,
401 416, 412, 410, 417, 395, 401, 414, 408, 394, 403,
402 399, 393, 389, 390, 388, 394, 396, 105, 385, 389,
403 401, 390, 391, 398, 387, 379, 381, 378, 375, 378,
404 372, 376, 389, 370, 365, 105, 383, 0, 381, 369,
405 365, 0, 0, 364, 365, 362, 360, 377, 363, 358,
406 105, 375, 374, 353, 357, 357, 351, 0, 368, 354,
407 349, 348, 354, 348, 345, 358, 348, 356, 358, 354,
409 349, 346, 351, 0, 337, 346, 352, 0, 0, 336,
410 122, 336, 347, 107, 0, 347, 333, 0, 330, 328,
411 338, 327, 338, 330, 329, 322, 319, 315, 332, 0,
412 332, 333, 0, 0, 329, 324, 331, 316, 316, 0,
413 116, 307, 309, 320, 324, 320, 0, 323, 320, 110,
414 320, 320, 0, 308, 318, 0, 318, 310, 0, 296,
415 0, 300, 309, 296, 293, 306, 306, 0, 135, 139,
416 295, 289, 292, 302, 290, 292, 0, 295, 297, 297,
417 278, 294, 297, 0, 295, 280, 278, 0, 279, 0,
418 272, 285, 269, 287, 272, 283, 0, 282, 281, 273,
420 267, 279, 263, 259, 261, 259, 0, 276, 258, 0,
421 257, 256, 260, 250, 271, 270, 267, 260, 272, 145,
422 271, 151, 0, 261, 243, 0, 242, 0, 261, 240,
423 260, 241, 0, 252, 239, 252, 238, 233, 249, 248,
424 0, 251, 249, 249, 236, 229, 242, 227, 0, 224,
425 0, 225, 224, 241, 226, 239, 220, 229, 0, 218,
426 217, 224, 219, 237, 215, 0, 0, 211, 0, 228,
427 0, 211, 205, 0, 218, 0, 0, 0, 214, 208,
428 213, 0, 222, 0, 0, 217, 206, 201, 202, 201,
429 215, 201, 201, 199, 208, 210, 209, 201, 190, 196,
431 194, 190, 190, 192, 198, 0, 200, 184, 186, 184,
432 0, 0, 186, 183, 190, 178, 0, 179, 173, 174,
433 172, 185, 188, 183, 173, 0, 185, 173, 166, 0,
434 169, 177, 0, 166, 162, 157, 159, 158, 161, 0,
435 157, 0, 0, 162, 167, 158, 0, 0, 0, 0,
436 0, 143, 152, 143, 141, 0, 0, 130, 124, 124,
437 0, 0, 107, 85, 80, 0, 0, 0, 518, 158,
438 163, 65, 168, 173, 178
441 static yyconst short int yy_def[476] =
443 469, 1, 469, 469, 469, 469, 470, 471, 472, 473,
444 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
445 473, 473, 473, 473, 473, 473, 473, 469, 469, 469,
446 470, 469, 471, 472, 469, 473, 473, 473, 473, 473,
447 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
448 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
449 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
450 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
451 473, 473, 473, 469, 470, 473, 473, 473, 473, 473,
452 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
454 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
455 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
456 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
457 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
458 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
459 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
460 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
461 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
462 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
463 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
465 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
466 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
467 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
468 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
469 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
470 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
471 473, 473, 473, 473, 473, 473, 473, 473, 469, 474,
472 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
473 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
474 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
476 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
477 473, 473, 473, 473, 473, 473, 473, 473, 475, 474,
478 475, 474, 473, 473, 473, 473, 473, 473, 473, 473,
479 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
480 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
481 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
482 473, 473, 473, 475, 473, 473, 473, 473, 473, 473,
483 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
484 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
485 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
487 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
488 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
489 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
490 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
491 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
492 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
493 473, 473, 473, 473, 473, 473, 473, 473, 0, 469,
494 469, 469, 469, 469, 469
497 static yyconst short int yy_nxt[554] =
499 4, 5, 6, 5, 7, 8, 4, 9, 9, 10,
500 11, 12, 13, 14, 15, 16, 17, 18, 19, 19,
501 20, 21, 22, 19, 23, 24, 25, 19, 26, 27,
502 19, 19, 19, 28, 29, 30, 37, 30, 50, 41,
503 52, 55, 51, 42, 81, 38, 43, 56, 82, 63,
504 53, 39, 83, 40, 44, 95, 67, 64, 54, 96,
505 59, 45, 60, 65, 103, 46, 68, 66, 47, 34,
506 61, 62, 48, 49, 70, 73, 71, 74, 76, 72,
507 77, 104, 30, 78, 30, 84, 84, 90, 85, 108,
508 91, 98, 99, 75, 79, 111, 113, 123, 126, 109,
510 129, 124, 131, 132, 114, 139, 468, 467, 127, 112,
511 130, 84, 84, 205, 85, 241, 206, 273, 242, 225,
512 274, 140, 243, 269, 269, 295, 270, 141, 226, 466,
513 207, 227, 228, 304, 229, 465, 269, 269, 305, 319,
514 321, 296, 321, 322, 36, 321, 321, 464, 321, 322,
515 36, 321, 321, 463, 321, 322, 36, 321, 31, 31,
516 462, 31, 31, 33, 33, 461, 33, 33, 36, 460,
517 459, 36, 36, 320, 320, 458, 320, 320, 321, 321,
518 457, 456, 321, 455, 454, 453, 452, 451, 450, 449,
519 448, 447, 446, 445, 444, 443, 442, 441, 440, 439,
521 438, 437, 436, 435, 434, 433, 432, 431, 430, 429,
522 428, 427, 426, 425, 424, 423, 422, 421, 420, 419,
523 418, 417, 416, 415, 414, 413, 412, 411, 410, 409,
524 408, 407, 406, 405, 404, 403, 402, 401, 400, 399,
525 398, 364, 397, 396, 395, 394, 393, 392, 391, 390,
526 389, 388, 387, 386, 385, 384, 383, 382, 381, 380,
527 379, 378, 377, 376, 375, 374, 373, 372, 371, 370,
528 369, 368, 367, 366, 365, 364, 364, 363, 362, 361,
529 360, 359, 358, 357, 356, 355, 354, 353, 352, 351,
530 350, 349, 348, 347, 346, 345, 344, 343, 342, 341,
532 340, 339, 338, 337, 336, 335, 334, 333, 332, 331,
533 330, 329, 328, 327, 326, 325, 324, 323, 318, 317,
534 316, 315, 314, 313, 312, 311, 310, 309, 308, 307,
535 306, 303, 302, 301, 300, 299, 298, 297, 294, 293,
536 292, 291, 290, 289, 288, 287, 286, 285, 284, 283,
537 282, 281, 280, 279, 278, 277, 276, 275, 272, 271,
538 268, 267, 266, 265, 264, 263, 262, 261, 260, 259,
539 258, 257, 256, 255, 254, 253, 252, 251, 250, 249,
540 248, 247, 246, 245, 244, 240, 239, 238, 237, 236,
541 235, 234, 233, 232, 231, 230, 224, 223, 222, 221,
543 220, 219, 218, 217, 216, 215, 214, 213, 212, 211,
544 210, 209, 208, 204, 203, 202, 201, 200, 199, 198,
545 197, 196, 195, 194, 193, 192, 191, 190, 189, 188,
546 187, 186, 185, 184, 183, 182, 181, 180, 179, 178,
547 177, 176, 175, 174, 173, 172, 171, 170, 169, 168,
548 167, 166, 165, 164, 163, 162, 161, 160, 159, 158,
549 157, 156, 155, 154, 153, 152, 151, 150, 149, 148,
550 147, 146, 32, 145, 144, 143, 142, 138, 137, 136,
551 135, 134, 133, 128, 125, 122, 121, 120, 119, 118,
552 117, 116, 115, 110, 107, 106, 105, 102, 101, 100,
554 97, 94, 93, 92, 89, 88, 87, 86, 35, 32,
555 80, 69, 58, 57, 35, 32, 469, 3, 469, 469,
556 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
557 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
558 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
562 static yyconst short int yy_chk[554] =
564 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
565 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
566 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
567 1, 1, 1, 1, 1, 5, 10, 5, 13, 11,
568 14, 15, 13, 11, 27, 10, 11, 15, 27, 20,
569 14, 10, 27, 10, 12, 45, 21, 20, 14, 45,
570 18, 12, 18, 20, 51, 12, 21, 20, 12, 472,
571 18, 18, 12, 12, 23, 24, 23, 24, 25, 23,
572 25, 51, 30, 25, 30, 32, 32, 41, 32, 55,
573 41, 47, 47, 24, 25, 57, 58, 67, 69, 55,
575 71, 67, 72, 72, 58, 79, 465, 464, 69, 57,
576 71, 84, 84, 148, 84, 181, 148, 214, 181, 166,
577 214, 79, 181, 211, 211, 241, 211, 79, 166, 463,
578 148, 166, 166, 250, 166, 460, 269, 269, 250, 269,
579 270, 241, 270, 270, 270, 270, 320, 459, 320, 320,
580 320, 320, 322, 458, 322, 322, 322, 322, 470, 470,
581 455, 470, 470, 471, 471, 454, 471, 471, 473, 453,
582 452, 473, 473, 474, 474, 446, 474, 474, 475, 475,
583 445, 444, 475, 441, 439, 438, 437, 436, 435, 434,
584 432, 431, 429, 428, 427, 425, 424, 423, 422, 421,
586 420, 419, 418, 416, 415, 414, 413, 410, 409, 408,
587 407, 405, 404, 403, 402, 401, 400, 399, 398, 397,
588 396, 395, 394, 393, 392, 391, 390, 389, 388, 387,
589 386, 383, 381, 380, 379, 375, 373, 372, 370, 368,
590 365, 364, 363, 362, 361, 360, 358, 357, 356, 355,
591 354, 353, 352, 350, 348, 347, 346, 345, 344, 343,
592 342, 340, 339, 338, 337, 336, 335, 334, 332, 331,
593 330, 329, 327, 325, 324, 321, 319, 318, 317, 316,
594 315, 314, 313, 312, 311, 309, 308, 306, 305, 304,
595 303, 302, 301, 300, 299, 298, 296, 295, 294, 293,
597 292, 291, 289, 287, 286, 285, 283, 282, 281, 280,
598 279, 278, 276, 275, 274, 273, 272, 271, 267, 266,
599 265, 264, 263, 262, 260, 258, 257, 255, 254, 252,
600 251, 249, 248, 246, 245, 244, 243, 242, 239, 238,
601 237, 236, 235, 232, 231, 229, 228, 227, 226, 225,
602 224, 223, 222, 221, 220, 219, 217, 216, 213, 212,
603 210, 207, 206, 205, 203, 202, 201, 200, 199, 198,
604 197, 196, 195, 194, 193, 192, 191, 190, 189, 187,
605 186, 185, 184, 183, 182, 180, 179, 178, 177, 176,
606 175, 174, 171, 170, 169, 167, 165, 164, 163, 162,
608 161, 160, 159, 158, 157, 156, 155, 154, 153, 152,
609 151, 150, 149, 147, 146, 145, 144, 143, 142, 141,
610 140, 139, 138, 137, 136, 135, 134, 133, 132, 131,
611 130, 129, 128, 126, 125, 124, 123, 122, 121, 120,
612 119, 118, 117, 116, 115, 114, 113, 112, 111, 110,
613 109, 108, 107, 105, 104, 103, 102, 101, 100, 99,
614 98, 97, 96, 95, 94, 93, 92, 91, 90, 89,
615 88, 86, 85, 83, 82, 81, 80, 78, 77, 76,
616 75, 74, 73, 70, 68, 66, 65, 64, 63, 62,
617 61, 60, 59, 56, 54, 53, 52, 50, 49, 48,
619 46, 44, 43, 42, 40, 39, 38, 37, 34, 31,
620 26, 22, 17, 16, 9, 7, 3, 469, 469, 469,
621 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
622 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
623 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
627 static yy_state_type yy_last_accepting_state;
628 static char *yy_last_accepting_cpos;
630 /* The intent behind this definition is that it'll catch
631 * any uses of REJECT which flex missed.
633 #define REJECT reject_used_but_not_detected
634 #define yymore() yymore_used_but_not_detected
635 #define YY_MORE_ADJ 0
636 #define YY_RESTORE_YY_MORE_OFFSET
641 /* Copyright 1997, 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
642 Written by Ian Lance Taylor, Cygnus Support.
644 This file is part of GNU Binutils.
646 This program is free software; you can redistribute it and/or modify
647 it under the terms of the GNU General Public License as published by
648 the Free Software Foundation; either version 2 of the License, or
649 (at your option) any later version.
651 This program is distributed in the hope that it will be useful,
652 but WITHOUT ANY WARRANTY; without even the implied warranty of
653 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
654 GNU General Public License for more details.
656 You should have received a copy of the GNU General Public License
657 along with this program; if not, write to the Free Software
658 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
661 /* This is a lex input file which generates a lexer used by the
662 Windows rc file parser. It basically just recognized a bunch of
667 #include "libiberty.h"
668 #include "safe-ctype.h"
674 /* Whether we are in rcdata mode, in which we returns the lengths of
677 static int rcdata_mode;
679 /* Whether we are supressing lines from cpp (including windows.h or
680 headers from your C sources may bring in externs and typedefs).
681 When active, we return IGNORED_TOKEN, which lets us ignore these
682 outside of resource constructs. Thus, it isn't required to protect
683 all the non-preprocessor lines in your header files with #ifdef
684 RC_INVOKED. It also means your RC file can't include other RC
685 files if they're named "*.h". Sorry. Name them *.rch or whatever. */
687 static int suppress_cpp_data;
689 #define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x)
691 /* The first filename we detect in the cpp output. We use this to
692 tell included files from the original file. */
694 static char *initial_fn;
696 /* List of allocated strings. */
700 struct alloc_string *next;
704 static struct alloc_string *strings;
706 /* Local functions. */
708 static void cpp_line (const char *);
709 static char *handle_quotes (const char *, unsigned long *);
710 static char *get_string (int);
714 /* Macros after this point can all be overridden by user definitions in
718 #ifndef YY_SKIP_YYWRAP
720 extern "C" int yywrap YY_PROTO(( void ));
722 extern int yywrap YY_PROTO(( void ));
727 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
731 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
734 #ifdef YY_NEED_STRLEN
735 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
740 static int yyinput YY_PROTO(( void ));
742 static int input YY_PROTO(( void ));
747 static int yy_start_stack_ptr = 0;
748 static int yy_start_stack_depth = 0;
749 static int *yy_start_stack = 0;
750 #ifndef YY_NO_PUSH_STATE
751 static void yy_push_state YY_PROTO(( int new_state ));
753 #ifndef YY_NO_POP_STATE
754 static void yy_pop_state YY_PROTO(( void ));
756 #ifndef YY_NO_TOP_STATE
757 static int yy_top_state YY_PROTO(( void ));
761 #define YY_NO_PUSH_STATE 1
762 #define YY_NO_POP_STATE 1
763 #define YY_NO_TOP_STATE 1
766 #ifdef YY_MALLOC_DECL
774 /* Just try to get by without declaring the routines. This will fail
775 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
776 * or sizeof(void*) != sizeof(int).
781 /* Amount of stuff to slurp up with each read. */
782 #ifndef YY_READ_BUF_SIZE
783 #define YY_READ_BUF_SIZE 8192
786 /* Copy whatever the last rule matched to the standard output. */
789 /* This used to be an fputs(), but since the string might contain NUL's,
790 * we now use fwrite().
792 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
795 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
796 * is returned in "result".
799 #define YY_INPUT(buf,result,max_size) \
800 if ( yy_current_buffer->yy_is_interactive ) \
803 for ( n = 0; n < max_size && \
804 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
807 buf[n++] = (char) c; \
808 if ( c == EOF && ferror( yyin ) ) \
809 YY_FATAL_ERROR( "input in flex scanner failed" ); \
815 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
817 if( errno != EINTR) \
819 YY_FATAL_ERROR( "input in flex scanner failed" ); \
828 /* No semi-colon after return; correct usage is to write "yyterminate();" -
829 * we don't want an extra ';' after the "return" because that will cause
830 * some compilers to complain about unreachable statements.
833 #define yyterminate() return YY_NULL
836 /* Number of entries by which start-condition stack grows. */
837 #ifndef YY_START_STACK_INCR
838 #define YY_START_STACK_INCR 25
841 /* Report a fatal error. */
842 #ifndef YY_FATAL_ERROR
843 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
846 /* Default declaration of generated scanner - a define so the user can
847 * easily add parameters.
850 #define YY_DECL int yylex YY_PROTO(( void ))
853 /* Code executed at the beginning of each rule, after yytext and yyleng
856 #ifndef YY_USER_ACTION
857 #define YY_USER_ACTION
860 /* Code executed at the end of each rule. */
862 #define YY_BREAK break;
865 #define YY_RULE_SETUP \
870 register yy_state_type yy_current_state;
871 register char *yy_cp, *yy_bp;
888 yy_start = 1; /* first start state */
896 if ( ! yy_current_buffer )
898 yy_create_buffer( yyin, YY_BUF_SIZE );
900 yy_load_buffer_state();
903 while ( 1 ) /* loops until end-of-file is reached */
907 /* Support of yytext. */
908 *yy_cp = yy_hold_char;
910 /* yy_bp points to the position in yy_ch_buf of the start of
915 yy_current_state = yy_start;
919 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
920 if ( yy_accept[yy_current_state] )
922 yy_last_accepting_state = yy_current_state;
923 yy_last_accepting_cpos = yy_cp;
925 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
927 yy_current_state = (int) yy_def[yy_current_state];
928 if ( yy_current_state >= 470 )
929 yy_c = yy_meta[(unsigned int) yy_c];
931 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
934 while ( yy_base[yy_current_state] != 518 );
937 yy_act = yy_accept[yy_current_state];
939 { /* have to back up */
940 yy_cp = yy_last_accepting_cpos;
941 yy_current_state = yy_last_accepting_state;
942 yy_act = yy_accept[yy_current_state];
948 do_action: /* This label is used only to access EOF actions. */
952 { /* beginning of action switch */
953 case 0: /* must back up */
954 /* undo the effects of YY_DO_BEFORE_ACTION */
955 *yy_cp = yy_hold_char;
956 yy_cp = yy_last_accepting_cpos;
957 yy_current_state = yy_last_accepting_state;
963 { MAYBE_RETURN (BEG); }
968 { MAYBE_RETURN (BEG); }
973 { MAYBE_RETURN (END); }
978 { MAYBE_RETURN (END); }
983 { MAYBE_RETURN (ACCELERATORS); }
988 { MAYBE_RETURN (VIRTKEY); }
993 { MAYBE_RETURN (ASCII); }
998 { MAYBE_RETURN (NOINVERT); }
1003 { MAYBE_RETURN (SHIFT); }
1008 { MAYBE_RETURN (CONTROL); }
1013 { MAYBE_RETURN (ALT); }
1018 { MAYBE_RETURN (BITMAP); }
1023 { MAYBE_RETURN (CURSOR); }
1028 { MAYBE_RETURN (DIALOG); }
1033 { MAYBE_RETURN (DIALOGEX); }
1038 { MAYBE_RETURN (EXSTYLE); }
1043 { MAYBE_RETURN (CAPTION); }
1048 { MAYBE_RETURN (CLASS); }
1053 { MAYBE_RETURN (STYLE); }
1058 { MAYBE_RETURN (AUTO3STATE); }
1063 { MAYBE_RETURN (AUTOCHECKBOX); }
1068 { MAYBE_RETURN (AUTORADIOBUTTON); }
1073 { MAYBE_RETURN (CHECKBOX); }
1078 { MAYBE_RETURN (COMBOBOX); }
1083 { MAYBE_RETURN (CTEXT); }
1088 { MAYBE_RETURN (DEFPUSHBUTTON); }
1093 { MAYBE_RETURN (EDITTEXT); }
1098 { MAYBE_RETURN (GROUPBOX); }
1103 { MAYBE_RETURN (LISTBOX); }
1108 { MAYBE_RETURN (LTEXT); }
1113 { MAYBE_RETURN (PUSHBOX); }
1118 { MAYBE_RETURN (PUSHBUTTON); }
1123 { MAYBE_RETURN (RADIOBUTTON); }
1128 { MAYBE_RETURN (RTEXT); }
1133 { MAYBE_RETURN (SCROLLBAR); }
1138 { MAYBE_RETURN (STATE3); }
1143 { MAYBE_RETURN (USERBUTTON); }
1148 { MAYBE_RETURN (BEDIT); }
1153 { MAYBE_RETURN (HEDIT); }
1158 { MAYBE_RETURN (IEDIT); }
1163 { MAYBE_RETURN (FONT); }
1168 { MAYBE_RETURN (ICON); }
1173 { MAYBE_RETURN (LANGUAGE); }
1178 { MAYBE_RETURN (CHARACTERISTICS); }
1183 { MAYBE_RETURN (VERSIONK); }
1188 { MAYBE_RETURN (MENU); }
1193 { MAYBE_RETURN (MENUEX); }
1198 { MAYBE_RETURN (MENUITEM); }
1203 { MAYBE_RETURN (SEPARATOR); }
1208 { MAYBE_RETURN (POPUP); }
1213 { MAYBE_RETURN (CHECKED); }
1218 { MAYBE_RETURN (GRAYED); }
1223 { MAYBE_RETURN (HELP); }
1228 { MAYBE_RETURN (INACTIVE); }
1233 { MAYBE_RETURN (MENUBARBREAK); }
1238 { MAYBE_RETURN (MENUBREAK); }
1243 { MAYBE_RETURN (MESSAGETABLE); }
1248 { MAYBE_RETURN (RCDATA); }
1253 { MAYBE_RETURN (STRINGTABLE); }
1258 { MAYBE_RETURN (VERSIONINFO); }
1263 { MAYBE_RETURN (FILEVERSION); }
1268 { MAYBE_RETURN (PRODUCTVERSION); }
1273 { MAYBE_RETURN (FILEFLAGSMASK); }
1278 { MAYBE_RETURN (FILEFLAGS); }
1283 { MAYBE_RETURN (FILEOS); }
1288 { MAYBE_RETURN (FILETYPE); }
1293 { MAYBE_RETURN (FILESUBTYPE); }
1298 { MAYBE_RETURN (VALUE); }
1303 { MAYBE_RETURN (MOVEABLE); }
1308 { MAYBE_RETURN (FIXED); }
1313 { MAYBE_RETURN (PURE); }
1318 { MAYBE_RETURN (IMPURE); }
1323 { MAYBE_RETURN (PRELOAD); }
1328 { MAYBE_RETURN (LOADONCALL); }
1333 { MAYBE_RETURN (DISCARDABLE); }
1338 { MAYBE_RETURN (NOT); }
1346 /* This is a hack to let us parse version
1347 information easily. */
1349 s = strchr (yytext, '"');
1351 send = strchr (s, '"');
1352 if (strncmp (s, "StringFileInfo",
1353 sizeof "StringFileInfo" - 1) == 0
1354 && s + sizeof "StringFileInfo" - 1 == send)
1355 MAYBE_RETURN (BLOCKSTRINGFILEINFO);
1356 else if (strncmp (s, "VarFileInfo",
1357 sizeof "VarFileInfo" - 1) == 0
1358 && s + sizeof "VarFileInfo" - 1 == send)
1359 MAYBE_RETURN (BLOCKVARFILEINFO);
1364 r = get_string (send - s + 1);
1365 strncpy (r, s, send - s);
1368 MAYBE_RETURN (BLOCK);
1383 yylval.i.val = strtoul (yytext, 0, 0);
1385 MAYBE_RETURN (NUMBER);
1392 yylval.i.val = strtoul (yytext, 0, 0);
1394 MAYBE_RETURN (NUMBER);
1402 unsigned long length;
1404 s = handle_quotes (yytext, &length);
1408 MAYBE_RETURN (QUOTEDSTRING);
1412 yylval.ss.length = length;
1414 MAYBE_RETURN (SIZEDSTRING);
1424 /* I rejected comma in a string in order to
1425 handle VIRTKEY, CONTROL in an accelerator
1426 resource. This means that an unquoted
1427 file name can not contain a comma. I
1428 don't know what rc permits. */
1430 s = get_string (strlen (yytext) + 1);
1433 MAYBE_RETURN (STRING);
1444 { /* ignore whitespace */ }
1449 { MAYBE_RETURN (*yytext); }
1456 #line 1457 "lex.yy.c"
1457 case YY_STATE_EOF(INITIAL):
1460 case YY_END_OF_BUFFER:
1462 /* Amount of text matched not including the EOB char. */
1463 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1465 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1466 *yy_cp = yy_hold_char;
1467 YY_RESTORE_YY_MORE_OFFSET
1469 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1471 /* We're scanning a new file or input source. It's
1472 * possible that this happened because the user
1473 * just pointed yyin at a new source and called
1474 * yylex(). If so, then we have to assure
1475 * consistency between yy_current_buffer and our
1476 * globals. Here is the right place to do so, because
1477 * this is the first action (other than possibly a
1478 * back-up) that will match for the new input source.
1480 yy_n_chars = yy_current_buffer->yy_n_chars;
1481 yy_current_buffer->yy_input_file = yyin;
1482 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1485 /* Note that here we test for yy_c_buf_p "<=" to the position
1486 * of the first EOB in the buffer, since yy_c_buf_p will
1487 * already have been incremented past the NUL character
1488 * (since all states make transitions on EOB to the
1489 * end-of-buffer state). Contrast this with the test
1492 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1493 { /* This was really a NUL. */
1494 yy_state_type yy_next_state;
1496 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1498 yy_current_state = yy_get_previous_state();
1500 /* Okay, we're now positioned to make the NUL
1501 * transition. We couldn't have
1502 * yy_get_previous_state() go ahead and do it
1503 * for us because it doesn't know how to deal
1504 * with the possibility of jamming (and we don't
1505 * want to build jamming into it because then it
1506 * will run more slowly).
1509 yy_next_state = yy_try_NUL_trans( yy_current_state );
1511 yy_bp = yytext_ptr + YY_MORE_ADJ;
1513 if ( yy_next_state )
1515 /* Consume the NUL. */
1516 yy_cp = ++yy_c_buf_p;
1517 yy_current_state = yy_next_state;
1524 goto yy_find_action;
1528 else switch ( yy_get_next_buffer() )
1530 case EOB_ACT_END_OF_FILE:
1532 yy_did_buffer_switch_on_eof = 0;
1536 /* Note: because we've taken care in
1537 * yy_get_next_buffer() to have set up
1538 * yytext, we can now set up
1539 * yy_c_buf_p so that if some total
1540 * hoser (like flex itself) wants to
1541 * call the scanner after we return the
1542 * YY_NULL, it'll still work - another
1543 * YY_NULL will get returned.
1545 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1547 yy_act = YY_STATE_EOF(YY_START);
1553 if ( ! yy_did_buffer_switch_on_eof )
1559 case EOB_ACT_CONTINUE_SCAN:
1561 yytext_ptr + yy_amount_of_matched_text;
1563 yy_current_state = yy_get_previous_state();
1566 yy_bp = yytext_ptr + YY_MORE_ADJ;
1569 case EOB_ACT_LAST_MATCH:
1571 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1573 yy_current_state = yy_get_previous_state();
1576 yy_bp = yytext_ptr + YY_MORE_ADJ;
1577 goto yy_find_action;
1584 "fatal flex scanner internal error--no action found" );
1585 } /* end of action switch */
1586 } /* end of scanning one token */
1587 } /* end of yylex */
1590 /* yy_get_next_buffer - try to read in a new buffer
1592 * Returns a code representing an action:
1593 * EOB_ACT_LAST_MATCH -
1594 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1595 * EOB_ACT_END_OF_FILE - end of file
1598 static int yy_get_next_buffer()
1600 register char *dest = yy_current_buffer->yy_ch_buf;
1601 register char *source = yytext_ptr;
1602 register int number_to_move, i;
1605 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1607 "fatal flex scanner internal error--end of buffer missed" );
1609 if ( yy_current_buffer->yy_fill_buffer == 0 )
1610 { /* Don't try to fill the buffer, so this is an EOF. */
1611 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1613 /* We matched a single character, the EOB, so
1614 * treat this as a final EOF.
1616 return EOB_ACT_END_OF_FILE;
1621 /* We matched some text prior to the EOB, first
1624 return EOB_ACT_LAST_MATCH;
1628 /* Try to read more data. */
1630 /* First move last chars to start of buffer. */
1631 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1633 for ( i = 0; i < number_to_move; ++i )
1634 *(dest++) = *(source++);
1636 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1637 /* don't do the read, it's not guaranteed to return an EOF,
1640 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1645 yy_current_buffer->yy_buf_size - number_to_move - 1;
1647 while ( num_to_read <= 0 )
1648 { /* Not enough room in the buffer - grow it. */
1649 #ifdef YY_USES_REJECT
1651 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1654 /* just a shorter name for the current buffer */
1655 YY_BUFFER_STATE b = yy_current_buffer;
1657 int yy_c_buf_p_offset =
1658 (int) (yy_c_buf_p - b->yy_ch_buf);
1660 if ( b->yy_is_our_buffer )
1662 int new_size = b->yy_buf_size * 2;
1664 if ( new_size <= 0 )
1665 b->yy_buf_size += b->yy_buf_size / 8;
1667 b->yy_buf_size *= 2;
1669 b->yy_ch_buf = (char *)
1670 /* Include room in for 2 EOB chars. */
1671 yy_flex_realloc( (void *) b->yy_ch_buf,
1672 b->yy_buf_size + 2 );
1675 /* Can't grow it, we don't own it. */
1678 if ( ! b->yy_ch_buf )
1680 "fatal error - scanner input buffer overflow" );
1682 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1684 num_to_read = yy_current_buffer->yy_buf_size -
1689 if ( num_to_read > YY_READ_BUF_SIZE )
1690 num_to_read = YY_READ_BUF_SIZE;
1692 /* Read in more data. */
1693 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1694 yy_n_chars, num_to_read );
1696 yy_current_buffer->yy_n_chars = yy_n_chars;
1699 if ( yy_n_chars == 0 )
1701 if ( number_to_move == YY_MORE_ADJ )
1703 ret_val = EOB_ACT_END_OF_FILE;
1709 ret_val = EOB_ACT_LAST_MATCH;
1710 yy_current_buffer->yy_buffer_status =
1711 YY_BUFFER_EOF_PENDING;
1716 ret_val = EOB_ACT_CONTINUE_SCAN;
1718 yy_n_chars += number_to_move;
1719 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1720 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1722 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1728 /* yy_get_previous_state - get the state just before the EOB char was reached */
1730 static yy_state_type yy_get_previous_state()
1732 register yy_state_type yy_current_state;
1733 register char *yy_cp;
1735 yy_current_state = yy_start;
1737 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1739 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1740 if ( yy_accept[yy_current_state] )
1742 yy_last_accepting_state = yy_current_state;
1743 yy_last_accepting_cpos = yy_cp;
1745 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1747 yy_current_state = (int) yy_def[yy_current_state];
1748 if ( yy_current_state >= 470 )
1749 yy_c = yy_meta[(unsigned int) yy_c];
1751 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1754 return yy_current_state;
1758 /* yy_try_NUL_trans - try to make a transition on the NUL character
1761 * next_state = yy_try_NUL_trans( current_state );
1764 #ifdef YY_USE_PROTOS
1765 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1767 static yy_state_type yy_try_NUL_trans( yy_current_state )
1768 yy_state_type yy_current_state;
1771 register int yy_is_jam;
1772 register char *yy_cp = yy_c_buf_p;
1774 register YY_CHAR yy_c = 1;
1775 if ( yy_accept[yy_current_state] )
1777 yy_last_accepting_state = yy_current_state;
1778 yy_last_accepting_cpos = yy_cp;
1780 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1782 yy_current_state = (int) yy_def[yy_current_state];
1783 if ( yy_current_state >= 470 )
1784 yy_c = yy_meta[(unsigned int) yy_c];
1786 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1787 yy_is_jam = (yy_current_state == 469);
1789 return yy_is_jam ? 0 : yy_current_state;
1794 #ifdef YY_USE_PROTOS
1795 static void yyunput( int c, register char *yy_bp )
1797 static void yyunput( c, yy_bp )
1799 register char *yy_bp;
1802 register char *yy_cp = yy_c_buf_p;
1804 /* undo effects of setting up yytext */
1805 *yy_cp = yy_hold_char;
1807 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1808 { /* need to shift things up to make room */
1809 /* +2 for EOB chars. */
1810 register int number_to_move = yy_n_chars + 2;
1811 register char *dest = &yy_current_buffer->yy_ch_buf[
1812 yy_current_buffer->yy_buf_size + 2];
1813 register char *source =
1814 &yy_current_buffer->yy_ch_buf[number_to_move];
1816 while ( source > yy_current_buffer->yy_ch_buf )
1817 *--dest = *--source;
1819 yy_cp += (int) (dest - source);
1820 yy_bp += (int) (dest - source);
1821 yy_current_buffer->yy_n_chars =
1822 yy_n_chars = yy_current_buffer->yy_buf_size;
1824 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1825 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1828 *--yy_cp = (char) c;
1832 yy_hold_char = *yy_cp;
1835 #endif /* ifndef YY_NO_UNPUT */
1839 static int yyinput()
1846 *yy_c_buf_p = yy_hold_char;
1848 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1850 /* yy_c_buf_p now points to the character we want to return.
1851 * If this occurs *before* the EOB characters, then it's a
1852 * valid NUL; if not, then we've hit the end of the buffer.
1854 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1855 /* This was really a NUL. */
1859 { /* need more input */
1860 int offset = yy_c_buf_p - yytext_ptr;
1863 switch ( yy_get_next_buffer() )
1865 case EOB_ACT_LAST_MATCH:
1866 /* This happens because yy_g_n_b()
1867 * sees that we've accumulated a
1868 * token and flags that we need to
1869 * try matching the token before
1870 * proceeding. But for input(),
1871 * there's no matching to consider.
1872 * So convert the EOB_ACT_LAST_MATCH
1873 * to EOB_ACT_END_OF_FILE.
1876 /* Reset buffer status. */
1881 case EOB_ACT_END_OF_FILE:
1886 if ( ! yy_did_buffer_switch_on_eof )
1895 case EOB_ACT_CONTINUE_SCAN:
1896 yy_c_buf_p = yytext_ptr + offset;
1902 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1903 *yy_c_buf_p = '\0'; /* preserve yytext */
1904 yy_hold_char = *++yy_c_buf_p;
1911 #ifdef YY_USE_PROTOS
1912 void yyrestart( FILE *input_file )
1914 void yyrestart( input_file )
1918 if ( ! yy_current_buffer )
1919 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1921 yy_init_buffer( yy_current_buffer, input_file );
1922 yy_load_buffer_state();
1926 #ifdef YY_USE_PROTOS
1927 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1929 void yy_switch_to_buffer( new_buffer )
1930 YY_BUFFER_STATE new_buffer;
1933 if ( yy_current_buffer == new_buffer )
1936 if ( yy_current_buffer )
1938 /* Flush out information for old buffer. */
1939 *yy_c_buf_p = yy_hold_char;
1940 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1941 yy_current_buffer->yy_n_chars = yy_n_chars;
1944 yy_current_buffer = new_buffer;
1945 yy_load_buffer_state();
1947 /* We don't actually know whether we did this switch during
1948 * EOF (yywrap()) processing, but the only time this flag
1949 * is looked at is after yywrap() is called, so it's safe
1950 * to go ahead and always set it.
1952 yy_did_buffer_switch_on_eof = 1;
1956 #ifdef YY_USE_PROTOS
1957 void yy_load_buffer_state( void )
1959 void yy_load_buffer_state()
1962 yy_n_chars = yy_current_buffer->yy_n_chars;
1963 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1964 yyin = yy_current_buffer->yy_input_file;
1965 yy_hold_char = *yy_c_buf_p;
1969 #ifdef YY_USE_PROTOS
1970 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1972 YY_BUFFER_STATE yy_create_buffer( file, size )
1979 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1981 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1983 b->yy_buf_size = size;
1985 /* yy_ch_buf has to be 2 characters longer than the size given because
1986 * we need to put in 2 end-of-buffer characters.
1988 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1989 if ( ! b->yy_ch_buf )
1990 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1992 b->yy_is_our_buffer = 1;
1994 yy_init_buffer( b, file );
2000 #ifdef YY_USE_PROTOS
2001 void yy_delete_buffer( YY_BUFFER_STATE b )
2003 void yy_delete_buffer( b )
2010 if ( b == yy_current_buffer )
2011 yy_current_buffer = (YY_BUFFER_STATE) 0;
2013 if ( b->yy_is_our_buffer )
2014 yy_flex_free( (void *) b->yy_ch_buf );
2016 yy_flex_free( (void *) b );
2023 #ifndef YY_ALWAYS_INTERACTIVE
2024 #ifndef YY_NEVER_INTERACTIVE
2025 extern int isatty YY_PROTO(( int ));
2030 #ifdef YY_USE_PROTOS
2031 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2033 void yy_init_buffer( b, file )
2040 yy_flush_buffer( b );
2042 b->yy_input_file = file;
2043 b->yy_fill_buffer = 1;
2045 #if YY_ALWAYS_INTERACTIVE
2046 b->yy_is_interactive = 1;
2048 #if YY_NEVER_INTERACTIVE
2049 b->yy_is_interactive = 0;
2051 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2057 #ifdef YY_USE_PROTOS
2058 void yy_flush_buffer( YY_BUFFER_STATE b )
2060 void yy_flush_buffer( b )
2070 /* We always need two end-of-buffer characters. The first causes
2071 * a transition to the end-of-buffer state. The second causes
2072 * a jam in that state.
2074 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2075 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2077 b->yy_buf_pos = &b->yy_ch_buf[0];
2080 b->yy_buffer_status = YY_BUFFER_NEW;
2082 if ( b == yy_current_buffer )
2083 yy_load_buffer_state();
2087 #ifndef YY_NO_SCAN_BUFFER
2088 #ifdef YY_USE_PROTOS
2089 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2091 YY_BUFFER_STATE yy_scan_buffer( base, size )
2099 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2100 base[size-1] != YY_END_OF_BUFFER_CHAR )
2101 /* They forgot to leave room for the EOB's. */
2104 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2106 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2108 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2109 b->yy_buf_pos = b->yy_ch_buf = base;
2110 b->yy_is_our_buffer = 0;
2111 b->yy_input_file = 0;
2112 b->yy_n_chars = b->yy_buf_size;
2113 b->yy_is_interactive = 0;
2115 b->yy_fill_buffer = 0;
2116 b->yy_buffer_status = YY_BUFFER_NEW;
2118 yy_switch_to_buffer( b );
2125 #ifndef YY_NO_SCAN_STRING
2126 #ifdef YY_USE_PROTOS
2127 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2129 YY_BUFFER_STATE yy_scan_string( yy_str )
2130 yyconst char *yy_str;
2134 for ( len = 0; yy_str[len]; ++len )
2137 return yy_scan_bytes( yy_str, len );
2142 #ifndef YY_NO_SCAN_BYTES
2143 #ifdef YY_USE_PROTOS
2144 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2146 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2147 yyconst char *bytes;
2156 /* Get memory for full buffer, including space for trailing EOB's. */
2158 buf = (char *) yy_flex_alloc( n );
2160 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2162 for ( i = 0; i < len; ++i )
2165 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2167 b = yy_scan_buffer( buf, n );
2169 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2171 /* It's okay to grow etc. this buffer, and we should throw it
2172 * away when we're done.
2174 b->yy_is_our_buffer = 1;
2181 #ifndef YY_NO_PUSH_STATE
2182 #ifdef YY_USE_PROTOS
2183 static void yy_push_state( int new_state )
2185 static void yy_push_state( new_state )
2189 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2193 yy_start_stack_depth += YY_START_STACK_INCR;
2194 new_size = yy_start_stack_depth * sizeof( int );
2196 if ( ! yy_start_stack )
2197 yy_start_stack = (int *) yy_flex_alloc( new_size );
2200 yy_start_stack = (int *) yy_flex_realloc(
2201 (void *) yy_start_stack, new_size );
2203 if ( ! yy_start_stack )
2205 "out of memory expanding start-condition stack" );
2208 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2215 #ifndef YY_NO_POP_STATE
2216 static void yy_pop_state()
2218 if ( --yy_start_stack_ptr < 0 )
2219 YY_FATAL_ERROR( "start-condition stack underflow" );
2221 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2226 #ifndef YY_NO_TOP_STATE
2227 static int yy_top_state()
2229 return yy_start_stack[yy_start_stack_ptr - 1];
2233 #ifndef YY_EXIT_FAILURE
2234 #define YY_EXIT_FAILURE 2
2237 #ifdef YY_USE_PROTOS
2238 static void yy_fatal_error( yyconst char msg[] )
2240 static void yy_fatal_error( msg )
2244 (void) fprintf( stderr, "%s\n", msg );
2245 exit( YY_EXIT_FAILURE );
2250 /* Redefine yyless() so it works in section 3 code. */
2256 /* Undo effects of setting up yytext. */ \
2257 yytext[yyleng] = yy_hold_char; \
2258 yy_c_buf_p = yytext + n; \
2259 yy_hold_char = *yy_c_buf_p; \
2260 *yy_c_buf_p = '\0'; \
2266 /* Internal utility routines. */
2269 #ifdef YY_USE_PROTOS
2270 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2272 static void yy_flex_strncpy( s1, s2, n )
2279 for ( i = 0; i < n; ++i )
2284 #ifdef YY_NEED_STRLEN
2285 #ifdef YY_USE_PROTOS
2286 static int yy_flex_strlen( yyconst char *s )
2288 static int yy_flex_strlen( s )
2293 for ( n = 0; s[n]; ++n )
2301 #ifdef YY_USE_PROTOS
2302 static void *yy_flex_alloc( yy_size_t size )
2304 static void *yy_flex_alloc( size )
2308 return (void *) malloc( size );
2311 #ifdef YY_USE_PROTOS
2312 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2314 static void *yy_flex_realloc( ptr, size )
2319 /* The cast to (char *) in the following accommodates both
2320 * implementations that use char* generic pointers, and those
2321 * that use void* generic pointers. It works with the latter
2322 * because both ANSI C and C++ allow castless assignment from
2323 * any pointer type to void*, and deal with argument conversions
2324 * as though doing an assignment.
2326 return (void *) realloc( (char *) ptr, size );
2329 #ifdef YY_USE_PROTOS
2330 static void yy_flex_free( void *ptr )
2332 static void yy_flex_free( ptr )
2349 /* This is needed for some versions of lex. */
2356 /* Handle a C preprocessor line. */
2359 cpp_line (const char *s)
2365 while (ISSPACE (*s))
2368 line = strtol (s, &send, 0);
2369 if (*send != '\0' && ! ISSPACE (*send))
2372 /* Subtract 1 because we are about to count the newline. */
2373 rc_lineno = line - 1;
2376 while (ISSPACE (*s))
2383 send = strchr (s, '"');
2387 fn = (char *) xmalloc (send - s + 1);
2388 strncpy (fn, s, send - s);
2389 fn[send - s] = '\0';
2396 initial_fn = xmalloc (strlen (fn) + 1);
2397 strcpy (initial_fn, fn);
2400 /* Allow the initial file, regardless of name. Suppress all other
2401 files if they end in ".h" (this allows included "*.rc"). */
2402 if (strcmp (initial_fn, fn) == 0
2403 || strcmp (fn + strlen (fn) - 2, ".h") != 0)
2404 suppress_cpp_data = 0;
2406 suppress_cpp_data = 1;
2409 /* Handle a quoted string. The quotes are stripped. A pair of quotes
2410 in a string are turned into a single quote. Adjacent strings are
2411 merged separated by whitespace are merged, as in C. */
2414 handle_quotes (const char *input, unsigned long *len)
2420 ret = get_string (strlen (input) + 1);
2434 rcparse_warning ("backslash at end of string");
2438 rcparse_warning ("use \"\" to put \" in a string");
2442 *s++ = ESCAPE_B; /* Strange, but true... */
2480 case '0': case '1': case '2': case '3':
2481 case '4': case '5': case '6': case '7':
2484 if (*t >= '0' && *t <= '7')
2486 ch = (ch << 3) | (*t - '0');
2488 if (*t >= '0' && *t <= '7')
2490 ch = (ch << 3) | (*t - '0');
2502 if (*t >= '0' && *t <= '9')
2503 ch = (ch << 4) | (*t - '0');
2504 else if (*t >= 'a' && *t <= 'f')
2505 ch = (ch << 4) | (*t - 'a' + 10);
2506 else if (*t >= 'A' && *t <= 'F')
2507 ch = (ch << 4) | (*t - 'A' + 10);
2516 rcparse_warning ("unrecognized escape sequence");
2524 else if (t[1] == '\0')
2526 else if (t[1] == '"')
2534 assert (ISSPACE (*t));
2535 while (ISSPACE (*t))
2555 /* Allocate a string of a given length. */
2558 get_string (int len)
2560 struct alloc_string *as;
2562 as = (struct alloc_string *) xmalloc (sizeof *as);
2563 as->s = xmalloc (len);
2571 /* Discard all the strings we have allocated. The parser calls this
2572 when it no longer needs them. */
2575 rcparse_discard_strings (void)
2577 struct alloc_string *as;
2582 struct alloc_string *n;
2593 /* Enter rcdata mode. */
2596 rcparse_rcdata (void)
2601 /* Go back to normal mode from rcdata mode. */
2604 rcparse_normal (void)