libnl 3.2.7
|
00001 #line 2 "route/cls/ematch_grammar.c" 00002 00003 #line 4 "route/cls/ematch_grammar.c" 00004 00005 #define YY_INT_ALIGNED short int 00006 00007 /* A lexical scanner generated by flex */ 00008 00009 #define FLEX_SCANNER 00010 #define YY_FLEX_MAJOR_VERSION 2 00011 #define YY_FLEX_MINOR_VERSION 5 00012 #define YY_FLEX_SUBMINOR_VERSION 35 00013 #if YY_FLEX_SUBMINOR_VERSION > 0 00014 #define FLEX_BETA 00015 #endif 00016 00017 /* First, we deal with platform-specific or compiler-specific issues. */ 00018 00019 /* begin standard C headers. */ 00020 #include <stdio.h> 00021 #include <string.h> 00022 #include <errno.h> 00023 #include <stdlib.h> 00024 00025 /* end standard C headers. */ 00026 00027 /* flex integer type definitions */ 00028 00029 #ifndef FLEXINT_H 00030 #define FLEXINT_H 00031 00032 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 00033 00034 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 00035 00036 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 00037 * if you want the limit (max/min) macros for int types. 00038 */ 00039 #ifndef __STDC_LIMIT_MACROS 00040 #define __STDC_LIMIT_MACROS 1 00041 #endif 00042 00043 #include <inttypes.h> 00044 typedef int8_t flex_int8_t; 00045 typedef uint8_t flex_uint8_t; 00046 typedef int16_t flex_int16_t; 00047 typedef uint16_t flex_uint16_t; 00048 typedef int32_t flex_int32_t; 00049 typedef uint32_t flex_uint32_t; 00050 #else 00051 typedef signed char flex_int8_t; 00052 typedef short int flex_int16_t; 00053 typedef int flex_int32_t; 00054 typedef unsigned char flex_uint8_t; 00055 typedef unsigned short int flex_uint16_t; 00056 typedef unsigned int flex_uint32_t; 00057 #endif /* ! C99 */ 00058 00059 /* Limits of integral types. */ 00060 #ifndef INT8_MIN 00061 #define INT8_MIN (-128) 00062 #endif 00063 #ifndef INT16_MIN 00064 #define INT16_MIN (-32767-1) 00065 #endif 00066 #ifndef INT32_MIN 00067 #define INT32_MIN (-2147483647-1) 00068 #endif 00069 #ifndef INT8_MAX 00070 #define INT8_MAX (127) 00071 #endif 00072 #ifndef INT16_MAX 00073 #define INT16_MAX (32767) 00074 #endif 00075 #ifndef INT32_MAX 00076 #define INT32_MAX (2147483647) 00077 #endif 00078 #ifndef UINT8_MAX 00079 #define UINT8_MAX (255U) 00080 #endif 00081 #ifndef UINT16_MAX 00082 #define UINT16_MAX (65535U) 00083 #endif 00084 #ifndef UINT32_MAX 00085 #define UINT32_MAX (4294967295U) 00086 #endif 00087 00088 #endif /* ! FLEXINT_H */ 00089 00090 #ifdef __cplusplus 00091 00092 /* The "const" storage-class-modifier is valid. */ 00093 #define YY_USE_CONST 00094 00095 #else /* ! __cplusplus */ 00096 00097 /* C99 requires __STDC__ to be defined as 1. */ 00098 #if defined (__STDC__) 00099 00100 #define YY_USE_CONST 00101 00102 #endif /* defined (__STDC__) */ 00103 #endif /* ! __cplusplus */ 00104 00105 #ifdef YY_USE_CONST 00106 #define yyconst const 00107 #else 00108 #define yyconst 00109 #endif 00110 00111 /* Returned upon end-of-file. */ 00112 #define YY_NULL 0 00113 00114 /* Promotes a possibly negative, possibly signed char to an unsigned 00115 * integer for use as an array index. If the signed char is negative, 00116 * we want to instead treat it as an 8-bit unsigned char, hence the 00117 * double cast. 00118 */ 00119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 00120 00121 /* An opaque pointer. */ 00122 #ifndef YY_TYPEDEF_YY_SCANNER_T 00123 #define YY_TYPEDEF_YY_SCANNER_T 00124 typedef void* yyscan_t; 00125 #endif 00126 00127 /* For convenience, these vars (plus the bison vars far below) 00128 are macros in the reentrant scanner. */ 00129 #define yyin yyg->yyin_r 00130 #define yyout yyg->yyout_r 00131 #define yyextra yyg->yyextra_r 00132 #define yyleng yyg->yyleng_r 00133 #define yytext yyg->yytext_r 00134 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) 00135 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) 00136 #define yy_flex_debug yyg->yy_flex_debug_r 00137 00138 /* Enter a start condition. This macro really ought to take a parameter, 00139 * but we do it the disgusting crufty way forced on us by the ()-less 00140 * definition of BEGIN. 00141 */ 00142 #define BEGIN yyg->yy_start = 1 + 2 * 00143 00144 /* Translate the current start state into a value that can be later handed 00145 * to BEGIN to return to the state. The YYSTATE alias is for lex 00146 * compatibility. 00147 */ 00148 #define YY_START ((yyg->yy_start - 1) / 2) 00149 #define YYSTATE YY_START 00150 00151 /* Action number for EOF rule of a given start state. */ 00152 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 00153 00154 /* Special action meaning "start processing a new file". */ 00155 #define YY_NEW_FILE ematch_restart(yyin ,yyscanner ) 00156 00157 #define YY_END_OF_BUFFER_CHAR 0 00158 00159 /* Size of default input buffer. */ 00160 #ifndef YY_BUF_SIZE 00161 #define YY_BUF_SIZE 16384 00162 #endif 00163 00164 /* The state buf must be large enough to hold one state per character in the main buffer. 00165 */ 00166 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 00167 00168 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 00169 #define YY_TYPEDEF_YY_BUFFER_STATE 00170 typedef struct yy_buffer_state *YY_BUFFER_STATE; 00171 #endif 00172 00173 #define EOB_ACT_CONTINUE_SCAN 0 00174 #define EOB_ACT_END_OF_FILE 1 00175 #define EOB_ACT_LAST_MATCH 2 00176 00177 #define YY_LESS_LINENO(n) 00178 00179 /* Return all but the first "n" matched characters back to the input stream. */ 00180 #define yyless(n) \ 00181 do \ 00182 { \ 00183 /* Undo effects of setting up yytext. */ \ 00184 int yyless_macro_arg = (n); \ 00185 YY_LESS_LINENO(yyless_macro_arg);\ 00186 *yy_cp = yyg->yy_hold_char; \ 00187 YY_RESTORE_YY_MORE_OFFSET \ 00188 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 00189 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 00190 } \ 00191 while ( 0 ) 00192 00193 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) 00194 00195 #ifndef YY_TYPEDEF_YY_SIZE_T 00196 #define YY_TYPEDEF_YY_SIZE_T 00197 typedef size_t yy_size_t; 00198 #endif 00199 00200 #ifndef YY_STRUCT_YY_BUFFER_STATE 00201 #define YY_STRUCT_YY_BUFFER_STATE 00202 struct yy_buffer_state 00203 { 00204 FILE *yy_input_file; 00205 00206 char *yy_ch_buf; /* input buffer */ 00207 char *yy_buf_pos; /* current position in input buffer */ 00208 00209 /* Size of input buffer in bytes, not including room for EOB 00210 * characters. 00211 */ 00212 yy_size_t yy_buf_size; 00213 00214 /* Number of characters read into yy_ch_buf, not including EOB 00215 * characters. 00216 */ 00217 int yy_n_chars; 00218 00219 /* Whether we "own" the buffer - i.e., we know we created it, 00220 * and can realloc() it to grow it, and should free() it to 00221 * delete it. 00222 */ 00223 int yy_is_our_buffer; 00224 00225 /* Whether this is an "interactive" input source; if so, and 00226 * if we're using stdio for input, then we want to use getc() 00227 * instead of fread(), to make sure we stop fetching input after 00228 * each newline. 00229 */ 00230 int yy_is_interactive; 00231 00232 /* Whether we're considered to be at the beginning of a line. 00233 * If so, '^' rules will be active on the next match, otherwise 00234 * not. 00235 */ 00236 int yy_at_bol; 00237 00238 int yy_bs_lineno; /**< The line count. */ 00239 int yy_bs_column; /**< The column count. */ 00240 00241 /* Whether to try to fill the input buffer when we reach the 00242 * end of it. 00243 */ 00244 int yy_fill_buffer; 00245 00246 int yy_buffer_status; 00247 00248 #define YY_BUFFER_NEW 0 00249 #define YY_BUFFER_NORMAL 1 00250 /* When an EOF's been seen but there's still some text to process 00251 * then we mark the buffer as YY_EOF_PENDING, to indicate that we 00252 * shouldn't try reading from the input source any more. We might 00253 * still have a bunch of tokens to match, though, because of 00254 * possible backing-up. 00255 * 00256 * When we actually see the EOF, we change the status to "new" 00257 * (via ematch_restart()), so that the user can continue scanning by 00258 * just pointing yyin at a new input file. 00259 */ 00260 #define YY_BUFFER_EOF_PENDING 2 00261 00262 }; 00263 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 00264 00265 /* We provide macros for accessing buffer states in case in the 00266 * future we want to put the buffer states in a more general 00267 * "scanner state". 00268 * 00269 * Returns the top of the stack, or NULL. 00270 */ 00271 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ 00272 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ 00273 : NULL) 00274 00275 /* Same as previous macro, but useful when we know that the buffer stack is not 00276 * NULL or when we need an lvalue. For internal use only. 00277 */ 00278 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] 00279 00280 void ematch_restart (FILE *input_file ,yyscan_t yyscanner ); 00281 void ematch__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); 00282 YY_BUFFER_STATE ematch__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); 00283 void ematch__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); 00284 void ematch__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); 00285 void ematch_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); 00286 void ematch_pop_buffer_state (yyscan_t yyscanner ); 00287 00288 static void ematch_ensure_buffer_stack (yyscan_t yyscanner ); 00289 static void ematch__load_buffer_state (yyscan_t yyscanner ); 00290 static void ematch__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); 00291 00292 #define YY_FLUSH_BUFFER ematch__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) 00293 00294 YY_BUFFER_STATE ematch__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); 00295 YY_BUFFER_STATE ematch__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); 00296 YY_BUFFER_STATE ematch__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); 00297 00298 void *ematch_alloc (yy_size_t ,yyscan_t yyscanner ); 00299 void *ematch_realloc (void *,yy_size_t ,yyscan_t yyscanner ); 00300 void ematch_free (void * ,yyscan_t yyscanner ); 00301 00302 #define yy_new_buffer ematch__create_buffer 00303 00304 #define yy_set_interactive(is_interactive) \ 00305 { \ 00306 if ( ! YY_CURRENT_BUFFER ){ \ 00307 ematch_ensure_buffer_stack (yyscanner); \ 00308 YY_CURRENT_BUFFER_LVALUE = \ 00309 ematch__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ 00310 } \ 00311 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 00312 } 00313 00314 #define yy_set_bol(at_bol) \ 00315 { \ 00316 if ( ! YY_CURRENT_BUFFER ){\ 00317 ematch_ensure_buffer_stack (yyscanner); \ 00318 YY_CURRENT_BUFFER_LVALUE = \ 00319 ematch__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ 00320 } \ 00321 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 00322 } 00323 00324 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 00325 00326 #define ematch_wrap(n) 1 00327 #define YY_SKIP_YYWRAP 00328 00329 typedef unsigned char YY_CHAR; 00330 00331 typedef int yy_state_type; 00332 00333 #define yytext_ptr yytext_r 00334 00335 static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); 00336 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); 00337 static int yy_get_next_buffer (yyscan_t yyscanner ); 00338 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); 00339 00340 /* Done after the current pattern has been matched and before the 00341 * corresponding action - sets up yytext. 00342 */ 00343 #define YY_DO_BEFORE_ACTION \ 00344 yyg->yytext_ptr = yy_bp; \ 00345 yyleng = (size_t) (yy_cp - yy_bp); \ 00346 yyg->yy_hold_char = *yy_cp; \ 00347 *yy_cp = '\0'; \ 00348 yyg->yy_c_buf_p = yy_cp; 00349 00350 #define YY_NUM_RULES 91 00351 #define YY_END_OF_BUFFER 92 00352 /* This struct is not used in this scanner, 00353 but its presence is necessary. */ 00354 struct yy_trans_info 00355 { 00356 flex_int32_t yy_verify; 00357 flex_int32_t yy_nxt; 00358 }; 00359 static yyconst flex_int16_t yy_accept[393] = 00360 { 0, 00361 0, 0, 0, 0, 92, 90, 1, 18, 2, 26, 00362 23, 24, 30, 5, 5, 12, 8, 10, 90, 90, 00363 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 00364 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 00365 90, 91, 3, 91, 4, 90, 1, 14, 5, 90, 00366 28, 90, 29, 90, 90, 90, 40, 90, 90, 90, 00367 90, 90, 15, 90, 90, 90, 90, 32, 90, 90, 00368 90, 33, 90, 90, 7, 9, 90, 11, 90, 90, 00369 90, 90, 90, 90, 90, 90, 90, 16, 3, 6, 00370 13, 19, 37, 90, 39, 90, 90, 90, 38, 17, 00371 00372 90, 90, 42, 90, 90, 34, 35, 90, 47, 90, 00373 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 00374 90, 90, 31, 36, 25, 22, 90, 90, 21, 90, 00375 90, 90, 90, 90, 54, 90, 90, 48, 90, 90, 00376 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 00377 90, 90, 90, 90, 90, 90, 86, 90, 27, 90, 00378 90, 90, 90, 90, 90, 90, 49, 90, 90, 57, 00379 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 00380 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 00381 90, 90, 90, 90, 90, 90, 90, 90, 53, 51, 00382 00383 90, 43, 90, 87, 90, 90, 90, 90, 90, 90, 00384 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 00385 90, 90, 90, 90, 90, 90, 90, 90, 20, 90, 00386 52, 88, 90, 50, 90, 90, 90, 90, 90, 90, 00387 90, 76, 90, 90, 80, 90, 90, 90, 90, 90, 00388 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 00389 66, 90, 90, 55, 90, 90, 90, 90, 90, 90, 00390 90, 90, 90, 90, 90, 65, 90, 90, 90, 90, 00391 90, 60, 90, 90, 90, 90, 90, 90, 90, 59, 00392 90, 90, 41, 44, 45, 46, 56, 90, 74, 90, 00393 00394 90, 58, 90, 90, 90, 90, 62, 90, 90, 61, 00395 90, 90, 90, 90, 90, 63, 90, 90, 90, 90, 00396 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 00397 90, 90, 90, 90, 90, 90, 90, 90, 90, 89, 00398 72, 90, 90, 90, 70, 81, 82, 90, 90, 90, 00399 64, 71, 83, 90, 90, 90, 90, 90, 90, 90, 00400 90, 90, 90, 90, 90, 90, 90, 90, 77, 90, 00401 67, 75, 90, 68, 90, 90, 78, 90, 90, 84, 00402 69, 90, 90, 90, 90, 90, 90, 85, 73, 90, 00403 79, 0 00404 00405 } ; 00406 00407 static yyconst flex_int32_t yy_ec[256] = 00408 { 0, 00409 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 00410 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 00411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00412 1, 2, 4, 5, 1, 1, 1, 6, 1, 7, 00413 8, 1, 9, 1, 1, 1, 1, 10, 11, 12, 00414 13, 14, 14, 15, 14, 16, 14, 1, 1, 17, 00415 18, 19, 1, 1, 20, 21, 22, 23, 24, 25, 00416 1, 26, 27, 1, 28, 29, 30, 31, 32, 33, 00417 1, 34, 35, 36, 37, 1, 1, 38, 1, 1, 00418 1, 39, 1, 1, 40, 1, 41, 42, 43, 44, 00419 00420 45, 46, 47, 48, 49, 1, 50, 51, 52, 53, 00421 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 00422 64, 1, 1, 65, 1, 1, 1, 1, 1, 1, 00423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00430 00431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00436 1, 1, 1, 1, 1 00437 } ; 00438 00439 static yyconst flex_int32_t yy_meta[66] = 00440 { 0, 00441 1, 2, 3, 1, 3, 2, 2, 2, 2, 1, 00442 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 00443 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00444 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 00445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00447 1, 1, 1, 1, 2 00448 } ; 00449 00450 static yyconst flex_int16_t yy_base[396] = 00451 { 0, 00452 0, 0, 63, 64, 537, 0, 68, 0, 538, 530, 00453 538, 538, 538, 62, 69, 538, 538, 516, 55, 57, 00454 52, 55, 60, 67, 72, 73, 64, 79, 75, 100, 00455 115, 65, 83, 475, 102, 117, 118, 89, 121, 131, 00456 482, 467, 0, 538, 538, 0, 133, 538, 167, 179, 00457 538, 123, 0, 111, 124, 132, 516, 153, 138, 151, 00458 169, 171, 0, 172, 170, 178, 171, 0, 129, 515, 00459 517, 0, 469, 466, 0, 0, 485, 0, 183, 466, 00460 41, 471, 186, 475, 482, 183, 480, 538, 0, 0, 00461 0, 0, 0, 184, 0, 187, 189, 207, 0, 0, 00462 00463 206, 218, 0, 208, 215, 0, 0, 479, 466, 474, 00464 466, 466, 194, 461, 455, 469, 461, 462, 469, 228, 00465 456, 455, 0, 0, 0, 0, 226, 213, 0, 217, 00466 456, 465, 464, 459, 0, 458, 438, 0, 447, 446, 00467 458, 452, 439, 204, 442, 438, 237, 453, 444, 451, 00468 434, 249, 236, 426, 199, 445, 0, 220, 0, 227, 00469 443, 435, 425, 432, 431, 428, 0, 430, 423, 0, 00470 432, 429, 427, 417, 419, 423, 417, 415, 419, 408, 00471 208, 409, 152, 424, 408, 414, 406, 421, 423, 408, 00472 417, 412, 415, 235, 261, 406, 413, 410, 0, 0, 00473 00474 411, 0, 397, 0, 414, 399, 399, 411, 401, 387, 00475 400, 400, 406, 391, 385, 257, 400, 384, 389, 381, 00476 395, 379, 258, 378, 391, 383, 375, 370, 0, 262, 00477 0, 0, 392, 0, 382, 388, 386, 384, 371, 375, 00478 384, 0, 379, 382, 0, 368, 365, 360, 365, 369, 00479 364, 371, 375, 369, 361, 368, 355, 350, 360, 363, 00480 0, 367, 361, 0, 266, 294, 361, 363, 345, 362, 00481 350, 336, 342, 341, 354, 0, 345, 349, 332, 341, 00482 333, 0, 350, 350, 331, 334, 336, 340, 333, 0, 00483 266, 344, 0, 0, 0, 0, 0, 340, 0, 333, 00484 00485 336, 0, 336, 320, 328, 332, 0, 335, 330, 0, 00486 323, 330, 325, 309, 325, 0, 324, 317, 307, 311, 00487 315, 318, 310, 322, 312, 320, 306, 299, 303, 305, 00488 314, 314, 300, 299, 297, 299, 304, 303, 296, 0, 00489 0, 305, 293, 302, 0, 0, 0, 289, 287, 287, 00490 0, 0, 0, 286, 279, 285, 283, 285, 287, 290, 00491 281, 265, 275, 277, 273, 270, 266, 261, 0, 268, 00492 0, 0, 264, 0, 265, 214, 0, 207, 209, 0, 00493 0, 205, 170, 109, 93, 75, 53, 0, 0, 57, 00494 0, 538, 325, 329, 333 00495 00496 } ; 00497 00498 static yyconst flex_int16_t yy_def[396] = 00499 { 0, 00500 392, 1, 393, 393, 392, 394, 392, 394, 392, 392, 00501 392, 392, 392, 394, 394, 392, 392, 392, 394, 394, 00502 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00503 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00504 394, 392, 395, 392, 392, 394, 392, 392, 394, 394, 00505 392, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00506 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00507 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00508 394, 394, 394, 394, 394, 394, 394, 392, 395, 50, 00509 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00510 00511 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00512 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00513 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00514 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00515 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00516 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00517 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00518 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00519 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00520 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00521 00522 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00523 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00524 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00525 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00526 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00527 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00528 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00529 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00530 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00531 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00532 00533 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00534 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00535 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00536 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00537 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00538 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00539 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00540 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00541 394, 394, 394, 394, 394, 394, 394, 394, 394, 394, 00542 394, 0, 392, 392, 392 00543 00544 } ; 00545 00546 static yyconst flex_int16_t yy_nxt[604] = 00547 { 0, 00548 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 00549 15, 15, 15, 15, 15, 15, 16, 17, 18, 19, 00550 6, 20, 6, 21, 22, 6, 23, 6, 24, 25, 00551 26, 27, 28, 6, 29, 30, 31, 6, 6, 6, 00552 19, 6, 20, 32, 33, 22, 34, 6, 23, 6, 00553 35, 36, 26, 27, 37, 6, 38, 39, 40, 31, 00554 41, 6, 6, 6, 42, 44, 44, 45, 45, 47, 00555 47, 49, 49, 49, 49, 49, 49, 49, 49, 49, 00556 49, 49, 49, 49, 49, 52, 54, 55, 56, 114, 00557 53, 59, 57, 58, 115, 60, 61, 63, 64, 50, 00558 00559 65, 44, 44, 391, 62, 73, 390, 52, 54, 74, 00560 55, 56, 59, 53, 57, 58, 60, 61, 55, 64, 00561 63, 66, 65, 67, 50, 70, 62, 71, 58, 82, 00562 72, 68, 389, 69, 47, 47, 59, 64, 75, 388, 00563 60, 55, 66, 92, 67, 91, 65, 83, 105, 93, 00564 58, 84, 66, 68, 67, 77, 69, 79, 64, 387, 00565 78, 60, 68, 94, 69, 92, 91, 80, 65, 105, 00566 85, 93, 97, 86, 81, 67, 49, 49, 49, 49, 00567 49, 49, 49, 96, 68, 94, 98, 69, 90, 90, 00568 90, 90, 90, 90, 90, 97, 102, 217, 90, 90, 00569 00570 90, 90, 90, 90, 99, 96, 100, 101, 104, 98, 00571 103, 218, 386, 123, 124, 103, 125, 97, 102, 90, 00572 90, 90, 90, 90, 90, 111, 126, 99, 117, 100, 00573 101, 121, 103, 104, 118, 123, 124, 103, 125, 112, 00574 97, 127, 128, 129, 136, 130, 172, 126, 159, 158, 00575 191, 160, 137, 194, 173, 192, 214, 385, 384, 195, 00576 383, 215, 382, 128, 127, 229, 129, 130, 144, 145, 00577 158, 159, 146, 147, 160, 148, 194, 176, 149, 150, 00578 186, 195, 151, 187, 152, 153, 154, 229, 188, 155, 00579 177, 182, 230, 183, 189, 265, 247, 257, 248, 258, 00580 00581 184, 293, 185, 294, 295, 296, 318, 249, 381, 380, 00582 379, 378, 377, 376, 230, 250, 259, 375, 265, 374, 00583 373, 319, 372, 371, 293, 43, 43, 43, 43, 46, 00584 370, 369, 46, 89, 89, 368, 367, 366, 365, 364, 00585 363, 362, 361, 360, 359, 358, 357, 356, 355, 354, 00586 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, 00587 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, 00588 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 00589 323, 322, 321, 320, 317, 316, 315, 314, 313, 312, 00590 311, 310, 309, 308, 307, 306, 305, 304, 303, 302, 00591 00592 301, 300, 299, 298, 297, 292, 291, 290, 289, 288, 00593 287, 286, 285, 284, 283, 282, 281, 280, 279, 278, 00594 277, 276, 275, 274, 273, 272, 271, 270, 269, 268, 00595 267, 266, 264, 263, 262, 261, 260, 256, 255, 254, 00596 253, 252, 251, 246, 245, 244, 243, 242, 241, 240, 00597 239, 238, 237, 236, 235, 234, 233, 232, 231, 228, 00598 227, 226, 225, 224, 223, 222, 221, 220, 219, 216, 00599 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 00600 203, 202, 201, 200, 199, 198, 197, 196, 193, 190, 00601 181, 180, 179, 178, 175, 174, 171, 170, 169, 168, 00602 00603 167, 166, 165, 164, 163, 162, 161, 157, 156, 143, 00604 142, 141, 140, 139, 138, 135, 134, 133, 132, 131, 00605 122, 120, 119, 116, 113, 110, 109, 108, 107, 106, 00606 95, 88, 87, 76, 51, 48, 392, 5, 392, 392, 00607 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00608 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00609 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00610 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00611 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00612 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00613 00614 392, 392, 392 00615 } ; 00616 00617 static yyconst flex_int16_t yy_chk[604] = 00618 { 0, 00619 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00620 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00621 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00622 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00623 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00624 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00625 1, 1, 1, 1, 1, 3, 4, 3, 4, 7, 00626 7, 14, 14, 14, 14, 14, 14, 14, 15, 15, 00627 15, 15, 15, 15, 15, 19, 20, 21, 22, 81, 00628 19, 25, 23, 24, 81, 25, 26, 27, 28, 14, 00629 00630 29, 3, 4, 390, 26, 32, 387, 19, 20, 32, 00631 21, 22, 25, 19, 23, 24, 25, 26, 33, 28, 00632 27, 30, 29, 30, 14, 31, 26, 31, 35, 38, 00633 31, 30, 386, 30, 47, 47, 36, 37, 33, 385, 00634 36, 33, 30, 54, 30, 52, 39, 38, 69, 55, 00635 35, 38, 40, 30, 40, 35, 30, 36, 37, 384, 00636 35, 36, 40, 56, 40, 54, 52, 37, 39, 69, 00637 39, 55, 59, 40, 37, 40, 49, 49, 49, 49, 00638 49, 49, 49, 58, 40, 56, 60, 40, 50, 50, 00639 50, 50, 50, 50, 50, 59, 65, 183, 50, 50, 00640 00641 50, 50, 50, 50, 61, 58, 62, 64, 67, 60, 00642 66, 183, 383, 94, 96, 86, 97, 79, 65, 50, 00643 50, 50, 50, 50, 50, 79, 98, 61, 83, 62, 00644 64, 86, 66, 67, 83, 94, 96, 86, 97, 79, 00645 79, 101, 102, 104, 113, 105, 144, 98, 128, 127, 00646 155, 130, 113, 158, 144, 155, 181, 382, 379, 160, 00647 378, 181, 376, 102, 101, 194, 104, 105, 120, 120, 00648 127, 128, 120, 120, 130, 120, 158, 147, 120, 120, 00649 153, 160, 120, 153, 120, 120, 120, 194, 153, 120, 00650 147, 152, 195, 152, 153, 230, 216, 223, 216, 223, 00651 00652 152, 265, 152, 266, 266, 266, 291, 216, 375, 373, 00653 370, 368, 367, 366, 195, 216, 223, 365, 230, 364, 00654 363, 291, 362, 361, 265, 393, 393, 393, 393, 394, 00655 360, 359, 394, 395, 395, 358, 357, 356, 355, 354, 00656 350, 349, 348, 344, 343, 342, 339, 338, 337, 336, 00657 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 00658 325, 324, 323, 322, 321, 320, 319, 318, 317, 315, 00659 314, 313, 312, 311, 309, 308, 306, 305, 304, 303, 00660 301, 300, 298, 292, 289, 288, 287, 286, 285, 284, 00661 283, 281, 280, 279, 278, 277, 275, 274, 273, 272, 00662 00663 271, 270, 269, 268, 267, 263, 262, 260, 259, 258, 00664 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, 00665 247, 246, 244, 243, 241, 240, 239, 238, 237, 236, 00666 235, 233, 228, 227, 226, 225, 224, 222, 221, 220, 00667 219, 218, 217, 215, 214, 213, 212, 211, 210, 209, 00668 208, 207, 206, 205, 203, 201, 198, 197, 196, 193, 00669 192, 191, 190, 189, 188, 187, 186, 185, 184, 182, 00670 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 00671 169, 168, 166, 165, 164, 163, 162, 161, 156, 154, 00672 151, 150, 149, 148, 146, 145, 143, 142, 141, 140, 00673 00674 139, 137, 136, 134, 133, 132, 131, 122, 121, 119, 00675 118, 117, 116, 115, 114, 112, 111, 110, 109, 108, 00676 87, 85, 84, 82, 80, 77, 74, 73, 71, 70, 00677 57, 42, 41, 34, 18, 10, 5, 392, 392, 392, 00678 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00679 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00680 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00681 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00682 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00683 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 00684 00685 392, 392, 392 00686 } ; 00687 00688 /* The intent behind this definition is that it'll catch 00689 * any uses of REJECT which flex missed. 00690 */ 00691 #define REJECT reject_used_but_not_detected 00692 #define yymore() yymore_used_but_not_detected 00693 #define YY_MORE_ADJ 0 00694 #define YY_RESTORE_YY_MORE_OFFSET 00695 #line 1 "route/cls/ematch_grammar.l" 00696 /* 00697 * lib/route/cls/ematch_grammar.l ematch expression grammar 00698 * 00699 * This library is free software; you can redistribute it and/or 00700 * modify it under the terms of the GNU Lesser General Public 00701 * License as published by the Free Software Foundation version 2.1 00702 * of the License. 00703 * 00704 * Copyright (c) 2010 Thomas Graf <tgraf@suug.ch> 00705 */ 00706 #line 13 "route/cls/ematch_grammar.l" 00707 #include <netlink-local.h> 00708 #include <netlink-tc.h> 00709 #include <netlink/netlink.h> 00710 #include <netlink/route/cls/ematch.h> 00711 #include <netlink/route/cls/ematch/cmp.h> 00712 #include "ematch_syntax.h" 00713 #define YY_NO_INPUT 1 00714 00715 #line 716 "route/cls/ematch_grammar.c" 00716 00717 #define INITIAL 0 00718 #define QUOTE 1 00719 00720 #ifndef YY_NO_UNISTD_H 00721 /* Special case for "unistd.h", since it is non-ANSI. We include it way 00722 * down here because we want the user's section 1 to have been scanned first. 00723 * The user has a chance to override it with an option. 00724 */ 00725 #include <unistd.h> 00726 #endif 00727 00728 #ifndef YY_EXTRA_TYPE 00729 #define YY_EXTRA_TYPE void * 00730 #endif 00731 00732 /* Holds the entire state of the reentrant scanner. */ 00733 struct yyguts_t 00734 { 00735 00736 /* User-defined. Not touched by flex. */ 00737 YY_EXTRA_TYPE yyextra_r; 00738 00739 /* The rest are the same as the globals declared in the non-reentrant scanner. */ 00740 FILE *yyin_r, *yyout_r; 00741 size_t yy_buffer_stack_top; /**< index of top of stack. */ 00742 size_t yy_buffer_stack_max; /**< capacity of stack. */ 00743 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ 00744 char yy_hold_char; 00745 int yy_n_chars; 00746 int yyleng_r; 00747 char *yy_c_buf_p; 00748 int yy_init; 00749 int yy_start; 00750 int yy_did_buffer_switch_on_eof; 00751 int yy_start_stack_ptr; 00752 int yy_start_stack_depth; 00753 int *yy_start_stack; 00754 yy_state_type yy_last_accepting_state; 00755 char* yy_last_accepting_cpos; 00756 00757 int yylineno_r; 00758 int yy_flex_debug_r; 00759 00760 char *yytext_r; 00761 int yy_more_flag; 00762 int yy_more_len; 00763 00764 YYSTYPE * yylval_r; 00765 00766 }; /* end struct yyguts_t */ 00767 00768 static int yy_init_globals (yyscan_t yyscanner ); 00769 00770 /* This must go here because YYSTYPE and YYLTYPE are included 00771 * from bison output in section 1.*/ 00772 # define yylval yyg->yylval_r 00773 00774 int ematch_lex_init (yyscan_t* scanner); 00775 00776 int ematch_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); 00777 00778 /* Accessor methods to globals. 00779 These are made visible to non-reentrant scanners for convenience. */ 00780 00781 int ematch_lex_destroy (yyscan_t yyscanner ); 00782 00783 int ematch_get_debug (yyscan_t yyscanner ); 00784 00785 void ematch_set_debug (int debug_flag ,yyscan_t yyscanner ); 00786 00787 YY_EXTRA_TYPE ematch_get_extra (yyscan_t yyscanner ); 00788 00789 void ematch_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); 00790 00791 FILE *ematch_get_in (yyscan_t yyscanner ); 00792 00793 void ematch_set_in (FILE * in_str ,yyscan_t yyscanner ); 00794 00795 FILE *ematch_get_out (yyscan_t yyscanner ); 00796 00797 void ematch_set_out (FILE * out_str ,yyscan_t yyscanner ); 00798 00799 int ematch_get_leng (yyscan_t yyscanner ); 00800 00801 char *ematch_get_text (yyscan_t yyscanner ); 00802 00803 int ematch_get_lineno (yyscan_t yyscanner ); 00804 00805 void ematch_set_lineno (int line_number ,yyscan_t yyscanner ); 00806 00807 int ematch_get_column (yyscan_t yyscanner ); 00808 00809 void ematch_set_column (int column_no ,yyscan_t yyscanner ); 00810 00811 YYSTYPE * ematch_get_lval (yyscan_t yyscanner ); 00812 00813 void ematch_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); 00814 00815 /* Macros after this point can all be overridden by user definitions in 00816 * section 1. 00817 */ 00818 00819 #ifndef YY_SKIP_YYWRAP 00820 #ifdef __cplusplus 00821 extern "C" int ematch_wrap (yyscan_t yyscanner ); 00822 #else 00823 extern int ematch_wrap (yyscan_t yyscanner ); 00824 #endif 00825 #endif 00826 00827 #ifndef yytext_ptr 00828 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); 00829 #endif 00830 00831 #ifdef YY_NEED_STRLEN 00832 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); 00833 #endif 00834 00835 #ifndef YY_NO_INPUT 00836 00837 #ifdef __cplusplus 00838 static int yyinput (yyscan_t yyscanner ); 00839 #else 00840 static int input (yyscan_t yyscanner ); 00841 #endif 00842 00843 #endif 00844 00845 /* Amount of stuff to slurp up with each read. */ 00846 #ifndef YY_READ_BUF_SIZE 00847 #define YY_READ_BUF_SIZE 8192 00848 #endif 00849 00850 /* Copy whatever the last rule matched to the standard output. */ 00851 #ifndef ECHO 00852 /* This used to be an fputs(), but since the string might contain NUL's, 00853 * we now use fwrite(). 00854 */ 00855 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) 00856 #endif 00857 00858 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 00859 * is returned in "result". 00860 */ 00861 #ifndef YY_INPUT 00862 #define YY_INPUT(buf,result,max_size) \ 00863 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 00864 { \ 00865 int c = '*'; \ 00866 unsigned n; \ 00867 for ( n = 0; n < max_size && \ 00868 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 00869 buf[n] = (char) c; \ 00870 if ( c == '\n' ) \ 00871 buf[n++] = (char) c; \ 00872 if ( c == EOF && ferror( yyin ) ) \ 00873 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00874 result = n; \ 00875 } \ 00876 else \ 00877 { \ 00878 errno=0; \ 00879 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 00880 { \ 00881 if( errno != EINTR) \ 00882 { \ 00883 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00884 break; \ 00885 } \ 00886 errno=0; \ 00887 clearerr(yyin); \ 00888 } \ 00889 }\ 00890 \ 00891 00892 #endif 00893 00894 /* No semi-colon after return; correct usage is to write "yyterminate();" - 00895 * we don't want an extra ';' after the "return" because that will cause 00896 * some compilers to complain about unreachable statements. 00897 */ 00898 #ifndef yyterminate 00899 #define yyterminate() return YY_NULL 00900 #endif 00901 00902 /* Number of entries by which start-condition stack grows. */ 00903 #ifndef YY_START_STACK_INCR 00904 #define YY_START_STACK_INCR 25 00905 #endif 00906 00907 /* Report a fatal error. */ 00908 #ifndef YY_FATAL_ERROR 00909 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) 00910 #endif 00911 00912 /* end tables serialization structures and prototypes */ 00913 00914 /* Default declaration of generated scanner - a define so the user can 00915 * easily add parameters. 00916 */ 00917 #ifndef YY_DECL 00918 #define YY_DECL_IS_OURS 1 00919 00920 extern int ematch_lex \ 00921 (YYSTYPE * yylval_param ,yyscan_t yyscanner); 00922 00923 #define YY_DECL int ematch_lex \ 00924 (YYSTYPE * yylval_param , yyscan_t yyscanner) 00925 #endif /* !YY_DECL */ 00926 00927 /* Code executed at the beginning of each rule, after yytext and yyleng 00928 * have been set up. 00929 */ 00930 #ifndef YY_USER_ACTION 00931 #define YY_USER_ACTION 00932 #endif 00933 00934 /* Code executed at the end of each rule. */ 00935 #ifndef YY_BREAK 00936 #define YY_BREAK break; 00937 #endif 00938 00939 #define YY_RULE_SETUP \ 00940 YY_USER_ACTION 00941 00942 /** The main scanner function which does all the work. 00943 */ 00944 YY_DECL 00945 { 00946 register yy_state_type yy_current_state; 00947 register char *yy_cp, *yy_bp; 00948 register int yy_act; 00949 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 00950 00951 #line 32 "route/cls/ematch_grammar.l" 00952 00953 00954 #line 955 "route/cls/ematch_grammar.c" 00955 00956 yylval = yylval_param; 00957 00958 if ( !yyg->yy_init ) 00959 { 00960 yyg->yy_init = 1; 00961 00962 #ifdef YY_USER_INIT 00963 YY_USER_INIT; 00964 #endif 00965 00966 if ( ! yyg->yy_start ) 00967 yyg->yy_start = 1; /* first start state */ 00968 00969 if ( ! yyin ) 00970 yyin = stdin; 00971 00972 if ( ! yyout ) 00973 yyout = stdout; 00974 00975 if ( ! YY_CURRENT_BUFFER ) { 00976 ematch_ensure_buffer_stack (yyscanner); 00977 YY_CURRENT_BUFFER_LVALUE = 00978 ematch__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); 00979 } 00980 00981 ematch__load_buffer_state(yyscanner ); 00982 } 00983 00984 while ( 1 ) /* loops until end-of-file is reached */ 00985 { 00986 yy_cp = yyg->yy_c_buf_p; 00987 00988 /* Support of yytext. */ 00989 *yy_cp = yyg->yy_hold_char; 00990 00991 /* yy_bp points to the position in yy_ch_buf of the start of 00992 * the current run. 00993 */ 00994 yy_bp = yy_cp; 00995 00996 yy_current_state = yyg->yy_start; 00997 yy_match: 00998 do 00999 { 01000 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 01001 if ( yy_accept[yy_current_state] ) 01002 { 01003 yyg->yy_last_accepting_state = yy_current_state; 01004 yyg->yy_last_accepting_cpos = yy_cp; 01005 } 01006 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01007 { 01008 yy_current_state = (int) yy_def[yy_current_state]; 01009 if ( yy_current_state >= 393 ) 01010 yy_c = yy_meta[(unsigned int) yy_c]; 01011 } 01012 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01013 ++yy_cp; 01014 } 01015 while ( yy_base[yy_current_state] != 538 ); 01016 01017 yy_find_action: 01018 yy_act = yy_accept[yy_current_state]; 01019 if ( yy_act == 0 ) 01020 { /* have to back up */ 01021 yy_cp = yyg->yy_last_accepting_cpos; 01022 yy_current_state = yyg->yy_last_accepting_state; 01023 yy_act = yy_accept[yy_current_state]; 01024 } 01025 01026 YY_DO_BEFORE_ACTION; 01027 01028 do_action: /* This label is used only to access EOF actions. */ 01029 01030 switch ( yy_act ) 01031 { /* beginning of action switch */ 01032 case 0: /* must back up */ 01033 /* undo the effects of YY_DO_BEFORE_ACTION */ 01034 *yy_cp = yyg->yy_hold_char; 01035 yy_cp = yyg->yy_last_accepting_cpos; 01036 yy_current_state = yyg->yy_last_accepting_state; 01037 goto yy_find_action; 01038 01039 case 1: 01040 /* rule 1 can match eol */ 01041 YY_RULE_SETUP 01042 #line 34 "route/cls/ematch_grammar.l" 01043 01044 YY_BREAK 01045 case 2: 01046 YY_RULE_SETUP 01047 #line 36 "route/cls/ematch_grammar.l" 01048 { 01049 NL_DBG(4, "Beginning of quote\n"); 01050 yylval->q.len = 32; 01051 if (!(yylval->q.data = calloc(1, yylval->q.len))) 01052 return ERROR; 01053 01054 yylval->q.index = 0; 01055 BEGIN(QUOTE); 01056 } 01057 YY_BREAK 01058 case 3: 01059 YY_RULE_SETUP 01060 #line 46 "route/cls/ematch_grammar.l" 01061 { 01062 memcpy(yylval->q.data + yylval->q.index, yytext, 01063 strlen(yytext)); 01064 yylval->q.index += strlen(yytext); 01065 } 01066 YY_BREAK 01067 case 4: 01068 YY_RULE_SETUP 01069 #line 52 "route/cls/ematch_grammar.l" 01070 { 01071 BEGIN(0); 01072 return QUOTED; 01073 } 01074 YY_BREAK 01075 case 5: 01076 #line 59 "route/cls/ematch_grammar.l" 01077 case 6: 01078 YY_RULE_SETUP 01079 #line 59 "route/cls/ematch_grammar.l" 01080 { 01081 yylval->i = strtoul(yytext, NULL, 0); 01082 return NUMBER; 01083 } 01084 YY_BREAK 01085 case 7: 01086 #line 65 "route/cls/ematch_grammar.l" 01087 case 8: 01088 YY_RULE_SETUP 01089 #line 65 "route/cls/ematch_grammar.l" 01090 return KW_EQ; 01091 YY_BREAK 01092 case 9: 01093 #line 67 "route/cls/ematch_grammar.l" 01094 case 10: 01095 YY_RULE_SETUP 01096 #line 67 "route/cls/ematch_grammar.l" 01097 return KW_GT; 01098 YY_BREAK 01099 case 11: 01100 #line 69 "route/cls/ematch_grammar.l" 01101 case 12: 01102 YY_RULE_SETUP 01103 #line 69 "route/cls/ematch_grammar.l" 01104 return KW_LT; 01105 YY_BREAK 01106 case 13: 01107 #line 72 "route/cls/ematch_grammar.l" 01108 case 14: 01109 YY_RULE_SETUP 01110 #line 72 "route/cls/ematch_grammar.l" 01111 { yylval->i = TCF_EM_REL_AND; return LOGIC; } 01112 YY_BREAK 01113 case 15: 01114 #line 74 "route/cls/ematch_grammar.l" 01115 case 16: 01116 YY_RULE_SETUP 01117 #line 74 "route/cls/ematch_grammar.l" 01118 { yylval->i = TCF_EM_REL_OR; return LOGIC; } 01119 YY_BREAK 01120 case 17: 01121 #line 76 "route/cls/ematch_grammar.l" 01122 case 18: 01123 YY_RULE_SETUP 01124 #line 76 "route/cls/ematch_grammar.l" 01125 return NOT; 01126 YY_BREAK 01127 case 19: 01128 YY_RULE_SETUP 01129 #line 78 "route/cls/ematch_grammar.l" 01130 { yylval->i = TCF_EM_CMP; return EMATCH_CMP; } 01131 YY_BREAK 01132 case 20: 01133 YY_RULE_SETUP 01134 #line 79 "route/cls/ematch_grammar.l" 01135 { yylval->i = TCF_EM_NBYTE; return EMATCH_NBYTE; } 01136 YY_BREAK 01137 case 21: 01138 YY_RULE_SETUP 01139 #line 80 "route/cls/ematch_grammar.l" 01140 { yylval->i = TCF_EM_TEXT; return EMATCH_TEXT; } 01141 YY_BREAK 01142 case 22: 01143 YY_RULE_SETUP 01144 #line 81 "route/cls/ematch_grammar.l" 01145 { yylval->i = TCF_EM_META; return EMATCH_META; } 01146 YY_BREAK 01147 case 23: 01148 YY_RULE_SETUP 01149 #line 83 "route/cls/ematch_grammar.l" 01150 return KW_OPEN; 01151 YY_BREAK 01152 case 24: 01153 YY_RULE_SETUP 01154 #line 84 "route/cls/ematch_grammar.l" 01155 return KW_CLOSE; 01156 YY_BREAK 01157 case 25: 01158 #line 86 "route/cls/ematch_grammar.l" 01159 case 26: 01160 YY_RULE_SETUP 01161 #line 86 "route/cls/ematch_grammar.l" 01162 return KW_MASK; 01163 YY_BREAK 01164 case 27: 01165 #line 88 "route/cls/ematch_grammar.l" 01166 case 28: 01167 YY_RULE_SETUP 01168 #line 88 "route/cls/ematch_grammar.l" 01169 return KW_SHIFT; 01170 YY_BREAK 01171 case 29: 01172 YY_RULE_SETUP 01173 #line 89 "route/cls/ematch_grammar.l" 01174 return KW_AT; 01175 YY_BREAK 01176 case 30: 01177 YY_RULE_SETUP 01178 #line 90 "route/cls/ematch_grammar.l" 01179 return KW_PLUS; 01180 YY_BREAK 01181 case 31: 01182 YY_RULE_SETUP 01183 #line 91 "route/cls/ematch_grammar.l" 01184 return KW_FROM; 01185 YY_BREAK 01186 case 32: 01187 YY_RULE_SETUP 01188 #line 92 "route/cls/ematch_grammar.l" 01189 return KW_TO; 01190 YY_BREAK 01191 case 33: 01192 YY_RULE_SETUP 01193 #line 94 "route/cls/ematch_grammar.l" 01194 { yylval->i = TCF_EM_ALIGN_U8; return ALIGN; } 01195 YY_BREAK 01196 case 34: 01197 YY_RULE_SETUP 01198 #line 95 "route/cls/ematch_grammar.l" 01199 { yylval->i = TCF_EM_ALIGN_U16; return ALIGN; } 01200 YY_BREAK 01201 case 35: 01202 YY_RULE_SETUP 01203 #line 96 "route/cls/ematch_grammar.l" 01204 { yylval->i = TCF_EM_ALIGN_U32; return ALIGN; } 01205 YY_BREAK 01206 case 36: 01207 #line 99 "route/cls/ematch_grammar.l" 01208 case 37: 01209 YY_RULE_SETUP 01210 #line 99 "route/cls/ematch_grammar.l" 01211 { yylval->i = TCF_LAYER_LINK; return LAYER; } 01212 YY_BREAK 01213 case 38: 01214 #line 101 "route/cls/ematch_grammar.l" 01215 case 39: 01216 #line 102 "route/cls/ematch_grammar.l" 01217 case 40: 01218 YY_RULE_SETUP 01219 #line 102 "route/cls/ematch_grammar.l" 01220 { yylval->i = TCF_LAYER_NETWORK; return LAYER; } 01221 YY_BREAK 01222 case 41: 01223 #line 104 "route/cls/ematch_grammar.l" 01224 case 42: 01225 YY_RULE_SETUP 01226 #line 104 "route/cls/ematch_grammar.l" 01227 { yylval->i = TCF_LAYER_TRANSPORT; return LAYER; } 01228 YY_BREAK 01229 case 43: 01230 YY_RULE_SETUP 01231 #line 106 "route/cls/ematch_grammar.l" 01232 return META_RANDOM; 01233 YY_BREAK 01234 case 44: 01235 YY_RULE_SETUP 01236 #line 107 "route/cls/ematch_grammar.l" 01237 return META_LOADAVG_0; 01238 YY_BREAK 01239 case 45: 01240 YY_RULE_SETUP 01241 #line 108 "route/cls/ematch_grammar.l" 01242 return META_LOADAVG_1; 01243 YY_BREAK 01244 case 46: 01245 YY_RULE_SETUP 01246 #line 109 "route/cls/ematch_grammar.l" 01247 return META_LOADAVG_2; 01248 YY_BREAK 01249 case 47: 01250 YY_RULE_SETUP 01251 #line 110 "route/cls/ematch_grammar.l" 01252 return META_DEV; 01253 YY_BREAK 01254 case 48: 01255 YY_RULE_SETUP 01256 #line 111 "route/cls/ematch_grammar.l" 01257 return META_PRIO; 01258 YY_BREAK 01259 case 49: 01260 YY_RULE_SETUP 01261 #line 112 "route/cls/ematch_grammar.l" 01262 return META_PROTO; 01263 YY_BREAK 01264 case 50: 01265 YY_RULE_SETUP 01266 #line 113 "route/cls/ematch_grammar.l" 01267 return META_PKTTYPE; 01268 YY_BREAK 01269 case 51: 01270 YY_RULE_SETUP 01271 #line 114 "route/cls/ematch_grammar.l" 01272 return META_PKTLEN; 01273 YY_BREAK 01274 case 52: 01275 YY_RULE_SETUP 01276 #line 115 "route/cls/ematch_grammar.l" 01277 return META_DATALEN; 01278 YY_BREAK 01279 case 53: 01280 YY_RULE_SETUP 01281 #line 116 "route/cls/ematch_grammar.l" 01282 return META_MACLEN; 01283 YY_BREAK 01284 case 54: 01285 YY_RULE_SETUP 01286 #line 117 "route/cls/ematch_grammar.l" 01287 return META_MARK; 01288 YY_BREAK 01289 case 55: 01290 YY_RULE_SETUP 01291 #line 118 "route/cls/ematch_grammar.l" 01292 return META_TCINDEX; 01293 YY_BREAK 01294 case 56: 01295 YY_RULE_SETUP 01296 #line 119 "route/cls/ematch_grammar.l" 01297 return META_RTCLASSID; 01298 YY_BREAK 01299 case 57: 01300 YY_RULE_SETUP 01301 #line 120 "route/cls/ematch_grammar.l" 01302 return META_RTIIF; 01303 YY_BREAK 01304 case 58: 01305 YY_RULE_SETUP 01306 #line 121 "route/cls/ematch_grammar.l" 01307 return META_SK_FAMILY; 01308 YY_BREAK 01309 case 59: 01310 YY_RULE_SETUP 01311 #line 122 "route/cls/ematch_grammar.l" 01312 return META_SK_STATE; 01313 YY_BREAK 01314 case 60: 01315 YY_RULE_SETUP 01316 #line 123 "route/cls/ematch_grammar.l" 01317 return META_SK_REUSE; 01318 YY_BREAK 01319 case 61: 01320 YY_RULE_SETUP 01321 #line 124 "route/cls/ematch_grammar.l" 01322 return META_SK_REFCNT; 01323 YY_BREAK 01324 case 62: 01325 YY_RULE_SETUP 01326 #line 125 "route/cls/ematch_grammar.l" 01327 return META_SK_RCVBUF; 01328 YY_BREAK 01329 case 63: 01330 YY_RULE_SETUP 01331 #line 126 "route/cls/ematch_grammar.l" 01332 return META_SK_SNDBUF; 01333 YY_BREAK 01334 case 64: 01335 YY_RULE_SETUP 01336 #line 127 "route/cls/ematch_grammar.l" 01337 return META_SK_SHUTDOWN; 01338 YY_BREAK 01339 case 65: 01340 YY_RULE_SETUP 01341 #line 128 "route/cls/ematch_grammar.l" 01342 return META_SK_PROTO; 01343 YY_BREAK 01344 case 66: 01345 YY_RULE_SETUP 01346 #line 129 "route/cls/ematch_grammar.l" 01347 return META_SK_TYPE; 01348 YY_BREAK 01349 case 67: 01350 YY_RULE_SETUP 01351 #line 130 "route/cls/ematch_grammar.l" 01352 return META_SK_RMEM_ALLOC; 01353 YY_BREAK 01354 case 68: 01355 YY_RULE_SETUP 01356 #line 131 "route/cls/ematch_grammar.l" 01357 return META_SK_WMEM_ALLOC; 01358 YY_BREAK 01359 case 69: 01360 YY_RULE_SETUP 01361 #line 132 "route/cls/ematch_grammar.l" 01362 return META_SK_WMEM_QUEUED; 01363 YY_BREAK 01364 case 70: 01365 YY_RULE_SETUP 01366 #line 133 "route/cls/ematch_grammar.l" 01367 return META_SK_RCV_QLEN; 01368 YY_BREAK 01369 case 71: 01370 YY_RULE_SETUP 01371 #line 134 "route/cls/ematch_grammar.l" 01372 return META_SK_SND_QLEN; 01373 YY_BREAK 01374 case 72: 01375 YY_RULE_SETUP 01376 #line 135 "route/cls/ematch_grammar.l" 01377 return META_SK_ERR_QLEN; 01378 YY_BREAK 01379 case 73: 01380 YY_RULE_SETUP 01381 #line 136 "route/cls/ematch_grammar.l" 01382 return META_SK_FORWARD_ALLOCS; 01383 YY_BREAK 01384 case 74: 01385 YY_RULE_SETUP 01386 #line 137 "route/cls/ematch_grammar.l" 01387 return META_SK_ALLOCS; 01388 YY_BREAK 01389 case 75: 01390 YY_RULE_SETUP 01391 #line 138 "route/cls/ematch_grammar.l" 01392 return META_SK_ROUTE_CAPS; 01393 YY_BREAK 01394 case 76: 01395 YY_RULE_SETUP 01396 #line 139 "route/cls/ematch_grammar.l" 01397 return META_SK_HASH; 01398 YY_BREAK 01399 case 77: 01400 YY_RULE_SETUP 01401 #line 140 "route/cls/ematch_grammar.l" 01402 return META_SK_LINGERTIME; 01403 YY_BREAK 01404 case 78: 01405 YY_RULE_SETUP 01406 #line 141 "route/cls/ematch_grammar.l" 01407 return META_SK_ACK_BACKLOG; 01408 YY_BREAK 01409 case 79: 01410 YY_RULE_SETUP 01411 #line 142 "route/cls/ematch_grammar.l" 01412 return META_SK_MAX_ACK_BACKLOG; 01413 YY_BREAK 01414 case 80: 01415 YY_RULE_SETUP 01416 #line 143 "route/cls/ematch_grammar.l" 01417 return META_SK_PRIO; 01418 YY_BREAK 01419 case 81: 01420 YY_RULE_SETUP 01421 #line 144 "route/cls/ematch_grammar.l" 01422 return META_SK_RCVLOWAT; 01423 YY_BREAK 01424 case 82: 01425 YY_RULE_SETUP 01426 #line 145 "route/cls/ematch_grammar.l" 01427 return META_SK_RCVTIMEO; 01428 YY_BREAK 01429 case 83: 01430 YY_RULE_SETUP 01431 #line 146 "route/cls/ematch_grammar.l" 01432 return META_SK_SNDTIMEO; 01433 YY_BREAK 01434 case 84: 01435 YY_RULE_SETUP 01436 #line 147 "route/cls/ematch_grammar.l" 01437 return META_SK_SENDMSG_OFF; 01438 YY_BREAK 01439 case 85: 01440 YY_RULE_SETUP 01441 #line 148 "route/cls/ematch_grammar.l" 01442 return META_SK_WRITE_PENDING; 01443 YY_BREAK 01444 case 86: 01445 YY_RULE_SETUP 01446 #line 149 "route/cls/ematch_grammar.l" 01447 return META_VLAN; 01448 YY_BREAK 01449 case 87: 01450 YY_RULE_SETUP 01451 #line 150 "route/cls/ematch_grammar.l" 01452 return META_RXHASH; 01453 YY_BREAK 01454 case 88: 01455 YY_RULE_SETUP 01456 #line 152 "route/cls/ematch_grammar.l" 01457 return META_DEVNAME; 01458 YY_BREAK 01459 case 89: 01460 YY_RULE_SETUP 01461 #line 153 "route/cls/ematch_grammar.l" 01462 return META_SK_BOUND_IF; 01463 YY_BREAK 01464 case 90: 01465 YY_RULE_SETUP 01466 #line 156 "route/cls/ematch_grammar.l" 01467 { 01468 yylval->s = strdup(yytext); 01469 if (yylval->s == NULL) 01470 return ERROR; 01471 NL_DBG(4, "lex STR=%s\n", yylval->s); 01472 return STR; 01473 } 01474 YY_BREAK 01475 case 91: 01476 YY_RULE_SETUP 01477 #line 163 "route/cls/ematch_grammar.l" 01478 ECHO; 01479 YY_BREAK 01480 #line 1481 "route/cls/ematch_grammar.c" 01481 case YY_STATE_EOF(INITIAL): 01482 case YY_STATE_EOF(QUOTE): 01483 yyterminate(); 01484 01485 case YY_END_OF_BUFFER: 01486 { 01487 /* Amount of text matched not including the EOB char. */ 01488 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; 01489 01490 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 01491 *yy_cp = yyg->yy_hold_char; 01492 YY_RESTORE_YY_MORE_OFFSET 01493 01494 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 01495 { 01496 /* We're scanning a new file or input source. It's 01497 * possible that this happened because the user 01498 * just pointed yyin at a new source and called 01499 * ematch_lex(). If so, then we have to assure 01500 * consistency between YY_CURRENT_BUFFER and our 01501 * globals. Here is the right place to do so, because 01502 * this is the first action (other than possibly a 01503 * back-up) that will match for the new input source. 01504 */ 01505 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01506 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 01507 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 01508 } 01509 01510 /* Note that here we test for yy_c_buf_p "<=" to the position 01511 * of the first EOB in the buffer, since yy_c_buf_p will 01512 * already have been incremented past the NUL character 01513 * (since all states make transitions on EOB to the 01514 * end-of-buffer state). Contrast this with the test 01515 * in input(). 01516 */ 01517 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) 01518 { /* This was really a NUL. */ 01519 yy_state_type yy_next_state; 01520 01521 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; 01522 01523 yy_current_state = yy_get_previous_state( yyscanner ); 01524 01525 /* Okay, we're now positioned to make the NUL 01526 * transition. We couldn't have 01527 * yy_get_previous_state() go ahead and do it 01528 * for us because it doesn't know how to deal 01529 * with the possibility of jamming (and we don't 01530 * want to build jamming into it because then it 01531 * will run more slowly). 01532 */ 01533 01534 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); 01535 01536 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; 01537 01538 if ( yy_next_state ) 01539 { 01540 /* Consume the NUL. */ 01541 yy_cp = ++yyg->yy_c_buf_p; 01542 yy_current_state = yy_next_state; 01543 goto yy_match; 01544 } 01545 01546 else 01547 { 01548 yy_cp = yyg->yy_c_buf_p; 01549 goto yy_find_action; 01550 } 01551 } 01552 01553 else switch ( yy_get_next_buffer( yyscanner ) ) 01554 { 01555 case EOB_ACT_END_OF_FILE: 01556 { 01557 yyg->yy_did_buffer_switch_on_eof = 0; 01558 01559 if ( ematch_wrap(yyscanner ) ) 01560 { 01561 /* Note: because we've taken care in 01562 * yy_get_next_buffer() to have set up 01563 * yytext, we can now set up 01564 * yy_c_buf_p so that if some total 01565 * hoser (like flex itself) wants to 01566 * call the scanner after we return the 01567 * YY_NULL, it'll still work - another 01568 * YY_NULL will get returned. 01569 */ 01570 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; 01571 01572 yy_act = YY_STATE_EOF(YY_START); 01573 goto do_action; 01574 } 01575 01576 else 01577 { 01578 if ( ! yyg->yy_did_buffer_switch_on_eof ) 01579 YY_NEW_FILE; 01580 } 01581 break; 01582 } 01583 01584 case EOB_ACT_CONTINUE_SCAN: 01585 yyg->yy_c_buf_p = 01586 yyg->yytext_ptr + yy_amount_of_matched_text; 01587 01588 yy_current_state = yy_get_previous_state( yyscanner ); 01589 01590 yy_cp = yyg->yy_c_buf_p; 01591 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; 01592 goto yy_match; 01593 01594 case EOB_ACT_LAST_MATCH: 01595 yyg->yy_c_buf_p = 01596 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; 01597 01598 yy_current_state = yy_get_previous_state( yyscanner ); 01599 01600 yy_cp = yyg->yy_c_buf_p; 01601 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; 01602 goto yy_find_action; 01603 } 01604 break; 01605 } 01606 01607 default: 01608 YY_FATAL_ERROR( 01609 "fatal flex scanner internal error--no action found" ); 01610 } /* end of action switch */ 01611 } /* end of scanning one token */ 01612 } /* end of ematch_lex */ 01613 01614 /* yy_get_next_buffer - try to read in a new buffer 01615 * 01616 * Returns a code representing an action: 01617 * EOB_ACT_LAST_MATCH - 01618 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 01619 * EOB_ACT_END_OF_FILE - end of file 01620 */ 01621 static int yy_get_next_buffer (yyscan_t yyscanner) 01622 { 01623 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01624 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 01625 register char *source = yyg->yytext_ptr; 01626 register int number_to_move, i; 01627 int ret_val; 01628 01629 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) 01630 YY_FATAL_ERROR( 01631 "fatal flex scanner internal error--end of buffer missed" ); 01632 01633 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 01634 { /* Don't try to fill the buffer, so this is an EOF. */ 01635 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) 01636 { 01637 /* We matched a single character, the EOB, so 01638 * treat this as a final EOF. 01639 */ 01640 return EOB_ACT_END_OF_FILE; 01641 } 01642 01643 else 01644 { 01645 /* We matched some text prior to the EOB, first 01646 * process it. 01647 */ 01648 return EOB_ACT_LAST_MATCH; 01649 } 01650 } 01651 01652 /* Try to read more data. */ 01653 01654 /* First move last chars to start of buffer. */ 01655 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; 01656 01657 for ( i = 0; i < number_to_move; ++i ) 01658 *(dest++) = *(source++); 01659 01660 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 01661 /* don't do the read, it's not guaranteed to return an EOF, 01662 * just force an EOF 01663 */ 01664 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; 01665 01666 else 01667 { 01668 int num_to_read = 01669 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 01670 01671 while ( num_to_read <= 0 ) 01672 { /* Not enough room in the buffer - grow it. */ 01673 01674 /* just a shorter name for the current buffer */ 01675 YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 01676 01677 int yy_c_buf_p_offset = 01678 (int) (yyg->yy_c_buf_p - b->yy_ch_buf); 01679 01680 if ( b->yy_is_our_buffer ) 01681 { 01682 int new_size = b->yy_buf_size * 2; 01683 01684 if ( new_size <= 0 ) 01685 b->yy_buf_size += b->yy_buf_size / 8; 01686 else 01687 b->yy_buf_size *= 2; 01688 01689 b->yy_ch_buf = (char *) 01690 /* Include room in for 2 EOB chars. */ 01691 ematch_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); 01692 } 01693 else 01694 /* Can't grow it, we don't own it. */ 01695 b->yy_ch_buf = 0; 01696 01697 if ( ! b->yy_ch_buf ) 01698 YY_FATAL_ERROR( 01699 "fatal error - scanner input buffer overflow" ); 01700 01701 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 01702 01703 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 01704 number_to_move - 1; 01705 01706 } 01707 01708 if ( num_to_read > YY_READ_BUF_SIZE ) 01709 num_to_read = YY_READ_BUF_SIZE; 01710 01711 /* Read in more data. */ 01712 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 01713 yyg->yy_n_chars, (size_t) num_to_read ); 01714 01715 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 01716 } 01717 01718 if ( yyg->yy_n_chars == 0 ) 01719 { 01720 if ( number_to_move == YY_MORE_ADJ ) 01721 { 01722 ret_val = EOB_ACT_END_OF_FILE; 01723 ematch_restart(yyin ,yyscanner); 01724 } 01725 01726 else 01727 { 01728 ret_val = EOB_ACT_LAST_MATCH; 01729 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 01730 YY_BUFFER_EOF_PENDING; 01731 } 01732 } 01733 01734 else 01735 ret_val = EOB_ACT_CONTINUE_SCAN; 01736 01737 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 01738 /* Extend the array by 50%, plus the number we really need. */ 01739 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); 01740 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ematch_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); 01741 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 01742 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 01743 } 01744 01745 yyg->yy_n_chars += number_to_move; 01746 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; 01747 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 01748 01749 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 01750 01751 return ret_val; 01752 } 01753 01754 /* yy_get_previous_state - get the state just before the EOB char was reached */ 01755 01756 static yy_state_type yy_get_previous_state (yyscan_t yyscanner) 01757 { 01758 register yy_state_type yy_current_state; 01759 register char *yy_cp; 01760 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01761 01762 yy_current_state = yyg->yy_start; 01763 01764 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) 01765 { 01766 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 01767 if ( yy_accept[yy_current_state] ) 01768 { 01769 yyg->yy_last_accepting_state = yy_current_state; 01770 yyg->yy_last_accepting_cpos = yy_cp; 01771 } 01772 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01773 { 01774 yy_current_state = (int) yy_def[yy_current_state]; 01775 if ( yy_current_state >= 393 ) 01776 yy_c = yy_meta[(unsigned int) yy_c]; 01777 } 01778 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01779 } 01780 01781 return yy_current_state; 01782 } 01783 01784 /* yy_try_NUL_trans - try to make a transition on the NUL character 01785 * 01786 * synopsis 01787 * next_state = yy_try_NUL_trans( current_state ); 01788 */ 01789 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) 01790 { 01791 register int yy_is_jam; 01792 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ 01793 register char *yy_cp = yyg->yy_c_buf_p; 01794 01795 register YY_CHAR yy_c = 1; 01796 if ( yy_accept[yy_current_state] ) 01797 { 01798 yyg->yy_last_accepting_state = yy_current_state; 01799 yyg->yy_last_accepting_cpos = yy_cp; 01800 } 01801 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01802 { 01803 yy_current_state = (int) yy_def[yy_current_state]; 01804 if ( yy_current_state >= 393 ) 01805 yy_c = yy_meta[(unsigned int) yy_c]; 01806 } 01807 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01808 yy_is_jam = (yy_current_state == 392); 01809 01810 return yy_is_jam ? 0 : yy_current_state; 01811 } 01812 01813 #ifndef YY_NO_INPUT 01814 #ifdef __cplusplus 01815 static int yyinput (yyscan_t yyscanner) 01816 #else 01817 static int input (yyscan_t yyscanner) 01818 #endif 01819 01820 { 01821 int c; 01822 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01823 01824 *yyg->yy_c_buf_p = yyg->yy_hold_char; 01825 01826 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 01827 { 01828 /* yy_c_buf_p now points to the character we want to return. 01829 * If this occurs *before* the EOB characters, then it's a 01830 * valid NUL; if not, then we've hit the end of the buffer. 01831 */ 01832 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) 01833 /* This was really a NUL. */ 01834 *yyg->yy_c_buf_p = '\0'; 01835 01836 else 01837 { /* need more input */ 01838 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; 01839 ++yyg->yy_c_buf_p; 01840 01841 switch ( yy_get_next_buffer( yyscanner ) ) 01842 { 01843 case EOB_ACT_LAST_MATCH: 01844 /* This happens because yy_g_n_b() 01845 * sees that we've accumulated a 01846 * token and flags that we need to 01847 * try matching the token before 01848 * proceeding. But for input(), 01849 * there's no matching to consider. 01850 * So convert the EOB_ACT_LAST_MATCH 01851 * to EOB_ACT_END_OF_FILE. 01852 */ 01853 01854 /* Reset buffer status. */ 01855 ematch_restart(yyin ,yyscanner); 01856 01857 /*FALLTHROUGH*/ 01858 01859 case EOB_ACT_END_OF_FILE: 01860 { 01861 if ( ematch_wrap(yyscanner ) ) 01862 return EOF; 01863 01864 if ( ! yyg->yy_did_buffer_switch_on_eof ) 01865 YY_NEW_FILE; 01866 #ifdef __cplusplus 01867 return yyinput(yyscanner); 01868 #else 01869 return input(yyscanner); 01870 #endif 01871 } 01872 01873 case EOB_ACT_CONTINUE_SCAN: 01874 yyg->yy_c_buf_p = yyg->yytext_ptr + offset; 01875 break; 01876 } 01877 } 01878 } 01879 01880 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ 01881 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ 01882 yyg->yy_hold_char = *++yyg->yy_c_buf_p; 01883 01884 return c; 01885 } 01886 #endif /* ifndef YY_NO_INPUT */ 01887 01888 /** Immediately switch to a different input stream. 01889 * @param input_file A readable stream. 01890 * @param yyscanner The scanner object. 01891 * @note This function does not reset the start condition to @c INITIAL . 01892 */ 01893 void ematch_restart (FILE * input_file , yyscan_t yyscanner) 01894 { 01895 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01896 01897 if ( ! YY_CURRENT_BUFFER ){ 01898 ematch_ensure_buffer_stack (yyscanner); 01899 YY_CURRENT_BUFFER_LVALUE = 01900 ematch__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); 01901 } 01902 01903 ematch__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); 01904 ematch__load_buffer_state(yyscanner ); 01905 } 01906 01907 /** Switch to a different input buffer. 01908 * @param new_buffer The new input buffer. 01909 * @param yyscanner The scanner object. 01910 */ 01911 void ematch__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) 01912 { 01913 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01914 01915 /* TODO. We should be able to replace this entire function body 01916 * with 01917 * ematch_pop_buffer_state(); 01918 * ematch_push_buffer_state(new_buffer); 01919 */ 01920 ematch_ensure_buffer_stack (yyscanner); 01921 if ( YY_CURRENT_BUFFER == new_buffer ) 01922 return; 01923 01924 if ( YY_CURRENT_BUFFER ) 01925 { 01926 /* Flush out information for old buffer. */ 01927 *yyg->yy_c_buf_p = yyg->yy_hold_char; 01928 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; 01929 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 01930 } 01931 01932 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01933 ematch__load_buffer_state(yyscanner ); 01934 01935 /* We don't actually know whether we did this switch during 01936 * EOF (ematch_wrap()) processing, but the only time this flag 01937 * is looked at is after ematch_wrap() is called, so it's safe 01938 * to go ahead and always set it. 01939 */ 01940 yyg->yy_did_buffer_switch_on_eof = 1; 01941 } 01942 01943 static void ematch__load_buffer_state (yyscan_t yyscanner) 01944 { 01945 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01946 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01947 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 01948 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 01949 yyg->yy_hold_char = *yyg->yy_c_buf_p; 01950 } 01951 01952 /** Allocate and initialize an input buffer state. 01953 * @param file A readable stream. 01954 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 01955 * @param yyscanner The scanner object. 01956 * @return the allocated buffer state. 01957 */ 01958 YY_BUFFER_STATE ematch__create_buffer (FILE * file, int size , yyscan_t yyscanner) 01959 { 01960 YY_BUFFER_STATE b; 01961 01962 b = (YY_BUFFER_STATE) ematch_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); 01963 if ( ! b ) 01964 YY_FATAL_ERROR( "out of dynamic memory in ematch__create_buffer()" ); 01965 01966 b->yy_buf_size = size; 01967 01968 /* yy_ch_buf has to be 2 characters longer than the size given because 01969 * we need to put in 2 end-of-buffer characters. 01970 */ 01971 b->yy_ch_buf = (char *) ematch_alloc(b->yy_buf_size + 2 ,yyscanner ); 01972 if ( ! b->yy_ch_buf ) 01973 YY_FATAL_ERROR( "out of dynamic memory in ematch__create_buffer()" ); 01974 01975 b->yy_is_our_buffer = 1; 01976 01977 ematch__init_buffer(b,file ,yyscanner); 01978 01979 return b; 01980 } 01981 01982 /** Destroy the buffer. 01983 * @param b a buffer created with ematch__create_buffer() 01984 * @param yyscanner The scanner object. 01985 */ 01986 void ematch__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) 01987 { 01988 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01989 01990 if ( ! b ) 01991 return; 01992 01993 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 01994 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 01995 01996 if ( b->yy_is_our_buffer ) 01997 ematch_free((void *) b->yy_ch_buf ,yyscanner ); 01998 01999 ematch_free((void *) b ,yyscanner ); 02000 } 02001 02002 #ifndef __cplusplus 02003 extern int isatty (int ); 02004 #endif /* __cplusplus */ 02005 02006 /* Initializes or reinitializes a buffer. 02007 * This function is sometimes called more than once on the same buffer, 02008 * such as during a ematch_restart() or at EOF. 02009 */ 02010 static void ematch__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) 02011 02012 { 02013 int oerrno = errno; 02014 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02015 02016 ematch__flush_buffer(b ,yyscanner); 02017 02018 b->yy_input_file = file; 02019 b->yy_fill_buffer = 1; 02020 02021 /* If b is the current buffer, then ematch__init_buffer was _probably_ 02022 * called from ematch_restart() or through yy_get_next_buffer. 02023 * In that case, we don't want to reset the lineno or column. 02024 */ 02025 if (b != YY_CURRENT_BUFFER){ 02026 b->yy_bs_lineno = 1; 02027 b->yy_bs_column = 0; 02028 } 02029 02030 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 02031 02032 errno = oerrno; 02033 } 02034 02035 /** Discard all buffered characters. On the next scan, YY_INPUT will be called. 02036 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 02037 * @param yyscanner The scanner object. 02038 */ 02039 void ematch__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) 02040 { 02041 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02042 if ( ! b ) 02043 return; 02044 02045 b->yy_n_chars = 0; 02046 02047 /* We always need two end-of-buffer characters. The first causes 02048 * a transition to the end-of-buffer state. The second causes 02049 * a jam in that state. 02050 */ 02051 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 02052 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 02053 02054 b->yy_buf_pos = &b->yy_ch_buf[0]; 02055 02056 b->yy_at_bol = 1; 02057 b->yy_buffer_status = YY_BUFFER_NEW; 02058 02059 if ( b == YY_CURRENT_BUFFER ) 02060 ematch__load_buffer_state(yyscanner ); 02061 } 02062 02063 /** Pushes the new state onto the stack. The new state becomes 02064 * the current state. This function will allocate the stack 02065 * if necessary. 02066 * @param new_buffer The new state. 02067 * @param yyscanner The scanner object. 02068 */ 02069 void ematch_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) 02070 { 02071 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02072 if (new_buffer == NULL) 02073 return; 02074 02075 ematch_ensure_buffer_stack(yyscanner); 02076 02077 /* This block is copied from ematch__switch_to_buffer. */ 02078 if ( YY_CURRENT_BUFFER ) 02079 { 02080 /* Flush out information for old buffer. */ 02081 *yyg->yy_c_buf_p = yyg->yy_hold_char; 02082 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; 02083 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 02084 } 02085 02086 /* Only push if top exists. Otherwise, replace top. */ 02087 if (YY_CURRENT_BUFFER) 02088 yyg->yy_buffer_stack_top++; 02089 YY_CURRENT_BUFFER_LVALUE = new_buffer; 02090 02091 /* copied from ematch__switch_to_buffer. */ 02092 ematch__load_buffer_state(yyscanner ); 02093 yyg->yy_did_buffer_switch_on_eof = 1; 02094 } 02095 02096 /** Removes and deletes the top of the stack, if present. 02097 * The next element becomes the new top. 02098 * @param yyscanner The scanner object. 02099 */ 02100 void ematch_pop_buffer_state (yyscan_t yyscanner) 02101 { 02102 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02103 if (!YY_CURRENT_BUFFER) 02104 return; 02105 02106 ematch__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); 02107 YY_CURRENT_BUFFER_LVALUE = NULL; 02108 if (yyg->yy_buffer_stack_top > 0) 02109 --yyg->yy_buffer_stack_top; 02110 02111 if (YY_CURRENT_BUFFER) { 02112 ematch__load_buffer_state(yyscanner ); 02113 yyg->yy_did_buffer_switch_on_eof = 1; 02114 } 02115 } 02116 02117 /* Allocates the stack if it does not exist. 02118 * Guarantees space for at least one push. 02119 */ 02120 static void ematch_ensure_buffer_stack (yyscan_t yyscanner) 02121 { 02122 int num_to_alloc; 02123 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02124 02125 if (!yyg->yy_buffer_stack) { 02126 02127 /* First allocation is just for 2 elements, since we don't know if this 02128 * scanner will even need a stack. We use 2 instead of 1 to avoid an 02129 * immediate realloc on the next call. 02130 */ 02131 num_to_alloc = 1; 02132 yyg->yy_buffer_stack = (struct yy_buffer_state**)ematch_alloc 02133 (num_to_alloc * sizeof(struct yy_buffer_state*) 02134 , yyscanner); 02135 if ( ! yyg->yy_buffer_stack ) 02136 YY_FATAL_ERROR( "out of dynamic memory in ematch_ensure_buffer_stack()" ); 02137 02138 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 02139 02140 yyg->yy_buffer_stack_max = num_to_alloc; 02141 yyg->yy_buffer_stack_top = 0; 02142 return; 02143 } 02144 02145 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ 02146 02147 /* Increase the buffer to prepare for a possible push. */ 02148 int grow_size = 8 /* arbitrary grow size */; 02149 02150 num_to_alloc = yyg->yy_buffer_stack_max + grow_size; 02151 yyg->yy_buffer_stack = (struct yy_buffer_state**)ematch_realloc 02152 (yyg->yy_buffer_stack, 02153 num_to_alloc * sizeof(struct yy_buffer_state*) 02154 , yyscanner); 02155 if ( ! yyg->yy_buffer_stack ) 02156 YY_FATAL_ERROR( "out of dynamic memory in ematch_ensure_buffer_stack()" ); 02157 02158 /* zero only the new slots.*/ 02159 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); 02160 yyg->yy_buffer_stack_max = num_to_alloc; 02161 } 02162 } 02163 02164 /** Setup the input buffer state to scan directly from a user-specified character buffer. 02165 * @param base the character buffer 02166 * @param size the size in bytes of the character buffer 02167 * @param yyscanner The scanner object. 02168 * @return the newly allocated buffer state object. 02169 */ 02170 YY_BUFFER_STATE ematch__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) 02171 { 02172 YY_BUFFER_STATE b; 02173 02174 if ( size < 2 || 02175 base[size-2] != YY_END_OF_BUFFER_CHAR || 02176 base[size-1] != YY_END_OF_BUFFER_CHAR ) 02177 /* They forgot to leave room for the EOB's. */ 02178 return 0; 02179 02180 b = (YY_BUFFER_STATE) ematch_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); 02181 if ( ! b ) 02182 YY_FATAL_ERROR( "out of dynamic memory in ematch__scan_buffer()" ); 02183 02184 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 02185 b->yy_buf_pos = b->yy_ch_buf = base; 02186 b->yy_is_our_buffer = 0; 02187 b->yy_input_file = 0; 02188 b->yy_n_chars = b->yy_buf_size; 02189 b->yy_is_interactive = 0; 02190 b->yy_at_bol = 1; 02191 b->yy_fill_buffer = 0; 02192 b->yy_buffer_status = YY_BUFFER_NEW; 02193 02194 ematch__switch_to_buffer(b ,yyscanner ); 02195 02196 return b; 02197 } 02198 02199 /** Setup the input buffer state to scan a string. The next call to ematch_lex() will 02200 * scan from a @e copy of @a str. 02201 * @param yystr a NUL-terminated string to scan 02202 * @param yyscanner The scanner object. 02203 * @return the newly allocated buffer state object. 02204 * @note If you want to scan bytes that may contain NUL values, then use 02205 * ematch__scan_bytes() instead. 02206 */ 02207 YY_BUFFER_STATE ematch__scan_string (yyconst char * yystr , yyscan_t yyscanner) 02208 { 02209 02210 return ematch__scan_bytes(yystr,strlen(yystr) ,yyscanner); 02211 } 02212 02213 /** Setup the input buffer state to scan the given bytes. The next call to ematch_lex() will 02214 * scan from a @e copy of @a bytes. 02215 * @param bytes the byte buffer to scan 02216 * @param len the number of bytes in the buffer pointed to by @a bytes. 02217 * @param yyscanner The scanner object. 02218 * @return the newly allocated buffer state object. 02219 */ 02220 YY_BUFFER_STATE ematch__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) 02221 { 02222 YY_BUFFER_STATE b; 02223 char *buf; 02224 yy_size_t n; 02225 int i; 02226 02227 /* Get memory for full buffer, including space for trailing EOB's. */ 02228 n = _yybytes_len + 2; 02229 buf = (char *) ematch_alloc(n ,yyscanner ); 02230 if ( ! buf ) 02231 YY_FATAL_ERROR( "out of dynamic memory in ematch__scan_bytes()" ); 02232 02233 for ( i = 0; i < _yybytes_len; ++i ) 02234 buf[i] = yybytes[i]; 02235 02236 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 02237 02238 b = ematch__scan_buffer(buf,n ,yyscanner); 02239 if ( ! b ) 02240 YY_FATAL_ERROR( "bad buffer in ematch__scan_bytes()" ); 02241 02242 /* It's okay to grow etc. this buffer, and we should throw it 02243 * away when we're done. 02244 */ 02245 b->yy_is_our_buffer = 1; 02246 02247 return b; 02248 } 02249 02250 #ifndef YY_EXIT_FAILURE 02251 #define YY_EXIT_FAILURE 2 02252 #endif 02253 02254 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) 02255 { 02256 (void) fprintf( stderr, "%s\n", msg ); 02257 exit( YY_EXIT_FAILURE ); 02258 } 02259 02260 /* Redefine yyless() so it works in section 3 code. */ 02261 02262 #undef yyless 02263 #define yyless(n) \ 02264 do \ 02265 { \ 02266 /* Undo effects of setting up yytext. */ \ 02267 int yyless_macro_arg = (n); \ 02268 YY_LESS_LINENO(yyless_macro_arg);\ 02269 yytext[yyleng] = yyg->yy_hold_char; \ 02270 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ 02271 yyg->yy_hold_char = *yyg->yy_c_buf_p; \ 02272 *yyg->yy_c_buf_p = '\0'; \ 02273 yyleng = yyless_macro_arg; \ 02274 } \ 02275 while ( 0 ) 02276 02277 /* Accessor methods (get/set functions) to struct members. */ 02278 02279 /** Get the user-defined data for this scanner. 02280 * @param yyscanner The scanner object. 02281 */ 02282 YY_EXTRA_TYPE ematch_get_extra (yyscan_t yyscanner) 02283 { 02284 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02285 return yyextra; 02286 } 02287 02288 /** Get the current line number. 02289 * @param yyscanner The scanner object. 02290 */ 02291 int ematch_get_lineno (yyscan_t yyscanner) 02292 { 02293 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02294 02295 if (! YY_CURRENT_BUFFER) 02296 return 0; 02297 02298 return yylineno; 02299 } 02300 02301 /** Get the current column number. 02302 * @param yyscanner The scanner object. 02303 */ 02304 int ematch_get_column (yyscan_t yyscanner) 02305 { 02306 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02307 02308 if (! YY_CURRENT_BUFFER) 02309 return 0; 02310 02311 return yycolumn; 02312 } 02313 02314 /** Get the input stream. 02315 * @param yyscanner The scanner object. 02316 */ 02317 FILE *ematch_get_in (yyscan_t yyscanner) 02318 { 02319 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02320 return yyin; 02321 } 02322 02323 /** Get the output stream. 02324 * @param yyscanner The scanner object. 02325 */ 02326 FILE *ematch_get_out (yyscan_t yyscanner) 02327 { 02328 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02329 return yyout; 02330 } 02331 02332 /** Get the length of the current token. 02333 * @param yyscanner The scanner object. 02334 */ 02335 int ematch_get_leng (yyscan_t yyscanner) 02336 { 02337 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02338 return yyleng; 02339 } 02340 02341 /** Get the current token. 02342 * @param yyscanner The scanner object. 02343 */ 02344 02345 char *ematch_get_text (yyscan_t yyscanner) 02346 { 02347 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02348 return yytext; 02349 } 02350 02351 /** Set the user-defined data. This data is never touched by the scanner. 02352 * @param user_defined The data to be associated with this scanner. 02353 * @param yyscanner The scanner object. 02354 */ 02355 void ematch_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) 02356 { 02357 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02358 yyextra = user_defined ; 02359 } 02360 02361 /** Set the current line number. 02362 * @param line_number 02363 * @param yyscanner The scanner object. 02364 */ 02365 void ematch_set_lineno (int line_number , yyscan_t yyscanner) 02366 { 02367 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02368 02369 /* lineno is only valid if an input buffer exists. */ 02370 if (! YY_CURRENT_BUFFER ) 02371 yy_fatal_error( "ematch_set_lineno called with no buffer" , yyscanner); 02372 02373 yylineno = line_number; 02374 } 02375 02376 /** Set the current column. 02377 * @param line_number 02378 * @param yyscanner The scanner object. 02379 */ 02380 void ematch_set_column (int column_no , yyscan_t yyscanner) 02381 { 02382 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02383 02384 /* column is only valid if an input buffer exists. */ 02385 if (! YY_CURRENT_BUFFER ) 02386 yy_fatal_error( "ematch_set_column called with no buffer" , yyscanner); 02387 02388 yycolumn = column_no; 02389 } 02390 02391 /** Set the input stream. This does not discard the current 02392 * input buffer. 02393 * @param in_str A readable stream. 02394 * @param yyscanner The scanner object. 02395 * @see ematch__switch_to_buffer 02396 */ 02397 void ematch_set_in (FILE * in_str , yyscan_t yyscanner) 02398 { 02399 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02400 yyin = in_str ; 02401 } 02402 02403 void ematch_set_out (FILE * out_str , yyscan_t yyscanner) 02404 { 02405 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02406 yyout = out_str ; 02407 } 02408 02409 int ematch_get_debug (yyscan_t yyscanner) 02410 { 02411 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02412 return yy_flex_debug; 02413 } 02414 02415 void ematch_set_debug (int bdebug , yyscan_t yyscanner) 02416 { 02417 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02418 yy_flex_debug = bdebug ; 02419 } 02420 02421 /* Accessor methods for yylval and yylloc */ 02422 02423 YYSTYPE * ematch_get_lval (yyscan_t yyscanner) 02424 { 02425 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02426 return yylval; 02427 } 02428 02429 void ematch_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) 02430 { 02431 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02432 yylval = yylval_param; 02433 } 02434 02435 /* User-visible API */ 02436 02437 /* ematch_lex_init is special because it creates the scanner itself, so it is 02438 * the ONLY reentrant function that doesn't take the scanner as the last argument. 02439 * That's why we explicitly handle the declaration, instead of using our macros. 02440 */ 02441 02442 int ematch_lex_init(yyscan_t* ptr_yy_globals) 02443 02444 { 02445 if (ptr_yy_globals == NULL){ 02446 errno = EINVAL; 02447 return 1; 02448 } 02449 02450 *ptr_yy_globals = (yyscan_t) ematch_alloc ( sizeof( struct yyguts_t ), NULL ); 02451 02452 if (*ptr_yy_globals == NULL){ 02453 errno = ENOMEM; 02454 return 1; 02455 } 02456 02457 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ 02458 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 02459 02460 return yy_init_globals ( *ptr_yy_globals ); 02461 } 02462 02463 /* ematch_lex_init_extra has the same functionality as ematch_lex_init, but follows the 02464 * convention of taking the scanner as the last argument. Note however, that 02465 * this is a *pointer* to a scanner, as it will be allocated by this call (and 02466 * is the reason, too, why this function also must handle its own declaration). 02467 * The user defined value in the first argument will be available to ematch_alloc in 02468 * the yyextra field. 02469 */ 02470 02471 int ematch_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) 02472 02473 { 02474 struct yyguts_t dummy_yyguts; 02475 02476 ematch_set_extra (yy_user_defined, &dummy_yyguts); 02477 02478 if (ptr_yy_globals == NULL){ 02479 errno = EINVAL; 02480 return 1; 02481 } 02482 02483 *ptr_yy_globals = (yyscan_t) ematch_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); 02484 02485 if (*ptr_yy_globals == NULL){ 02486 errno = ENOMEM; 02487 return 1; 02488 } 02489 02490 /* By setting to 0xAA, we expose bugs in 02491 yy_init_globals. Leave at 0x00 for releases. */ 02492 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 02493 02494 ematch_set_extra (yy_user_defined, *ptr_yy_globals); 02495 02496 return yy_init_globals ( *ptr_yy_globals ); 02497 } 02498 02499 static int yy_init_globals (yyscan_t yyscanner) 02500 { 02501 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02502 /* Initialization is the same as for the non-reentrant scanner. 02503 * This function is called from ematch_lex_destroy(), so don't allocate here. 02504 */ 02505 02506 yyg->yy_buffer_stack = 0; 02507 yyg->yy_buffer_stack_top = 0; 02508 yyg->yy_buffer_stack_max = 0; 02509 yyg->yy_c_buf_p = (char *) 0; 02510 yyg->yy_init = 0; 02511 yyg->yy_start = 0; 02512 02513 yyg->yy_start_stack_ptr = 0; 02514 yyg->yy_start_stack_depth = 0; 02515 yyg->yy_start_stack = NULL; 02516 02517 /* Defined in main.c */ 02518 #ifdef YY_STDINIT 02519 yyin = stdin; 02520 yyout = stdout; 02521 #else 02522 yyin = (FILE *) 0; 02523 yyout = (FILE *) 0; 02524 #endif 02525 02526 /* For future reference: Set errno on error, since we are called by 02527 * ematch_lex_init() 02528 */ 02529 return 0; 02530 } 02531 02532 /* ematch_lex_destroy is for both reentrant and non-reentrant scanners. */ 02533 int ematch_lex_destroy (yyscan_t yyscanner) 02534 { 02535 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02536 02537 /* Pop the buffer stack, destroying each element. */ 02538 while(YY_CURRENT_BUFFER){ 02539 ematch__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); 02540 YY_CURRENT_BUFFER_LVALUE = NULL; 02541 ematch_pop_buffer_state(yyscanner); 02542 } 02543 02544 /* Destroy the stack itself. */ 02545 ematch_free(yyg->yy_buffer_stack ,yyscanner); 02546 yyg->yy_buffer_stack = NULL; 02547 02548 /* Destroy the start condition stack. */ 02549 ematch_free(yyg->yy_start_stack ,yyscanner ); 02550 yyg->yy_start_stack = NULL; 02551 02552 /* Reset the globals. This is important in a non-reentrant scanner so the next time 02553 * ematch_lex() is called, initialization will occur. */ 02554 yy_init_globals( yyscanner); 02555 02556 /* Destroy the main struct (reentrant only). */ 02557 ematch_free ( yyscanner , yyscanner ); 02558 yyscanner = NULL; 02559 return 0; 02560 } 02561 02562 /* 02563 * Internal utility routines. 02564 */ 02565 02566 #ifndef yytext_ptr 02567 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) 02568 { 02569 register int i; 02570 for ( i = 0; i < n; ++i ) 02571 s1[i] = s2[i]; 02572 } 02573 #endif 02574 02575 #ifdef YY_NEED_STRLEN 02576 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) 02577 { 02578 register int n; 02579 for ( n = 0; s[n]; ++n ) 02580 ; 02581 02582 return n; 02583 } 02584 #endif 02585 02586 void *ematch_alloc (yy_size_t size , yyscan_t yyscanner) 02587 { 02588 return (void *) malloc( size ); 02589 } 02590 02591 void *ematch_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) 02592 { 02593 /* The cast to (char *) in the following accommodates both 02594 * implementations that use char* generic pointers, and those 02595 * that use void* generic pointers. It works with the latter 02596 * because both ANSI C and C++ allow castless assignment from 02597 * any pointer type to void*, and deal with argument conversions 02598 * as though doing an assignment. 02599 */ 02600 return (void *) realloc( (char *) ptr, size ); 02601 } 02602 02603 void ematch_free (void * ptr , yyscan_t yyscanner) 02604 { 02605 free( (char *) ptr ); /* see ematch_realloc() for (char *) cast */ 02606 } 02607 02608 #define YYTABLES_NAME "yytables" 02609 02610 #line 163 "route/cls/ematch_grammar.l"