1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
4 * $Header: /cvs/src/src/binutils/Attic/rclex.c,v 1.1.6.2 2002/05/11 20:00:49 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" */
28 #ifndef YY_ALWAYS_INTERACTIVE
29 #ifndef YY_NEVER_INTERACTIVE
30 extern int isatty YY_PROTO(( int ));
35 /* Use prototypes in function declarations. */
38 /* The "const" storage-class-modifier is valid. */
41 #else /* ! __cplusplus */
49 #endif /* ! __cplusplus */
68 #define YY_PROTO(proto) proto
70 #define YY_PROTO(proto) ()
73 /* Returned upon end-of-file. */
76 /* Promotes a possibly negative, possibly signed char to an unsigned
77 * integer for use as an array index. If the signed char is negative,
78 * we want to instead treat it as an 8-bit unsigned char, hence the
81 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
83 /* Enter a start condition. This macro really ought to take a parameter,
84 * but we do it the disgusting crufty way forced on us by the ()-less
85 * definition of BEGIN.
87 #define BEGIN yy_start = 1 + 2 *
89 /* Translate the current start state into a value that can be later handed
90 * to BEGIN to return to the state. The YYSTATE alias is for lex
93 #define YY_START ((yy_start - 1) / 2)
94 #define YYSTATE YY_START
96 /* Action number for EOF rule of a given start state. */
97 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
99 /* Special action meaning "start processing a new file". */
100 #define YY_NEW_FILE yyrestart( yyin )
102 #define YY_END_OF_BUFFER_CHAR 0
104 /* Size of default input buffer. */
105 #define YY_BUF_SIZE 16384
107 typedef struct yy_buffer_state *YY_BUFFER_STATE;
110 extern FILE *yyin, *yyout;
112 #define EOB_ACT_CONTINUE_SCAN 0
113 #define EOB_ACT_END_OF_FILE 1
114 #define EOB_ACT_LAST_MATCH 2
116 /* The funky do-while in the following #define is used to turn the definition
117 * int a single C statement (which needs a semi-colon terminator). This
118 * avoids problems with code like:
120 * if ( condition_holds )
123 * do_something_else();
125 * Prior to using the do-while the compiler would get upset at the
126 * "else" because it interpreted the "if" statement as being all
127 * done when it reached the ';' after the yyless() call.
130 /* Return all but the first 'n' matched characters back to the input stream. */
135 /* Undo effects of setting up yytext. */ \
136 *yy_cp = yy_hold_char; \
137 YY_RESTORE_YY_MORE_OFFSET \
138 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
139 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
143 #define unput(c) yyunput( c, yytext_ptr )
145 /* The following is because we cannot portably get our hands on size_t
146 * (without autoconf's help, which isn't available because we want
147 * flex-generated scanners to compile on their own).
149 typedef unsigned int yy_size_t;
152 struct yy_buffer_state
156 char *yy_ch_buf; /* input buffer */
157 char *yy_buf_pos; /* current position in input buffer */
159 /* Size of input buffer in bytes, not including room for EOB
162 yy_size_t yy_buf_size;
164 /* Number of characters read into yy_ch_buf, not including EOB
169 /* Whether we "own" the buffer - i.e., we know we created it,
170 * and can realloc() it to grow it, and should free() it to
173 int yy_is_our_buffer;
175 /* Whether this is an "interactive" input source; if so, and
176 * if we're using stdio for input, then we want to use getc()
177 * instead of fread(), to make sure we stop fetching input after
180 int yy_is_interactive;
182 /* Whether we're considered to be at the beginning of a line.
183 * If so, '^' rules will be active on the next match, otherwise
188 /* Whether to try to fill the input buffer when we reach the
193 int yy_buffer_status;
194 #define YY_BUFFER_NEW 0
195 #define YY_BUFFER_NORMAL 1
196 /* When an EOF's been seen but there's still some text to process
197 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
198 * shouldn't try reading from the input source any more. We might
199 * still have a bunch of tokens to match, though, because of
200 * possible backing-up.
202 * When we actually see the EOF, we change the status to "new"
203 * (via yyrestart()), so that the user can continue scanning by
204 * just pointing yyin at a new input file.
206 #define YY_BUFFER_EOF_PENDING 2
209 static YY_BUFFER_STATE yy_current_buffer = 0;
211 /* We provide macros for accessing buffer states in case in the
212 * future we want to put the buffer states in a more general
215 #define YY_CURRENT_BUFFER yy_current_buffer
218 /* yy_hold_char holds the character lost when yytext is formed. */
219 static char yy_hold_char;
221 static int yy_n_chars; /* number of characters read into yy_ch_buf */
226 /* Points to current character in buffer. */
227 static char *yy_c_buf_p = (char *) 0;
228 static int yy_init = 1; /* whether we need to initialize */
229 static int yy_start = 0; /* start state number */
231 /* Flag which is used to allow yywrap()'s to do buffer switches
232 * instead of setting up a fresh yyin. A bit of a hack ...
234 static int yy_did_buffer_switch_on_eof;
236 void yyrestart YY_PROTO(( FILE *input_file ));
238 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
239 void yy_load_buffer_state YY_PROTO(( void ));
240 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
241 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
242 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
243 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
244 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
246 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
247 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
248 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
250 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
251 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
252 static void yy_flex_free YY_PROTO(( void * ));
254 #define yy_new_buffer yy_create_buffer
256 #define yy_set_interactive(is_interactive) \
258 if ( ! yy_current_buffer ) \
259 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
260 yy_current_buffer->yy_is_interactive = is_interactive; \
263 #define yy_set_bol(at_bol) \
265 if ( ! yy_current_buffer ) \
266 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
267 yy_current_buffer->yy_at_bol = at_bol; \
270 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
272 typedef unsigned char YY_CHAR;
273 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
274 typedef int yy_state_type;
276 #define yytext_ptr yytext
278 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
279 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
280 static int yy_get_next_buffer YY_PROTO(( void ));
281 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
283 /* Done after the current pattern has been matched and before the
284 * corresponding action - sets up yytext.
286 #define YY_DO_BEFORE_ACTION \
287 yytext_ptr = yy_bp; \
288 yyleng = (int) (yy_cp - yy_bp); \
289 yy_hold_char = *yy_cp; \
293 #define YY_NUM_RULES 86
294 #define YY_END_OF_BUFFER 87
295 static yyconst short int yy_accept[470] =
297 0, 0, 87, 85, 84, 83, 85, 78, 80, 82,
298 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
299 82, 82, 82, 82, 82, 82, 82, 2, 4, 84,
300 0, 81, 78, 80, 79, 82, 82, 82, 82, 82,
301 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
302 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
303 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
304 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
305 82, 82, 82, 81, 0, 82, 11, 82, 82, 82,
306 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
308 82, 82, 82, 82, 82, 3, 82, 82, 82, 82,
309 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
310 82, 82, 82, 82, 82, 82, 76, 82, 82, 82,
311 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
312 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
313 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
314 82, 82, 82, 82, 82, 82, 82, 41, 82, 82,
315 82, 53, 42, 82, 82, 82, 82, 82, 82, 82,
316 46, 82, 82, 82, 82, 82, 82, 71, 82, 82,
317 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
319 82, 82, 82, 7, 82, 82, 82, 38, 1, 82,
320 82, 82, 82, 82, 18, 82, 82, 25, 82, 82,
321 82, 82, 82, 82, 82, 82, 82, 82, 82, 70,
322 82, 82, 39, 40, 82, 82, 82, 82, 82, 30,
323 82, 82, 82, 82, 82, 82, 50, 82, 82, 82,
324 82, 82, 34, 82, 82, 9, 82, 82, 19, 82,
325 68, 82, 82, 82, 82, 82, 82, 12, 0, 82,
326 82, 82, 82, 82, 82, 82, 13, 82, 14, 82,
327 82, 82, 82, 65, 82, 82, 82, 52, 82, 72,
328 82, 82, 82, 82, 82, 82, 47, 82, 82, 82,
330 82, 82, 82, 82, 82, 82, 58, 82, 82, 36,
331 82, 82, 82, 82, 82, 82, 82, 82, 0, 82,
332 0, 77, 17, 82, 82, 51, 82, 10, 82, 82,
333 82, 82, 16, 82, 82, 82, 82, 82, 82, 82,
334 29, 82, 82, 82, 82, 82, 82, 82, 73, 82,
335 31, 82, 82, 82, 82, 82, 82, 45, 6, 82,
336 82, 82, 82, 77, 82, 23, 24, 82, 15, 82,
337 27, 82, 82, 66, 82, 28, 54, 43, 82, 82,
338 82, 48, 82, 69, 8, 82, 82, 82, 82, 82,
339 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
341 64, 82, 82, 82, 82, 56, 82, 82, 82, 82,
342 35, 49, 82, 82, 82, 82, 20, 82, 82, 82,
343 82, 82, 82, 82, 82, 74, 82, 82, 82, 32,
344 82, 82, 37, 82, 82, 82, 82, 82, 82, 75,
345 82, 67, 61, 82, 82, 82, 33, 59, 60, 5,
346 21, 82, 82, 82, 82, 55, 57, 82, 82, 82,
347 26, 63, 82, 82, 82, 62, 22, 44, 0
350 static yyconst int yy_ec[256] =
352 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
353 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
355 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
356 1, 1, 1, 7, 1, 1, 1, 8, 8, 8,
357 9, 8, 8, 8, 8, 8, 8, 1, 1, 1,
358 1, 1, 1, 1, 10, 11, 12, 13, 14, 15,
359 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
360 19, 26, 27, 28, 29, 30, 19, 31, 32, 19,
361 1, 1, 1, 1, 1, 1, 33, 33, 33, 33,
363 33, 33, 19, 19, 19, 19, 19, 19, 19, 19,
364 19, 19, 19, 19, 19, 19, 19, 19, 19, 33,
365 19, 19, 34, 1, 35, 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,
368 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,
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
382 static yyconst int yy_meta[36] =
384 1, 2, 3, 2, 1, 4, 2, 5, 5, 5,
385 5, 5, 5, 5, 5, 1, 1, 1, 1, 1,
386 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 static yyconst short int yy_base[476] =
392 0, 0, 515, 516, 34, 516, 509, 0, 492, 25,
393 26, 45, 25, 28, 24, 486, 497, 49, 0, 40,
394 43, 486, 51, 66, 67, 482, 35, 516, 516, 81,
395 503, 84, 0, 486, 516, 0, 494, 477, 492, 475,
396 74, 474, 477, 475, 46, 489, 69, 484, 471, 481,
397 55, 477, 481, 466, 67, 469, 83, 83, 467, 477,
398 464, 478, 464, 459, 475, 470, 74, 453, 81, 457,
399 86, 76, 468, 467, 465, 452, 452, 458, 95, 461,
400 453, 447, 446, 106, 466, 456, 0, 451, 444, 449,
401 448, 443, 452, 435, 436, 449, 433, 448, 430, 426,
403 429, 430, 433, 441, 424, 0, 423, 436, 435, 420,
404 415, 417, 427, 419, 420, 424, 412, 428, 423, 410,
405 424, 405, 406, 407, 419, 409, 0, 402, 409, 416,
406 414, 410, 408, 415, 393, 399, 412, 406, 392, 401,
407 397, 391, 387, 388, 386, 392, 394, 103, 383, 387,
408 399, 388, 389, 396, 385, 377, 379, 376, 373, 376,
409 370, 374, 387, 368, 363, 98, 381, 0, 379, 367,
410 363, 0, 0, 362, 363, 360, 358, 375, 361, 356,
411 105, 373, 372, 351, 355, 355, 349, 0, 366, 352,
412 347, 346, 352, 346, 343, 356, 346, 354, 356, 352,
414 347, 344, 349, 0, 335, 344, 350, 0, 0, 334,
415 115, 334, 345, 119, 0, 345, 331, 0, 328, 326,
416 336, 325, 336, 328, 327, 320, 317, 313, 330, 0,
417 330, 331, 0, 0, 327, 322, 329, 314, 314, 0,
418 114, 305, 307, 318, 322, 318, 0, 321, 318, 107,
419 318, 318, 0, 306, 316, 0, 316, 308, 0, 294,
420 0, 298, 307, 294, 291, 304, 304, 0, 132, 137,
421 293, 287, 290, 300, 288, 290, 0, 293, 295, 295,
422 276, 292, 295, 0, 293, 278, 276, 0, 277, 0,
423 270, 283, 267, 285, 270, 281, 0, 280, 279, 271,
425 265, 277, 261, 257, 259, 257, 0, 274, 256, 0,
426 255, 254, 258, 248, 269, 268, 265, 258, 270, 143,
427 269, 149, 0, 259, 241, 0, 240, 0, 259, 238,
428 258, 239, 0, 250, 237, 250, 236, 231, 247, 246,
429 0, 249, 247, 247, 234, 227, 240, 225, 0, 222,
430 0, 223, 222, 239, 224, 237, 218, 227, 0, 216,
431 215, 222, 217, 235, 213, 0, 0, 209, 0, 226,
432 0, 209, 203, 0, 216, 0, 0, 0, 212, 206,
433 211, 0, 220, 0, 0, 215, 204, 199, 200, 199,
434 213, 199, 199, 197, 206, 208, 207, 199, 188, 194,
436 192, 188, 188, 190, 196, 0, 198, 182, 184, 182,
437 0, 0, 184, 181, 188, 176, 0, 177, 171, 172,
438 170, 183, 186, 181, 171, 0, 183, 171, 164, 0,
439 167, 175, 0, 164, 160, 155, 157, 156, 159, 0,
440 155, 0, 0, 160, 165, 156, 0, 0, 0, 0,
441 0, 141, 150, 141, 139, 0, 0, 128, 122, 126,
442 0, 0, 109, 91, 79, 0, 0, 0, 516, 156,
443 161, 65, 166, 171, 176
446 static yyconst short int yy_def[476] =
448 469, 1, 469, 469, 469, 469, 470, 471, 472, 473,
449 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
450 473, 473, 473, 473, 473, 473, 473, 469, 469, 469,
451 470, 469, 471, 472, 469, 473, 473, 473, 473, 473,
452 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
453 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, 469, 470, 473, 473, 473, 473, 473,
457 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,
464 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,
470 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
471 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
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,
475 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
476 473, 473, 473, 473, 473, 473, 473, 473, 469, 474,
477 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
478 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
479 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, 473, 473, 473, 473, 473, 475, 474,
483 475, 474, 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,
486 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
487 473, 473, 473, 475, 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,
492 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
493 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
494 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
495 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
496 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
497 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
498 473, 473, 473, 473, 473, 473, 473, 473, 0, 469,
499 469, 469, 469, 469, 469
502 static yyconst short int yy_nxt[552] =
504 4, 5, 6, 5, 7, 8, 4, 9, 9, 10,
505 11, 12, 13, 14, 15, 16, 17, 18, 19, 19,
506 20, 21, 22, 19, 23, 24, 25, 19, 26, 27,
507 19, 19, 19, 28, 29, 30, 37, 30, 50, 41,
508 52, 55, 51, 42, 81, 38, 43, 56, 82, 63,
509 53, 39, 83, 40, 44, 95, 67, 64, 54, 96,
510 59, 45, 60, 65, 103, 46, 68, 66, 47, 34,
511 61, 62, 48, 49, 70, 73, 71, 74, 76, 72,
512 77, 104, 30, 78, 30, 84, 90, 108, 85, 91,
513 98, 99, 111, 75, 79, 113, 123, 109, 126, 129,
515 124, 131, 132, 114, 139, 468, 112, 84, 127, 130,
516 85, 205, 225, 467, 206, 241, 269, 269, 242, 270,
517 140, 226, 243, 295, 227, 228, 141, 229, 207, 273,
518 304, 466, 274, 269, 269, 305, 319, 465, 321, 296,
519 321, 322, 36, 321, 321, 464, 321, 322, 36, 321,
520 321, 463, 321, 322, 36, 321, 31, 31, 462, 31,
521 31, 33, 33, 461, 33, 33, 36, 460, 459, 36,
522 36, 320, 320, 458, 320, 320, 321, 321, 457, 456,
523 321, 455, 454, 453, 452, 451, 450, 449, 448, 447,
524 446, 445, 444, 443, 442, 441, 440, 439, 438, 437,
526 436, 435, 434, 433, 432, 431, 430, 429, 428, 427,
527 426, 425, 424, 423, 422, 421, 420, 419, 418, 417,
528 416, 415, 414, 413, 412, 411, 410, 409, 408, 407,
529 406, 405, 404, 403, 402, 401, 400, 399, 398, 364,
530 397, 396, 395, 394, 393, 392, 391, 390, 389, 388,
531 387, 386, 385, 384, 383, 382, 381, 380, 379, 378,
532 377, 376, 375, 374, 373, 372, 371, 370, 369, 368,
533 367, 366, 365, 364, 364, 363, 362, 361, 360, 359,
534 358, 357, 356, 355, 354, 353, 352, 351, 350, 349,
535 348, 347, 346, 345, 344, 343, 342, 341, 340, 339,
537 338, 337, 336, 335, 334, 333, 332, 331, 330, 329,
538 328, 327, 326, 325, 324, 323, 318, 317, 316, 315,
539 314, 313, 312, 311, 310, 309, 308, 307, 306, 303,
540 302, 301, 300, 299, 298, 297, 294, 293, 292, 291,
541 290, 289, 288, 287, 286, 285, 284, 283, 282, 281,
542 280, 279, 278, 277, 276, 275, 272, 271, 268, 267,
543 266, 265, 264, 263, 262, 261, 260, 259, 258, 257,
544 256, 255, 254, 253, 252, 251, 250, 249, 248, 247,
545 246, 245, 244, 240, 239, 238, 237, 236, 235, 234,
546 233, 232, 231, 230, 224, 223, 222, 221, 220, 219,
548 218, 217, 216, 215, 214, 213, 212, 211, 210, 209,
549 208, 204, 203, 202, 201, 200, 199, 198, 197, 196,
550 195, 194, 193, 192, 191, 190, 189, 188, 187, 186,
551 185, 184, 183, 182, 181, 180, 179, 178, 177, 176,
552 175, 174, 173, 172, 171, 170, 169, 168, 167, 166,
553 165, 164, 163, 162, 161, 160, 159, 158, 157, 156,
554 155, 154, 153, 152, 151, 150, 149, 148, 147, 146,
555 32, 145, 144, 143, 142, 138, 137, 136, 135, 134,
556 133, 128, 125, 122, 121, 120, 119, 118, 117, 116,
557 115, 110, 107, 106, 105, 102, 101, 100, 97, 94,
559 93, 92, 89, 88, 87, 86, 35, 32, 80, 69,
560 58, 57, 35, 32, 469, 3, 469, 469, 469, 469,
561 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
562 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
563 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
567 static yyconst short int yy_chk[552] =
569 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
570 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
571 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
572 1, 1, 1, 1, 1, 5, 10, 5, 13, 11,
573 14, 15, 13, 11, 27, 10, 11, 15, 27, 20,
574 14, 10, 27, 10, 12, 45, 21, 20, 14, 45,
575 18, 12, 18, 20, 51, 12, 21, 20, 12, 472,
576 18, 18, 12, 12, 23, 24, 23, 24, 25, 23,
577 25, 51, 30, 25, 30, 32, 41, 55, 32, 41,
578 47, 47, 57, 24, 25, 58, 67, 55, 69, 71,
580 67, 72, 72, 58, 79, 465, 57, 84, 69, 71,
581 84, 148, 166, 464, 148, 181, 211, 211, 181, 211,
582 79, 166, 181, 241, 166, 166, 79, 166, 148, 214,
583 250, 463, 214, 269, 269, 250, 269, 460, 270, 241,
584 270, 270, 270, 270, 320, 459, 320, 320, 320, 320,
585 322, 458, 322, 322, 322, 322, 470, 470, 455, 470,
586 470, 471, 471, 454, 471, 471, 473, 453, 452, 473,
587 473, 474, 474, 446, 474, 474, 475, 475, 445, 444,
588 475, 441, 439, 438, 437, 436, 435, 434, 432, 431,
589 429, 428, 427, 425, 424, 423, 422, 421, 420, 419,
591 418, 416, 415, 414, 413, 410, 409, 408, 407, 405,
592 404, 403, 402, 401, 400, 399, 398, 397, 396, 395,
593 394, 393, 392, 391, 390, 389, 388, 387, 386, 383,
594 381, 380, 379, 375, 373, 372, 370, 368, 365, 364,
595 363, 362, 361, 360, 358, 357, 356, 355, 354, 353,
596 352, 350, 348, 347, 346, 345, 344, 343, 342, 340,
597 339, 338, 337, 336, 335, 334, 332, 331, 330, 329,
598 327, 325, 324, 321, 319, 318, 317, 316, 315, 314,
599 313, 312, 311, 309, 308, 306, 305, 304, 303, 302,
600 301, 300, 299, 298, 296, 295, 294, 293, 292, 291,
602 289, 287, 286, 285, 283, 282, 281, 280, 279, 278,
603 276, 275, 274, 273, 272, 271, 267, 266, 265, 264,
604 263, 262, 260, 258, 257, 255, 254, 252, 251, 249,
605 248, 246, 245, 244, 243, 242, 239, 238, 237, 236,
606 235, 232, 231, 229, 228, 227, 226, 225, 224, 223,
607 222, 221, 220, 219, 217, 216, 213, 212, 210, 207,
608 206, 205, 203, 202, 201, 200, 199, 198, 197, 196,
609 195, 194, 193, 192, 191, 190, 189, 187, 186, 185,
610 184, 183, 182, 180, 179, 178, 177, 176, 175, 174,
611 171, 170, 169, 167, 165, 164, 163, 162, 161, 160,
613 159, 158, 157, 156, 155, 154, 153, 152, 151, 150,
614 149, 147, 146, 145, 144, 143, 142, 141, 140, 139,
615 138, 137, 136, 135, 134, 133, 132, 131, 130, 129,
616 128, 126, 125, 124, 123, 122, 121, 120, 119, 118,
617 117, 116, 115, 114, 113, 112, 111, 110, 109, 108,
618 107, 105, 104, 103, 102, 101, 100, 99, 98, 97,
619 96, 95, 94, 93, 92, 91, 90, 89, 88, 86,
620 85, 83, 82, 81, 80, 78, 77, 76, 75, 74,
621 73, 70, 68, 66, 65, 64, 63, 62, 61, 60,
622 59, 56, 54, 53, 52, 50, 49, 48, 46, 44,
624 43, 42, 40, 39, 38, 37, 34, 31, 26, 22,
625 17, 16, 9, 7, 3, 469, 469, 469, 469, 469,
626 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
627 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
628 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
632 static yy_state_type yy_last_accepting_state;
633 static char *yy_last_accepting_cpos;
635 /* The intent behind this definition is that it'll catch
636 * any uses of REJECT which flex missed.
638 #define REJECT reject_used_but_not_detected
639 #define yymore() yymore_used_but_not_detected
640 #define YY_MORE_ADJ 0
641 #define YY_RESTORE_YY_MORE_OFFSET
646 /* Copyright 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
647 Written by Ian Lance Taylor, Cygnus Support.
649 This file is part of GNU Binutils.
651 This program is free software; you can redistribute it and/or modify
652 it under the terms of the GNU General Public License as published by
653 the Free Software Foundation; either version 2 of the License, or
654 (at your option) any later version.
656 This program is distributed in the hope that it will be useful,
657 but WITHOUT ANY WARRANTY; without even the implied warranty of
658 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
659 GNU General Public License for more details.
661 You should have received a copy of the GNU General Public License
662 along with this program; if not, write to the Free Software
663 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
666 /* This is a lex input file which generates a lexer used by the
667 Windows rc file parser. It basically just recognized a bunch of
672 #include "libiberty.h"
673 #include "safe-ctype.h"
679 /* Whether we are in rcdata mode, in which we returns the lengths of
682 static int rcdata_mode;
684 /* Whether we are supressing lines from cpp (including windows.h or
685 headers from your C sources may bring in externs and typedefs).
686 When active, we return IGNORED_TOKEN, which lets us ignore these
687 outside of resource constructs. Thus, it isn't required to protect
688 all the non-preprocessor lines in your header files with #ifdef
689 RC_INVOKED. It also means your RC file can't include other RC
690 files if they're named "*.h". Sorry. Name them *.rch or whatever. */
692 static int suppress_cpp_data;
694 #define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x)
696 /* The first filename we detect in the cpp output. We use this to
697 tell included files from the original file. */
699 static char *initial_fn;
701 /* List of allocated strings. */
705 struct alloc_string *next;
709 static struct alloc_string *strings;
711 /* Local functions. */
713 static void cpp_line PARAMS ((const char *));
714 static char *handle_quotes PARAMS ((const char *, unsigned long *));
715 static char *get_string PARAMS ((int));
719 /* Macros after this point can all be overridden by user definitions in
723 #ifndef YY_SKIP_YYWRAP
725 extern "C" int yywrap YY_PROTO(( void ));
727 extern int yywrap YY_PROTO(( void ));
732 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
736 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
739 #ifdef YY_NEED_STRLEN
740 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
745 static int yyinput YY_PROTO(( void ));
747 static int input YY_PROTO(( void ));
752 static int yy_start_stack_ptr = 0;
753 static int yy_start_stack_depth = 0;
754 static int *yy_start_stack = 0;
755 #ifndef YY_NO_PUSH_STATE
756 static void yy_push_state YY_PROTO(( int new_state ));
758 #ifndef YY_NO_POP_STATE
759 static void yy_pop_state YY_PROTO(( void ));
761 #ifndef YY_NO_TOP_STATE
762 static int yy_top_state YY_PROTO(( void ));
766 #define YY_NO_PUSH_STATE 1
767 #define YY_NO_POP_STATE 1
768 #define YY_NO_TOP_STATE 1
771 #ifdef YY_MALLOC_DECL
779 /* Just try to get by without declaring the routines. This will fail
780 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
781 * or sizeof(void*) != sizeof(int).
786 /* Amount of stuff to slurp up with each read. */
787 #ifndef YY_READ_BUF_SIZE
788 #define YY_READ_BUF_SIZE 8192
791 /* Copy whatever the last rule matched to the standard output. */
794 /* This used to be an fputs(), but since the string might contain NUL's,
795 * we now use fwrite().
797 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
800 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
801 * is returned in "result".
804 #define YY_INPUT(buf,result,max_size) \
805 if ( yy_current_buffer->yy_is_interactive ) \
808 for ( n = 0; n < max_size && \
809 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
812 buf[n++] = (char) c; \
813 if ( c == EOF && ferror( yyin ) ) \
814 YY_FATAL_ERROR( "input in flex scanner failed" ); \
820 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
822 if( errno != EINTR) \
824 YY_FATAL_ERROR( "input in flex scanner failed" ); \
833 /* No semi-colon after return; correct usage is to write "yyterminate();" -
834 * we don't want an extra ';' after the "return" because that will cause
835 * some compilers to complain about unreachable statements.
838 #define yyterminate() return YY_NULL
841 /* Number of entries by which start-condition stack grows. */
842 #ifndef YY_START_STACK_INCR
843 #define YY_START_STACK_INCR 25
846 /* Report a fatal error. */
847 #ifndef YY_FATAL_ERROR
848 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
851 /* Default declaration of generated scanner - a define so the user can
852 * easily add parameters.
855 #define YY_DECL int yylex YY_PROTO(( void ))
858 /* Code executed at the beginning of each rule, after yytext and yyleng
861 #ifndef YY_USER_ACTION
862 #define YY_USER_ACTION
865 /* Code executed at the end of each rule. */
867 #define YY_BREAK break;
870 #define YY_RULE_SETUP \
875 register yy_state_type yy_current_state;
876 register char *yy_cp, *yy_bp;
893 yy_start = 1; /* first start state */
901 if ( ! yy_current_buffer )
903 yy_create_buffer( yyin, YY_BUF_SIZE );
905 yy_load_buffer_state();
908 while ( 1 ) /* loops until end-of-file is reached */
912 /* Support of yytext. */
913 *yy_cp = yy_hold_char;
915 /* yy_bp points to the position in yy_ch_buf of the start of
920 yy_current_state = yy_start;
924 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
925 if ( yy_accept[yy_current_state] )
927 yy_last_accepting_state = yy_current_state;
928 yy_last_accepting_cpos = yy_cp;
930 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
932 yy_current_state = (int) yy_def[yy_current_state];
933 if ( yy_current_state >= 470 )
934 yy_c = yy_meta[(unsigned int) yy_c];
936 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
939 while ( yy_base[yy_current_state] != 516 );
942 yy_act = yy_accept[yy_current_state];
944 { /* have to back up */
945 yy_cp = yy_last_accepting_cpos;
946 yy_current_state = yy_last_accepting_state;
947 yy_act = yy_accept[yy_current_state];
953 do_action: /* This label is used only to access EOF actions. */
957 { /* beginning of action switch */
958 case 0: /* must back up */
959 /* undo the effects of YY_DO_BEFORE_ACTION */
960 *yy_cp = yy_hold_char;
961 yy_cp = yy_last_accepting_cpos;
962 yy_current_state = yy_last_accepting_state;
968 { MAYBE_RETURN (BEG); }
973 { MAYBE_RETURN (BEG); }
978 { MAYBE_RETURN (END); }
983 { MAYBE_RETURN (END); }
988 { MAYBE_RETURN (ACCELERATORS); }
993 { MAYBE_RETURN (VIRTKEY); }
998 { MAYBE_RETURN (ASCII); }
1003 { MAYBE_RETURN (NOINVERT); }
1008 { MAYBE_RETURN (SHIFT); }
1013 { MAYBE_RETURN (CONTROL); }
1018 { MAYBE_RETURN (ALT); }
1023 { MAYBE_RETURN (BITMAP); }
1028 { MAYBE_RETURN (CURSOR); }
1033 { MAYBE_RETURN (DIALOG); }
1038 { MAYBE_RETURN (DIALOGEX); }
1043 { MAYBE_RETURN (EXSTYLE); }
1048 { MAYBE_RETURN (CAPTION); }
1053 { MAYBE_RETURN (CLASS); }
1058 { MAYBE_RETURN (STYLE); }
1063 { MAYBE_RETURN (AUTO3STATE); }
1068 { MAYBE_RETURN (AUTOCHECKBOX); }
1073 { MAYBE_RETURN (AUTORADIOBUTTON); }
1078 { MAYBE_RETURN (CHECKBOX); }
1083 { MAYBE_RETURN (COMBOBOX); }
1088 { MAYBE_RETURN (CTEXT); }
1093 { MAYBE_RETURN (DEFPUSHBUTTON); }
1098 { MAYBE_RETURN (EDITTEXT); }
1103 { MAYBE_RETURN (GROUPBOX); }
1108 { MAYBE_RETURN (LISTBOX); }
1113 { MAYBE_RETURN (LTEXT); }
1118 { MAYBE_RETURN (PUSHBOX); }
1123 { MAYBE_RETURN (PUSHBUTTON); }
1128 { MAYBE_RETURN (RADIOBUTTON); }
1133 { MAYBE_RETURN (RTEXT); }
1138 { MAYBE_RETURN (SCROLLBAR); }
1143 { MAYBE_RETURN (STATE3); }
1148 { MAYBE_RETURN (USERBUTTON); }
1153 { MAYBE_RETURN (BEDIT); }
1158 { MAYBE_RETURN (HEDIT); }
1163 { MAYBE_RETURN (IEDIT); }
1168 { MAYBE_RETURN (FONT); }
1173 { MAYBE_RETURN (ICON); }
1178 { MAYBE_RETURN (LANGUAGE); }
1183 { MAYBE_RETURN (CHARACTERISTICS); }
1188 { MAYBE_RETURN (VERSIONK); }
1193 { MAYBE_RETURN (MENU); }
1198 { MAYBE_RETURN (MENUEX); }
1203 { MAYBE_RETURN (MENUITEM); }
1208 { MAYBE_RETURN (SEPARATOR); }
1213 { MAYBE_RETURN (POPUP); }
1218 { MAYBE_RETURN (CHECKED); }
1223 { MAYBE_RETURN (GRAYED); }
1228 { MAYBE_RETURN (HELP); }
1233 { MAYBE_RETURN (INACTIVE); }
1238 { MAYBE_RETURN (MENUBARBREAK); }
1243 { MAYBE_RETURN (MENUBREAK); }
1248 { MAYBE_RETURN (MESSAGETABLE); }
1253 { MAYBE_RETURN (RCDATA); }
1258 { MAYBE_RETURN (STRINGTABLE); }
1263 { MAYBE_RETURN (VERSIONINFO); }
1268 { MAYBE_RETURN (FILEVERSION); }
1273 { MAYBE_RETURN (PRODUCTVERSION); }
1278 { MAYBE_RETURN (FILEFLAGSMASK); }
1283 { MAYBE_RETURN (FILEFLAGS); }
1288 { MAYBE_RETURN (FILEOS); }
1293 { MAYBE_RETURN (FILETYPE); }
1298 { MAYBE_RETURN (FILESUBTYPE); }
1303 { MAYBE_RETURN (VALUE); }
1308 { MAYBE_RETURN (MOVEABLE); }
1313 { MAYBE_RETURN (FIXED); }
1318 { MAYBE_RETURN (PURE); }
1323 { MAYBE_RETURN (IMPURE); }
1328 { MAYBE_RETURN (PRELOAD); }
1333 { MAYBE_RETURN (LOADONCALL); }
1338 { MAYBE_RETURN (DISCARDABLE); }
1343 { MAYBE_RETURN (NOT); }
1351 /* This is a hack to let us parse version
1352 information easily. */
1354 s = strchr (yytext, '"');
1356 send = strchr (s, '"');
1357 if (strncmp (s, "StringFileInfo",
1358 sizeof "StringFileInfo" - 1) == 0
1359 && s + sizeof "StringFileInfo" - 1 == send)
1360 MAYBE_RETURN (BLOCKSTRINGFILEINFO);
1361 else if (strncmp (s, "VarFileInfo",
1362 sizeof "VarFileInfo" - 1) == 0
1363 && s + sizeof "VarFileInfo" - 1 == send)
1364 MAYBE_RETURN (BLOCKVARFILEINFO);
1369 r = get_string (send - s + 1);
1370 strncpy (r, s, send - s);
1373 MAYBE_RETURN (BLOCK);
1388 yylval.i.val = strtoul (yytext, 0, 0);
1390 MAYBE_RETURN (NUMBER);
1397 yylval.i.val = strtoul (yytext, 0, 0);
1399 MAYBE_RETURN (NUMBER);
1407 unsigned long length;
1409 s = handle_quotes (yytext, &length);
1413 MAYBE_RETURN (QUOTEDSTRING);
1417 yylval.ss.length = length;
1419 MAYBE_RETURN (SIZEDSTRING);
1429 /* I rejected comma in a string in order to
1430 handle VIRTKEY, CONTROL in an accelerator
1431 resource. This means that an unquoted
1432 file name can not contain a comma. I
1433 don't know what rc permits. */
1435 s = get_string (strlen (yytext) + 1);
1438 MAYBE_RETURN (STRING);
1449 { /* ignore whitespace */ }
1454 { MAYBE_RETURN (*yytext); }
1461 #line 1462 "lex.yy.c"
1462 case YY_STATE_EOF(INITIAL):
1465 case YY_END_OF_BUFFER:
1467 /* Amount of text matched not including the EOB char. */
1468 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1470 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1471 *yy_cp = yy_hold_char;
1472 YY_RESTORE_YY_MORE_OFFSET
1474 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1476 /* We're scanning a new file or input source. It's
1477 * possible that this happened because the user
1478 * just pointed yyin at a new source and called
1479 * yylex(). If so, then we have to assure
1480 * consistency between yy_current_buffer and our
1481 * globals. Here is the right place to do so, because
1482 * this is the first action (other than possibly a
1483 * back-up) that will match for the new input source.
1485 yy_n_chars = yy_current_buffer->yy_n_chars;
1486 yy_current_buffer->yy_input_file = yyin;
1487 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1490 /* Note that here we test for yy_c_buf_p "<=" to the position
1491 * of the first EOB in the buffer, since yy_c_buf_p will
1492 * already have been incremented past the NUL character
1493 * (since all states make transitions on EOB to the
1494 * end-of-buffer state). Contrast this with the test
1497 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1498 { /* This was really a NUL. */
1499 yy_state_type yy_next_state;
1501 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1503 yy_current_state = yy_get_previous_state();
1505 /* Okay, we're now positioned to make the NUL
1506 * transition. We couldn't have
1507 * yy_get_previous_state() go ahead and do it
1508 * for us because it doesn't know how to deal
1509 * with the possibility of jamming (and we don't
1510 * want to build jamming into it because then it
1511 * will run more slowly).
1514 yy_next_state = yy_try_NUL_trans( yy_current_state );
1516 yy_bp = yytext_ptr + YY_MORE_ADJ;
1518 if ( yy_next_state )
1520 /* Consume the NUL. */
1521 yy_cp = ++yy_c_buf_p;
1522 yy_current_state = yy_next_state;
1529 goto yy_find_action;
1533 else switch ( yy_get_next_buffer() )
1535 case EOB_ACT_END_OF_FILE:
1537 yy_did_buffer_switch_on_eof = 0;
1541 /* Note: because we've taken care in
1542 * yy_get_next_buffer() to have set up
1543 * yytext, we can now set up
1544 * yy_c_buf_p so that if some total
1545 * hoser (like flex itself) wants to
1546 * call the scanner after we return the
1547 * YY_NULL, it'll still work - another
1548 * YY_NULL will get returned.
1550 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1552 yy_act = YY_STATE_EOF(YY_START);
1558 if ( ! yy_did_buffer_switch_on_eof )
1564 case EOB_ACT_CONTINUE_SCAN:
1566 yytext_ptr + yy_amount_of_matched_text;
1568 yy_current_state = yy_get_previous_state();
1571 yy_bp = yytext_ptr + YY_MORE_ADJ;
1574 case EOB_ACT_LAST_MATCH:
1576 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1578 yy_current_state = yy_get_previous_state();
1581 yy_bp = yytext_ptr + YY_MORE_ADJ;
1582 goto yy_find_action;
1589 "fatal flex scanner internal error--no action found" );
1590 } /* end of action switch */
1591 } /* end of scanning one token */
1592 } /* end of yylex */
1595 /* yy_get_next_buffer - try to read in a new buffer
1597 * Returns a code representing an action:
1598 * EOB_ACT_LAST_MATCH -
1599 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1600 * EOB_ACT_END_OF_FILE - end of file
1603 static int yy_get_next_buffer()
1605 register char *dest = yy_current_buffer->yy_ch_buf;
1606 register char *source = yytext_ptr;
1607 register int number_to_move, i;
1610 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1612 "fatal flex scanner internal error--end of buffer missed" );
1614 if ( yy_current_buffer->yy_fill_buffer == 0 )
1615 { /* Don't try to fill the buffer, so this is an EOF. */
1616 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1618 /* We matched a single character, the EOB, so
1619 * treat this as a final EOF.
1621 return EOB_ACT_END_OF_FILE;
1626 /* We matched some text prior to the EOB, first
1629 return EOB_ACT_LAST_MATCH;
1633 /* Try to read more data. */
1635 /* First move last chars to start of buffer. */
1636 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1638 for ( i = 0; i < number_to_move; ++i )
1639 *(dest++) = *(source++);
1641 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1642 /* don't do the read, it's not guaranteed to return an EOF,
1645 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1650 yy_current_buffer->yy_buf_size - number_to_move - 1;
1652 while ( num_to_read <= 0 )
1653 { /* Not enough room in the buffer - grow it. */
1654 #ifdef YY_USES_REJECT
1656 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1659 /* just a shorter name for the current buffer */
1660 YY_BUFFER_STATE b = yy_current_buffer;
1662 int yy_c_buf_p_offset =
1663 (int) (yy_c_buf_p - b->yy_ch_buf);
1665 if ( b->yy_is_our_buffer )
1667 int new_size = b->yy_buf_size * 2;
1669 if ( new_size <= 0 )
1670 b->yy_buf_size += b->yy_buf_size / 8;
1672 b->yy_buf_size *= 2;
1674 b->yy_ch_buf = (char *)
1675 /* Include room in for 2 EOB chars. */
1676 yy_flex_realloc( (void *) b->yy_ch_buf,
1677 b->yy_buf_size + 2 );
1680 /* Can't grow it, we don't own it. */
1683 if ( ! b->yy_ch_buf )
1685 "fatal error - scanner input buffer overflow" );
1687 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1689 num_to_read = yy_current_buffer->yy_buf_size -
1694 if ( num_to_read > YY_READ_BUF_SIZE )
1695 num_to_read = YY_READ_BUF_SIZE;
1697 /* Read in more data. */
1698 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1699 yy_n_chars, num_to_read );
1701 yy_current_buffer->yy_n_chars = yy_n_chars;
1704 if ( yy_n_chars == 0 )
1706 if ( number_to_move == YY_MORE_ADJ )
1708 ret_val = EOB_ACT_END_OF_FILE;
1714 ret_val = EOB_ACT_LAST_MATCH;
1715 yy_current_buffer->yy_buffer_status =
1716 YY_BUFFER_EOF_PENDING;
1721 ret_val = EOB_ACT_CONTINUE_SCAN;
1723 yy_n_chars += number_to_move;
1724 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1725 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1727 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1733 /* yy_get_previous_state - get the state just before the EOB char was reached */
1735 static yy_state_type yy_get_previous_state()
1737 register yy_state_type yy_current_state;
1738 register char *yy_cp;
1740 yy_current_state = yy_start;
1742 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1744 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1745 if ( yy_accept[yy_current_state] )
1747 yy_last_accepting_state = yy_current_state;
1748 yy_last_accepting_cpos = yy_cp;
1750 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1752 yy_current_state = (int) yy_def[yy_current_state];
1753 if ( yy_current_state >= 470 )
1754 yy_c = yy_meta[(unsigned int) yy_c];
1756 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1759 return yy_current_state;
1763 /* yy_try_NUL_trans - try to make a transition on the NUL character
1766 * next_state = yy_try_NUL_trans( current_state );
1769 #ifdef YY_USE_PROTOS
1770 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1772 static yy_state_type yy_try_NUL_trans( yy_current_state )
1773 yy_state_type yy_current_state;
1776 register int yy_is_jam;
1777 register char *yy_cp = yy_c_buf_p;
1779 register YY_CHAR yy_c = 1;
1780 if ( yy_accept[yy_current_state] )
1782 yy_last_accepting_state = yy_current_state;
1783 yy_last_accepting_cpos = yy_cp;
1785 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1787 yy_current_state = (int) yy_def[yy_current_state];
1788 if ( yy_current_state >= 470 )
1789 yy_c = yy_meta[(unsigned int) yy_c];
1791 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1792 yy_is_jam = (yy_current_state == 469);
1794 return yy_is_jam ? 0 : yy_current_state;
1799 #ifdef YY_USE_PROTOS
1800 static void yyunput( int c, register char *yy_bp )
1802 static void yyunput( c, yy_bp )
1804 register char *yy_bp;
1807 register char *yy_cp = yy_c_buf_p;
1809 /* undo effects of setting up yytext */
1810 *yy_cp = yy_hold_char;
1812 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1813 { /* need to shift things up to make room */
1814 /* +2 for EOB chars. */
1815 register int number_to_move = yy_n_chars + 2;
1816 register char *dest = &yy_current_buffer->yy_ch_buf[
1817 yy_current_buffer->yy_buf_size + 2];
1818 register char *source =
1819 &yy_current_buffer->yy_ch_buf[number_to_move];
1821 while ( source > yy_current_buffer->yy_ch_buf )
1822 *--dest = *--source;
1824 yy_cp += (int) (dest - source);
1825 yy_bp += (int) (dest - source);
1826 yy_current_buffer->yy_n_chars =
1827 yy_n_chars = yy_current_buffer->yy_buf_size;
1829 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1830 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1833 *--yy_cp = (char) c;
1837 yy_hold_char = *yy_cp;
1840 #endif /* ifndef YY_NO_UNPUT */
1844 static int yyinput()
1851 *yy_c_buf_p = yy_hold_char;
1853 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1855 /* yy_c_buf_p now points to the character we want to return.
1856 * If this occurs *before* the EOB characters, then it's a
1857 * valid NUL; if not, then we've hit the end of the buffer.
1859 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1860 /* This was really a NUL. */
1864 { /* need more input */
1865 int offset = yy_c_buf_p - yytext_ptr;
1868 switch ( yy_get_next_buffer() )
1870 case EOB_ACT_LAST_MATCH:
1871 /* This happens because yy_g_n_b()
1872 * sees that we've accumulated a
1873 * token and flags that we need to
1874 * try matching the token before
1875 * proceeding. But for input(),
1876 * there's no matching to consider.
1877 * So convert the EOB_ACT_LAST_MATCH
1878 * to EOB_ACT_END_OF_FILE.
1881 /* Reset buffer status. */
1886 case EOB_ACT_END_OF_FILE:
1891 if ( ! yy_did_buffer_switch_on_eof )
1900 case EOB_ACT_CONTINUE_SCAN:
1901 yy_c_buf_p = yytext_ptr + offset;
1907 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1908 *yy_c_buf_p = '\0'; /* preserve yytext */
1909 yy_hold_char = *++yy_c_buf_p;
1916 #ifdef YY_USE_PROTOS
1917 void yyrestart( FILE *input_file )
1919 void yyrestart( input_file )
1923 if ( ! yy_current_buffer )
1924 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1926 yy_init_buffer( yy_current_buffer, input_file );
1927 yy_load_buffer_state();
1931 #ifdef YY_USE_PROTOS
1932 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1934 void yy_switch_to_buffer( new_buffer )
1935 YY_BUFFER_STATE new_buffer;
1938 if ( yy_current_buffer == new_buffer )
1941 if ( yy_current_buffer )
1943 /* Flush out information for old buffer. */
1944 *yy_c_buf_p = yy_hold_char;
1945 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1946 yy_current_buffer->yy_n_chars = yy_n_chars;
1949 yy_current_buffer = new_buffer;
1950 yy_load_buffer_state();
1952 /* We don't actually know whether we did this switch during
1953 * EOF (yywrap()) processing, but the only time this flag
1954 * is looked at is after yywrap() is called, so it's safe
1955 * to go ahead and always set it.
1957 yy_did_buffer_switch_on_eof = 1;
1961 #ifdef YY_USE_PROTOS
1962 void yy_load_buffer_state( void )
1964 void yy_load_buffer_state()
1967 yy_n_chars = yy_current_buffer->yy_n_chars;
1968 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1969 yyin = yy_current_buffer->yy_input_file;
1970 yy_hold_char = *yy_c_buf_p;
1974 #ifdef YY_USE_PROTOS
1975 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1977 YY_BUFFER_STATE yy_create_buffer( file, size )
1984 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1986 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1988 b->yy_buf_size = size;
1990 /* yy_ch_buf has to be 2 characters longer than the size given because
1991 * we need to put in 2 end-of-buffer characters.
1993 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1994 if ( ! b->yy_ch_buf )
1995 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1997 b->yy_is_our_buffer = 1;
1999 yy_init_buffer( b, file );
2005 #ifdef YY_USE_PROTOS
2006 void yy_delete_buffer( YY_BUFFER_STATE b )
2008 void yy_delete_buffer( b )
2015 if ( b == yy_current_buffer )
2016 yy_current_buffer = (YY_BUFFER_STATE) 0;
2018 if ( b->yy_is_our_buffer )
2019 yy_flex_free( (void *) b->yy_ch_buf );
2021 yy_flex_free( (void *) b );
2028 #ifndef YY_ALWAYS_INTERACTIVE
2029 #ifndef YY_NEVER_INTERACTIVE
2030 extern int isatty YY_PROTO(( int ));
2035 #ifdef YY_USE_PROTOS
2036 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2038 void yy_init_buffer( b, file )
2045 yy_flush_buffer( b );
2047 b->yy_input_file = file;
2048 b->yy_fill_buffer = 1;
2050 #if YY_ALWAYS_INTERACTIVE
2051 b->yy_is_interactive = 1;
2053 #if YY_NEVER_INTERACTIVE
2054 b->yy_is_interactive = 0;
2056 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2062 #ifdef YY_USE_PROTOS
2063 void yy_flush_buffer( YY_BUFFER_STATE b )
2065 void yy_flush_buffer( b )
2075 /* We always need two end-of-buffer characters. The first causes
2076 * a transition to the end-of-buffer state. The second causes
2077 * a jam in that state.
2079 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2080 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2082 b->yy_buf_pos = &b->yy_ch_buf[0];
2085 b->yy_buffer_status = YY_BUFFER_NEW;
2087 if ( b == yy_current_buffer )
2088 yy_load_buffer_state();
2092 #ifndef YY_NO_SCAN_BUFFER
2093 #ifdef YY_USE_PROTOS
2094 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2096 YY_BUFFER_STATE yy_scan_buffer( base, size )
2104 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2105 base[size-1] != YY_END_OF_BUFFER_CHAR )
2106 /* They forgot to leave room for the EOB's. */
2109 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2111 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2113 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2114 b->yy_buf_pos = b->yy_ch_buf = base;
2115 b->yy_is_our_buffer = 0;
2116 b->yy_input_file = 0;
2117 b->yy_n_chars = b->yy_buf_size;
2118 b->yy_is_interactive = 0;
2120 b->yy_fill_buffer = 0;
2121 b->yy_buffer_status = YY_BUFFER_NEW;
2123 yy_switch_to_buffer( b );
2130 #ifndef YY_NO_SCAN_STRING
2131 #ifdef YY_USE_PROTOS
2132 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2134 YY_BUFFER_STATE yy_scan_string( yy_str )
2135 yyconst char *yy_str;
2139 for ( len = 0; yy_str[len]; ++len )
2142 return yy_scan_bytes( yy_str, len );
2147 #ifndef YY_NO_SCAN_BYTES
2148 #ifdef YY_USE_PROTOS
2149 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2151 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2152 yyconst char *bytes;
2161 /* Get memory for full buffer, including space for trailing EOB's. */
2163 buf = (char *) yy_flex_alloc( n );
2165 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2167 for ( i = 0; i < len; ++i )
2170 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2172 b = yy_scan_buffer( buf, n );
2174 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2176 /* It's okay to grow etc. this buffer, and we should throw it
2177 * away when we're done.
2179 b->yy_is_our_buffer = 1;
2186 #ifndef YY_NO_PUSH_STATE
2187 #ifdef YY_USE_PROTOS
2188 static void yy_push_state( int new_state )
2190 static void yy_push_state( new_state )
2194 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2198 yy_start_stack_depth += YY_START_STACK_INCR;
2199 new_size = yy_start_stack_depth * sizeof( int );
2201 if ( ! yy_start_stack )
2202 yy_start_stack = (int *) yy_flex_alloc( new_size );
2205 yy_start_stack = (int *) yy_flex_realloc(
2206 (void *) yy_start_stack, new_size );
2208 if ( ! yy_start_stack )
2210 "out of memory expanding start-condition stack" );
2213 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2220 #ifndef YY_NO_POP_STATE
2221 static void yy_pop_state()
2223 if ( --yy_start_stack_ptr < 0 )
2224 YY_FATAL_ERROR( "start-condition stack underflow" );
2226 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2231 #ifndef YY_NO_TOP_STATE
2232 static int yy_top_state()
2234 return yy_start_stack[yy_start_stack_ptr - 1];
2238 #ifndef YY_EXIT_FAILURE
2239 #define YY_EXIT_FAILURE 2
2242 #ifdef YY_USE_PROTOS
2243 static void yy_fatal_error( yyconst char msg[] )
2245 static void yy_fatal_error( msg )
2249 (void) fprintf( stderr, "%s\n", msg );
2250 exit( YY_EXIT_FAILURE );
2255 /* Redefine yyless() so it works in section 3 code. */
2261 /* Undo effects of setting up yytext. */ \
2262 yytext[yyleng] = yy_hold_char; \
2263 yy_c_buf_p = yytext + n; \
2264 yy_hold_char = *yy_c_buf_p; \
2265 *yy_c_buf_p = '\0'; \
2271 /* Internal utility routines. */
2274 #ifdef YY_USE_PROTOS
2275 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2277 static void yy_flex_strncpy( s1, s2, n )
2284 for ( i = 0; i < n; ++i )
2289 #ifdef YY_NEED_STRLEN
2290 #ifdef YY_USE_PROTOS
2291 static int yy_flex_strlen( yyconst char *s )
2293 static int yy_flex_strlen( s )
2298 for ( n = 0; s[n]; ++n )
2306 #ifdef YY_USE_PROTOS
2307 static void *yy_flex_alloc( yy_size_t size )
2309 static void *yy_flex_alloc( size )
2313 return (void *) malloc( size );
2316 #ifdef YY_USE_PROTOS
2317 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2319 static void *yy_flex_realloc( ptr, size )
2324 /* The cast to (char *) in the following accommodates both
2325 * implementations that use char* generic pointers, and those
2326 * that use void* generic pointers. It works with the latter
2327 * because both ANSI C and C++ allow castless assignment from
2328 * any pointer type to void*, and deal with argument conversions
2329 * as though doing an assignment.
2331 return (void *) realloc( (char *) ptr, size );
2334 #ifdef YY_USE_PROTOS
2335 static void yy_flex_free( void *ptr )
2337 static void yy_flex_free( ptr )
2354 /* This is needed for some versions of lex. */
2361 /* Handle a C preprocessor line. */
2371 while (ISSPACE (*s))
2374 line = strtol (s, &send, 0);
2375 if (*send != '\0' && ! ISSPACE (*send))
2378 /* Subtract 1 because we are about to count the newline. */
2379 rc_lineno = line - 1;
2382 while (ISSPACE (*s))
2389 send = strchr (s, '"');
2393 fn = (char *) xmalloc (send - s + 1);
2394 strncpy (fn, s, send - s);
2395 fn[send - s] = '\0';
2402 initial_fn = xmalloc (strlen (fn) + 1);
2403 strcpy (initial_fn, fn);
2406 /* Allow the initial file, regardless of name. Suppress all other
2407 files if they end in ".h" (this allows included "*.rc"). */
2408 if (strcmp (initial_fn, fn) == 0
2409 || strcmp (fn + strlen (fn) - 2, ".h") != 0)
2410 suppress_cpp_data = 0;
2412 suppress_cpp_data = 1;
2415 /* Handle a quoted string. The quotes are stripped. A pair of quotes
2416 in a string are turned into a single quote. Adjacent strings are
2417 merged separated by whitespace are merged, as in C. */
2420 handle_quotes (input, len)
2428 ret = get_string (strlen (input) + 1);
2442 rcparse_warning ("backslash at end of string");
2446 rcparse_warning ("use \"\" to put \" in a string");
2450 *s++ = ESCAPE_B; /* Strange, but true... */
2488 case '0': case '1': case '2': case '3':
2489 case '4': case '5': case '6': case '7':
2492 if (*t >= '0' && *t <= '7')
2494 ch = (ch << 3) | (*t - '0');
2496 if (*t >= '0' && *t <= '7')
2498 ch = (ch << 3) | (*t - '0');
2510 if (*t >= '0' && *t <= '9')
2511 ch = (ch << 4) | (*t - '0');
2512 else if (*t >= 'a' && *t <= 'f')
2513 ch = (ch << 4) | (*t - 'a' + 10);
2514 else if (*t >= 'A' && *t <= 'F')
2515 ch = (ch << 4) | (*t - 'A' + 10);
2524 rcparse_warning ("unrecognized escape sequence");
2532 else if (t[1] == '\0')
2534 else if (t[1] == '"')
2542 assert (ISSPACE (*t));
2543 while (ISSPACE (*t))
2559 /* Allocate a string of a given length. */
2565 struct alloc_string *as;
2567 as = (struct alloc_string *) xmalloc (sizeof *as);
2568 as->s = xmalloc (len);
2576 /* Discard all the strings we have allocated. The parser calls this
2577 when it no longer needs them. */
2580 rcparse_discard_strings ()
2582 struct alloc_string *as;
2587 struct alloc_string *n;
2598 /* Enter rcdata mode. */
2606 /* Go back to normal mode from rcdata mode. */