update generated files
[binutils.git] / binutils / rclex.c
blobf6462650b6813fe2f64a3f3b4b08931d7691765d
1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
4 * $Header$
5 */
7 #define FLEX_SCANNER
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
11 #include <stdio.h>
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
15 #ifdef c_plusplus
16 #ifndef __cplusplus
17 #define __cplusplus
18 #endif
19 #endif
22 #ifdef __cplusplus
24 #include <stdlib.h>
25 #include <unistd.h>
27 /* Use prototypes in function declarations. */
28 #define YY_USE_PROTOS
30 /* The "const" storage-class-modifier is valid. */
31 #define YY_USE_CONST
33 #else /* ! __cplusplus */
35 #if __STDC__
37 #define YY_USE_PROTOS
38 #define YY_USE_CONST
40 #endif /* __STDC__ */
41 #endif /* ! __cplusplus */
43 #ifdef __TURBOC__
44 #pragma warn -rch
45 #pragma warn -use
46 #include <io.h>
47 #include <stdlib.h>
48 #define YY_USE_CONST
49 #define YY_USE_PROTOS
50 #endif
52 #ifdef YY_USE_CONST
53 #define yyconst const
54 #else
55 #define yyconst
56 #endif
59 #ifdef YY_USE_PROTOS
60 #define YY_PROTO(proto) proto
61 #else
62 #define YY_PROTO(proto) ()
63 #endif
65 /* Returned upon end-of-file. */
66 #define YY_NULL 0
68 /* Promotes a possibly negative, possibly signed char to an unsigned
69 * integer for use as an array index. If the signed char is negative,
70 * we want to instead treat it as an 8-bit unsigned char, hence the
71 * double cast.
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75 /* Enter a start condition. This macro really ought to take a parameter,
76 * but we do it the disgusting crufty way forced on us by the ()-less
77 * definition of BEGIN.
79 #define BEGIN yy_start = 1 + 2 *
81 /* Translate the current start state into a value that can be later handed
82 * to BEGIN to return to the state. The YYSTATE alias is for lex
83 * compatibility.
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
94 #define YY_END_OF_BUFFER_CHAR 0
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
99 typedef struct yy_buffer_state *YY_BUFFER_STATE;
101 extern int yyleng;
102 extern FILE *yyin, *yyout;
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
108 /* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator). This
110 * avoids problems with code like:
112 * if ( condition_holds )
113 * yyless( 5 );
114 * else
115 * do_something_else();
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
122 /* Return all but the first 'n' matched characters back to the input stream. */
124 #define yyless(n) \
125 do \
127 /* Undo effects of setting up yytext. */ \
128 *yy_cp = yy_hold_char; \
129 YY_RESTORE_YY_MORE_OFFSET \
130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
133 while ( 0 )
135 #define unput(c) yyunput( c, yytext_ptr )
137 /* The following is because we cannot portably get our hands on size_t
138 * (without autoconf's help, which isn't available because we want
139 * flex-generated scanners to compile on their own).
141 typedef unsigned int yy_size_t;
144 struct yy_buffer_state
146 FILE *yy_input_file;
148 char *yy_ch_buf; /* input buffer */
149 char *yy_buf_pos; /* current position in input buffer */
151 /* Size of input buffer in bytes, not including room for EOB
152 * characters.
154 yy_size_t yy_buf_size;
156 /* Number of characters read into yy_ch_buf, not including EOB
157 * characters.
159 int yy_n_chars;
161 /* Whether we "own" the buffer - i.e., we know we created it,
162 * and can realloc() it to grow it, and should free() it to
163 * delete it.
165 int yy_is_our_buffer;
167 /* Whether this is an "interactive" input source; if so, and
168 * if we're using stdio for input, then we want to use getc()
169 * instead of fread(), to make sure we stop fetching input after
170 * each newline.
172 int yy_is_interactive;
174 /* Whether we're considered to be at the beginning of a line.
175 * If so, '^' rules will be active on the next match, otherwise
176 * not.
178 int yy_at_bol;
180 /* Whether to try to fill the input buffer when we reach the
181 * end of it.
183 int yy_fill_buffer;
185 int yy_buffer_status;
186 #define YY_BUFFER_NEW 0
187 #define YY_BUFFER_NORMAL 1
188 /* When an EOF's been seen but there's still some text to process
189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190 * shouldn't try reading from the input source any more. We might
191 * still have a bunch of tokens to match, though, because of
192 * possible backing-up.
194 * When we actually see the EOF, we change the status to "new"
195 * (via yyrestart()), so that the user can continue scanning by
196 * just pointing yyin at a new input file.
198 #define YY_BUFFER_EOF_PENDING 2
201 static YY_BUFFER_STATE yy_current_buffer = 0;
203 /* We provide macros for accessing buffer states in case in the
204 * future we want to put the buffer states in a more general
205 * "scanner state".
207 #define YY_CURRENT_BUFFER yy_current_buffer
210 /* yy_hold_char holds the character lost when yytext is formed. */
211 static char yy_hold_char;
213 static int yy_n_chars; /* number of characters read into yy_ch_buf */
216 int yyleng;
218 /* Points to current character in buffer. */
219 static char *yy_c_buf_p = (char *) 0;
220 static int yy_init = 1; /* whether we need to initialize */
221 static int yy_start = 0; /* start state number */
223 /* Flag which is used to allow yywrap()'s to do buffer switches
224 * instead of setting up a fresh yyin. A bit of a hack ...
226 static int yy_did_buffer_switch_on_eof;
228 void yyrestart YY_PROTO(( FILE *input_file ));
230 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231 void yy_load_buffer_state YY_PROTO(( void ));
232 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
242 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244 static void yy_flex_free YY_PROTO(( void * ));
246 #define yy_new_buffer yy_create_buffer
248 #define yy_set_interactive(is_interactive) \
250 if ( ! yy_current_buffer ) \
251 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252 yy_current_buffer->yy_is_interactive = is_interactive; \
255 #define yy_set_bol(at_bol) \
257 if ( ! yy_current_buffer ) \
258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259 yy_current_buffer->yy_at_bol = at_bol; \
262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
264 typedef unsigned char YY_CHAR;
265 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
266 typedef int yy_state_type;
267 extern char *yytext;
268 #define yytext_ptr yytext
270 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
271 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
272 static int yy_get_next_buffer YY_PROTO(( void ));
273 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
275 /* Done after the current pattern has been matched and before the
276 * corresponding action - sets up yytext.
278 #define YY_DO_BEFORE_ACTION \
279 yytext_ptr = yy_bp; \
280 yyleng = (int) (yy_cp - yy_bp); \
281 yy_hold_char = *yy_cp; \
282 *yy_cp = '\0'; \
283 yy_c_buf_p = yy_cp;
285 #define YY_NUM_RULES 86
286 #define YY_END_OF_BUFFER 87
287 static yyconst short int yy_accept[470] =
288 { 0,
289 0, 0, 87, 85, 84, 83, 85, 78, 80, 82,
290 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
291 82, 82, 82, 82, 82, 82, 82, 2, 4, 84,
292 0, 81, 78, 80, 79, 82, 82, 82, 82, 82,
293 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
294 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
295 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
296 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
297 82, 82, 82, 81, 0, 82, 11, 82, 82, 82,
298 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
300 82, 82, 82, 82, 82, 3, 82, 82, 82, 82,
301 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
302 82, 82, 82, 82, 82, 82, 76, 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, 82, 82, 82, 82, 82, 82, 82,
306 82, 82, 82, 82, 82, 82, 82, 41, 82, 82,
307 82, 53, 42, 82, 82, 82, 82, 82, 82, 82,
308 46, 82, 82, 82, 82, 82, 82, 71, 82, 82,
309 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
311 82, 82, 82, 7, 82, 82, 82, 38, 1, 82,
312 82, 82, 82, 82, 18, 82, 82, 25, 82, 82,
313 82, 82, 82, 82, 82, 82, 82, 82, 82, 70,
314 82, 82, 39, 40, 82, 82, 82, 82, 82, 30,
315 82, 82, 82, 82, 82, 82, 50, 82, 82, 82,
316 82, 82, 34, 82, 82, 9, 82, 82, 19, 82,
317 68, 82, 82, 82, 82, 82, 82, 12, 0, 82,
318 82, 82, 82, 82, 82, 82, 13, 82, 14, 82,
319 82, 82, 82, 65, 82, 82, 82, 52, 82, 72,
320 82, 82, 82, 82, 82, 82, 47, 82, 82, 82,
322 82, 82, 82, 82, 82, 82, 58, 82, 82, 36,
323 82, 82, 82, 82, 82, 82, 82, 82, 0, 82,
324 0, 77, 17, 82, 82, 51, 82, 10, 82, 82,
325 82, 82, 16, 82, 82, 82, 82, 82, 82, 82,
326 29, 82, 82, 82, 82, 82, 82, 82, 73, 82,
327 31, 82, 82, 82, 82, 82, 82, 45, 6, 82,
328 82, 82, 82, 77, 82, 23, 24, 82, 15, 82,
329 27, 82, 82, 66, 82, 28, 54, 43, 82, 82,
330 82, 48, 82, 69, 8, 82, 82, 82, 82, 82,
331 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
333 64, 82, 82, 82, 82, 56, 82, 82, 82, 82,
334 35, 49, 82, 82, 82, 82, 20, 82, 82, 82,
335 82, 82, 82, 82, 82, 74, 82, 82, 82, 32,
336 82, 82, 37, 82, 82, 82, 82, 82, 82, 75,
337 82, 67, 61, 82, 82, 82, 33, 59, 60, 5,
338 21, 82, 82, 82, 82, 55, 57, 82, 82, 82,
339 26, 63, 82, 82, 82, 62, 22, 44, 0
342 static yyconst int yy_ec[256] =
343 { 0,
344 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
345 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
348 1, 1, 1, 7, 1, 1, 1, 8, 8, 8,
349 9, 8, 8, 8, 8, 8, 8, 1, 1, 1,
350 1, 1, 1, 1, 10, 11, 12, 13, 14, 15,
351 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
352 19, 26, 27, 28, 29, 30, 19, 31, 32, 19,
353 1, 1, 1, 1, 1, 1, 33, 33, 33, 33,
355 33, 33, 19, 19, 19, 19, 19, 19, 19, 19,
356 19, 19, 19, 19, 19, 19, 19, 19, 19, 33,
357 19, 19, 34, 1, 35, 1, 1, 1, 1, 1,
358 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
360 1, 1, 1, 1, 1, 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,
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
374 static yyconst int yy_meta[36] =
375 { 0,
376 1, 2, 3, 2, 1, 4, 2, 5, 5, 5,
377 5, 5, 5, 5, 5, 1, 1, 1, 1, 1,
378 5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 1, 1, 5, 1, 1
382 static yyconst short int yy_base[476] =
383 { 0,
384 0, 0, 515, 516, 34, 516, 509, 0, 492, 25,
385 26, 45, 25, 28, 24, 486, 497, 49, 0, 40,
386 43, 486, 51, 66, 67, 482, 35, 516, 516, 81,
387 503, 84, 0, 486, 516, 0, 494, 477, 492, 475,
388 74, 474, 477, 475, 46, 489, 69, 484, 471, 481,
389 55, 477, 481, 466, 67, 469, 83, 83, 467, 477,
390 464, 478, 464, 459, 475, 470, 74, 453, 81, 457,
391 86, 76, 468, 467, 465, 452, 452, 458, 95, 461,
392 453, 447, 446, 106, 466, 456, 0, 451, 444, 449,
393 448, 443, 452, 435, 436, 449, 433, 448, 430, 426,
395 429, 430, 433, 441, 424, 0, 423, 436, 435, 420,
396 415, 417, 427, 419, 420, 424, 412, 428, 423, 410,
397 424, 405, 406, 407, 419, 409, 0, 402, 409, 416,
398 414, 410, 408, 415, 393, 399, 412, 406, 392, 401,
399 397, 391, 387, 388, 386, 392, 394, 103, 383, 387,
400 399, 388, 389, 396, 385, 377, 379, 376, 373, 376,
401 370, 374, 387, 368, 363, 98, 381, 0, 379, 367,
402 363, 0, 0, 362, 363, 360, 358, 375, 361, 356,
403 105, 373, 372, 351, 355, 355, 349, 0, 366, 352,
404 347, 346, 352, 346, 343, 356, 346, 354, 356, 352,
406 347, 344, 349, 0, 335, 344, 350, 0, 0, 334,
407 115, 334, 345, 119, 0, 345, 331, 0, 328, 326,
408 336, 325, 336, 328, 327, 320, 317, 313, 330, 0,
409 330, 331, 0, 0, 327, 322, 329, 314, 314, 0,
410 114, 305, 307, 318, 322, 318, 0, 321, 318, 107,
411 318, 318, 0, 306, 316, 0, 316, 308, 0, 294,
412 0, 298, 307, 294, 291, 304, 304, 0, 132, 137,
413 293, 287, 290, 300, 288, 290, 0, 293, 295, 295,
414 276, 292, 295, 0, 293, 278, 276, 0, 277, 0,
415 270, 283, 267, 285, 270, 281, 0, 280, 279, 271,
417 265, 277, 261, 257, 259, 257, 0, 274, 256, 0,
418 255, 254, 258, 248, 269, 268, 265, 258, 270, 143,
419 269, 149, 0, 259, 241, 0, 240, 0, 259, 238,
420 258, 239, 0, 250, 237, 250, 236, 231, 247, 246,
421 0, 249, 247, 247, 234, 227, 240, 225, 0, 222,
422 0, 223, 222, 239, 224, 237, 218, 227, 0, 216,
423 215, 222, 217, 235, 213, 0, 0, 209, 0, 226,
424 0, 209, 203, 0, 216, 0, 0, 0, 212, 206,
425 211, 0, 220, 0, 0, 215, 204, 199, 200, 199,
426 213, 199, 199, 197, 206, 208, 207, 199, 188, 194,
428 192, 188, 188, 190, 196, 0, 198, 182, 184, 182,
429 0, 0, 184, 181, 188, 176, 0, 177, 171, 172,
430 170, 183, 186, 181, 171, 0, 183, 171, 164, 0,
431 167, 175, 0, 164, 160, 155, 157, 156, 159, 0,
432 155, 0, 0, 160, 165, 156, 0, 0, 0, 0,
433 0, 141, 150, 141, 139, 0, 0, 128, 122, 126,
434 0, 0, 109, 91, 79, 0, 0, 0, 516, 156,
435 161, 65, 166, 171, 176
438 static yyconst short int yy_def[476] =
439 { 0,
440 469, 1, 469, 469, 469, 469, 470, 471, 472, 473,
441 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
442 473, 473, 473, 473, 473, 473, 473, 469, 469, 469,
443 470, 469, 471, 472, 469, 473, 473, 473, 473, 473,
444 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
445 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
446 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
447 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
448 473, 473, 473, 469, 470, 473, 473, 473, 473, 473,
449 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
451 473, 473, 473, 473, 473, 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, 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,
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, 469, 474,
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, 473, 473,
473 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
474 473, 473, 473, 473, 473, 473, 473, 473, 475, 474,
475 475, 474, 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, 473, 473,
478 473, 473, 473, 473, 473, 473, 473, 473, 473, 473,
479 473, 473, 473, 475, 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, 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, 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, 0, 469,
491 469, 469, 469, 469, 469
494 static yyconst short int yy_nxt[552] =
495 { 0,
496 4, 5, 6, 5, 7, 8, 4, 9, 9, 10,
497 11, 12, 13, 14, 15, 16, 17, 18, 19, 19,
498 20, 21, 22, 19, 23, 24, 25, 19, 26, 27,
499 19, 19, 19, 28, 29, 30, 37, 30, 50, 41,
500 52, 55, 51, 42, 81, 38, 43, 56, 82, 63,
501 53, 39, 83, 40, 44, 95, 67, 64, 54, 96,
502 59, 45, 60, 65, 103, 46, 68, 66, 47, 34,
503 61, 62, 48, 49, 70, 73, 71, 74, 76, 72,
504 77, 104, 30, 78, 30, 84, 90, 108, 85, 91,
505 98, 99, 111, 75, 79, 113, 123, 109, 126, 129,
507 124, 131, 132, 114, 139, 468, 112, 84, 127, 130,
508 85, 205, 225, 467, 206, 241, 269, 269, 242, 270,
509 140, 226, 243, 295, 227, 228, 141, 229, 207, 273,
510 304, 466, 274, 269, 269, 305, 319, 465, 321, 296,
511 321, 322, 36, 321, 321, 464, 321, 322, 36, 321,
512 321, 463, 321, 322, 36, 321, 31, 31, 462, 31,
513 31, 33, 33, 461, 33, 33, 36, 460, 459, 36,
514 36, 320, 320, 458, 320, 320, 321, 321, 457, 456,
515 321, 455, 454, 453, 452, 451, 450, 449, 448, 447,
516 446, 445, 444, 443, 442, 441, 440, 439, 438, 437,
518 436, 435, 434, 433, 432, 431, 430, 429, 428, 427,
519 426, 425, 424, 423, 422, 421, 420, 419, 418, 417,
520 416, 415, 414, 413, 412, 411, 410, 409, 408, 407,
521 406, 405, 404, 403, 402, 401, 400, 399, 398, 364,
522 397, 396, 395, 394, 393, 392, 391, 390, 389, 388,
523 387, 386, 385, 384, 383, 382, 381, 380, 379, 378,
524 377, 376, 375, 374, 373, 372, 371, 370, 369, 368,
525 367, 366, 365, 364, 364, 363, 362, 361, 360, 359,
526 358, 357, 356, 355, 354, 353, 352, 351, 350, 349,
527 348, 347, 346, 345, 344, 343, 342, 341, 340, 339,
529 338, 337, 336, 335, 334, 333, 332, 331, 330, 329,
530 328, 327, 326, 325, 324, 323, 318, 317, 316, 315,
531 314, 313, 312, 311, 310, 309, 308, 307, 306, 303,
532 302, 301, 300, 299, 298, 297, 294, 293, 292, 291,
533 290, 289, 288, 287, 286, 285, 284, 283, 282, 281,
534 280, 279, 278, 277, 276, 275, 272, 271, 268, 267,
535 266, 265, 264, 263, 262, 261, 260, 259, 258, 257,
536 256, 255, 254, 253, 252, 251, 250, 249, 248, 247,
537 246, 245, 244, 240, 239, 238, 237, 236, 235, 234,
538 233, 232, 231, 230, 224, 223, 222, 221, 220, 219,
540 218, 217, 216, 215, 214, 213, 212, 211, 210, 209,
541 208, 204, 203, 202, 201, 200, 199, 198, 197, 196,
542 195, 194, 193, 192, 191, 190, 189, 188, 187, 186,
543 185, 184, 183, 182, 181, 180, 179, 178, 177, 176,
544 175, 174, 173, 172, 171, 170, 169, 168, 167, 166,
545 165, 164, 163, 162, 161, 160, 159, 158, 157, 156,
546 155, 154, 153, 152, 151, 150, 149, 148, 147, 146,
547 32, 145, 144, 143, 142, 138, 137, 136, 135, 134,
548 133, 128, 125, 122, 121, 120, 119, 118, 117, 116,
549 115, 110, 107, 106, 105, 102, 101, 100, 97, 94,
551 93, 92, 89, 88, 87, 86, 35, 32, 80, 69,
552 58, 57, 35, 32, 469, 3, 469, 469, 469, 469,
553 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
554 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
555 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
559 static yyconst short int yy_chk[552] =
560 { 0,
561 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
562 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
563 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
564 1, 1, 1, 1, 1, 5, 10, 5, 13, 11,
565 14, 15, 13, 11, 27, 10, 11, 15, 27, 20,
566 14, 10, 27, 10, 12, 45, 21, 20, 14, 45,
567 18, 12, 18, 20, 51, 12, 21, 20, 12, 472,
568 18, 18, 12, 12, 23, 24, 23, 24, 25, 23,
569 25, 51, 30, 25, 30, 32, 41, 55, 32, 41,
570 47, 47, 57, 24, 25, 58, 67, 55, 69, 71,
572 67, 72, 72, 58, 79, 465, 57, 84, 69, 71,
573 84, 148, 166, 464, 148, 181, 211, 211, 181, 211,
574 79, 166, 181, 241, 166, 166, 79, 166, 148, 214,
575 250, 463, 214, 269, 269, 250, 269, 460, 270, 241,
576 270, 270, 270, 270, 320, 459, 320, 320, 320, 320,
577 322, 458, 322, 322, 322, 322, 470, 470, 455, 470,
578 470, 471, 471, 454, 471, 471, 473, 453, 452, 473,
579 473, 474, 474, 446, 474, 474, 475, 475, 445, 444,
580 475, 441, 439, 438, 437, 436, 435, 434, 432, 431,
581 429, 428, 427, 425, 424, 423, 422, 421, 420, 419,
583 418, 416, 415, 414, 413, 410, 409, 408, 407, 405,
584 404, 403, 402, 401, 400, 399, 398, 397, 396, 395,
585 394, 393, 392, 391, 390, 389, 388, 387, 386, 383,
586 381, 380, 379, 375, 373, 372, 370, 368, 365, 364,
587 363, 362, 361, 360, 358, 357, 356, 355, 354, 353,
588 352, 350, 348, 347, 346, 345, 344, 343, 342, 340,
589 339, 338, 337, 336, 335, 334, 332, 331, 330, 329,
590 327, 325, 324, 321, 319, 318, 317, 316, 315, 314,
591 313, 312, 311, 309, 308, 306, 305, 304, 303, 302,
592 301, 300, 299, 298, 296, 295, 294, 293, 292, 291,
594 289, 287, 286, 285, 283, 282, 281, 280, 279, 278,
595 276, 275, 274, 273, 272, 271, 267, 266, 265, 264,
596 263, 262, 260, 258, 257, 255, 254, 252, 251, 249,
597 248, 246, 245, 244, 243, 242, 239, 238, 237, 236,
598 235, 232, 231, 229, 228, 227, 226, 225, 224, 223,
599 222, 221, 220, 219, 217, 216, 213, 212, 210, 207,
600 206, 205, 203, 202, 201, 200, 199, 198, 197, 196,
601 195, 194, 193, 192, 191, 190, 189, 187, 186, 185,
602 184, 183, 182, 180, 179, 178, 177, 176, 175, 174,
603 171, 170, 169, 167, 165, 164, 163, 162, 161, 160,
605 159, 158, 157, 156, 155, 154, 153, 152, 151, 150,
606 149, 147, 146, 145, 144, 143, 142, 141, 140, 139,
607 138, 137, 136, 135, 134, 133, 132, 131, 130, 129,
608 128, 126, 125, 124, 123, 122, 121, 120, 119, 118,
609 117, 116, 115, 114, 113, 112, 111, 110, 109, 108,
610 107, 105, 104, 103, 102, 101, 100, 99, 98, 97,
611 96, 95, 94, 93, 92, 91, 90, 89, 88, 86,
612 85, 83, 82, 81, 80, 78, 77, 76, 75, 74,
613 73, 70, 68, 66, 65, 64, 63, 62, 61, 60,
614 59, 56, 54, 53, 52, 50, 49, 48, 46, 44,
616 43, 42, 40, 39, 38, 37, 34, 31, 26, 22,
617 17, 16, 9, 7, 3, 469, 469, 469, 469, 469,
618 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
619 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
620 469, 469, 469, 469, 469, 469, 469, 469, 469, 469,
624 static yy_state_type yy_last_accepting_state;
625 static char *yy_last_accepting_cpos;
627 /* The intent behind this definition is that it'll catch
628 * any uses of REJECT which flex missed.
630 #define REJECT reject_used_but_not_detected
631 #define yymore() yymore_used_but_not_detected
632 #define YY_MORE_ADJ 0
633 #define YY_RESTORE_YY_MORE_OFFSET
634 char *yytext;
635 #line 1 "rclex.l"
636 #define INITIAL 0
637 #line 2 "rclex.l"
638 /* Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
639 Written by Ian Lance Taylor, Cygnus Support.
641 This file is part of GNU Binutils.
643 This program is free software; you can redistribute it and/or modify
644 it under the terms of the GNU General Public License as published by
645 the Free Software Foundation; either version 2 of the License, or
646 (at your option) any later version.
648 This program is distributed in the hope that it will be useful,
649 but WITHOUT ANY WARRANTY; without even the implied warranty of
650 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
651 GNU General Public License for more details.
653 You should have received a copy of the GNU General Public License
654 along with this program; if not, write to the Free Software
655 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
656 02111-1307, USA. */
658 /* This is a lex input file which generates a lexer used by the
659 Windows rc file parser. It basically just recognized a bunch of
660 keywords. */
662 #include "bfd.h"
663 #include "bucomm.h"
664 #include "libiberty.h"
665 #include "windres.h"
666 #include "rcparse.h"
668 #include <ctype.h>
669 #include <assert.h>
671 /* Whether we are in rcdata mode, in which we returns the lengths of
672 strings. */
674 static int rcdata_mode;
676 /* Whether we are supressing lines from cpp (including windows.h or
677 headers from your C sources may bring in externs and typedefs).
678 When active, we return IGNORED_TOKEN, which lets us ignore these
679 outside of resource constructs. Thus, it isn't required to protect
680 all the non-preprocessor lines in your header files with #ifdef
681 RC_INVOKED. It also means your RC file can't include other RC
682 files if they're named "*.h". Sorry. Name them *.rch or whatever. */
684 static int suppress_cpp_data;
686 #define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x)
688 /* The first filename we detect in the cpp output. We use this to
689 tell included files from the original file. */
691 static char *initial_fn;
693 /* List of allocated strings. */
695 struct alloc_string
697 struct alloc_string *next;
698 char *s;
701 static struct alloc_string *strings;
703 /* Local functions. */
705 static void cpp_line PARAMS ((const char *));
706 static char *handle_quotes PARAMS ((const char *, unsigned long *));
707 static char *get_string PARAMS ((int));
709 #line 710 "lex.yy.c"
711 /* Macros after this point can all be overridden by user definitions in
712 * section 1.
715 #ifndef YY_SKIP_YYWRAP
716 #ifdef __cplusplus
717 extern "C" int yywrap YY_PROTO(( void ));
718 #else
719 extern int yywrap YY_PROTO(( void ));
720 #endif
721 #endif
723 #ifndef YY_NO_UNPUT
724 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
725 #endif
727 #ifndef yytext_ptr
728 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
729 #endif
731 #ifdef YY_NEED_STRLEN
732 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
733 #endif
735 #ifndef YY_NO_INPUT
736 #ifdef __cplusplus
737 static int yyinput YY_PROTO(( void ));
738 #else
739 static int input YY_PROTO(( void ));
740 #endif
741 #endif
743 #if YY_STACK_USED
744 static int yy_start_stack_ptr = 0;
745 static int yy_start_stack_depth = 0;
746 static int *yy_start_stack = 0;
747 #ifndef YY_NO_PUSH_STATE
748 static void yy_push_state YY_PROTO(( int new_state ));
749 #endif
750 #ifndef YY_NO_POP_STATE
751 static void yy_pop_state YY_PROTO(( void ));
752 #endif
753 #ifndef YY_NO_TOP_STATE
754 static int yy_top_state YY_PROTO(( void ));
755 #endif
757 #else
758 #define YY_NO_PUSH_STATE 1
759 #define YY_NO_POP_STATE 1
760 #define YY_NO_TOP_STATE 1
761 #endif
763 #ifdef YY_MALLOC_DECL
764 YY_MALLOC_DECL
765 #else
766 #if __STDC__
767 #ifndef __cplusplus
768 #include <stdlib.h>
769 #endif
770 #else
771 /* Just try to get by without declaring the routines. This will fail
772 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
773 * or sizeof(void*) != sizeof(int).
775 #endif
776 #endif
778 /* Amount of stuff to slurp up with each read. */
779 #ifndef YY_READ_BUF_SIZE
780 #define YY_READ_BUF_SIZE 8192
781 #endif
783 /* Copy whatever the last rule matched to the standard output. */
785 #ifndef ECHO
786 /* This used to be an fputs(), but since the string might contain NUL's,
787 * we now use fwrite().
789 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
790 #endif
792 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
793 * is returned in "result".
795 #ifndef YY_INPUT
796 #define YY_INPUT(buf,result,max_size) \
797 if ( yy_current_buffer->yy_is_interactive ) \
799 int c = '*', n; \
800 for ( n = 0; n < max_size && \
801 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
802 buf[n] = (char) c; \
803 if ( c == '\n' ) \
804 buf[n++] = (char) c; \
805 if ( c == EOF && ferror( yyin ) ) \
806 YY_FATAL_ERROR( "input in flex scanner failed" ); \
807 result = n; \
809 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
810 && ferror( yyin ) ) \
811 YY_FATAL_ERROR( "input in flex scanner failed" );
812 #endif
814 /* No semi-colon after return; correct usage is to write "yyterminate();" -
815 * we don't want an extra ';' after the "return" because that will cause
816 * some compilers to complain about unreachable statements.
818 #ifndef yyterminate
819 #define yyterminate() return YY_NULL
820 #endif
822 /* Number of entries by which start-condition stack grows. */
823 #ifndef YY_START_STACK_INCR
824 #define YY_START_STACK_INCR 25
825 #endif
827 /* Report a fatal error. */
828 #ifndef YY_FATAL_ERROR
829 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
830 #endif
832 /* Default declaration of generated scanner - a define so the user can
833 * easily add parameters.
835 #ifndef YY_DECL
836 #define YY_DECL int yylex YY_PROTO(( void ))
837 #endif
839 /* Code executed at the beginning of each rule, after yytext and yyleng
840 * have been set up.
842 #ifndef YY_USER_ACTION
843 #define YY_USER_ACTION
844 #endif
846 /* Code executed at the end of each rule. */
847 #ifndef YY_BREAK
848 #define YY_BREAK break;
849 #endif
851 #define YY_RULE_SETUP \
852 YY_USER_ACTION
854 YY_DECL
856 register yy_state_type yy_current_state;
857 register char *yy_cp, *yy_bp;
858 register int yy_act;
860 #line 75 "rclex.l"
863 #line 864 "lex.yy.c"
865 if ( yy_init )
867 yy_init = 0;
869 #ifdef YY_USER_INIT
870 YY_USER_INIT;
871 #endif
873 if ( ! yy_start )
874 yy_start = 1; /* first start state */
876 if ( ! yyin )
877 yyin = stdin;
879 if ( ! yyout )
880 yyout = stdout;
882 if ( ! yy_current_buffer )
883 yy_current_buffer =
884 yy_create_buffer( yyin, YY_BUF_SIZE );
886 yy_load_buffer_state();
889 while ( 1 ) /* loops until end-of-file is reached */
891 yy_cp = yy_c_buf_p;
893 /* Support of yytext. */
894 *yy_cp = yy_hold_char;
896 /* yy_bp points to the position in yy_ch_buf of the start of
897 * the current run.
899 yy_bp = yy_cp;
901 yy_current_state = yy_start;
902 yy_match:
905 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
906 if ( yy_accept[yy_current_state] )
908 yy_last_accepting_state = yy_current_state;
909 yy_last_accepting_cpos = yy_cp;
911 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
913 yy_current_state = (int) yy_def[yy_current_state];
914 if ( yy_current_state >= 470 )
915 yy_c = yy_meta[(unsigned int) yy_c];
917 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
918 ++yy_cp;
920 while ( yy_base[yy_current_state] != 516 );
922 yy_find_action:
923 yy_act = yy_accept[yy_current_state];
924 if ( yy_act == 0 )
925 { /* have to back up */
926 yy_cp = yy_last_accepting_cpos;
927 yy_current_state = yy_last_accepting_state;
928 yy_act = yy_accept[yy_current_state];
931 YY_DO_BEFORE_ACTION;
934 do_action: /* This label is used only to access EOF actions. */
937 switch ( yy_act )
938 { /* beginning of action switch */
939 case 0: /* must back up */
940 /* undo the effects of YY_DO_BEFORE_ACTION */
941 *yy_cp = yy_hold_char;
942 yy_cp = yy_last_accepting_cpos;
943 yy_current_state = yy_last_accepting_state;
944 goto yy_find_action;
946 case 1:
947 YY_RULE_SETUP
948 #line 77 "rclex.l"
949 { MAYBE_RETURN (BEG); }
950 YY_BREAK
951 case 2:
952 YY_RULE_SETUP
953 #line 78 "rclex.l"
954 { MAYBE_RETURN (BEG); }
955 YY_BREAK
956 case 3:
957 YY_RULE_SETUP
958 #line 79 "rclex.l"
959 { MAYBE_RETURN (END); }
960 YY_BREAK
961 case 4:
962 YY_RULE_SETUP
963 #line 80 "rclex.l"
964 { MAYBE_RETURN (END); }
965 YY_BREAK
966 case 5:
967 YY_RULE_SETUP
968 #line 81 "rclex.l"
969 { MAYBE_RETURN (ACCELERATORS); }
970 YY_BREAK
971 case 6:
972 YY_RULE_SETUP
973 #line 82 "rclex.l"
974 { MAYBE_RETURN (VIRTKEY); }
975 YY_BREAK
976 case 7:
977 YY_RULE_SETUP
978 #line 83 "rclex.l"
979 { MAYBE_RETURN (ASCII); }
980 YY_BREAK
981 case 8:
982 YY_RULE_SETUP
983 #line 84 "rclex.l"
984 { MAYBE_RETURN (NOINVERT); }
985 YY_BREAK
986 case 9:
987 YY_RULE_SETUP
988 #line 85 "rclex.l"
989 { MAYBE_RETURN (SHIFT); }
990 YY_BREAK
991 case 10:
992 YY_RULE_SETUP
993 #line 86 "rclex.l"
994 { MAYBE_RETURN (CONTROL); }
995 YY_BREAK
996 case 11:
997 YY_RULE_SETUP
998 #line 87 "rclex.l"
999 { MAYBE_RETURN (ALT); }
1000 YY_BREAK
1001 case 12:
1002 YY_RULE_SETUP
1003 #line 88 "rclex.l"
1004 { MAYBE_RETURN (BITMAP); }
1005 YY_BREAK
1006 case 13:
1007 YY_RULE_SETUP
1008 #line 89 "rclex.l"
1009 { MAYBE_RETURN (CURSOR); }
1010 YY_BREAK
1011 case 14:
1012 YY_RULE_SETUP
1013 #line 90 "rclex.l"
1014 { MAYBE_RETURN (DIALOG); }
1015 YY_BREAK
1016 case 15:
1017 YY_RULE_SETUP
1018 #line 91 "rclex.l"
1019 { MAYBE_RETURN (DIALOGEX); }
1020 YY_BREAK
1021 case 16:
1022 YY_RULE_SETUP
1023 #line 92 "rclex.l"
1024 { MAYBE_RETURN (EXSTYLE); }
1025 YY_BREAK
1026 case 17:
1027 YY_RULE_SETUP
1028 #line 93 "rclex.l"
1029 { MAYBE_RETURN (CAPTION); }
1030 YY_BREAK
1031 case 18:
1032 YY_RULE_SETUP
1033 #line 94 "rclex.l"
1034 { MAYBE_RETURN (CLASS); }
1035 YY_BREAK
1036 case 19:
1037 YY_RULE_SETUP
1038 #line 95 "rclex.l"
1039 { MAYBE_RETURN (STYLE); }
1040 YY_BREAK
1041 case 20:
1042 YY_RULE_SETUP
1043 #line 96 "rclex.l"
1044 { MAYBE_RETURN (AUTO3STATE); }
1045 YY_BREAK
1046 case 21:
1047 YY_RULE_SETUP
1048 #line 97 "rclex.l"
1049 { MAYBE_RETURN (AUTOCHECKBOX); }
1050 YY_BREAK
1051 case 22:
1052 YY_RULE_SETUP
1053 #line 98 "rclex.l"
1054 { MAYBE_RETURN (AUTORADIOBUTTON); }
1055 YY_BREAK
1056 case 23:
1057 YY_RULE_SETUP
1058 #line 99 "rclex.l"
1059 { MAYBE_RETURN (CHECKBOX); }
1060 YY_BREAK
1061 case 24:
1062 YY_RULE_SETUP
1063 #line 100 "rclex.l"
1064 { MAYBE_RETURN (COMBOBOX); }
1065 YY_BREAK
1066 case 25:
1067 YY_RULE_SETUP
1068 #line 101 "rclex.l"
1069 { MAYBE_RETURN (CTEXT); }
1070 YY_BREAK
1071 case 26:
1072 YY_RULE_SETUP
1073 #line 102 "rclex.l"
1074 { MAYBE_RETURN (DEFPUSHBUTTON); }
1075 YY_BREAK
1076 case 27:
1077 YY_RULE_SETUP
1078 #line 103 "rclex.l"
1079 { MAYBE_RETURN (EDITTEXT); }
1080 YY_BREAK
1081 case 28:
1082 YY_RULE_SETUP
1083 #line 104 "rclex.l"
1084 { MAYBE_RETURN (GROUPBOX); }
1085 YY_BREAK
1086 case 29:
1087 YY_RULE_SETUP
1088 #line 105 "rclex.l"
1089 { MAYBE_RETURN (LISTBOX); }
1090 YY_BREAK
1091 case 30:
1092 YY_RULE_SETUP
1093 #line 106 "rclex.l"
1094 { MAYBE_RETURN (LTEXT); }
1095 YY_BREAK
1096 case 31:
1097 YY_RULE_SETUP
1098 #line 107 "rclex.l"
1099 { MAYBE_RETURN (PUSHBOX); }
1100 YY_BREAK
1101 case 32:
1102 YY_RULE_SETUP
1103 #line 108 "rclex.l"
1104 { MAYBE_RETURN (PUSHBUTTON); }
1105 YY_BREAK
1106 case 33:
1107 YY_RULE_SETUP
1108 #line 109 "rclex.l"
1109 { MAYBE_RETURN (RADIOBUTTON); }
1110 YY_BREAK
1111 case 34:
1112 YY_RULE_SETUP
1113 #line 110 "rclex.l"
1114 { MAYBE_RETURN (RTEXT); }
1115 YY_BREAK
1116 case 35:
1117 YY_RULE_SETUP
1118 #line 111 "rclex.l"
1119 { MAYBE_RETURN (SCROLLBAR); }
1120 YY_BREAK
1121 case 36:
1122 YY_RULE_SETUP
1123 #line 112 "rclex.l"
1124 { MAYBE_RETURN (STATE3); }
1125 YY_BREAK
1126 case 37:
1127 YY_RULE_SETUP
1128 #line 113 "rclex.l"
1129 { MAYBE_RETURN (USERBUTTON); }
1130 YY_BREAK
1131 case 38:
1132 YY_RULE_SETUP
1133 #line 114 "rclex.l"
1134 { MAYBE_RETURN (BEDIT); }
1135 YY_BREAK
1136 case 39:
1137 YY_RULE_SETUP
1138 #line 115 "rclex.l"
1139 { MAYBE_RETURN (HEDIT); }
1140 YY_BREAK
1141 case 40:
1142 YY_RULE_SETUP
1143 #line 116 "rclex.l"
1144 { MAYBE_RETURN (IEDIT); }
1145 YY_BREAK
1146 case 41:
1147 YY_RULE_SETUP
1148 #line 117 "rclex.l"
1149 { MAYBE_RETURN (FONT); }
1150 YY_BREAK
1151 case 42:
1152 YY_RULE_SETUP
1153 #line 118 "rclex.l"
1154 { MAYBE_RETURN (ICON); }
1155 YY_BREAK
1156 case 43:
1157 YY_RULE_SETUP
1158 #line 119 "rclex.l"
1159 { MAYBE_RETURN (LANGUAGE); }
1160 YY_BREAK
1161 case 44:
1162 YY_RULE_SETUP
1163 #line 120 "rclex.l"
1164 { MAYBE_RETURN (CHARACTERISTICS); }
1165 YY_BREAK
1166 case 45:
1167 YY_RULE_SETUP
1168 #line 121 "rclex.l"
1169 { MAYBE_RETURN (VERSIONK); }
1170 YY_BREAK
1171 case 46:
1172 YY_RULE_SETUP
1173 #line 122 "rclex.l"
1174 { MAYBE_RETURN (MENU); }
1175 YY_BREAK
1176 case 47:
1177 YY_RULE_SETUP
1178 #line 123 "rclex.l"
1179 { MAYBE_RETURN (MENUEX); }
1180 YY_BREAK
1181 case 48:
1182 YY_RULE_SETUP
1183 #line 124 "rclex.l"
1184 { MAYBE_RETURN (MENUITEM); }
1185 YY_BREAK
1186 case 49:
1187 YY_RULE_SETUP
1188 #line 125 "rclex.l"
1189 { MAYBE_RETURN (SEPARATOR); }
1190 YY_BREAK
1191 case 50:
1192 YY_RULE_SETUP
1193 #line 126 "rclex.l"
1194 { MAYBE_RETURN (POPUP); }
1195 YY_BREAK
1196 case 51:
1197 YY_RULE_SETUP
1198 #line 127 "rclex.l"
1199 { MAYBE_RETURN (CHECKED); }
1200 YY_BREAK
1201 case 52:
1202 YY_RULE_SETUP
1203 #line 128 "rclex.l"
1204 { MAYBE_RETURN (GRAYED); }
1205 YY_BREAK
1206 case 53:
1207 YY_RULE_SETUP
1208 #line 129 "rclex.l"
1209 { MAYBE_RETURN (HELP); }
1210 YY_BREAK
1211 case 54:
1212 YY_RULE_SETUP
1213 #line 130 "rclex.l"
1214 { MAYBE_RETURN (INACTIVE); }
1215 YY_BREAK
1216 case 55:
1217 YY_RULE_SETUP
1218 #line 131 "rclex.l"
1219 { MAYBE_RETURN (MENUBARBREAK); }
1220 YY_BREAK
1221 case 56:
1222 YY_RULE_SETUP
1223 #line 132 "rclex.l"
1224 { MAYBE_RETURN (MENUBREAK); }
1225 YY_BREAK
1226 case 57:
1227 YY_RULE_SETUP
1228 #line 133 "rclex.l"
1229 { MAYBE_RETURN (MESSAGETABLE); }
1230 YY_BREAK
1231 case 58:
1232 YY_RULE_SETUP
1233 #line 134 "rclex.l"
1234 { MAYBE_RETURN (RCDATA); }
1235 YY_BREAK
1236 case 59:
1237 YY_RULE_SETUP
1238 #line 135 "rclex.l"
1239 { MAYBE_RETURN (STRINGTABLE); }
1240 YY_BREAK
1241 case 60:
1242 YY_RULE_SETUP
1243 #line 136 "rclex.l"
1244 { MAYBE_RETURN (VERSIONINFO); }
1245 YY_BREAK
1246 case 61:
1247 YY_RULE_SETUP
1248 #line 137 "rclex.l"
1249 { MAYBE_RETURN (FILEVERSION); }
1250 YY_BREAK
1251 case 62:
1252 YY_RULE_SETUP
1253 #line 138 "rclex.l"
1254 { MAYBE_RETURN (PRODUCTVERSION); }
1255 YY_BREAK
1256 case 63:
1257 YY_RULE_SETUP
1258 #line 139 "rclex.l"
1259 { MAYBE_RETURN (FILEFLAGSMASK); }
1260 YY_BREAK
1261 case 64:
1262 YY_RULE_SETUP
1263 #line 140 "rclex.l"
1264 { MAYBE_RETURN (FILEFLAGS); }
1265 YY_BREAK
1266 case 65:
1267 YY_RULE_SETUP
1268 #line 141 "rclex.l"
1269 { MAYBE_RETURN (FILEOS); }
1270 YY_BREAK
1271 case 66:
1272 YY_RULE_SETUP
1273 #line 142 "rclex.l"
1274 { MAYBE_RETURN (FILETYPE); }
1275 YY_BREAK
1276 case 67:
1277 YY_RULE_SETUP
1278 #line 143 "rclex.l"
1279 { MAYBE_RETURN (FILESUBTYPE); }
1280 YY_BREAK
1281 case 68:
1282 YY_RULE_SETUP
1283 #line 144 "rclex.l"
1284 { MAYBE_RETURN (VALUE); }
1285 YY_BREAK
1286 case 69:
1287 YY_RULE_SETUP
1288 #line 145 "rclex.l"
1289 { MAYBE_RETURN (MOVEABLE); }
1290 YY_BREAK
1291 case 70:
1292 YY_RULE_SETUP
1293 #line 146 "rclex.l"
1294 { MAYBE_RETURN (FIXED); }
1295 YY_BREAK
1296 case 71:
1297 YY_RULE_SETUP
1298 #line 147 "rclex.l"
1299 { MAYBE_RETURN (PURE); }
1300 YY_BREAK
1301 case 72:
1302 YY_RULE_SETUP
1303 #line 148 "rclex.l"
1304 { MAYBE_RETURN (IMPURE); }
1305 YY_BREAK
1306 case 73:
1307 YY_RULE_SETUP
1308 #line 149 "rclex.l"
1309 { MAYBE_RETURN (PRELOAD); }
1310 YY_BREAK
1311 case 74:
1312 YY_RULE_SETUP
1313 #line 150 "rclex.l"
1314 { MAYBE_RETURN (LOADONCALL); }
1315 YY_BREAK
1316 case 75:
1317 YY_RULE_SETUP
1318 #line 151 "rclex.l"
1319 { MAYBE_RETURN (DISCARDABLE); }
1320 YY_BREAK
1321 case 76:
1322 YY_RULE_SETUP
1323 #line 152 "rclex.l"
1324 { MAYBE_RETURN (NOT); }
1325 YY_BREAK
1326 case 77:
1327 YY_RULE_SETUP
1328 #line 154 "rclex.l"
1330 char *s, *send;
1332 /* This is a hack to let us parse version
1333 information easily. */
1335 s = strchr (yytext, '"');
1336 ++s;
1337 send = strchr (s, '"');
1338 if (strncmp (s, "StringFileInfo",
1339 sizeof "StringFileInfo" - 1) == 0
1340 && s + sizeof "StringFileInfo" - 1 == send)
1341 MAYBE_RETURN (BLOCKSTRINGFILEINFO);
1342 else if (strncmp (s, "VarFileInfo",
1343 sizeof "VarFileInfo" - 1) == 0
1344 && s + sizeof "VarFileInfo" - 1 == send)
1345 MAYBE_RETURN (BLOCKVARFILEINFO);
1346 else
1348 char *r;
1350 r = get_string (send - s + 1);
1351 strncpy (r, s, send - s);
1352 r[send - s] = '\0';
1353 yylval.s = r;
1354 MAYBE_RETURN (BLOCK);
1357 YY_BREAK
1358 case 78:
1359 YY_RULE_SETUP
1360 #line 183 "rclex.l"
1362 cpp_line (yytext);
1364 YY_BREAK
1365 case 79:
1366 YY_RULE_SETUP
1367 #line 187 "rclex.l"
1369 yylval.i.val = strtoul (yytext, 0, 0);
1370 yylval.i.dword = 1;
1371 MAYBE_RETURN (NUMBER);
1373 YY_BREAK
1374 case 80:
1375 YY_RULE_SETUP
1376 #line 193 "rclex.l"
1378 yylval.i.val = strtoul (yytext, 0, 0);
1379 yylval.i.dword = 0;
1380 MAYBE_RETURN (NUMBER);
1382 YY_BREAK
1383 case 81:
1384 YY_RULE_SETUP
1385 #line 199 "rclex.l"
1387 char *s;
1388 unsigned long length;
1390 s = handle_quotes (yytext, &length);
1391 if (! rcdata_mode)
1393 yylval.s = s;
1394 MAYBE_RETURN (QUOTEDSTRING);
1396 else
1398 yylval.ss.length = length;
1399 yylval.ss.s = s;
1400 MAYBE_RETURN (SIZEDSTRING);
1403 YY_BREAK
1404 case 82:
1405 YY_RULE_SETUP
1406 #line 217 "rclex.l"
1408 char *s;
1410 /* I rejected comma in a string in order to
1411 handle VIRTKEY, CONTROL in an accelerator
1412 resource. This means that an unquoted
1413 file name can not contain a comma. I
1414 don't know what rc permits. */
1416 s = get_string (strlen (yytext) + 1);
1417 strcpy (s, yytext);
1418 yylval.s = s;
1419 MAYBE_RETURN (STRING);
1421 YY_BREAK
1422 case 83:
1423 YY_RULE_SETUP
1424 #line 232 "rclex.l"
1425 { ++rc_lineno; }
1426 YY_BREAK
1427 case 84:
1428 YY_RULE_SETUP
1429 #line 233 "rclex.l"
1430 { /* ignore whitespace */ }
1431 YY_BREAK
1432 case 85:
1433 YY_RULE_SETUP
1434 #line 234 "rclex.l"
1435 { MAYBE_RETURN (*yytext); }
1436 YY_BREAK
1437 case 86:
1438 YY_RULE_SETUP
1439 #line 236 "rclex.l"
1440 ECHO;
1441 YY_BREAK
1442 #line 1443 "lex.yy.c"
1443 case YY_STATE_EOF(INITIAL):
1444 yyterminate();
1446 case YY_END_OF_BUFFER:
1448 /* Amount of text matched not including the EOB char. */
1449 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1451 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1452 *yy_cp = yy_hold_char;
1453 YY_RESTORE_YY_MORE_OFFSET
1455 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1457 /* We're scanning a new file or input source. It's
1458 * possible that this happened because the user
1459 * just pointed yyin at a new source and called
1460 * yylex(). If so, then we have to assure
1461 * consistency between yy_current_buffer and our
1462 * globals. Here is the right place to do so, because
1463 * this is the first action (other than possibly a
1464 * back-up) that will match for the new input source.
1466 yy_n_chars = yy_current_buffer->yy_n_chars;
1467 yy_current_buffer->yy_input_file = yyin;
1468 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1471 /* Note that here we test for yy_c_buf_p "<=" to the position
1472 * of the first EOB in the buffer, since yy_c_buf_p will
1473 * already have been incremented past the NUL character
1474 * (since all states make transitions on EOB to the
1475 * end-of-buffer state). Contrast this with the test
1476 * in input().
1478 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1479 { /* This was really a NUL. */
1480 yy_state_type yy_next_state;
1482 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1484 yy_current_state = yy_get_previous_state();
1486 /* Okay, we're now positioned to make the NUL
1487 * transition. We couldn't have
1488 * yy_get_previous_state() go ahead and do it
1489 * for us because it doesn't know how to deal
1490 * with the possibility of jamming (and we don't
1491 * want to build jamming into it because then it
1492 * will run more slowly).
1495 yy_next_state = yy_try_NUL_trans( yy_current_state );
1497 yy_bp = yytext_ptr + YY_MORE_ADJ;
1499 if ( yy_next_state )
1501 /* Consume the NUL. */
1502 yy_cp = ++yy_c_buf_p;
1503 yy_current_state = yy_next_state;
1504 goto yy_match;
1507 else
1509 yy_cp = yy_c_buf_p;
1510 goto yy_find_action;
1514 else switch ( yy_get_next_buffer() )
1516 case EOB_ACT_END_OF_FILE:
1518 yy_did_buffer_switch_on_eof = 0;
1520 if ( yywrap() )
1522 /* Note: because we've taken care in
1523 * yy_get_next_buffer() to have set up
1524 * yytext, we can now set up
1525 * yy_c_buf_p so that if some total
1526 * hoser (like flex itself) wants to
1527 * call the scanner after we return the
1528 * YY_NULL, it'll still work - another
1529 * YY_NULL will get returned.
1531 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1533 yy_act = YY_STATE_EOF(YY_START);
1534 goto do_action;
1537 else
1539 if ( ! yy_did_buffer_switch_on_eof )
1540 YY_NEW_FILE;
1542 break;
1545 case EOB_ACT_CONTINUE_SCAN:
1546 yy_c_buf_p =
1547 yytext_ptr + yy_amount_of_matched_text;
1549 yy_current_state = yy_get_previous_state();
1551 yy_cp = yy_c_buf_p;
1552 yy_bp = yytext_ptr + YY_MORE_ADJ;
1553 goto yy_match;
1555 case EOB_ACT_LAST_MATCH:
1556 yy_c_buf_p =
1557 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1559 yy_current_state = yy_get_previous_state();
1561 yy_cp = yy_c_buf_p;
1562 yy_bp = yytext_ptr + YY_MORE_ADJ;
1563 goto yy_find_action;
1565 break;
1568 default:
1569 YY_FATAL_ERROR(
1570 "fatal flex scanner internal error--no action found" );
1571 } /* end of action switch */
1572 } /* end of scanning one token */
1573 } /* end of yylex */
1576 /* yy_get_next_buffer - try to read in a new buffer
1578 * Returns a code representing an action:
1579 * EOB_ACT_LAST_MATCH -
1580 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1581 * EOB_ACT_END_OF_FILE - end of file
1584 static int yy_get_next_buffer()
1586 register char *dest = yy_current_buffer->yy_ch_buf;
1587 register char *source = yytext_ptr;
1588 register int number_to_move, i;
1589 int ret_val;
1591 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1592 YY_FATAL_ERROR(
1593 "fatal flex scanner internal error--end of buffer missed" );
1595 if ( yy_current_buffer->yy_fill_buffer == 0 )
1596 { /* Don't try to fill the buffer, so this is an EOF. */
1597 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1599 /* We matched a single character, the EOB, so
1600 * treat this as a final EOF.
1602 return EOB_ACT_END_OF_FILE;
1605 else
1607 /* We matched some text prior to the EOB, first
1608 * process it.
1610 return EOB_ACT_LAST_MATCH;
1614 /* Try to read more data. */
1616 /* First move last chars to start of buffer. */
1617 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1619 for ( i = 0; i < number_to_move; ++i )
1620 *(dest++) = *(source++);
1622 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1623 /* don't do the read, it's not guaranteed to return an EOF,
1624 * just force an EOF
1626 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1628 else
1630 int num_to_read =
1631 yy_current_buffer->yy_buf_size - number_to_move - 1;
1633 while ( num_to_read <= 0 )
1634 { /* Not enough room in the buffer - grow it. */
1635 #ifdef YY_USES_REJECT
1636 YY_FATAL_ERROR(
1637 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1638 #else
1640 /* just a shorter name for the current buffer */
1641 YY_BUFFER_STATE b = yy_current_buffer;
1643 int yy_c_buf_p_offset =
1644 (int) (yy_c_buf_p - b->yy_ch_buf);
1646 if ( b->yy_is_our_buffer )
1648 int new_size = b->yy_buf_size * 2;
1650 if ( new_size <= 0 )
1651 b->yy_buf_size += b->yy_buf_size / 8;
1652 else
1653 b->yy_buf_size *= 2;
1655 b->yy_ch_buf = (char *)
1656 /* Include room in for 2 EOB chars. */
1657 yy_flex_realloc( (void *) b->yy_ch_buf,
1658 b->yy_buf_size + 2 );
1660 else
1661 /* Can't grow it, we don't own it. */
1662 b->yy_ch_buf = 0;
1664 if ( ! b->yy_ch_buf )
1665 YY_FATAL_ERROR(
1666 "fatal error - scanner input buffer overflow" );
1668 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1670 num_to_read = yy_current_buffer->yy_buf_size -
1671 number_to_move - 1;
1672 #endif
1675 if ( num_to_read > YY_READ_BUF_SIZE )
1676 num_to_read = YY_READ_BUF_SIZE;
1678 /* Read in more data. */
1679 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1680 yy_n_chars, num_to_read );
1682 yy_current_buffer->yy_n_chars = yy_n_chars;
1685 if ( yy_n_chars == 0 )
1687 if ( number_to_move == YY_MORE_ADJ )
1689 ret_val = EOB_ACT_END_OF_FILE;
1690 yyrestart( yyin );
1693 else
1695 ret_val = EOB_ACT_LAST_MATCH;
1696 yy_current_buffer->yy_buffer_status =
1697 YY_BUFFER_EOF_PENDING;
1701 else
1702 ret_val = EOB_ACT_CONTINUE_SCAN;
1704 yy_n_chars += number_to_move;
1705 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1706 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1708 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1710 return ret_val;
1714 /* yy_get_previous_state - get the state just before the EOB char was reached */
1716 static yy_state_type yy_get_previous_state()
1718 register yy_state_type yy_current_state;
1719 register char *yy_cp;
1721 yy_current_state = yy_start;
1723 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1725 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1726 if ( yy_accept[yy_current_state] )
1728 yy_last_accepting_state = yy_current_state;
1729 yy_last_accepting_cpos = yy_cp;
1731 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1733 yy_current_state = (int) yy_def[yy_current_state];
1734 if ( yy_current_state >= 470 )
1735 yy_c = yy_meta[(unsigned int) yy_c];
1737 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1740 return yy_current_state;
1744 /* yy_try_NUL_trans - try to make a transition on the NUL character
1746 * synopsis
1747 * next_state = yy_try_NUL_trans( current_state );
1750 #ifdef YY_USE_PROTOS
1751 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1752 #else
1753 static yy_state_type yy_try_NUL_trans( yy_current_state )
1754 yy_state_type yy_current_state;
1755 #endif
1757 register int yy_is_jam;
1758 register char *yy_cp = yy_c_buf_p;
1760 register YY_CHAR yy_c = 1;
1761 if ( yy_accept[yy_current_state] )
1763 yy_last_accepting_state = yy_current_state;
1764 yy_last_accepting_cpos = yy_cp;
1766 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1768 yy_current_state = (int) yy_def[yy_current_state];
1769 if ( yy_current_state >= 470 )
1770 yy_c = yy_meta[(unsigned int) yy_c];
1772 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1773 yy_is_jam = (yy_current_state == 469);
1775 return yy_is_jam ? 0 : yy_current_state;
1779 #ifndef YY_NO_UNPUT
1780 #ifdef YY_USE_PROTOS
1781 static void yyunput( int c, register char *yy_bp )
1782 #else
1783 static void yyunput( c, yy_bp )
1784 int c;
1785 register char *yy_bp;
1786 #endif
1788 register char *yy_cp = yy_c_buf_p;
1790 /* undo effects of setting up yytext */
1791 *yy_cp = yy_hold_char;
1793 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1794 { /* need to shift things up to make room */
1795 /* +2 for EOB chars. */
1796 register int number_to_move = yy_n_chars + 2;
1797 register char *dest = &yy_current_buffer->yy_ch_buf[
1798 yy_current_buffer->yy_buf_size + 2];
1799 register char *source =
1800 &yy_current_buffer->yy_ch_buf[number_to_move];
1802 while ( source > yy_current_buffer->yy_ch_buf )
1803 *--dest = *--source;
1805 yy_cp += (int) (dest - source);
1806 yy_bp += (int) (dest - source);
1807 yy_current_buffer->yy_n_chars =
1808 yy_n_chars = yy_current_buffer->yy_buf_size;
1810 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1811 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1814 *--yy_cp = (char) c;
1817 yytext_ptr = yy_bp;
1818 yy_hold_char = *yy_cp;
1819 yy_c_buf_p = yy_cp;
1821 #endif /* ifndef YY_NO_UNPUT */
1824 #ifdef __cplusplus
1825 static int yyinput()
1826 #else
1827 static int input()
1828 #endif
1830 int c;
1832 *yy_c_buf_p = yy_hold_char;
1834 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1836 /* yy_c_buf_p now points to the character we want to return.
1837 * If this occurs *before* the EOB characters, then it's a
1838 * valid NUL; if not, then we've hit the end of the buffer.
1840 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1841 /* This was really a NUL. */
1842 *yy_c_buf_p = '\0';
1844 else
1845 { /* need more input */
1846 int offset = yy_c_buf_p - yytext_ptr;
1847 ++yy_c_buf_p;
1849 switch ( yy_get_next_buffer() )
1851 case EOB_ACT_LAST_MATCH:
1852 /* This happens because yy_g_n_b()
1853 * sees that we've accumulated a
1854 * token and flags that we need to
1855 * try matching the token before
1856 * proceeding. But for input(),
1857 * there's no matching to consider.
1858 * So convert the EOB_ACT_LAST_MATCH
1859 * to EOB_ACT_END_OF_FILE.
1862 /* Reset buffer status. */
1863 yyrestart( yyin );
1865 /* fall through */
1867 case EOB_ACT_END_OF_FILE:
1869 if ( yywrap() )
1870 return EOF;
1872 if ( ! yy_did_buffer_switch_on_eof )
1873 YY_NEW_FILE;
1874 #ifdef __cplusplus
1875 return yyinput();
1876 #else
1877 return input();
1878 #endif
1881 case EOB_ACT_CONTINUE_SCAN:
1882 yy_c_buf_p = yytext_ptr + offset;
1883 break;
1888 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1889 *yy_c_buf_p = '\0'; /* preserve yytext */
1890 yy_hold_char = *++yy_c_buf_p;
1893 return c;
1897 #ifdef YY_USE_PROTOS
1898 void yyrestart( FILE *input_file )
1899 #else
1900 void yyrestart( input_file )
1901 FILE *input_file;
1902 #endif
1904 if ( ! yy_current_buffer )
1905 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1907 yy_init_buffer( yy_current_buffer, input_file );
1908 yy_load_buffer_state();
1912 #ifdef YY_USE_PROTOS
1913 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1914 #else
1915 void yy_switch_to_buffer( new_buffer )
1916 YY_BUFFER_STATE new_buffer;
1917 #endif
1919 if ( yy_current_buffer == new_buffer )
1920 return;
1922 if ( yy_current_buffer )
1924 /* Flush out information for old buffer. */
1925 *yy_c_buf_p = yy_hold_char;
1926 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1927 yy_current_buffer->yy_n_chars = yy_n_chars;
1930 yy_current_buffer = new_buffer;
1931 yy_load_buffer_state();
1933 /* We don't actually know whether we did this switch during
1934 * EOF (yywrap()) processing, but the only time this flag
1935 * is looked at is after yywrap() is called, so it's safe
1936 * to go ahead and always set it.
1938 yy_did_buffer_switch_on_eof = 1;
1942 #ifdef YY_USE_PROTOS
1943 void yy_load_buffer_state( void )
1944 #else
1945 void yy_load_buffer_state()
1946 #endif
1948 yy_n_chars = yy_current_buffer->yy_n_chars;
1949 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1950 yyin = yy_current_buffer->yy_input_file;
1951 yy_hold_char = *yy_c_buf_p;
1955 #ifdef YY_USE_PROTOS
1956 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1957 #else
1958 YY_BUFFER_STATE yy_create_buffer( file, size )
1959 FILE *file;
1960 int size;
1961 #endif
1963 YY_BUFFER_STATE b;
1965 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1966 if ( ! b )
1967 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1969 b->yy_buf_size = size;
1971 /* yy_ch_buf has to be 2 characters longer than the size given because
1972 * we need to put in 2 end-of-buffer characters.
1974 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1975 if ( ! b->yy_ch_buf )
1976 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1978 b->yy_is_our_buffer = 1;
1980 yy_init_buffer( b, file );
1982 return b;
1986 #ifdef YY_USE_PROTOS
1987 void yy_delete_buffer( YY_BUFFER_STATE b )
1988 #else
1989 void yy_delete_buffer( b )
1990 YY_BUFFER_STATE b;
1991 #endif
1993 if ( ! b )
1994 return;
1996 if ( b == yy_current_buffer )
1997 yy_current_buffer = (YY_BUFFER_STATE) 0;
1999 if ( b->yy_is_our_buffer )
2000 yy_flex_free( (void *) b->yy_ch_buf );
2002 yy_flex_free( (void *) b );
2006 #ifndef YY_ALWAYS_INTERACTIVE
2007 #ifndef YY_NEVER_INTERACTIVE
2008 extern int isatty YY_PROTO(( int ));
2009 #endif
2010 #endif
2012 #ifdef YY_USE_PROTOS
2013 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2014 #else
2015 void yy_init_buffer( b, file )
2016 YY_BUFFER_STATE b;
2017 FILE *file;
2018 #endif
2022 yy_flush_buffer( b );
2024 b->yy_input_file = file;
2025 b->yy_fill_buffer = 1;
2027 #if YY_ALWAYS_INTERACTIVE
2028 b->yy_is_interactive = 1;
2029 #else
2030 #if YY_NEVER_INTERACTIVE
2031 b->yy_is_interactive = 0;
2032 #else
2033 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2034 #endif
2035 #endif
2039 #ifdef YY_USE_PROTOS
2040 void yy_flush_buffer( YY_BUFFER_STATE b )
2041 #else
2042 void yy_flush_buffer( b )
2043 YY_BUFFER_STATE b;
2044 #endif
2047 if ( ! b )
2048 return;
2050 b->yy_n_chars = 0;
2052 /* We always need two end-of-buffer characters. The first causes
2053 * a transition to the end-of-buffer state. The second causes
2054 * a jam in that state.
2056 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2057 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2059 b->yy_buf_pos = &b->yy_ch_buf[0];
2061 b->yy_at_bol = 1;
2062 b->yy_buffer_status = YY_BUFFER_NEW;
2064 if ( b == yy_current_buffer )
2065 yy_load_buffer_state();
2069 #ifndef YY_NO_SCAN_BUFFER
2070 #ifdef YY_USE_PROTOS
2071 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2072 #else
2073 YY_BUFFER_STATE yy_scan_buffer( base, size )
2074 char *base;
2075 yy_size_t size;
2076 #endif
2078 YY_BUFFER_STATE b;
2080 if ( size < 2 ||
2081 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2082 base[size-1] != YY_END_OF_BUFFER_CHAR )
2083 /* They forgot to leave room for the EOB's. */
2084 return 0;
2086 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2087 if ( ! b )
2088 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2090 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2091 b->yy_buf_pos = b->yy_ch_buf = base;
2092 b->yy_is_our_buffer = 0;
2093 b->yy_input_file = 0;
2094 b->yy_n_chars = b->yy_buf_size;
2095 b->yy_is_interactive = 0;
2096 b->yy_at_bol = 1;
2097 b->yy_fill_buffer = 0;
2098 b->yy_buffer_status = YY_BUFFER_NEW;
2100 yy_switch_to_buffer( b );
2102 return b;
2104 #endif
2107 #ifndef YY_NO_SCAN_STRING
2108 #ifdef YY_USE_PROTOS
2109 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2110 #else
2111 YY_BUFFER_STATE yy_scan_string( yy_str )
2112 yyconst char *yy_str;
2113 #endif
2115 int len;
2116 for ( len = 0; yy_str[len]; ++len )
2119 return yy_scan_bytes( yy_str, len );
2121 #endif
2124 #ifndef YY_NO_SCAN_BYTES
2125 #ifdef YY_USE_PROTOS
2126 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2127 #else
2128 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2129 yyconst char *bytes;
2130 int len;
2131 #endif
2133 YY_BUFFER_STATE b;
2134 char *buf;
2135 yy_size_t n;
2136 int i;
2138 /* Get memory for full buffer, including space for trailing EOB's. */
2139 n = len + 2;
2140 buf = (char *) yy_flex_alloc( n );
2141 if ( ! buf )
2142 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2144 for ( i = 0; i < len; ++i )
2145 buf[i] = bytes[i];
2147 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2149 b = yy_scan_buffer( buf, n );
2150 if ( ! b )
2151 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2153 /* It's okay to grow etc. this buffer, and we should throw it
2154 * away when we're done.
2156 b->yy_is_our_buffer = 1;
2158 return b;
2160 #endif
2163 #ifndef YY_NO_PUSH_STATE
2164 #ifdef YY_USE_PROTOS
2165 static void yy_push_state( int new_state )
2166 #else
2167 static void yy_push_state( new_state )
2168 int new_state;
2169 #endif
2171 if ( yy_start_stack_ptr >= yy_start_stack_depth )
2173 yy_size_t new_size;
2175 yy_start_stack_depth += YY_START_STACK_INCR;
2176 new_size = yy_start_stack_depth * sizeof( int );
2178 if ( ! yy_start_stack )
2179 yy_start_stack = (int *) yy_flex_alloc( new_size );
2181 else
2182 yy_start_stack = (int *) yy_flex_realloc(
2183 (void *) yy_start_stack, new_size );
2185 if ( ! yy_start_stack )
2186 YY_FATAL_ERROR(
2187 "out of memory expanding start-condition stack" );
2190 yy_start_stack[yy_start_stack_ptr++] = YY_START;
2192 BEGIN(new_state);
2194 #endif
2197 #ifndef YY_NO_POP_STATE
2198 static void yy_pop_state()
2200 if ( --yy_start_stack_ptr < 0 )
2201 YY_FATAL_ERROR( "start-condition stack underflow" );
2203 BEGIN(yy_start_stack[yy_start_stack_ptr]);
2205 #endif
2208 #ifndef YY_NO_TOP_STATE
2209 static int yy_top_state()
2211 return yy_start_stack[yy_start_stack_ptr - 1];
2213 #endif
2215 #ifndef YY_EXIT_FAILURE
2216 #define YY_EXIT_FAILURE 2
2217 #endif
2219 #ifdef YY_USE_PROTOS
2220 static void yy_fatal_error( yyconst char msg[] )
2221 #else
2222 static void yy_fatal_error( msg )
2223 char msg[];
2224 #endif
2226 (void) fprintf( stderr, "%s\n", msg );
2227 exit( YY_EXIT_FAILURE );
2232 /* Redefine yyless() so it works in section 3 code. */
2234 #undef yyless
2235 #define yyless(n) \
2236 do \
2238 /* Undo effects of setting up yytext. */ \
2239 yytext[yyleng] = yy_hold_char; \
2240 yy_c_buf_p = yytext + n; \
2241 yy_hold_char = *yy_c_buf_p; \
2242 *yy_c_buf_p = '\0'; \
2243 yyleng = n; \
2245 while ( 0 )
2248 /* Internal utility routines. */
2250 #ifndef yytext_ptr
2251 #ifdef YY_USE_PROTOS
2252 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2253 #else
2254 static void yy_flex_strncpy( s1, s2, n )
2255 char *s1;
2256 yyconst char *s2;
2257 int n;
2258 #endif
2260 register int i;
2261 for ( i = 0; i < n; ++i )
2262 s1[i] = s2[i];
2264 #endif
2266 #ifdef YY_NEED_STRLEN
2267 #ifdef YY_USE_PROTOS
2268 static int yy_flex_strlen( yyconst char *s )
2269 #else
2270 static int yy_flex_strlen( s )
2271 yyconst char *s;
2272 #endif
2274 register int n;
2275 for ( n = 0; s[n]; ++n )
2278 return n;
2280 #endif
2283 #ifdef YY_USE_PROTOS
2284 static void *yy_flex_alloc( yy_size_t size )
2285 #else
2286 static void *yy_flex_alloc( size )
2287 yy_size_t size;
2288 #endif
2290 return (void *) malloc( size );
2293 #ifdef YY_USE_PROTOS
2294 static void *yy_flex_realloc( void *ptr, yy_size_t size )
2295 #else
2296 static void *yy_flex_realloc( ptr, size )
2297 void *ptr;
2298 yy_size_t size;
2299 #endif
2301 /* The cast to (char *) in the following accommodates both
2302 * implementations that use char* generic pointers, and those
2303 * that use void* generic pointers. It works with the latter
2304 * because both ANSI C and C++ allow castless assignment from
2305 * any pointer type to void*, and deal with argument conversions
2306 * as though doing an assignment.
2308 return (void *) realloc( (char *) ptr, size );
2311 #ifdef YY_USE_PROTOS
2312 static void yy_flex_free( void *ptr )
2313 #else
2314 static void yy_flex_free( ptr )
2315 void *ptr;
2316 #endif
2318 free( ptr );
2321 #if YY_MAIN
2322 int main()
2324 yylex();
2325 return 0;
2327 #endif
2328 #line 236 "rclex.l"
2330 #ifndef yywrap
2331 /* This is needed for some versions of lex. */
2332 int yywrap ()
2334 return 1;
2336 #endif
2338 /* Handle a C preprocessor line. */
2340 static void
2341 cpp_line (s)
2342 const char *s;
2344 int line;
2345 char *send, *fn;
2347 ++s;
2348 while (isspace ((unsigned char) *s))
2349 ++s;
2351 line = strtol (s, &send, 0);
2352 if (*send != '\0' && ! isspace ((unsigned char) *send))
2353 return;
2355 /* Subtract 1 because we are about to count the newline. */
2356 rc_lineno = line - 1;
2358 s = send;
2359 while (isspace ((unsigned char) *s))
2360 ++s;
2362 if (*s != '"')
2363 return;
2365 ++s;
2366 send = strchr (s, '"');
2367 if (send == NULL)
2368 return;
2370 fn = (char *) xmalloc (send - s + 1);
2371 strncpy (fn, s, send - s);
2372 fn[send - s] = '\0';
2374 free (rc_filename);
2375 rc_filename = fn;
2377 if (!initial_fn)
2379 initial_fn = xmalloc (strlen (fn) + 1);
2380 strcpy(initial_fn, fn);
2383 /* Allow the initial file, regardless of name. Suppress all other
2384 files if they end in ".h" (this allows included "*.rc") */
2385 if (strcmp (initial_fn, fn) == 0
2386 || strcmp (fn + strlen (fn) - 2, ".h") != 0)
2387 suppress_cpp_data = 0;
2388 else
2389 suppress_cpp_data = 1;
2392 /* Handle a quoted string. The quotes are stripped. A pair of quotes
2393 in a string are turned into a single quote. Adjacent strings are
2394 merged separated by whitespace are merged, as in C. */
2396 static char *
2397 handle_quotes (input, len)
2398 const char *input;
2399 unsigned long *len;
2401 char *ret, *s;
2402 const char *t;
2403 int ch;
2405 ret = get_string (strlen (input) + 1);
2407 s = ret;
2408 t = input;
2409 if (*t == '"')
2410 ++t;
2411 while (*t != '\0')
2413 if (*t == '\\')
2415 ++t;
2416 switch (*t)
2418 case '\0':
2419 rcparse_warning ("backslash at end of string");
2420 break;
2422 case '\"':
2423 rcparse_warning ("use \"\" to put \" in a string");
2424 break;
2426 case 'a':
2427 *s++ = ESCAPE_A;
2428 ++t;
2429 break;
2431 case 'b':
2432 *s++ = ESCAPE_B;
2433 ++t;
2434 break;
2436 case 'f':
2437 *s++ = ESCAPE_F;
2438 ++t;
2439 break;
2441 case 'n':
2442 *s++ = ESCAPE_N;
2443 ++t;
2444 break;
2446 case 'r':
2447 *s++ = ESCAPE_R;
2448 ++t;
2449 break;
2451 case 't':
2452 *s++ = ESCAPE_T;
2453 ++t;
2454 break;
2456 case 'v':
2457 *s++ = ESCAPE_V;
2458 ++t;
2459 break;
2461 case '\\':
2462 *s++ = *t++;
2463 break;
2465 case '0': case '1': case '2': case '3':
2466 case '4': case '5': case '6': case '7':
2467 ch = *t - '0';
2468 ++t;
2469 if (*t >= '0' && *t <= '7')
2471 ch = (ch << 3) | (*t - '0');
2472 ++t;
2473 if (*t >= '0' && *t <= '7')
2475 ch = (ch << 3) | (*t - '0');
2476 ++t;
2479 *s++ = ch;
2480 break;
2482 case 'x':
2483 ++t;
2484 ch = 0;
2485 while (1)
2487 if (*t >= '0' && *t <= '9')
2488 ch = (ch << 4) | (*t - '0');
2489 else if (*t >= 'a' && *t <= 'f')
2490 ch = (ch << 4) | (*t - 'a');
2491 else if (*t >= 'A' && *t <= 'F')
2492 ch = (ch << 4) | (*t - 'A');
2493 else
2494 break;
2495 ++t;
2497 *s++ = ch;
2498 break;
2500 default:
2501 rcparse_warning ("unrecognized escape sequence");
2502 *s++ = '\\';
2503 *s++ = *t++;
2504 break;
2507 else if (*t != '"')
2508 *s++ = *t++;
2509 else if (t[1] == '\0')
2510 break;
2511 else if (t[1] == '"')
2513 *s++ = '"';
2514 t += 2;
2516 else
2518 ++t;
2519 assert (isspace ((unsigned char) *t));
2520 while (isspace ((unsigned char) *t))
2521 ++t;
2522 if (*t == '\0')
2523 break;
2524 assert (*t == '"');
2525 ++t;
2529 *s = '\0';
2531 *len = s - ret;
2533 return ret;
2536 /* Allocate a string of a given length. */
2538 static char *
2539 get_string (len)
2540 int len;
2542 struct alloc_string *as;
2544 as = (struct alloc_string *) xmalloc (sizeof *as);
2545 as->s = xmalloc (len);
2547 as->next = strings;
2548 strings = as->next;
2550 return as->s;
2553 /* Discard all the strings we have allocated. The parser calls this
2554 when it no longer needs them. */
2556 void
2557 rcparse_discard_strings ()
2559 struct alloc_string *as;
2561 as = strings;
2562 while (as != NULL)
2564 struct alloc_string *n;
2566 free (as->s);
2567 n = as->next;
2568 free (as);
2569 as = n;
2572 strings = NULL;
2575 /* Enter rcdata mode. */
2577 void
2578 rcparse_rcdata ()
2580 rcdata_mode = 1;
2583 /* Go back to normal mode from rcdata mode. */
2585 void
2586 rcparse_normal ()
2588 rcdata_mode = 0;