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