[insert project logo here (125x200px max)] Navigator Mailinglists Please report any errors or ommissions you find to our `Help' mailinglist, or post a message in the Forums. Copyright and Licensing Information Snap is (c) Jonathan T. Moore, 1999-2002 and licensed under the GNU General Public License (GPL). All other parts of Splash are (c) Willem de Bruijn, 2002-2003 and licensed under the BSD Open Source License. All sourcecode is made publicly available. Acknowledgement Splash and the Splash website are hosted by SourceForge.net |
Splash - DocumentationSNMP Plus a Lightweight API for SNAP Handlingsnap-1.1-wjdb/utils/snaplex.cGo to the documentation of this file.00001 /* A lexical scanner generated by flex */ 00002 00003 /* Scanner skeleton version: 00004 * $Header: /cvsroot/splash-snap/snapsnmp/code/snap-1.1-wjdb/utils/snaplex.c,v 1.3 2003/04/16 10:58:59 wdebruij Exp $ 00005 */ 00006 00007 #define FLEX_SCANNER 00008 #define YY_FLEX_MAJOR_VERSION 2 00009 #define YY_FLEX_MINOR_VERSION 5 00010 00011 #include <stdio.h> 00012 #include <unistd.h> 00013 00014 00015 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ 00016 #ifdef c_plusplus 00017 #ifndef __cplusplus 00018 #define __cplusplus 00019 #endif 00020 #endif 00021 00022 00023 #ifdef __cplusplus 00024 00025 #include <stdlib.h> 00026 00027 /* Use prototypes in function declarations. */ 00028 #define YY_USE_PROTOS 00029 00030 /* The "const" storage-class-modifier is valid. */ 00031 #define YY_USE_CONST 00032 00033 #else /* ! __cplusplus */ 00034 00035 #if __STDC__ 00036 00037 #define YY_USE_PROTOS 00038 #define YY_USE_CONST 00039 00040 #endif /* __STDC__ */ 00041 #endif /* ! __cplusplus */ 00042 00043 #ifdef __TURBOC__ 00044 #pragma warn -rch 00045 #pragma warn -use 00046 #include <io.h> 00047 #include <stdlib.h> 00048 #define YY_USE_CONST 00049 #define YY_USE_PROTOS 00050 #endif 00051 00052 #ifdef YY_USE_CONST 00053 #define yyconst const 00054 #else 00055 #define yyconst 00056 #endif 00057 00058 00059 #ifdef YY_USE_PROTOS 00060 #define YY_PROTO(proto) proto 00061 #else 00062 #define YY_PROTO(proto) () 00063 #endif 00064 00065 /* Returned upon end-of-file. */ 00066 #define YY_NULL 0 00067 00068 /* Promotes a possibly negative, possibly signed char to an unsigned 00069 * integer for use as an array index. If the signed char is negative, 00070 * we want to instead treat it as an 8-bit unsigned char, hence the 00071 * double cast. 00072 */ 00073 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 00074 00075 /* Enter a start condition. This macro really ought to take a parameter, 00076 * but we do it the disgusting crufty way forced on us by the ()-less 00077 * definition of BEGIN. 00078 */ 00079 #define BEGIN yy_start = 1 + 2 * 00080 00081 /* Translate the current start state into a value that can be later handed 00082 * to BEGIN to return to the state. The YYSTATE alias is for lex 00083 * compatibility. 00084 */ 00085 #define YY_START ((yy_start - 1) / 2) 00086 #define YYSTATE YY_START 00087 00088 /* Action number for EOF rule of a given start state. */ 00089 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 00090 00091 /* Special action meaning "start processing a new file". */ 00092 #define YY_NEW_FILE yyrestart( yyin ) 00093 00094 #define YY_END_OF_BUFFER_CHAR 0 00095 00096 /* Size of default input buffer. */ 00097 #define YY_BUF_SIZE 16384 00098 00099 typedef struct yy_buffer_state *YY_BUFFER_STATE; 00100 00101 extern int yyleng; 00102 extern FILE *yyin, *yyout; 00103 00104 #define EOB_ACT_CONTINUE_SCAN 0 00105 #define EOB_ACT_END_OF_FILE 1 00106 #define EOB_ACT_LAST_MATCH 2 00107 00108 /* The funky do-while in the following #define is used to turn the definition 00109 * int a single C statement (which needs a semi-colon terminator). This 00110 * avoids problems with code like: 00111 * 00112 * if ( condition_holds ) 00113 * yyless( 5 ); 00114 * else 00115 * do_something_else(); 00116 * 00117 * Prior to using the do-while the compiler would get upset at the 00118 * "else" because it interpreted the "if" statement as being all 00119 * done when it reached the ';' after the yyless() call. 00120 */ 00121 00122 /* Return all but the first 'n' matched characters back to the input stream. */ 00123 00124 #define yyless(n) \ 00125 do \ 00126 { \ 00127 /* Undo effects of setting up yytext. */ \ 00128 *yy_cp = yy_hold_char; \ 00129 YY_RESTORE_YY_MORE_OFFSET \ 00130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ 00131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 00132 } \ 00133 while ( 0 ) 00134 00135 #define unput(c) yyunput( c, yytext_ptr ) 00136 00137 /* The following is because we cannot portably get our hands on size_t 00138 * (without autoconf's help, which isn't available because we want 00139 * flex-generated scanners to compile on their own). 00140 */ 00141 typedef unsigned int yy_size_t; 00142 00143 00144 struct yy_buffer_state 00145 { 00146 FILE *yy_input_file; 00147 00148 char *yy_ch_buf; /* input buffer */ 00149 char *yy_buf_pos; /* current position in input buffer */ 00150 00151 /* Size of input buffer in bytes, not including room for EOB 00152 * characters. 00153 */ 00154 yy_size_t yy_buf_size; 00155 00156 /* Number of characters read into yy_ch_buf, not including EOB 00157 * characters. 00158 */ 00159 int yy_n_chars; 00160 00161 /* Whether we "own" the buffer - i.e., we know we created it, 00162 * and can realloc() it to grow it, and should free() it to 00163 * delete it. 00164 */ 00165 int yy_is_our_buffer; 00166 00167 /* Whether this is an "interactive" input source; if so, and 00168 * if we're using stdio for input, then we want to use getc() 00169 * instead of fread(), to make sure we stop fetching input after 00170 * each newline. 00171 */ 00172 int yy_is_interactive; 00173 00174 /* Whether we're considered to be at the beginning of a line. 00175 * If so, '^' rules will be active on the next match, otherwise 00176 * not. 00177 */ 00178 int yy_at_bol; 00179 00180 /* Whether to try to fill the input buffer when we reach the 00181 * end of it. 00182 */ 00183 int yy_fill_buffer; 00184 00185 int yy_buffer_status; 00186 #define YY_BUFFER_NEW 0 00187 #define YY_BUFFER_NORMAL 1 00188 /* When an EOF's been seen but there's still some text to process 00189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we 00190 * shouldn't try reading from the input source any more. We might 00191 * still have a bunch of tokens to match, though, because of 00192 * possible backing-up. 00193 * 00194 * When we actually see the EOF, we change the status to "new" 00195 * (via yyrestart()), so that the user can continue scanning by 00196 * just pointing yyin at a new input file. 00197 */ 00198 #define YY_BUFFER_EOF_PENDING 2 00199 }; 00200 00201 static YY_BUFFER_STATE yy_current_buffer = 0; 00202 00203 /* We provide macros for accessing buffer states in case in the 00204 * future we want to put the buffer states in a more general 00205 * "scanner state". 00206 */ 00207 #define YY_CURRENT_BUFFER yy_current_buffer 00208 00209 00210 /* yy_hold_char holds the character lost when yytext is formed. */ 00211 static char yy_hold_char; 00212 00213 static int yy_n_chars; /* number of characters read into yy_ch_buf */ 00214 00215 00216 int yyleng; 00217 00218 /* Points to current character in buffer. */ 00219 static char *yy_c_buf_p = (char *) 0; 00220 static int yy_init = 1; /* whether we need to initialize */ 00221 static int yy_start = 0; /* start state number */ 00222 00223 /* Flag which is used to allow yywrap()'s to do buffer switches 00224 * instead of setting up a fresh yyin. A bit of a hack ... 00225 */ 00226 static int yy_did_buffer_switch_on_eof; 00227 00228 void yyrestart YY_PROTO(( FILE *input_file )); 00229 00230 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); 00231 void yy_load_buffer_state YY_PROTO(( void )); 00232 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); 00233 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); 00234 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); 00235 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); 00236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) 00237 00238 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); 00239 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); 00240 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); 00241 00242 static void *yy_flex_alloc YY_PROTO(( yy_size_t )); 00243 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); 00244 static void yy_flex_free YY_PROTO(( void * )); 00245 00246 #define yy_new_buffer yy_create_buffer 00247 00248 #define yy_set_interactive(is_interactive) \ 00249 { \ 00250 if ( ! yy_current_buffer ) \ 00251 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 00252 yy_current_buffer->yy_is_interactive = is_interactive; \ 00253 } 00254 00255 #define yy_set_bol(at_bol) \ 00256 { \ 00257 if ( ! yy_current_buffer ) \ 00258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 00259 yy_current_buffer->yy_at_bol = at_bol; \ 00260 } 00261 00262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 00263 00264 typedef unsigned char YY_CHAR; 00265 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 00266 typedef int yy_state_type; 00267 extern char *yytext; 00268 #define yytext_ptr yytext 00269 00270 static yy_state_type yy_get_previous_state YY_PROTO(( void )); 00271 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); 00272 static int yy_get_next_buffer YY_PROTO(( void )); 00273 static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); 00274 00275 /* Done after the current pattern has been matched and before the 00276 * corresponding action - sets up yytext. 00277 */ 00278 #define YY_DO_BEFORE_ACTION \ 00279 yytext_ptr = yy_bp; \ 00280 yyleng = (int) (yy_cp - yy_bp); \ 00281 yy_hold_char = *yy_cp; \ 00282 *yy_cp = '\0'; \ 00283 yy_c_buf_p = yy_cp; 00284 00285 #define YY_NUM_RULES 102 00286 #define YY_END_OF_BUFFER 103 00287 static yyconst short int yy_accept[468] = 00288 { 0, 00289 0, 0, 103, 102, 1, 102, 102, 89, 90, 87, 00290 91, 88, 102, 95, 102, 102, 102, 102, 102, 102, 00291 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 00292 102, 102, 102, 100, 100, 100, 100, 100, 100, 100, 00293 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 00294 100, 100, 102, 1, 0, 98, 0, 0, 0, 95, 00295 96, 0, 95, 97, 0, 2, 0, 0, 0, 0, 00296 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 00297 0, 69, 0, 0, 0, 13, 0, 0, 0, 71, 00298 0, 0, 0, 0, 0, 0, 34, 0, 61, 0, 00299 00300 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00301 0, 0, 100, 101, 100, 100, 100, 100, 100, 100, 00302 100, 100, 100, 100, 10, 100, 100, 100, 69, 100, 00303 100, 100, 13, 100, 100, 100, 71, 100, 100, 100, 00304 100, 100, 100, 100, 34, 100, 61, 100, 100, 100, 00305 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 00306 0, 0, 0, 96, 19, 32, 0, 16, 17, 0, 00307 0, 0, 25, 0, 9, 0, 99, 0, 68, 0, 00308 73, 0, 55, 0, 0, 45, 64, 70, 0, 0, 00309 75, 0, 27, 0, 28, 12, 29, 63, 33, 14, 00310 00311 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00312 0, 0, 0, 21, 0, 0, 19, 32, 100, 16, 00313 17, 100, 100, 100, 25, 100, 9, 100, 100, 68, 00314 100, 73, 100, 55, 100, 100, 45, 64, 70, 100, 00315 100, 75, 100, 27, 100, 100, 28, 12, 29, 63, 00316 33, 14, 6, 100, 100, 100, 100, 100, 100, 100, 00317 100, 100, 100, 100, 100, 21, 100, 100, 94, 0, 00318 0, 0, 18, 31, 0, 0, 0, 0, 24, 0, 00319 3, 56, 72, 0, 0, 0, 0, 50, 0, 0, 00320 74, 30, 36, 0, 26, 23, 11, 5, 0, 7, 00321 00322 4, 0, 0, 40, 38, 0, 54, 0, 42, 0, 00323 0, 20, 66, 15, 18, 31, 100, 100, 100, 100, 00324 24, 100, 3, 56, 72, 100, 100, 100, 100, 50, 00325 100, 100, 74, 30, 36, 100, 26, 23, 100, 11, 00326 5, 100, 7, 4, 100, 100, 40, 38, 100, 54, 00327 100, 42, 100, 100, 20, 66, 15, 79, 0, 44, 00328 67, 59, 81, 80, 0, 0, 76, 46, 0, 0, 00329 0, 65, 35, 62, 22, 60, 0, 0, 52, 39, 00330 37, 53, 77, 41, 0, 8, 44, 67, 59, 81, 00331 80, 100, 100, 76, 46, 100, 100, 100, 65, 35, 00332 00333 62, 22, 86, 60, 100, 100, 52, 39, 37, 53, 00334 77, 41, 100, 8, 0, 43, 58, 0, 57, 48, 00335 49, 47, 51, 0, 78, 0, 0, 43, 58, 100, 00336 57, 48, 49, 47, 51, 100, 78, 100, 100, 92, 00337 82, 0, 0, 0, 82, 100, 100, 100, 0, 0, 00338 0, 0, 100, 100, 100, 93, 85, 0, 0, 85, 00339 100, 100, 84, 83, 84, 83, 0 00340 } ; 00341 00342 static yyconst int yy_ec[256] = 00343 { 0, 00344 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 00345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00347 1, 2, 1, 4, 5, 1, 1, 1, 1, 6, 00348 7, 1, 8, 9, 10, 11, 1, 12, 12, 12, 00349 12, 12, 12, 12, 12, 12, 12, 13, 14, 1, 00350 1, 1, 1, 1, 15, 16, 17, 18, 19, 20, 00351 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 00352 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 00353 1, 41, 1, 1, 42, 1, 43, 44, 45, 46, 00354 00355 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 00356 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 00357 67, 68, 1, 69, 1, 1, 1, 1, 1, 1, 00358 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00359 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00365 00366 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00367 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00368 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00369 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00370 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00371 1, 1, 1, 1, 1 00372 } ; 00373 00374 static yyconst int yy_meta[70] = 00375 { 0, 00376 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 00377 1, 3, 3, 1, 3, 3, 3, 3, 3, 3, 00378 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 00379 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 00380 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 00381 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 00382 3, 3, 3, 3, 3, 3, 3, 3, 1 00383 } ; 00384 00385 static yyconst short int yy_base[471] = 00386 { 0, 00387 0, 0, 1104, 1105, 68, 68, 55, 1105, 1105, 1105, 00388 1105, 63, 1091, 65, 1099, 60, 63, 64, 64, 54, 00389 57, 70, 74, 57, 71, 105, 101, 108, 63, 128, 00390 147, 158, 98, 122, 170, 131, 183, 169, 140, 199, 00391 182, 166, 200, 1088, 219, 229, 236, 211, 286, 276, 00392 337, 227, 1088, 96, 143, 1105, 272, 226, 1087, 137, 00393 1086, 1085, 225, 1105, 1093, 1105, 227, 232, 244, 222, 00394 248, 242, 247, 250, 258, 278, 285, 288, 1083, 280, 00395 283, 297, 291, 294, 319, 1105, 299, 297, 313, 324, 00396 325, 342, 335, 343, 328, 344, 344, 344, 1105, 340, 00397 00398 353, 353, 354, 343, 358, 364, 363, 364, 388, 393, 00399 395, 398, 1077, 1105, 402, 403, 409, 410, 413, 416, 00400 417, 405, 415, 414, 423, 430, 422, 425, 434, 426, 00401 450, 454, 1074, 462, 442, 451, 482, 455, 478, 481, 00402 121, 498, 464, 484, 487, 489, 1073, 501, 499, 510, 00403 502, 514, 515, 526, 517, 527, 539, 542, 543, 548, 00404 90, 1073, 508, 454, 525, 539, 533, 1105, 1105, 541, 00405 534, 543, 555, 552, 1105, 547, 1072, 546, 561, 567, 00406 1105, 568, 1105, 570, 557, 1105, 1105, 575, 567, 576, 00407 1105, 569, 582, 573, 1105, 587, 1105, 1105, 1105, 1105, 00408 00409 591, 588, 592, 597, 589, 589, 610, 605, 613, 596, 00410 603, 622, 608, 618, 607, 621, 635, 643, 641, 1070, 00411 1068, 644, 642, 647, 659, 648, 1067, 650, 662, 665, 00412 682, 1066, 670, 1065, 672, 668, 1064, 1063, 667, 679, 00413 680, 1061, 674, 688, 710, 250, 1060, 707, 1059, 1058, 00414 1057, 1056, 709, 712, 720, 713, 716, 711, 735, 734, 00415 738, 741, 725, 749, 739, 742, 744, 751, 1105, 1056, 00416 752, 1055, 1105, 1105, 735, 737, 738, 745, 1105, 765, 00417 1105, 751, 1105, 753, 770, 774, 770, 1105, 759, 762, 00418 1105, 1105, 773, 771, 1105, 782, 1105, 1105, 772, 776, 00419 00420 1105, 793, 796, 794, 798, 786, 1105, 801, 802, 801, 00421 808, 1105, 1105, 1105, 1053, 1051, 818, 823, 819, 822, 00422 1050, 826, 1049, 828, 1048, 825, 829, 847, 835, 1044, 00423 851, 848, 1043, 1039, 853, 858, 1038, 856, 1037, 1035, 00424 1031, 855, 861, 1030, 879, 883, 886, 887, 869, 1027, 00425 890, 895, 888, 901, 1026, 1025, 1023, 1105, 685, 874, 00426 1105, 892, 885, 1105, 892, 889, 1105, 1105, 890, 910, 00427 909, 1105, 1105, 1105, 1105, 1105, 895, 893, 1105, 1105, 00428 1105, 1105, 1105, 1105, 915, 1105, 922, 1022, 931, 929, 00429 1019, 937, 940, 926, 923, 945, 948, 951, 868, 864, 00430 00431 860, 857, 1105, 833, 954, 958, 708, 636, 519, 496, 00432 490, 470, 959, 456, 332, 1105, 1105, 940, 1105, 1105, 00433 1105, 1105, 1105, 960, 1105, 948, 953, 291, 287, 955, 00434 275, 264, 243, 235, 212, 968, 206, 972, 973, 977, 00435 1105, 970, 957, 965, 197, 996, 986, 997, 163, 989, 00436 989, 984, 1006, 1009, 1013, 139, 1105, 991, 991, 128, 00437 1020, 1021, 1105, 1105, 116, 92, 1105, 1088, 1091, 78 00438 } ; 00439 00440 static yyconst short int yy_def[471] = 00441 { 0, 00442 467, 1, 467, 467, 467, 468, 467, 467, 467, 467, 00443 467, 467, 467, 467, 469, 467, 467, 467, 467, 467, 00444 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00445 467, 467, 467, 470, 470, 470, 470, 470, 470, 470, 00446 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00447 470, 470, 467, 467, 468, 467, 467, 467, 467, 467, 00448 467, 467, 467, 467, 469, 467, 467, 467, 467, 467, 00449 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00450 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00451 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00452 00453 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00454 467, 467, 470, 467, 470, 470, 470, 470, 470, 470, 00455 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00456 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00457 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00458 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00459 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00460 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00461 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00462 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00463 00464 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00465 467, 467, 467, 467, 467, 467, 470, 470, 470, 470, 00466 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00467 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00468 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00469 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00470 470, 470, 470, 470, 470, 470, 470, 470, 467, 467, 00471 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00472 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00473 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00474 00475 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00476 467, 467, 467, 467, 470, 470, 470, 470, 470, 470, 00477 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00478 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00479 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00480 470, 470, 470, 470, 470, 470, 470, 467, 467, 467, 00481 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00482 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00483 467, 467, 467, 467, 467, 467, 470, 470, 470, 470, 00484 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 00485 00486 470, 470, 467, 470, 470, 470, 470, 470, 470, 470, 00487 470, 470, 470, 470, 467, 467, 467, 467, 467, 467, 00488 467, 467, 467, 467, 467, 467, 467, 470, 470, 470, 00489 470, 470, 470, 470, 470, 470, 470, 470, 470, 467, 00490 467, 467, 467, 467, 470, 470, 470, 470, 467, 467, 00491 467, 467, 470, 470, 470, 467, 467, 467, 467, 470, 00492 470, 470, 467, 467, 470, 470, 0, 467, 467, 467 00493 } ; 00494 00495 static yyconst short int yy_nxt[1175] = 00496 { 0, 00497 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 00498 13, 14, 4, 15, 16, 17, 18, 19, 20, 21, 00499 22, 23, 24, 25, 4, 26, 27, 28, 29, 30, 00500 4, 31, 32, 33, 4, 4, 4, 4, 4, 4, 00501 4, 4, 34, 35, 36, 37, 38, 39, 40, 41, 00502 42, 43, 44, 45, 46, 47, 48, 49, 44, 50, 00503 51, 52, 44, 44, 44, 44, 44, 44, 53, 54, 00504 54, 56, 58, 59, 60, 62, 63, 67, 72, 69, 00505 113, 70, 73, 74, 77, 80, 75, 68, 81, 85, 00506 71, 78, 83, 86, 97, 79, 76, 54, 54, 64, 00507 00508 58, 161, 84, 82, 114, 67, 72, 69, 57, 70, 00509 73, 74, 77, 80, 75, 68, 81, 85, 71, 78, 00510 83, 86, 97, 87, 76, 91, 94, 112, 114, 92, 00511 84, 82, 88, 114, 114, 93, 95, 89, 90, 115, 00512 114, 96, 98, 114, 99, 120, 56, 59, 60, 116, 00513 456, 87, 114, 91, 94, 112, 100, 92, 269, 101, 00514 88, 103, 102, 93, 95, 89, 90, 115, 127, 96, 00515 98, 246, 99, 120, 456, 104, 107, 116, 114, 105, 00516 106, 114, 114, 57, 100, 108, 117, 101, 118, 103, 00517 102, 109, 110, 111, 114, 114, 127, 119, 132, 125, 00518 00519 130, 121, 122, 104, 107, 123, 126, 105, 106, 114, 00520 131, 114, 114, 108, 117, 124, 118, 128, 114, 109, 00521 110, 111, 133, 114, 114, 119, 132, 125, 130, 121, 00522 122, 114, 129, 123, 126, 62, 63, 134, 131, 114, 00523 163, 114, 145, 124, 165, 128, 135, 114, 114, 166, 00524 133, 136, 137, 138, 142, 114, 160, 139, 167, 64, 00525 129, 168, 114, 140, 143, 134, 169, 170, 163, 144, 00526 145, 141, 165, 171, 135, 55, 114, 166, 172, 136, 00527 137, 138, 142, 162, 160, 139, 167, 114, 114, 168, 00528 151, 140, 143, 173, 169, 170, 174, 144, 114, 114, 00529 00530 146, 171, 147, 114, 152, 339, 172, 175, 153, 154, 00531 176, 178, 55, 179, 148, 55, 180, 149, 151, 181, 00532 150, 173, 182, 183, 174, 189, 187, 55, 146, 188, 00533 147, 55, 152, 55, 190, 175, 153, 154, 176, 178, 00534 184, 179, 148, 440, 180, 149, 191, 181, 150, 114, 00535 182, 183, 185, 189, 187, 155, 186, 188, 192, 193, 00536 194, 197, 190, 195, 156, 198, 199, 200, 184, 201, 00537 157, 158, 159, 196, 191, 202, 205, 206, 203, 207, 00538 185, 208, 211, 155, 186, 204, 192, 193, 194, 197, 00539 209, 195, 156, 198, 199, 200, 210, 201, 157, 158, 00540 00541 159, 196, 212, 202, 205, 206, 203, 207, 214, 208, 00542 211, 215, 216, 204, 114, 114, 213, 114, 209, 217, 00543 218, 114, 114, 219, 210, 114, 114, 114, 114, 114, 00544 212, 221, 226, 224, 114, 114, 214, 114, 114, 215, 00545 216, 222, 114, 223, 213, 227, 114, 217, 218, 220, 00546 225, 219, 228, 229, 114, 230, 232, 233, 231, 221, 00547 226, 224, 114, 114, 272, 164, 114, 114, 114, 222, 00548 240, 223, 241, 227, 114, 235, 114, 220, 225, 234, 00549 228, 229, 114, 230, 232, 233, 231, 236, 243, 238, 00550 114, 237, 239, 114, 114, 244, 114, 249, 240, 114, 00551 00552 241, 114, 114, 235, 242, 250, 245, 234, 114, 251, 00553 114, 114, 252, 114, 114, 236, 243, 238, 247, 237, 00554 239, 254, 114, 244, 257, 249, 114, 114, 248, 114, 00555 253, 114, 242, 250, 245, 255, 259, 251, 114, 114, 00556 252, 271, 256, 260, 261, 263, 247, 273, 258, 254, 00557 262, 114, 257, 264, 114, 114, 248, 266, 253, 267, 00558 114, 274, 268, 255, 259, 275, 276, 265, 277, 271, 00559 256, 260, 261, 263, 278, 273, 258, 279, 262, 280, 00560 281, 264, 282, 283, 284, 266, 288, 267, 289, 274, 00561 268, 290, 285, 275, 276, 265, 277, 291, 286, 287, 00562 00563 292, 293, 278, 294, 295, 279, 296, 280, 281, 297, 00564 282, 283, 284, 298, 288, 299, 289, 300, 301, 290, 00565 285, 302, 303, 306, 304, 291, 286, 287, 292, 293, 00566 307, 294, 295, 308, 296, 305, 309, 297, 310, 311, 00567 312, 298, 313, 299, 314, 300, 301, 114, 114, 302, 00568 303, 306, 304, 114, 114, 114, 114, 315, 307, 114, 00569 114, 308, 114, 305, 309, 316, 310, 311, 312, 318, 00570 313, 114, 314, 317, 114, 322, 319, 114, 320, 114, 00571 114, 321, 114, 323, 114, 315, 114, 325, 330, 333, 00572 331, 114, 114, 316, 114, 415, 359, 318, 324, 326, 00573 00574 114, 317, 332, 322, 319, 335, 320, 327, 336, 321, 00575 337, 323, 334, 328, 329, 325, 330, 333, 331, 114, 00576 114, 114, 114, 114, 114, 114, 324, 326, 114, 340, 00577 332, 341, 114, 335, 344, 327, 336, 114, 337, 342, 00578 334, 328, 329, 338, 346, 343, 114, 114, 345, 347, 00579 114, 114, 349, 114, 114, 350, 114, 340, 352, 341, 00580 348, 114, 344, 114, 355, 353, 358, 342, 360, 361, 00581 354, 338, 346, 343, 357, 362, 345, 347, 351, 356, 00582 349, 363, 364, 350, 365, 366, 352, 367, 348, 368, 00583 371, 372, 355, 353, 358, 373, 360, 361, 354, 369, 00584 00585 374, 370, 357, 362, 375, 376, 351, 356, 377, 363, 00586 364, 378, 365, 366, 379, 367, 380, 368, 371, 372, 00587 381, 382, 383, 373, 384, 385, 386, 369, 374, 370, 00588 114, 114, 375, 376, 114, 114, 377, 114, 114, 378, 00589 114, 114, 379, 391, 380, 114, 394, 114, 381, 382, 00590 383, 387, 384, 385, 386, 388, 389, 393, 390, 114, 00591 114, 392, 395, 114, 396, 114, 397, 114, 114, 114, 00592 114, 391, 114, 114, 394, 400, 114, 399, 402, 387, 00593 114, 114, 398, 388, 389, 393, 390, 401, 404, 392, 00594 395, 114, 396, 405, 397, 114, 416, 406, 114, 114, 00595 00596 114, 407, 114, 400, 410, 399, 402, 114, 408, 409, 00597 398, 411, 413, 114, 417, 401, 404, 412, 418, 414, 00598 419, 405, 420, 421, 416, 406, 422, 423, 424, 407, 00599 425, 426, 410, 427, 114, 114, 408, 409, 114, 411, 00600 413, 114, 417, 114, 428, 412, 418, 414, 419, 114, 00601 420, 421, 114, 429, 422, 423, 424, 114, 425, 426, 00602 114, 427, 430, 114, 434, 431, 114, 114, 441, 435, 00603 114, 114, 428, 432, 442, 438, 443, 439, 433, 444, 00604 114, 429, 446, 445, 114, 114, 450, 436, 440, 449, 00605 430, 451, 434, 431, 452, 437, 441, 435, 114, 448, 00606 00607 447, 432, 442, 438, 443, 439, 433, 444, 114, 114, 00608 446, 445, 453, 457, 450, 436, 458, 459, 114, 451, 00609 454, 114, 452, 437, 463, 114, 455, 448, 447, 464, 00610 460, 114, 114, 114, 114, 114, 461, 114, 114, 114, 00611 453, 457, 114, 114, 458, 459, 462, 114, 454, 403, 00612 114, 114, 463, 465, 455, 114, 114, 464, 460, 466, 00613 114, 114, 114, 114, 461, 114, 359, 55, 114, 114, 00614 114, 114, 114, 114, 462, 114, 114, 114, 114, 114, 00615 114, 465, 114, 177, 270, 114, 114, 466, 55, 114, 00616 55, 65, 65, 65, 177, 66, 164, 61, 61, 161, 00617 00618 114, 66, 61, 467, 3, 467, 467, 467, 467, 467, 00619 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00620 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00621 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00622 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00623 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00624 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00625 467, 467, 467, 467 00626 } ; 00627 00628 static yyconst short int yy_chk[1175] = 00629 { 0, 00630 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00631 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00632 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00633 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00634 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00635 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00636 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 00637 5, 6, 7, 12, 12, 14, 14, 16, 18, 17, 00638 470, 17, 19, 19, 20, 21, 19, 16, 22, 24, 00639 17, 20, 23, 25, 29, 20, 19, 54, 54, 14, 00640 00641 7, 161, 23, 22, 466, 16, 18, 17, 6, 17, 00642 19, 19, 20, 21, 19, 16, 22, 24, 17, 20, 00643 23, 25, 29, 26, 19, 27, 28, 33, 465, 27, 00644 23, 22, 26, 141, 34, 27, 28, 26, 26, 34, 00645 460, 28, 30, 36, 30, 36, 55, 60, 60, 34, 00646 456, 26, 39, 27, 28, 33, 30, 27, 161, 30, 00647 26, 31, 30, 27, 28, 26, 26, 34, 39, 28, 00648 30, 141, 30, 36, 449, 31, 32, 34, 42, 31, 00649 31, 38, 35, 55, 30, 32, 35, 30, 35, 31, 00650 30, 32, 32, 32, 41, 37, 39, 35, 42, 38, 00651 00652 41, 37, 37, 31, 32, 37, 38, 31, 31, 445, 00653 41, 40, 43, 32, 35, 37, 35, 40, 437, 32, 00654 32, 32, 43, 48, 435, 35, 42, 38, 41, 37, 00655 37, 45, 40, 37, 38, 63, 63, 45, 41, 52, 00656 58, 46, 48, 37, 67, 40, 45, 434, 47, 68, 00657 43, 45, 45, 46, 47, 433, 52, 46, 69, 63, 00658 40, 70, 246, 46, 47, 45, 71, 72, 58, 47, 00659 48, 46, 67, 73, 45, 57, 432, 68, 74, 45, 00660 45, 46, 47, 57, 52, 46, 69, 431, 50, 70, 00661 50, 46, 47, 75, 71, 72, 76, 47, 49, 429, 00662 00663 49, 73, 49, 428, 50, 246, 74, 77, 50, 50, 00664 78, 80, 57, 81, 49, 57, 81, 49, 50, 82, 00665 49, 75, 83, 84, 76, 88, 87, 57, 49, 87, 00666 49, 57, 50, 57, 89, 77, 50, 50, 78, 80, 00667 85, 81, 49, 415, 81, 49, 90, 82, 49, 51, 00668 83, 84, 85, 88, 87, 51, 85, 87, 91, 92, 00669 93, 95, 89, 94, 51, 96, 97, 98, 85, 100, 00670 51, 51, 51, 94, 90, 101, 103, 104, 102, 105, 00671 85, 106, 108, 51, 85, 102, 91, 92, 93, 95, 00672 107, 94, 51, 96, 97, 98, 107, 100, 51, 51, 00673 00674 51, 94, 109, 101, 103, 104, 102, 105, 110, 106, 00675 108, 111, 112, 102, 115, 116, 109, 122, 107, 115, 00676 116, 117, 118, 117, 107, 119, 124, 123, 120, 121, 00677 109, 119, 124, 122, 127, 125, 110, 128, 130, 111, 00678 112, 120, 126, 121, 109, 125, 129, 115, 116, 118, 00679 123, 117, 126, 127, 135, 128, 129, 130, 128, 119, 00680 124, 122, 131, 136, 164, 164, 132, 138, 414, 120, 00681 135, 121, 136, 125, 134, 132, 143, 118, 123, 131, 00682 126, 127, 412, 128, 129, 130, 128, 132, 138, 134, 00683 139, 132, 134, 140, 137, 139, 144, 143, 135, 145, 00684 00685 136, 146, 411, 132, 137, 144, 140, 131, 410, 145, 00686 142, 149, 146, 148, 151, 132, 138, 134, 142, 132, 00687 134, 149, 150, 139, 151, 143, 152, 153, 142, 155, 00688 148, 409, 137, 144, 140, 150, 153, 145, 154, 156, 00689 146, 163, 150, 154, 155, 156, 142, 165, 152, 149, 00690 155, 157, 151, 157, 158, 159, 142, 158, 148, 159, 00691 160, 166, 160, 150, 153, 167, 170, 157, 171, 163, 00692 150, 154, 155, 156, 172, 165, 152, 173, 155, 174, 00693 176, 157, 178, 179, 180, 158, 182, 159, 184, 166, 00694 160, 185, 180, 167, 170, 157, 171, 188, 180, 180, 00695 00696 189, 190, 172, 192, 193, 173, 194, 174, 176, 196, 00697 178, 179, 180, 201, 182, 202, 184, 203, 204, 185, 00698 180, 205, 206, 208, 207, 188, 180, 180, 189, 190, 00699 209, 192, 193, 210, 194, 207, 211, 196, 212, 213, 00700 214, 201, 215, 202, 216, 203, 204, 217, 408, 205, 00701 206, 208, 207, 219, 223, 218, 222, 217, 209, 224, 00702 226, 210, 228, 207, 211, 218, 212, 213, 214, 222, 00703 215, 225, 216, 219, 229, 226, 223, 230, 224, 239, 00704 236, 225, 233, 228, 235, 217, 243, 230, 233, 239, 00705 235, 240, 241, 218, 231, 359, 359, 222, 229, 231, 00706 00707 244, 219, 236, 226, 223, 241, 224, 231, 243, 225, 00708 244, 228, 240, 231, 231, 230, 233, 239, 235, 248, 00709 407, 253, 245, 258, 254, 256, 229, 231, 257, 248, 00710 236, 253, 255, 241, 256, 231, 243, 263, 244, 254, 00711 240, 231, 231, 245, 258, 255, 260, 259, 257, 259, 00712 261, 265, 260, 262, 266, 261, 267, 248, 263, 253, 00713 259, 264, 256, 268, 266, 264, 271, 254, 275, 276, 00714 265, 245, 258, 255, 268, 277, 257, 259, 262, 267, 00715 260, 278, 280, 261, 282, 284, 263, 285, 259, 286, 00716 289, 290, 266, 264, 271, 293, 275, 276, 265, 287, 00717 00718 294, 287, 268, 277, 296, 299, 262, 267, 300, 278, 00719 280, 302, 282, 284, 303, 285, 304, 286, 289, 290, 00720 305, 306, 308, 293, 309, 310, 311, 287, 294, 287, 00721 317, 319, 296, 299, 320, 318, 300, 326, 322, 302, 00722 324, 327, 303, 322, 304, 404, 327, 329, 305, 306, 00723 308, 317, 309, 310, 311, 318, 319, 326, 320, 328, 00724 332, 324, 328, 331, 329, 335, 329, 342, 338, 402, 00725 336, 322, 401, 343, 327, 335, 400, 332, 338, 317, 00726 399, 349, 331, 318, 319, 326, 320, 336, 342, 324, 00727 328, 345, 329, 343, 329, 346, 360, 345, 347, 348, 00728 00729 353, 346, 351, 335, 349, 332, 338, 352, 347, 348, 00730 331, 351, 353, 354, 362, 336, 342, 352, 363, 354, 00731 365, 343, 366, 369, 360, 345, 370, 371, 377, 346, 00732 378, 385, 349, 385, 387, 395, 347, 348, 394, 351, 00733 353, 390, 362, 389, 387, 352, 363, 354, 365, 392, 00734 366, 369, 393, 389, 370, 371, 377, 396, 378, 385, 00735 397, 385, 390, 398, 397, 392, 405, 430, 418, 398, 00736 406, 413, 387, 393, 424, 413, 426, 413, 396, 427, 00737 436, 389, 436, 430, 438, 439, 442, 405, 440, 440, 00738 390, 443, 397, 392, 444, 406, 418, 398, 447, 439, 00739 00740 438, 393, 424, 413, 426, 413, 396, 427, 446, 448, 00741 436, 430, 446, 450, 442, 405, 451, 452, 453, 443, 00742 447, 454, 444, 406, 458, 455, 448, 439, 438, 459, 00743 453, 391, 461, 462, 388, 357, 454, 356, 355, 350, 00744 446, 450, 344, 341, 451, 452, 455, 340, 447, 339, 00745 337, 334, 458, 461, 448, 333, 330, 459, 453, 462, 00746 325, 323, 321, 316, 454, 315, 272, 270, 252, 251, 00747 250, 249, 247, 242, 455, 238, 237, 234, 232, 227, 00748 221, 461, 220, 177, 162, 147, 133, 462, 468, 113, 00749 468, 469, 469, 469, 79, 65, 62, 61, 59, 53, 00750 00751 44, 15, 13, 3, 467, 467, 467, 467, 467, 467, 00752 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00753 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00754 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00755 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00756 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00757 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, 00758 467, 467, 467, 467 00759 } ; 00760 00761 static yy_state_type yy_last_accepting_state; 00762 static char *yy_last_accepting_cpos; 00763 00764 /* The intent behind this definition is that it'll catch 00765 * any uses of REJECT which flex missed. 00766 */ 00767 #define REJECT reject_used_but_not_detected 00768 #define yymore() yymore_used_but_not_detected 00769 #define YY_MORE_ADJ 0 00770 #define YY_RESTORE_YY_MORE_OFFSET 00771 char *yytext; 00772 #line 1 "snaplex.l" 00773 #define INITIAL 0 00774 /* snap-1.0. Copyright (C) 2000 by Jonathan T. Moore and Michael Hicks. 00775 * 00776 * snaplex.l : lexer for SNAP assembly language 00777 * 00778 * $Id: snaplex.c,v 1.3 2003/04/16 10:58:59 wdebruij Exp $ 00779 */ 00780 #line 9 "snaplex.l" 00781 #include <assert.h> 00782 #include <ctype.h> 00783 #include <netinet/in.h> 00784 #include <stdio.h> 00785 #include <string.h> 00786 #include "../lib/bytecode.h" 00787 #include "../lib/io.h" 00788 #include "../lib/memalloc.h" 00789 #include "snapparse.h" 00790 00791 int value_int; 00792 uint32 value_addr; 00793 buffer_t value_str; 00794 int value_exc; 00795 float32 value_float; 00796 00797 int read_from_file = 1; 00798 00799 char *lexbuf = NULL; 00800 int lexbuf_len = 0; 00801 int lexbuf_pos = 0; 00802 00803 void conv_string(char *s,buffer_t *buf); 00804 00805 int snap_yy_input(char *buf, int max_size) { 00806 int i; 00807 00808 if (read_from_file) { /* get chars from yyin FILE */ 00809 for (i=0; i < max_size; i++) { 00810 int c = getc(yyin); 00811 if (c == EOF) { 00812 if (i == 0) { 00813 return(YY_NULL); 00814 } 00815 break; 00816 } else { 00817 buf[i] = c; 00818 } 00819 } 00820 return(i); /* return number of chars read */ 00821 00822 } else { /* reading input from lexbuf string */ 00823 if (lexbuf_pos == lexbuf_len) { 00824 return(YY_NULL); 00825 } else { 00826 for (i=0; i < max_size && i < (lexbuf_len - lexbuf_pos); i++) { 00827 buf[i] = lexbuf[lexbuf_pos]; 00828 lexbuf_pos++; 00829 } 00830 return(i); /* return number of chars read */ 00831 } 00832 } 00833 } 00834 00835 #define YY_INPUT(buf,result,max_size) \ 00836 { (result) = snap_yy_input((buf),(max_size)); } 00837 00838 #line 839 "lex.yy.c" 00839 00840 /* Macros after this point can all be overridden by user definitions in 00841 * section 1. 00842 */ 00843 00844 #ifndef YY_SKIP_YYWRAP 00845 #ifdef __cplusplus 00846 extern "C" int yywrap YY_PROTO(( void )); 00847 #else 00848 extern int yywrap YY_PROTO(( void )); 00849 #endif 00850 #endif 00851 00852 #ifndef YY_NO_UNPUT 00853 static void yyunput YY_PROTO(( int c, char *buf_ptr )); 00854 #endif 00855 00856 #ifndef yytext_ptr 00857 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); 00858 #endif 00859 00860 #ifdef YY_NEED_STRLEN 00861 static int yy_flex_strlen YY_PROTO(( yyconst char * )); 00862 #endif 00863 00864 #ifndef YY_NO_INPUT 00865 #ifdef __cplusplus 00866 static int yyinput YY_PROTO(( void )); 00867 #else 00868 static int input YY_PROTO(( void )); 00869 #endif 00870 #endif 00871 00872 #if YY_STACK_USED 00873 static int yy_start_stack_ptr = 0; 00874 static int yy_start_stack_depth = 0; 00875 static int *yy_start_stack = 0; 00876 #ifndef YY_NO_PUSH_STATE 00877 static void yy_push_state YY_PROTO(( int new_state )); 00878 #endif 00879 #ifndef YY_NO_POP_STATE 00880 static void yy_pop_state YY_PROTO(( void )); 00881 #endif 00882 #ifndef YY_NO_TOP_STATE 00883 static int yy_top_state YY_PROTO(( void )); 00884 #endif 00885 00886 #else 00887 #define YY_NO_PUSH_STATE 1 00888 #define YY_NO_POP_STATE 1 00889 #define YY_NO_TOP_STATE 1 00890 #endif 00891 00892 #ifdef YY_MALLOC_DECL 00893 YY_MALLOC_DECL 00894 #else 00895 #if __STDC__ 00896 #ifndef __cplusplus 00897 #include <stdlib.h> 00898 #endif 00899 #else 00900 /* Just try to get by without declaring the routines. This will fail 00901 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) 00902 * or sizeof(void*) != sizeof(int). 00903 */ 00904 #endif 00905 #endif 00906 00907 /* Amount of stuff to slurp up with each read. */ 00908 #ifndef YY_READ_BUF_SIZE 00909 #define YY_READ_BUF_SIZE 8192 00910 #endif 00911 00912 /* Copy whatever the last rule matched to the standard output. */ 00913 00914 #ifndef ECHO 00915 /* This used to be an fputs(), but since the string might contain NUL's, 00916 * we now use fwrite(). 00917 */ 00918 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) 00919 #endif 00920 00921 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 00922 * is returned in "result". 00923 */ 00924 #ifndef YY_INPUT 00925 #define YY_INPUT(buf,result,max_size) \ 00926 if ( yy_current_buffer->yy_is_interactive ) \ 00927 { \ 00928 int c = '*', n; \ 00929 for ( n = 0; n < max_size && \ 00930 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 00931 buf[n] = (char) c; \ 00932 if ( c == '\n' ) \ 00933 buf[n++] = (char) c; \ 00934 if ( c == EOF && ferror( yyin ) ) \ 00935 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00936 result = n; \ 00937 } \ 00938 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ 00939 && ferror( yyin ) ) \ 00940 YY_FATAL_ERROR( "input in flex scanner failed" ); 00941 #endif 00942 00943 /* No semi-colon after return; correct usage is to write "yyterminate();" - 00944 * we don't want an extra ';' after the "return" because that will cause 00945 * some compilers to complain about unreachable statements. 00946 */ 00947 #ifndef yyterminate 00948 #define yyterminate() return YY_NULL 00949 #endif 00950 00951 /* Number of entries by which start-condition stack grows. */ 00952 #ifndef YY_START_STACK_INCR 00953 #define YY_START_STACK_INCR 25 00954 #endif 00955 00956 /* Report a fatal error. */ 00957 #ifndef YY_FATAL_ERROR 00958 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 00959 #endif 00960 00961 /* Default declaration of generated scanner - a define so the user can 00962 * easily add parameters. 00963 */ 00964 #ifndef YY_DECL 00965 #define YY_DECL int yylex YY_PROTO(( void )) 00966 #endif 00967 00968 /* Code executed at the beginning of each rule, after yytext and yyleng 00969 * have been set up. 00970 */ 00971 #ifndef YY_USER_ACTION 00972 #define YY_USER_ACTION 00973 #endif 00974 00975 /* Code executed at the end of each rule. */ 00976 #ifndef YY_BREAK 00977 #define YY_BREAK break; 00978 #endif 00979 00980 #define YY_RULE_SETUP \ 00981 YY_USER_ACTION 00982 00983 YY_DECL 00984 { 00985 register yy_state_type yy_current_state; 00986 register char *yy_cp = NULL, *yy_bp = NULL; 00987 register int yy_act; 00988 00989 #line 100 "snaplex.l" 00990 00991 #line 992 "lex.yy.c" 00992 00993 if ( yy_init ) 00994 { 00995 yy_init = 0; 00996 00997 #ifdef YY_USER_INIT 00998 YY_USER_INIT; 00999 #endif 01000 01001 if ( ! yy_start ) 01002 yy_start = 1; /* first start state */ 01003 01004 if ( ! yyin ) 01005 yyin = stdin; 01006 01007 if ( ! yyout ) 01008 yyout = stdout; 01009 01010 if ( ! yy_current_buffer ) 01011 yy_current_buffer = 01012 yy_create_buffer( yyin, YY_BUF_SIZE ); 01013 01014 yy_load_buffer_state(); 01015 } 01016 01017 while ( 1 ) /* loops until end-of-file is reached */ 01018 { 01019 yy_cp = yy_c_buf_p; 01020 01021 /* Support of yytext. */ 01022 *yy_cp = yy_hold_char; 01023 01024 /* yy_bp points to the position in yy_ch_buf of the start of 01025 * the current run. 01026 */ 01027 yy_bp = yy_cp; 01028 01029 yy_current_state = yy_start; 01030 yy_match: 01031 do 01032 { 01033 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 01034 if ( yy_accept[yy_current_state] ) 01035 { 01036 yy_last_accepting_state = yy_current_state; 01037 yy_last_accepting_cpos = yy_cp; 01038 } 01039 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01040 { 01041 yy_current_state = (int) yy_def[yy_current_state]; 01042 if ( yy_current_state >= 468 ) 01043 yy_c = yy_meta[(unsigned int) yy_c]; 01044 } 01045 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01046 ++yy_cp; 01047 } 01048 while ( yy_base[yy_current_state] != 1105 ); 01049 01050 yy_find_action: 01051 yy_act = yy_accept[yy_current_state]; 01052 if ( yy_act == 0 ) 01053 { /* have to back up */ 01054 yy_cp = yy_last_accepting_cpos; 01055 yy_current_state = yy_last_accepting_state; 01056 yy_act = yy_accept[yy_current_state]; 01057 } 01058 01059 YY_DO_BEFORE_ACTION; 01060 01061 01062 do_action: /* This label is used only to access EOF actions. */ 01063 01064 01065 switch ( yy_act ) 01066 { /* beginning of action switch */ 01067 case 0: /* must back up */ 01068 /* undo the effects of YY_DO_BEFORE_ACTION */ 01069 *yy_cp = yy_hold_char; 01070 yy_cp = yy_last_accepting_cpos; 01071 yy_current_state = yy_last_accepting_state; 01072 goto yy_find_action; 01073 01074 case 1: 01075 YY_RULE_SETUP 01076 #line 101 "snaplex.l" 01077 ; /* skip whitespace */ 01078 YY_BREAK 01079 case 2: 01080 YY_RULE_SETUP 01081 #line 102 "snaplex.l" 01082 ; /* ignore comments to end of line */ 01083 YY_BREAK 01084 case 3: 01085 YY_RULE_SETUP 01086 #line 104 "snaplex.l" 01087 return(T_EXIT); 01088 YY_BREAK 01089 case 4: 01090 YY_RULE_SETUP 01091 #line 105 "snaplex.l" 01092 return(T_PUSH); 01093 YY_BREAK 01094 case 5: 01095 YY_RULE_SETUP 01096 #line 106 "snaplex.l" 01097 return(T_POPI); 01098 YY_BREAK 01099 case 6: 01100 YY_RULE_SETUP 01101 #line 107 "snaplex.l" 01102 return(T_POP); 01103 YY_BREAK 01104 case 7: 01105 YY_RULE_SETUP 01106 #line 108 "snaplex.l" 01107 return(T_PULL); 01108 YY_BREAK 01109 case 8: 01110 YY_RULE_SETUP 01111 #line 109 "snaplex.l" 01112 return(T_STORE); 01113 YY_BREAK 01114 case 9: 01115 YY_RULE_SETUP 01116 #line 110 "snaplex.l" 01117 return(T_EQI); 01118 YY_BREAK 01119 case 10: 01120 YY_RULE_SETUP 01121 #line 111 "snaplex.l" 01122 return(T_EQ); 01123 YY_BREAK 01124 case 11: 01125 YY_RULE_SETUP 01126 #line 112 "snaplex.l" 01127 return(T_NEQI); 01128 YY_BREAK 01129 case 12: 01130 YY_RULE_SETUP 01131 #line 113 "snaplex.l" 01132 return(T_NEQ); 01133 YY_BREAK 01134 case 13: 01135 YY_RULE_SETUP 01136 #line 114 "snaplex.l" 01137 return(T_JI); 01138 YY_BREAK 01139 case 14: 01140 YY_RULE_SETUP 01141 #line 115 "snaplex.l" 01142 return(T_PAJ); 01143 YY_BREAK 01144 case 15: 01145 YY_RULE_SETUP 01146 #line 116 "snaplex.l" 01147 return(T_TPAJ); 01148 YY_BREAK 01149 case 16: 01150 YY_RULE_SETUP 01151 #line 117 "snaplex.l" 01152 return(T_BEZ); 01153 YY_BREAK 01154 case 17: 01155 YY_RULE_SETUP 01156 #line 118 "snaplex.l" 01157 return(T_BNE); 01158 YY_BREAK 01159 case 18: 01160 YY_RULE_SETUP 01161 #line 119 "snaplex.l" 01162 return(T_ADDI); 01163 YY_BREAK 01164 case 19: 01165 YY_RULE_SETUP 01166 #line 120 "snaplex.l" 01167 return(T_ADD); 01168 YY_BREAK 01169 case 20: 01170 YY_RULE_SETUP 01171 #line 121 "snaplex.l" 01172 return(T_SUBI); 01173 YY_BREAK 01174 case 21: 01175 YY_RULE_SETUP 01176 #line 122 "snaplex.l" 01177 return(T_SUB); 01178 YY_BREAK 01179 case 22: 01180 YY_RULE_SETUP 01181 #line 123 "snaplex.l" 01182 return(T_MULTI); 01183 YY_BREAK 01184 case 23: 01185 YY_RULE_SETUP 01186 #line 124 "snaplex.l" 01187 return(T_MULT); 01188 YY_BREAK 01189 case 24: 01190 YY_RULE_SETUP 01191 #line 125 "snaplex.l" 01192 return(T_DIVI); 01193 YY_BREAK 01194 case 25: 01195 YY_RULE_SETUP 01196 #line 126 "snaplex.l" 01197 return(T_DIV); 01198 YY_BREAK 01199 case 26: 01200 YY_RULE_SETUP 01201 #line 127 "snaplex.l" 01202 return(T_MODI); 01203 YY_BREAK 01204 case 27: 01205 YY_RULE_SETUP 01206 #line 128 "snaplex.l" 01207 return(T_MOD); 01208 YY_BREAK 01209 case 28: 01210 YY_RULE_SETUP 01211 #line 129 "snaplex.l" 01212 return(T_NEG); 01213 YY_BREAK 01214 case 29: 01215 YY_RULE_SETUP 01216 #line 130 "snaplex.l" 01217 return(T_NOT); 01218 YY_BREAK 01219 case 30: 01220 YY_RULE_SETUP 01221 #line 131 "snaplex.l" 01222 return(T_LNOT); 01223 YY_BREAK 01224 case 31: 01225 YY_RULE_SETUP 01226 #line 132 "snaplex.l" 01227 return(T_ANDI); 01228 YY_BREAK 01229 case 32: 01230 YY_RULE_SETUP 01231 #line 133 "snaplex.l" 01232 return(T_AND); 01233 YY_BREAK 01234 case 33: 01235 YY_RULE_SETUP 01236 #line 134 "snaplex.l" 01237 return(T_ORI); 01238 YY_BREAK 01239 case 34: 01240 YY_RULE_SETUP 01241 #line 135 "snaplex.l" 01242 return(T_OR); 01243 YY_BREAK 01244 case 35: 01245 YY_RULE_SETUP 01246 #line 136 "snaplex.l" 01247 return(T_LSHLI); 01248 YY_BREAK 01249 case 36: 01250 YY_RULE_SETUP 01251 #line 137 "snaplex.l" 01252 return(T_LSHL); 01253 YY_BREAK 01254 case 37: 01255 YY_RULE_SETUP 01256 #line 138 "snaplex.l" 01257 return(T_RSHLI); 01258 YY_BREAK 01259 case 38: 01260 YY_RULE_SETUP 01261 #line 139 "snaplex.l" 01262 return(T_RSHL); 01263 YY_BREAK 01264 case 39: 01265 YY_RULE_SETUP 01266 #line 140 "snaplex.l" 01267 return(T_RSHAI); 01268 YY_BREAK 01269 case 40: 01270 YY_RULE_SETUP 01271 #line 141 "snaplex.l" 01272 return(T_RSHA); 01273 YY_BREAK 01274 case 41: 01275 YY_RULE_SETUP 01276 #line 142 "snaplex.l" 01277 return(T_SNETI); 01278 YY_BREAK 01279 case 42: 01280 YY_RULE_SETUP 01281 #line 143 "snaplex.l" 01282 return(T_SNET); 01283 YY_BREAK 01284 case 43: 01285 YY_RULE_SETUP 01286 #line 144 "snaplex.l" 01287 return(T_BCASTI); 01288 YY_BREAK 01289 case 44: 01290 YY_RULE_SETUP 01291 #line 145 "snaplex.l" 01292 return(T_BCAST); 01293 YY_BREAK 01294 case 45: 01295 YY_RULE_SETUP 01296 #line 146 "snaplex.l" 01297 return(T_ISX); 01298 YY_BREAK 01299 case 46: 01300 YY_RULE_SETUP 01301 #line 147 "snaplex.l" 01302 return(T_GETRB); 01303 YY_BREAK 01304 case 47: 01305 YY_RULE_SETUP 01306 #line 148 "snaplex.l" 01307 return(T_GETSRC); 01308 YY_BREAK 01309 case 48: 01310 YY_RULE_SETUP 01311 #line 149 "snaplex.l" 01312 return(T_GETDST); 01313 YY_BREAK 01314 case 49: 01315 YY_RULE_SETUP 01316 #line 150 "snaplex.l" 01317 return(T_GETSPT); 01318 YY_BREAK 01319 case 50: 01320 YY_RULE_SETUP 01321 #line 151 "snaplex.l" 01322 return(T_HERE); 01323 YY_BREAK 01324 case 51: 01325 YY_RULE_SETUP 01326 #line 152 "snaplex.l" 01327 return(T_ISHERE); 01328 YY_BREAK 01329 case 52: 01330 YY_RULE_SETUP 01331 #line 153 "snaplex.l" 01332 return(T_ROUTE); 01333 YY_BREAK 01334 case 53: 01335 YY_RULE_SETUP 01336 #line 154 "snaplex.l" 01337 return(T_RTDEV); 01338 YY_BREAK 01339 case 54: 01340 YY_RULE_SETUP 01341 #line 155 "snaplex.l" 01342 return(T_SEND); 01343 YY_BREAK 01344 case 55: 01345 YY_RULE_SETUP 01346 #line 156 "snaplex.l" 01347 return(T_HOP); 01348 YY_BREAK 01349 case 56: 01350 YY_RULE_SETUP 01351 #line 157 "snaplex.l" 01352 return(T_FORW); 01353 YY_BREAK 01354 case 57: 01355 YY_RULE_SETUP 01356 #line 158 "snaplex.l" 01357 return(T_FORWTO); 01358 YY_BREAK 01359 case 58: 01360 YY_RULE_SETUP 01361 #line 159 "snaplex.l" 01362 return(T_DEMUXI); 01363 YY_BREAK 01364 case 59: 01365 YY_RULE_SETUP 01366 #line 160 "snaplex.l" 01367 return(T_DEMUX); 01368 YY_BREAK 01369 case 60: 01370 YY_RULE_SETUP 01371 #line 161 "snaplex.l" 01372 return(T_PRINT); 01373 YY_BREAK 01374 case 61: 01375 YY_RULE_SETUP 01376 #line 162 "snaplex.l" 01377 return(T_PC); 01378 YY_BREAK 01379 case 62: 01380 YY_RULE_SETUP 01381 #line 163 "snaplex.l" 01382 return(T_MKTUP); 01383 YY_BREAK 01384 case 63: 01385 YY_RULE_SETUP 01386 #line 164 "snaplex.l" 01387 return(T_NTH); 01388 YY_BREAK 01389 case 64: 01390 YY_RULE_SETUP 01391 #line 165 "snaplex.l" 01392 return(T_LEN); 01393 YY_BREAK 01394 case 65: 01395 YY_RULE_SETUP 01396 #line 166 "snaplex.l" 01397 return(T_ISTUP); 01398 YY_BREAK 01399 case 66: 01400 YY_RULE_SETUP 01401 #line 167 "snaplex.l" 01402 return(T_SVCV); 01403 YY_BREAK 01404 case 67: 01405 YY_RULE_SETUP 01406 #line 168 "snaplex.l" 01407 return(T_CALLS); 01408 YY_BREAK 01409 case 68: 01410 YY_RULE_SETUP 01411 #line 169 "snaplex.l" 01412 return(T_GEQ); 01413 YY_BREAK 01414 case 69: 01415 YY_RULE_SETUP 01416 #line 170 "snaplex.l" 01417 return(T_GT); 01418 YY_BREAK 01419 case 70: 01420 YY_RULE_SETUP 01421 #line 171 "snaplex.l" 01422 return(T_LEQ); 01423 YY_BREAK 01424 case 71: 01425 YY_RULE_SETUP 01426 #line 172 "snaplex.l" 01427 return(T_LT); 01428 YY_BREAK 01429 case 72: 01430 YY_RULE_SETUP 01431 #line 173 "snaplex.l" 01432 return(T_GEQI); 01433 YY_BREAK 01434 case 73: 01435 YY_RULE_SETUP 01436 #line 174 "snaplex.l" 01437 return(T_GTI); 01438 YY_BREAK 01439 case 74: 01440 YY_RULE_SETUP 01441 #line 175 "snaplex.l" 01442 return(T_LEQI); 01443 YY_BREAK 01444 case 75: 01445 YY_RULE_SETUP 01446 #line 176 "snaplex.l" 01447 return(T_LTI); 01448 YY_BREAK 01449 case 76: 01450 YY_RULE_SETUP 01451 #line 177 "snaplex.l" 01452 return(T_GETLD); 01453 YY_BREAK 01454 case 77: 01455 YY_RULE_SETUP 01456 #line 178 "snaplex.l" 01457 return(T_SETXH); 01458 YY_BREAK 01459 case 78: 01460 YY_RULE_SETUP 01461 #line 179 "snaplex.l" 01462 return(T_RAISEX); 01463 YY_BREAK 01464 case 79: 01465 YY_RULE_SETUP 01466 #line 180 "snaplex.l" 01467 return(T_DATA); 01468 YY_BREAK 01469 case 80: 01470 YY_RULE_SETUP 01471 #line 182 "snaplex.l" 01472 return(T_DSEND); 01473 YY_BREAK 01474 case 81: 01475 YY_RULE_SETUP 01476 #line 183 "snaplex.l" 01477 return(T_DFORW); 01478 YY_BREAK 01479 case 82: 01480 YY_RULE_SETUP 01481 #line 184 "snaplex.l" 01482 return(T_DFORWTO); 01483 YY_BREAK 01484 case 83: 01485 YY_RULE_SETUP 01486 #line 186 "snaplex.l" 01487 return(T_STACKEMPTY); 01488 YY_BREAK 01489 case 84: 01490 YY_RULE_SETUP 01491 #line 187 "snaplex.l" 01492 return(T_STACKCOUNT); 01493 YY_BREAK 01494 case 85: 01495 YY_RULE_SETUP 01496 #line 189 "snaplex.l" 01497 return (T_PULLSTACK); 01498 YY_BREAK 01499 case 86: 01500 YY_RULE_SETUP 01501 #line 191 "snaplex.l" 01502 return(T_MAIN); 01503 YY_BREAK 01504 case 87: 01505 YY_RULE_SETUP 01506 #line 192 "snaplex.l" 01507 return(T_PLUS); 01508 YY_BREAK 01509 case 88: 01510 YY_RULE_SETUP 01511 #line 193 "snaplex.l" 01512 return(T_MINUS); 01513 YY_BREAK 01514 case 89: 01515 YY_RULE_SETUP 01516 #line 194 "snaplex.l" 01517 return(T_LPAREN); 01518 YY_BREAK 01519 case 90: 01520 YY_RULE_SETUP 01521 #line 195 "snaplex.l" 01522 return(T_RPAREN); 01523 YY_BREAK 01524 case 91: 01525 YY_RULE_SETUP 01526 #line 196 "snaplex.l" 01527 return(T_COMMA); 01528 YY_BREAK 01529 case 92: 01530 YY_RULE_SETUP 01531 #line 198 "snaplex.l" 01532 { char *s = yytext; 01533 char *s1; 01534 char *s2; 01535 char *s3; 01536 char *s4; 01537 uint32 value_addr_h; 01538 s1 = strsep(&s,"."); 01539 value_addr_h = (uint32)(atoi(s1) << 24); 01540 s2 = strsep(&s,"."); 01541 value_addr_h |= (uint32)(atoi(s2) << 16); 01542 s3 = strsep(&s,"."); 01543 value_addr_h |= (uint32)(atoi(s3) << 8); 01544 s4 = s; 01545 value_addr_h |= (uint32)(atoi(s4)); 01546 #ifdef LARGE_ADDR 01547 value_addr = MAKE_UDP_ADDR(htonl(value_addr_h),0); 01548 #else 01549 value_addr = htonl(value_addr_h); 01550 #endif 01551 return(T_ADDRV); 01552 } 01553 YY_BREAK 01554 case 93: 01555 YY_RULE_SETUP 01556 #line 219 "snaplex.l" 01557 { char *s = yytext; 01558 char *s1; 01559 char *s2; 01560 char *s3; 01561 char *s4; 01562 char *s5; 01563 uint32 value_addr_h; 01564 s1 = strsep(&s,"."); 01565 value_addr_h = (uint32)(atoi(s1) << 24); 01566 s2 = strsep(&s,"."); 01567 value_addr_h |= (uint32)(atoi(s2) << 16); 01568 s3 = strsep(&s,"."); 01569 value_addr_h |= (uint32)(atoi(s3) << 8); 01570 s4 = strsep(&s,":"); 01571 value_addr_h |= (uint32)(atoi(s4)); 01572 #ifndef LARGE_ADDR 01573 fprintf(stderr,"Warning: truncating port of large addr\n"); 01574 value_addr = htonl(value_addr_h); 01575 #else 01576 s5 = s; 01577 value_addr = MAKE_UDP_ADDR(htonl(value_addr_h), 01578 htons((short)atoi(s))); 01579 #endif 01580 return(T_ADDRV); 01581 } 01582 YY_BREAK 01583 case 94: 01584 YY_RULE_SETUP 01585 #line 244 "snaplex.l" 01586 { int sizeb; 01587 sscanf(yytext,"|%d|",&sizeb); 01588 memalloc(value_str.s,char *,sizeb); 01589 value_str.lenb = sizeb; 01590 value_str.s[sizeb-1] = (char)0xff; 01591 return(T_STRV); 01592 } 01593 YY_BREAK 01594 case 95: 01595 YY_RULE_SETUP 01596 #line 251 "snaplex.l" 01597 { value_int = atoi(yytext); 01598 return(T_INTV); 01599 } 01600 YY_BREAK 01601 case 96: 01602 YY_RULE_SETUP 01603 #line 254 "snaplex.l" 01604 { int ntok; 01605 ntok = sscanf(yytext,"%f",&value_float); 01606 if (ntok != 1) { 01607 fprintf(stderr, 01608 "%s:%d: failure to parse float literal %s\n", 01609 __FILE__,__LINE__,yytext); 01610 exit(1); 01611 } 01612 return(T_FLOATV); 01613 } 01614 YY_BREAK 01615 case 97: 01616 YY_RULE_SETUP 01617 #line 264 "snaplex.l" 01618 { int len = strlen(yytext); 01619 char c = yytext[len-1]; 01620 yytext[len-1] = '\0'; 01621 #ifdef LARGE_ADDR 01622 value_addr = MAKE_UDP_ADDR(atoi(yytext),0); 01623 #else 01624 value_addr = atoi(yytext); 01625 #endif 01626 yytext[len-1] = c; 01627 return(T_ADDRV); 01628 } 01629 YY_BREAK 01630 case 98: 01631 YY_RULE_SETUP 01632 #line 275 "snaplex.l" 01633 { conv_string(yytext,&value_str); 01634 return(T_STRV); 01635 } 01636 YY_BREAK 01637 case 99: 01638 YY_RULE_SETUP 01639 #line 278 "snaplex.l" 01640 { value_exc = atoi(&yytext[2]); 01641 return(T_EXCV); 01642 } 01643 YY_BREAK 01644 case 100: 01645 YY_RULE_SETUP 01646 #line 281 "snaplex.l" 01647 { memalloc(value_str.s, char *, strlen(yytext)+1); 01648 strcpy(value_str.s,yytext); 01649 value_str.lenb = strlen(yytext) + 1; 01650 return(T_LABELV); 01651 } 01652 YY_BREAK 01653 case 101: 01654 YY_RULE_SETUP 01655 #line 286 "snaplex.l" 01656 { memalloc(value_str.s, char *, strlen(yytext)); 01657 strncpy(value_str.s,yytext,strlen(yytext)-1); 01658 value_str.lenb = strlen(yytext); 01659 return(T_LABEL); } 01660 YY_BREAK 01661 case 102: 01662 YY_RULE_SETUP 01663 #line 291 "snaplex.l" 01664 ECHO; 01665 YY_BREAK 01666 #line 1667 "lex.yy.c" 01667 case YY_STATE_EOF(INITIAL): 01668 yyterminate(); 01669 01670 case YY_END_OF_BUFFER: 01671 { 01672 /* Amount of text matched not including the EOB char. */ 01673 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; 01674 01675 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 01676 *yy_cp = yy_hold_char; 01677 YY_RESTORE_YY_MORE_OFFSET 01678 01679 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) 01680 { 01681 /* We're scanning a new file or input source. It's 01682 * possible that this happened because the user 01683 * just pointed yyin at a new source and called 01684 * yylex(). If so, then we have to assure 01685 * consistency between yy_current_buffer and our 01686 * globals. Here is the right place to do so, because 01687 * this is the first action (other than possibly a 01688 * back-up) that will match for the new input source. 01689 */ 01690 yy_n_chars = yy_current_buffer->yy_n_chars; 01691 yy_current_buffer->yy_input_file = yyin; 01692 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; 01693 } 01694 01695 /* Note that here we test for yy_c_buf_p "<=" to the position 01696 * of the first EOB in the buffer, since yy_c_buf_p will 01697 * already have been incremented past the NUL character 01698 * (since all states make transitions on EOB to the 01699 * end-of-buffer state). Contrast this with the test 01700 * in input(). 01701 */ 01702 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 01703 { /* This was really a NUL. */ 01704 yy_state_type yy_next_state; 01705 01706 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; 01707 01708 yy_current_state = yy_get_previous_state(); 01709 01710 /* Okay, we're now positioned to make the NUL 01711 * transition. We couldn't have 01712 * yy_get_previous_state() go ahead and do it 01713 * for us because it doesn't know how to deal 01714 * with the possibility of jamming (and we don't 01715 * want to build jamming into it because then it 01716 * will run more slowly). 01717 */ 01718 01719 yy_next_state = yy_try_NUL_trans( yy_current_state ); 01720 01721 yy_bp = yytext_ptr + YY_MORE_ADJ; 01722 01723 if ( yy_next_state ) 01724 { 01725 /* Consume the NUL. */ 01726 yy_cp = ++yy_c_buf_p; 01727 yy_current_state = yy_next_state; 01728 goto yy_match; 01729 } 01730 01731 else 01732 { 01733 yy_cp = yy_c_buf_p; 01734 goto yy_find_action; 01735 } 01736 } 01737 01738 else switch ( yy_get_next_buffer() ) 01739 { 01740 case EOB_ACT_END_OF_FILE: 01741 { 01742 yy_did_buffer_switch_on_eof = 0; 01743 01744 if ( yywrap() ) 01745 { 01746 /* Note: because we've taken care in 01747 * yy_get_next_buffer() to have set up 01748 * yytext, we can now set up 01749 * yy_c_buf_p so that if some total 01750 * hoser (like flex itself) wants to 01751 * call the scanner after we return the 01752 * YY_NULL, it'll still work - another 01753 * YY_NULL will get returned. 01754 */ 01755 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; 01756 01757 yy_act = YY_STATE_EOF(YY_START); 01758 goto do_action; 01759 } 01760 01761 else 01762 { 01763 if ( ! yy_did_buffer_switch_on_eof ) 01764 YY_NEW_FILE; 01765 } 01766 break; 01767 } 01768 01769 case EOB_ACT_CONTINUE_SCAN: 01770 yy_c_buf_p = 01771 yytext_ptr + yy_amount_of_matched_text; 01772 01773 yy_current_state = yy_get_previous_state(); 01774 01775 yy_cp = yy_c_buf_p; 01776 yy_bp = yytext_ptr + YY_MORE_ADJ; 01777 goto yy_match; 01778 01779 case EOB_ACT_LAST_MATCH: 01780 yy_c_buf_p = 01781 &yy_current_buffer->yy_ch_buf[yy_n_chars]; 01782 01783 yy_current_state = yy_get_previous_state(); 01784 01785 yy_cp = yy_c_buf_p; 01786 yy_bp = yytext_ptr + YY_MORE_ADJ; 01787 goto yy_find_action; 01788 } 01789 break; 01790 } 01791 01792 default: 01793 YY_FATAL_ERROR( 01794 "fatal flex scanner internal error--no action found" ); 01795 } /* end of action switch */ 01796 } /* end of scanning one token */ 01797 } /* end of yylex */ 01798 01799 01800 /* yy_get_next_buffer - try to read in a new buffer 01801 * 01802 * Returns a code representing an action: 01803 * EOB_ACT_LAST_MATCH - 01804 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 01805 * EOB_ACT_END_OF_FILE - end of file 01806 */ 01807 01808 static int yy_get_next_buffer() 01809 { 01810 register char *dest = yy_current_buffer->yy_ch_buf; 01811 register char *source = yytext_ptr; 01812 register int number_to_move, i; 01813 int ret_val; 01814 01815 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) 01816 YY_FATAL_ERROR( 01817 "fatal flex scanner internal error--end of buffer missed" ); 01818 01819 if ( yy_current_buffer->yy_fill_buffer == 0 ) 01820 { /* Don't try to fill the buffer, so this is an EOF. */ 01821 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) 01822 { 01823 /* We matched a single character, the EOB, so 01824 * treat this as a final EOF. 01825 */ 01826 return EOB_ACT_END_OF_FILE; 01827 } 01828 01829 else 01830 { 01831 /* We matched some text prior to the EOB, first 01832 * process it. 01833 */ 01834 return EOB_ACT_LAST_MATCH; 01835 } 01836 } 01837 01838 /* Try to read more data. */ 01839 01840 /* First move last chars to start of buffer. */ 01841 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; 01842 01843 for ( i = 0; i < number_to_move; ++i ) 01844 *(dest++) = *(source++); 01845 01846 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 01847 /* don't do the read, it's not guaranteed to return an EOF, 01848 * just force an EOF 01849 */ 01850 yy_current_buffer->yy_n_chars = yy_n_chars = 0; 01851 01852 else 01853 { 01854 int num_to_read = 01855 yy_current_buffer->yy_buf_size - number_to_move - 1; 01856 01857 while ( num_to_read <= 0 ) 01858 { /* Not enough room in the buffer - grow it. */ 01859 #ifdef YY_USES_REJECT 01860 YY_FATAL_ERROR( 01861 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); 01862 #else 01863 01864 /* just a shorter name for the current buffer */ 01865 YY_BUFFER_STATE b = yy_current_buffer; 01866 01867 int yy_c_buf_p_offset = 01868 (int) (yy_c_buf_p - b->yy_ch_buf); 01869 01870 if ( b->yy_is_our_buffer ) 01871 { 01872 int new_size = b->yy_buf_size * 2; 01873 01874 if ( new_size <= 0 ) 01875 b->yy_buf_size += b->yy_buf_size / 8; 01876 else 01877 b->yy_buf_size *= 2; 01878 01879 b->yy_ch_buf = (char *) 01880 /* Include room in for 2 EOB chars. */ 01881 yy_flex_realloc( (void *) b->yy_ch_buf, 01882 b->yy_buf_size + 2 ); 01883 } 01884 else 01885 /* Can't grow it, we don't own it. */ 01886 b->yy_ch_buf = 0; 01887 01888 if ( ! b->yy_ch_buf ) 01889 YY_FATAL_ERROR( 01890 "fatal error - scanner input buffer overflow" ); 01891 01892 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 01893 01894 num_to_read = yy_current_buffer->yy_buf_size - 01895 number_to_move - 1; 01896 #endif 01897 } 01898 01899 if ( num_to_read > YY_READ_BUF_SIZE ) 01900 num_to_read = YY_READ_BUF_SIZE; 01901 01902 /* Read in more data. */ 01903 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), 01904 yy_n_chars, num_to_read ); 01905 01906 yy_current_buffer->yy_n_chars = yy_n_chars; 01907 } 01908 01909 if ( yy_n_chars == 0 ) 01910 { 01911 if ( number_to_move == YY_MORE_ADJ ) 01912 { 01913 ret_val = EOB_ACT_END_OF_FILE; 01914 yyrestart( yyin ); 01915 } 01916 01917 else 01918 { 01919 ret_val = EOB_ACT_LAST_MATCH; 01920 yy_current_buffer->yy_buffer_status = 01921 YY_BUFFER_EOF_PENDING; 01922 } 01923 } 01924 01925 else 01926 ret_val = EOB_ACT_CONTINUE_SCAN; 01927 01928 yy_n_chars += number_to_move; 01929 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; 01930 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 01931 01932 yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; 01933 01934 return ret_val; 01935 } 01936 01937 01938 /* yy_get_previous_state - get the state just before the EOB char was reached */ 01939 01940 static yy_state_type yy_get_previous_state() 01941 { 01942 register yy_state_type yy_current_state; 01943 register char *yy_cp; 01944 01945 yy_current_state = yy_start; 01946 01947 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 01948 { 01949 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 01950 if ( yy_accept[yy_current_state] ) 01951 { 01952 yy_last_accepting_state = yy_current_state; 01953 yy_last_accepting_cpos = yy_cp; 01954 } 01955 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01956 { 01957 yy_current_state = (int) yy_def[yy_current_state]; 01958 if ( yy_current_state >= 468 ) 01959 yy_c = yy_meta[(unsigned int) yy_c]; 01960 } 01961 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01962 } 01963 01964 return yy_current_state; 01965 } 01966 01967 01968 /* yy_try_NUL_trans - try to make a transition on the NUL character 01969 * 01970 * synopsis 01971 * next_state = yy_try_NUL_trans( current_state ); 01972 */ 01973 01974 #ifdef YY_USE_PROTOS 01975 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) 01976 #else 01977 static yy_state_type yy_try_NUL_trans( yy_current_state ) 01978 yy_state_type yy_current_state; 01979 #endif 01980 { 01981 register int yy_is_jam; 01982 register char *yy_cp = yy_c_buf_p; 01983 01984 register YY_CHAR yy_c = 1; 01985 if ( yy_accept[yy_current_state] ) 01986 { 01987 yy_last_accepting_state = yy_current_state; 01988 yy_last_accepting_cpos = yy_cp; 01989 } 01990 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01991 { 01992 yy_current_state = (int) yy_def[yy_current_state]; 01993 if ( yy_current_state >= 468 ) 01994 yy_c = yy_meta[(unsigned int) yy_c]; 01995 } 01996 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01997 yy_is_jam = (yy_current_state == 467); 01998 01999 return yy_is_jam ? 0 : yy_current_state; 02000 } 02001 02002 02003 #ifndef YY_NO_UNPUT 02004 #ifdef YY_USE_PROTOS 02005 static void yyunput( int c, register char *yy_bp ) 02006 #else 02007 static void yyunput( c, yy_bp ) 02008 int c; 02009 register char *yy_bp; 02010 #endif 02011 { 02012 register char *yy_cp = yy_c_buf_p; 02013 02014 /* undo effects of setting up yytext */ 02015 *yy_cp = yy_hold_char; 02016 02017 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 02018 { /* need to shift things up to make room */ 02019 /* +2 for EOB chars. */ 02020 register int number_to_move = yy_n_chars + 2; 02021 register char *dest = &yy_current_buffer->yy_ch_buf[ 02022 yy_current_buffer->yy_buf_size + 2]; 02023 register char *source = 02024 &yy_current_buffer->yy_ch_buf[number_to_move]; 02025 02026 while ( source > yy_current_buffer->yy_ch_buf ) 02027 *--dest = *--source; 02028 02029 yy_cp += (int) (dest - source); 02030 yy_bp += (int) (dest - source); 02031 yy_current_buffer->yy_n_chars = 02032 yy_n_chars = yy_current_buffer->yy_buf_size; 02033 02034 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 02035 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 02036 } 02037 02038 *--yy_cp = (char) c; 02039 02040 02041 yytext_ptr = yy_bp; 02042 yy_hold_char = *yy_cp; 02043 yy_c_buf_p = yy_cp; 02044 } 02045 #endif /* ifndef YY_NO_UNPUT */ 02046 02047 02048 #ifdef __cplusplus 02049 static int yyinput() 02050 #else 02051 static int input() 02052 #endif 02053 { 02054 int c; 02055 02056 *yy_c_buf_p = yy_hold_char; 02057 02058 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 02059 { 02060 /* yy_c_buf_p now points to the character we want to return. 02061 * If this occurs *before* the EOB characters, then it's a 02062 * valid NUL; if not, then we've hit the end of the buffer. 02063 */ 02064 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 02065 /* This was really a NUL. */ 02066 *yy_c_buf_p = '\0'; 02067 02068 else 02069 { /* need more input */ 02070 int offset = yy_c_buf_p - yytext_ptr; 02071 ++yy_c_buf_p; 02072 02073 switch ( yy_get_next_buffer() ) 02074 { 02075 case EOB_ACT_LAST_MATCH: 02076 /* This happens because yy_g_n_b() 02077 * sees that we've accumulated a 02078 * token and flags that we need to 02079 * try matching the token before 02080 * proceeding. But for input(), 02081 * there's no matching to consider. 02082 * So convert the EOB_ACT_LAST_MATCH 02083 * to EOB_ACT_END_OF_FILE. 02084 */ 02085 02086 /* Reset buffer status. */ 02087 yyrestart( yyin ); 02088 02089 /* fall through */ 02090 02091 case EOB_ACT_END_OF_FILE: 02092 { 02093 if ( yywrap() ) 02094 return EOF; 02095 02096 if ( ! yy_did_buffer_switch_on_eof ) 02097 YY_NEW_FILE; 02098 #ifdef __cplusplus 02099 return yyinput(); 02100 #else 02101 return input(); 02102 #endif 02103 } 02104 02105 case EOB_ACT_CONTINUE_SCAN: 02106 yy_c_buf_p = yytext_ptr + offset; 02107 break; 02108 } 02109 } 02110 } 02111 02112 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ 02113 *yy_c_buf_p = '\0'; /* preserve yytext */ 02114 yy_hold_char = *++yy_c_buf_p; 02115 02116 02117 return c; 02118 } 02119 02120 02121 #ifdef YY_USE_PROTOS 02122 void yyrestart( FILE *input_file ) 02123 #else 02124 void yyrestart( input_file ) 02125 FILE *input_file; 02126 #endif 02127 { 02128 if ( ! yy_current_buffer ) 02129 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); 02130 02131 yy_init_buffer( yy_current_buffer, input_file ); 02132 yy_load_buffer_state(); 02133 } 02134 02135 02136 #ifdef YY_USE_PROTOS 02137 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) 02138 #else 02139 void yy_switch_to_buffer( new_buffer ) 02140 YY_BUFFER_STATE new_buffer; 02141 #endif 02142 { 02143 if ( yy_current_buffer == new_buffer ) 02144 return; 02145 02146 if ( yy_current_buffer ) 02147 { 02148 /* Flush out information for old buffer. */ 02149 *yy_c_buf_p = yy_hold_char; 02150 yy_current_buffer->yy_buf_pos = yy_c_buf_p; 02151 yy_current_buffer->yy_n_chars = yy_n_chars; 02152 } 02153 02154 yy_current_buffer = new_buffer; 02155 yy_load_buffer_state(); 02156 02157 /* We don't actually know whether we did this switch during 02158 * EOF (yywrap()) processing, but the only time this flag 02159 * is looked at is after yywrap() is called, so it's safe 02160 * to go ahead and always set it. 02161 */ 02162 yy_did_buffer_switch_on_eof = 1; 02163 } 02164 02165 02166 #ifdef YY_USE_PROTOS 02167 void yy_load_buffer_state( void ) 02168 #else 02169 void yy_load_buffer_state() 02170 #endif 02171 { 02172 yy_n_chars = yy_current_buffer->yy_n_chars; 02173 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; 02174 yyin = yy_current_buffer->yy_input_file; 02175 yy_hold_char = *yy_c_buf_p; 02176 } 02177 02178 02179 #ifdef YY_USE_PROTOS 02180 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) 02181 #else 02182 YY_BUFFER_STATE yy_create_buffer( file, size ) 02183 FILE *file; 02184 int size; 02185 #endif 02186 { 02187 YY_BUFFER_STATE b; 02188 02189 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 02190 if ( ! b ) 02191 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 02192 02193 b->yy_buf_size = size; 02194 02195 /* yy_ch_buf has to be 2 characters longer than the size given because 02196 * we need to put in 2 end-of-buffer characters. 02197 */ 02198 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); 02199 if ( ! b->yy_ch_buf ) 02200 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 02201 02202 b->yy_is_our_buffer = 1; 02203 02204 yy_init_buffer( b, file ); 02205 02206 return b; 02207 } 02208 02209 02210 #ifdef YY_USE_PROTOS 02211 void yy_delete_buffer( YY_BUFFER_STATE b ) 02212 #else 02213 void yy_delete_buffer( b ) 02214 YY_BUFFER_STATE b; 02215 #endif 02216 { 02217 if ( ! b ) 02218 return; 02219 02220 if ( b == yy_current_buffer ) 02221 yy_current_buffer = (YY_BUFFER_STATE) 0; 02222 02223 if ( b->yy_is_our_buffer ) 02224 yy_flex_free( (void *) b->yy_ch_buf ); 02225 02226 yy_flex_free( (void *) b ); 02227 } 02228 02229 02230 02231 #ifdef YY_USE_PROTOS 02232 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) 02233 #else 02234 void yy_init_buffer( b, file ) 02235 YY_BUFFER_STATE b; 02236 FILE *file; 02237 #endif 02238 02239 02240 { 02241 yy_flush_buffer( b ); 02242 02243 b->yy_input_file = file; 02244 b->yy_fill_buffer = 1; 02245 02246 #if YY_ALWAYS_INTERACTIVE 02247 b->yy_is_interactive = 1; 02248 #else 02249 #if YY_NEVER_INTERACTIVE 02250 b->yy_is_interactive = 0; 02251 #else 02252 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 02253 #endif 02254 #endif 02255 } 02256 02257 02258 #ifdef YY_USE_PROTOS 02259 void yy_flush_buffer( YY_BUFFER_STATE b ) 02260 #else 02261 void yy_flush_buffer( b ) 02262 YY_BUFFER_STATE b; 02263 #endif 02264 02265 { 02266 if ( ! b ) 02267 return; 02268 02269 b->yy_n_chars = 0; 02270 02271 /* We always need two end-of-buffer characters. The first causes 02272 * a transition to the end-of-buffer state. The second causes 02273 * a jam in that state. 02274 */ 02275 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 02276 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 02277 02278 b->yy_buf_pos = &b->yy_ch_buf[0]; 02279 02280 b->yy_at_bol = 1; 02281 b->yy_buffer_status = YY_BUFFER_NEW; 02282 02283 if ( b == yy_current_buffer ) 02284 yy_load_buffer_state(); 02285 } 02286 02287 02288 #ifndef YY_NO_SCAN_BUFFER 02289 #ifdef YY_USE_PROTOS 02290 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) 02291 #else 02292 YY_BUFFER_STATE yy_scan_buffer( base, size ) 02293 char *base; 02294 yy_size_t size; 02295 #endif 02296 { 02297 YY_BUFFER_STATE b; 02298 02299 if ( size < 2 || 02300 base[size-2] != YY_END_OF_BUFFER_CHAR || 02301 base[size-1] != YY_END_OF_BUFFER_CHAR ) 02302 /* They forgot to leave room for the EOB's. */ 02303 return 0; 02304 02305 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 02306 if ( ! b ) 02307 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 02308 02309 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 02310 b->yy_buf_pos = b->yy_ch_buf = base; 02311 b->yy_is_our_buffer = 0; 02312 b->yy_input_file = 0; 02313 b->yy_n_chars = b->yy_buf_size; 02314 b->yy_is_interactive = 0; 02315 b->yy_at_bol = 1; 02316 b->yy_fill_buffer = 0; 02317 b->yy_buffer_status = YY_BUFFER_NEW; 02318 02319 yy_switch_to_buffer( b ); 02320 02321 return b; 02322 } 02323 #endif 02324 02325 02326 #ifndef YY_NO_SCAN_STRING 02327 #ifdef YY_USE_PROTOS 02328 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) 02329 #else 02330 YY_BUFFER_STATE yy_scan_string( yy_str ) 02331 yyconst char *yy_str; 02332 #endif 02333 { 02334 int len; 02335 for ( len = 0; yy_str[len]; ++len ) 02336 ; 02337 02338 return yy_scan_bytes( yy_str, len ); 02339 } 02340 #endif 02341 02342 02343 #ifndef YY_NO_SCAN_BYTES 02344 #ifdef YY_USE_PROTOS 02345 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) 02346 #else 02347 YY_BUFFER_STATE yy_scan_bytes( bytes, len ) 02348 yyconst char *bytes; 02349 int len; 02350 #endif 02351 { 02352 YY_BUFFER_STATE b; 02353 char *buf; 02354 yy_size_t n; 02355 int i; 02356 02357 /* Get memory for full buffer, including space for trailing EOB's. */ 02358 n = len + 2; 02359 buf = (char *) yy_flex_alloc( n ); 02360 if ( ! buf ) 02361 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 02362 02363 for ( i = 0; i < len; ++i ) 02364 buf[i] = bytes[i]; 02365 02366 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; 02367 02368 b = yy_scan_buffer( buf, n ); 02369 if ( ! b ) 02370 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 02371 02372 /* It's okay to grow etc. this buffer, and we should throw it 02373 * away when we're done. 02374 */ 02375 b->yy_is_our_buffer = 1; 02376 02377 return b; 02378 } 02379 #endif 02380 02381 02382 #ifndef YY_NO_PUSH_STATE 02383 #ifdef YY_USE_PROTOS 02384 static void yy_push_state( int new_state ) 02385 #else 02386 static void yy_push_state( new_state ) 02387 int new_state; 02388 #endif 02389 { 02390 if ( yy_start_stack_ptr >= yy_start_stack_depth ) 02391 { 02392 yy_size_t new_size; 02393 02394 yy_start_stack_depth += YY_START_STACK_INCR; 02395 new_size = yy_start_stack_depth * sizeof( int ); 02396 02397 if ( ! yy_start_stack ) 02398 yy_start_stack = (int *) yy_flex_alloc( new_size ); 02399 02400 else 02401 yy_start_stack = (int *) yy_flex_realloc( 02402 (void *) yy_start_stack, new_size ); 02403 02404 if ( ! yy_start_stack ) 02405 YY_FATAL_ERROR( 02406 "out of memory expanding start-condition stack" ); 02407 } 02408 02409 yy_start_stack[yy_start_stack_ptr++] = YY_START; 02410 02411 BEGIN(new_state); 02412 } 02413 #endif 02414 02415 02416 #ifndef YY_NO_POP_STATE 02417 static void yy_pop_state() 02418 { 02419 if ( --yy_start_stack_ptr < 0 ) 02420 YY_FATAL_ERROR( "start-condition stack underflow" ); 02421 02422 BEGIN(yy_start_stack[yy_start_stack_ptr]); 02423 } 02424 #endif 02425 02426 02427 #ifndef YY_NO_TOP_STATE 02428 static int yy_top_state() 02429 { 02430 return yy_start_stack[yy_start_stack_ptr - 1]; 02431 } 02432 #endif 02433 02434 #ifndef YY_EXIT_FAILURE 02435 #define YY_EXIT_FAILURE 2 02436 #endif 02437 02438 #ifdef YY_USE_PROTOS 02439 static void yy_fatal_error( yyconst char msg[] ) 02440 #else 02441 static void yy_fatal_error( msg ) 02442 char msg[]; 02443 #endif 02444 { 02445 (void) fprintf( stderr, "%s\n", msg ); 02446 exit( YY_EXIT_FAILURE ); 02447 } 02448 02449 02450 02451 /* Redefine yyless() so it works in section 3 code. */ 02452 02453 #undef yyless 02454 #define yyless(n) \ 02455 do \ 02456 { \ 02457 /* Undo effects of setting up yytext. */ \ 02458 yytext[yyleng] = yy_hold_char; \ 02459 yy_c_buf_p = yytext + n; \ 02460 yy_hold_char = *yy_c_buf_p; \ 02461 *yy_c_buf_p = '\0'; \ 02462 yyleng = n; \ 02463 } \ 02464 while ( 0 ) 02465 02466 02467 /* Internal utility routines. */ 02468 02469 #ifndef yytext_ptr 02470 #ifdef YY_USE_PROTOS 02471 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 02472 #else 02473 static void yy_flex_strncpy( s1, s2, n ) 02474 char *s1; 02475 yyconst char *s2; 02476 int n; 02477 #endif 02478 { 02479 register int i; 02480 for ( i = 0; i < n; ++i ) 02481 s1[i] = s2[i]; 02482 } 02483 #endif 02484 02485 #ifdef YY_NEED_STRLEN 02486 #ifdef YY_USE_PROTOS 02487 static int yy_flex_strlen( yyconst char *s ) 02488 #else 02489 static int yy_flex_strlen( s ) 02490 yyconst char *s; 02491 #endif 02492 { 02493 register int n; 02494 for ( n = 0; s[n]; ++n ) 02495 ; 02496 02497 return n; 02498 } 02499 #endif 02500 02501 02502 #ifdef YY_USE_PROTOS 02503 static void *yy_flex_alloc( yy_size_t size ) 02504 #else 02505 static void *yy_flex_alloc( size ) 02506 yy_size_t size; 02507 #endif 02508 { 02509 return (void *) malloc( size ); 02510 } 02511 02512 #ifdef YY_USE_PROTOS 02513 static void *yy_flex_realloc( void *ptr, yy_size_t size ) 02514 #else 02515 static void *yy_flex_realloc( ptr, size ) 02516 void *ptr; 02517 yy_size_t size; 02518 #endif 02519 { 02520 /* The cast to (char *) in the following accommodates both 02521 * implementations that use char* generic pointers, and those 02522 * that use void* generic pointers. It works with the latter 02523 * because both ANSI C and C++ allow castless assignment from 02524 * any pointer type to void*, and deal with argument conversions 02525 * as though doing an assignment. 02526 */ 02527 return (void *) realloc( (char *) ptr, size ); 02528 } 02529 02530 #ifdef YY_USE_PROTOS 02531 static void yy_flex_free( void *ptr ) 02532 #else 02533 static void yy_flex_free( ptr ) 02534 void *ptr; 02535 #endif 02536 { 02537 free( ptr ); 02538 } 02539 02540 #if YY_MAIN 02541 int main() 02542 { 02543 yylex(); 02544 return 0; 02545 } 02546 #endif 02547 #line 291 "snaplex.l" 02548 02549 /* <<EOF>> return(T_EOF); */ 02550 void conv_string(char *orig,buffer_t *buf) { 02551 char *dest; 02552 char *src; 02553 02554 memalloc(buf->s, char *, strlen(orig) - 1); 02555 dest = buf->s; 02556 src = orig; 02557 src++; /* skip initial quote */ 02558 while(*src != '\"') { 02559 if (*src == '\\') { 02560 switch(src[1]) { 02561 case 'n': 02562 *dest++ = '\n'; src += 2; break; 02563 case 'b': 02564 *dest++ = '\b'; src += 2; break; 02565 case 'r': 02566 *dest++ = '\r'; src += 2; break; 02567 case 't': 02568 *dest++ = '\t'; src += 2; break; 02569 case '\\': 02570 *dest++ = '\\'; src += 2; break; 02571 case '\"': 02572 *dest++ = '\"'; src += 2; break; 02573 default: 02574 { 02575 char save = src[4]; 02576 int charcode; 02577 assert((isdigit(src[1]) && isdigit(src[2]) && isdigit(src[3]))); 02578 src[4] = '\0'; 02579 sscanf(&src[1],"%o",&charcode); 02580 src[4] = save; 02581 *dest++ = (char)charcode; src += 4; break; 02582 } 02583 } 02584 } else { 02585 *dest++ = *src++; 02586 } 02587 } 02588 *dest++ = '\0'; 02589 buf->lenb = dest - buf->s; 02590 return; 02591 } |