Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenparser.yy.c
Go to the documentation of this file.
00001 #line 2 "parser.yy.c" 00002 00003 #line 4 "parser.yy.c" 00004 00005 #define YY_INT_ALIGNED short int 00006 00007 /* A lexical scanner generated by flex */ 00008 00009 #define yy_create_buffer parser__create_buffer 00010 #define yy_delete_buffer parser__delete_buffer 00011 #define yy_flex_debug parser__flex_debug 00012 #define yy_init_buffer parser__init_buffer 00013 #define yy_flush_buffer parser__flush_buffer 00014 #define yy_load_buffer_state parser__load_buffer_state 00015 #define yy_switch_to_buffer parser__switch_to_buffer 00016 #define yyin parser_in 00017 #define yyleng parser_leng 00018 #define yylex parser_lex 00019 #define yylineno parser_lineno 00020 #define yyout parser_out 00021 #define yyrestart parser_restart 00022 #define yytext parser_text 00023 #define yywrap parser_wrap 00024 #define yyalloc parser_alloc 00025 #define yyrealloc parser_realloc 00026 #define yyfree parser_free 00027 00028 #define FLEX_SCANNER 00029 #define YY_FLEX_MAJOR_VERSION 2 00030 #define YY_FLEX_MINOR_VERSION 5 00031 #define YY_FLEX_SUBMINOR_VERSION 35 00032 #if YY_FLEX_SUBMINOR_VERSION > 0 00033 #define FLEX_BETA 00034 #endif 00035 00036 /* First, we deal with platform-specific or compiler-specific issues. */ 00037 00038 /* begin standard C headers. */ 00039 #include <stdio.h> 00040 #include <string.h> 00041 #include <errno.h> 00042 #include <stdlib.h> 00043 00044 /* end standard C headers. */ 00045 00046 /* flex integer type definitions */ 00047 00048 #ifndef FLEXINT_H 00049 #define FLEXINT_H 00050 00051 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 00052 00053 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 00054 00055 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 00056 * if you want the limit (max/min) macros for int types. 00057 */ 00058 #ifndef __STDC_LIMIT_MACROS 00059 #define __STDC_LIMIT_MACROS 1 00060 #endif 00061 00062 #include <inttypes.h> 00063 typedef int8_t flex_int8_t; 00064 typedef uint8_t flex_uint8_t; 00065 typedef int16_t flex_int16_t; 00066 typedef uint16_t flex_uint16_t; 00067 typedef int32_t flex_int32_t; 00068 typedef uint32_t flex_uint32_t; 00069 #else 00070 typedef signed char flex_int8_t; 00071 typedef short int flex_int16_t; 00072 typedef int flex_int32_t; 00073 typedef unsigned char flex_uint8_t; 00074 typedef unsigned short int flex_uint16_t; 00075 typedef unsigned int flex_uint32_t; 00076 00077 /* Limits of integral types. */ 00078 #ifndef INT8_MIN 00079 #define INT8_MIN (-128) 00080 #endif 00081 #ifndef INT16_MIN 00082 #define INT16_MIN (-32767-1) 00083 #endif 00084 #ifndef INT32_MIN 00085 #define INT32_MIN (-2147483647-1) 00086 #endif 00087 #ifndef INT8_MAX 00088 #define INT8_MAX (127) 00089 #endif 00090 #ifndef INT16_MAX 00091 #define INT16_MAX (32767) 00092 #endif 00093 #ifndef INT32_MAX 00094 #define INT32_MAX (2147483647) 00095 #endif 00096 #ifndef UINT8_MAX 00097 #define UINT8_MAX (255U) 00098 #endif 00099 #ifndef UINT16_MAX 00100 #define UINT16_MAX (65535U) 00101 #endif 00102 #ifndef UINT32_MAX 00103 #define UINT32_MAX (4294967295U) 00104 #endif 00105 00106 #endif /* ! C99 */ 00107 00108 #endif /* ! FLEXINT_H */ 00109 00110 #ifdef __cplusplus 00111 00112 /* The "const" storage-class-modifier is valid. */ 00113 #define YY_USE_CONST 00114 00115 #else /* ! __cplusplus */ 00116 00117 /* C99 requires __STDC__ to be defined as 1. */ 00118 #if defined (__STDC__) 00119 00120 #define YY_USE_CONST 00121 00122 #endif /* defined (__STDC__) */ 00123 #endif /* ! __cplusplus */ 00124 00125 #ifdef YY_USE_CONST 00126 #define yyconst const 00127 #else 00128 #define yyconst 00129 #endif 00130 00131 /* Returned upon end-of-file. */ 00132 #define YY_NULL 0 00133 00134 /* Promotes a possibly negative, possibly signed char to an unsigned 00135 * integer for use as an array index. If the signed char is negative, 00136 * we want to instead treat it as an 8-bit unsigned char, hence the 00137 * double cast. 00138 */ 00139 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 00140 00141 /* Enter a start condition. This macro really ought to take a parameter, 00142 * but we do it the disgusting crufty way forced on us by the ()-less 00143 * definition of BEGIN. 00144 */ 00145 #define BEGIN (yy_start) = 1 + 2 * 00146 00147 /* Translate the current start state into a value that can be later handed 00148 * to BEGIN to return to the state. The YYSTATE alias is for lex 00149 * compatibility. 00150 */ 00151 #define YY_START (((yy_start) - 1) / 2) 00152 #define YYSTATE YY_START 00153 00154 /* Action number for EOF rule of a given start state. */ 00155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 00156 00157 /* Special action meaning "start processing a new file". */ 00158 #define YY_NEW_FILE parser_restart(parser_in ) 00159 00160 #define YY_END_OF_BUFFER_CHAR 0 00161 00162 /* Size of default input buffer. */ 00163 #ifndef YY_BUF_SIZE 00164 #ifdef __ia64__ 00165 /* On IA-64, the buffer size is 16k, not 8k. 00166 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. 00167 * Ditto for the __ia64__ case accordingly. 00168 */ 00169 #define YY_BUF_SIZE 32768 00170 #else 00171 #define YY_BUF_SIZE 16384 00172 #endif /* __ia64__ */ 00173 #endif 00174 00175 /* The state buf must be large enough to hold one state per character in the main buffer. 00176 */ 00177 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 00178 00179 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 00180 #define YY_TYPEDEF_YY_BUFFER_STATE 00181 typedef struct yy_buffer_state *YY_BUFFER_STATE; 00182 #endif 00183 00184 extern int parser_leng; 00185 00186 extern FILE *parser_in, *parser_out; 00187 00188 #define EOB_ACT_CONTINUE_SCAN 0 00189 #define EOB_ACT_END_OF_FILE 1 00190 #define EOB_ACT_LAST_MATCH 2 00191 00192 #define YY_LESS_LINENO(n) 00193 00194 /* Return all but the first "n" matched characters back to the input stream. */ 00195 #define yyless(n) \ 00196 do \ 00197 { \ 00198 /* Undo effects of setting up parser_text. */ \ 00199 int yyless_macro_arg = (n); \ 00200 YY_LESS_LINENO(yyless_macro_arg);\ 00201 *yy_cp = (yy_hold_char); \ 00202 YY_RESTORE_YY_MORE_OFFSET \ 00203 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 00204 YY_DO_BEFORE_ACTION; /* set up parser_text again */ \ 00205 } \ 00206 while ( 0 ) 00207 00208 #define unput(c) yyunput( c, (yytext_ptr) ) 00209 00210 #ifndef YY_TYPEDEF_YY_SIZE_T 00211 #define YY_TYPEDEF_YY_SIZE_T 00212 typedef size_t yy_size_t; 00213 #endif 00214 00215 #ifndef YY_STRUCT_YY_BUFFER_STATE 00216 #define YY_STRUCT_YY_BUFFER_STATE 00217 struct yy_buffer_state 00218 { 00219 FILE *yy_input_file; 00220 00221 char *yy_ch_buf; /* input buffer */ 00222 char *yy_buf_pos; /* current position in input buffer */ 00223 00224 /* Size of input buffer in bytes, not including room for EOB 00225 * characters. 00226 */ 00227 yy_size_t yy_buf_size; 00228 00229 /* Number of characters read into yy_ch_buf, not including EOB 00230 * characters. 00231 */ 00232 int yy_n_chars; 00233 00234 /* Whether we "own" the buffer - i.e., we know we created it, 00235 * and can realloc() it to grow it, and should free() it to 00236 * delete it. 00237 */ 00238 int yy_is_our_buffer; 00239 00240 /* Whether this is an "interactive" input source; if so, and 00241 * if we're using stdio for input, then we want to use getc() 00242 * instead of fread(), to make sure we stop fetching input after 00243 * each newline. 00244 */ 00245 int yy_is_interactive; 00246 00247 /* Whether we're considered to be at the beginning of a line. 00248 * If so, '^' rules will be active on the next match, otherwise 00249 * not. 00250 */ 00251 int yy_at_bol; 00252 00253 int yy_bs_lineno; 00254 int yy_bs_column; 00256 /* Whether to try to fill the input buffer when we reach the 00257 * end of it. 00258 */ 00259 int yy_fill_buffer; 00260 00261 int yy_buffer_status; 00262 00263 #define YY_BUFFER_NEW 0 00264 #define YY_BUFFER_NORMAL 1 00265 /* When an EOF's been seen but there's still some text to process 00266 * then we mark the buffer as YY_EOF_PENDING, to indicate that we 00267 * shouldn't try reading from the input source any more. We might 00268 * still have a bunch of tokens to match, though, because of 00269 * possible backing-up. 00270 * 00271 * When we actually see the EOF, we change the status to "new" 00272 * (via parser_restart()), so that the user can continue scanning by 00273 * just pointing parser_in at a new input file. 00274 */ 00275 #define YY_BUFFER_EOF_PENDING 2 00276 00277 }; 00278 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 00279 00280 /* Stack of input buffers. */ 00281 static size_t yy_buffer_stack_top = 0; 00282 static size_t yy_buffer_stack_max = 0; 00283 static YY_BUFFER_STATE * yy_buffer_stack = 0; 00285 /* We provide macros for accessing buffer states in case in the 00286 * future we want to put the buffer states in a more general 00287 * "scanner state". 00288 * 00289 * Returns the top of the stack, or NULL. 00290 */ 00291 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 00292 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 00293 : NULL) 00294 00295 /* Same as previous macro, but useful when we know that the buffer stack is not 00296 * NULL or when we need an lvalue. For internal use only. 00297 */ 00298 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 00299 00300 /* yy_hold_char holds the character lost when parser_text is formed. */ 00301 static char yy_hold_char; 00302 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 00303 int parser_leng; 00304 00305 /* Points to current character in buffer. */ 00306 static char *yy_c_buf_p = (char *) 0; 00307 static int yy_init = 0; /* whether we need to initialize */ 00308 static int yy_start = 0; /* start state number */ 00309 00310 /* Flag which is used to allow parser_wrap()'s to do buffer switches 00311 * instead of setting up a fresh parser_in. A bit of a hack ... 00312 */ 00313 static int yy_did_buffer_switch_on_eof; 00314 00315 void parser_restart (FILE *input_file ); 00316 void parser__switch_to_buffer (YY_BUFFER_STATE new_buffer ); 00317 YY_BUFFER_STATE parser__create_buffer (FILE *file,int size ); 00318 void parser__delete_buffer (YY_BUFFER_STATE b ); 00319 void parser__flush_buffer (YY_BUFFER_STATE b ); 00320 void parser_push_buffer_state (YY_BUFFER_STATE new_buffer ); 00321 void parser_pop_buffer_state (void ); 00322 00323 static void parser_ensure_buffer_stack (void ); 00324 static void parser__load_buffer_state (void ); 00325 static void parser__init_buffer (YY_BUFFER_STATE b,FILE *file ); 00326 00327 #define YY_FLUSH_BUFFER parser__flush_buffer(YY_CURRENT_BUFFER ) 00328 00329 YY_BUFFER_STATE parser__scan_buffer (char *base,yy_size_t size ); 00330 YY_BUFFER_STATE parser__scan_string (yyconst char *yy_str ); 00331 YY_BUFFER_STATE parser__scan_bytes (yyconst char *bytes,int len ); 00332 00333 void *parser_alloc (yy_size_t ); 00334 void *parser_realloc (void *,yy_size_t ); 00335 void parser_free (void * ); 00336 00337 #define yy_new_buffer parser__create_buffer 00338 00339 #define yy_set_interactive(is_interactive) \ 00340 { \ 00341 if ( ! YY_CURRENT_BUFFER ){ \ 00342 parser_ensure_buffer_stack (); \ 00343 YY_CURRENT_BUFFER_LVALUE = \ 00344 parser__create_buffer(parser_in,YY_BUF_SIZE ); \ 00345 } \ 00346 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 00347 } 00348 00349 #define yy_set_bol(at_bol) \ 00350 { \ 00351 if ( ! YY_CURRENT_BUFFER ){\ 00352 parser_ensure_buffer_stack (); \ 00353 YY_CURRENT_BUFFER_LVALUE = \ 00354 parser__create_buffer(parser_in,YY_BUF_SIZE ); \ 00355 } \ 00356 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 00357 } 00358 00359 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 00360 00361 /* Begin user sect3 */ 00362 00363 typedef unsigned char YY_CHAR; 00364 00365 FILE *parser_in = (FILE *) 0, *parser_out = (FILE *) 0; 00366 00367 typedef int yy_state_type; 00368 00369 extern int parser_lineno; 00370 00371 int parser_lineno = 1; 00372 00373 extern char *parser_text; 00374 #define yytext_ptr parser_text 00375 00376 static yy_state_type yy_get_previous_state (void ); 00377 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 00378 static int yy_get_next_buffer (void ); 00379 static void yy_fatal_error (yyconst char msg[] ); 00380 00381 /* Done after the current pattern has been matched and before the 00382 * corresponding action - sets up parser_text. 00383 */ 00384 #define YY_DO_BEFORE_ACTION \ 00385 (yytext_ptr) = yy_bp; \ 00386 parser_leng = (size_t) (yy_cp - yy_bp); \ 00387 (yy_hold_char) = *yy_cp; \ 00388 *yy_cp = '\0'; \ 00389 (yy_c_buf_p) = yy_cp; 00390 00391 #define YY_NUM_RULES 36 00392 #define YY_END_OF_BUFFER 37 00393 /* This struct is not used in this scanner, 00394 but its presence is necessary. */ 00395 struct yy_trans_info 00396 { 00397 flex_int32_t yy_verify; 00398 flex_int32_t yy_nxt; 00399 }; 00400 static yyconst flex_int16_t yy_accept[148] = 00401 { 0, 00402 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 00403 0, 0, 37, 35, 24, 23, 35, 3, 35, 7, 00404 35, 35, 19, 19, 35, 35, 35, 22, 22, 22, 00405 14, 35, 24, 1, 13, 36, 4, 13, 6, 19, 00406 19, 16, 16, 16, 15, 2, 8, 13, 29, 33, 00407 27, 0, 0, 19, 19, 19, 0, 25, 31, 28, 00408 30, 26, 22, 5, 22, 32, 0, 1, 1, 12, 00409 10, 9, 19, 0, 16, 16, 2, 11, 34, 20, 00410 19, 19, 18, 22, 19, 0, 16, 0, 18, 18, 00411 22, 19, 0, 16, 0, 20, 18, 18, 22, 19, 00412 00413 0, 16, 22, 19, 0, 16, 22, 19, 0, 16, 00414 22, 19, 0, 16, 22, 0, 19, 0, 21, 0, 00415 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00416 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00417 0, 0, 0, 0, 0, 17, 0 00418 } ; 00419 00420 static yyconst flex_int32_t yy_ec[256] = 00421 { 0, 00422 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 00423 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 00424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00425 1, 2, 4, 5, 6, 1, 1, 7, 8, 9, 00426 1, 1, 10, 1, 11, 12, 1, 13, 14, 14, 00427 14, 14, 14, 14, 14, 14, 14, 1, 1, 15, 00428 16, 17, 1, 1, 18, 19, 19, 19, 20, 21, 00429 22, 22, 22, 22, 22, 23, 22, 22, 22, 22, 00430 22, 24, 25, 22, 26, 22, 22, 27, 28, 22, 00431 29, 30, 31, 1, 22, 1, 19, 19, 19, 19, 00432 00433 32, 19, 22, 22, 22, 22, 22, 33, 22, 22, 00434 22, 22, 22, 22, 22, 22, 34, 22, 22, 35, 00435 22, 22, 1, 36, 1, 1, 1, 1, 1, 1, 00436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00438 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00439 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00440 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00441 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00442 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00443 00444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00448 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00449 1, 1, 1, 1, 1 00450 } ; 00451 00452 static yyconst flex_int32_t yy_meta[37] = 00453 { 0, 00454 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 00455 1, 1, 3, 3, 1, 1, 1, 3, 3, 3, 00456 3, 4, 4, 4, 4, 4, 4, 4, 1, 1, 00457 1, 3, 4, 4, 4, 1 00458 } ; 00459 00460 static yyconst flex_int16_t yy_base[184] = 00461 { 0, 00462 0, 35, 35, 39, 40, 43, 61, 45, 262, 261, 00463 46, 47, 263, 481, 481, 481, 246, 481, 254, 481, 00464 243, 243, 85, 25, 41, 238, 42, 0, 248, 229, 00465 481, 210, 60, 243, 481, 481, 481, 34, 481, 108, 00466 26, 131, 154, 239, 481, 0, 481, 60, 481, 481, 00467 481, 231, 58, 0, 75, 77, 0, 481, 481, 481, 00468 481, 481, 0, 481, 220, 481, 61, 238, 236, 481, 00469 481, 481, 174, 0, 196, 0, 0, 481, 481, 93, 00470 481, 481, 113, 213, 216, 0, 238, 166, 89, 81, 00471 214, 258, 0, 280, 89, 169, 481, 481, 207, 300, 00472 00473 0, 322, 203, 342, 0, 364, 208, 384, 0, 406, 00474 197, 428, 213, 212, 115, 0, 211, 128, 481, 0, 00475 0, 0, 210, 0, 0, 0, 0, 209, 0, 0, 00476 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 00477 0, 0, 0, 0, 0, 481, 481, 462, 466, 468, 00478 472, 476, 215, 210, 209, 208, 202, 201, 200, 199, 00479 196, 195, 193, 188, 187, 182, 181, 178, 175, 168, 00480 167, 166, 159, 158, 157, 145, 135, 130, 129, 113, 00481 102, 88, 75 00482 } ; 00483 00484 static yyconst flex_int16_t yy_def[184] = 00485 { 0, 00486 147, 1, 148, 148, 148, 148, 1, 7, 149, 149, 00487 148, 148, 147, 147, 147, 147, 147, 147, 147, 147, 00488 147, 147, 147, 23, 147, 147, 147, 150, 150, 150, 00489 147, 147, 147, 147, 147, 147, 147, 151, 147, 147, 00490 40, 147, 42, 43, 147, 152, 147, 151, 147, 147, 00491 147, 147, 147, 24, 147, 147, 153, 147, 147, 147, 00492 147, 147, 150, 147, 150, 147, 147, 147, 147, 147, 00493 147, 147, 147, 154, 43, 43, 152, 147, 147, 147, 00494 147, 147, 153, 150, 147, 155, 43, 147, 147, 147, 00495 150, 147, 156, 43, 147, 147, 147, 147, 150, 147, 00496 00497 157, 43, 150, 147, 158, 43, 150, 147, 159, 43, 00498 150, 147, 147, 43, 150, 160, 112, 147, 147, 161, 00499 162, 163, 147, 164, 165, 166, 167, 147, 168, 169, 00500 170, 171, 147, 172, 173, 174, 175, 176, 177, 178, 00501 179, 180, 181, 182, 183, 147, 0, 147, 147, 147, 00502 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 00503 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 00504 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 00505 147, 147, 147 00506 } ; 00507 00508 static yyconst flex_int16_t yy_nxt[518] = 00509 { 0, 00510 14, 15, 16, 17, 18, 14, 19, 20, 14, 14, 00511 21, 22, 23, 24, 25, 26, 27, 28, 28, 28, 00512 28, 28, 29, 28, 30, 28, 28, 28, 31, 14, 00513 14, 28, 28, 28, 28, 32, 33, 36, 71, 37, 00514 34, 36, 36, 37, 39, 36, 33, 39, 36, 36, 00515 34, 147, 147, 47, 47, 58, 59, 61, 62, 147, 00516 147, 67, 67, 72, 38, 68, 68, 78, 38, 38, 00517 80, 80, 38, 40, 41, 48, 48, 146, 42, 42, 00518 42, 42, 43, 44, 43, 43, 43, 43, 43, 72, 00519 145, 45, 42, 43, 43, 43, 53, 54, 54, 82, 00520 00521 81, 96, 96, 98, 144, 80, 80, 55, 81, 82, 00522 56, 57, 88, 98, 97, 143, 118, 55, 56, 57, 00523 73, 73, 97, 119, 88, 74, 74, 74, 74, 118, 00524 55, 142, 141, 56, 57, 89, 119, 140, 90, 74, 00525 55, 56, 57, 75, 75, 89, 90, 139, 75, 75, 00526 75, 75, 76, 76, 76, 76, 76, 76, 76, 138, 00527 137, 136, 75, 76, 76, 76, 76, 76, 135, 133, 00528 132, 76, 76, 76, 76, 95, 95, 131, 96, 96, 00529 130, 96, 96, 128, 127, 76, 85, 85, 88, 126, 00530 125, 86, 86, 86, 86, 123, 55, 122, 121, 56, 00531 00532 88, 120, 113, 109, 105, 86, 55, 56, 87, 87, 00533 101, 93, 86, 87, 87, 87, 87, 83, 134, 129, 00534 124, 147, 116, 116, 115, 111, 107, 87, 92, 92, 00535 103, 99, 91, 93, 93, 93, 93, 69, 55, 69, 00536 84, 56, 79, 64, 69, 66, 65, 93, 55, 56, 00537 94, 94, 64, 60, 52, 94, 94, 94, 94, 51, 00538 50, 49, 147, 36, 36, 147, 147, 147, 147, 94, 00539 100, 100, 147, 147, 147, 101, 101, 101, 101, 147, 00540 55, 147, 147, 56, 147, 147, 147, 147, 147, 101, 00541 55, 56, 102, 102, 147, 147, 147, 102, 102, 102, 00542 00543 102, 147, 147, 147, 147, 147, 147, 147, 147, 147, 00544 147, 102, 104, 104, 147, 147, 147, 105, 105, 105, 00545 105, 147, 55, 147, 147, 56, 147, 147, 147, 147, 00546 147, 105, 55, 56, 106, 106, 147, 147, 147, 106, 00547 106, 106, 106, 147, 147, 147, 147, 147, 147, 147, 00548 147, 147, 147, 106, 108, 108, 147, 147, 147, 109, 00549 109, 109, 109, 147, 55, 147, 147, 56, 147, 147, 00550 147, 147, 147, 109, 55, 56, 110, 110, 147, 147, 00551 147, 110, 110, 110, 110, 147, 147, 147, 147, 147, 00552 147, 147, 147, 147, 147, 110, 112, 112, 147, 147, 00553 00554 147, 113, 113, 113, 113, 147, 55, 147, 147, 56, 00555 147, 147, 147, 147, 147, 113, 55, 56, 114, 114, 00556 147, 147, 147, 114, 114, 114, 114, 147, 147, 147, 00557 147, 147, 147, 147, 147, 147, 147, 114, 116, 147, 00558 117, 117, 147, 147, 147, 147, 147, 147, 147, 147, 00559 55, 147, 147, 56, 147, 147, 147, 147, 147, 147, 00560 55, 56, 35, 35, 35, 35, 46, 46, 46, 46, 00561 63, 63, 70, 147, 70, 70, 77, 147, 77, 77, 00562 13, 147, 147, 147, 147, 147, 147, 147, 147, 147, 00563 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 00564 00565 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 00566 147, 147, 147, 147, 147, 147, 147 00567 } ; 00568 00569 static yyconst flex_int16_t yy_chk[518] = 00570 { 0, 00571 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00572 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00573 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00574 1, 1, 1, 1, 1, 1, 2, 3, 38, 3, 00575 2, 4, 5, 4, 5, 6, 8, 6, 11, 12, 00576 8, 24, 41, 11, 12, 25, 25, 27, 27, 24, 00577 41, 33, 67, 38, 3, 33, 67, 48, 4, 5, 00578 53, 53, 6, 7, 7, 11, 12, 183, 7, 7, 00579 7, 7, 7, 7, 7, 7, 7, 7, 7, 48, 00580 182, 7, 7, 7, 7, 7, 23, 23, 23, 56, 00581 00582 55, 95, 95, 90, 181, 80, 80, 23, 55, 56, 00583 23, 23, 80, 90, 89, 180, 115, 23, 23, 23, 00584 40, 40, 89, 115, 80, 40, 40, 40, 40, 118, 00585 40, 179, 178, 40, 40, 83, 118, 177, 83, 40, 00586 40, 40, 40, 42, 42, 83, 83, 176, 42, 42, 00587 42, 42, 42, 42, 42, 42, 42, 42, 42, 175, 00588 174, 173, 42, 42, 42, 42, 43, 43, 172, 171, 00589 170, 43, 43, 43, 43, 88, 88, 169, 88, 88, 00590 168, 96, 96, 167, 166, 43, 73, 73, 96, 165, 00591 164, 73, 73, 73, 73, 163, 73, 162, 161, 73, 00592 00593 96, 160, 159, 158, 157, 73, 73, 73, 75, 75, 00594 156, 155, 154, 75, 75, 75, 75, 153, 133, 128, 00595 123, 117, 114, 113, 111, 107, 103, 75, 85, 85, 00596 99, 91, 84, 85, 85, 85, 85, 69, 85, 68, 00597 65, 85, 52, 44, 34, 32, 30, 85, 85, 85, 00598 87, 87, 29, 26, 22, 87, 87, 87, 87, 21, 00599 19, 17, 13, 10, 9, 0, 0, 0, 0, 87, 00600 92, 92, 0, 0, 0, 92, 92, 92, 92, 0, 00601 92, 0, 0, 92, 0, 0, 0, 0, 0, 92, 00602 92, 92, 94, 94, 0, 0, 0, 94, 94, 94, 00603 00604 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00605 0, 94, 100, 100, 0, 0, 0, 100, 100, 100, 00606 100, 0, 100, 0, 0, 100, 0, 0, 0, 0, 00607 0, 100, 100, 100, 102, 102, 0, 0, 0, 102, 00608 102, 102, 102, 0, 0, 0, 0, 0, 0, 0, 00609 0, 0, 0, 102, 104, 104, 0, 0, 0, 104, 00610 104, 104, 104, 0, 104, 0, 0, 104, 0, 0, 00611 0, 0, 0, 104, 104, 104, 106, 106, 0, 0, 00612 0, 106, 106, 106, 106, 0, 0, 0, 0, 0, 00613 0, 0, 0, 0, 0, 106, 108, 108, 0, 0, 00614 00615 0, 108, 108, 108, 108, 0, 108, 0, 0, 108, 00616 0, 0, 0, 0, 0, 108, 108, 108, 110, 110, 00617 0, 0, 0, 110, 110, 110, 110, 0, 0, 0, 00618 0, 0, 0, 0, 0, 0, 0, 110, 112, 0, 00619 112, 112, 0, 0, 0, 0, 0, 0, 0, 0, 00620 112, 0, 0, 112, 0, 0, 0, 0, 0, 0, 00621 112, 112, 148, 148, 148, 148, 149, 149, 149, 149, 00622 150, 150, 151, 0, 151, 151, 152, 0, 152, 152, 00623 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 00624 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 00625 00626 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 00627 147, 147, 147, 147, 147, 147, 147 00628 } ; 00629 00630 static yy_state_type yy_last_accepting_state; 00631 static char *yy_last_accepting_cpos; 00632 00633 extern int parser__flex_debug; 00634 int parser__flex_debug = 0; 00635 00636 /* The intent behind this definition is that it'll catch 00637 * any uses of REJECT which flex missed. 00638 */ 00639 #define REJECT reject_used_but_not_detected 00640 #define yymore() yymore_used_but_not_detected 00641 #define YY_MORE_ADJ 0 00642 #define YY_RESTORE_YY_MORE_OFFSET 00643 char *parser_text; 00644 #line 1 "parser.l" 00645 /* -*-C-*- 00646 * IDL Compiler 00647 * 00648 * Copyright 2002 Ove Kaaven 00649 * 00650 * This library is free software; you can redistribute it and/or 00651 * modify it under the terms of the GNU Lesser General Public 00652 * License as published by the Free Software Foundation; either 00653 * version 2.1 of the License, or (at your option) any later version. 00654 * 00655 * This library is distributed in the hope that it will be useful, 00656 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00657 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00658 * Lesser General Public License for more details. 00659 * 00660 * You should have received a copy of the GNU Lesser General Public 00661 * License along with this library; if not, write to the Free Software 00662 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00663 */ 00664 #define YY_NO_INPUT 1 00665 00666 00667 00668 00669 00670 #line 43 "parser.l" 00671 00672 #include "config.h" 00673 #include "wine/port.h" 00674 00675 #include <stdio.h> 00676 #include <stdlib.h> 00677 #include <string.h> 00678 #include <ctype.h> 00679 #include <assert.h> 00680 #include <errno.h> 00681 #include <limits.h> 00682 00683 #ifdef HAVE_UNISTD_H 00684 #include <unistd.h> 00685 #else 00686 #define YY_NO_UNISTD_H 00687 #endif 00688 00689 #include "widl.h" 00690 #include "utils.h" 00691 #include "parser.h" 00692 #include "wine/wpp.h" 00693 00694 #include "parser.tab.h" 00695 00696 static void addcchar(char c); 00697 static char *get_buffered_cstring(void); 00698 00699 static char *cbuffer; 00700 static int cbufidx; 00701 static int cbufalloc = 0; 00702 00703 static int kw_token(const char *kw); 00704 static int attr_token(const char *kw); 00705 00706 #define MAX_IMPORT_DEPTH 10 00707 struct { 00708 YY_BUFFER_STATE state; 00709 char *input_name; 00710 int line_number; 00711 char *temp_name; 00712 } import_stack[MAX_IMPORT_DEPTH]; 00713 int import_stack_ptr = 0; 00714 00715 /* converts an integer in string form to an unsigned long and prints an error 00716 * on overflow */ 00717 static unsigned int xstrtoul(const char *nptr, char **endptr, int base) 00718 { 00719 unsigned long val; 00720 00721 errno = 0; 00722 val = strtoul(nptr, endptr, base); 00723 if ((val == ULONG_MAX && errno == ERANGE) || ((unsigned int)val != val)) 00724 error_loc("integer constant %s is too large\n", nptr); 00725 return val; 00726 } 00727 00728 UUID *parse_uuid(const char *u) 00729 { 00730 UUID* uuid = xmalloc(sizeof(UUID)); 00731 char b[3]; 00732 /* it would be nice to use UuidFromStringA */ 00733 uuid->Data1 = strtoul(u, NULL, 16); 00734 uuid->Data2 = strtoul(u+9, NULL, 16); 00735 uuid->Data3 = strtoul(u+14, NULL, 16); 00736 b[2] = 0; 00737 memcpy(b, u+19, 2); uuid->Data4[0] = strtoul(b, NULL, 16); 00738 memcpy(b, u+21, 2); uuid->Data4[1] = strtoul(b, NULL, 16); 00739 memcpy(b, u+24, 2); uuid->Data4[2] = strtoul(b, NULL, 16); 00740 memcpy(b, u+26, 2); uuid->Data4[3] = strtoul(b, NULL, 16); 00741 memcpy(b, u+28, 2); uuid->Data4[4] = strtoul(b, NULL, 16); 00742 memcpy(b, u+30, 2); uuid->Data4[5] = strtoul(b, NULL, 16); 00743 memcpy(b, u+32, 2); uuid->Data4[6] = strtoul(b, NULL, 16); 00744 memcpy(b, u+34, 2); uuid->Data4[7] = strtoul(b, NULL, 16); 00745 return uuid; 00746 } 00747 00748 /* 00749 ************************************************************************** 00750 * The flexer starts here 00751 ************************************************************************** 00752 */ 00753 #line 754 "parser.yy.c" 00754 00755 #define INITIAL 0 00756 #define QUOTE 1 00757 #define WSTRQUOTE 2 00758 #define ATTR 3 00759 #define PP_LINE 4 00760 #define SQUOTE 5 00761 00762 #ifndef YY_NO_UNISTD_H 00763 /* Special case for "unistd.h", since it is non-ANSI. We include it way 00764 * down here because we want the user's section 1 to have been scanned first. 00765 * The user has a chance to override it with an option. 00766 */ 00767 #include <unistd.h> 00768 #endif 00769 00770 #ifndef YY_EXTRA_TYPE 00771 #define YY_EXTRA_TYPE void * 00772 #endif 00773 00774 static int yy_init_globals (void ); 00775 00776 /* Accessor methods to globals. 00777 These are made visible to non-reentrant scanners for convenience. */ 00778 00779 int parser_lex_destroy (void ); 00780 00781 int parser_get_debug (void ); 00782 00783 void parser_set_debug (int debug_flag ); 00784 00785 YY_EXTRA_TYPE parser_get_extra (void ); 00786 00787 void parser_set_extra (YY_EXTRA_TYPE user_defined ); 00788 00789 FILE *parser_get_in (void ); 00790 00791 void parser_set_in (FILE * in_str ); 00792 00793 FILE *parser_get_out (void ); 00794 00795 void parser_set_out (FILE * out_str ); 00796 00797 int parser_get_leng (void ); 00798 00799 char *parser_get_text (void ); 00800 00801 int parser_get_lineno (void ); 00802 00803 void parser_set_lineno (int line_number ); 00804 00805 /* Macros after this point can all be overridden by user definitions in 00806 * section 1. 00807 */ 00808 00809 #ifndef YY_SKIP_YYWRAP 00810 #ifdef __cplusplus 00811 extern "C" int parser_wrap (void ); 00812 #else 00813 extern int parser_wrap (void ); 00814 #endif 00815 #endif 00816 00817 #ifndef yytext_ptr 00818 static void yy_flex_strncpy (char *,yyconst char *,int ); 00819 #endif 00820 00821 #ifdef YY_NEED_STRLEN 00822 static int yy_flex_strlen (yyconst char * ); 00823 #endif 00824 00825 #ifndef YY_NO_INPUT 00826 00827 #ifdef __cplusplus 00828 static int yyinput (void ); 00829 #else 00830 static int input (void ); 00831 #endif 00832 00833 #endif 00834 00835 static int yy_start_stack_ptr = 0; 00836 static int yy_start_stack_depth = 0; 00837 static int *yy_start_stack = NULL; 00838 00839 static void yy_push_state (int new_state ); 00840 00841 static void yy_pop_state (void ); 00842 00843 /* Amount of stuff to slurp up with each read. */ 00844 #ifndef YY_READ_BUF_SIZE 00845 #ifdef __ia64__ 00846 /* On IA-64, the buffer size is 16k, not 8k */ 00847 #define YY_READ_BUF_SIZE 16384 00848 #else 00849 #define YY_READ_BUF_SIZE 8192 00850 #endif /* __ia64__ */ 00851 #endif 00852 00853 /* Copy whatever the last rule matched to the standard output. */ 00854 #ifndef ECHO 00855 /* This used to be an fputs(), but since the string might contain NUL's, 00856 * we now use fwrite(). 00857 */ 00858 #define ECHO do { if (fwrite( parser_text, parser_leng, 1, parser_out )) {} } while (0) 00859 #endif 00860 00861 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 00862 * is returned in "result". 00863 */ 00864 #ifndef YY_INPUT 00865 #define YY_INPUT(buf,result,max_size) \ 00866 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 00867 { \ 00868 int c = '*'; \ 00869 size_t n; \ 00870 for ( n = 0; n < max_size && \ 00871 (c = getc( parser_in )) != EOF && c != '\n'; ++n ) \ 00872 buf[n] = (char) c; \ 00873 if ( c == '\n' ) \ 00874 buf[n++] = (char) c; \ 00875 if ( c == EOF && ferror( parser_in ) ) \ 00876 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00877 result = n; \ 00878 } \ 00879 else \ 00880 { \ 00881 errno=0; \ 00882 while ( (result = fread(buf, 1, max_size, parser_in))==0 && ferror(parser_in)) \ 00883 { \ 00884 if( errno != EINTR) \ 00885 { \ 00886 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00887 break; \ 00888 } \ 00889 errno=0; \ 00890 clearerr(parser_in); \ 00891 } \ 00892 }\ 00893 \ 00894 00895 #endif 00896 00897 /* No semi-colon after return; correct usage is to write "yyterminate();" - 00898 * we don't want an extra ';' after the "return" because that will cause 00899 * some compilers to complain about unreachable statements. 00900 */ 00901 #ifndef yyterminate 00902 #define yyterminate() return YY_NULL 00903 #endif 00904 00905 /* Number of entries by which start-condition stack grows. */ 00906 #ifndef YY_START_STACK_INCR 00907 #define YY_START_STACK_INCR 25 00908 #endif 00909 00910 /* Report a fatal error. */ 00911 #ifndef YY_FATAL_ERROR 00912 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 00913 #endif 00914 00915 /* end tables serialization structures and prototypes */ 00916 00917 /* Default declaration of generated scanner - a define so the user can 00918 * easily add parameters. 00919 */ 00920 #ifndef YY_DECL 00921 #define YY_DECL_IS_OURS 1 00922 00923 extern int parser_lex (void); 00924 00925 #define YY_DECL int parser_lex (void) 00926 #endif /* !YY_DECL */ 00927 00928 /* Code executed at the beginning of each rule, after parser_text and parser_leng 00929 * have been set up. 00930 */ 00931 #ifndef YY_USER_ACTION 00932 #define YY_USER_ACTION 00933 #endif 00934 00935 /* Code executed at the end of each rule. */ 00936 #ifndef YY_BREAK 00937 #define YY_BREAK break; 00938 #endif 00939 00940 #define YY_RULE_SETUP \ 00941 if ( parser_leng > 0 ) \ 00942 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ 00943 (parser_text[parser_leng - 1] == '\n'); \ 00944 YY_USER_ACTION 00945 00948 YY_DECL 00949 { 00950 register yy_state_type yy_current_state; 00951 register char *yy_cp, *yy_bp; 00952 register int yy_act; 00953 00954 #line 127 "parser.l" 00955 00956 #line 957 "parser.yy.c" 00957 00958 if ( !(yy_init) ) 00959 { 00960 (yy_init) = 1; 00961 00962 #ifdef YY_USER_INIT 00963 YY_USER_INIT; 00964 #endif 00965 00966 if ( ! (yy_start) ) 00967 (yy_start) = 1; /* first start state */ 00968 00969 if ( ! parser_in ) 00970 parser_in = stdin; 00971 00972 if ( ! parser_out ) 00973 parser_out = stdout; 00974 00975 if ( ! YY_CURRENT_BUFFER ) { 00976 parser_ensure_buffer_stack (); 00977 YY_CURRENT_BUFFER_LVALUE = 00978 parser__create_buffer(parser_in,YY_BUF_SIZE ); 00979 } 00980 00981 parser__load_buffer_state( ); 00982 } 00983 00984 while ( 1 ) /* loops until end-of-file is reached */ 00985 { 00986 yy_cp = (yy_c_buf_p); 00987 00988 /* Support of parser_text. */ 00989 *yy_cp = (yy_hold_char); 00990 00991 /* yy_bp points to the position in yy_ch_buf of the start of 00992 * the current run. 00993 */ 00994 yy_bp = yy_cp; 00995 00996 yy_current_state = (yy_start); 00997 yy_current_state += YY_AT_BOL(); 00998 yy_match: 00999 do 01000 { 01001 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 01002 if ( yy_accept[yy_current_state] ) 01003 { 01004 (yy_last_accepting_state) = yy_current_state; 01005 (yy_last_accepting_cpos) = yy_cp; 01006 } 01007 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01008 { 01009 yy_current_state = (int) yy_def[yy_current_state]; 01010 if ( yy_current_state >= 148 ) 01011 yy_c = yy_meta[(unsigned int) yy_c]; 01012 } 01013 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01014 ++yy_cp; 01015 } 01016 while ( yy_current_state != 147 ); 01017 yy_cp = (yy_last_accepting_cpos); 01018 yy_current_state = (yy_last_accepting_state); 01019 01020 yy_find_action: 01021 yy_act = yy_accept[yy_current_state]; 01022 01023 YY_DO_BEFORE_ACTION; 01024 01025 do_action: /* This label is used only to access EOF actions. */ 01026 01027 switch ( yy_act ) 01028 { /* beginning of action switch */ 01029 case 0: /* must back up */ 01030 /* undo the effects of YY_DO_BEFORE_ACTION */ 01031 *yy_cp = (yy_hold_char); 01032 yy_cp = (yy_last_accepting_cpos); 01033 yy_current_state = (yy_last_accepting_state); 01034 goto yy_find_action; 01035 01036 case 1: 01037 YY_RULE_SETUP 01038 #line 128 "parser.l" 01039 yy_push_state(PP_LINE); 01040 YY_BREAK 01041 case 2: 01042 YY_RULE_SETUP 01043 #line 129 "parser.l" 01044 { 01045 int lineno; 01046 char *cptr, *fname; 01047 yy_pop_state(); 01048 lineno = (int)strtol(parser_text, &cptr, 10); 01049 if(!lineno) 01050 error_loc("Malformed '#...' line-directive; invalid linenumber\n"); 01051 fname = strchr(cptr, '"'); 01052 if(!fname) 01053 error_loc("Malformed '#...' line-directive; missing filename\n"); 01054 fname++; 01055 cptr = strchr(fname, '"'); 01056 if(!cptr) 01057 error_loc("Malformed '#...' line-directive; missing terminating \"\n"); 01058 *cptr = '\0'; 01059 line_number = lineno - 1; /* We didn't read the newline */ 01060 input_name = xstrdup(fname); 01061 } 01062 YY_BREAK 01063 case 3: 01064 YY_RULE_SETUP 01065 #line 147 "parser.l" 01066 yy_push_state(QUOTE); cbufidx = 0; 01067 YY_BREAK 01068 case 4: 01069 YY_RULE_SETUP 01070 #line 148 "parser.l" 01071 { 01072 yy_pop_state(); 01073 parser_lval.str = get_buffered_cstring(); 01074 return aSTRING; 01075 } 01076 YY_BREAK 01077 case 5: 01078 YY_RULE_SETUP 01079 #line 153 "parser.l" 01080 yy_push_state(WSTRQUOTE); cbufidx = 0; 01081 YY_BREAK 01082 case 6: 01083 YY_RULE_SETUP 01084 #line 154 "parser.l" 01085 { 01086 yy_pop_state(); 01087 parser_lval.str = get_buffered_cstring(); 01088 return aWSTRING; 01089 } 01090 YY_BREAK 01091 case 7: 01092 YY_RULE_SETUP 01093 #line 159 "parser.l" 01094 yy_push_state(SQUOTE); cbufidx = 0; 01095 YY_BREAK 01096 case 8: 01097 YY_RULE_SETUP 01098 #line 160 "parser.l" 01099 { 01100 yy_pop_state(); 01101 parser_lval.str = get_buffered_cstring(); 01102 return aSQSTRING; 01103 } 01104 YY_BREAK 01105 case 9: 01106 #line 166 "parser.l" 01107 case 10: 01108 YY_RULE_SETUP 01109 #line 166 "parser.l" 01110 addcchar(parser_text[1]); 01111 YY_BREAK 01112 case 11: 01113 YY_RULE_SETUP 01114 #line 167 "parser.l" 01115 addcchar(parser_text[1]); 01116 YY_BREAK 01117 case 12: 01118 YY_RULE_SETUP 01119 #line 168 "parser.l" 01120 addcchar('\\'); addcchar(parser_text[1]); 01121 YY_BREAK 01122 case 13: 01123 YY_RULE_SETUP 01124 #line 169 "parser.l" 01125 addcchar(parser_text[0]); 01126 YY_BREAK 01127 case 14: 01128 YY_RULE_SETUP 01129 #line 170 "parser.l" 01130 yy_push_state(ATTR); return '['; 01131 YY_BREAK 01132 case 15: 01133 YY_RULE_SETUP 01134 #line 171 "parser.l" 01135 yy_pop_state(); return ']'; 01136 YY_BREAK 01137 case 16: 01138 YY_RULE_SETUP 01139 #line 172 "parser.l" 01140 return attr_token(parser_text); 01141 YY_BREAK 01142 case 17: 01143 YY_RULE_SETUP 01144 #line 173 "parser.l" 01145 { 01146 parser_lval.uuid = parse_uuid(parser_text); 01147 return aUUID; 01148 } 01149 YY_BREAK 01150 case 18: 01151 YY_RULE_SETUP 01152 #line 177 "parser.l" 01153 { 01154 parser_lval.num = xstrtoul(parser_text, NULL, 0); 01155 return aHEXNUM; 01156 } 01157 YY_BREAK 01158 case 19: 01159 YY_RULE_SETUP 01160 #line 181 "parser.l" 01161 { 01162 parser_lval.num = xstrtoul(parser_text, NULL, 0); 01163 return aNUM; 01164 } 01165 YY_BREAK 01166 case 20: 01167 YY_RULE_SETUP 01168 #line 185 "parser.l" 01169 { 01170 parser_lval.dbl = strtod(parser_text, NULL); 01171 return aDOUBLE; 01172 } 01173 YY_BREAK 01174 case 21: 01175 *yy_cp = (yy_hold_char); /* undo effects of setting up parser_text */ 01176 (yy_c_buf_p) = yy_cp -= 1; 01177 YY_DO_BEFORE_ACTION; /* set up parser_text again */ 01178 YY_RULE_SETUP 01179 #line 189 "parser.l" 01180 return tSAFEARRAY; 01181 YY_BREAK 01182 case 22: 01183 YY_RULE_SETUP 01184 #line 190 "parser.l" 01185 return kw_token(parser_text); 01186 YY_BREAK 01187 case 23: 01188 /* rule 23 can match eol */ 01189 YY_RULE_SETUP 01190 #line 191 "parser.l" 01191 line_number++; 01192 YY_BREAK 01193 case 24: 01194 YY_RULE_SETUP 01195 #line 192 "parser.l" 01196 01197 YY_BREAK 01198 case 25: 01199 YY_RULE_SETUP 01200 #line 193 "parser.l" 01201 return SHL; 01202 YY_BREAK 01203 case 26: 01204 YY_RULE_SETUP 01205 #line 194 "parser.l" 01206 return SHR; 01207 YY_BREAK 01208 case 27: 01209 YY_RULE_SETUP 01210 #line 195 "parser.l" 01211 return MEMBERPTR; 01212 YY_BREAK 01213 case 28: 01214 YY_RULE_SETUP 01215 #line 196 "parser.l" 01216 return EQUALITY; 01217 YY_BREAK 01218 case 29: 01219 YY_RULE_SETUP 01220 #line 197 "parser.l" 01221 return INEQUALITY; 01222 YY_BREAK 01223 case 30: 01224 YY_RULE_SETUP 01225 #line 198 "parser.l" 01226 return GREATEREQUAL; 01227 YY_BREAK 01228 case 31: 01229 YY_RULE_SETUP 01230 #line 199 "parser.l" 01231 return LESSEQUAL; 01232 YY_BREAK 01233 case 32: 01234 YY_RULE_SETUP 01235 #line 200 "parser.l" 01236 return LOGICALOR; 01237 YY_BREAK 01238 case 33: 01239 YY_RULE_SETUP 01240 #line 201 "parser.l" 01241 return LOGICALAND; 01242 YY_BREAK 01243 case 34: 01244 YY_RULE_SETUP 01245 #line 202 "parser.l" 01246 return ELLIPSIS; 01247 YY_BREAK 01248 case 35: 01249 YY_RULE_SETUP 01250 #line 203 "parser.l" 01251 return parser_text[0]; 01252 YY_BREAK 01253 case YY_STATE_EOF(INITIAL): 01254 case YY_STATE_EOF(QUOTE): 01255 case YY_STATE_EOF(WSTRQUOTE): 01256 case YY_STATE_EOF(ATTR): 01257 case YY_STATE_EOF(PP_LINE): 01258 case YY_STATE_EOF(SQUOTE): 01259 #line 204 "parser.l" 01260 { 01261 if (import_stack_ptr) 01262 return aEOF; 01263 else yyterminate(); 01264 } 01265 YY_BREAK 01266 case 36: 01267 YY_RULE_SETUP 01268 #line 209 "parser.l" 01269 ECHO; 01270 YY_BREAK 01271 #line 1272 "parser.yy.c" 01272 01273 case YY_END_OF_BUFFER: 01274 { 01275 /* Amount of text matched not including the EOB char. */ 01276 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 01277 01278 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 01279 *yy_cp = (yy_hold_char); 01280 YY_RESTORE_YY_MORE_OFFSET 01281 01282 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 01283 { 01284 /* We're scanning a new file or input source. It's 01285 * possible that this happened because the user 01286 * just pointed parser_in at a new source and called 01287 * parser_lex(). If so, then we have to assure 01288 * consistency between YY_CURRENT_BUFFER and our 01289 * globals. Here is the right place to do so, because 01290 * this is the first action (other than possibly a 01291 * back-up) that will match for the new input source. 01292 */ 01293 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01294 YY_CURRENT_BUFFER_LVALUE->yy_input_file = parser_in; 01295 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 01296 } 01297 01298 /* Note that here we test for yy_c_buf_p "<=" to the position 01299 * of the first EOB in the buffer, since yy_c_buf_p will 01300 * already have been incremented past the NUL character 01301 * (since all states make transitions on EOB to the 01302 * end-of-buffer state). Contrast this with the test 01303 * in input(). 01304 */ 01305 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 01306 { /* This was really a NUL. */ 01307 yy_state_type yy_next_state; 01308 01309 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 01310 01311 yy_current_state = yy_get_previous_state( ); 01312 01313 /* Okay, we're now positioned to make the NUL 01314 * transition. We couldn't have 01315 * yy_get_previous_state() go ahead and do it 01316 * for us because it doesn't know how to deal 01317 * with the possibility of jamming (and we don't 01318 * want to build jamming into it because then it 01319 * will run more slowly). 01320 */ 01321 01322 yy_next_state = yy_try_NUL_trans( yy_current_state ); 01323 01324 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01325 01326 if ( yy_next_state ) 01327 { 01328 /* Consume the NUL. */ 01329 yy_cp = ++(yy_c_buf_p); 01330 yy_current_state = yy_next_state; 01331 goto yy_match; 01332 } 01333 01334 else 01335 { 01336 yy_cp = (yy_last_accepting_cpos); 01337 yy_current_state = (yy_last_accepting_state); 01338 goto yy_find_action; 01339 } 01340 } 01341 01342 else switch ( yy_get_next_buffer( ) ) 01343 { 01344 case EOB_ACT_END_OF_FILE: 01345 { 01346 (yy_did_buffer_switch_on_eof) = 0; 01347 01348 if ( parser_wrap( ) ) 01349 { 01350 /* Note: because we've taken care in 01351 * yy_get_next_buffer() to have set up 01352 * parser_text, we can now set up 01353 * yy_c_buf_p so that if some total 01354 * hoser (like flex itself) wants to 01355 * call the scanner after we return the 01356 * YY_NULL, it'll still work - another 01357 * YY_NULL will get returned. 01358 */ 01359 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 01360 01361 yy_act = YY_STATE_EOF(YY_START); 01362 goto do_action; 01363 } 01364 01365 else 01366 { 01367 if ( ! (yy_did_buffer_switch_on_eof) ) 01368 YY_NEW_FILE; 01369 } 01370 break; 01371 } 01372 01373 case EOB_ACT_CONTINUE_SCAN: 01374 (yy_c_buf_p) = 01375 (yytext_ptr) + yy_amount_of_matched_text; 01376 01377 yy_current_state = yy_get_previous_state( ); 01378 01379 yy_cp = (yy_c_buf_p); 01380 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01381 goto yy_match; 01382 01383 case EOB_ACT_LAST_MATCH: 01384 (yy_c_buf_p) = 01385 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 01386 01387 yy_current_state = yy_get_previous_state( ); 01388 01389 yy_cp = (yy_c_buf_p); 01390 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01391 goto yy_find_action; 01392 } 01393 break; 01394 } 01395 01396 default: 01397 YY_FATAL_ERROR( 01398 "fatal flex scanner internal error--no action found" ); 01399 } /* end of action switch */ 01400 } /* end of scanning one token */ 01401 } /* end of parser_lex */ 01402 01403 /* yy_get_next_buffer - try to read in a new buffer 01404 * 01405 * Returns a code representing an action: 01406 * EOB_ACT_LAST_MATCH - 01407 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 01408 * EOB_ACT_END_OF_FILE - end of file 01409 */ 01410 static int yy_get_next_buffer (void) 01411 { 01412 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 01413 register char *source = (yytext_ptr); 01414 register int number_to_move, i; 01415 int ret_val; 01416 01417 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 01418 YY_FATAL_ERROR( 01419 "fatal flex scanner internal error--end of buffer missed" ); 01420 01421 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 01422 { /* Don't try to fill the buffer, so this is an EOF. */ 01423 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 01424 { 01425 /* We matched a single character, the EOB, so 01426 * treat this as a final EOF. 01427 */ 01428 return EOB_ACT_END_OF_FILE; 01429 } 01430 01431 else 01432 { 01433 /* We matched some text prior to the EOB, first 01434 * process it. 01435 */ 01436 return EOB_ACT_LAST_MATCH; 01437 } 01438 } 01439 01440 /* Try to read more data. */ 01441 01442 /* First move last chars to start of buffer. */ 01443 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; 01444 01445 for ( i = 0; i < number_to_move; ++i ) 01446 *(dest++) = *(source++); 01447 01448 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 01449 /* don't do the read, it's not guaranteed to return an EOF, 01450 * just force an EOF 01451 */ 01452 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 01453 01454 else 01455 { 01456 int num_to_read = 01457 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 01458 01459 while ( num_to_read <= 0 ) 01460 { /* Not enough room in the buffer - grow it. */ 01461 01462 /* just a shorter name for the current buffer */ 01463 YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 01464 01465 int yy_c_buf_p_offset = 01466 (int) ((yy_c_buf_p) - b->yy_ch_buf); 01467 01468 if ( b->yy_is_our_buffer ) 01469 { 01470 int new_size = b->yy_buf_size * 2; 01471 01472 if ( new_size <= 0 ) 01473 b->yy_buf_size += b->yy_buf_size / 8; 01474 else 01475 b->yy_buf_size *= 2; 01476 01477 b->yy_ch_buf = (char *) 01478 /* Include room in for 2 EOB chars. */ 01479 parser_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 01480 } 01481 else 01482 /* Can't grow it, we don't own it. */ 01483 b->yy_ch_buf = 0; 01484 01485 if ( ! b->yy_ch_buf ) 01486 YY_FATAL_ERROR( 01487 "fatal error - scanner input buffer overflow" ); 01488 01489 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 01490 01491 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 01492 number_to_move - 1; 01493 01494 } 01495 01496 if ( num_to_read > YY_READ_BUF_SIZE ) 01497 num_to_read = YY_READ_BUF_SIZE; 01498 01499 /* Read in more data. */ 01500 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 01501 (yy_n_chars), (size_t) num_to_read ); 01502 01503 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 01504 } 01505 01506 if ( (yy_n_chars) == 0 ) 01507 { 01508 if ( number_to_move == YY_MORE_ADJ ) 01509 { 01510 ret_val = EOB_ACT_END_OF_FILE; 01511 parser_restart(parser_in ); 01512 } 01513 01514 else 01515 { 01516 ret_val = EOB_ACT_LAST_MATCH; 01517 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 01518 YY_BUFFER_EOF_PENDING; 01519 } 01520 } 01521 01522 else 01523 ret_val = EOB_ACT_CONTINUE_SCAN; 01524 01525 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 01526 /* Extend the array by 50%, plus the number we really need. */ 01527 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); 01528 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) parser_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); 01529 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 01530 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 01531 } 01532 01533 (yy_n_chars) += number_to_move; 01534 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 01535 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 01536 01537 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 01538 01539 return ret_val; 01540 } 01541 01542 /* yy_get_previous_state - get the state just before the EOB char was reached */ 01543 01544 static yy_state_type yy_get_previous_state (void) 01545 { 01546 register yy_state_type yy_current_state; 01547 register char *yy_cp; 01548 01549 yy_current_state = (yy_start); 01550 yy_current_state += YY_AT_BOL(); 01551 01552 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 01553 { 01554 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 01555 if ( yy_accept[yy_current_state] ) 01556 { 01557 (yy_last_accepting_state) = yy_current_state; 01558 (yy_last_accepting_cpos) = yy_cp; 01559 } 01560 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01561 { 01562 yy_current_state = (int) yy_def[yy_current_state]; 01563 if ( yy_current_state >= 148 ) 01564 yy_c = yy_meta[(unsigned int) yy_c]; 01565 } 01566 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01567 } 01568 01569 return yy_current_state; 01570 } 01571 01572 /* yy_try_NUL_trans - try to make a transition on the NUL character 01573 * 01574 * synopsis 01575 * next_state = yy_try_NUL_trans( current_state ); 01576 */ 01577 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 01578 { 01579 register int yy_is_jam; 01580 register char *yy_cp = (yy_c_buf_p); 01581 01582 register YY_CHAR yy_c = 1; 01583 if ( yy_accept[yy_current_state] ) 01584 { 01585 (yy_last_accepting_state) = yy_current_state; 01586 (yy_last_accepting_cpos) = yy_cp; 01587 } 01588 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01589 { 01590 yy_current_state = (int) yy_def[yy_current_state]; 01591 if ( yy_current_state >= 148 ) 01592 yy_c = yy_meta[(unsigned int) yy_c]; 01593 } 01594 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01595 yy_is_jam = (yy_current_state == 147); 01596 01597 return yy_is_jam ? 0 : yy_current_state; 01598 } 01599 01600 #ifndef YY_NO_INPUT 01601 #ifdef __cplusplus 01602 static int yyinput (void) 01603 #else 01604 static int input (void) 01605 #endif 01606 01607 { 01608 int c; 01609 01610 *(yy_c_buf_p) = (yy_hold_char); 01611 01612 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 01613 { 01614 /* yy_c_buf_p now points to the character we want to return. 01615 * If this occurs *before* the EOB characters, then it's a 01616 * valid NUL; if not, then we've hit the end of the buffer. 01617 */ 01618 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 01619 /* This was really a NUL. */ 01620 *(yy_c_buf_p) = '\0'; 01621 01622 else 01623 { /* need more input */ 01624 int offset = (yy_c_buf_p) - (yytext_ptr); 01625 ++(yy_c_buf_p); 01626 01627 switch ( yy_get_next_buffer( ) ) 01628 { 01629 case EOB_ACT_LAST_MATCH: 01630 /* This happens because yy_g_n_b() 01631 * sees that we've accumulated a 01632 * token and flags that we need to 01633 * try matching the token before 01634 * proceeding. But for input(), 01635 * there's no matching to consider. 01636 * So convert the EOB_ACT_LAST_MATCH 01637 * to EOB_ACT_END_OF_FILE. 01638 */ 01639 01640 /* Reset buffer status. */ 01641 parser_restart(parser_in ); 01642 01643 /*FALLTHROUGH*/ 01644 01645 case EOB_ACT_END_OF_FILE: 01646 { 01647 if ( parser_wrap( ) ) 01648 return EOF; 01649 01650 if ( ! (yy_did_buffer_switch_on_eof) ) 01651 YY_NEW_FILE; 01652 #ifdef __cplusplus 01653 return yyinput(); 01654 #else 01655 return input(); 01656 #endif 01657 } 01658 01659 case EOB_ACT_CONTINUE_SCAN: 01660 (yy_c_buf_p) = (yytext_ptr) + offset; 01661 break; 01662 } 01663 } 01664 } 01665 01666 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 01667 *(yy_c_buf_p) = '\0'; /* preserve parser_text */ 01668 (yy_hold_char) = *++(yy_c_buf_p); 01669 01670 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); 01671 01672 return c; 01673 } 01674 #endif /* ifndef YY_NO_INPUT */ 01675 01681 void parser_restart (FILE * input_file ) 01682 { 01683 01684 if ( ! YY_CURRENT_BUFFER ){ 01685 parser_ensure_buffer_stack (); 01686 YY_CURRENT_BUFFER_LVALUE = 01687 parser__create_buffer(parser_in,YY_BUF_SIZE ); 01688 } 01689 01690 parser__init_buffer(YY_CURRENT_BUFFER,input_file ); 01691 parser__load_buffer_state( ); 01692 } 01693 01698 void parser__switch_to_buffer (YY_BUFFER_STATE new_buffer ) 01699 { 01700 01701 /* TODO. We should be able to replace this entire function body 01702 * with 01703 * parser_pop_buffer_state(); 01704 * parser_push_buffer_state(new_buffer); 01705 */ 01706 parser_ensure_buffer_stack (); 01707 if ( YY_CURRENT_BUFFER == new_buffer ) 01708 return; 01709 01710 if ( YY_CURRENT_BUFFER ) 01711 { 01712 /* Flush out information for old buffer. */ 01713 *(yy_c_buf_p) = (yy_hold_char); 01714 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 01715 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 01716 } 01717 01718 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01719 parser__load_buffer_state( ); 01720 01721 /* We don't actually know whether we did this switch during 01722 * EOF (parser_wrap()) processing, but the only time this flag 01723 * is looked at is after parser_wrap() is called, so it's safe 01724 * to go ahead and always set it. 01725 */ 01726 (yy_did_buffer_switch_on_eof) = 1; 01727 } 01728 01729 static void parser__load_buffer_state (void) 01730 { 01731 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01732 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 01733 parser_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 01734 (yy_hold_char) = *(yy_c_buf_p); 01735 } 01736 01743 YY_BUFFER_STATE parser__create_buffer (FILE * file, int size ) 01744 { 01745 YY_BUFFER_STATE b; 01746 01747 b = (YY_BUFFER_STATE) parser_alloc(sizeof( struct yy_buffer_state ) ); 01748 if ( ! b ) 01749 YY_FATAL_ERROR( "out of dynamic memory in parser__create_buffer()" ); 01750 01751 b->yy_buf_size = size; 01752 01753 /* yy_ch_buf has to be 2 characters longer than the size given because 01754 * we need to put in 2 end-of-buffer characters. 01755 */ 01756 b->yy_ch_buf = (char *) parser_alloc(b->yy_buf_size + 2 ); 01757 if ( ! b->yy_ch_buf ) 01758 YY_FATAL_ERROR( "out of dynamic memory in parser__create_buffer()" ); 01759 01760 b->yy_is_our_buffer = 1; 01761 01762 parser__init_buffer(b,file ); 01763 01764 return b; 01765 } 01766 01771 void parser__delete_buffer (YY_BUFFER_STATE b ) 01772 { 01773 01774 if ( ! b ) 01775 return; 01776 01777 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 01778 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 01779 01780 if ( b->yy_is_our_buffer ) 01781 parser_free((void *) b->yy_ch_buf ); 01782 01783 parser_free((void *) b ); 01784 } 01785 01786 /* Initializes or reinitializes a buffer. 01787 * This function is sometimes called more than once on the same buffer, 01788 * such as during a parser_restart() or at EOF. 01789 */ 01790 static void parser__init_buffer (YY_BUFFER_STATE b, FILE * file ) 01791 01792 { 01793 int oerrno = errno; 01794 01795 parser__flush_buffer(b ); 01796 01797 b->yy_input_file = file; 01798 b->yy_fill_buffer = 1; 01799 01800 /* If b is the current buffer, then parser__init_buffer was _probably_ 01801 * called from parser_restart() or through yy_get_next_buffer. 01802 * In that case, we don't want to reset the lineno or column. 01803 */ 01804 if (b != YY_CURRENT_BUFFER){ 01805 b->yy_bs_lineno = 1; 01806 b->yy_bs_column = 0; 01807 } 01808 01809 b->yy_is_interactive = 0; 01810 01811 errno = oerrno; 01812 } 01813 01818 void parser__flush_buffer (YY_BUFFER_STATE b ) 01819 { 01820 if ( ! b ) 01821 return; 01822 01823 b->yy_n_chars = 0; 01824 01825 /* We always need two end-of-buffer characters. The first causes 01826 * a transition to the end-of-buffer state. The second causes 01827 * a jam in that state. 01828 */ 01829 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 01830 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 01831 01832 b->yy_buf_pos = &b->yy_ch_buf[0]; 01833 01834 b->yy_at_bol = 1; 01835 b->yy_buffer_status = YY_BUFFER_NEW; 01836 01837 if ( b == YY_CURRENT_BUFFER ) 01838 parser__load_buffer_state( ); 01839 } 01840 01847 void parser_push_buffer_state (YY_BUFFER_STATE new_buffer ) 01848 { 01849 if (new_buffer == NULL) 01850 return; 01851 01852 parser_ensure_buffer_stack(); 01853 01854 /* This block is copied from parser__switch_to_buffer. */ 01855 if ( YY_CURRENT_BUFFER ) 01856 { 01857 /* Flush out information for old buffer. */ 01858 *(yy_c_buf_p) = (yy_hold_char); 01859 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 01860 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 01861 } 01862 01863 /* Only push if top exists. Otherwise, replace top. */ 01864 if (YY_CURRENT_BUFFER) 01865 (yy_buffer_stack_top)++; 01866 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01867 01868 /* copied from parser__switch_to_buffer. */ 01869 parser__load_buffer_state( ); 01870 (yy_did_buffer_switch_on_eof) = 1; 01871 } 01872 01877 void parser_pop_buffer_state (void) 01878 { 01879 if (!YY_CURRENT_BUFFER) 01880 return; 01881 01882 parser__delete_buffer(YY_CURRENT_BUFFER ); 01883 YY_CURRENT_BUFFER_LVALUE = NULL; 01884 if ((yy_buffer_stack_top) > 0) 01885 --(yy_buffer_stack_top); 01886 01887 if (YY_CURRENT_BUFFER) { 01888 parser__load_buffer_state( ); 01889 (yy_did_buffer_switch_on_eof) = 1; 01890 } 01891 } 01892 01893 /* Allocates the stack if it does not exist. 01894 * Guarantees space for at least one push. 01895 */ 01896 static void parser_ensure_buffer_stack (void) 01897 { 01898 int num_to_alloc; 01899 01900 if (!(yy_buffer_stack)) { 01901 01902 /* First allocation is just for 2 elements, since we don't know if this 01903 * scanner will even need a stack. We use 2 instead of 1 to avoid an 01904 * immediate realloc on the next call. 01905 */ 01906 num_to_alloc = 1; 01907 (yy_buffer_stack) = (struct yy_buffer_state**)parser_alloc 01908 (num_to_alloc * sizeof(struct yy_buffer_state*) 01909 ); 01910 if ( ! (yy_buffer_stack) ) 01911 YY_FATAL_ERROR( "out of dynamic memory in parser_ensure_buffer_stack()" ); 01912 01913 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 01914 01915 (yy_buffer_stack_max) = num_to_alloc; 01916 (yy_buffer_stack_top) = 0; 01917 return; 01918 } 01919 01920 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 01921 01922 /* Increase the buffer to prepare for a possible push. */ 01923 int grow_size = 8 /* arbitrary grow size */; 01924 01925 num_to_alloc = (yy_buffer_stack_max) + grow_size; 01926 (yy_buffer_stack) = (struct yy_buffer_state**)parser_realloc 01927 ((yy_buffer_stack), 01928 num_to_alloc * sizeof(struct yy_buffer_state*) 01929 ); 01930 if ( ! (yy_buffer_stack) ) 01931 YY_FATAL_ERROR( "out of dynamic memory in parser_ensure_buffer_stack()" ); 01932 01933 /* zero only the new slots.*/ 01934 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 01935 (yy_buffer_stack_max) = num_to_alloc; 01936 } 01937 } 01938 01945 YY_BUFFER_STATE parser__scan_buffer (char * base, yy_size_t size ) 01946 { 01947 YY_BUFFER_STATE b; 01948 01949 if ( size < 2 || 01950 base[size-2] != YY_END_OF_BUFFER_CHAR || 01951 base[size-1] != YY_END_OF_BUFFER_CHAR ) 01952 /* They forgot to leave room for the EOB's. */ 01953 return 0; 01954 01955 b = (YY_BUFFER_STATE) parser_alloc(sizeof( struct yy_buffer_state ) ); 01956 if ( ! b ) 01957 YY_FATAL_ERROR( "out of dynamic memory in parser__scan_buffer()" ); 01958 01959 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 01960 b->yy_buf_pos = b->yy_ch_buf = base; 01961 b->yy_is_our_buffer = 0; 01962 b->yy_input_file = 0; 01963 b->yy_n_chars = b->yy_buf_size; 01964 b->yy_is_interactive = 0; 01965 b->yy_at_bol = 1; 01966 b->yy_fill_buffer = 0; 01967 b->yy_buffer_status = YY_BUFFER_NEW; 01968 01969 parser__switch_to_buffer(b ); 01970 01971 return b; 01972 } 01973 01982 YY_BUFFER_STATE parser__scan_string (yyconst char * yystr ) 01983 { 01984 01985 return parser__scan_bytes(yystr,strlen(yystr) ); 01986 } 01987 01995 YY_BUFFER_STATE parser__scan_bytes (yyconst char * yybytes, int _yybytes_len ) 01996 { 01997 YY_BUFFER_STATE b; 01998 char *buf; 01999 yy_size_t n; 02000 int i; 02001 02002 /* Get memory for full buffer, including space for trailing EOB's. */ 02003 n = _yybytes_len + 2; 02004 buf = (char *) parser_alloc(n ); 02005 if ( ! buf ) 02006 YY_FATAL_ERROR( "out of dynamic memory in parser__scan_bytes()" ); 02007 02008 for ( i = 0; i < _yybytes_len; ++i ) 02009 buf[i] = yybytes[i]; 02010 02011 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 02012 02013 b = parser__scan_buffer(buf,n ); 02014 if ( ! b ) 02015 YY_FATAL_ERROR( "bad buffer in parser__scan_bytes()" ); 02016 02017 /* It's okay to grow etc. this buffer, and we should throw it 02018 * away when we're done. 02019 */ 02020 b->yy_is_our_buffer = 1; 02021 02022 return b; 02023 } 02024 02025 static void yy_push_state (int new_state ) 02026 { 02027 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) 02028 { 02029 yy_size_t new_size; 02030 02031 (yy_start_stack_depth) += YY_START_STACK_INCR; 02032 new_size = (yy_start_stack_depth) * sizeof( int ); 02033 02034 if ( ! (yy_start_stack) ) 02035 (yy_start_stack) = (int *) parser_alloc(new_size ); 02036 02037 else 02038 (yy_start_stack) = (int *) parser_realloc((void *) (yy_start_stack),new_size ); 02039 02040 if ( ! (yy_start_stack) ) 02041 YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); 02042 } 02043 02044 (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; 02045 02046 BEGIN(new_state); 02047 } 02048 02049 static void yy_pop_state (void) 02050 { 02051 if ( --(yy_start_stack_ptr) < 0 ) 02052 YY_FATAL_ERROR( "start-condition stack underflow" ); 02053 02054 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); 02055 } 02056 02057 #ifndef YY_EXIT_FAILURE 02058 #define YY_EXIT_FAILURE 2 02059 #endif 02060 02061 static void yy_fatal_error (yyconst char* msg ) 02062 { 02063 (void) fprintf( stderr, "%s\n", msg ); 02064 exit( YY_EXIT_FAILURE ); 02065 } 02066 02067 /* Redefine yyless() so it works in section 3 code. */ 02068 02069 #undef yyless 02070 #define yyless(n) \ 02071 do \ 02072 { \ 02073 /* Undo effects of setting up parser_text. */ \ 02074 int yyless_macro_arg = (n); \ 02075 YY_LESS_LINENO(yyless_macro_arg);\ 02076 parser_text[parser_leng] = (yy_hold_char); \ 02077 (yy_c_buf_p) = parser_text + yyless_macro_arg; \ 02078 (yy_hold_char) = *(yy_c_buf_p); \ 02079 *(yy_c_buf_p) = '\0'; \ 02080 parser_leng = yyless_macro_arg; \ 02081 } \ 02082 while ( 0 ) 02083 02084 /* Accessor methods (get/set functions) to struct members. */ 02085 02089 int parser_get_lineno (void) 02090 { 02091 02092 return parser_lineno; 02093 } 02094 02098 FILE *parser_get_in (void) 02099 { 02100 return parser_in; 02101 } 02102 02106 FILE *parser_get_out (void) 02107 { 02108 return parser_out; 02109 } 02110 02114 int parser_get_leng (void) 02115 { 02116 return parser_leng; 02117 } 02118 02123 char *parser_get_text (void) 02124 { 02125 return parser_text; 02126 } 02127 02132 void parser_set_lineno (int line_number ) 02133 { 02134 02135 parser_lineno = line_number; 02136 } 02137 02144 void parser_set_in (FILE * in_str ) 02145 { 02146 parser_in = in_str ; 02147 } 02148 02149 void parser_set_out (FILE * out_str ) 02150 { 02151 parser_out = out_str ; 02152 } 02153 02154 int parser_get_debug (void) 02155 { 02156 return parser__flex_debug; 02157 } 02158 02159 void parser_set_debug (int bdebug ) 02160 { 02161 parser__flex_debug = bdebug ; 02162 } 02163 02164 static int yy_init_globals (void) 02165 { 02166 /* Initialization is the same as for the non-reentrant scanner. 02167 * This function is called from parser_lex_destroy(), so don't allocate here. 02168 */ 02169 02170 (yy_buffer_stack) = 0; 02171 (yy_buffer_stack_top) = 0; 02172 (yy_buffer_stack_max) = 0; 02173 (yy_c_buf_p) = (char *) 0; 02174 (yy_init) = 0; 02175 (yy_start) = 0; 02176 02177 (yy_start_stack_ptr) = 0; 02178 (yy_start_stack_depth) = 0; 02179 (yy_start_stack) = NULL; 02180 02181 /* Defined in main.c */ 02182 #ifdef YY_STDINIT 02183 parser_in = stdin; 02184 parser_out = stdout; 02185 #else 02186 parser_in = (FILE *) 0; 02187 parser_out = (FILE *) 0; 02188 #endif 02189 02190 /* For future reference: Set errno on error, since we are called by 02191 * parser_lex_init() 02192 */ 02193 return 0; 02194 } 02195 02196 /* parser_lex_destroy is for both reentrant and non-reentrant scanners. */ 02197 int parser_lex_destroy (void) 02198 { 02199 02200 /* Pop the buffer stack, destroying each element. */ 02201 while(YY_CURRENT_BUFFER){ 02202 parser__delete_buffer(YY_CURRENT_BUFFER ); 02203 YY_CURRENT_BUFFER_LVALUE = NULL; 02204 parser_pop_buffer_state(); 02205 } 02206 02207 /* Destroy the stack itself. */ 02208 parser_free((yy_buffer_stack) ); 02209 (yy_buffer_stack) = NULL; 02210 02211 /* Destroy the start condition stack. */ 02212 parser_free((yy_start_stack) ); 02213 (yy_start_stack) = NULL; 02214 02215 /* Reset the globals. This is important in a non-reentrant scanner so the next time 02216 * parser_lex() is called, initialization will occur. */ 02217 yy_init_globals( ); 02218 02219 return 0; 02220 } 02221 02222 /* 02223 * Internal utility routines. 02224 */ 02225 02226 #ifndef yytext_ptr 02227 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 02228 { 02229 register int i; 02230 for ( i = 0; i < n; ++i ) 02231 s1[i] = s2[i]; 02232 } 02233 #endif 02234 02235 #ifdef YY_NEED_STRLEN 02236 static int yy_flex_strlen (yyconst char * s ) 02237 { 02238 register int n; 02239 for ( n = 0; s[n]; ++n ) 02240 ; 02241 02242 return n; 02243 } 02244 #endif 02245 02246 void *parser_alloc (yy_size_t size ) 02247 { 02248 return (void *) malloc( size ); 02249 } 02250 02251 void *parser_realloc (void * ptr, yy_size_t size ) 02252 { 02253 /* The cast to (char *) in the following accommodates both 02254 * implementations that use char* generic pointers, and those 02255 * that use void* generic pointers. It works with the latter 02256 * because both ANSI C and C++ allow castless assignment from 02257 * any pointer type to void*, and deal with argument conversions 02258 * as though doing an assignment. 02259 */ 02260 return (void *) realloc( (char *) ptr, size ); 02261 } 02262 02263 void parser_free (void * ptr ) 02264 { 02265 free( (char *) ptr ); /* see parser_realloc() for (char *) cast */ 02266 } 02267 02268 #define YYTABLES_NAME "yytables" 02269 02270 #line 209 "parser.l" 02271 02272 02273 02274 #ifndef parser_wrap 02275 int parser_wrap(void) 02276 { 02277 return 1; 02278 } 02279 #endif 02280 02281 struct keyword { 02282 const char *kw; 02283 int token; 02284 }; 02285 02286 /* This table MUST be alphabetically sorted on the kw field */ 02287 static const struct keyword keywords[] = { 02288 {"FALSE", tFALSE}, 02289 {"NULL", tNULL}, 02290 {"TRUE", tTRUE}, 02291 {"__cdecl", tCDECL}, 02292 {"__fastcall", tFASTCALL}, 02293 {"__int3264", tINT3264}, 02294 {"__int64", tINT64}, 02295 {"__pascal", tPASCAL}, 02296 {"__stdcall", tSTDCALL}, 02297 {"_cdecl", tCDECL}, 02298 {"_fastcall", tFASTCALL}, 02299 {"_pascal", tPASCAL}, 02300 {"_stdcall", tSTDCALL}, 02301 {"boolean", tBOOLEAN}, 02302 {"byte", tBYTE}, 02303 {"case", tCASE}, 02304 {"cdecl", tCDECL}, 02305 {"char", tCHAR}, 02306 {"coclass", tCOCLASS}, 02307 {"const", tCONST}, 02308 {"cpp_quote", tCPPQUOTE}, 02309 {"default", tDEFAULT}, 02310 {"dispinterface", tDISPINTERFACE}, 02311 {"double", tDOUBLE}, 02312 {"enum", tENUM}, 02313 {"error_status_t", tERRORSTATUST}, 02314 {"extern", tEXTERN}, 02315 {"float", tFLOAT}, 02316 {"handle_t", tHANDLET}, 02317 {"hyper", tHYPER}, 02318 {"import", tIMPORT}, 02319 {"importlib", tIMPORTLIB}, 02320 {"inline", tINLINE}, 02321 {"int", tINT}, 02322 {"interface", tINTERFACE}, 02323 {"library", tLIBRARY}, 02324 {"long", tLONG}, 02325 {"methods", tMETHODS}, 02326 {"module", tMODULE}, 02327 {"pascal", tPASCAL}, 02328 {"properties", tPROPERTIES}, 02329 {"register", tREGISTER}, 02330 {"short", tSHORT}, 02331 {"signed", tSIGNED}, 02332 {"sizeof", tSIZEOF}, 02333 {"small", tSMALL}, 02334 {"static", tSTATIC}, 02335 {"stdcall", tSTDCALL}, 02336 {"struct", tSTRUCT}, 02337 {"switch", tSWITCH}, 02338 {"typedef", tTYPEDEF}, 02339 {"union", tUNION}, 02340 {"unsigned", tUNSIGNED}, 02341 {"void", tVOID}, 02342 {"wchar_t", tWCHAR}, 02343 }; 02344 #define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0])) 02345 02346 /* keywords only recognized in attribute lists 02347 * This table MUST be alphabetically sorted on the kw field 02348 */ 02349 static const struct keyword attr_keywords[] = 02350 { 02351 {"aggregatable", tAGGREGATABLE}, 02352 {"allocate", tALLOCATE}, 02353 {"annotation", tANNOTATION}, 02354 {"apartment", tAPARTMENT}, 02355 {"appobject", tAPPOBJECT}, 02356 {"async", tASYNC}, 02357 {"async_uuid", tASYNCUUID}, 02358 {"auto_handle", tAUTOHANDLE}, 02359 {"bindable", tBINDABLE}, 02360 {"both", tBOTH}, 02361 {"broadcast", tBROADCAST}, 02362 {"byte_count", tBYTECOUNT}, 02363 {"call_as", tCALLAS}, 02364 {"callback", tCALLBACK}, 02365 {"code", tCODE}, 02366 {"comm_status", tCOMMSTATUS}, 02367 {"context_handle", tCONTEXTHANDLE}, 02368 {"context_handle_noserialize", tCONTEXTHANDLENOSERIALIZE}, 02369 {"context_handle_serialize", tCONTEXTHANDLENOSERIALIZE}, 02370 {"control", tCONTROL}, 02371 {"decode", tDECODE}, 02372 {"defaultbind", tDEFAULTBIND}, 02373 {"defaultcollelem", tDEFAULTCOLLELEM}, 02374 {"defaultvalue", tDEFAULTVALUE}, 02375 {"defaultvtable", tDEFAULTVTABLE}, 02376 {"disable_consistency_check", tDISABLECONSISTENCYCHECK}, 02377 {"displaybind", tDISPLAYBIND}, 02378 {"dllname", tDLLNAME}, 02379 {"dual", tDUAL}, 02380 {"enable_allocate", tENABLEALLOCATE}, 02381 {"encode", tENCODE}, 02382 {"endpoint", tENDPOINT}, 02383 {"entry", tENTRY}, 02384 {"explicit_handle", tEXPLICITHANDLE}, 02385 {"fault_status", tFAULTSTATUS}, 02386 {"force_allocate", tFORCEALLOCATE}, 02387 {"free", tFREE}, 02388 {"handle", tHANDLE}, 02389 {"helpcontext", tHELPCONTEXT}, 02390 {"helpfile", tHELPFILE}, 02391 {"helpstring", tHELPSTRING}, 02392 {"helpstringcontext", tHELPSTRINGCONTEXT}, 02393 {"helpstringdll", tHELPSTRINGDLL}, 02394 {"hidden", tHIDDEN}, 02395 {"id", tID}, 02396 {"idempotent", tIDEMPOTENT}, 02397 {"ignore", tIGNORE}, 02398 {"iid_is", tIIDIS}, 02399 {"immediatebind", tIMMEDIATEBIND}, 02400 {"implicit_handle", tIMPLICITHANDLE}, 02401 {"in", tIN}, 02402 {"in_line", tIN_LINE}, 02403 {"input_sync", tINPUTSYNC}, 02404 {"lcid", tLCID}, 02405 {"length_is", tLENGTHIS}, 02406 {"licensed", tLICENSED}, 02407 {"local", tLOCAL}, 02408 {"maybe", tMAYBE}, 02409 {"message", tMESSAGE}, 02410 {"neutral", tNEUTRAL}, 02411 {"nocode", tNOCODE}, 02412 {"nonbrowsable", tNONBROWSABLE}, 02413 {"noncreatable", tNONCREATABLE}, 02414 {"nonextensible", tNONEXTENSIBLE}, 02415 {"notify", tNOTIFY}, 02416 {"notify_flag", tNOTIFYFLAG}, 02417 {"object", tOBJECT}, 02418 {"odl", tODL}, 02419 {"oleautomation", tOLEAUTOMATION}, 02420 {"optimize", tOPTIMIZE}, 02421 {"optional", tOPTIONAL}, 02422 {"out", tOUT}, 02423 {"partial_ignore", tPARTIALIGNORE}, 02424 {"pointer_default", tPOINTERDEFAULT}, 02425 {"progid", tPROGID}, 02426 {"propget", tPROPGET}, 02427 {"propput", tPROPPUT}, 02428 {"propputref", tPROPPUTREF}, 02429 {"proxy", tPROXY}, 02430 {"ptr", tPTR}, 02431 {"public", tPUBLIC}, 02432 {"range", tRANGE}, 02433 {"readonly", tREADONLY}, 02434 {"ref", tREF}, 02435 {"represent_as", tREPRESENTAS}, 02436 {"requestedit", tREQUESTEDIT}, 02437 {"restricted", tRESTRICTED}, 02438 {"retval", tRETVAL}, 02439 {"single", tSINGLE}, 02440 {"size_is", tSIZEIS}, 02441 {"source", tSOURCE}, 02442 {"strict_context_handle", tSTRICTCONTEXTHANDLE}, 02443 {"string", tSTRING}, 02444 {"switch_is", tSWITCHIS}, 02445 {"switch_type", tSWITCHTYPE}, 02446 {"threading", tTHREADING}, 02447 {"transmit_as", tTRANSMITAS}, 02448 {"uidefault", tUIDEFAULT}, 02449 {"unique", tUNIQUE}, 02450 {"user_marshal", tUSERMARSHAL}, 02451 {"usesgetlasterror", tUSESGETLASTERROR}, 02452 {"uuid", tUUID}, 02453 {"v1_enum", tV1ENUM}, 02454 {"vararg", tVARARG}, 02455 {"version", tVERSION}, 02456 {"vi_progid", tVIPROGID}, 02457 {"wire_marshal", tWIREMARSHAL}, 02458 }; 02459 02460 /* attributes TODO: 02461 custom 02462 first_is 02463 last_is 02464 max_is 02465 min_is 02466 */ 02467 02468 #define KWP(p) ((const struct keyword *)(p)) 02469 02470 static int kw_cmp_func(const void *s1, const void *s2) 02471 { 02472 return strcmp(KWP(s1)->kw, KWP(s2)->kw); 02473 } 02474 02475 static int kw_token(const char *kw) 02476 { 02477 struct keyword key, *kwp; 02478 key.kw = kw; 02479 kwp = bsearch(&key, keywords, NKEYWORDS, sizeof(keywords[0]), kw_cmp_func); 02480 if (kwp) { 02481 parser_lval.str = xstrdup(kwp->kw); 02482 return kwp->token; 02483 } 02484 parser_lval.str = xstrdup(kw); 02485 return is_type(kw) ? aKNOWNTYPE : aIDENTIFIER; 02486 } 02487 02488 static int attr_token(const char *kw) 02489 { 02490 struct keyword key, *kwp; 02491 key.kw = kw; 02492 kwp = bsearch(&key, attr_keywords, sizeof(attr_keywords)/sizeof(attr_keywords[0]), 02493 sizeof(attr_keywords[0]), kw_cmp_func); 02494 if (kwp) { 02495 parser_lval.str = xstrdup(kwp->kw); 02496 return kwp->token; 02497 } 02498 return kw_token(kw); 02499 } 02500 02501 static void addcchar(char c) 02502 { 02503 if(cbufidx >= cbufalloc) 02504 { 02505 cbufalloc += 1024; 02506 cbuffer = xrealloc(cbuffer, cbufalloc * sizeof(cbuffer[0])); 02507 if(cbufalloc > 65536) 02508 parser_warning("Reallocating string buffer larger than 64kB\n"); 02509 } 02510 cbuffer[cbufidx++] = c; 02511 } 02512 02513 static char *get_buffered_cstring(void) 02514 { 02515 addcchar(0); 02516 return xstrdup(cbuffer); 02517 } 02518 02519 void pop_import(void) 02520 { 02521 int ptr = import_stack_ptr-1; 02522 02523 fclose(parser_in); 02524 parser__delete_buffer(YY_CURRENT_BUFFER ); 02525 parser__switch_to_buffer(import_stack[ptr].state ); 02526 if (temp_name) { 02527 unlink(temp_name); 02528 free(temp_name); 02529 } 02530 temp_name = import_stack[ptr].temp_name; 02531 input_name = import_stack[ptr].input_name; 02532 line_number = import_stack[ptr].line_number; 02533 import_stack_ptr--; 02534 } 02535 02536 struct imports { 02537 char *name; 02538 struct imports *next; 02539 } *first_import; 02540 02541 int do_import(char *fname) 02542 { 02543 FILE *f; 02544 char *path, *name; 02545 struct imports *import; 02546 int ptr = import_stack_ptr; 02547 int ret, fd; 02548 02549 import = first_import; 02550 while (import && strcmp(import->name, fname)) 02551 import = import->next; 02552 if (import) return 0; /* already imported */ 02553 02554 import = xmalloc(sizeof(struct imports)); 02555 import->name = xstrdup(fname); 02556 import->next = first_import; 02557 first_import = import; 02558 02559 /* don't search for a file name with a path in the include directories, 02560 * for compatibility with MIDL */ 02561 if (strchr( fname, '/' ) || strchr( fname, '\\' )) 02562 path = xstrdup( fname ); 02563 else if (!(path = wpp_find_include( fname, input_name ))) 02564 error_loc("Unable to open include file %s\n", fname); 02565 02566 import_stack[ptr].temp_name = temp_name; 02567 import_stack[ptr].input_name = input_name; 02568 import_stack[ptr].line_number = line_number; 02569 import_stack_ptr++; 02570 input_name = path; 02571 line_number = 1; 02572 02573 name = xstrdup( "widl.XXXXXX" ); 02574 if((fd = mkstemps( name, 0 )) == -1) 02575 error("Could not generate a temp name from %s\n", name); 02576 02577 temp_name = name; 02578 if (!(f = fdopen(fd, "wt"))) 02579 error("Could not open fd %s for writing\n", name); 02580 02581 ret = wpp_parse( path, f ); 02582 fclose( f ); 02583 if (ret) exit(1); 02584 02585 if((f = fopen(temp_name, "r")) == NULL) 02586 error_loc("Unable to open %s\n", temp_name); 02587 02588 import_stack[ptr].state = YY_CURRENT_BUFFER; 02589 parser__switch_to_buffer(parser__create_buffer(f,YY_BUF_SIZE)); 02590 return 1; 02591 } 02592 02593 void abort_import(void) 02594 { 02595 int ptr; 02596 02597 for (ptr=0; ptr<import_stack_ptr; ptr++) 02598 unlink(import_stack[ptr].temp_name); 02599 } 02600 Generated on Sun May 27 2012 04:37:50 for ReactOS by
1.7.6.1
|