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