00001 00002 #line 3 "<stdout>" 00003 00004 #define YY_INT_ALIGNED short int 00005 00006 /* A lexical scanner generated by flex */ 00007 00008 #define FLEX_SCANNER 00009 #define YY_FLEX_MAJOR_VERSION 2 00010 #define YY_FLEX_MINOR_VERSION 5 00011 #define YY_FLEX_SUBMINOR_VERSION 33 00012 #if YY_FLEX_SUBMINOR_VERSION > 0 00013 #define FLEX_BETA 00014 #endif 00015 00016 /* First, we deal with platform-specific or compiler-specific issues. */ 00017 00018 /* begin standard C headers. */ 00019 #include <stdio.h> 00020 #include <string.h> 00021 #include <errno.h> 00022 #include <stdlib.h> 00023 00024 /* end standard C headers. */ 00025 00026 /* flex integer type definitions */ 00027 00028 #ifndef FLEXINT_H 00029 #define FLEXINT_H 00030 00031 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 00032 00033 #if __STDC_VERSION__ >= 199901L 00034 00035 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 00036 * if you want the limit (max/min) macros for int types. 00037 */ 00038 #ifndef __STDC_LIMIT_MACROS 00039 #define __STDC_LIMIT_MACROS 1 00040 #endif 00041 00042 #include <inttypes.h> 00043 typedef int8_t flex_int8_t; 00044 typedef uint8_t flex_uint8_t; 00045 typedef int16_t flex_int16_t; 00046 typedef uint16_t flex_uint16_t; 00047 typedef int32_t flex_int32_t; 00048 typedef uint32_t flex_uint32_t; 00049 #else 00050 typedef signed char flex_int8_t; 00051 typedef short int flex_int16_t; 00052 typedef int flex_int32_t; 00053 typedef unsigned char flex_uint8_t; 00054 typedef unsigned short int flex_uint16_t; 00055 typedef unsigned int flex_uint32_t; 00056 #endif /* ! C99 */ 00057 00058 /* Limits of integral types. */ 00059 #ifndef INT8_MIN 00060 #define INT8_MIN (-128) 00061 #endif 00062 #ifndef INT16_MIN 00063 #define INT16_MIN (-32767-1) 00064 #endif 00065 #ifndef INT32_MIN 00066 #define INT32_MIN (-2147483647-1) 00067 #endif 00068 #ifndef INT8_MAX 00069 #define INT8_MAX (127) 00070 #endif 00071 #ifndef INT16_MAX 00072 #define INT16_MAX (32767) 00073 #endif 00074 #ifndef INT32_MAX 00075 #define INT32_MAX (2147483647) 00076 #endif 00077 #ifndef UINT8_MAX 00078 #define UINT8_MAX (255U) 00079 #endif 00080 #ifndef UINT16_MAX 00081 #define UINT16_MAX (65535U) 00082 #endif 00083 #ifndef UINT32_MAX 00084 #define UINT32_MAX (4294967295U) 00085 #endif 00086 00087 #endif /* ! FLEXINT_H */ 00088 00089 #ifdef __cplusplus 00090 00091 /* The "const" storage-class-modifier is valid. */ 00092 #define YY_USE_CONST 00093 00094 #else /* ! __cplusplus */ 00095 00096 #if __STDC__ 00097 00098 #define YY_USE_CONST 00099 00100 #endif /* __STDC__ */ 00101 #endif /* ! __cplusplus */ 00102 00103 #ifdef YY_USE_CONST 00104 #define yyconst const 00105 #else 00106 #define yyconst 00107 #endif 00108 00109 /* Returned upon end-of-file. */ 00110 #define YY_NULL 0 00111 00112 /* Promotes a possibly negative, possibly signed char to an unsigned 00113 * integer for use as an array index. If the signed char is negative, 00114 * we want to instead treat it as an 8-bit unsigned char, hence the 00115 * double cast. 00116 */ 00117 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 00118 00119 /* Enter a start condition. This macro really ought to take a parameter, 00120 * but we do it the disgusting crufty way forced on us by the ()-less 00121 * definition of BEGIN. 00122 */ 00123 #define BEGIN (yy_start) = 1 + 2 * 00124 00125 /* Translate the current start state into a value that can be later handed 00126 * to BEGIN to return to the state. The YYSTATE alias is for lex 00127 * compatibility. 00128 */ 00129 #define YY_START (((yy_start) - 1) / 2) 00130 #define YYSTATE YY_START 00131 00132 /* Action number for EOF rule of a given start state. */ 00133 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 00134 00135 /* Special action meaning "start processing a new file". */ 00136 #define YY_NEW_FILE cppExpYYrestart(cppExpYYin ) 00137 00138 #define YY_END_OF_BUFFER_CHAR 0 00139 00140 /* Size of default input buffer. */ 00141 #ifndef YY_BUF_SIZE 00142 #define YY_BUF_SIZE 16384 00143 #endif 00144 00145 /* The state buf must be large enough to hold one state per character in the main buffer. 00146 */ 00147 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 00148 00149 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 00150 #define YY_TYPEDEF_YY_BUFFER_STATE 00151 typedef struct yy_buffer_state *YY_BUFFER_STATE; 00152 #endif 00153 00154 extern int cppExpYYleng; 00155 00156 extern FILE *cppExpYYin, *cppExpYYout; 00157 00158 #define EOB_ACT_CONTINUE_SCAN 0 00159 #define EOB_ACT_END_OF_FILE 1 00160 #define EOB_ACT_LAST_MATCH 2 00161 00162 #define YY_LESS_LINENO(n) 00163 00164 /* Return all but the first "n" matched characters back to the input stream. */ 00165 #define yyless(n) \ 00166 do \ 00167 { \ 00168 /* Undo effects of setting up cppExpYYtext. */ \ 00169 int yyless_macro_arg = (n); \ 00170 YY_LESS_LINENO(yyless_macro_arg);\ 00171 *yy_cp = (yy_hold_char); \ 00172 YY_RESTORE_YY_MORE_OFFSET \ 00173 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 00174 YY_DO_BEFORE_ACTION; /* set up cppExpYYtext again */ \ 00175 } \ 00176 while ( 0 ) 00177 00178 #define unput(c) yyunput( c, (yytext_ptr) ) 00179 00180 /* The following is because we cannot portably get our hands on size_t 00181 * (without autoconf's help, which isn't available because we want 00182 * flex-generated scanners to compile on their own). 00183 */ 00184 00185 #ifndef YY_TYPEDEF_YY_SIZE_T 00186 #define YY_TYPEDEF_YY_SIZE_T 00187 typedef unsigned int yy_size_t; 00188 #endif 00189 00190 #ifndef YY_STRUCT_YY_BUFFER_STATE 00191 #define YY_STRUCT_YY_BUFFER_STATE 00192 struct yy_buffer_state 00193 { 00194 FILE *yy_input_file; 00195 00196 char *yy_ch_buf; /* input buffer */ 00197 char *yy_buf_pos; /* current position in input buffer */ 00198 00199 /* Size of input buffer in bytes, not including room for EOB 00200 * characters. 00201 */ 00202 yy_size_t yy_buf_size; 00203 00204 /* Number of characters read into yy_ch_buf, not including EOB 00205 * characters. 00206 */ 00207 int yy_n_chars; 00208 00209 /* Whether we "own" the buffer - i.e., we know we created it, 00210 * and can realloc() it to grow it, and should free() it to 00211 * delete it. 00212 */ 00213 int yy_is_our_buffer; 00214 00215 /* Whether this is an "interactive" input source; if so, and 00216 * if we're using stdio for input, then we want to use getc() 00217 * instead of fread(), to make sure we stop fetching input after 00218 * each newline. 00219 */ 00220 int yy_is_interactive; 00221 00222 /* Whether we're considered to be at the beginning of a line. 00223 * If so, '^' rules will be active on the next match, otherwise 00224 * not. 00225 */ 00226 int yy_at_bol; 00227 00228 int yy_bs_lineno; 00229 int yy_bs_column; 00231 /* Whether to try to fill the input buffer when we reach the 00232 * end of it. 00233 */ 00234 int yy_fill_buffer; 00235 00236 int yy_buffer_status; 00237 00238 #define YY_BUFFER_NEW 0 00239 #define YY_BUFFER_NORMAL 1 00240 /* When an EOF's been seen but there's still some text to process 00241 * then we mark the buffer as YY_EOF_PENDING, to indicate that we 00242 * shouldn't try reading from the input source any more. We might 00243 * still have a bunch of tokens to match, though, because of 00244 * possible backing-up. 00245 * 00246 * When we actually see the EOF, we change the status to "new" 00247 * (via cppExpYYrestart()), so that the user can continue scanning by 00248 * just pointing cppExpYYin at a new input file. 00249 */ 00250 #define YY_BUFFER_EOF_PENDING 2 00251 00252 }; 00253 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 00254 00255 /* Stack of input buffers. */ 00256 static size_t yy_buffer_stack_top = 0; 00257 static size_t yy_buffer_stack_max = 0; 00258 static YY_BUFFER_STATE * yy_buffer_stack = 0; 00260 /* We provide macros for accessing buffer states in case in the 00261 * future we want to put the buffer states in a more general 00262 * "scanner state". 00263 * 00264 * Returns the top of the stack, or NULL. 00265 */ 00266 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ 00267 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ 00268 : NULL) 00269 00270 /* Same as previous macro, but useful when we know that the buffer stack is not 00271 * NULL or when we need an lvalue. For internal use only. 00272 */ 00273 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] 00274 00275 /* yy_hold_char holds the character lost when cppExpYYtext is formed. */ 00276 static char yy_hold_char; 00277 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 00278 int cppExpYYleng; 00279 00280 /* Points to current character in buffer. */ 00281 static char *yy_c_buf_p = (char *) 0; 00282 static int yy_init = 0; /* whether we need to initialize */ 00283 static int yy_start = 0; /* start state number */ 00284 00285 /* Flag which is used to allow cppExpYYwrap()'s to do buffer switches 00286 * instead of setting up a fresh cppExpYYin. A bit of a hack ... 00287 */ 00288 static int yy_did_buffer_switch_on_eof; 00289 00290 void cppExpYYrestart (FILE *input_file ); 00291 void cppExpYY_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 00292 YY_BUFFER_STATE cppExpYY_create_buffer (FILE *file,int size ); 00293 void cppExpYY_delete_buffer (YY_BUFFER_STATE b ); 00294 void cppExpYY_flush_buffer (YY_BUFFER_STATE b ); 00295 void cppExpYYpush_buffer_state (YY_BUFFER_STATE new_buffer ); 00296 void cppExpYYpop_buffer_state (void ); 00297 00298 static void cppExpYYensure_buffer_stack (void ); 00299 static void cppExpYY_load_buffer_state (void ); 00300 static void cppExpYY_init_buffer (YY_BUFFER_STATE b,FILE *file ); 00301 00302 #define YY_FLUSH_BUFFER cppExpYY_flush_buffer(YY_CURRENT_BUFFER ) 00303 00304 YY_BUFFER_STATE cppExpYY_scan_buffer (char *base,yy_size_t size ); 00305 YY_BUFFER_STATE cppExpYY_scan_string (yyconst char *yy_str ); 00306 YY_BUFFER_STATE cppExpYY_scan_bytes (yyconst char *bytes,int len ); 00307 00308 void *cppExpYYalloc (yy_size_t ); 00309 void *cppExpYYrealloc (void *,yy_size_t ); 00310 void cppExpYYfree (void * ); 00311 00312 #define yy_new_buffer cppExpYY_create_buffer 00313 00314 #define yy_set_interactive(is_interactive) \ 00315 { \ 00316 if ( ! YY_CURRENT_BUFFER ){ \ 00317 cppExpYYensure_buffer_stack (); \ 00318 YY_CURRENT_BUFFER_LVALUE = \ 00319 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE ); \ 00320 } \ 00321 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 00322 } 00323 00324 #define yy_set_bol(at_bol) \ 00325 { \ 00326 if ( ! YY_CURRENT_BUFFER ){\ 00327 cppExpYYensure_buffer_stack (); \ 00328 YY_CURRENT_BUFFER_LVALUE = \ 00329 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE ); \ 00330 } \ 00331 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 00332 } 00333 00334 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 00335 00336 /* Begin user sect3 */ 00337 00338 typedef unsigned char YY_CHAR; 00339 00340 FILE *cppExpYYin = (FILE *) 0, *cppExpYYout = (FILE *) 0; 00341 00342 typedef int yy_state_type; 00343 00344 extern int cppExpYYlineno; 00345 00346 int cppExpYYlineno = 1; 00347 00348 extern char *cppExpYYtext; 00349 #define yytext_ptr cppExpYYtext 00350 00351 static yy_state_type yy_get_previous_state (void ); 00352 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); 00353 static int yy_get_next_buffer (void ); 00354 static void yy_fatal_error (yyconst char msg[] ); 00355 00356 /* Done after the current pattern has been matched and before the 00357 * corresponding action - sets up cppExpYYtext. 00358 */ 00359 #define YY_DO_BEFORE_ACTION \ 00360 (yytext_ptr) = yy_bp; \ 00361 cppExpYYleng = (size_t) (yy_cp - yy_bp); \ 00362 (yy_hold_char) = *yy_cp; \ 00363 *yy_cp = '\0'; \ 00364 (yy_c_buf_p) = yy_cp; 00365 00366 #define YY_NUM_RULES 33 00367 #define YY_END_OF_BUFFER 34 00368 /* This struct is not used in this scanner, 00369 but its presence is necessary. */ 00370 struct yy_trans_info 00371 { 00372 flex_int32_t yy_verify; 00373 flex_int32_t yy_nxt; 00374 }; 00375 static yyconst flex_int16_t yy_accept[77] = 00376 { 0, 00377 0, 0, 34, 31, 32, 22, 20, 7, 31, 23, 00378 24, 18, 16, 17, 31, 19, 26, 27, 2, 10, 00379 31, 11, 1, 6, 5, 21, 8, 4, 0, 0, 00380 29, 29, 26, 0, 0, 26, 26, 0, 27, 27, 00381 27, 14, 12, 9, 13, 15, 3, 25, 0, 0, 00382 0, 0, 29, 29, 0, 30, 26, 26, 26, 28, 00383 27, 27, 27, 0, 0, 29, 30, 26, 28, 28, 00384 27, 28, 28, 28, 28, 0 00385 } ; 00386 00387 static yyconst flex_int32_t yy_ec[256] = 00388 { 0, 00389 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 00390 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 00391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00392 1, 1, 4, 5, 1, 1, 6, 7, 8, 9, 00393 10, 11, 12, 1, 13, 14, 15, 16, 17, 17, 00394 17, 17, 17, 17, 17, 18, 18, 19, 1, 20, 00395 21, 22, 23, 1, 24, 24, 24, 24, 25, 26, 00396 1, 1, 1, 1, 1, 27, 1, 1, 1, 1, 00397 1, 1, 1, 1, 28, 1, 1, 29, 1, 1, 00398 1, 30, 1, 31, 1, 1, 32, 32, 24, 24, 00399 00400 25, 33, 1, 1, 1, 1, 1, 27, 1, 5, 00401 1, 1, 1, 5, 1, 5, 28, 5, 1, 34, 00402 1, 1, 1, 35, 1, 36, 1, 1, 1, 1, 00403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00404 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00410 00411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00416 1, 1, 1, 1, 1 00417 } ; 00418 00419 static yyconst flex_int32_t yy_meta[37] = 00420 { 0, 00421 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 00422 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, 00423 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 00424 1, 3, 3, 1, 1, 1 00425 } ; 00426 00427 static yyconst flex_int16_t yy_base[80] = 00428 { 0, 00429 0, 0, 145, 163, 163, 119, 163, 132, 108, 163, 00430 163, 163, 163, 163, 21, 163, 26, 47, 163, 25, 00431 116, 26, 163, 163, 101, 163, 163, 163, 41, 71, 00432 90, 40, 33, 52, 68, 55, 106, 0, 0, 63, 00433 105, 163, 163, 163, 163, 163, 163, 163, 123, 94, 00434 0, 80, 163, 0, 102, 108, 102, 163, 82, 86, 00435 71, 163, 68, 70, 111, 126, 163, 163, 94, 46, 00436 163, 31, 163, 25, 163, 163, 159, 47, 38 00437 } ; 00438 00439 static yyconst flex_int16_t yy_def[80] = 00440 { 0, 00441 76, 1, 76, 76, 76, 76, 76, 76, 77, 76, 00442 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 00443 76, 76, 76, 76, 76, 76, 76, 76, 77, 76, 00444 76, 31, 17, 76, 76, 76, 76, 78, 18, 76, 00445 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 00446 79, 76, 76, 32, 76, 76, 76, 76, 76, 78, 00447 76, 76, 76, 79, 76, 76, 76, 76, 76, 76, 00448 76, 76, 76, 76, 76, 0, 76, 76, 76 00449 } ; 00450 00451 static yyconst flex_int16_t yy_nxt[200] = 00452 { 0, 00453 4, 5, 4, 6, 4, 7, 8, 9, 10, 11, 00454 12, 13, 14, 15, 16, 17, 18, 18, 19, 20, 00455 21, 22, 23, 4, 4, 4, 4, 4, 4, 4, 00456 24, 4, 4, 4, 25, 26, 31, 31, 31, 32, 00457 64, 33, 33, 34, 42, 43, 45, 46, 48, 60, 00458 35, 75, 36, 37, 38, 54, 54, 54, 73, 38, 00459 32, 76, 39, 39, 39, 32, 76, 34, 34, 34, 00460 76, 35, 74, 40, 41, 49, 35, 48, 49, 55, 00461 55, 57, 58, 56, 56, 56, 50, 50, 50, 61, 00462 62, 65, 65, 49, 71, 66, 66, 66, 62, 51, 00463 00464 49, 48, 49, 49, 51, 31, 31, 31, 68, 50, 00465 50, 50, 69, 70, 52, 53, 53, 56, 56, 56, 00466 72, 73, 53, 56, 56, 56, 66, 66, 66, 58, 00467 48, 63, 59, 67, 67, 47, 44, 30, 28, 27, 00468 67, 66, 66, 66, 76, 76, 76, 76, 76, 76, 00469 76, 53, 53, 76, 76, 76, 76, 76, 53, 29, 00470 76, 29, 3, 76, 76, 76, 76, 76, 76, 76, 00471 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 00472 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 00473 76, 76, 76, 76, 76, 76, 76, 76, 76 00474 00475 } ; 00476 00477 static yyconst flex_int16_t yy_chk[200] = 00478 { 0, 00479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00480 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00481 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00482 1, 1, 1, 1, 1, 1, 15, 15, 15, 17, 00483 79, 17, 17, 17, 20, 20, 22, 22, 29, 78, 00484 17, 74, 17, 17, 17, 32, 32, 32, 72, 17, 00485 18, 33, 18, 18, 18, 34, 33, 34, 34, 34, 00486 29, 18, 70, 18, 18, 30, 34, 64, 30, 35, 00487 35, 36, 36, 35, 35, 35, 30, 30, 30, 40, 00488 40, 52, 52, 30, 63, 52, 52, 52, 61, 30, 00489 00490 30, 50, 30, 30, 30, 31, 31, 31, 59, 50, 00491 50, 50, 60, 60, 31, 31, 31, 55, 55, 55, 00492 69, 69, 31, 56, 56, 56, 65, 65, 65, 57, 00493 49, 41, 37, 56, 56, 25, 21, 9, 8, 6, 00494 56, 66, 66, 66, 3, 0, 0, 0, 0, 0, 00495 0, 66, 66, 0, 0, 0, 0, 0, 66, 77, 00496 0, 77, 76, 76, 76, 76, 76, 76, 76, 76, 00497 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 00498 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 00499 76, 76, 76, 76, 76, 76, 76, 76, 76 00500 00501 } ; 00502 00503 static yy_state_type yy_last_accepting_state; 00504 static char *yy_last_accepting_cpos; 00505 00506 extern int cppExpYY_flex_debug; 00507 int cppExpYY_flex_debug = 0; 00508 00509 /* The intent behind this definition is that it'll catch 00510 * any uses of REJECT which flex missed. 00511 */ 00512 #define REJECT reject_used_but_not_detected 00513 #define yymore() yymore_used_but_not_detected 00514 #define YY_MORE_ADJ 0 00515 #define YY_RESTORE_YY_MORE_OFFSET 00516 char *cppExpYYtext; 00517 #line 1 "constexp.l" 00518 /****************************************************************************** 00519 * 00520 * $Id: constexp.l,v 1.11 2001/03/19 19:27:40 root Exp $ 00521 * 00522 * 00523 * Copyright (C) 1997-2008 by Dimitri van Heesch. 00524 * 00525 * Permission to use, copy, modify, and distribute this software and its 00526 * documentation under the terms of the GNU General Public License is hereby 00527 * granted. No representations are made about the suitability of this software 00528 * for any purpose. It is provided "as is" without express or implied warranty. 00529 * See the GNU General Public License for more details. 00530 * 00531 * Documents produced by Doxygen are derivative works derived from the 00532 * input used in their production; they are not affected by this license. 00533 * 00534 */ 00535 #line 20 "constexp.l" 00536 00537 #include "constexp.h" 00538 #include "cppvalue.h" 00539 #include "ce_parse.h" // generated header file 00540 00541 #define YY_NEVER_INTERACTIVE 1 00542 00543 QCString g_strToken; 00544 CPPValue g_resultValue; 00545 int g_constExpLineNr; 00546 QCString g_constExpFileName; 00547 00548 static const char *g_inputString; 00549 static int g_inputPosition; 00550 00551 #undef YY_INPUT 00552 #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); 00553 00554 static int yyread(char *buf,int max_size) 00555 { 00556 int c=0; 00557 while( c < max_size && g_inputString[g_inputPosition] ) 00558 { 00559 *buf = g_inputString[g_inputPosition++] ; 00560 c++; buf++; 00561 } 00562 return c; 00563 } 00564 00565 #line 566 "<stdout>" 00566 00567 #define INITIAL 0 00568 00569 #ifndef YY_NO_UNISTD_H 00570 /* Special case for "unistd.h", since it is non-ANSI. We include it way 00571 * down here because we want the user's section 1 to have been scanned first. 00572 * The user has a chance to override it with an option. 00573 */ 00574 #include <unistd.h> 00575 #endif 00576 00577 #ifndef YY_EXTRA_TYPE 00578 #define YY_EXTRA_TYPE void * 00579 #endif 00580 00581 static int yy_init_globals (void ); 00582 00583 /* Macros after this point can all be overridden by user definitions in 00584 * section 1. 00585 */ 00586 00587 #ifndef YY_SKIP_YYWRAP 00588 #ifdef __cplusplus 00589 extern "C" int cppExpYYwrap (void ); 00590 #else 00591 extern int cppExpYYwrap (void ); 00592 #endif 00593 #endif 00594 00595 #ifndef yytext_ptr 00596 static void yy_flex_strncpy (char *,yyconst char *,int ); 00597 #endif 00598 00599 #ifdef YY_NEED_STRLEN 00600 static int yy_flex_strlen (yyconst char * ); 00601 #endif 00602 00603 #ifndef YY_NO_INPUT 00604 00605 #ifdef __cplusplus 00606 static int yyinput (void ); 00607 #else 00608 static int input (void ); 00609 #endif 00610 00611 #endif 00612 00613 /* Amount of stuff to slurp up with each read. */ 00614 #ifndef YY_READ_BUF_SIZE 00615 #define YY_READ_BUF_SIZE 8192 00616 #endif 00617 00618 /* Copy whatever the last rule matched to the standard output. */ 00619 #ifndef ECHO 00620 /* This used to be an fputs(), but since the string might contain NUL's, 00621 * we now use fwrite(). 00622 */ 00623 #define ECHO (void) fwrite( cppExpYYtext, cppExpYYleng, 1, cppExpYYout ) 00624 #endif 00625 00626 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 00627 * is returned in "result". 00628 */ 00629 #ifndef YY_INPUT 00630 #define YY_INPUT(buf,result,max_size) \ 00631 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 00632 { \ 00633 int c = '*'; \ 00634 size_t n; \ 00635 for ( n = 0; n < max_size && \ 00636 (c = getc( cppExpYYin )) != EOF && c != '\n'; ++n ) \ 00637 buf[n] = (char) c; \ 00638 if ( c == '\n' ) \ 00639 buf[n++] = (char) c; \ 00640 if ( c == EOF && ferror( cppExpYYin ) ) \ 00641 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00642 result = n; \ 00643 } \ 00644 else \ 00645 { \ 00646 errno=0; \ 00647 while ( (result = fread(buf, 1, max_size, cppExpYYin))==0 && ferror(cppExpYYin)) \ 00648 { \ 00649 if( errno != EINTR) \ 00650 { \ 00651 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00652 break; \ 00653 } \ 00654 errno=0; \ 00655 clearerr(cppExpYYin); \ 00656 } \ 00657 }\ 00658 \ 00659 00660 #endif 00661 00662 /* No semi-colon after return; correct usage is to write "yyterminate();" - 00663 * we don't want an extra ';' after the "return" because that will cause 00664 * some compilers to complain about unreachable statements. 00665 */ 00666 #ifndef yyterminate 00667 #define yyterminate() return YY_NULL 00668 #endif 00669 00670 /* Number of entries by which start-condition stack grows. */ 00671 #ifndef YY_START_STACK_INCR 00672 #define YY_START_STACK_INCR 25 00673 #endif 00674 00675 /* Report a fatal error. */ 00676 #ifndef YY_FATAL_ERROR 00677 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 00678 #endif 00679 00680 /* end tables serialization structures and prototypes */ 00681 00682 /* Default declaration of generated scanner - a define so the user can 00683 * easily add parameters. 00684 */ 00685 #ifndef YY_DECL 00686 #define YY_DECL_IS_OURS 1 00687 00688 extern int cppExpYYlex (void); 00689 00690 #define YY_DECL int cppExpYYlex (void) 00691 #endif /* !YY_DECL */ 00692 00693 /* Code executed at the beginning of each rule, after cppExpYYtext and cppExpYYleng 00694 * have been set up. 00695 */ 00696 #ifndef YY_USER_ACTION 00697 #define YY_USER_ACTION 00698 #endif 00699 00700 /* Code executed at the end of each rule. */ 00701 #ifndef YY_BREAK 00702 #define YY_BREAK break; 00703 #endif 00704 00705 #define YY_RULE_SETUP \ 00706 YY_USER_ACTION 00707 00710 YY_DECL 00711 { 00712 register yy_state_type yy_current_state; 00713 register char *yy_cp, *yy_bp; 00714 register int yy_act; 00715 00716 #line 55 "constexp.l" 00717 00718 00719 #line 720 "<stdout>" 00720 00721 if ( !(yy_init) ) 00722 { 00723 (yy_init) = 1; 00724 00725 #ifdef YY_USER_INIT 00726 YY_USER_INIT; 00727 #endif 00728 00729 if ( ! (yy_start) ) 00730 (yy_start) = 1; /* first start state */ 00731 00732 if ( ! cppExpYYin ) 00733 cppExpYYin = stdin; 00734 00735 if ( ! cppExpYYout ) 00736 cppExpYYout = stdout; 00737 00738 if ( ! YY_CURRENT_BUFFER ) { 00739 cppExpYYensure_buffer_stack (); 00740 YY_CURRENT_BUFFER_LVALUE = 00741 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE ); 00742 } 00743 00744 cppExpYY_load_buffer_state( ); 00745 } 00746 00747 while ( 1 ) /* loops until end-of-file is reached */ 00748 { 00749 yy_cp = (yy_c_buf_p); 00750 00751 /* Support of cppExpYYtext. */ 00752 *yy_cp = (yy_hold_char); 00753 00754 /* yy_bp points to the position in yy_ch_buf of the start of 00755 * the current run. 00756 */ 00757 yy_bp = yy_cp; 00758 00759 yy_current_state = (yy_start); 00760 yy_match: 00761 do 00762 { 00763 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 00764 if ( yy_accept[yy_current_state] ) 00765 { 00766 (yy_last_accepting_state) = yy_current_state; 00767 (yy_last_accepting_cpos) = yy_cp; 00768 } 00769 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 00770 { 00771 yy_current_state = (int) yy_def[yy_current_state]; 00772 if ( yy_current_state >= 77 ) 00773 yy_c = yy_meta[(unsigned int) yy_c]; 00774 } 00775 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 00776 ++yy_cp; 00777 } 00778 while ( yy_base[yy_current_state] != 163 ); 00779 00780 yy_find_action: 00781 yy_act = yy_accept[yy_current_state]; 00782 if ( yy_act == 0 ) 00783 { /* have to back up */ 00784 yy_cp = (yy_last_accepting_cpos); 00785 yy_current_state = (yy_last_accepting_state); 00786 yy_act = yy_accept[yy_current_state]; 00787 } 00788 00789 YY_DO_BEFORE_ACTION; 00790 00791 do_action: /* This label is used only to access EOF actions. */ 00792 00793 switch ( yy_act ) 00794 { /* beginning of action switch */ 00795 case 0: /* must back up */ 00796 /* undo the effects of YY_DO_BEFORE_ACTION */ 00797 *yy_cp = (yy_hold_char); 00798 yy_cp = (yy_last_accepting_cpos); 00799 yy_current_state = (yy_last_accepting_state); 00800 goto yy_find_action; 00801 00802 case 1: 00803 YY_RULE_SETUP 00804 #line 57 "constexp.l" 00805 { return TOK_QUESTIONMARK; } 00806 YY_BREAK 00807 case 2: 00808 YY_RULE_SETUP 00809 #line 58 "constexp.l" 00810 { return TOK_COLON; } 00811 YY_BREAK 00812 case 3: 00813 YY_RULE_SETUP 00814 #line 59 "constexp.l" 00815 { return TOK_OR; } 00816 YY_BREAK 00817 case 4: 00818 YY_RULE_SETUP 00819 #line 60 "constexp.l" 00820 { return TOK_AND; } 00821 YY_BREAK 00822 case 5: 00823 YY_RULE_SETUP 00824 #line 61 "constexp.l" 00825 { return TOK_BITWISEOR; } 00826 YY_BREAK 00827 case 6: 00828 YY_RULE_SETUP 00829 #line 62 "constexp.l" 00830 { return TOK_BITWISEXOR; } 00831 YY_BREAK 00832 case 7: 00833 YY_RULE_SETUP 00834 #line 63 "constexp.l" 00835 { return TOK_AMPERSAND; } 00836 YY_BREAK 00837 case 8: 00838 YY_RULE_SETUP 00839 #line 64 "constexp.l" 00840 { return TOK_NOTEQUAL; } 00841 YY_BREAK 00842 case 9: 00843 YY_RULE_SETUP 00844 #line 65 "constexp.l" 00845 { return TOK_EQUAL; } 00846 YY_BREAK 00847 case 10: 00848 YY_RULE_SETUP 00849 #line 66 "constexp.l" 00850 { return TOK_LESSTHAN; } 00851 YY_BREAK 00852 case 11: 00853 YY_RULE_SETUP 00854 #line 67 "constexp.l" 00855 { return TOK_GREATERTHAN; } 00856 YY_BREAK 00857 case 12: 00858 YY_RULE_SETUP 00859 #line 68 "constexp.l" 00860 { return TOK_LESSTHANOREQUALTO; } 00861 YY_BREAK 00862 case 13: 00863 YY_RULE_SETUP 00864 #line 69 "constexp.l" 00865 { return TOK_GREATERTHANOREQUALTO; } 00866 YY_BREAK 00867 case 14: 00868 YY_RULE_SETUP 00869 #line 70 "constexp.l" 00870 { return TOK_SHIFTLEFT; } 00871 YY_BREAK 00872 case 15: 00873 YY_RULE_SETUP 00874 #line 71 "constexp.l" 00875 { return TOK_SHIFTRIGHT; } 00876 YY_BREAK 00877 case 16: 00878 YY_RULE_SETUP 00879 #line 72 "constexp.l" 00880 { return TOK_PLUS; } 00881 YY_BREAK 00882 case 17: 00883 YY_RULE_SETUP 00884 #line 73 "constexp.l" 00885 { return TOK_MINUS; } 00886 YY_BREAK 00887 case 18: 00888 YY_RULE_SETUP 00889 #line 74 "constexp.l" 00890 { return TOK_STAR; } 00891 YY_BREAK 00892 case 19: 00893 YY_RULE_SETUP 00894 #line 75 "constexp.l" 00895 { return TOK_DIVIDE; } 00896 YY_BREAK 00897 case 20: 00898 YY_RULE_SETUP 00899 #line 76 "constexp.l" 00900 { return TOK_MOD; } 00901 YY_BREAK 00902 case 21: 00903 YY_RULE_SETUP 00904 #line 77 "constexp.l" 00905 { return TOK_TILDE; } 00906 YY_BREAK 00907 case 22: 00908 YY_RULE_SETUP 00909 #line 78 "constexp.l" 00910 { return TOK_NOT; } 00911 YY_BREAK 00912 case 23: 00913 YY_RULE_SETUP 00914 #line 79 "constexp.l" 00915 { return TOK_LPAREN; } 00916 YY_BREAK 00917 case 24: 00918 YY_RULE_SETUP 00919 #line 80 "constexp.l" 00920 { return TOK_RPAREN; } 00921 YY_BREAK 00922 case 25: 00923 YY_RULE_SETUP 00924 #line 81 "constexp.l" 00925 { 00926 g_strToken=cppExpYYtext; 00927 return TOK_CHARACTER; 00928 } 00929 YY_BREAK 00930 case 26: 00931 YY_RULE_SETUP 00932 #line 85 "constexp.l" 00933 { g_strToken=cppExpYYtext; 00934 return TOK_OCTALINT; 00935 } 00936 YY_BREAK 00937 case 27: 00938 YY_RULE_SETUP 00939 #line 88 "constexp.l" 00940 { g_strToken=cppExpYYtext; 00941 return TOK_DECIMALINT; 00942 } 00943 YY_BREAK 00944 case 28: 00945 YY_RULE_SETUP 00946 #line 91 "constexp.l" 00947 { g_strToken=cppExpYYtext+2; 00948 return TOK_HEXADECIMALINT; 00949 } 00950 YY_BREAK 00951 case 29: 00952 YY_RULE_SETUP 00953 #line 94 "constexp.l" 00954 { 00955 g_strToken=cppExpYYtext; return TOK_FLOAT; 00956 } 00957 YY_BREAK 00958 case 30: 00959 YY_RULE_SETUP 00960 #line 97 "constexp.l" 00961 { 00962 g_strToken=cppExpYYtext; return TOK_FLOAT; 00963 } 00964 YY_BREAK 00965 case 31: 00966 YY_RULE_SETUP 00967 #line 100 "constexp.l" 00968 00969 YY_BREAK 00970 case 32: 00971 /* rule 32 can match eol */ 00972 YY_RULE_SETUP 00973 #line 101 "constexp.l" 00974 00975 YY_BREAK 00976 case 33: 00977 YY_RULE_SETUP 00978 #line 103 "constexp.l" 00979 ECHO; 00980 YY_BREAK 00981 #line 982 "<stdout>" 00982 case YY_STATE_EOF(INITIAL): 00983 yyterminate(); 00984 00985 case YY_END_OF_BUFFER: 00986 { 00987 /* Amount of text matched not including the EOB char. */ 00988 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; 00989 00990 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 00991 *yy_cp = (yy_hold_char); 00992 YY_RESTORE_YY_MORE_OFFSET 00993 00994 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 00995 { 00996 /* We're scanning a new file or input source. It's 00997 * possible that this happened because the user 00998 * just pointed cppExpYYin at a new source and called 00999 * cppExpYYlex(). If so, then we have to assure 01000 * consistency between YY_CURRENT_BUFFER and our 01001 * globals. Here is the right place to do so, because 01002 * this is the first action (other than possibly a 01003 * back-up) that will match for the new input source. 01004 */ 01005 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01006 YY_CURRENT_BUFFER_LVALUE->yy_input_file = cppExpYYin; 01007 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 01008 } 01009 01010 /* Note that here we test for yy_c_buf_p "<=" to the position 01011 * of the first EOB in the buffer, since yy_c_buf_p will 01012 * already have been incremented past the NUL character 01013 * (since all states make transitions on EOB to the 01014 * end-of-buffer state). Contrast this with the test 01015 * in input(). 01016 */ 01017 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 01018 { /* This was really a NUL. */ 01019 yy_state_type yy_next_state; 01020 01021 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; 01022 01023 yy_current_state = yy_get_previous_state( ); 01024 01025 /* Okay, we're now positioned to make the NUL 01026 * transition. We couldn't have 01027 * yy_get_previous_state() go ahead and do it 01028 * for us because it doesn't know how to deal 01029 * with the possibility of jamming (and we don't 01030 * want to build jamming into it because then it 01031 * will run more slowly). 01032 */ 01033 01034 yy_next_state = yy_try_NUL_trans( yy_current_state ); 01035 01036 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01037 01038 if ( yy_next_state ) 01039 { 01040 /* Consume the NUL. */ 01041 yy_cp = ++(yy_c_buf_p); 01042 yy_current_state = yy_next_state; 01043 goto yy_match; 01044 } 01045 01046 else 01047 { 01048 yy_cp = (yy_c_buf_p); 01049 goto yy_find_action; 01050 } 01051 } 01052 01053 else switch ( yy_get_next_buffer( ) ) 01054 { 01055 case EOB_ACT_END_OF_FILE: 01056 { 01057 (yy_did_buffer_switch_on_eof) = 0; 01058 01059 if ( cppExpYYwrap( ) ) 01060 { 01061 /* Note: because we've taken care in 01062 * yy_get_next_buffer() to have set up 01063 * cppExpYYtext, we can now set up 01064 * yy_c_buf_p so that if some total 01065 * hoser (like flex itself) wants to 01066 * call the scanner after we return the 01067 * YY_NULL, it'll still work - another 01068 * YY_NULL will get returned. 01069 */ 01070 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; 01071 01072 yy_act = YY_STATE_EOF(YY_START); 01073 goto do_action; 01074 } 01075 01076 else 01077 { 01078 if ( ! (yy_did_buffer_switch_on_eof) ) 01079 YY_NEW_FILE; 01080 } 01081 break; 01082 } 01083 01084 case EOB_ACT_CONTINUE_SCAN: 01085 (yy_c_buf_p) = 01086 (yytext_ptr) + yy_amount_of_matched_text; 01087 01088 yy_current_state = yy_get_previous_state( ); 01089 01090 yy_cp = (yy_c_buf_p); 01091 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01092 goto yy_match; 01093 01094 case EOB_ACT_LAST_MATCH: 01095 (yy_c_buf_p) = 01096 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; 01097 01098 yy_current_state = yy_get_previous_state( ); 01099 01100 yy_cp = (yy_c_buf_p); 01101 yy_bp = (yytext_ptr) + YY_MORE_ADJ; 01102 goto yy_find_action; 01103 } 01104 break; 01105 } 01106 01107 default: 01108 YY_FATAL_ERROR( 01109 "fatal flex scanner internal error--no action found" ); 01110 } /* end of action switch */ 01111 } /* end of scanning one token */ 01112 } /* end of cppExpYYlex */ 01113 01114 /* yy_get_next_buffer - try to read in a new buffer 01115 * 01116 * Returns a code representing an action: 01117 * EOB_ACT_LAST_MATCH - 01118 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 01119 * EOB_ACT_END_OF_FILE - end of file 01120 */ 01121 static int yy_get_next_buffer (void) 01122 { 01123 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 01124 register char *source = (yytext_ptr); 01125 register int number_to_move, i; 01126 int ret_val; 01127 01128 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) 01129 YY_FATAL_ERROR( 01130 "fatal flex scanner internal error--end of buffer missed" ); 01131 01132 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 01133 { /* Don't try to fill the buffer, so this is an EOF. */ 01134 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) 01135 { 01136 /* We matched a single character, the EOB, so 01137 * treat this as a final EOF. 01138 */ 01139 return EOB_ACT_END_OF_FILE; 01140 } 01141 01142 else 01143 { 01144 /* We matched some text prior to the EOB, first 01145 * process it. 01146 */ 01147 return EOB_ACT_LAST_MATCH; 01148 } 01149 } 01150 01151 /* Try to read more data. */ 01152 01153 /* First move last chars to start of buffer. */ 01154 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; 01155 01156 for ( i = 0; i < number_to_move; ++i ) 01157 *(dest++) = *(source++); 01158 01159 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 01160 /* don't do the read, it's not guaranteed to return an EOF, 01161 * just force an EOF 01162 */ 01163 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; 01164 01165 else 01166 { 01167 int num_to_read = 01168 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 01169 01170 while ( num_to_read <= 0 ) 01171 { /* Not enough room in the buffer - grow it. */ 01172 01173 /* just a shorter name for the current buffer */ 01174 YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 01175 01176 int yy_c_buf_p_offset = 01177 (int) ((yy_c_buf_p) - b->yy_ch_buf); 01178 01179 if ( b->yy_is_our_buffer ) 01180 { 01181 int new_size = b->yy_buf_size * 2; 01182 01183 if ( new_size <= 0 ) 01184 b->yy_buf_size += b->yy_buf_size / 8; 01185 else 01186 b->yy_buf_size *= 2; 01187 01188 b->yy_ch_buf = (char *) 01189 /* Include room in for 2 EOB chars. */ 01190 cppExpYYrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); 01191 } 01192 else 01193 /* Can't grow it, we don't own it. */ 01194 b->yy_ch_buf = 0; 01195 01196 if ( ! b->yy_ch_buf ) 01197 YY_FATAL_ERROR( 01198 "fatal error - scanner input buffer overflow" ); 01199 01200 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; 01201 01202 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 01203 number_to_move - 1; 01204 01205 } 01206 01207 if ( num_to_read > YY_READ_BUF_SIZE ) 01208 num_to_read = YY_READ_BUF_SIZE; 01209 01210 /* Read in more data. */ 01211 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 01212 (yy_n_chars), num_to_read ); 01213 01214 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 01215 } 01216 01217 if ( (yy_n_chars) == 0 ) 01218 { 01219 if ( number_to_move == YY_MORE_ADJ ) 01220 { 01221 ret_val = EOB_ACT_END_OF_FILE; 01222 cppExpYYrestart(cppExpYYin ); 01223 } 01224 01225 else 01226 { 01227 ret_val = EOB_ACT_LAST_MATCH; 01228 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 01229 YY_BUFFER_EOF_PENDING; 01230 } 01231 } 01232 01233 else 01234 ret_val = EOB_ACT_CONTINUE_SCAN; 01235 01236 (yy_n_chars) += number_to_move; 01237 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; 01238 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; 01239 01240 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 01241 01242 return ret_val; 01243 } 01244 01245 /* yy_get_previous_state - get the state just before the EOB char was reached */ 01246 01247 static yy_state_type yy_get_previous_state (void) 01248 { 01249 register yy_state_type yy_current_state; 01250 register char *yy_cp; 01251 01252 yy_current_state = (yy_start); 01253 01254 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 01255 { 01256 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 01257 if ( yy_accept[yy_current_state] ) 01258 { 01259 (yy_last_accepting_state) = yy_current_state; 01260 (yy_last_accepting_cpos) = yy_cp; 01261 } 01262 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01263 { 01264 yy_current_state = (int) yy_def[yy_current_state]; 01265 if ( yy_current_state >= 77 ) 01266 yy_c = yy_meta[(unsigned int) yy_c]; 01267 } 01268 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01269 } 01270 01271 return yy_current_state; 01272 } 01273 01274 /* yy_try_NUL_trans - try to make a transition on the NUL character 01275 * 01276 * synopsis 01277 * next_state = yy_try_NUL_trans( current_state ); 01278 */ 01279 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 01280 { 01281 register int yy_is_jam; 01282 register char *yy_cp = (yy_c_buf_p); 01283 01284 register YY_CHAR yy_c = 1; 01285 if ( yy_accept[yy_current_state] ) 01286 { 01287 (yy_last_accepting_state) = yy_current_state; 01288 (yy_last_accepting_cpos) = yy_cp; 01289 } 01290 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01291 { 01292 yy_current_state = (int) yy_def[yy_current_state]; 01293 if ( yy_current_state >= 77 ) 01294 yy_c = yy_meta[(unsigned int) yy_c]; 01295 } 01296 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01297 yy_is_jam = (yy_current_state == 76); 01298 01299 return yy_is_jam ? 0 : yy_current_state; 01300 } 01301 01302 #ifndef YY_NO_INPUT 01303 #ifdef __cplusplus 01304 static int yyinput (void) 01305 #else 01306 static int input (void) 01307 #endif 01308 01309 { 01310 int c; 01311 01312 *(yy_c_buf_p) = (yy_hold_char); 01313 01314 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 01315 { 01316 /* yy_c_buf_p now points to the character we want to return. 01317 * If this occurs *before* the EOB characters, then it's a 01318 * valid NUL; if not, then we've hit the end of the buffer. 01319 */ 01320 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) 01321 /* This was really a NUL. */ 01322 *(yy_c_buf_p) = '\0'; 01323 01324 else 01325 { /* need more input */ 01326 int offset = (yy_c_buf_p) - (yytext_ptr); 01327 ++(yy_c_buf_p); 01328 01329 switch ( yy_get_next_buffer( ) ) 01330 { 01331 case EOB_ACT_LAST_MATCH: 01332 /* This happens because yy_g_n_b() 01333 * sees that we've accumulated a 01334 * token and flags that we need to 01335 * try matching the token before 01336 * proceeding. But for input(), 01337 * there's no matching to consider. 01338 * So convert the EOB_ACT_LAST_MATCH 01339 * to EOB_ACT_END_OF_FILE. 01340 */ 01341 01342 /* Reset buffer status. */ 01343 cppExpYYrestart(cppExpYYin ); 01344 01345 /*FALLTHROUGH*/ 01346 01347 case EOB_ACT_END_OF_FILE: 01348 { 01349 if ( cppExpYYwrap( ) ) 01350 return 0; 01351 01352 if ( ! (yy_did_buffer_switch_on_eof) ) 01353 YY_NEW_FILE; 01354 #ifdef __cplusplus 01355 return yyinput(); 01356 #else 01357 return input(); 01358 #endif 01359 } 01360 01361 case EOB_ACT_CONTINUE_SCAN: 01362 (yy_c_buf_p) = (yytext_ptr) + offset; 01363 break; 01364 } 01365 } 01366 } 01367 01368 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ 01369 *(yy_c_buf_p) = '\0'; /* preserve cppExpYYtext */ 01370 (yy_hold_char) = *++(yy_c_buf_p); 01371 01372 return c; 01373 } 01374 #endif /* ifndef YY_NO_INPUT */ 01375 01381 void cppExpYYrestart (FILE * input_file ) 01382 { 01383 01384 if ( ! YY_CURRENT_BUFFER ){ 01385 cppExpYYensure_buffer_stack (); 01386 YY_CURRENT_BUFFER_LVALUE = 01387 cppExpYY_create_buffer(cppExpYYin,YY_BUF_SIZE ); 01388 } 01389 01390 cppExpYY_init_buffer(YY_CURRENT_BUFFER,input_file ); 01391 cppExpYY_load_buffer_state( ); 01392 } 01393 01398 void cppExpYY_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 01399 { 01400 01401 /* TODO. We should be able to replace this entire function body 01402 * with 01403 * cppExpYYpop_buffer_state(); 01404 * cppExpYYpush_buffer_state(new_buffer); 01405 */ 01406 cppExpYYensure_buffer_stack (); 01407 if ( YY_CURRENT_BUFFER == new_buffer ) 01408 return; 01409 01410 if ( YY_CURRENT_BUFFER ) 01411 { 01412 /* Flush out information for old buffer. */ 01413 *(yy_c_buf_p) = (yy_hold_char); 01414 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 01415 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 01416 } 01417 01418 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01419 cppExpYY_load_buffer_state( ); 01420 01421 /* We don't actually know whether we did this switch during 01422 * EOF (cppExpYYwrap()) processing, but the only time this flag 01423 * is looked at is after cppExpYYwrap() is called, so it's safe 01424 * to go ahead and always set it. 01425 */ 01426 (yy_did_buffer_switch_on_eof) = 1; 01427 } 01428 01429 static void cppExpYY_load_buffer_state (void) 01430 { 01431 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01432 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 01433 cppExpYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 01434 (yy_hold_char) = *(yy_c_buf_p); 01435 } 01436 01443 YY_BUFFER_STATE cppExpYY_create_buffer (FILE * file, int size ) 01444 { 01445 YY_BUFFER_STATE b; 01446 01447 b = (YY_BUFFER_STATE) cppExpYYalloc(sizeof( struct yy_buffer_state ) ); 01448 if ( ! b ) 01449 YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_create_buffer()" ); 01450 01451 b->yy_buf_size = size; 01452 01453 /* yy_ch_buf has to be 2 characters longer than the size given because 01454 * we need to put in 2 end-of-buffer characters. 01455 */ 01456 b->yy_ch_buf = (char *) cppExpYYalloc(b->yy_buf_size + 2 ); 01457 if ( ! b->yy_ch_buf ) 01458 YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_create_buffer()" ); 01459 01460 b->yy_is_our_buffer = 1; 01461 01462 cppExpYY_init_buffer(b,file ); 01463 01464 return b; 01465 } 01466 01471 void cppExpYY_delete_buffer (YY_BUFFER_STATE b ) 01472 { 01473 01474 if ( ! b ) 01475 return; 01476 01477 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 01478 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 01479 01480 if ( b->yy_is_our_buffer ) 01481 cppExpYYfree((void *) b->yy_ch_buf ); 01482 01483 cppExpYYfree((void *) b ); 01484 } 01485 01486 #ifndef __cplusplus 01487 extern int isatty (int ); 01488 #endif /* __cplusplus */ 01489 01490 /* Initializes or reinitializes a buffer. 01491 * This function is sometimes called more than once on the same buffer, 01492 * such as during a cppExpYYrestart() or at EOF. 01493 */ 01494 static void cppExpYY_init_buffer (YY_BUFFER_STATE b, FILE * file ) 01495 01496 { 01497 int oerrno = errno; 01498 01499 cppExpYY_flush_buffer(b ); 01500 01501 b->yy_input_file = file; 01502 b->yy_fill_buffer = 1; 01503 01504 /* If b is the current buffer, then cppExpYY_init_buffer was _probably_ 01505 * called from cppExpYYrestart() or through yy_get_next_buffer. 01506 * In that case, we don't want to reset the lineno or column. 01507 */ 01508 if (b != YY_CURRENT_BUFFER){ 01509 b->yy_bs_lineno = 1; 01510 b->yy_bs_column = 0; 01511 } 01512 01513 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 01514 01515 errno = oerrno; 01516 } 01517 01522 void cppExpYY_flush_buffer (YY_BUFFER_STATE b ) 01523 { 01524 if ( ! b ) 01525 return; 01526 01527 b->yy_n_chars = 0; 01528 01529 /* We always need two end-of-buffer characters. The first causes 01530 * a transition to the end-of-buffer state. The second causes 01531 * a jam in that state. 01532 */ 01533 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 01534 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 01535 01536 b->yy_buf_pos = &b->yy_ch_buf[0]; 01537 01538 b->yy_at_bol = 1; 01539 b->yy_buffer_status = YY_BUFFER_NEW; 01540 01541 if ( b == YY_CURRENT_BUFFER ) 01542 cppExpYY_load_buffer_state( ); 01543 } 01544 01551 void cppExpYYpush_buffer_state (YY_BUFFER_STATE new_buffer ) 01552 { 01553 if (new_buffer == NULL) 01554 return; 01555 01556 cppExpYYensure_buffer_stack(); 01557 01558 /* This block is copied from cppExpYY_switch_to_buffer. */ 01559 if ( YY_CURRENT_BUFFER ) 01560 { 01561 /* Flush out information for old buffer. */ 01562 *(yy_c_buf_p) = (yy_hold_char); 01563 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); 01564 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 01565 } 01566 01567 /* Only push if top exists. Otherwise, replace top. */ 01568 if (YY_CURRENT_BUFFER) 01569 (yy_buffer_stack_top)++; 01570 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01571 01572 /* copied from cppExpYY_switch_to_buffer. */ 01573 cppExpYY_load_buffer_state( ); 01574 (yy_did_buffer_switch_on_eof) = 1; 01575 } 01576 01581 void cppExpYYpop_buffer_state (void) 01582 { 01583 if (!YY_CURRENT_BUFFER) 01584 return; 01585 01586 cppExpYY_delete_buffer(YY_CURRENT_BUFFER ); 01587 YY_CURRENT_BUFFER_LVALUE = NULL; 01588 if ((yy_buffer_stack_top) > 0) 01589 --(yy_buffer_stack_top); 01590 01591 if (YY_CURRENT_BUFFER) { 01592 cppExpYY_load_buffer_state( ); 01593 (yy_did_buffer_switch_on_eof) = 1; 01594 } 01595 } 01596 01597 /* Allocates the stack if it does not exist. 01598 * Guarantees space for at least one push. 01599 */ 01600 static void cppExpYYensure_buffer_stack (void) 01601 { 01602 int num_to_alloc; 01603 01604 if (!(yy_buffer_stack)) { 01605 01606 /* First allocation is just for 2 elements, since we don't know if this 01607 * scanner will even need a stack. We use 2 instead of 1 to avoid an 01608 * immediate realloc on the next call. 01609 */ 01610 num_to_alloc = 1; 01611 (yy_buffer_stack) = (struct yy_buffer_state**)cppExpYYalloc 01612 (num_to_alloc * sizeof(struct yy_buffer_state*) 01613 ); 01614 01615 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 01616 01617 (yy_buffer_stack_max) = num_to_alloc; 01618 (yy_buffer_stack_top) = 0; 01619 return; 01620 } 01621 01622 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ 01623 01624 /* Increase the buffer to prepare for a possible push. */ 01625 int grow_size = 8 /* arbitrary grow size */; 01626 01627 num_to_alloc = (yy_buffer_stack_max) + grow_size; 01628 (yy_buffer_stack) = (struct yy_buffer_state**)cppExpYYrealloc 01629 ((yy_buffer_stack), 01630 num_to_alloc * sizeof(struct yy_buffer_state*) 01631 ); 01632 01633 /* zero only the new slots.*/ 01634 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); 01635 (yy_buffer_stack_max) = num_to_alloc; 01636 } 01637 } 01638 01645 YY_BUFFER_STATE cppExpYY_scan_buffer (char * base, yy_size_t size ) 01646 { 01647 YY_BUFFER_STATE b; 01648 01649 if ( size < 2 || 01650 base[size-2] != YY_END_OF_BUFFER_CHAR || 01651 base[size-1] != YY_END_OF_BUFFER_CHAR ) 01652 /* They forgot to leave room for the EOB's. */ 01653 return 0; 01654 01655 b = (YY_BUFFER_STATE) cppExpYYalloc(sizeof( struct yy_buffer_state ) ); 01656 if ( ! b ) 01657 YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_scan_buffer()" ); 01658 01659 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 01660 b->yy_buf_pos = b->yy_ch_buf = base; 01661 b->yy_is_our_buffer = 0; 01662 b->yy_input_file = 0; 01663 b->yy_n_chars = b->yy_buf_size; 01664 b->yy_is_interactive = 0; 01665 b->yy_at_bol = 1; 01666 b->yy_fill_buffer = 0; 01667 b->yy_buffer_status = YY_BUFFER_NEW; 01668 01669 cppExpYY_switch_to_buffer(b ); 01670 01671 return b; 01672 } 01673 01682 YY_BUFFER_STATE cppExpYY_scan_string (yyconst char * yystr ) 01683 { 01684 01685 return cppExpYY_scan_bytes(yystr,strlen(yystr) ); 01686 } 01687 01695 YY_BUFFER_STATE cppExpYY_scan_bytes (yyconst char * yybytes, int _yybytes_len ) 01696 { 01697 YY_BUFFER_STATE b; 01698 char *buf; 01699 yy_size_t n; 01700 int i; 01701 01702 /* Get memory for full buffer, including space for trailing EOB's. */ 01703 n = _yybytes_len + 2; 01704 buf = (char *) cppExpYYalloc(n ); 01705 if ( ! buf ) 01706 YY_FATAL_ERROR( "out of dynamic memory in cppExpYY_scan_bytes()" ); 01707 01708 for ( i = 0; i < _yybytes_len; ++i ) 01709 buf[i] = yybytes[i]; 01710 01711 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 01712 01713 b = cppExpYY_scan_buffer(buf,n ); 01714 if ( ! b ) 01715 YY_FATAL_ERROR( "bad buffer in cppExpYY_scan_bytes()" ); 01716 01717 /* It's okay to grow etc. this buffer, and we should throw it 01718 * away when we're done. 01719 */ 01720 b->yy_is_our_buffer = 1; 01721 01722 return b; 01723 } 01724 01725 #ifndef YY_EXIT_FAILURE 01726 #define YY_EXIT_FAILURE 2 01727 #endif 01728 01729 static void yy_fatal_error (yyconst char* msg ) 01730 { 01731 (void) fprintf( stderr, "%s\n", msg ); 01732 exit( YY_EXIT_FAILURE ); 01733 } 01734 01735 /* Redefine yyless() so it works in section 3 code. */ 01736 01737 #undef yyless 01738 #define yyless(n) \ 01739 do \ 01740 { \ 01741 /* Undo effects of setting up cppExpYYtext. */ \ 01742 int yyless_macro_arg = (n); \ 01743 YY_LESS_LINENO(yyless_macro_arg);\ 01744 cppExpYYtext[cppExpYYleng] = (yy_hold_char); \ 01745 (yy_c_buf_p) = cppExpYYtext + yyless_macro_arg; \ 01746 (yy_hold_char) = *(yy_c_buf_p); \ 01747 *(yy_c_buf_p) = '\0'; \ 01748 cppExpYYleng = yyless_macro_arg; \ 01749 } \ 01750 while ( 0 ) 01751 01752 /* Accessor methods (get/set functions) to struct members. */ 01753 01757 int cppExpYYget_lineno (void) 01758 { 01759 01760 return cppExpYYlineno; 01761 } 01762 01766 FILE *cppExpYYget_in (void) 01767 { 01768 return cppExpYYin; 01769 } 01770 01774 FILE *cppExpYYget_out (void) 01775 { 01776 return cppExpYYout; 01777 } 01778 01782 int cppExpYYget_leng (void) 01783 { 01784 return cppExpYYleng; 01785 } 01786 01791 char *cppExpYYget_text (void) 01792 { 01793 return cppExpYYtext; 01794 } 01795 01800 void cppExpYYset_lineno (int line_number ) 01801 { 01802 01803 cppExpYYlineno = line_number; 01804 } 01805 01812 void cppExpYYset_in (FILE * in_str ) 01813 { 01814 cppExpYYin = in_str ; 01815 } 01816 01817 void cppExpYYset_out (FILE * out_str ) 01818 { 01819 cppExpYYout = out_str ; 01820 } 01821 01822 int cppExpYYget_debug (void) 01823 { 01824 return cppExpYY_flex_debug; 01825 } 01826 01827 void cppExpYYset_debug (int bdebug ) 01828 { 01829 cppExpYY_flex_debug = bdebug ; 01830 } 01831 01832 static int yy_init_globals (void) 01833 { 01834 /* Initialization is the same as for the non-reentrant scanner. 01835 * This function is called from cppExpYYlex_destroy(), so don't allocate here. 01836 */ 01837 01838 (yy_buffer_stack) = 0; 01839 (yy_buffer_stack_top) = 0; 01840 (yy_buffer_stack_max) = 0; 01841 (yy_c_buf_p) = (char *) 0; 01842 (yy_init) = 0; 01843 (yy_start) = 0; 01844 01845 /* Defined in main.c */ 01846 #ifdef YY_STDINIT 01847 cppExpYYin = stdin; 01848 cppExpYYout = stdout; 01849 #else 01850 cppExpYYin = (FILE *) 0; 01851 cppExpYYout = (FILE *) 0; 01852 #endif 01853 01854 /* For future reference: Set errno on error, since we are called by 01855 * cppExpYYlex_init() 01856 */ 01857 return 0; 01858 } 01859 01860 /* cppExpYYlex_destroy is for both reentrant and non-reentrant scanners. */ 01861 int cppExpYYlex_destroy (void) 01862 { 01863 01864 /* Pop the buffer stack, destroying each element. */ 01865 while(YY_CURRENT_BUFFER){ 01866 cppExpYY_delete_buffer(YY_CURRENT_BUFFER ); 01867 YY_CURRENT_BUFFER_LVALUE = NULL; 01868 cppExpYYpop_buffer_state(); 01869 } 01870 01871 /* Destroy the stack itself. */ 01872 cppExpYYfree((yy_buffer_stack) ); 01873 (yy_buffer_stack) = NULL; 01874 01875 /* Reset the globals. This is important in a non-reentrant scanner so the next time 01876 * cppExpYYlex() is called, initialization will occur. */ 01877 yy_init_globals( ); 01878 01879 return 0; 01880 } 01881 01882 /* 01883 * Internal utility routines. 01884 */ 01885 01886 #ifndef yytext_ptr 01887 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) 01888 { 01889 register int i; 01890 for ( i = 0; i < n; ++i ) 01891 s1[i] = s2[i]; 01892 } 01893 #endif 01894 01895 #ifdef YY_NEED_STRLEN 01896 static int yy_flex_strlen (yyconst char * s ) 01897 { 01898 register int n; 01899 for ( n = 0; s[n]; ++n ) 01900 ; 01901 01902 return n; 01903 } 01904 #endif 01905 01906 void *cppExpYYalloc (yy_size_t size ) 01907 { 01908 return (void *) malloc( size ); 01909 } 01910 01911 void *cppExpYYrealloc (void * ptr, yy_size_t size ) 01912 { 01913 /* The cast to (char *) in the following accommodates both 01914 * implementations that use char* generic pointers, and those 01915 * that use void* generic pointers. It works with the latter 01916 * because both ANSI C and C++ allow castless assignment from 01917 * any pointer type to void*, and deal with argument conversions 01918 * as though doing an assignment. 01919 */ 01920 return (void *) realloc( (char *) ptr, size ); 01921 } 01922 01923 void cppExpYYfree (void * ptr ) 01924 { 01925 free( (char *) ptr ); /* see cppExpYYrealloc() for (char *) cast */ 01926 } 01927 01928 #define YYTABLES_NAME "yytables" 01929 01930 #line 103 "constexp.l" 01931 01932 01933 01934 bool parseCppExpression(const char *fileName,int lineNr,const QCString &s) 01935 { 01936 //printf("Expression: `%s'\n",s.data()); 01937 g_constExpFileName = fileName; 01938 g_constExpLineNr = lineNr; 01939 g_inputString = s; 01940 g_inputPosition = 0; 01941 cppExpYYrestart( cppExpYYin ); 01942 cppExpYYparse(); 01943 //printf("Result: %ld\n",(long)g_resultValue); 01944 return (long)g_resultValue!=0; 01945 } 01946 01947 extern "C" { 01948 int cppExpYYwrap() { return 1; } 01949 } 01950