rclex.c revision 61843
1/* A lexical scanner generated by flex */ 2 3/* Scanner skeleton version: 4 * $Header: /cvs/src/src/binutils/Attic/rclex.c,v 1.1.2.1 2000/05/29 14:08:52 pb 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 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#include <unistd.h> 26 27/* Use prototypes in function declarations. */ 28#define YY_USE_PROTOS 29 30/* The "const" storage-class-modifier is valid. */ 31#define YY_USE_CONST 32 33#else /* ! __cplusplus */ 34 35#if __STDC__ 36 37#define YY_USE_PROTOS 38#define YY_USE_CONST 39 40#endif /* __STDC__ */ 41#endif /* ! __cplusplus */ 42 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 51 52#ifdef YY_USE_CONST 53#define yyconst const 54#else 55#define yyconst 56#endif 57 58 59#ifdef YY_USE_PROTOS 60#define YY_PROTO(proto) proto 61#else 62#define YY_PROTO(proto) () 63#endif 64 65/* Returned upon end-of-file. */ 66#define YY_NULL 0 67 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. 72 */ 73#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 74 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. 78 */ 79#define BEGIN yy_start = 1 + 2 * 80 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. 84 */ 85#define YY_START ((yy_start - 1) / 2) 86#define YYSTATE YY_START 87 88/* Action number for EOF rule of a given start state. */ 89#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 90 91/* Special action meaning "start processing a new file". */ 92#define YY_NEW_FILE yyrestart( yyin ) 93 94#define YY_END_OF_BUFFER_CHAR 0 95 96/* Size of default input buffer. */ 97#define YY_BUF_SIZE 16384 98 99typedef struct yy_buffer_state *YY_BUFFER_STATE; 100 101extern int yyleng; 102extern FILE *yyin, *yyout; 103 104#define EOB_ACT_CONTINUE_SCAN 0 105#define EOB_ACT_END_OF_FILE 1 106#define EOB_ACT_LAST_MATCH 2 107 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: 111 * 112 * if ( condition_holds ) 113 * yyless( 5 ); 114 * else 115 * do_something_else(); 116 * 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. 120 */ 121 122/* Return all but the first 'n' matched characters back to the input stream. */ 123 124#define yyless(n) \ 125 do \ 126 { \ 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 */ \ 132 } \ 133 while ( 0 ) 134 135#define unput(c) yyunput( c, yytext_ptr ) 136 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). 140 */ 141typedef unsigned int yy_size_t; 142 143 144struct yy_buffer_state 145 { 146 FILE *yy_input_file; 147 148 char *yy_ch_buf; /* input buffer */ 149 char *yy_buf_pos; /* current position in input buffer */ 150 151 /* Size of input buffer in bytes, not including room for EOB 152 * characters. 153 */ 154 yy_size_t yy_buf_size; 155 156 /* Number of characters read into yy_ch_buf, not including EOB 157 * characters. 158 */ 159 int yy_n_chars; 160 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. 164 */ 165 int yy_is_our_buffer; 166 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. 171 */ 172 int yy_is_interactive; 173 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. 177 */ 178 int yy_at_bol; 179 180 /* Whether to try to fill the input buffer when we reach the 181 * end of it. 182 */ 183 int yy_fill_buffer; 184 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. 193 * 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. 197 */ 198#define YY_BUFFER_EOF_PENDING 2 199 }; 200 201static YY_BUFFER_STATE yy_current_buffer = 0; 202 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". 206 */ 207#define YY_CURRENT_BUFFER yy_current_buffer 208 209 210/* yy_hold_char holds the character lost when yytext is formed. */ 211static char yy_hold_char; 212 213static int yy_n_chars; /* number of characters read into yy_ch_buf */ 214 215 216int yyleng; 217 218/* Points to current character in buffer. */ 219static char *yy_c_buf_p = (char *) 0; 220static int yy_init = 1; /* whether we need to initialize */ 221static int yy_start = 0; /* start state number */ 222 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 ... 225 */ 226static int yy_did_buffer_switch_on_eof; 227 228void yyrestart YY_PROTO(( FILE *input_file )); 229 230void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); 231void yy_load_buffer_state YY_PROTO(( void )); 232YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); 233void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); 234void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); 235void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); 236#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) 237 238YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); 239YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); 240YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); 241 242static void *yy_flex_alloc YY_PROTO(( yy_size_t )); 243static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); 244static void yy_flex_free YY_PROTO(( void * )); 245 246#define yy_new_buffer yy_create_buffer 247 248#define yy_set_interactive(is_interactive) \ 249 { \ 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; \ 253 } 254 255#define yy_set_bol(at_bol) \ 256 { \ 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; \ 260 } 261 262#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 263 264typedef unsigned char YY_CHAR; 265FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 266typedef int yy_state_type; 267extern char *yytext; 268#define yytext_ptr yytext 269 270static yy_state_type yy_get_previous_state YY_PROTO(( void )); 271static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); 272static int yy_get_next_buffer YY_PROTO(( void )); 273static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); 274 275/* Done after the current pattern has been matched and before the 276 * corresponding action - sets up yytext. 277 */ 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; 284 285#define YY_NUM_RULES 86 286#define YY_END_OF_BUFFER 87 287static 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, 299 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, 310 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, 321 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, 332 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 340 } ; 341 342static 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, 354 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, 365 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 372 } ; 373 374static 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 380 } ; 381 382static 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, 394 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, 405 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, 416 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, 427 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 436 } ; 437 438static 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, 450 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, 461 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, 472 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, 483 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 492 } ; 493 494static 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, 506 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, 517 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, 528 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, 539 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, 550 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, 556 469 557 } ; 558 559static 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, 571 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, 582 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, 593 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, 604 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, 615 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, 621 469 622 } ; 623 624static yy_state_type yy_last_accepting_state; 625static char *yy_last_accepting_cpos; 626 627/* The intent behind this definition is that it'll catch 628 * any uses of REJECT which flex missed. 629 */ 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 634char *yytext; 635#line 1 "rclex.l" 636#define INITIAL 0 637#line 2 "rclex.l" 638/* Copyright 1997, 1998 Free Software Foundation, Inc. 639 Written by Ian Lance Taylor, Cygnus Support. 640 641 This file is part of GNU Binutils. 642 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. 647 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. 652 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. */ 657 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. */ 661 662#include "bfd.h" 663#include "bucomm.h" 664#include "libiberty.h" 665#include "windres.h" 666#include "rcparse.h" 667 668#include <ctype.h> 669#include <assert.h> 670 671/* Whether we are in rcdata mode, in which we returns the lengths of 672 strings. */ 673 674static int rcdata_mode; 675 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. */ 683 684static int suppress_cpp_data; 685 686#define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x) 687 688/* The first filename we detect in the cpp output. We use this to 689 tell included files from the original file. */ 690 691static char *initial_fn; 692 693/* List of allocated strings. */ 694 695struct alloc_string 696{ 697 struct alloc_string *next; 698 char *s; 699}; 700 701static struct alloc_string *strings; 702 703/* Local functions. */ 704 705static void cpp_line PARAMS ((const char *)); 706static char *handle_quotes PARAMS ((const char *, unsigned long *)); 707static char *get_string PARAMS ((int)); 708 709#line 710 "lex.yy.c" 710 711/* Macros after this point can all be overridden by user definitions in 712 * section 1. 713 */ 714 715#ifndef YY_SKIP_YYWRAP 716#ifdef __cplusplus 717extern "C" int yywrap YY_PROTO(( void )); 718#else 719extern int yywrap YY_PROTO(( void )); 720#endif 721#endif 722 723#ifndef YY_NO_UNPUT 724static void yyunput YY_PROTO(( int c, char *buf_ptr )); 725#endif 726 727#ifndef yytext_ptr 728static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); 729#endif 730 731#ifdef YY_NEED_STRLEN 732static int yy_flex_strlen YY_PROTO(( yyconst char * )); 733#endif 734 735#ifndef YY_NO_INPUT 736#ifdef __cplusplus 737static int yyinput YY_PROTO(( void )); 738#else 739static int input YY_PROTO(( void )); 740#endif 741#endif 742 743#if YY_STACK_USED 744static int yy_start_stack_ptr = 0; 745static int yy_start_stack_depth = 0; 746static int *yy_start_stack = 0; 747#ifndef YY_NO_PUSH_STATE 748static void yy_push_state YY_PROTO(( int new_state )); 749#endif 750#ifndef YY_NO_POP_STATE 751static void yy_pop_state YY_PROTO(( void )); 752#endif 753#ifndef YY_NO_TOP_STATE 754static int yy_top_state YY_PROTO(( void )); 755#endif 756 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 762 763#ifdef YY_MALLOC_DECL 764YY_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). 774 */ 775#endif 776#endif 777 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 782 783/* Copy whatever the last rule matched to the standard output. */ 784 785#ifndef ECHO 786/* This used to be an fputs(), but since the string might contain NUL's, 787 * we now use fwrite(). 788 */ 789#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) 790#endif 791 792/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 793 * is returned in "result". 794 */ 795#ifndef YY_INPUT 796#define YY_INPUT(buf,result,max_size) \ 797 if ( yy_current_buffer->yy_is_interactive ) \ 798 { \ 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; \ 808 } \ 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 813 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. 817 */ 818#ifndef yyterminate 819#define yyterminate() return YY_NULL 820#endif 821 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 826 827/* Report a fatal error. */ 828#ifndef YY_FATAL_ERROR 829#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 830#endif 831 832/* Default declaration of generated scanner - a define so the user can 833 * easily add parameters. 834 */ 835#ifndef YY_DECL 836#define YY_DECL int yylex YY_PROTO(( void )) 837#endif 838 839/* Code executed at the beginning of each rule, after yytext and yyleng 840 * have been set up. 841 */ 842#ifndef YY_USER_ACTION 843#define YY_USER_ACTION 844#endif 845 846/* Code executed at the end of each rule. */ 847#ifndef YY_BREAK 848#define YY_BREAK break; 849#endif 850 851#define YY_RULE_SETUP \ 852 YY_USER_ACTION 853 854YY_DECL 855 { 856 register yy_state_type yy_current_state; 857 register char *yy_cp, *yy_bp; 858 register int yy_act; 859 860#line 75 "rclex.l" 861 862 863#line 864 "lex.yy.c" 864 865 if ( yy_init ) 866 { 867 yy_init = 0; 868 869#ifdef YY_USER_INIT 870 YY_USER_INIT; 871#endif 872 873 if ( ! yy_start ) 874 yy_start = 1; /* first start state */ 875 876 if ( ! yyin ) 877 yyin = stdin; 878 879 if ( ! yyout ) 880 yyout = stdout; 881 882 if ( ! yy_current_buffer ) 883 yy_current_buffer = 884 yy_create_buffer( yyin, YY_BUF_SIZE ); 885 886 yy_load_buffer_state(); 887 } 888 889 while ( 1 ) /* loops until end-of-file is reached */ 890 { 891 yy_cp = yy_c_buf_p; 892 893 /* Support of yytext. */ 894 *yy_cp = yy_hold_char; 895 896 /* yy_bp points to the position in yy_ch_buf of the start of 897 * the current run. 898 */ 899 yy_bp = yy_cp; 900 901 yy_current_state = yy_start; 902yy_match: 903 do 904 { 905 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 906 if ( yy_accept[yy_current_state] ) 907 { 908 yy_last_accepting_state = yy_current_state; 909 yy_last_accepting_cpos = yy_cp; 910 } 911 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 912 { 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]; 916 } 917 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 918 ++yy_cp; 919 } 920 while ( yy_base[yy_current_state] != 516 ); 921 922yy_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]; 929 } 930 931 YY_DO_BEFORE_ACTION; 932 933 934do_action: /* This label is used only to access EOF actions. */ 935 936 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; 945 946case 1: 947YY_RULE_SETUP 948#line 77 "rclex.l" 949{ MAYBE_RETURN (BEG); } 950 YY_BREAK 951case 2: 952YY_RULE_SETUP 953#line 78 "rclex.l" 954{ MAYBE_RETURN (BEG); } 955 YY_BREAK 956case 3: 957YY_RULE_SETUP 958#line 79 "rclex.l" 959{ MAYBE_RETURN (END); } 960 YY_BREAK 961case 4: 962YY_RULE_SETUP 963#line 80 "rclex.l" 964{ MAYBE_RETURN (END); } 965 YY_BREAK 966case 5: 967YY_RULE_SETUP 968#line 81 "rclex.l" 969{ MAYBE_RETURN (ACCELERATORS); } 970 YY_BREAK 971case 6: 972YY_RULE_SETUP 973#line 82 "rclex.l" 974{ MAYBE_RETURN (VIRTKEY); } 975 YY_BREAK 976case 7: 977YY_RULE_SETUP 978#line 83 "rclex.l" 979{ MAYBE_RETURN (ASCII); } 980 YY_BREAK 981case 8: 982YY_RULE_SETUP 983#line 84 "rclex.l" 984{ MAYBE_RETURN (NOINVERT); } 985 YY_BREAK 986case 9: 987YY_RULE_SETUP 988#line 85 "rclex.l" 989{ MAYBE_RETURN (SHIFT); } 990 YY_BREAK 991case 10: 992YY_RULE_SETUP 993#line 86 "rclex.l" 994{ MAYBE_RETURN (CONTROL); } 995 YY_BREAK 996case 11: 997YY_RULE_SETUP 998#line 87 "rclex.l" 999{ MAYBE_RETURN (ALT); } 1000 YY_BREAK 1001case 12: 1002YY_RULE_SETUP 1003#line 88 "rclex.l" 1004{ MAYBE_RETURN (BITMAP); } 1005 YY_BREAK 1006case 13: 1007YY_RULE_SETUP 1008#line 89 "rclex.l" 1009{ MAYBE_RETURN (CURSOR); } 1010 YY_BREAK 1011case 14: 1012YY_RULE_SETUP 1013#line 90 "rclex.l" 1014{ MAYBE_RETURN (DIALOG); } 1015 YY_BREAK 1016case 15: 1017YY_RULE_SETUP 1018#line 91 "rclex.l" 1019{ MAYBE_RETURN (DIALOGEX); } 1020 YY_BREAK 1021case 16: 1022YY_RULE_SETUP 1023#line 92 "rclex.l" 1024{ MAYBE_RETURN (EXSTYLE); } 1025 YY_BREAK 1026case 17: 1027YY_RULE_SETUP 1028#line 93 "rclex.l" 1029{ MAYBE_RETURN (CAPTION); } 1030 YY_BREAK 1031case 18: 1032YY_RULE_SETUP 1033#line 94 "rclex.l" 1034{ MAYBE_RETURN (CLASS); } 1035 YY_BREAK 1036case 19: 1037YY_RULE_SETUP 1038#line 95 "rclex.l" 1039{ MAYBE_RETURN (STYLE); } 1040 YY_BREAK 1041case 20: 1042YY_RULE_SETUP 1043#line 96 "rclex.l" 1044{ MAYBE_RETURN (AUTO3STATE); } 1045 YY_BREAK 1046case 21: 1047YY_RULE_SETUP 1048#line 97 "rclex.l" 1049{ MAYBE_RETURN (AUTOCHECKBOX); } 1050 YY_BREAK 1051case 22: 1052YY_RULE_SETUP 1053#line 98 "rclex.l" 1054{ MAYBE_RETURN (AUTORADIOBUTTON); } 1055 YY_BREAK 1056case 23: 1057YY_RULE_SETUP 1058#line 99 "rclex.l" 1059{ MAYBE_RETURN (CHECKBOX); } 1060 YY_BREAK 1061case 24: 1062YY_RULE_SETUP 1063#line 100 "rclex.l" 1064{ MAYBE_RETURN (COMBOBOX); } 1065 YY_BREAK 1066case 25: 1067YY_RULE_SETUP 1068#line 101 "rclex.l" 1069{ MAYBE_RETURN (CTEXT); } 1070 YY_BREAK 1071case 26: 1072YY_RULE_SETUP 1073#line 102 "rclex.l" 1074{ MAYBE_RETURN (DEFPUSHBUTTON); } 1075 YY_BREAK 1076case 27: 1077YY_RULE_SETUP 1078#line 103 "rclex.l" 1079{ MAYBE_RETURN (EDITTEXT); } 1080 YY_BREAK 1081case 28: 1082YY_RULE_SETUP 1083#line 104 "rclex.l" 1084{ MAYBE_RETURN (GROUPBOX); } 1085 YY_BREAK 1086case 29: 1087YY_RULE_SETUP 1088#line 105 "rclex.l" 1089{ MAYBE_RETURN (LISTBOX); } 1090 YY_BREAK 1091case 30: 1092YY_RULE_SETUP 1093#line 106 "rclex.l" 1094{ MAYBE_RETURN (LTEXT); } 1095 YY_BREAK 1096case 31: 1097YY_RULE_SETUP 1098#line 107 "rclex.l" 1099{ MAYBE_RETURN (PUSHBOX); } 1100 YY_BREAK 1101case 32: 1102YY_RULE_SETUP 1103#line 108 "rclex.l" 1104{ MAYBE_RETURN (PUSHBUTTON); } 1105 YY_BREAK 1106case 33: 1107YY_RULE_SETUP 1108#line 109 "rclex.l" 1109{ MAYBE_RETURN (RADIOBUTTON); } 1110 YY_BREAK 1111case 34: 1112YY_RULE_SETUP 1113#line 110 "rclex.l" 1114{ MAYBE_RETURN (RTEXT); } 1115 YY_BREAK 1116case 35: 1117YY_RULE_SETUP 1118#line 111 "rclex.l" 1119{ MAYBE_RETURN (SCROLLBAR); } 1120 YY_BREAK 1121case 36: 1122YY_RULE_SETUP 1123#line 112 "rclex.l" 1124{ MAYBE_RETURN (STATE3); } 1125 YY_BREAK 1126case 37: 1127YY_RULE_SETUP 1128#line 113 "rclex.l" 1129{ MAYBE_RETURN (USERBUTTON); } 1130 YY_BREAK 1131case 38: 1132YY_RULE_SETUP 1133#line 114 "rclex.l" 1134{ MAYBE_RETURN (BEDIT); } 1135 YY_BREAK 1136case 39: 1137YY_RULE_SETUP 1138#line 115 "rclex.l" 1139{ MAYBE_RETURN (HEDIT); } 1140 YY_BREAK 1141case 40: 1142YY_RULE_SETUP 1143#line 116 "rclex.l" 1144{ MAYBE_RETURN (IEDIT); } 1145 YY_BREAK 1146case 41: 1147YY_RULE_SETUP 1148#line 117 "rclex.l" 1149{ MAYBE_RETURN (FONT); } 1150 YY_BREAK 1151case 42: 1152YY_RULE_SETUP 1153#line 118 "rclex.l" 1154{ MAYBE_RETURN (ICON); } 1155 YY_BREAK 1156case 43: 1157YY_RULE_SETUP 1158#line 119 "rclex.l" 1159{ MAYBE_RETURN (LANGUAGE); } 1160 YY_BREAK 1161case 44: 1162YY_RULE_SETUP 1163#line 120 "rclex.l" 1164{ MAYBE_RETURN (CHARACTERISTICS); } 1165 YY_BREAK 1166case 45: 1167YY_RULE_SETUP 1168#line 121 "rclex.l" 1169{ MAYBE_RETURN (VERSIONK); } 1170 YY_BREAK 1171case 46: 1172YY_RULE_SETUP 1173#line 122 "rclex.l" 1174{ MAYBE_RETURN (MENU); } 1175 YY_BREAK 1176case 47: 1177YY_RULE_SETUP 1178#line 123 "rclex.l" 1179{ MAYBE_RETURN (MENUEX); } 1180 YY_BREAK 1181case 48: 1182YY_RULE_SETUP 1183#line 124 "rclex.l" 1184{ MAYBE_RETURN (MENUITEM); } 1185 YY_BREAK 1186case 49: 1187YY_RULE_SETUP 1188#line 125 "rclex.l" 1189{ MAYBE_RETURN (SEPARATOR); } 1190 YY_BREAK 1191case 50: 1192YY_RULE_SETUP 1193#line 126 "rclex.l" 1194{ MAYBE_RETURN (POPUP); } 1195 YY_BREAK 1196case 51: 1197YY_RULE_SETUP 1198#line 127 "rclex.l" 1199{ MAYBE_RETURN (CHECKED); } 1200 YY_BREAK 1201case 52: 1202YY_RULE_SETUP 1203#line 128 "rclex.l" 1204{ MAYBE_RETURN (GRAYED); } 1205 YY_BREAK 1206case 53: 1207YY_RULE_SETUP 1208#line 129 "rclex.l" 1209{ MAYBE_RETURN (HELP); } 1210 YY_BREAK 1211case 54: 1212YY_RULE_SETUP 1213#line 130 "rclex.l" 1214{ MAYBE_RETURN (INACTIVE); } 1215 YY_BREAK 1216case 55: 1217YY_RULE_SETUP 1218#line 131 "rclex.l" 1219{ MAYBE_RETURN (MENUBARBREAK); } 1220 YY_BREAK 1221case 56: 1222YY_RULE_SETUP 1223#line 132 "rclex.l" 1224{ MAYBE_RETURN (MENUBREAK); } 1225 YY_BREAK 1226case 57: 1227YY_RULE_SETUP 1228#line 133 "rclex.l" 1229{ MAYBE_RETURN (MESSAGETABLE); } 1230 YY_BREAK 1231case 58: 1232YY_RULE_SETUP 1233#line 134 "rclex.l" 1234{ MAYBE_RETURN (RCDATA); } 1235 YY_BREAK 1236case 59: 1237YY_RULE_SETUP 1238#line 135 "rclex.l" 1239{ MAYBE_RETURN (STRINGTABLE); } 1240 YY_BREAK 1241case 60: 1242YY_RULE_SETUP 1243#line 136 "rclex.l" 1244{ MAYBE_RETURN (VERSIONINFO); } 1245 YY_BREAK 1246case 61: 1247YY_RULE_SETUP 1248#line 137 "rclex.l" 1249{ MAYBE_RETURN (FILEVERSION); } 1250 YY_BREAK 1251case 62: 1252YY_RULE_SETUP 1253#line 138 "rclex.l" 1254{ MAYBE_RETURN (PRODUCTVERSION); } 1255 YY_BREAK 1256case 63: 1257YY_RULE_SETUP 1258#line 139 "rclex.l" 1259{ MAYBE_RETURN (FILEFLAGSMASK); } 1260 YY_BREAK 1261case 64: 1262YY_RULE_SETUP 1263#line 140 "rclex.l" 1264{ MAYBE_RETURN (FILEFLAGS); } 1265 YY_BREAK 1266case 65: 1267YY_RULE_SETUP 1268#line 141 "rclex.l" 1269{ MAYBE_RETURN (FILEOS); } 1270 YY_BREAK 1271case 66: 1272YY_RULE_SETUP 1273#line 142 "rclex.l" 1274{ MAYBE_RETURN (FILETYPE); } 1275 YY_BREAK 1276case 67: 1277YY_RULE_SETUP 1278#line 143 "rclex.l" 1279{ MAYBE_RETURN (FILESUBTYPE); } 1280 YY_BREAK 1281case 68: 1282YY_RULE_SETUP 1283#line 144 "rclex.l" 1284{ MAYBE_RETURN (VALUE); } 1285 YY_BREAK 1286case 69: 1287YY_RULE_SETUP 1288#line 145 "rclex.l" 1289{ MAYBE_RETURN (MOVEABLE); } 1290 YY_BREAK 1291case 70: 1292YY_RULE_SETUP 1293#line 146 "rclex.l" 1294{ MAYBE_RETURN (FIXED); } 1295 YY_BREAK 1296case 71: 1297YY_RULE_SETUP 1298#line 147 "rclex.l" 1299{ MAYBE_RETURN (PURE); } 1300 YY_BREAK 1301case 72: 1302YY_RULE_SETUP 1303#line 148 "rclex.l" 1304{ MAYBE_RETURN (IMPURE); } 1305 YY_BREAK 1306case 73: 1307YY_RULE_SETUP 1308#line 149 "rclex.l" 1309{ MAYBE_RETURN (PRELOAD); } 1310 YY_BREAK 1311case 74: 1312YY_RULE_SETUP 1313#line 150 "rclex.l" 1314{ MAYBE_RETURN (LOADONCALL); } 1315 YY_BREAK 1316case 75: 1317YY_RULE_SETUP 1318#line 151 "rclex.l" 1319{ MAYBE_RETURN (DISCARDABLE); } 1320 YY_BREAK 1321case 76: 1322YY_RULE_SETUP 1323#line 152 "rclex.l" 1324{ MAYBE_RETURN (NOT); } 1325 YY_BREAK 1326case 77: 1327YY_RULE_SETUP 1328#line 154 "rclex.l" 1329{ 1330 char *s, *send; 1331 1332 /* This is a hack to let us parse version 1333 information easily. */ 1334 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 1347 { 1348 char *r; 1349 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); 1355 } 1356 } 1357 YY_BREAK 1358case 78: 1359YY_RULE_SETUP 1360#line 183 "rclex.l" 1361{ 1362 cpp_line (yytext); 1363 } 1364 YY_BREAK 1365case 79: 1366YY_RULE_SETUP 1367#line 187 "rclex.l" 1368{ 1369 yylval.i.val = strtoul (yytext, 0, 0); 1370 yylval.i.dword = 1; 1371 MAYBE_RETURN (NUMBER); 1372 } 1373 YY_BREAK 1374case 80: 1375YY_RULE_SETUP 1376#line 193 "rclex.l" 1377{ 1378 yylval.i.val = strtoul (yytext, 0, 0); 1379 yylval.i.dword = 0; 1380 MAYBE_RETURN (NUMBER); 1381 } 1382 YY_BREAK 1383case 81: 1384YY_RULE_SETUP 1385#line 199 "rclex.l" 1386{ 1387 char *s; 1388 unsigned long length; 1389 1390 s = handle_quotes (yytext, &length); 1391 if (! rcdata_mode) 1392 { 1393 yylval.s = s; 1394 MAYBE_RETURN (QUOTEDSTRING); 1395 } 1396 else 1397 { 1398 yylval.ss.length = length; 1399 yylval.ss.s = s; 1400 MAYBE_RETURN (SIZEDSTRING); 1401 } 1402 } 1403 YY_BREAK 1404case 82: 1405YY_RULE_SETUP 1406#line 217 "rclex.l" 1407{ 1408 char *s; 1409 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. */ 1415 1416 s = get_string (strlen (yytext) + 1); 1417 strcpy (s, yytext); 1418 yylval.s = s; 1419 MAYBE_RETURN (STRING); 1420 } 1421 YY_BREAK 1422case 83: 1423YY_RULE_SETUP 1424#line 232 "rclex.l" 1425{ ++rc_lineno; } 1426 YY_BREAK 1427case 84: 1428YY_RULE_SETUP 1429#line 233 "rclex.l" 1430{ /* ignore whitespace */ } 1431 YY_BREAK 1432case 85: 1433YY_RULE_SETUP 1434#line 234 "rclex.l" 1435{ MAYBE_RETURN (*yytext); } 1436 YY_BREAK 1437case 86: 1438YY_RULE_SETUP 1439#line 236 "rclex.l" 1440ECHO; 1441 YY_BREAK 1442#line 1443 "lex.yy.c" 1443case YY_STATE_EOF(INITIAL): 1444 yyterminate(); 1445 1446 case YY_END_OF_BUFFER: 1447 { 1448 /* Amount of text matched not including the EOB char. */ 1449 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; 1450 1451 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 1452 *yy_cp = yy_hold_char; 1453 YY_RESTORE_YY_MORE_OFFSET 1454 1455 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) 1456 { 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. 1465 */ 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; 1469 } 1470 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(). 1477 */ 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; 1481 1482 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; 1483 1484 yy_current_state = yy_get_previous_state(); 1485 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). 1493 */ 1494 1495 yy_next_state = yy_try_NUL_trans( yy_current_state ); 1496 1497 yy_bp = yytext_ptr + YY_MORE_ADJ; 1498 1499 if ( yy_next_state ) 1500 { 1501 /* Consume the NUL. */ 1502 yy_cp = ++yy_c_buf_p; 1503 yy_current_state = yy_next_state; 1504 goto yy_match; 1505 } 1506 1507 else 1508 { 1509 yy_cp = yy_c_buf_p; 1510 goto yy_find_action; 1511 } 1512 } 1513 1514 else switch ( yy_get_next_buffer() ) 1515 { 1516 case EOB_ACT_END_OF_FILE: 1517 { 1518 yy_did_buffer_switch_on_eof = 0; 1519 1520 if ( yywrap() ) 1521 { 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. 1530 */ 1531 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; 1532 1533 yy_act = YY_STATE_EOF(YY_START); 1534 goto do_action; 1535 } 1536 1537 else 1538 { 1539 if ( ! yy_did_buffer_switch_on_eof ) 1540 YY_NEW_FILE; 1541 } 1542 break; 1543 } 1544 1545 case EOB_ACT_CONTINUE_SCAN: 1546 yy_c_buf_p = 1547 yytext_ptr + yy_amount_of_matched_text; 1548 1549 yy_current_state = yy_get_previous_state(); 1550 1551 yy_cp = yy_c_buf_p; 1552 yy_bp = yytext_ptr + YY_MORE_ADJ; 1553 goto yy_match; 1554 1555 case EOB_ACT_LAST_MATCH: 1556 yy_c_buf_p = 1557 &yy_current_buffer->yy_ch_buf[yy_n_chars]; 1558 1559 yy_current_state = yy_get_previous_state(); 1560 1561 yy_cp = yy_c_buf_p; 1562 yy_bp = yytext_ptr + YY_MORE_ADJ; 1563 goto yy_find_action; 1564 } 1565 break; 1566 } 1567 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 */ 1574 1575 1576/* yy_get_next_buffer - try to read in a new buffer 1577 * 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 1582 */ 1583 1584static int yy_get_next_buffer() 1585 { 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; 1590 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" ); 1594 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 ) 1598 { 1599 /* We matched a single character, the EOB, so 1600 * treat this as a final EOF. 1601 */ 1602 return EOB_ACT_END_OF_FILE; 1603 } 1604 1605 else 1606 { 1607 /* We matched some text prior to the EOB, first 1608 * process it. 1609 */ 1610 return EOB_ACT_LAST_MATCH; 1611 } 1612 } 1613 1614 /* Try to read more data. */ 1615 1616 /* First move last chars to start of buffer. */ 1617 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; 1618 1619 for ( i = 0; i < number_to_move; ++i ) 1620 *(dest++) = *(source++); 1621 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 1625 */ 1626 yy_current_buffer->yy_n_chars = yy_n_chars = 0; 1627 1628 else 1629 { 1630 int num_to_read = 1631 yy_current_buffer->yy_buf_size - number_to_move - 1; 1632 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 1639 1640 /* just a shorter name for the current buffer */ 1641 YY_BUFFER_STATE b = yy_current_buffer; 1642 1643 int yy_c_buf_p_offset = 1644 (int) (yy_c_buf_p - b->yy_ch_buf); 1645 1646 if ( b->yy_is_our_buffer ) 1647 { 1648 int new_size = b->yy_buf_size * 2; 1649 1650 if ( new_size <= 0 ) 1651 b->yy_buf_size += b->yy_buf_size / 8; 1652 else 1653 b->yy_buf_size *= 2; 1654 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 ); 1659 } 1660 else 1661 /* Can't grow it, we don't own it. */ 1662 b->yy_ch_buf = 0; 1663 1664 if ( ! b->yy_ch_buf ) 1665 YY_FATAL_ERROR( 1666 "fatal error - scanner input buffer overflow" ); 1667 1668 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 1669 1670 num_to_read = yy_current_buffer->yy_buf_size - 1671 number_to_move - 1; 1672#endif 1673 } 1674 1675 if ( num_to_read > YY_READ_BUF_SIZE ) 1676 num_to_read = YY_READ_BUF_SIZE; 1677 1678 /* Read in more data. */ 1679 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), 1680 yy_n_chars, num_to_read ); 1681 1682 yy_current_buffer->yy_n_chars = yy_n_chars; 1683 } 1684 1685 if ( yy_n_chars == 0 ) 1686 { 1687 if ( number_to_move == YY_MORE_ADJ ) 1688 { 1689 ret_val = EOB_ACT_END_OF_FILE; 1690 yyrestart( yyin ); 1691 } 1692 1693 else 1694 { 1695 ret_val = EOB_ACT_LAST_MATCH; 1696 yy_current_buffer->yy_buffer_status = 1697 YY_BUFFER_EOF_PENDING; 1698 } 1699 } 1700 1701 else 1702 ret_val = EOB_ACT_CONTINUE_SCAN; 1703 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; 1707 1708 yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; 1709 1710 return ret_val; 1711 } 1712 1713 1714/* yy_get_previous_state - get the state just before the EOB char was reached */ 1715 1716static yy_state_type yy_get_previous_state() 1717 { 1718 register yy_state_type yy_current_state; 1719 register char *yy_cp; 1720 1721 yy_current_state = yy_start; 1722 1723 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 1724 { 1725 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1726 if ( yy_accept[yy_current_state] ) 1727 { 1728 yy_last_accepting_state = yy_current_state; 1729 yy_last_accepting_cpos = yy_cp; 1730 } 1731 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1732 { 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]; 1736 } 1737 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1738 } 1739 1740 return yy_current_state; 1741 } 1742 1743 1744/* yy_try_NUL_trans - try to make a transition on the NUL character 1745 * 1746 * synopsis 1747 * next_state = yy_try_NUL_trans( current_state ); 1748 */ 1749 1750#ifdef YY_USE_PROTOS 1751static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) 1752#else 1753static yy_state_type yy_try_NUL_trans( yy_current_state ) 1754yy_state_type yy_current_state; 1755#endif 1756 { 1757 register int yy_is_jam; 1758 register char *yy_cp = yy_c_buf_p; 1759 1760 register YY_CHAR yy_c = 1; 1761 if ( yy_accept[yy_current_state] ) 1762 { 1763 yy_last_accepting_state = yy_current_state; 1764 yy_last_accepting_cpos = yy_cp; 1765 } 1766 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1767 { 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]; 1771 } 1772 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1773 yy_is_jam = (yy_current_state == 469); 1774 1775 return yy_is_jam ? 0 : yy_current_state; 1776 } 1777 1778 1779#ifndef YY_NO_UNPUT 1780#ifdef YY_USE_PROTOS 1781static void yyunput( int c, register char *yy_bp ) 1782#else 1783static void yyunput( c, yy_bp ) 1784int c; 1785register char *yy_bp; 1786#endif 1787 { 1788 register char *yy_cp = yy_c_buf_p; 1789 1790 /* undo effects of setting up yytext */ 1791 *yy_cp = yy_hold_char; 1792 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]; 1801 1802 while ( source > yy_current_buffer->yy_ch_buf ) 1803 *--dest = *--source; 1804 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; 1809 1810 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1811 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1812 } 1813 1814 *--yy_cp = (char) c; 1815 1816 1817 yytext_ptr = yy_bp; 1818 yy_hold_char = *yy_cp; 1819 yy_c_buf_p = yy_cp; 1820 } 1821#endif /* ifndef YY_NO_UNPUT */ 1822 1823 1824#ifdef __cplusplus 1825static int yyinput() 1826#else 1827static int input() 1828#endif 1829 { 1830 int c; 1831 1832 *yy_c_buf_p = yy_hold_char; 1833 1834 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 1835 { 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. 1839 */ 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'; 1843 1844 else 1845 { /* need more input */ 1846 int offset = yy_c_buf_p - yytext_ptr; 1847 ++yy_c_buf_p; 1848 1849 switch ( yy_get_next_buffer() ) 1850 { 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. 1860 */ 1861 1862 /* Reset buffer status. */ 1863 yyrestart( yyin ); 1864 1865 /* fall through */ 1866 1867 case EOB_ACT_END_OF_FILE: 1868 { 1869 if ( yywrap() ) 1870 return EOF; 1871 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 1879 } 1880 1881 case EOB_ACT_CONTINUE_SCAN: 1882 yy_c_buf_p = yytext_ptr + offset; 1883 break; 1884 } 1885 } 1886 } 1887 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; 1891 1892 1893 return c; 1894 } 1895 1896 1897#ifdef YY_USE_PROTOS 1898void yyrestart( FILE *input_file ) 1899#else 1900void yyrestart( input_file ) 1901FILE *input_file; 1902#endif 1903 { 1904 if ( ! yy_current_buffer ) 1905 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); 1906 1907 yy_init_buffer( yy_current_buffer, input_file ); 1908 yy_load_buffer_state(); 1909 } 1910 1911 1912#ifdef YY_USE_PROTOS 1913void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) 1914#else 1915void yy_switch_to_buffer( new_buffer ) 1916YY_BUFFER_STATE new_buffer; 1917#endif 1918 { 1919 if ( yy_current_buffer == new_buffer ) 1920 return; 1921 1922 if ( yy_current_buffer ) 1923 { 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; 1928 } 1929 1930 yy_current_buffer = new_buffer; 1931 yy_load_buffer_state(); 1932 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. 1937 */ 1938 yy_did_buffer_switch_on_eof = 1; 1939 } 1940 1941 1942#ifdef YY_USE_PROTOS 1943void yy_load_buffer_state( void ) 1944#else 1945void yy_load_buffer_state() 1946#endif 1947 { 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; 1952 } 1953 1954 1955#ifdef YY_USE_PROTOS 1956YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) 1957#else 1958YY_BUFFER_STATE yy_create_buffer( file, size ) 1959FILE *file; 1960int size; 1961#endif 1962 { 1963 YY_BUFFER_STATE b; 1964 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()" ); 1968 1969 b->yy_buf_size = size; 1970 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. 1973 */ 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()" ); 1977 1978 b->yy_is_our_buffer = 1; 1979 1980 yy_init_buffer( b, file ); 1981 1982 return b; 1983 } 1984 1985 1986#ifdef YY_USE_PROTOS 1987void yy_delete_buffer( YY_BUFFER_STATE b ) 1988#else 1989void yy_delete_buffer( b ) 1990YY_BUFFER_STATE b; 1991#endif 1992 { 1993 if ( ! b ) 1994 return; 1995 1996 if ( b == yy_current_buffer ) 1997 yy_current_buffer = (YY_BUFFER_STATE) 0; 1998 1999 if ( b->yy_is_our_buffer ) 2000 yy_flex_free( (void *) b->yy_ch_buf ); 2001 2002 yy_flex_free( (void *) b ); 2003 } 2004 2005 2006#ifndef YY_ALWAYS_INTERACTIVE 2007#ifndef YY_NEVER_INTERACTIVE 2008extern int isatty YY_PROTO(( int )); 2009#endif 2010#endif 2011 2012#ifdef YY_USE_PROTOS 2013void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) 2014#else 2015void yy_init_buffer( b, file ) 2016YY_BUFFER_STATE b; 2017FILE *file; 2018#endif 2019 2020 2021 { 2022 yy_flush_buffer( b ); 2023 2024 b->yy_input_file = file; 2025 b->yy_fill_buffer = 1; 2026 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 2036 } 2037 2038 2039#ifdef YY_USE_PROTOS 2040void yy_flush_buffer( YY_BUFFER_STATE b ) 2041#else 2042void yy_flush_buffer( b ) 2043YY_BUFFER_STATE b; 2044#endif 2045 2046 { 2047 if ( ! b ) 2048 return; 2049 2050 b->yy_n_chars = 0; 2051 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. 2055 */ 2056 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 2057 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 2058 2059 b->yy_buf_pos = &b->yy_ch_buf[0]; 2060 2061 b->yy_at_bol = 1; 2062 b->yy_buffer_status = YY_BUFFER_NEW; 2063 2064 if ( b == yy_current_buffer ) 2065 yy_load_buffer_state(); 2066 } 2067 2068 2069#ifndef YY_NO_SCAN_BUFFER 2070#ifdef YY_USE_PROTOS 2071YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) 2072#else 2073YY_BUFFER_STATE yy_scan_buffer( base, size ) 2074char *base; 2075yy_size_t size; 2076#endif 2077 { 2078 YY_BUFFER_STATE b; 2079 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; 2085 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()" ); 2089 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; 2099 2100 yy_switch_to_buffer( b ); 2101 2102 return b; 2103 } 2104#endif 2105 2106 2107#ifndef YY_NO_SCAN_STRING 2108#ifdef YY_USE_PROTOS 2109YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) 2110#else 2111YY_BUFFER_STATE yy_scan_string( yy_str ) 2112yyconst char *yy_str; 2113#endif 2114 { 2115 int len; 2116 for ( len = 0; yy_str[len]; ++len ) 2117 ; 2118 2119 return yy_scan_bytes( yy_str, len ); 2120 } 2121#endif 2122 2123 2124#ifndef YY_NO_SCAN_BYTES 2125#ifdef YY_USE_PROTOS 2126YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) 2127#else 2128YY_BUFFER_STATE yy_scan_bytes( bytes, len ) 2129yyconst char *bytes; 2130int len; 2131#endif 2132 { 2133 YY_BUFFER_STATE b; 2134 char *buf; 2135 yy_size_t n; 2136 int i; 2137 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()" ); 2143 2144 for ( i = 0; i < len; ++i ) 2145 buf[i] = bytes[i]; 2146 2147 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; 2148 2149 b = yy_scan_buffer( buf, n ); 2150 if ( ! b ) 2151 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 2152 2153 /* It's okay to grow etc. this buffer, and we should throw it 2154 * away when we're done. 2155 */ 2156 b->yy_is_our_buffer = 1; 2157 2158 return b; 2159 } 2160#endif 2161 2162 2163#ifndef YY_NO_PUSH_STATE 2164#ifdef YY_USE_PROTOS 2165static void yy_push_state( int new_state ) 2166#else 2167static void yy_push_state( new_state ) 2168int new_state; 2169#endif 2170 { 2171 if ( yy_start_stack_ptr >= yy_start_stack_depth ) 2172 { 2173 yy_size_t new_size; 2174 2175 yy_start_stack_depth += YY_START_STACK_INCR; 2176 new_size = yy_start_stack_depth * sizeof( int ); 2177 2178 if ( ! yy_start_stack ) 2179 yy_start_stack = (int *) yy_flex_alloc( new_size ); 2180 2181 else 2182 yy_start_stack = (int *) yy_flex_realloc( 2183 (void *) yy_start_stack, new_size ); 2184 2185 if ( ! yy_start_stack ) 2186 YY_FATAL_ERROR( 2187 "out of memory expanding start-condition stack" ); 2188 } 2189 2190 yy_start_stack[yy_start_stack_ptr++] = YY_START; 2191 2192 BEGIN(new_state); 2193 } 2194#endif 2195 2196 2197#ifndef YY_NO_POP_STATE 2198static void yy_pop_state() 2199 { 2200 if ( --yy_start_stack_ptr < 0 ) 2201 YY_FATAL_ERROR( "start-condition stack underflow" ); 2202 2203 BEGIN(yy_start_stack[yy_start_stack_ptr]); 2204 } 2205#endif 2206 2207 2208#ifndef YY_NO_TOP_STATE 2209static int yy_top_state() 2210 { 2211 return yy_start_stack[yy_start_stack_ptr - 1]; 2212 } 2213#endif 2214 2215#ifndef YY_EXIT_FAILURE 2216#define YY_EXIT_FAILURE 2 2217#endif 2218 2219#ifdef YY_USE_PROTOS 2220static void yy_fatal_error( yyconst char msg[] ) 2221#else 2222static void yy_fatal_error( msg ) 2223char msg[]; 2224#endif 2225 { 2226 (void) fprintf( stderr, "%s\n", msg ); 2227 exit( YY_EXIT_FAILURE ); 2228 } 2229 2230 2231 2232/* Redefine yyless() so it works in section 3 code. */ 2233 2234#undef yyless 2235#define yyless(n) \ 2236 do \ 2237 { \ 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; \ 2244 } \ 2245 while ( 0 ) 2246 2247 2248/* Internal utility routines. */ 2249 2250#ifndef yytext_ptr 2251#ifdef YY_USE_PROTOS 2252static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 2253#else 2254static void yy_flex_strncpy( s1, s2, n ) 2255char *s1; 2256yyconst char *s2; 2257int n; 2258#endif 2259 { 2260 register int i; 2261 for ( i = 0; i < n; ++i ) 2262 s1[i] = s2[i]; 2263 } 2264#endif 2265 2266#ifdef YY_NEED_STRLEN 2267#ifdef YY_USE_PROTOS 2268static int yy_flex_strlen( yyconst char *s ) 2269#else 2270static int yy_flex_strlen( s ) 2271yyconst char *s; 2272#endif 2273 { 2274 register int n; 2275 for ( n = 0; s[n]; ++n ) 2276 ; 2277 2278 return n; 2279 } 2280#endif 2281 2282 2283#ifdef YY_USE_PROTOS 2284static void *yy_flex_alloc( yy_size_t size ) 2285#else 2286static void *yy_flex_alloc( size ) 2287yy_size_t size; 2288#endif 2289 { 2290 return (void *) malloc( size ); 2291 } 2292 2293#ifdef YY_USE_PROTOS 2294static void *yy_flex_realloc( void *ptr, yy_size_t size ) 2295#else 2296static void *yy_flex_realloc( ptr, size ) 2297void *ptr; 2298yy_size_t size; 2299#endif 2300 { 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. 2307 */ 2308 return (void *) realloc( (char *) ptr, size ); 2309 } 2310 2311#ifdef YY_USE_PROTOS 2312static void yy_flex_free( void *ptr ) 2313#else 2314static void yy_flex_free( ptr ) 2315void *ptr; 2316#endif 2317 { 2318 free( ptr ); 2319 } 2320 2321#if YY_MAIN 2322int main() 2323 { 2324 yylex(); 2325 return 0; 2326 } 2327#endif 2328#line 236 "rclex.l" 2329 2330#ifndef yywrap 2331/* This is needed for some versions of lex. */ 2332int yywrap () 2333{ 2334 return 1; 2335} 2336#endif 2337 2338/* Handle a C preprocessor line. */ 2339 2340static void 2341cpp_line (s) 2342 const char *s; 2343{ 2344 int line; 2345 char *send, *fn; 2346 2347 ++s; 2348 while (isspace ((unsigned char) *s)) 2349 ++s; 2350 2351 line = strtol (s, &send, 0); 2352 if (*send != '\0' && ! isspace ((unsigned char) *send)) 2353 return; 2354 2355 /* Subtract 1 because we are about to count the newline. */ 2356 rc_lineno = line - 1; 2357 2358 s = send; 2359 while (isspace ((unsigned char) *s)) 2360 ++s; 2361 2362 if (*s != '"') 2363 return; 2364 2365 ++s; 2366 send = strchr (s, '"'); 2367 if (send == NULL) 2368 return; 2369 2370 fn = (char *) xmalloc (send - s + 1); 2371 strncpy (fn, s, send - s); 2372 fn[send - s] = '\0'; 2373 2374 free (rc_filename); 2375 rc_filename = fn; 2376 2377 if (!initial_fn) 2378 { 2379 initial_fn = xmalloc (strlen (fn) + 1); 2380 strcpy(initial_fn, fn); 2381 } 2382 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; 2390} 2391 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. */ 2395 2396static char * 2397handle_quotes (input, len) 2398 const char *input; 2399 unsigned long *len; 2400{ 2401 char *ret, *s; 2402 const char *t; 2403 int ch; 2404 2405 ret = get_string (strlen (input) + 1); 2406 2407 s = ret; 2408 t = input; 2409 if (*t == '"') 2410 ++t; 2411 while (*t != '\0') 2412 { 2413 if (*t == '\\') 2414 { 2415 ++t; 2416 switch (*t) 2417 { 2418 case '\0': 2419 rcparse_warning ("backslash at end of string"); 2420 break; 2421 2422 case '\"': 2423 rcparse_warning ("use \"\" to put \" in a string"); 2424 break; 2425 2426 case 'a': 2427 *s++ = ESCAPE_A; 2428 ++t; 2429 break; 2430 2431 case 'b': 2432 *s++ = ESCAPE_B; 2433 ++t; 2434 break; 2435 2436 case 'f': 2437 *s++ = ESCAPE_F; 2438 ++t; 2439 break; 2440 2441 case 'n': 2442 *s++ = ESCAPE_N; 2443 ++t; 2444 break; 2445 2446 case 'r': 2447 *s++ = ESCAPE_R; 2448 ++t; 2449 break; 2450 2451 case 't': 2452 *s++ = ESCAPE_T; 2453 ++t; 2454 break; 2455 2456 case 'v': 2457 *s++ = ESCAPE_V; 2458 ++t; 2459 break; 2460 2461 case '\\': 2462 *s++ = *t++; 2463 break; 2464 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') 2470 { 2471 ch = (ch << 3) | (*t - '0'); 2472 ++t; 2473 if (*t >= '0' && *t <= '7') 2474 { 2475 ch = (ch << 3) | (*t - '0'); 2476 ++t; 2477 } 2478 } 2479 *s++ = ch; 2480 break; 2481 2482 case 'x': 2483 ++t; 2484 ch = 0; 2485 while (1) 2486 { 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; 2496 } 2497 *s++ = ch; 2498 break; 2499 2500 default: 2501 rcparse_warning ("unrecognized escape sequence"); 2502 *s++ = '\\'; 2503 *s++ = *t++; 2504 break; 2505 } 2506 } 2507 else if (*t != '"') 2508 *s++ = *t++; 2509 else if (t[1] == '\0') 2510 break; 2511 else if (t[1] == '"') 2512 { 2513 *s++ = '"'; 2514 t += 2; 2515 } 2516 else 2517 { 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; 2526 } 2527 } 2528 2529 *s = '\0'; 2530 2531 *len = s - ret; 2532 2533 return ret; 2534} 2535 2536/* Allocate a string of a given length. */ 2537 2538static char * 2539get_string (len) 2540 int len; 2541{ 2542 struct alloc_string *as; 2543 2544 as = (struct alloc_string *) xmalloc (sizeof *as); 2545 as->s = xmalloc (len); 2546 2547 as->next = strings; 2548 strings = as->next; 2549 2550 return as->s; 2551} 2552 2553/* Discard all the strings we have allocated. The parser calls this 2554 when it no longer needs them. */ 2555 2556void 2557rcparse_discard_strings () 2558{ 2559 struct alloc_string *as; 2560 2561 as = strings; 2562 while (as != NULL) 2563 { 2564 struct alloc_string *n; 2565 2566 free (as->s); 2567 n = as->next; 2568 free (as); 2569 as = n; 2570 } 2571 2572 strings = NULL; 2573} 2574 2575/* Enter rcdata mode. */ 2576 2577void 2578rcparse_rcdata () 2579{ 2580 rcdata_mode = 1; 2581} 2582 2583/* Go back to normal mode from rcdata mode. */ 2584 2585void 2586rcparse_normal () 2587{ 2588 rcdata_mode = 0; 2589} 2590