| 1 | #define yy_create_buffer fc__create_buffer |
| 2 | #define yy_delete_buffer fc__delete_buffer |
| 3 | #define yy_scan_buffer fc__scan_buffer |
| 4 | #define yy_scan_string fc__scan_string |
| 5 | #define yy_scan_bytes fc__scan_bytes |
| 6 | #define yy_flex_debug fc__flex_debug |
| 7 | #define yy_init_buffer fc__init_buffer |
| 8 | #define yy_flush_buffer fc__flush_buffer |
| 9 | #define yy_load_buffer_state fc__load_buffer_state |
| 10 | #define yy_switch_to_buffer fc__switch_to_buffer |
| 11 | #define yyin fc_in |
| 12 | #define yyleng fc_leng |
| 13 | #define yylex fc_lex |
| 14 | #define yyout fc_out |
| 15 | #define yyrestart fc_restart |
| 16 | #define yytext fc_text |
| 17 | #define yylineno fc_lineno |
| 18 | #define yywrap fc_wrap |
| 19 | |
| 20 | /* A lexical scanner generated by flex */ |
| 21 | |
| 22 | /* Scanner skeleton version: |
| 23 | * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ |
| 24 | */ |
| 25 | |
| 26 | #define FLEX_SCANNER |
| 27 | #define YY_FLEX_MAJOR_VERSION 2 |
| 28 | #define YY_FLEX_MINOR_VERSION 5 |
| 29 | |
| 30 | #include <stdio.h> |
| 31 | |
| 32 | |
| 33 | /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ |
| 34 | #ifdef c_plusplus |
| 35 | #ifndef __cplusplus |
| 36 | #define __cplusplus |
| 37 | #endif |
| 38 | #endif |
| 39 | |
| 40 | |
| 41 | #ifdef __cplusplus |
| 42 | |
| 43 | #include <stdlib.h> |
| 44 | #include <unistd.h> |
| 45 | |
| 46 | /* Use prototypes in function declarations. */ |
| 47 | #define YY_USE_PROTOS |
| 48 | |
| 49 | /* The "const" storage-class-modifier is valid. */ |
| 50 | #define YY_USE_CONST |
| 51 | |
| 52 | #else /* ! __cplusplus */ |
| 53 | |
| 54 | #if __STDC__ |
| 55 | |
| 56 | #define YY_USE_PROTOS |
| 57 | #define YY_USE_CONST |
| 58 | |
| 59 | #endif /* __STDC__ */ |
| 60 | #endif /* ! __cplusplus */ |
| 61 | |
| 62 | #ifdef __TURBOC__ |
| 63 | #pragma warn -rch |
| 64 | #pragma warn -use |
| 65 | #include <io.h> |
| 66 | #include <stdlib.h> |
| 67 | #define YY_USE_CONST |
| 68 | #define YY_USE_PROTOS |
| 69 | #endif |
| 70 | |
| 71 | #ifdef YY_USE_CONST |
| 72 | #define yyconst const |
| 73 | #else |
| 74 | #define yyconst |
| 75 | #endif |
| 76 | |
| 77 | |
| 78 | #ifdef YY_USE_PROTOS |
| 79 | #define YY_PROTO(proto) proto |
| 80 | #else |
| 81 | #define YY_PROTO(proto) () |
| 82 | #endif |
| 83 | |
| 84 | /* Returned upon end-of-file. */ |
| 85 | #define YY_NULL 0 |
| 86 | |
| 87 | /* Promotes a possibly negative, possibly signed char to an unsigned |
| 88 | * integer for use as an array index. If the signed char is negative, |
| 89 | * we want to instead treat it as an 8-bit unsigned char, hence the |
| 90 | * double cast. |
| 91 | */ |
| 92 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
| 93 | |
| 94 | /* Enter a start condition. This macro really ought to take a parameter, |
| 95 | * but we do it the disgusting crufty way forced on us by the ()-less |
| 96 | * definition of BEGIN. |
| 97 | */ |
| 98 | #define BEGIN yy_start = 1 + 2 * |
| 99 | |
| 100 | /* Translate the current start state into a value that can be later handed |
| 101 | * to BEGIN to return to the state. The YYSTATE alias is for lex |
| 102 | * compatibility. |
| 103 | */ |
| 104 | #define YY_START ((yy_start - 1) / 2) |
| 105 | #define YYSTATE YY_START |
| 106 | |
| 107 | /* Action number for EOF rule of a given start state. */ |
| 108 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
| 109 | |
| 110 | /* Special action meaning "start processing a new file". */ |
| 111 | #define YY_NEW_FILE yyrestart( yyin ) |
| 112 | |
| 113 | #define YY_END_OF_BUFFER_CHAR 0 |
| 114 | |
| 115 | /* Size of default input buffer. */ |
| 116 | #define YY_BUF_SIZE 16384*5 |
| 117 | |
| 118 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
| 119 | |
| 120 | extern int yyleng; |
| 121 | extern FILE *yyin, *yyout; |
| 122 | |
| 123 | #define EOB_ACT_CONTINUE_SCAN 0 |
| 124 | #define EOB_ACT_END_OF_FILE 1 |
| 125 | #define EOB_ACT_LAST_MATCH 2 |
| 126 | |
| 127 | /* The funky do-while in the following #define is used to turn the definition |
| 128 | * int a single C statement (which needs a semi-colon terminator). This |
| 129 | * avoids problems with code like: |
| 130 | * |
| 131 | * if ( condition_holds ) |
| 132 | * yyless( 5 ); |
| 133 | * else |
| 134 | * do_something_else(); |
| 135 | * |
| 136 | * Prior to using the do-while the compiler would get upset at the |
| 137 | * "else" because it interpreted the "if" statement as being all |
| 138 | * done when it reached the ';' after the yyless() call. |
| 139 | */ |
| 140 | |
| 141 | /* Return all but the first 'n' matched characters back to the input stream. */ |
| 142 | |
| 143 | #define yyless(n) \ |
| 144 | do \ |
| 145 | { \ |
| 146 | /* Undo effects of setting up yytext. */ \ |
| 147 | *yy_cp = yy_hold_char; \ |
| 148 | YY_RESTORE_YY_MORE_OFFSET \ |
| 149 | yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ |
| 150 | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
| 151 | } \ |
| 152 | while ( 0 ) |
| 153 | |
| 154 | #define unput(c) yyunput( c, yytext_ptr ) |
| 155 | |
| 156 | /* The following is because we cannot portably get our hands on size_t |
| 157 | * (without autoconf's help, which isn't available because we want |
| 158 | * flex-generated scanners to compile on their own). |
| 159 | */ |
| 160 | typedef unsigned int yy_size_t; |
| 161 | |
| 162 | |
| 163 | struct yy_buffer_state |
| 164 | { |
| 165 | FILE *yy_input_file; |
| 166 | |
| 167 | char *yy_ch_buf; /* input buffer */ |
| 168 | char *yy_buf_pos; /* current position in input buffer */ |
| 169 | |
| 170 | /* Size of input buffer in bytes, not including room for EOB |
| 171 | * characters. |
| 172 | */ |
| 173 | yy_size_t yy_buf_size; |
| 174 | |
| 175 | /* Number of characters read into yy_ch_buf, not including EOB |
| 176 | * characters. |
| 177 | */ |
| 178 | int yy_n_chars; |
| 179 | |
| 180 | /* Whether we "own" the buffer - i.e., we know we created it, |
| 181 | * and can realloc() it to grow it, and should free() it to |
| 182 | * delete it. |
| 183 | */ |
| 184 | int yy_is_our_buffer; |
| 185 | |
| 186 | /* Whether this is an "interactive" input source; if so, and |
| 187 | * if we're using stdio for input, then we want to use getc() |
| 188 | * instead of fread(), to make sure we stop fetching input after |
| 189 | * each newline. |
| 190 | */ |
| 191 | int yy_is_interactive; |
| 192 | |
| 193 | /* Whether we're considered to be at the beginning of a line. |
| 194 | * If so, '^' rules will be active on the next match, otherwise |
| 195 | * not. |
| 196 | */ |
| 197 | int yy_at_bol; |
| 198 | |
| 199 | /* Whether to try to fill the input buffer when we reach the |
| 200 | * end of it. |
| 201 | */ |
| 202 | int yy_fill_buffer; |
| 203 | |
| 204 | int yy_buffer_status; |
| 205 | #define YY_BUFFER_NEW 0 |
| 206 | #define YY_BUFFER_NORMAL 1 |
| 207 | /* When an EOF's been seen but there's still some text to process |
| 208 | * then we mark the buffer as YY_EOF_PENDING, to indicate that we |
| 209 | * shouldn't try reading from the input source any more. We might |
| 210 | * still have a bunch of tokens to match, though, because of |
| 211 | * possible backing-up. |
| 212 | * |
| 213 | * When we actually see the EOF, we change the status to "new" |
| 214 | * (via yyrestart()), so that the user can continue scanning by |
| 215 | * just pointing yyin at a new input file. |
| 216 | */ |
| 217 | #define YY_BUFFER_EOF_PENDING 2 |
| 218 | }; |
| 219 | |
| 220 | static YY_BUFFER_STATE yy_current_buffer = 0; |
| 221 | |
| 222 | /* We provide macros for accessing buffer states in case in the |
| 223 | * future we want to put the buffer states in a more general |
| 224 | * "scanner state". |
| 225 | */ |
| 226 | #define YY_CURRENT_BUFFER yy_current_buffer |
| 227 | |
| 228 | |
| 229 | /* yy_hold_char holds the character lost when yytext is formed. */ |
| 230 | static char yy_hold_char; |
| 231 | |
| 232 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
| 233 | |
| 234 | |
| 235 | int yyleng; |
| 236 | |
| 237 | /* Points to current character in buffer. */ |
| 238 | static char *yy_c_buf_p = (char *) 0; |
| 239 | static int yy_init = 1; /* whether we need to initialize */ |
| 240 | static int yy_start = 0; /* start state number */ |
| 241 | |
| 242 | /* Flag which is used to allow yywrap()'s to do buffer switches |
| 243 | * instead of setting up a fresh yyin. A bit of a hack ... |
| 244 | */ |
| 245 | static int yy_did_buffer_switch_on_eof; |
| 246 | |
| 247 | void yyrestart YY_PROTO(( FILE *input_file )); |
| 248 | |
| 249 | void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); |
| 250 | void yy_load_buffer_state YY_PROTO(( void )); |
| 251 | YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); |
| 252 | void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
| 253 | void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); |
| 254 | void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
| 255 | #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) |
| 256 | |
| 257 | YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); |
| 258 | YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); |
| 259 | YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); |
| 260 | |
| 261 | static void *yy_flex_alloc YY_PROTO(( yy_size_t )); |
| 262 | static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); |
| 263 | static void yy_flex_free YY_PROTO(( void * )); |
| 264 | |
| 265 | #define yy_new_buffer yy_create_buffer |
| 266 | |
| 267 | #define yy_set_interactive(is_interactive) \ |
| 268 | { \ |
| 269 | if ( ! yy_current_buffer ) \ |
| 270 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
| 271 | yy_current_buffer->yy_is_interactive = is_interactive; \ |
| 272 | } |
| 273 | |
| 274 | #define yy_set_bol(at_bol) \ |
| 275 | { \ |
| 276 | if ( ! yy_current_buffer ) \ |
| 277 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
| 278 | yy_current_buffer->yy_at_bol = at_bol; \ |
| 279 | } |
| 280 | |
| 281 | #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) |
| 282 | |
| 283 | |
| 284 | #define YY_USES_REJECT |
| 285 | typedef unsigned char YY_CHAR; |
| 286 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; |
| 287 | typedef int yy_state_type; |
| 288 | extern int yylineno; |
| 289 | int yylineno = 1; |
| 290 | extern char *yytext; |
| 291 | #define yytext_ptr yytext |
| 292 | |
| 293 | static yy_state_type yy_get_previous_state YY_PROTO(( void )); |
| 294 | static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); |
| 295 | static int yy_get_next_buffer YY_PROTO(( void )); |
| 296 | static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); |
| 297 | |
| 298 | /* Done after the current pattern has been matched and before the |
| 299 | * corresponding action - sets up yytext. |
| 300 | */ |
| 301 | #define YY_DO_BEFORE_ACTION \ |
| 302 | yytext_ptr = yy_bp; \ |
| 303 | yyleng = (int) (yy_cp - yy_bp); \ |
| 304 | yy_hold_char = *yy_cp; \ |
| 305 | *yy_cp = '\0'; \ |
| 306 | yy_c_buf_p = yy_cp; |
| 307 | |
| 308 | #define YY_NUM_RULES 19 |
| 309 | #define YY_END_OF_BUFFER 20 |
| 310 | static yyconst short int yy_acclist[53] = |
| 311 | { 0, |
| 312 | 13, 13, 20, 11, 19, 19, 11, 19, 11, 19, |
| 313 | 11, 19, 11, 19, 11, 19, 11, 19, 11, 19, |
| 314 | 13, 19, 12, 19, 19, 18, 19, 18, 19, 16, |
| 315 | 19, 15, 19, 8, 19, 7, 8, 19, 6, 8, |
| 316 | 19, 4, 2, 1, 13, 17, 6, 3, 14, 10, |
| 317 | 9, 5 |
| 318 | } ; |
| 319 | |
| 320 | static yyconst short int yy_accept[99] = |
| 321 | { 0, |
| 322 | 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, |
| 323 | 3, 4, 6, 7, 9, 11, 13, 15, 17, 19, |
| 324 | 21, 23, 25, 26, 28, 30, 32, 34, 36, 39, |
| 325 | 42, 42, 43, 43, 43, 43, 44, 45, 45, 45, |
| 326 | 45, 45, 45, 46, 46, 47, 48, 48, 48, 49, |
| 327 | 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, |
| 328 | 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, |
| 329 | 50, 50, 50, 51, 51, 51, 51, 51, 51, 51, |
| 330 | 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, |
| 331 | 51, 51, 51, 51, 52, 52, 53, 53 |
| 332 | |
| 333 | } ; |
| 334 | |
| 335 | static yyconst int yy_ec[256] = |
| 336 | { 0, |
| 337 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
| 338 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 339 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 340 | 1, 4, 1, 5, 1, 1, 1, 1, 6, 1, |
| 341 | 1, 7, 1, 1, 1, 1, 8, 9, 9, 9, |
| 342 | 9, 9, 9, 9, 9, 10, 10, 11, 12, 13, |
| 343 | 14, 15, 16, 1, 17, 17, 17, 17, 17, 17, |
| 344 | 18, 18, 18, 18, 18, 19, 18, 18, 18, 18, |
| 345 | 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, |
| 346 | 1, 20, 1, 1, 11, 1, 21, 22, 23, 24, |
| 347 | |
| 348 | 25, 22, 26, 18, 27, 18, 18, 28, 29, 30, |
| 349 | 18, 31, 18, 32, 33, 32, 34, 32, 18, 35, |
| 350 | 18, 18, 1, 1, 1, 1, 1, 1, 1, 1, |
| 351 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 352 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 353 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 354 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 355 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 356 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 357 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 358 | |
| 359 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 360 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 361 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 362 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 363 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 364 | 1, 1, 1, 1, 1 |
| 365 | } ; |
| 366 | |
| 367 | static yyconst int yy_meta[36] = |
| 368 | { 0, |
| 369 | 1, 2, 3, 4, 5, 6, 1, 1, 7, 8, |
| 370 | 9, 10, 1, 11, 1, 5, 12, 13, 13, 5, |
| 371 | 14, 14, 12, 12, 12, 13, 13, 13, 13, 15, |
| 372 | 13, 15, 13, 13, 15 |
| 373 | } ; |
| 374 | |
| 375 | static yyconst short int yy_base[114] = |
| 376 | { 0, |
| 377 | 0, 32, 7, 11, 14, 15, 283, 282, 66, 0, |
| 378 | 277, 360, 360, 21, 256, 21, 26, 233, 241, 228, |
| 379 | 0, 360, 0, 360, 242, 360, 360, 360, 360, 0, |
| 380 | 28, 360, 14, 19, 93, 360, 360, 37, 227, 209, |
| 381 | 134, 135, 41, 31, 360, 0, 45, 0, 360, 38, |
| 382 | 0, 132, 134, 128, 48, 98, 124, 99, 144, 123, |
| 383 | 123, 129, 101, 0, 103, 0, 128, 120, 139, 117, |
| 384 | 119, 100, 360, 116, 106, 117, 112, 103, 127, 101, |
| 385 | 0, 87, 108, 86, 110, 111, 112, 92, 107, 48, |
| 386 | 38, 52, 123, 360, 30, 360, 360, 169, 184, 199, |
| 387 | |
| 388 | 214, 229, 244, 259, 266, 277, 288, 297, 305, 308, |
| 389 | 320, 332, 344 |
| 390 | } ; |
| 391 | |
| 392 | static yyconst short int yy_def[114] = |
| 393 | { 0, |
| 394 | 98, 98, 99, 99, 100, 100, 101, 101, 97, 9, |
| 395 | 97, 97, 97, 102, 103, 97, 97, 97, 97, 97, |
| 396 | 97, 97, 104, 97, 97, 97, 97, 97, 97, 105, |
| 397 | 102, 97, 106, 103, 107, 97, 97, 102, 103, 97, |
| 398 | 97, 97, 97, 104, 97, 105, 102, 108, 97, 103, |
| 399 | 109, 97, 97, 97, 104, 102, 102, 103, 103, 97, |
| 400 | 97, 97, 102, 57, 103, 59, 97, 97, 97, 97, |
| 401 | 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, |
| 402 | 110, 97, 111, 97, 97, 111, 112, 97, 112, 113, |
| 403 | 97, 97, 113, 97, 97, 97, 0, 97, 97, 97, |
| 404 | |
| 405 | 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, |
| 406 | 97, 97, 97 |
| 407 | } ; |
| 408 | |
| 409 | static yyconst short int yy_nxt[396] = |
| 410 | { 0, |
| 411 | 97, 43, 13, 43, 14, 15, 97, 16, 21, 22, |
| 412 | 21, 23, 21, 22, 21, 23, 13, 13, 17, 23, |
| 413 | 25, 25, 47, 23, 49, 32, 18, 36, 37, 19, |
| 414 | 38, 39, 32, 20, 13, 55, 14, 15, 35, 16, |
| 415 | 33, 32, 43, 49, 43, 55, 58, 33, 48, 32, |
| 416 | 17, 92, 55, 56, 96, 92, 33, 35, 18, 94, |
| 417 | 95, 19, 55, 94, 33, 20, 28, 28, 13, 28, |
| 418 | 28, 28, 28, 28, 28, 28, 28, 29, 28, 28, |
| 419 | 28, 28, 30, 30, 30, 28, 30, 30, 30, 30, |
| 420 | 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, |
| 421 | |
| 422 | 30, 50, 32, 75, 49, 32, 63, 65, 49, 75, |
| 423 | 89, 85, 91, 85, 85, 89, 88, 33, 35, 84, |
| 424 | 33, 87, 35, 87, 87, 82, 92, 51, 32, 76, |
| 425 | 81, 80, 64, 64, 94, 76, 79, 78, 77, 74, |
| 426 | 64, 73, 72, 33, 64, 64, 64, 64, 64, 49, |
| 427 | 71, 70, 66, 66, 69, 68, 67, 62, 61, 60, |
| 428 | 66, 54, 53, 35, 66, 66, 66, 66, 66, 12, |
| 429 | 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, |
| 430 | 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, |
| 431 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 24, |
| 432 | |
| 433 | 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, |
| 434 | 24, 24, 24, 24, 26, 26, 26, 26, 26, 26, |
| 435 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 31, |
| 436 | 31, 52, 31, 31, 31, 31, 31, 31, 31, 31, |
| 437 | 31, 31, 31, 31, 34, 34, 35, 34, 34, 45, |
| 438 | 34, 34, 34, 34, 34, 34, 34, 34, 34, 44, |
| 439 | 42, 41, 40, 44, 44, 44, 44, 44, 44, 44, |
| 440 | 44, 44, 44, 44, 46, 35, 97, 46, 46, 46, |
| 441 | 46, 31, 31, 31, 27, 27, 97, 97, 97, 97, |
| 442 | 31, 31, 34, 34, 34, 97, 97, 97, 97, 97, |
| 443 | |
| 444 | 97, 34, 34, 57, 57, 97, 97, 97, 57, 97, |
| 445 | 57, 59, 59, 97, 97, 97, 59, 97, 59, 83, |
| 446 | 83, 83, 83, 86, 97, 97, 97, 97, 86, 97, |
| 447 | 86, 86, 86, 86, 86, 90, 97, 97, 97, 97, |
| 448 | 97, 97, 97, 90, 90, 90, 90, 93, 97, 97, |
| 449 | 97, 97, 93, 93, 97, 93, 93, 93, 93, 11, |
| 450 | 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, |
| 451 | 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, |
| 452 | 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, |
| 453 | 97, 97, 97, 97, 97 |
| 454 | |
| 455 | } ; |
| 456 | |
| 457 | static yyconst short int yy_chk[396] = |
| 458 | { 0, |
| 459 | 0, 21, 1, 21, 1, 1, 0, 1, 3, 3, |
| 460 | 3, 3, 4, 4, 4, 4, 5, 6, 1, 3, |
| 461 | 5, 6, 33, 4, 34, 14, 1, 16, 16, 1, |
| 462 | 17, 17, 31, 1, 2, 44, 2, 2, 34, 2, |
| 463 | 14, 38, 43, 50, 43, 44, 50, 31, 33, 47, |
| 464 | 2, 90, 55, 47, 95, 92, 38, 50, 2, 90, |
| 465 | 91, 2, 55, 92, 47, 2, 9, 9, 9, 9, |
| 466 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
| 467 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
| 468 | 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, |
| 469 | |
| 470 | 9, 35, 56, 72, 58, 63, 56, 58, 65, 75, |
| 471 | 89, 83, 88, 85, 86, 87, 84, 56, 58, 82, |
| 472 | 63, 83, 65, 85, 86, 80, 93, 35, 57, 72, |
| 473 | 79, 78, 57, 57, 93, 75, 77, 76, 74, 71, |
| 474 | 57, 70, 69, 57, 57, 57, 57, 57, 57, 59, |
| 475 | 68, 67, 59, 59, 62, 61, 60, 54, 53, 52, |
| 476 | 59, 42, 41, 59, 59, 59, 59, 59, 59, 98, |
| 477 | 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, |
| 478 | 98, 98, 98, 98, 99, 99, 99, 99, 99, 99, |
| 479 | 99, 99, 99, 99, 99, 99, 99, 99, 99, 100, |
| 480 | |
| 481 | 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, |
| 482 | 100, 100, 100, 100, 101, 101, 101, 101, 101, 101, |
| 483 | 101, 101, 101, 101, 101, 101, 101, 101, 101, 102, |
| 484 | 102, 40, 102, 102, 102, 102, 102, 102, 102, 102, |
| 485 | 102, 102, 102, 102, 103, 103, 39, 103, 103, 25, |
| 486 | 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, |
| 487 | 20, 19, 18, 104, 104, 104, 104, 104, 104, 104, |
| 488 | 104, 104, 104, 104, 105, 15, 11, 105, 105, 105, |
| 489 | 105, 106, 106, 106, 8, 7, 0, 0, 0, 0, |
| 490 | 106, 106, 107, 107, 107, 0, 0, 0, 0, 0, |
| 491 | |
| 492 | 0, 107, 107, 108, 108, 0, 0, 0, 108, 0, |
| 493 | 108, 109, 109, 0, 0, 0, 109, 0, 109, 110, |
| 494 | 110, 110, 110, 111, 0, 0, 0, 0, 111, 0, |
| 495 | 111, 111, 111, 111, 111, 112, 0, 0, 0, 0, |
| 496 | 0, 0, 0, 112, 112, 112, 112, 113, 0, 0, |
| 497 | 0, 0, 113, 113, 0, 113, 113, 113, 113, 97, |
| 498 | 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, |
| 499 | 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, |
| 500 | 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, |
| 501 | 97, 97, 97, 97, 97 |
| 502 | |
| 503 | } ; |
| 504 | |
| 505 | static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; |
| 506 | static char *yy_full_match; |
| 507 | static int yy_lp; |
| 508 | #define REJECT \ |
| 509 | { \ |
| 510 | *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ |
| 511 | yy_cp = yy_full_match; /* restore poss. backed-over text */ \ |
| 512 | ++yy_lp; \ |
| 513 | goto find_rule; \ |
| 514 | } |
| 515 | #define yymore() yymore_used_but_not_detected |
| 516 | #define YY_MORE_ADJ 0 |
| 517 | #define YY_RESTORE_YY_MORE_OFFSET |
| 518 | char *yytext; |
| 519 | #define INITIAL 0 |
| 520 | /** |
| 521 | * the "incl" state is used for picking up the name |
| 522 | * of an include file |
| 523 | */ |
| 524 | #define incl 1 |
| 525 | |
| 526 | #define c_comment 2 |
| 527 | |
| 528 | #define cpp_comment 3 |
| 529 | |
| 530 | #define using_namespace 4 |
| 531 | |
| 532 | // Avoid spam output |
| 533 | #ifdef ECHO |
| 534 | #undef ECHO |
| 535 | #endif |
| 536 | #define ECHO |
| 537 | |
| 538 | // Never exit |
| 539 | #ifdef YY_FATAL_ERROR |
| 540 | #undef YY_FATAL_ERROR |
| 541 | #endif |
| 542 | #define YY_FATAL_ERROR(msg) |
| 543 | |
| 544 | #include <list> |
| 545 | #include <wx/filename.h> |
| 546 | #include "crawler_include.h" |
| 547 | |
| 548 | |
| 549 | /* Macros after this point can all be overridden by user definitions in |
| 550 | * section 1. |
| 551 | */ |
| 552 | |
| 553 | #ifndef YY_SKIP_YYWRAP |
| 554 | #ifdef __cplusplus |
| 555 | extern "C" int yywrap YY_PROTO(( void )); |
| 556 | #else |
| 557 | extern int yywrap YY_PROTO(( void )); |
| 558 | #endif |
| 559 | #endif |
| 560 | |
| 561 | #ifndef YY_NO_UNPUT |
| 562 | static void yyunput YY_PROTO(( int c, char *buf_ptr )); |
| 563 | #endif |
| 564 | |
| 565 | #ifndef yytext_ptr |
| 566 | static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); |
| 567 | #endif |
| 568 | |
| 569 | #ifdef YY_NEED_STRLEN |
| 570 | static int yy_flex_strlen YY_PROTO(( yyconst char * )); |
| 571 | #endif |
| 572 | |
| 573 | #ifndef YY_NO_INPUT |
| 574 | #ifdef __cplusplus |
| 575 | static int yyinput YY_PROTO(( void )); |
| 576 | #else |
| 577 | static int input YY_PROTO(( void )); |
| 578 | #endif |
| 579 | #endif |
| 580 | |
| 581 | #if YY_STACK_USED |
| 582 | static int yy_start_stack_ptr = 0; |
| 583 | static int yy_start_stack_depth = 0; |
| 584 | static int *yy_start_stack = 0; |
| 585 | #ifndef YY_NO_PUSH_STATE |
| 586 | static void yy_push_state YY_PROTO(( int new_state )); |
| 587 | #endif |
| 588 | #ifndef YY_NO_POP_STATE |
| 589 | static void yy_pop_state YY_PROTO(( void )); |
| 590 | #endif |
| 591 | #ifndef YY_NO_TOP_STATE |
| 592 | static int yy_top_state YY_PROTO(( void )); |
| 593 | #endif |
| 594 | |
| 595 | #else |
| 596 | #define YY_NO_PUSH_STATE 1 |
| 597 | #define YY_NO_POP_STATE 1 |
| 598 | #define YY_NO_TOP_STATE 1 |
| 599 | #endif |
| 600 | |
| 601 | #ifdef YY_MALLOC_DECL |
| 602 | YY_MALLOC_DECL |
| 603 | #else |
| 604 | #if __STDC__ |
| 605 | #ifndef __cplusplus |
| 606 | #include <stdlib.h> |
| 607 | #endif |
| 608 | #else |
| 609 | /* Just try to get by without declaring the routines. This will fail |
| 610 | * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) |
| 611 | * or sizeof(void*) != sizeof(int). |
| 612 | */ |
| 613 | #endif |
| 614 | #endif |
| 615 | |
| 616 | /* Amount of stuff to slurp up with each read. */ |
| 617 | #ifndef YY_READ_BUF_SIZE |
| 618 | #define YY_READ_BUF_SIZE 8192 |
| 619 | #endif |
| 620 | |
| 621 | /* Copy whatever the last rule matched to the standard output. */ |
| 622 | |
| 623 | #ifndef ECHO |
| 624 | /* This used to be an fputs(), but since the string might contain NUL's, |
| 625 | * we now use fwrite(). |
| 626 | */ |
| 627 | #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
| 628 | #endif |
| 629 | |
| 630 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
| 631 | * is returned in "result". |
| 632 | */ |
| 633 | #ifndef YY_INPUT |
| 634 | #define YY_INPUT(buf,result,max_size) \ |
| 635 | if ( yy_current_buffer->yy_is_interactive ) \ |
| 636 | { \ |
| 637 | int c = '*', n; \ |
| 638 | for ( n = 0; n < max_size && \ |
| 639 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
| 640 | buf[n] = (char) c; \ |
| 641 | if ( c == '\n' ) \ |
| 642 | buf[n++] = (char) c; \ |
| 643 | if ( c == EOF && ferror( yyin ) ) \ |
| 644 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
| 645 | result = n; \ |
| 646 | } \ |
| 647 | else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ |
| 648 | && ferror( yyin ) ) \ |
| 649 | YY_FATAL_ERROR( "input in flex scanner failed" ); |
| 650 | #endif |
| 651 | |
| 652 | /* No semi-colon after return; correct usage is to write "yyterminate();" - |
| 653 | * we don't want an extra ';' after the "return" because that will cause |
| 654 | * some compilers to complain about unreachable statements. |
| 655 | */ |
| 656 | #ifndef yyterminate |
| 657 | #define yyterminate() return YY_NULL |
| 658 | #endif |
| 659 | |
| 660 | /* Number of entries by which start-condition stack grows. */ |
| 661 | #ifndef YY_START_STACK_INCR |
| 662 | #define YY_START_STACK_INCR 25 |
| 663 | #endif |
| 664 | |
| 665 | /* Report a fatal error. */ |
| 666 | #ifndef YY_FATAL_ERROR |
| 667 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
| 668 | #endif |
| 669 | |
| 670 | /* Default declaration of generated scanner - a define so the user can |
| 671 | * easily add parameters. |
| 672 | */ |
| 673 | #ifndef YY_DECL |
| 674 | #define YY_DECL int yylex YY_PROTO(( void )) |
| 675 | #endif |
| 676 | |
| 677 | /* Code executed at the beginning of each rule, after yytext and yyleng |
| 678 | * have been set up. |
| 679 | */ |
| 680 | #ifndef YY_USER_ACTION |
| 681 | #define YY_USER_ACTION |
| 682 | #endif |
| 683 | |
| 684 | /* Code executed at the end of each rule. */ |
| 685 | #ifndef YY_BREAK |
| 686 | #define YY_BREAK break; |
| 687 | #endif |
| 688 | |
| 689 | #define YY_RULE_SETUP \ |
| 690 | YY_USER_ACTION |
| 691 | |
| 692 | YY_DECL |
| 693 | { |
| 694 | register yy_state_type yy_current_state; |
| 695 | register char *yy_cp, *yy_bp; |
| 696 | register int yy_act; |
| 697 | |
| 698 | |
| 699 | |
| 700 | |
| 701 | if ( yy_init ) |
| 702 | { |
| 703 | yy_init = 0; |
| 704 | |
| 705 | #ifdef YY_USER_INIT |
| 706 | YY_USER_INIT; |
| 707 | #endif |
| 708 | |
| 709 | if ( ! yy_start ) |
| 710 | yy_start = 1; /* first start state */ |
| 711 | |
| 712 | if ( ! yyin ) |
| 713 | yyin = stdin; |
| 714 | |
| 715 | if ( ! yyout ) |
| 716 | yyout = stdout; |
| 717 | |
| 718 | if ( ! yy_current_buffer ) |
| 719 | yy_current_buffer = |
| 720 | yy_create_buffer( yyin, YY_BUF_SIZE ); |
| 721 | |
| 722 | yy_load_buffer_state(); |
| 723 | } |
| 724 | |
| 725 | while ( 1 ) /* loops until end-of-file is reached */ |
| 726 | { |
| 727 | yy_cp = yy_c_buf_p; |
| 728 | |
| 729 | /* Support of yytext. */ |
| 730 | *yy_cp = yy_hold_char; |
| 731 | |
| 732 | /* yy_bp points to the position in yy_ch_buf of the start of |
| 733 | * the current run. |
| 734 | */ |
| 735 | yy_bp = yy_cp; |
| 736 | |
| 737 | yy_current_state = yy_start; |
| 738 | yy_state_ptr = yy_state_buf; |
| 739 | *yy_state_ptr++ = yy_current_state; |
| 740 | yy_match: |
| 741 | do |
| 742 | { |
| 743 | register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
| 744 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
| 745 | { |
| 746 | yy_current_state = (int) yy_def[yy_current_state]; |
| 747 | if ( yy_current_state >= 98 ) |
| 748 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 749 | } |
| 750 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
| 751 | *yy_state_ptr++ = yy_current_state; |
| 752 | ++yy_cp; |
| 753 | } |
| 754 | while ( yy_base[yy_current_state] != 360 ); |
| 755 | |
| 756 | yy_find_action: |
| 757 | yy_current_state = *--yy_state_ptr; |
| 758 | yy_lp = yy_accept[yy_current_state]; |
| 759 | find_rule: /* we branch to this label when backing up */ |
| 760 | for ( ; ; ) /* until we find what rule we matched */ |
| 761 | { |
| 762 | if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) |
| 763 | { |
| 764 | yy_act = yy_acclist[yy_lp]; |
| 765 | { |
| 766 | yy_full_match = yy_cp; |
| 767 | break; |
| 768 | } |
| 769 | } |
| 770 | --yy_cp; |
| 771 | yy_current_state = *--yy_state_ptr; |
| 772 | yy_lp = yy_accept[yy_current_state]; |
| 773 | } |
| 774 | |
| 775 | YY_DO_BEFORE_ACTION; |
| 776 | |
| 777 | if ( yy_act != YY_END_OF_BUFFER ) |
| 778 | { |
| 779 | int yyl; |
| 780 | for ( yyl = 0; yyl < yyleng; ++yyl ) |
| 781 | if ( yytext[yyl] == '\n' ) |
| 782 | ++yylineno; |
| 783 | } |
| 784 | |
| 785 | do_action: /* This label is used only to access EOF actions. */ |
| 786 | |
| 787 | |
| 788 | switch ( yy_act ) |
| 789 | { /* beginning of action switch */ |
| 790 | case 1: |
| 791 | YY_RULE_SETUP |
| 792 | { |
| 793 | BEGIN(cpp_comment); |
| 794 | } |
| 795 | YY_BREAK |
| 796 | case 2: |
| 797 | YY_RULE_SETUP |
| 798 | { |
| 799 | BEGIN(c_comment); |
| 800 | } |
| 801 | YY_BREAK |
| 802 | case 3: |
| 803 | YY_RULE_SETUP |
| 804 | {/* eat a string */} |
| 805 | YY_BREAK |
| 806 | case 4: |
| 807 | YY_RULE_SETUP |
| 808 | {/* eat a string */} |
| 809 | YY_BREAK |
| 810 | case 5: |
| 811 | YY_RULE_SETUP |
| 812 | {BEGIN(using_namespace);} |
| 813 | YY_BREAK |
| 814 | case 6: |
| 815 | YY_RULE_SETUP |
| 816 | { /* got the namespace */ |
| 817 | fcFileOpener::Get()->AddNamespace(yytext); |
| 818 | BEGIN(INITIAL); |
| 819 | } |
| 820 | YY_BREAK |
| 821 | case 7: |
| 822 | YY_RULE_SETUP |
| 823 | {BEGIN(INITIAL);} |
| 824 | YY_BREAK |
| 825 | case 8: |
| 826 | YY_RULE_SETUP |
| 827 | {} |
| 828 | YY_BREAK |
| 829 | case 9: |
| 830 | YY_RULE_SETUP |
| 831 | {fcFileOpener::Get()->AddNamespaceAlias(yytext);} |
| 832 | YY_BREAK |
| 833 | case 10: |
| 834 | YY_RULE_SETUP |
| 835 | {BEGIN(incl);} |
| 836 | YY_BREAK |
| 837 | case 11: |
| 838 | YY_RULE_SETUP |
| 839 | {} |
| 840 | YY_BREAK |
| 841 | case 12: |
| 842 | YY_RULE_SETUP |
| 843 | {BEGIN(INITIAL);} |
| 844 | YY_BREAK |
| 845 | case 13: |
| 846 | YY_RULE_SETUP |
| 847 | {} /* eat the whitespace */ |
| 848 | YY_BREAK |
| 849 | case 14: |
| 850 | YY_RULE_SETUP |
| 851 | { /* got the include file name */ |
| 852 | // Open the new file |
| 853 | FILE * new_file(NULL); |
| 854 | |
| 855 | // keep the include statement |
| 856 | fcFileOpener::Get()->AddIncludeStatement( yytext ); |
| 857 | wxString filepath; |
| 858 | if ( fcFileOpener::Get()->getDepth() < fcFileOpener::Get()->getMaxDepth() ) { |
| 859 | new_file = fcFileOpener::Get()->OpenFile( yytext, filepath ); |
| 860 | } |
| 861 | |
| 862 | if ( ! new_file ) { |
| 863 | // We got some error |
| 864 | BEGIN(INITIAL); |
| 865 | |
| 866 | } else { |
| 867 | // keep the current buffer |
| 868 | fc_in = new_file; |
| 869 | fcFileOpener::Get()->PushBufferState( YY_CURRENT_BUFFER, filepath ); |
| 870 | |
| 871 | yy_switch_to_buffer( yy_create_buffer( new_file, YY_BUF_SIZE ) ); |
| 872 | BEGIN(INITIAL); |
| 873 | } |
| 874 | } |
| 875 | YY_BREAK |
| 876 | case 15: |
| 877 | YY_RULE_SETUP |
| 878 | { |
| 879 | BEGIN(INITIAL); |
| 880 | } |
| 881 | YY_BREAK |
| 882 | case 16: |
| 883 | YY_RULE_SETUP |
| 884 | {} /* do nothing */ |
| 885 | YY_BREAK |
| 886 | case 17: |
| 887 | YY_RULE_SETUP |
| 888 | { |
| 889 | BEGIN(INITIAL); |
| 890 | } |
| 891 | YY_BREAK |
| 892 | case 18: |
| 893 | YY_RULE_SETUP |
| 894 | {} |
| 895 | YY_BREAK |
| 896 | case YY_STATE_EOF(INITIAL): |
| 897 | case YY_STATE_EOF(incl): |
| 898 | case YY_STATE_EOF(c_comment): |
| 899 | case YY_STATE_EOF(cpp_comment): |
| 900 | case YY_STATE_EOF(using_namespace): |
| 901 | { |
| 902 | if ( !fcFileOpener::Get()->IsStateStackEmpty() ) { |
| 903 | |
| 904 | if ( YY_CURRENT_BUFFER->yy_input_file ) { |
| 905 | fclose( YY_CURRENT_BUFFER->yy_input_file ); |
| 906 | YY_CURRENT_BUFFER->yy_input_file = NULL; |
| 907 | } |
| 908 | |
| 909 | yy_delete_buffer ( YY_CURRENT_BUFFER ); |
| 910 | yy_switch_to_buffer ( fcFileOpener::Get()->PopBufferState() ); |
| 911 | |
| 912 | } else { |
| 913 | |
| 914 | if ( YY_CURRENT_BUFFER->yy_input_file ) { |
| 915 | fclose( YY_CURRENT_BUFFER->yy_input_file ); |
| 916 | YY_CURRENT_BUFFER->yy_input_file = NULL; |
| 917 | |
| 918 | } |
| 919 | |
| 920 | yy_delete_buffer ( YY_CURRENT_BUFFER ); |
| 921 | yyterminate(); |
| 922 | } |
| 923 | } |
| 924 | YY_BREAK |
| 925 | case 19: |
| 926 | YY_RULE_SETUP |
| 927 | ECHO; |
| 928 | YY_BREAK |
| 929 | |
| 930 | case YY_END_OF_BUFFER: |
| 931 | { |
| 932 | /* Amount of text matched not including the EOB char. */ |
| 933 | int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; |
| 934 | |
| 935 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
| 936 | *yy_cp = yy_hold_char; |
| 937 | YY_RESTORE_YY_MORE_OFFSET |
| 938 | |
| 939 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) |
| 940 | { |
| 941 | /* We're scanning a new file or input source. It's |
| 942 | * possible that this happened because the user |
| 943 | * just pointed yyin at a new source and called |
| 944 | * yylex(). If so, then we have to assure |
| 945 | * consistency between yy_current_buffer and our |
| 946 | * globals. Here is the right place to do so, because |
| 947 | * this is the first action (other than possibly a |
| 948 | * back-up) that will match for the new input source. |
| 949 | */ |
| 950 | yy_n_chars = yy_current_buffer->yy_n_chars; |
| 951 | yy_current_buffer->yy_input_file = yyin; |
| 952 | yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; |
| 953 | } |
| 954 | |
| 955 | /* Note that here we test for yy_c_buf_p "<=" to the position |
| 956 | * of the first EOB in the buffer, since yy_c_buf_p will |
| 957 | * already have been incremented past the NUL character |
| 958 | * (since all states make transitions on EOB to the |
| 959 | * end-of-buffer state). Contrast this with the test |
| 960 | * in input(). |
| 961 | */ |
| 962 | if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
| 963 | { /* This was really a NUL. */ |
| 964 | yy_state_type yy_next_state; |
| 965 | |
| 966 | yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; |
| 967 | |
| 968 | yy_current_state = yy_get_previous_state(); |
| 969 | |
| 970 | /* Okay, we're now positioned to make the NUL |
| 971 | * transition. We couldn't have |
| 972 | * yy_get_previous_state() go ahead and do it |
| 973 | * for us because it doesn't know how to deal |
| 974 | * with the possibility of jamming (and we don't |
| 975 | * want to build jamming into it because then it |
| 976 | * will run more slowly). |
| 977 | */ |
| 978 | |
| 979 | yy_next_state = yy_try_NUL_trans( yy_current_state ); |
| 980 | |
| 981 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
| 982 | |
| 983 | if ( yy_next_state ) |
| 984 | { |
| 985 | /* Consume the NUL. */ |
| 986 | yy_cp = ++yy_c_buf_p; |
| 987 | yy_current_state = yy_next_state; |
| 988 | goto yy_match; |
| 989 | } |
| 990 | |
| 991 | else |
| 992 | { |
| 993 | yy_cp = yy_c_buf_p; |
| 994 | goto yy_find_action; |
| 995 | } |
| 996 | } |
| 997 | |
| 998 | else switch ( yy_get_next_buffer() ) |
| 999 | { |
| 1000 | case EOB_ACT_END_OF_FILE: |
| 1001 | { |
| 1002 | yy_did_buffer_switch_on_eof = 0; |
| 1003 | |
| 1004 | if ( yywrap() ) |
| 1005 | { |
| 1006 | /* Note: because we've taken care in |
| 1007 | * yy_get_next_buffer() to have set up |
| 1008 | * yytext, we can now set up |
| 1009 | * yy_c_buf_p so that if some total |
| 1010 | * hoser (like flex itself) wants to |
| 1011 | * call the scanner after we return the |
| 1012 | * YY_NULL, it'll still work - another |
| 1013 | * YY_NULL will get returned. |
| 1014 | */ |
| 1015 | yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; |
| 1016 | |
| 1017 | yy_act = YY_STATE_EOF(YY_START); |
| 1018 | goto do_action; |
| 1019 | } |
| 1020 | |
| 1021 | else |
| 1022 | { |
| 1023 | if ( ! yy_did_buffer_switch_on_eof ) |
| 1024 | YY_NEW_FILE; |
| 1025 | } |
| 1026 | break; |
| 1027 | } |
| 1028 | |
| 1029 | case EOB_ACT_CONTINUE_SCAN: |
| 1030 | yy_c_buf_p = |
| 1031 | yytext_ptr + yy_amount_of_matched_text; |
| 1032 | |
| 1033 | yy_current_state = yy_get_previous_state(); |
| 1034 | |
| 1035 | yy_cp = yy_c_buf_p; |
| 1036 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
| 1037 | goto yy_match; |
| 1038 | |
| 1039 | case EOB_ACT_LAST_MATCH: |
| 1040 | yy_c_buf_p = |
| 1041 | &yy_current_buffer->yy_ch_buf[yy_n_chars]; |
| 1042 | |
| 1043 | yy_current_state = yy_get_previous_state(); |
| 1044 | |
| 1045 | yy_cp = yy_c_buf_p; |
| 1046 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
| 1047 | goto yy_find_action; |
| 1048 | } |
| 1049 | break; |
| 1050 | } |
| 1051 | |
| 1052 | default: |
| 1053 | YY_FATAL_ERROR( |
| 1054 | "fatal flex scanner internal error--no action found" ); |
| 1055 | } /* end of action switch */ |
| 1056 | } /* end of scanning one token */ |
| 1057 | } /* end of yylex */ |
| 1058 | |
| 1059 | |
| 1060 | /* yy_get_next_buffer - try to read in a new buffer |
| 1061 | * |
| 1062 | * Returns a code representing an action: |
| 1063 | * EOB_ACT_LAST_MATCH - |
| 1064 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
| 1065 | * EOB_ACT_END_OF_FILE - end of file |
| 1066 | */ |
| 1067 | |
| 1068 | static int yy_get_next_buffer() |
| 1069 | { |
| 1070 | register char *dest = yy_current_buffer->yy_ch_buf; |
| 1071 | register char *source = yytext_ptr; |
| 1072 | register int number_to_move, i; |
| 1073 | int ret_val; |
| 1074 | |
| 1075 | if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) |
| 1076 | YY_FATAL_ERROR( |
| 1077 | "fatal flex scanner internal error--end of buffer missed" ); |
| 1078 | |
| 1079 | if ( yy_current_buffer->yy_fill_buffer == 0 ) |
| 1080 | { /* Don't try to fill the buffer, so this is an EOF. */ |
| 1081 | if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) |
| 1082 | { |
| 1083 | /* We matched a single character, the EOB, so |
| 1084 | * treat this as a final EOF. |
| 1085 | */ |
| 1086 | return EOB_ACT_END_OF_FILE; |
| 1087 | } |
| 1088 | |
| 1089 | else |
| 1090 | { |
| 1091 | /* We matched some text prior to the EOB, first |
| 1092 | * process it. |
| 1093 | */ |
| 1094 | return EOB_ACT_LAST_MATCH; |
| 1095 | } |
| 1096 | } |
| 1097 | |
| 1098 | /* Try to read more data. */ |
| 1099 | |
| 1100 | /* First move last chars to start of buffer. */ |
| 1101 | number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; |
| 1102 | |
| 1103 | for ( i = 0; i < number_to_move; ++i ) |
| 1104 | *(dest++) = *(source++); |
| 1105 | |
| 1106 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
| 1107 | /* don't do the read, it's not guaranteed to return an EOF, |
| 1108 | * just force an EOF |
| 1109 | */ |
| 1110 | yy_current_buffer->yy_n_chars = yy_n_chars = 0; |
| 1111 | |
| 1112 | else |
| 1113 | { |
| 1114 | int num_to_read = |
| 1115 | yy_current_buffer->yy_buf_size - number_to_move - 1; |
| 1116 | |
| 1117 | while ( num_to_read <= 0 ) |
| 1118 | { /* Not enough room in the buffer - grow it. */ |
| 1119 | #ifdef YY_USES_REJECT |
| 1120 | YY_FATAL_ERROR( |
| 1121 | "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); |
| 1122 | #else |
| 1123 | |
| 1124 | /* just a shorter name for the current buffer */ |
| 1125 | YY_BUFFER_STATE b = yy_current_buffer; |
| 1126 | |
| 1127 | int yy_c_buf_p_offset = |
| 1128 | (int) (yy_c_buf_p - b->yy_ch_buf); |
| 1129 | |
| 1130 | if ( b->yy_is_our_buffer ) |
| 1131 | { |
| 1132 | int new_size = b->yy_buf_size * 2; |
| 1133 | |
| 1134 | if ( new_size <= 0 ) |
| 1135 | b->yy_buf_size += b->yy_buf_size / 8; |
| 1136 | else |
| 1137 | b->yy_buf_size *= 2; |
| 1138 | |
| 1139 | b->yy_ch_buf = (char *) |
| 1140 | /* Include room in for 2 EOB chars. */ |
| 1141 | yy_flex_realloc( (void *) b->yy_ch_buf, |
| 1142 | b->yy_buf_size + 2 ); |
| 1143 | } |
| 1144 | else |
| 1145 | /* Can't grow it, we don't own it. */ |
| 1146 | b->yy_ch_buf = 0; |
| 1147 | |
| 1148 | if ( ! b->yy_ch_buf ) |
| 1149 | YY_FATAL_ERROR( |
| 1150 | "fatal error - scanner input buffer overflow" ); |
| 1151 | |
| 1152 | yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
| 1153 | |
| 1154 | num_to_read = yy_current_buffer->yy_buf_size - |
| 1155 | number_to_move - 1; |
| 1156 | #endif |
| 1157 | } |
| 1158 | |
| 1159 | if ( num_to_read > YY_READ_BUF_SIZE ) |
| 1160 | num_to_read = YY_READ_BUF_SIZE; |
| 1161 | |
| 1162 | /* Read in more data. */ |
| 1163 | YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), |
| 1164 | yy_n_chars, num_to_read ); |
| 1165 | |
| 1166 | yy_current_buffer->yy_n_chars = yy_n_chars; |
| 1167 | } |
| 1168 | |
| 1169 | if ( yy_n_chars == 0 ) |
| 1170 | { |
| 1171 | if ( number_to_move == YY_MORE_ADJ ) |
| 1172 | { |
| 1173 | ret_val = EOB_ACT_END_OF_FILE; |
| 1174 | yyrestart( yyin ); |
| 1175 | } |
| 1176 | |
| 1177 | else |
| 1178 | { |
| 1179 | ret_val = EOB_ACT_LAST_MATCH; |
| 1180 | yy_current_buffer->yy_buffer_status = |
| 1181 | YY_BUFFER_EOF_PENDING; |
| 1182 | } |
| 1183 | } |
| 1184 | |
| 1185 | else |
| 1186 | ret_val = EOB_ACT_CONTINUE_SCAN; |
| 1187 | |
| 1188 | yy_n_chars += number_to_move; |
| 1189 | yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
| 1190 | yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; |
| 1191 | |
| 1192 | yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; |
| 1193 | |
| 1194 | return ret_val; |
| 1195 | } |
| 1196 | |
| 1197 | |
| 1198 | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
| 1199 | |
| 1200 | static yy_state_type yy_get_previous_state() |
| 1201 | { |
| 1202 | register yy_state_type yy_current_state; |
| 1203 | register char *yy_cp; |
| 1204 | |
| 1205 | yy_current_state = yy_start; |
| 1206 | yy_state_ptr = yy_state_buf; |
| 1207 | *yy_state_ptr++ = yy_current_state; |
| 1208 | |
| 1209 | for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) |
| 1210 | { |
| 1211 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
| 1212 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
| 1213 | { |
| 1214 | yy_current_state = (int) yy_def[yy_current_state]; |
| 1215 | if ( yy_current_state >= 98 ) |
| 1216 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 1217 | } |
| 1218 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
| 1219 | *yy_state_ptr++ = yy_current_state; |
| 1220 | } |
| 1221 | |
| 1222 | return yy_current_state; |
| 1223 | } |
| 1224 | |
| 1225 | |
| 1226 | /* yy_try_NUL_trans - try to make a transition on the NUL character |
| 1227 | * |
| 1228 | * synopsis |
| 1229 | * next_state = yy_try_NUL_trans( current_state ); |
| 1230 | */ |
| 1231 | |
| 1232 | #ifdef YY_USE_PROTOS |
| 1233 | static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) |
| 1234 | #else |
| 1235 | static yy_state_type yy_try_NUL_trans( yy_current_state ) |
| 1236 | yy_state_type yy_current_state; |
| 1237 | #endif |
| 1238 | { |
| 1239 | register int yy_is_jam; |
| 1240 | |
| 1241 | register YY_CHAR yy_c = 1; |
| 1242 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
| 1243 | { |
| 1244 | yy_current_state = (int) yy_def[yy_current_state]; |
| 1245 | if ( yy_current_state >= 98 ) |
| 1246 | yy_c = yy_meta[(unsigned int) yy_c]; |
| 1247 | } |
| 1248 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
| 1249 | yy_is_jam = (yy_current_state == 97); |
| 1250 | if ( ! yy_is_jam ) |
| 1251 | *yy_state_ptr++ = yy_current_state; |
| 1252 | |
| 1253 | return yy_is_jam ? 0 : yy_current_state; |
| 1254 | } |
| 1255 | |
| 1256 | |
| 1257 | #ifndef YY_NO_UNPUT |
| 1258 | #ifdef YY_USE_PROTOS |
| 1259 | static void yyunput( int c, register char *yy_bp ) |
| 1260 | #else |
| 1261 | static void yyunput( c, yy_bp ) |
| 1262 | int c; |
| 1263 | register char *yy_bp; |
| 1264 | #endif |
| 1265 | { |
| 1266 | register char *yy_cp = yy_c_buf_p; |
| 1267 | |
| 1268 | /* undo effects of setting up yytext */ |
| 1269 | *yy_cp = yy_hold_char; |
| 1270 | |
| 1271 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
| 1272 | { /* need to shift things up to make room */ |
| 1273 | /* +2 for EOB chars. */ |
| 1274 | register int number_to_move = yy_n_chars + 2; |
| 1275 | register char *dest = &yy_current_buffer->yy_ch_buf[ |
| 1276 | yy_current_buffer->yy_buf_size + 2]; |
| 1277 | register char *source = |
| 1278 | &yy_current_buffer->yy_ch_buf[number_to_move]; |
| 1279 | |
| 1280 | while ( source > yy_current_buffer->yy_ch_buf ) |
| 1281 | *--dest = *--source; |
| 1282 | |
| 1283 | yy_cp += (int) (dest - source); |
| 1284 | yy_bp += (int) (dest - source); |
| 1285 | yy_current_buffer->yy_n_chars = |
| 1286 | yy_n_chars = yy_current_buffer->yy_buf_size; |
| 1287 | |
| 1288 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
| 1289 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); |
| 1290 | } |
| 1291 | |
| 1292 | *--yy_cp = (char) c; |
| 1293 | |
| 1294 | if ( c == '\n' ) |
| 1295 | --yylineno; |
| 1296 | |
| 1297 | yytext_ptr = yy_bp; |
| 1298 | yy_hold_char = *yy_cp; |
| 1299 | yy_c_buf_p = yy_cp; |
| 1300 | } |
| 1301 | #endif /* ifndef YY_NO_UNPUT */ |
| 1302 | |
| 1303 | |
| 1304 | #ifdef __cplusplus |
| 1305 | static int yyinput() |
| 1306 | #else |
| 1307 | static int input() |
| 1308 | #endif |
| 1309 | { |
| 1310 | int c; |
| 1311 | |
| 1312 | *yy_c_buf_p = yy_hold_char; |
| 1313 | |
| 1314 | if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) |
| 1315 | { |
| 1316 | /* yy_c_buf_p now points to the character we want to return. |
| 1317 | * If this occurs *before* the EOB characters, then it's a |
| 1318 | * valid NUL; if not, then we've hit the end of the buffer. |
| 1319 | */ |
| 1320 | if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
| 1321 | /* This was really a NUL. */ |
| 1322 | *yy_c_buf_p = '\0'; |
| 1323 | |
| 1324 | else |
| 1325 | { /* need more input */ |
| 1326 | int offset = yy_c_buf_p - yytext_ptr; |
| 1327 | ++yy_c_buf_p; |
| 1328 | |
| 1329 | switch ( yy_get_next_buffer() ) |
| 1330 | { |
| 1331 | case EOB_ACT_LAST_MATCH: |
| 1332 | /* This happens because yy_g_n_b() |
| 1333 | * sees that we've accumulated a |
| 1334 | * token and flags that we need to |
| 1335 | * try matching the token before |
| 1336 | * proceeding. But for input(), |
| 1337 | * there's no matching to consider. |
| 1338 | * So convert the EOB_ACT_LAST_MATCH |
| 1339 | * to EOB_ACT_END_OF_FILE. |
| 1340 | */ |
| 1341 | |
| 1342 | /* Reset buffer status. */ |
| 1343 | yyrestart( yyin ); |
| 1344 | |
| 1345 | /* fall through */ |
| 1346 | |
| 1347 | case EOB_ACT_END_OF_FILE: |
| 1348 | { |
| 1349 | if ( yywrap() ) |
| 1350 | return EOF; |
| 1351 | |
| 1352 | if ( ! yy_did_buffer_switch_on_eof ) |
| 1353 | YY_NEW_FILE; |
| 1354 | #ifdef __cplusplus |
| 1355 | return yyinput(); |
| 1356 | #else |
| 1357 | return input(); |
| 1358 | #endif |
| 1359 | } |
| 1360 | |
| 1361 | case EOB_ACT_CONTINUE_SCAN: |
| 1362 | yy_c_buf_p = yytext_ptr + offset; |
| 1363 | break; |
| 1364 | } |
| 1365 | } |
| 1366 | } |
| 1367 | |
| 1368 | c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ |
| 1369 | *yy_c_buf_p = '\0'; /* preserve yytext */ |
| 1370 | yy_hold_char = *++yy_c_buf_p; |
| 1371 | |
| 1372 | if ( c == '\n' ) |
| 1373 | ++yylineno; |
| 1374 | |
| 1375 | return c; |
| 1376 | } |
| 1377 | |
| 1378 | |
| 1379 | #ifdef YY_USE_PROTOS |
| 1380 | void yyrestart( FILE *input_file ) |
| 1381 | #else |
| 1382 | void yyrestart( input_file ) |
| 1383 | FILE *input_file; |
| 1384 | #endif |
| 1385 | { |
| 1386 | if ( ! yy_current_buffer ) |
| 1387 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); |
| 1388 | |
| 1389 | yy_init_buffer( yy_current_buffer, input_file ); |
| 1390 | yy_load_buffer_state(); |
| 1391 | } |
| 1392 | |
| 1393 | |
| 1394 | #ifdef YY_USE_PROTOS |
| 1395 | void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) |
| 1396 | #else |
| 1397 | void yy_switch_to_buffer( new_buffer ) |
| 1398 | YY_BUFFER_STATE new_buffer; |
| 1399 | #endif |
| 1400 | { |
| 1401 | if ( yy_current_buffer == new_buffer ) |
| 1402 | return; |
| 1403 | |
| 1404 | if ( yy_current_buffer ) |
| 1405 | { |
| 1406 | /* Flush out information for old buffer. */ |
| 1407 | *yy_c_buf_p = yy_hold_char; |
| 1408 | yy_current_buffer->yy_buf_pos = yy_c_buf_p; |
| 1409 | yy_current_buffer->yy_n_chars = yy_n_chars; |
| 1410 | } |
| 1411 | |
| 1412 | yy_current_buffer = new_buffer; |
| 1413 | yy_load_buffer_state(); |
| 1414 | |
| 1415 | /* We don't actually know whether we did this switch during |
| 1416 | * EOF (yywrap()) processing, but the only time this flag |
| 1417 | * is looked at is after yywrap() is called, so it's safe |
| 1418 | * to go ahead and always set it. |
| 1419 | */ |
| 1420 | yy_did_buffer_switch_on_eof = 1; |
| 1421 | } |
| 1422 | |
| 1423 | |
| 1424 | #ifdef YY_USE_PROTOS |
| 1425 | void yy_load_buffer_state( void ) |
| 1426 | #else |
| 1427 | void yy_load_buffer_state() |
| 1428 | #endif |
| 1429 | { |
| 1430 | yy_n_chars = yy_current_buffer->yy_n_chars; |
| 1431 | yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; |
| 1432 | yyin = yy_current_buffer->yy_input_file; |
| 1433 | yy_hold_char = *yy_c_buf_p; |
| 1434 | } |
| 1435 | |
| 1436 | |
| 1437 | #ifdef YY_USE_PROTOS |
| 1438 | YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) |
| 1439 | #else |
| 1440 | YY_BUFFER_STATE yy_create_buffer( file, size ) |
| 1441 | FILE *file; |
| 1442 | int size; |
| 1443 | #endif |
| 1444 | { |
| 1445 | YY_BUFFER_STATE b; |
| 1446 | |
| 1447 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
| 1448 | if ( ! b ) |
| 1449 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
| 1450 | |
| 1451 | b->yy_buf_size = size; |
| 1452 | |
| 1453 | /* yy_ch_buf has to be 2 characters longer than the size given because |
| 1454 | * we need to put in 2 end-of-buffer characters. |
| 1455 | */ |
| 1456 | b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); |
| 1457 | if ( ! b->yy_ch_buf ) |
| 1458 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
| 1459 | |
| 1460 | b->yy_is_our_buffer = 1; |
| 1461 | |
| 1462 | yy_init_buffer( b, file ); |
| 1463 | |
| 1464 | return b; |
| 1465 | } |
| 1466 | |
| 1467 | |
| 1468 | #ifdef YY_USE_PROTOS |
| 1469 | void yy_delete_buffer( YY_BUFFER_STATE b ) |
| 1470 | #else |
| 1471 | void yy_delete_buffer( b ) |
| 1472 | YY_BUFFER_STATE b; |
| 1473 | #endif |
| 1474 | { |
| 1475 | if ( ! b ) |
| 1476 | return; |
| 1477 | |
| 1478 | if ( b == yy_current_buffer ) |
| 1479 | yy_current_buffer = (YY_BUFFER_STATE) 0; |
| 1480 | |
| 1481 | if ( b->yy_is_our_buffer ) |
| 1482 | yy_flex_free( (void *) b->yy_ch_buf ); |
| 1483 | |
| 1484 | yy_flex_free( (void *) b ); |
| 1485 | } |
| 1486 | |
| 1487 | |
| 1488 | #ifndef YY_ALWAYS_INTERACTIVE |
| 1489 | #ifndef YY_NEVER_INTERACTIVE |
| 1490 | extern int isatty YY_PROTO(( int )); |
| 1491 | #endif |
| 1492 | #endif |
| 1493 | |
| 1494 | #ifdef YY_USE_PROTOS |
| 1495 | void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) |
| 1496 | #else |
| 1497 | void yy_init_buffer( b, file ) |
| 1498 | YY_BUFFER_STATE b; |
| 1499 | FILE *file; |
| 1500 | #endif |
| 1501 | |
| 1502 | |
| 1503 | { |
| 1504 | yy_flush_buffer( b ); |
| 1505 | |
| 1506 | b->yy_input_file = file; |
| 1507 | b->yy_fill_buffer = 1; |
| 1508 | |
| 1509 | #if YY_ALWAYS_INTERACTIVE |
| 1510 | b->yy_is_interactive = 1; |
| 1511 | #else |
| 1512 | #if YY_NEVER_INTERACTIVE |
| 1513 | b->yy_is_interactive = 0; |
| 1514 | #else |
| 1515 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; |
| 1516 | #endif |
| 1517 | #endif |
| 1518 | } |
| 1519 | |
| 1520 | |
| 1521 | #ifdef YY_USE_PROTOS |
| 1522 | void yy_flush_buffer( YY_BUFFER_STATE b ) |
| 1523 | #else |
| 1524 | void yy_flush_buffer( b ) |
| 1525 | YY_BUFFER_STATE b; |
| 1526 | #endif |
| 1527 | |
| 1528 | { |
| 1529 | if ( ! b ) |
| 1530 | return; |
| 1531 | |
| 1532 | b->yy_n_chars = 0; |
| 1533 | |
| 1534 | /* We always need two end-of-buffer characters. The first causes |
| 1535 | * a transition to the end-of-buffer state. The second causes |
| 1536 | * a jam in that state. |
| 1537 | */ |
| 1538 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
| 1539 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
| 1540 | |
| 1541 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
| 1542 | |
| 1543 | b->yy_at_bol = 1; |
| 1544 | b->yy_buffer_status = YY_BUFFER_NEW; |
| 1545 | |
| 1546 | if ( b == yy_current_buffer ) |
| 1547 | yy_load_buffer_state(); |
| 1548 | } |
| 1549 | |
| 1550 | |
| 1551 | #ifndef YY_NO_SCAN_BUFFER |
| 1552 | #ifdef YY_USE_PROTOS |
| 1553 | YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) |
| 1554 | #else |
| 1555 | YY_BUFFER_STATE yy_scan_buffer( base, size ) |
| 1556 | char *base; |
| 1557 | yy_size_t size; |
| 1558 | #endif |
| 1559 | { |
| 1560 | YY_BUFFER_STATE b; |
| 1561 | |
| 1562 | if ( size < 2 || |
| 1563 | base[size-2] != YY_END_OF_BUFFER_CHAR || |
| 1564 | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
| 1565 | /* They forgot to leave room for the EOB's. */ |
| 1566 | return 0; |
| 1567 | |
| 1568 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
| 1569 | if ( ! b ) |
| 1570 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); |
| 1571 | |
| 1572 | b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ |
| 1573 | b->yy_buf_pos = b->yy_ch_buf = base; |
| 1574 | b->yy_is_our_buffer = 0; |
| 1575 | b->yy_input_file = 0; |
| 1576 | b->yy_n_chars = b->yy_buf_size; |
| 1577 | b->yy_is_interactive = 0; |
| 1578 | b->yy_at_bol = 1; |
| 1579 | b->yy_fill_buffer = 0; |
| 1580 | b->yy_buffer_status = YY_BUFFER_NEW; |
| 1581 | |
| 1582 | yy_switch_to_buffer( b ); |
| 1583 | |
| 1584 | return b; |
| 1585 | } |
| 1586 | #endif |
| 1587 | |
| 1588 | |
| 1589 | #ifndef YY_NO_SCAN_STRING |
| 1590 | #ifdef YY_USE_PROTOS |
| 1591 | YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) |
| 1592 | #else |
| 1593 | YY_BUFFER_STATE yy_scan_string( yy_str ) |
| 1594 | yyconst char *yy_str; |
| 1595 | #endif |
| 1596 | { |
| 1597 | int len; |
| 1598 | for ( len = 0; yy_str[len]; ++len ) |
| 1599 | ; |
| 1600 | |
| 1601 | return yy_scan_bytes( yy_str, len ); |
| 1602 | } |
| 1603 | #endif |
| 1604 | |
| 1605 | |
| 1606 | #ifndef YY_NO_SCAN_BYTES |
| 1607 | #ifdef YY_USE_PROTOS |
| 1608 | YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) |
| 1609 | #else |
| 1610 | YY_BUFFER_STATE yy_scan_bytes( bytes, len ) |
| 1611 | yyconst char *bytes; |
| 1612 | int len; |
| 1613 | #endif |
| 1614 | { |
| 1615 | YY_BUFFER_STATE b; |
| 1616 | char *buf; |
| 1617 | yy_size_t n; |
| 1618 | int i; |
| 1619 | |
| 1620 | /* Get memory for full buffer, including space for trailing EOB's. */ |
| 1621 | n = len + 2; |
| 1622 | buf = (char *) yy_flex_alloc( n ); |
| 1623 | if ( ! buf ) |
| 1624 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
| 1625 | |
| 1626 | for ( i = 0; i < len; ++i ) |
| 1627 | buf[i] = bytes[i]; |
| 1628 | |
| 1629 | buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; |
| 1630 | |
| 1631 | b = yy_scan_buffer( buf, n ); |
| 1632 | if ( ! b ) |
| 1633 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); |
| 1634 | |
| 1635 | /* It's okay to grow etc. this buffer, and we should throw it |
| 1636 | * away when we're done. |
| 1637 | */ |
| 1638 | b->yy_is_our_buffer = 1; |
| 1639 | |
| 1640 | return b; |
| 1641 | } |
| 1642 | #endif |
| 1643 | |
| 1644 | |
| 1645 | #ifndef YY_NO_PUSH_STATE |
| 1646 | #ifdef YY_USE_PROTOS |
| 1647 | static void yy_push_state( int new_state ) |
| 1648 | #else |
| 1649 | static void yy_push_state( new_state ) |
| 1650 | int new_state; |
| 1651 | #endif |
| 1652 | { |
| 1653 | if ( yy_start_stack_ptr >= yy_start_stack_depth ) |
| 1654 | { |
| 1655 | yy_size_t new_size; |
| 1656 | |
| 1657 | yy_start_stack_depth += YY_START_STACK_INCR; |
| 1658 | new_size = yy_start_stack_depth * sizeof( int ); |
| 1659 | |
| 1660 | if ( ! yy_start_stack ) |
| 1661 | yy_start_stack = (int *) yy_flex_alloc( new_size ); |
| 1662 | |
| 1663 | else |
| 1664 | yy_start_stack = (int *) yy_flex_realloc( |
| 1665 | (void *) yy_start_stack, new_size ); |
| 1666 | |
| 1667 | if ( ! yy_start_stack ) |
| 1668 | YY_FATAL_ERROR( |
| 1669 | "out of memory expanding start-condition stack" ); |
| 1670 | } |
| 1671 | |
| 1672 | yy_start_stack[yy_start_stack_ptr++] = YY_START; |
| 1673 | |
| 1674 | BEGIN(new_state); |
| 1675 | } |
| 1676 | #endif |
| 1677 | |
| 1678 | |
| 1679 | #ifndef YY_NO_POP_STATE |
| 1680 | static void yy_pop_state() |
| 1681 | { |
| 1682 | if ( --yy_start_stack_ptr < 0 ) |
| 1683 | YY_FATAL_ERROR( "start-condition stack underflow" ); |
| 1684 | |
| 1685 | BEGIN(yy_start_stack[yy_start_stack_ptr]); |
| 1686 | } |
| 1687 | #endif |
| 1688 | |
| 1689 | |
| 1690 | #ifndef YY_NO_TOP_STATE |
| 1691 | static int yy_top_state() |
| 1692 | { |
| 1693 | return yy_start_stack[yy_start_stack_ptr - 1]; |
| 1694 | } |
| 1695 | #endif |
| 1696 | |
| 1697 | #ifndef YY_EXIT_FAILURE |
| 1698 | #define YY_EXIT_FAILURE 2 |
| 1699 | #endif |
| 1700 | |
| 1701 | #ifdef YY_USE_PROTOS |
| 1702 | static void yy_fatal_error( yyconst char msg[] ) |
| 1703 | #else |
| 1704 | static void yy_fatal_error( msg ) |
| 1705 | char msg[]; |
| 1706 | #endif |
| 1707 | { |
| 1708 | (void) fprintf( stderr, "%s\n", msg ); |
| 1709 | // exit( YY_EXIT_FAILURE ); |
| 1710 | } |
| 1711 | |
| 1712 | |
| 1713 | |
| 1714 | /* Redefine yyless() so it works in section 3 code. */ |
| 1715 | |
| 1716 | #undef yyless |
| 1717 | #define yyless(n) \ |
| 1718 | do \ |
| 1719 | { \ |
| 1720 | /* Undo effects of setting up yytext. */ \ |
| 1721 | yytext[yyleng] = yy_hold_char; \ |
| 1722 | yy_c_buf_p = yytext + n; \ |
| 1723 | yy_hold_char = *yy_c_buf_p; \ |
| 1724 | *yy_c_buf_p = '\0'; \ |
| 1725 | yyleng = n; \ |
| 1726 | } \ |
| 1727 | while ( 0 ) |
| 1728 | |
| 1729 | |
| 1730 | /* Internal utility routines. */ |
| 1731 | |
| 1732 | #ifndef yytext_ptr |
| 1733 | #ifdef YY_USE_PROTOS |
| 1734 | static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) |
| 1735 | #else |
| 1736 | static void yy_flex_strncpy( s1, s2, n ) |
| 1737 | char *s1; |
| 1738 | yyconst char *s2; |
| 1739 | int n; |
| 1740 | #endif |
| 1741 | { |
| 1742 | register int i; |
| 1743 | for ( i = 0; i < n; ++i ) |
| 1744 | s1[i] = s2[i]; |
| 1745 | } |
| 1746 | #endif |
| 1747 | |
| 1748 | #ifdef YY_NEED_STRLEN |
| 1749 | #ifdef YY_USE_PROTOS |
| 1750 | static int yy_flex_strlen( yyconst char *s ) |
| 1751 | #else |
| 1752 | static int yy_flex_strlen( s ) |
| 1753 | yyconst char *s; |
| 1754 | #endif |
| 1755 | { |
| 1756 | register int n; |
| 1757 | for ( n = 0; s[n]; ++n ) |
| 1758 | ; |
| 1759 | |
| 1760 | return n; |
| 1761 | } |
| 1762 | #endif |
| 1763 | |
| 1764 | |
| 1765 | #ifdef YY_USE_PROTOS |
| 1766 | static void *yy_flex_alloc( yy_size_t size ) |
| 1767 | #else |
| 1768 | static void *yy_flex_alloc( size ) |
| 1769 | yy_size_t size; |
| 1770 | #endif |
| 1771 | { |
| 1772 | return (void *) malloc( size ); |
| 1773 | } |
| 1774 | |
| 1775 | #ifdef YY_USE_PROTOS |
| 1776 | static void *yy_flex_realloc( void *ptr, yy_size_t size ) |
| 1777 | #else |
| 1778 | static void *yy_flex_realloc( ptr, size ) |
| 1779 | void *ptr; |
| 1780 | yy_size_t size; |
| 1781 | #endif |
| 1782 | { |
| 1783 | /* The cast to (char *) in the following accommodates both |
| 1784 | * implementations that use char* generic pointers, and those |
| 1785 | * that use void* generic pointers. It works with the latter |
| 1786 | * because both ANSI C and C++ allow castless assignment from |
| 1787 | * any pointer type to void*, and deal with argument conversions |
| 1788 | * as though doing an assignment. |
| 1789 | */ |
| 1790 | return (void *) realloc( (char *) ptr, size ); |
| 1791 | } |
| 1792 | |
| 1793 | #ifdef YY_USE_PROTOS |
| 1794 | static void yy_flex_free( void *ptr ) |
| 1795 | #else |
| 1796 | static void yy_flex_free( ptr ) |
| 1797 | void *ptr; |
| 1798 | #endif |
| 1799 | { |
| 1800 | free( ptr ); |
| 1801 | } |
| 1802 | |
| 1803 | #if YY_MAIN |
| 1804 | int main() |
| 1805 | { |
| 1806 | yylex(); |
| 1807 | return 0; |
| 1808 | } |
| 1809 | #endif |
| 1810 | |
| 1811 | |
| 1812 | int yywrap() { |
| 1813 | return 1; |
| 1814 | } |
| 1815 | |
| 1816 | int crawlerScan( const char* filePath ) |
| 1817 | { |
| 1818 | BEGIN INITIAL; |
| 1819 | fc_lineno = 1; |
| 1820 | |
| 1821 | wxFileName fn(filePath); |
| 1822 | if ( fn.IsRelative() ) { |
| 1823 | fn.MakeAbsolute(); |
| 1824 | } |
| 1825 | |
| 1826 | FILE* fp = fopen(fn.GetFullPath().mb_str(wxConvUTF8).data(), "r"); |
| 1827 | if ( fp == NULL ) { |
| 1828 | //printf("%s\n", strerror(errno)); |
| 1829 | // failed to open input file... |
| 1830 | return -1; |
| 1831 | } |
| 1832 | |
| 1833 | // set the initial search directory |
| 1834 | fcFileOpener::Get()->SetCwd( fn.GetPath() ); |
| 1835 | |
| 1836 | yy_switch_to_buffer( yy_create_buffer(fp, YY_BUF_SIZE) ); |
| 1837 | fc_in = fp; |
| 1838 | int rc = fc_lex(); |
| 1839 | yy_delete_buffer( YY_CURRENT_BUFFER ); |
| 1840 | |
| 1841 | return rc; |
| 1842 | } |
| 1843 |