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