SphinxBase 0.6
|
00001 #line 2 "jsgf_scanner.c" 00002 00003 #line 4 "jsgf_scanner.c" 00004 00005 #define YY_INT_ALIGNED short int 00006 00007 /* A lexical scanner generated by flex */ 00008 00009 #define FLEX_SCANNER 00010 #define YY_FLEX_MAJOR_VERSION 2 00011 #define YY_FLEX_MINOR_VERSION 5 00012 #define YY_FLEX_SUBMINOR_VERSION 35 00013 #if YY_FLEX_SUBMINOR_VERSION > 0 00014 #define FLEX_BETA 00015 #endif 00016 00017 /* First, we deal with platform-specific or compiler-specific issues. */ 00018 00019 /* begin standard C headers. */ 00020 #include <stdio.h> 00021 #include <string.h> 00022 #include <errno.h> 00023 #include <stdlib.h> 00024 00025 /* end standard C headers. */ 00026 00027 /* flex integer type definitions */ 00028 00029 #ifndef FLEXINT_H 00030 #define FLEXINT_H 00031 00032 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ 00033 00034 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 00035 00036 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 00037 * if you want the limit (max/min) macros for int types. 00038 */ 00039 #ifndef __STDC_LIMIT_MACROS 00040 #define __STDC_LIMIT_MACROS 1 00041 #endif 00042 00043 #include <inttypes.h> 00044 typedef int8_t flex_int8_t; 00045 typedef uint8_t flex_uint8_t; 00046 typedef int16_t flex_int16_t; 00047 typedef uint16_t flex_uint16_t; 00048 typedef int32_t flex_int32_t; 00049 typedef uint32_t flex_uint32_t; 00050 #else 00051 typedef signed char flex_int8_t; 00052 typedef short int flex_int16_t; 00053 typedef int flex_int32_t; 00054 typedef unsigned char flex_uint8_t; 00055 typedef unsigned short int flex_uint16_t; 00056 typedef unsigned int flex_uint32_t; 00057 #endif /* ! C99 */ 00058 00059 /* Limits of integral types. */ 00060 #ifndef INT8_MIN 00061 #define INT8_MIN (-128) 00062 #endif 00063 #ifndef INT16_MIN 00064 #define INT16_MIN (-32767-1) 00065 #endif 00066 #ifndef INT32_MIN 00067 #define INT32_MIN (-2147483647-1) 00068 #endif 00069 #ifndef INT8_MAX 00070 #define INT8_MAX (127) 00071 #endif 00072 #ifndef INT16_MAX 00073 #define INT16_MAX (32767) 00074 #endif 00075 #ifndef INT32_MAX 00076 #define INT32_MAX (2147483647) 00077 #endif 00078 #ifndef UINT8_MAX 00079 #define UINT8_MAX (255U) 00080 #endif 00081 #ifndef UINT16_MAX 00082 #define UINT16_MAX (65535U) 00083 #endif 00084 #ifndef UINT32_MAX 00085 #define UINT32_MAX (4294967295U) 00086 #endif 00087 00088 #endif /* ! FLEXINT_H */ 00089 00090 #ifdef __cplusplus 00091 00092 /* The "const" storage-class-modifier is valid. */ 00093 #define YY_USE_CONST 00094 00095 #else /* ! __cplusplus */ 00096 00097 /* C99 requires __STDC__ to be defined as 1. */ 00098 #if defined (__STDC__) 00099 00100 #define YY_USE_CONST 00101 00102 #endif /* defined (__STDC__) */ 00103 #endif /* ! __cplusplus */ 00104 00105 #ifdef YY_USE_CONST 00106 #define yyconst const 00107 #else 00108 #define yyconst 00109 #endif 00110 00111 /* Returned upon end-of-file. */ 00112 #define YY_NULL 0 00113 00114 /* Promotes a possibly negative, possibly signed char to an unsigned 00115 * integer for use as an array index. If the signed char is negative, 00116 * we want to instead treat it as an 8-bit unsigned char, hence the 00117 * double cast. 00118 */ 00119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 00120 00121 /* An opaque pointer. */ 00122 #ifndef YY_TYPEDEF_YY_SCANNER_T 00123 #define YY_TYPEDEF_YY_SCANNER_T 00124 typedef void* yyscan_t; 00125 #endif 00126 00127 /* For convenience, these vars (plus the bison vars far below) 00128 are macros in the reentrant scanner. */ 00129 #define yyin yyg->yyin_r 00130 #define yyout yyg->yyout_r 00131 #define yyextra yyg->yyextra_r 00132 #define yyleng yyg->yyleng_r 00133 #define yytext yyg->yytext_r 00134 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) 00135 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) 00136 #define yy_flex_debug yyg->yy_flex_debug_r 00137 00138 /* Enter a start condition. This macro really ought to take a parameter, 00139 * but we do it the disgusting crufty way forced on us by the ()-less 00140 * definition of BEGIN. 00141 */ 00142 #define BEGIN yyg->yy_start = 1 + 2 * 00143 00144 /* Translate the current start state into a value that can be later handed 00145 * to BEGIN to return to the state. The YYSTATE alias is for lex 00146 * compatibility. 00147 */ 00148 #define YY_START ((yyg->yy_start - 1) / 2) 00149 #define YYSTATE YY_START 00150 00151 /* Action number for EOF rule of a given start state. */ 00152 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 00153 00154 /* Special action meaning "start processing a new file". */ 00155 #define YY_NEW_FILE yyrestart(yyin ,yyscanner ) 00156 00157 #define YY_END_OF_BUFFER_CHAR 0 00158 00159 /* Size of default input buffer. */ 00160 #ifndef YY_BUF_SIZE 00161 #define YY_BUF_SIZE 16384 00162 #endif 00163 00164 /* The state buf must be large enough to hold one state per character in the main buffer. 00165 */ 00166 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) 00167 00168 #ifndef YY_TYPEDEF_YY_BUFFER_STATE 00169 #define YY_TYPEDEF_YY_BUFFER_STATE 00170 typedef struct yy_buffer_state *YY_BUFFER_STATE; 00171 #endif 00172 00173 #define EOB_ACT_CONTINUE_SCAN 0 00174 #define EOB_ACT_END_OF_FILE 1 00175 #define EOB_ACT_LAST_MATCH 2 00176 00177 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires 00178 * access to the local variable yy_act. Since yyless() is a macro, it would break 00179 * existing scanners that call yyless() from OUTSIDE yylex. 00180 * One obvious solution it to make yy_act a global. I tried that, and saw 00181 * a 5% performance hit in a non-yylineno scanner, because yy_act is 00182 * normally declared as a register variable-- so it is not worth it. 00183 */ 00184 #define YY_LESS_LINENO(n) \ 00185 do { \ 00186 int yyl;\ 00187 for ( yyl = n; yyl < yyleng; ++yyl )\ 00188 if ( yytext[yyl] == '\n' )\ 00189 --yylineno;\ 00190 }while(0) 00191 00192 /* Return all but the first "n" matched characters back to the input stream. */ 00193 #define yyless(n) \ 00194 do \ 00195 { \ 00196 /* Undo effects of setting up yytext. */ \ 00197 int yyless_macro_arg = (n); \ 00198 YY_LESS_LINENO(yyless_macro_arg);\ 00199 *yy_cp = yyg->yy_hold_char; \ 00200 YY_RESTORE_YY_MORE_OFFSET \ 00201 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ 00202 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 00203 } \ 00204 while ( 0 ) 00205 00206 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) 00207 00208 #ifndef YY_TYPEDEF_YY_SIZE_T 00209 #define YY_TYPEDEF_YY_SIZE_T 00210 typedef size_t yy_size_t; 00211 #endif 00212 00213 #ifndef YY_STRUCT_YY_BUFFER_STATE 00214 #define YY_STRUCT_YY_BUFFER_STATE 00215 struct yy_buffer_state 00216 { 00217 FILE *yy_input_file; 00218 00219 char *yy_ch_buf; /* input buffer */ 00220 char *yy_buf_pos; /* current position in input buffer */ 00221 00222 /* Size of input buffer in bytes, not including room for EOB 00223 * characters. 00224 */ 00225 yy_size_t yy_buf_size; 00226 00227 /* Number of characters read into yy_ch_buf, not including EOB 00228 * characters. 00229 */ 00230 int yy_n_chars; 00231 00232 /* Whether we "own" the buffer - i.e., we know we created it, 00233 * and can realloc() it to grow it, and should free() it to 00234 * delete it. 00235 */ 00236 int yy_is_our_buffer; 00237 00238 /* Whether this is an "interactive" input source; if so, and 00239 * if we're using stdio for input, then we want to use getc() 00240 * instead of fread(), to make sure we stop fetching input after 00241 * each newline. 00242 */ 00243 int yy_is_interactive; 00244 00245 /* Whether we're considered to be at the beginning of a line. 00246 * If so, '^' rules will be active on the next match, otherwise 00247 * not. 00248 */ 00249 int yy_at_bol; 00250 00251 int yy_bs_lineno; 00252 int yy_bs_column; 00254 /* Whether to try to fill the input buffer when we reach the 00255 * end of it. 00256 */ 00257 int yy_fill_buffer; 00258 00259 int yy_buffer_status; 00260 00261 #define YY_BUFFER_NEW 0 00262 #define YY_BUFFER_NORMAL 1 00263 /* When an EOF's been seen but there's still some text to process 00264 * then we mark the buffer as YY_EOF_PENDING, to indicate that we 00265 * shouldn't try reading from the input source any more. We might 00266 * still have a bunch of tokens to match, though, because of 00267 * possible backing-up. 00268 * 00269 * When we actually see the EOF, we change the status to "new" 00270 * (via yyrestart()), so that the user can continue scanning by 00271 * just pointing yyin at a new input file. 00272 */ 00273 #define YY_BUFFER_EOF_PENDING 2 00274 00275 }; 00276 #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 00277 00278 /* We provide macros for accessing buffer states in case in the 00279 * future we want to put the buffer states in a more general 00280 * "scanner state". 00281 * 00282 * Returns the top of the stack, or NULL. 00283 */ 00284 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ 00285 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ 00286 : NULL) 00287 00288 /* Same as previous macro, but useful when we know that the buffer stack is not 00289 * NULL or when we need an lvalue. For internal use only. 00290 */ 00291 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] 00292 00293 void yyrestart (FILE *input_file ,yyscan_t yyscanner ); 00294 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); 00295 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); 00296 void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); 00297 void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); 00298 void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); 00299 void yypop_buffer_state (yyscan_t yyscanner ); 00300 00301 static void yyensure_buffer_stack (yyscan_t yyscanner ); 00302 static void yy_load_buffer_state (yyscan_t yyscanner ); 00303 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); 00304 00305 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) 00306 00307 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); 00308 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); 00309 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); 00310 00311 void *yyalloc (yy_size_t ,yyscan_t yyscanner ); 00312 void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); 00313 void yyfree (void * ,yyscan_t yyscanner ); 00314 00315 #define yy_new_buffer yy_create_buffer 00316 00317 #define yy_set_interactive(is_interactive) \ 00318 { \ 00319 if ( ! YY_CURRENT_BUFFER ){ \ 00320 yyensure_buffer_stack (yyscanner); \ 00321 YY_CURRENT_BUFFER_LVALUE = \ 00322 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ 00323 } \ 00324 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ 00325 } 00326 00327 #define yy_set_bol(at_bol) \ 00328 { \ 00329 if ( ! YY_CURRENT_BUFFER ){\ 00330 yyensure_buffer_stack (yyscanner); \ 00331 YY_CURRENT_BUFFER_LVALUE = \ 00332 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ 00333 } \ 00334 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ 00335 } 00336 00337 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 00338 00339 /* Begin user sect3 */ 00340 00341 #define yywrap(n) 1 00342 #define YY_SKIP_YYWRAP 00343 00344 typedef unsigned char YY_CHAR; 00345 00346 typedef int yy_state_type; 00347 00348 #define yytext_ptr yytext_r 00349 00350 static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); 00351 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); 00352 static int yy_get_next_buffer (yyscan_t yyscanner ); 00353 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); 00354 00355 /* Done after the current pattern has been matched and before the 00356 * corresponding action - sets up yytext. 00357 */ 00358 #define YY_DO_BEFORE_ACTION \ 00359 yyg->yytext_ptr = yy_bp; \ 00360 yyleng = (size_t) (yy_cp - yy_bp); \ 00361 yyg->yy_hold_char = *yy_cp; \ 00362 *yy_cp = '\0'; \ 00363 yyg->yy_c_buf_p = yy_cp; 00364 00365 #define YY_NUM_RULES 22 00366 #define YY_END_OF_BUFFER 23 00367 /* This struct is not used in this scanner, 00368 but its presence is necessary. */ 00369 struct yy_trans_info 00370 { 00371 flex_int32_t yy_verify; 00372 flex_int32_t yy_nxt; 00373 }; 00374 static yyconst flex_int16_t yy_accept[98] = 00375 { 0, 00376 0, 0, 0, 0, 0, 0, 0, 0, 23, 22, 00377 1, 22, 22, 22, 22, 22, 22, 22, 5, 1, 00378 5, 17, 1, 17, 21, 21, 18, 21, 21, 9, 00379 1, 9, 0, 3, 0, 0, 0, 0, 0, 0, 00380 4, 17, 17, 0, 17, 17, 7, 0, 20, 0, 00381 0, 0, 0, 0, 16, 8, 0, 0, 2, 14, 00382 0, 0, 0, 0, 19, 0, 17, 0, 17, 17, 00383 0, 0, 6, 20, 0, 15, 0, 0, 16, 0, 00384 0, 0, 0, 0, 19, 0, 0, 0, 10, 0, 00385 0, 0, 0, 12, 13, 11, 0 00386 00387 } ; 00388 00389 static yyconst flex_int32_t yy_ec[256] = 00390 { 0, 00391 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 00392 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 00393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00394 1, 2, 1, 4, 5, 1, 1, 1, 1, 6, 00395 6, 7, 6, 1, 8, 9, 10, 11, 11, 11, 00396 11, 11, 11, 11, 11, 11, 11, 1, 12, 13, 00397 6, 14, 1, 1, 1, 1, 1, 1, 1, 15, 00398 16, 1, 1, 17, 1, 1, 1, 1, 1, 1, 00399 1, 1, 18, 1, 1, 1, 1, 1, 1, 1, 00400 6, 19, 6, 1, 1, 1, 20, 21, 22, 1, 00401 00402 23, 1, 24, 1, 25, 1, 1, 26, 27, 1, 00403 28, 29, 1, 30, 1, 31, 32, 1, 1, 1, 00404 1, 1, 33, 6, 34, 1, 1, 1, 1, 1, 00405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00410 1, 1, 1, 1, 1, 1, 35, 1, 1, 1, 00411 36, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00412 00413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00416 1, 1, 1, 1, 1, 1, 1, 1, 37, 1, 00417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00418 1, 1, 1, 1, 1 00419 } ; 00420 00421 static yyconst flex_int32_t yy_meta[38] = 00422 { 0, 00423 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 00424 1, 2, 3, 3, 1, 1, 1, 1, 1, 1, 00425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 00426 1, 1, 2, 2, 1, 1, 1 00427 } ; 00428 00429 static yyconst flex_int16_t yy_base[113] = 00430 { 0, 00431 0, 36, 4, 12, 72, 105, 14, 20, 135, 312, 00432 312, 117, 2, 0, 103, 105, 99, 95, 312, 312, 00433 119, 0, 312, 138, 312, 21, 312, 0, 1, 312, 00434 312, 118, 109, 312, 123, 111, 104, 94, 101, 85, 00435 312, 0, 171, 14, 0, 204, 312, 109, 113, 41, 00436 106, 96, 21, 23, 312, 312, 88, 98, 312, 312, 00437 73, 71, 70, 89, 312, 44, 0, 39, 0, 237, 00438 43, 90, 312, 312, 57, 312, 37, 69, 43, 77, 00439 64, 57, 58, 64, 76, 94, 79, 59, 312, 39, 00440 14, 14, 4, 312, 312, 312, 312, 271, 274, 277, 00441 00442 280, 283, 0, 285, 288, 290, 293, 296, 299, 302, 00443 305, 308 00444 } ; 00445 00446 static yyconst flex_int16_t yy_def[113] = 00447 { 0, 00448 98, 98, 99, 99, 100, 100, 101, 101, 97, 97, 00449 97, 97, 97, 102, 97, 97, 97, 97, 97, 97, 00450 97, 103, 97, 104, 97, 97, 97, 105, 106, 97, 00451 97, 97, 97, 97, 107, 102, 97, 97, 97, 97, 00452 97, 103, 104, 108, 103, 109, 97, 97, 110, 97, 00453 97, 105, 106, 111, 97, 97, 97, 107, 97, 97, 00454 97, 97, 97, 97, 97, 112, 43, 108, 43, 109, 00455 97, 110, 97, 97, 97, 97, 106, 111, 106, 97, 00456 97, 97, 97, 97, 108, 112, 97, 97, 97, 97, 00457 97, 97, 97, 97, 97, 97, 0, 97, 97, 97, 00458 00459 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 00460 97, 97 00461 } ; 00462 00463 static yyconst flex_int16_t yy_nxt[350] = 00464 { 0, 00465 42, 11, 11, 97, 12, 20, 11, 97, 34, 13, 00466 21, 35, 14, 20, 11, 31, 11, 65, 21, 54, 00467 32, 31, 11, 15, 16, 53, 32, 47, 17, 48, 00468 49, 50, 66, 96, 55, 95, 18, 11, 11, 54, 00469 12, 78, 65, 51, 94, 13, 44, 85, 14, 48, 00470 74, 50, 74, 87, 55, 54, 79, 66, 93, 15, 00471 16, 54, 86, 51, 17, 51, 74, 88, 74, 88, 00472 55, 53, 18, 23, 11, 24, 55, 25, 25, 65, 00473 33, 26, 92, 27, 28, 25, 91, 78, 74, 87, 00474 90, 89, 73, 84, 66, 83, 44, 85, 82, 81, 00475 00476 59, 51, 79, 80, 29, 25, 23, 11, 24, 76, 00477 25, 25, 86, 75, 26, 73, 27, 28, 25, 71, 00478 64, 63, 62, 61, 60, 59, 57, 56, 41, 40, 00479 39, 38, 37, 33, 97, 97, 97, 29, 25, 44, 00480 44, 45, 97, 44, 44, 97, 97, 44, 97, 44, 00481 44, 44, 97, 97, 97, 97, 46, 97, 97, 97, 00482 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 00483 44, 44, 44, 44, 45, 97, 44, 44, 97, 97, 00484 44, 97, 44, 44, 44, 97, 97, 97, 97, 46, 00485 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 00486 00487 97, 97, 97, 44, 44, 68, 44, 69, 97, 68, 00488 68, 97, 97, 68, 97, 68, 68, 68, 97, 97, 00489 97, 97, 70, 97, 97, 97, 97, 97, 97, 97, 00490 97, 97, 97, 97, 97, 97, 68, 68, 68, 44, 00491 69, 97, 68, 68, 97, 97, 68, 97, 68, 68, 00492 68, 97, 97, 97, 97, 70, 97, 97, 97, 97, 00493 97, 97, 97, 97, 97, 97, 97, 97, 97, 68, 00494 68, 10, 10, 10, 19, 19, 19, 22, 22, 22, 00495 30, 30, 30, 36, 36, 43, 43, 43, 52, 52, 00496 53, 53, 53, 58, 58, 58, 44, 44, 44, 67, 00497 00498 67, 67, 72, 72, 72, 77, 77, 77, 68, 68, 00499 68, 9, 97, 97, 97, 97, 97, 97, 97, 97, 00500 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 00501 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 00502 97, 97, 97, 97, 97, 97, 97, 97, 97 00503 } ; 00504 00505 static yyconst flex_int16_t yy_chk[350] = 00506 { 0, 00507 103, 1, 1, 0, 1, 3, 3, 0, 13, 1, 00508 3, 13, 1, 4, 4, 7, 7, 44, 4, 29, 00509 7, 8, 8, 1, 1, 54, 8, 26, 1, 26, 00510 26, 26, 44, 93, 29, 92, 1, 2, 2, 53, 00511 2, 54, 68, 26, 91, 2, 66, 66, 2, 50, 00512 50, 50, 71, 71, 53, 77, 54, 68, 90, 2, 00513 2, 79, 66, 50, 2, 71, 75, 75, 88, 88, 00514 77, 78, 2, 5, 5, 5, 79, 5, 5, 85, 00515 84, 5, 83, 5, 5, 5, 82, 78, 87, 87, 00516 81, 80, 72, 64, 85, 63, 86, 86, 62, 61, 00517 00518 58, 87, 78, 57, 5, 5, 6, 6, 6, 52, 00519 6, 6, 86, 51, 6, 49, 6, 6, 6, 48, 00520 40, 39, 38, 37, 36, 35, 33, 32, 21, 18, 00521 17, 16, 15, 12, 9, 0, 0, 6, 6, 24, 00522 24, 24, 0, 24, 24, 0, 0, 24, 0, 24, 00523 24, 24, 0, 0, 0, 0, 24, 0, 0, 0, 00524 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00525 24, 24, 43, 43, 43, 0, 43, 43, 0, 0, 00526 43, 0, 43, 43, 43, 0, 0, 0, 0, 43, 00527 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 00528 00529 0, 0, 0, 43, 43, 46, 46, 46, 0, 46, 00530 46, 0, 0, 46, 0, 46, 46, 46, 0, 0, 00531 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 00532 0, 0, 0, 0, 0, 0, 46, 46, 70, 70, 00533 70, 0, 70, 70, 0, 0, 70, 0, 70, 70, 00534 70, 0, 0, 0, 0, 70, 0, 0, 0, 0, 00535 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 00536 70, 98, 98, 98, 99, 99, 99, 100, 100, 100, 00537 101, 101, 101, 102, 102, 104, 104, 104, 105, 105, 00538 106, 106, 106, 107, 107, 107, 108, 108, 108, 109, 00539 00540 109, 109, 110, 110, 110, 111, 111, 111, 112, 112, 00541 112, 97, 97, 97, 97, 97, 97, 97, 97, 97, 00542 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 00543 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 00544 97, 97, 97, 97, 97, 97, 97, 97, 97 00545 } ; 00546 00547 /* Table of booleans, true if rule could match eol. */ 00548 static yyconst flex_int32_t yy_rule_can_match_eol[23] = 00549 { 0, 00550 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 00551 0, 0, 0, }; 00552 00553 /* The intent behind this definition is that it'll catch 00554 * any uses of REJECT which flex missed. 00555 */ 00556 #define REJECT reject_used_but_not_detected 00557 #define yymore() yymore_used_but_not_detected 00558 #define YY_MORE_ADJ 0 00559 #define YY_RESTORE_YY_MORE_OFFSET 00560 #line 1 "_jsgf_scanner.l" 00561 /* -*- mode: text -*- */ 00562 /* ==================================================================== 00563 * Copyright (c) 2007 Carnegie Mellon University. All rights 00564 * reserved. 00565 * 00566 * Redistribution and use in source and binary forms, with or without 00567 * modification, are permitted provided that the following conditions 00568 * are met: 00569 * 00570 * 1. Redistributions of source code must retain the above copyright 00571 * notice, this list of conditions and the following disclaimer. 00572 * 00573 * 2. Redistributions in binary form must reproduce the above copyright 00574 * notice, this list of conditions and the following disclaimer in 00575 * the documentation and/or other materials provided with the 00576 * distribution. 00577 * 00578 * This work was supported in part by funding from the Defense Advanced 00579 * Research Projects Agency and the National Science Foundation of the 00580 * United States of America, and the CMU Sphinx Speech Consortium. 00581 * 00582 * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 00583 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00584 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00585 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY 00586 * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00587 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00588 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00589 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00590 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00591 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00592 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00593 * 00594 * ==================================================================== 00595 * 00596 */ 00597 /* YOU MUST USE FLEX 2.5.33 OR NEWER TO PROCESS THIS FILE!!! */ 00598 #line 39 "_jsgf_scanner.l" 00599 00600 #include "jsgf_internal.h" 00601 #include "jsgf_parser.h" 00602 00603 00604 00605 00606 #line 607 "jsgf_scanner.c" 00607 00608 #define INITIAL 0 00609 #define COMMENT 1 00610 #define DECL 2 00611 #define DECLCOMMENT 3 00612 00613 #ifndef YY_NO_UNISTD_H 00614 /* Special case for "unistd.h", since it is non-ANSI. We include it way 00615 * down here because we want the user's section 1 to have been scanned first. 00616 * The user has a chance to override it with an option. 00617 */ 00618 #include <unistd.h> 00619 #endif 00620 00621 #ifndef YY_EXTRA_TYPE 00622 #define YY_EXTRA_TYPE void * 00623 #endif 00624 00625 /* Holds the entire state of the reentrant scanner. */ 00626 struct yyguts_t 00627 { 00628 00629 /* User-defined. Not touched by flex. */ 00630 YY_EXTRA_TYPE yyextra_r; 00631 00632 /* The rest are the same as the globals declared in the non-reentrant scanner. */ 00633 FILE *yyin_r, *yyout_r; 00634 size_t yy_buffer_stack_top; 00635 size_t yy_buffer_stack_max; 00636 YY_BUFFER_STATE * yy_buffer_stack; 00637 char yy_hold_char; 00638 int yy_n_chars; 00639 int yyleng_r; 00640 char *yy_c_buf_p; 00641 int yy_init; 00642 int yy_start; 00643 int yy_did_buffer_switch_on_eof; 00644 int yy_start_stack_ptr; 00645 int yy_start_stack_depth; 00646 int *yy_start_stack; 00647 yy_state_type yy_last_accepting_state; 00648 char* yy_last_accepting_cpos; 00649 00650 int yylineno_r; 00651 int yy_flex_debug_r; 00652 00653 char *yytext_r; 00654 int yy_more_flag; 00655 int yy_more_len; 00656 00657 YYSTYPE * yylval_r; 00658 00659 }; /* end struct yyguts_t */ 00660 00661 static int yy_init_globals (yyscan_t yyscanner ); 00662 00663 /* This must go here because YYSTYPE and YYLTYPE are included 00664 * from bison output in section 1.*/ 00665 # define yylval yyg->yylval_r 00666 00667 int yylex_init (yyscan_t* scanner); 00668 00669 int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); 00670 00671 /* Accessor methods to globals. 00672 These are made visible to non-reentrant scanners for convenience. */ 00673 00674 int yylex_destroy (yyscan_t yyscanner ); 00675 00676 int yyget_debug (yyscan_t yyscanner ); 00677 00678 void yyset_debug (int debug_flag ,yyscan_t yyscanner ); 00679 00680 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); 00681 00682 void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); 00683 00684 FILE *yyget_in (yyscan_t yyscanner ); 00685 00686 void yyset_in (FILE * in_str ,yyscan_t yyscanner ); 00687 00688 FILE *yyget_out (yyscan_t yyscanner ); 00689 00690 void yyset_out (FILE * out_str ,yyscan_t yyscanner ); 00691 00692 int yyget_leng (yyscan_t yyscanner ); 00693 00694 char *yyget_text (yyscan_t yyscanner ); 00695 00696 int yyget_lineno (yyscan_t yyscanner ); 00697 00698 void yyset_lineno (int line_number ,yyscan_t yyscanner ); 00699 00700 YYSTYPE * yyget_lval (yyscan_t yyscanner ); 00701 00702 void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); 00703 00704 /* Macros after this point can all be overridden by user definitions in 00705 * section 1. 00706 */ 00707 00708 #ifndef YY_SKIP_YYWRAP 00709 #ifdef __cplusplus 00710 extern "C" int yywrap (yyscan_t yyscanner ); 00711 #else 00712 extern int yywrap (yyscan_t yyscanner ); 00713 #endif 00714 #endif 00715 00716 static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); 00717 00718 #ifndef yytext_ptr 00719 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); 00720 #endif 00721 00722 #ifdef YY_NEED_STRLEN 00723 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); 00724 #endif 00725 00726 #ifndef YY_NO_INPUT 00727 00728 #ifdef __cplusplus 00729 static int yyinput (yyscan_t yyscanner ); 00730 #else 00731 static int input (yyscan_t yyscanner ); 00732 #endif 00733 00734 #endif 00735 00736 /* Amount of stuff to slurp up with each read. */ 00737 #ifndef YY_READ_BUF_SIZE 00738 #define YY_READ_BUF_SIZE 8192 00739 #endif 00740 00741 /* Copy whatever the last rule matched to the standard output. */ 00742 #ifndef ECHO 00743 /* This used to be an fputs(), but since the string might contain NUL's, 00744 * we now use fwrite(). 00745 */ 00746 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) 00747 #endif 00748 00749 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 00750 * is returned in "result". 00751 */ 00752 #ifndef YY_INPUT 00753 #define YY_INPUT(buf,result,max_size) \ 00754 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 00755 { \ 00756 int c = '*'; \ 00757 unsigned n; \ 00758 for ( n = 0; n < max_size && \ 00759 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 00760 buf[n] = (char) c; \ 00761 if ( c == '\n' ) \ 00762 buf[n++] = (char) c; \ 00763 if ( c == EOF && ferror( yyin ) ) \ 00764 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00765 result = n; \ 00766 } \ 00767 else \ 00768 { \ 00769 errno=0; \ 00770 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ 00771 { \ 00772 if( errno != EINTR) \ 00773 { \ 00774 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 00775 break; \ 00776 } \ 00777 errno=0; \ 00778 clearerr(yyin); \ 00779 } \ 00780 }\ 00781 \ 00782 00783 #endif 00784 00785 /* No semi-colon after return; correct usage is to write "yyterminate();" - 00786 * we don't want an extra ';' after the "return" because that will cause 00787 * some compilers to complain about unreachable statements. 00788 */ 00789 #ifndef yyterminate 00790 #define yyterminate() return YY_NULL 00791 #endif 00792 00793 /* Number of entries by which start-condition stack grows. */ 00794 #ifndef YY_START_STACK_INCR 00795 #define YY_START_STACK_INCR 25 00796 #endif 00797 00798 /* Report a fatal error. */ 00799 #ifndef YY_FATAL_ERROR 00800 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) 00801 #endif 00802 00803 /* end tables serialization structures and prototypes */ 00804 00805 /* Default declaration of generated scanner - a define so the user can 00806 * easily add parameters. 00807 */ 00808 #ifndef YY_DECL 00809 #define YY_DECL_IS_OURS 1 00810 00811 extern int yylex \ 00812 (YYSTYPE * yylval_param ,yyscan_t yyscanner); 00813 00814 #define YY_DECL int yylex \ 00815 (YYSTYPE * yylval_param , yyscan_t yyscanner) 00816 #endif /* !YY_DECL */ 00817 00818 /* Code executed at the beginning of each rule, after yytext and yyleng 00819 * have been set up. 00820 */ 00821 #ifndef YY_USER_ACTION 00822 #define YY_USER_ACTION 00823 #endif 00824 00825 /* Code executed at the end of each rule. */ 00826 #ifndef YY_BREAK 00827 #define YY_BREAK break; 00828 #endif 00829 00830 #define YY_RULE_SETUP \ 00831 YY_USER_ACTION 00832 00835 YY_DECL 00836 { 00837 register yy_state_type yy_current_state; 00838 register char *yy_cp, *yy_bp; 00839 register int yy_act; 00840 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 00841 00842 #line 59 "_jsgf_scanner.l" 00843 00844 00845 #line 846 "jsgf_scanner.c" 00846 00847 yylval = yylval_param; 00848 00849 if ( !yyg->yy_init ) 00850 { 00851 yyg->yy_init = 1; 00852 00853 #ifdef YY_USER_INIT 00854 YY_USER_INIT; 00855 #endif 00856 00857 if ( ! yyg->yy_start ) 00858 yyg->yy_start = 1; /* first start state */ 00859 00860 if ( ! yyin ) 00861 yyin = stdin; 00862 00863 if ( ! yyout ) 00864 yyout = stdout; 00865 00866 if ( ! YY_CURRENT_BUFFER ) { 00867 yyensure_buffer_stack (yyscanner); 00868 YY_CURRENT_BUFFER_LVALUE = 00869 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); 00870 } 00871 00872 yy_load_buffer_state(yyscanner ); 00873 } 00874 00875 while ( 1 ) /* loops until end-of-file is reached */ 00876 { 00877 yy_cp = yyg->yy_c_buf_p; 00878 00879 /* Support of yytext. */ 00880 *yy_cp = yyg->yy_hold_char; 00881 00882 /* yy_bp points to the position in yy_ch_buf of the start of 00883 * the current run. 00884 */ 00885 yy_bp = yy_cp; 00886 00887 yy_current_state = yyg->yy_start; 00888 yy_match: 00889 do 00890 { 00891 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 00892 if ( yy_accept[yy_current_state] ) 00893 { 00894 yyg->yy_last_accepting_state = yy_current_state; 00895 yyg->yy_last_accepting_cpos = yy_cp; 00896 } 00897 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 00898 { 00899 yy_current_state = (int) yy_def[yy_current_state]; 00900 if ( yy_current_state >= 98 ) 00901 yy_c = yy_meta[(unsigned int) yy_c]; 00902 } 00903 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 00904 ++yy_cp; 00905 } 00906 while ( yy_base[yy_current_state] != 312 ); 00907 00908 yy_find_action: 00909 yy_act = yy_accept[yy_current_state]; 00910 if ( yy_act == 0 ) 00911 { /* have to back up */ 00912 yy_cp = yyg->yy_last_accepting_cpos; 00913 yy_current_state = yyg->yy_last_accepting_state; 00914 yy_act = yy_accept[yy_current_state]; 00915 } 00916 00917 YY_DO_BEFORE_ACTION; 00918 00919 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) 00920 { 00921 int yyl; 00922 for ( yyl = 0; yyl < yyleng; ++yyl ) 00923 if ( yytext[yyl] == '\n' ) 00924 00925 do{ yylineno++; 00926 yycolumn=0; 00927 }while(0) 00928 ; 00929 } 00930 00931 do_action: /* This label is used only to access EOF actions. */ 00932 00933 switch ( yy_act ) 00934 { /* beginning of action switch */ 00935 case 0: /* must back up */ 00936 /* undo the effects of YY_DO_BEFORE_ACTION */ 00937 *yy_cp = yyg->yy_hold_char; 00938 yy_cp = yyg->yy_last_accepting_cpos; 00939 yy_current_state = yyg->yy_last_accepting_state; 00940 goto yy_find_action; 00941 00942 case 1: 00943 /* rule 1 can match eol */ 00944 YY_RULE_SETUP 00945 #line 61 "_jsgf_scanner.l" 00946 ; /* ignore whitespace */ 00947 YY_BREAK 00948 case 2: 00949 /* rule 2 can match eol */ 00950 YY_RULE_SETUP 00951 #line 62 "_jsgf_scanner.l" 00952 ; /* single-line comments */ 00953 YY_BREAK 00954 case 3: 00955 YY_RULE_SETUP 00956 #line 63 "_jsgf_scanner.l" 00957 { BEGIN(COMMENT); } /* C-style comments */ 00958 YY_BREAK 00959 case 4: 00960 YY_RULE_SETUP 00961 #line 64 "_jsgf_scanner.l" 00962 { BEGIN(INITIAL); } 00963 YY_BREAK 00964 case 5: 00965 YY_RULE_SETUP 00966 #line 65 "_jsgf_scanner.l" 00967 ; /* Ignore stuff in comment mode */ 00968 YY_BREAK 00969 case 6: 00970 /* rule 6 can match eol */ 00971 YY_RULE_SETUP 00972 #line 67 "_jsgf_scanner.l" 00973 ; /* single-line comments inside decl */ 00974 YY_BREAK 00975 case 7: 00976 YY_RULE_SETUP 00977 #line 68 "_jsgf_scanner.l" 00978 { BEGIN(DECLCOMMENT); } /* C-style comments inside decl */ 00979 YY_BREAK 00980 case 8: 00981 YY_RULE_SETUP 00982 #line 69 "_jsgf_scanner.l" 00983 { BEGIN(DECL); } 00984 YY_BREAK 00985 case 9: 00986 YY_RULE_SETUP 00987 #line 70 "_jsgf_scanner.l" 00988 ; /* Ignore stuff in comment mode */ 00989 YY_BREAK 00990 case 10: 00991 YY_RULE_SETUP 00992 #line 72 "_jsgf_scanner.l" 00993 {BEGIN(DECL); return HEADER;} 00994 YY_BREAK 00995 case 11: 00996 YY_RULE_SETUP 00997 #line 73 "_jsgf_scanner.l" 00998 {BEGIN(DECL); return GRAMMAR;} 00999 YY_BREAK 01000 case 12: 01001 YY_RULE_SETUP 01002 #line 74 "_jsgf_scanner.l" 01003 {BEGIN(DECL); return IMPORT;} 01004 YY_BREAK 01005 case 13: 01006 YY_RULE_SETUP 01007 #line 75 "_jsgf_scanner.l" 01008 {BEGIN(DECL); return PUBLIC;} 01009 YY_BREAK 01010 case 14: 01011 /* rule 14 can match eol */ 01012 YY_RULE_SETUP 01013 #line 77 "_jsgf_scanner.l" 01014 { BEGIN(DECL); yylval->name = strdup(yytext); return RULENAME; } 01015 YY_BREAK 01016 case 15: 01017 /* rule 15 can match eol */ 01018 YY_RULE_SETUP 01019 #line 78 "_jsgf_scanner.l" 01020 { yylval->name = strdup(yytext); return RULENAME; } 01021 YY_BREAK 01022 case 16: 01023 /* rule 16 can match eol */ 01024 YY_RULE_SETUP 01025 #line 80 "_jsgf_scanner.l" 01026 { yylval->name = strdup(yytext); return TAG; } 01027 YY_BREAK 01028 case 17: 01029 YY_RULE_SETUP 01030 #line 81 "_jsgf_scanner.l" 01031 { yylval->name = strdup(yytext); return TOKEN; } 01032 YY_BREAK 01033 case 18: 01034 YY_RULE_SETUP 01035 #line 82 "_jsgf_scanner.l" 01036 { BEGIN(INITIAL); return yytext[0]; } 01037 YY_BREAK 01038 case 19: 01039 /* rule 19 can match eol */ 01040 YY_RULE_SETUP 01041 #line 83 "_jsgf_scanner.l" 01042 { yylval->name = strdup(yytext); return TOKEN; } 01043 YY_BREAK 01044 case 20: 01045 YY_RULE_SETUP 01046 #line 84 "_jsgf_scanner.l" 01047 { yylval->weight = atof_c(yytext+1); return WEIGHT; } 01048 YY_BREAK 01049 case 21: 01050 YY_RULE_SETUP 01051 #line 85 "_jsgf_scanner.l" 01052 return yytext[0]; /* Single-character tokens */ 01053 YY_BREAK 01054 case 22: 01055 YY_RULE_SETUP 01056 #line 87 "_jsgf_scanner.l" 01057 ECHO; 01058 YY_BREAK 01059 #line 1060 "jsgf_scanner.c" 01060 case YY_STATE_EOF(INITIAL): 01061 case YY_STATE_EOF(COMMENT): 01062 case YY_STATE_EOF(DECL): 01063 case YY_STATE_EOF(DECLCOMMENT): 01064 yyterminate(); 01065 01066 case YY_END_OF_BUFFER: 01067 { 01068 /* Amount of text matched not including the EOB char. */ 01069 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; 01070 01071 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 01072 *yy_cp = yyg->yy_hold_char; 01073 YY_RESTORE_YY_MORE_OFFSET 01074 01075 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) 01076 { 01077 /* We're scanning a new file or input source. It's 01078 * possible that this happened because the user 01079 * just pointed yyin at a new source and called 01080 * yylex(). If so, then we have to assure 01081 * consistency between YY_CURRENT_BUFFER and our 01082 * globals. Here is the right place to do so, because 01083 * this is the first action (other than possibly a 01084 * back-up) that will match for the new input source. 01085 */ 01086 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01087 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; 01088 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; 01089 } 01090 01091 /* Note that here we test for yy_c_buf_p "<=" to the position 01092 * of the first EOB in the buffer, since yy_c_buf_p will 01093 * already have been incremented past the NUL character 01094 * (since all states make transitions on EOB to the 01095 * end-of-buffer state). Contrast this with the test 01096 * in input(). 01097 */ 01098 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) 01099 { /* This was really a NUL. */ 01100 yy_state_type yy_next_state; 01101 01102 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; 01103 01104 yy_current_state = yy_get_previous_state( yyscanner ); 01105 01106 /* Okay, we're now positioned to make the NUL 01107 * transition. We couldn't have 01108 * yy_get_previous_state() go ahead and do it 01109 * for us because it doesn't know how to deal 01110 * with the possibility of jamming (and we don't 01111 * want to build jamming into it because then it 01112 * will run more slowly). 01113 */ 01114 01115 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); 01116 01117 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; 01118 01119 if ( yy_next_state ) 01120 { 01121 /* Consume the NUL. */ 01122 yy_cp = ++yyg->yy_c_buf_p; 01123 yy_current_state = yy_next_state; 01124 goto yy_match; 01125 } 01126 01127 else 01128 { 01129 yy_cp = yyg->yy_c_buf_p; 01130 goto yy_find_action; 01131 } 01132 } 01133 01134 else switch ( yy_get_next_buffer( yyscanner ) ) 01135 { 01136 case EOB_ACT_END_OF_FILE: 01137 { 01138 yyg->yy_did_buffer_switch_on_eof = 0; 01139 01140 if ( yywrap(yyscanner ) ) 01141 { 01142 /* Note: because we've taken care in 01143 * yy_get_next_buffer() to have set up 01144 * yytext, we can now set up 01145 * yy_c_buf_p so that if some total 01146 * hoser (like flex itself) wants to 01147 * call the scanner after we return the 01148 * YY_NULL, it'll still work - another 01149 * YY_NULL will get returned. 01150 */ 01151 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; 01152 01153 yy_act = YY_STATE_EOF(YY_START); 01154 goto do_action; 01155 } 01156 01157 else 01158 { 01159 if ( ! yyg->yy_did_buffer_switch_on_eof ) 01160 YY_NEW_FILE; 01161 } 01162 break; 01163 } 01164 01165 case EOB_ACT_CONTINUE_SCAN: 01166 yyg->yy_c_buf_p = 01167 yyg->yytext_ptr + yy_amount_of_matched_text; 01168 01169 yy_current_state = yy_get_previous_state( yyscanner ); 01170 01171 yy_cp = yyg->yy_c_buf_p; 01172 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; 01173 goto yy_match; 01174 01175 case EOB_ACT_LAST_MATCH: 01176 yyg->yy_c_buf_p = 01177 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; 01178 01179 yy_current_state = yy_get_previous_state( yyscanner ); 01180 01181 yy_cp = yyg->yy_c_buf_p; 01182 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; 01183 goto yy_find_action; 01184 } 01185 break; 01186 } 01187 01188 default: 01189 YY_FATAL_ERROR( 01190 "fatal flex scanner internal error--no action found" ); 01191 } /* end of action switch */ 01192 } /* end of scanning one token */ 01193 } /* end of yylex */ 01194 01195 /* yy_get_next_buffer - try to read in a new buffer 01196 * 01197 * Returns a code representing an action: 01198 * EOB_ACT_LAST_MATCH - 01199 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 01200 * EOB_ACT_END_OF_FILE - end of file 01201 */ 01202 static int yy_get_next_buffer (yyscan_t yyscanner) 01203 { 01204 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01205 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; 01206 register char *source = yyg->yytext_ptr; 01207 register int number_to_move, i; 01208 int ret_val; 01209 01210 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) 01211 YY_FATAL_ERROR( 01212 "fatal flex scanner internal error--end of buffer missed" ); 01213 01214 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) 01215 { /* Don't try to fill the buffer, so this is an EOF. */ 01216 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) 01217 { 01218 /* We matched a single character, the EOB, so 01219 * treat this as a final EOF. 01220 */ 01221 return EOB_ACT_END_OF_FILE; 01222 } 01223 01224 else 01225 { 01226 /* We matched some text prior to the EOB, first 01227 * process it. 01228 */ 01229 return EOB_ACT_LAST_MATCH; 01230 } 01231 } 01232 01233 /* Try to read more data. */ 01234 01235 /* First move last chars to start of buffer. */ 01236 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; 01237 01238 for ( i = 0; i < number_to_move; ++i ) 01239 *(dest++) = *(source++); 01240 01241 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 01242 /* don't do the read, it's not guaranteed to return an EOF, 01243 * just force an EOF 01244 */ 01245 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; 01246 01247 else 01248 { 01249 int num_to_read = 01250 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 01251 01252 while ( num_to_read <= 0 ) 01253 { /* Not enough room in the buffer - grow it. */ 01254 01255 /* just a shorter name for the current buffer */ 01256 YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 01257 01258 int yy_c_buf_p_offset = 01259 (int) (yyg->yy_c_buf_p - b->yy_ch_buf); 01260 01261 if ( b->yy_is_our_buffer ) 01262 { 01263 int new_size = b->yy_buf_size * 2; 01264 01265 if ( new_size <= 0 ) 01266 b->yy_buf_size += b->yy_buf_size / 8; 01267 else 01268 b->yy_buf_size *= 2; 01269 01270 b->yy_ch_buf = (char *) 01271 /* Include room in for 2 EOB chars. */ 01272 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); 01273 } 01274 else 01275 /* Can't grow it, we don't own it. */ 01276 b->yy_ch_buf = 0; 01277 01278 if ( ! b->yy_ch_buf ) 01279 YY_FATAL_ERROR( 01280 "fatal error - scanner input buffer overflow" ); 01281 01282 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 01283 01284 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - 01285 number_to_move - 1; 01286 01287 } 01288 01289 if ( num_to_read > YY_READ_BUF_SIZE ) 01290 num_to_read = YY_READ_BUF_SIZE; 01291 01292 /* Read in more data. */ 01293 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 01294 yyg->yy_n_chars, (size_t) num_to_read ); 01295 01296 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 01297 } 01298 01299 if ( yyg->yy_n_chars == 0 ) 01300 { 01301 if ( number_to_move == YY_MORE_ADJ ) 01302 { 01303 ret_val = EOB_ACT_END_OF_FILE; 01304 yyrestart(yyin ,yyscanner); 01305 } 01306 01307 else 01308 { 01309 ret_val = EOB_ACT_LAST_MATCH; 01310 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = 01311 YY_BUFFER_EOF_PENDING; 01312 } 01313 } 01314 01315 else 01316 ret_val = EOB_ACT_CONTINUE_SCAN; 01317 01318 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { 01319 /* Extend the array by 50%, plus the number we really need. */ 01320 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); 01321 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); 01322 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 01323 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); 01324 } 01325 01326 yyg->yy_n_chars += number_to_move; 01327 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; 01328 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 01329 01330 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; 01331 01332 return ret_val; 01333 } 01334 01335 /* yy_get_previous_state - get the state just before the EOB char was reached */ 01336 01337 static yy_state_type yy_get_previous_state (yyscan_t yyscanner) 01338 { 01339 register yy_state_type yy_current_state; 01340 register char *yy_cp; 01341 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01342 01343 yy_current_state = yyg->yy_start; 01344 01345 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) 01346 { 01347 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 01348 if ( yy_accept[yy_current_state] ) 01349 { 01350 yyg->yy_last_accepting_state = yy_current_state; 01351 yyg->yy_last_accepting_cpos = yy_cp; 01352 } 01353 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01354 { 01355 yy_current_state = (int) yy_def[yy_current_state]; 01356 if ( yy_current_state >= 98 ) 01357 yy_c = yy_meta[(unsigned int) yy_c]; 01358 } 01359 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01360 } 01361 01362 return yy_current_state; 01363 } 01364 01365 /* yy_try_NUL_trans - try to make a transition on the NUL character 01366 * 01367 * synopsis 01368 * next_state = yy_try_NUL_trans( current_state ); 01369 */ 01370 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) 01371 { 01372 register int yy_is_jam; 01373 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ 01374 register char *yy_cp = yyg->yy_c_buf_p; 01375 01376 register YY_CHAR yy_c = 1; 01377 if ( yy_accept[yy_current_state] ) 01378 { 01379 yyg->yy_last_accepting_state = yy_current_state; 01380 yyg->yy_last_accepting_cpos = yy_cp; 01381 } 01382 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 01383 { 01384 yy_current_state = (int) yy_def[yy_current_state]; 01385 if ( yy_current_state >= 98 ) 01386 yy_c = yy_meta[(unsigned int) yy_c]; 01387 } 01388 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 01389 yy_is_jam = (yy_current_state == 97); 01390 01391 return yy_is_jam ? 0 : yy_current_state; 01392 } 01393 01394 static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) 01395 { 01396 register char *yy_cp; 01397 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01398 01399 yy_cp = yyg->yy_c_buf_p; 01400 01401 /* undo effects of setting up yytext */ 01402 *yy_cp = yyg->yy_hold_char; 01403 01404 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 01405 { /* need to shift things up to make room */ 01406 /* +2 for EOB chars. */ 01407 register int number_to_move = yyg->yy_n_chars + 2; 01408 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ 01409 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; 01410 register char *source = 01411 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; 01412 01413 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) 01414 *--dest = *--source; 01415 01416 yy_cp += (int) (dest - source); 01417 yy_bp += (int) (dest - source); 01418 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = 01419 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; 01420 01421 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) 01422 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 01423 } 01424 01425 *--yy_cp = (char) c; 01426 01427 if ( c == '\n' ){ 01428 --yylineno; 01429 } 01430 01431 yyg->yytext_ptr = yy_bp; 01432 yyg->yy_hold_char = *yy_cp; 01433 yyg->yy_c_buf_p = yy_cp; 01434 } 01435 01436 #ifndef YY_NO_INPUT 01437 #ifdef __cplusplus 01438 static int yyinput (yyscan_t yyscanner) 01439 #else 01440 static int input (yyscan_t yyscanner) 01441 #endif 01442 01443 { 01444 int c; 01445 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01446 01447 *yyg->yy_c_buf_p = yyg->yy_hold_char; 01448 01449 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 01450 { 01451 /* yy_c_buf_p now points to the character we want to return. 01452 * If this occurs *before* the EOB characters, then it's a 01453 * valid NUL; if not, then we've hit the end of the buffer. 01454 */ 01455 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) 01456 /* This was really a NUL. */ 01457 *yyg->yy_c_buf_p = '\0'; 01458 01459 else 01460 { /* need more input */ 01461 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; 01462 ++yyg->yy_c_buf_p; 01463 01464 switch ( yy_get_next_buffer( yyscanner ) ) 01465 { 01466 case EOB_ACT_LAST_MATCH: 01467 /* This happens because yy_g_n_b() 01468 * sees that we've accumulated a 01469 * token and flags that we need to 01470 * try matching the token before 01471 * proceeding. But for input(), 01472 * there's no matching to consider. 01473 * So convert the EOB_ACT_LAST_MATCH 01474 * to EOB_ACT_END_OF_FILE. 01475 */ 01476 01477 /* Reset buffer status. */ 01478 yyrestart(yyin ,yyscanner); 01479 01480 /*FALLTHROUGH*/ 01481 01482 case EOB_ACT_END_OF_FILE: 01483 { 01484 if ( yywrap(yyscanner ) ) 01485 return EOF; 01486 01487 if ( ! yyg->yy_did_buffer_switch_on_eof ) 01488 YY_NEW_FILE; 01489 #ifdef __cplusplus 01490 return yyinput(yyscanner); 01491 #else 01492 return input(yyscanner); 01493 #endif 01494 } 01495 01496 case EOB_ACT_CONTINUE_SCAN: 01497 yyg->yy_c_buf_p = yyg->yytext_ptr + offset; 01498 break; 01499 } 01500 } 01501 } 01502 01503 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ 01504 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ 01505 yyg->yy_hold_char = *++yyg->yy_c_buf_p; 01506 01507 if ( c == '\n' ) 01508 01509 do{ yylineno++; 01510 yycolumn=0; 01511 }while(0) 01512 ; 01513 01514 return c; 01515 } 01516 #endif /* ifndef YY_NO_INPUT */ 01517 01523 void yyrestart (FILE * input_file , yyscan_t yyscanner) 01524 { 01525 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01526 01527 if ( ! YY_CURRENT_BUFFER ){ 01528 yyensure_buffer_stack (yyscanner); 01529 YY_CURRENT_BUFFER_LVALUE = 01530 yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); 01531 } 01532 01533 yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); 01534 yy_load_buffer_state(yyscanner ); 01535 } 01536 01541 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) 01542 { 01543 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01544 01545 /* TODO. We should be able to replace this entire function body 01546 * with 01547 * yypop_buffer_state(); 01548 * yypush_buffer_state(new_buffer); 01549 */ 01550 yyensure_buffer_stack (yyscanner); 01551 if ( YY_CURRENT_BUFFER == new_buffer ) 01552 return; 01553 01554 if ( YY_CURRENT_BUFFER ) 01555 { 01556 /* Flush out information for old buffer. */ 01557 *yyg->yy_c_buf_p = yyg->yy_hold_char; 01558 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; 01559 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 01560 } 01561 01562 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01563 yy_load_buffer_state(yyscanner ); 01564 01565 /* We don't actually know whether we did this switch during 01566 * EOF (yywrap()) processing, but the only time this flag 01567 * is looked at is after yywrap() is called, so it's safe 01568 * to go ahead and always set it. 01569 */ 01570 yyg->yy_did_buffer_switch_on_eof = 1; 01571 } 01572 01573 static void yy_load_buffer_state (yyscan_t yyscanner) 01574 { 01575 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01576 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; 01577 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; 01578 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; 01579 yyg->yy_hold_char = *yyg->yy_c_buf_p; 01580 } 01581 01588 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) 01589 { 01590 YY_BUFFER_STATE b; 01591 01592 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); 01593 if ( ! b ) 01594 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 01595 01596 b->yy_buf_size = size; 01597 01598 /* yy_ch_buf has to be 2 characters longer than the size given because 01599 * we need to put in 2 end-of-buffer characters. 01600 */ 01601 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner ); 01602 if ( ! b->yy_ch_buf ) 01603 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 01604 01605 b->yy_is_our_buffer = 1; 01606 01607 yy_init_buffer(b,file ,yyscanner); 01608 01609 return b; 01610 } 01611 01616 void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) 01617 { 01618 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01619 01620 if ( ! b ) 01621 return; 01622 01623 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ 01624 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; 01625 01626 if ( b->yy_is_our_buffer ) 01627 yyfree((void *) b->yy_ch_buf ,yyscanner ); 01628 01629 yyfree((void *) b ,yyscanner ); 01630 } 01631 01632 #ifndef __cplusplus 01633 extern int isatty (int ); 01634 #endif /* __cplusplus */ 01635 01636 /* Initializes or reinitializes a buffer. 01637 * This function is sometimes called more than once on the same buffer, 01638 * such as during a yyrestart() or at EOF. 01639 */ 01640 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) 01641 01642 { 01643 int oerrno = errno; 01644 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01645 01646 yy_flush_buffer(b ,yyscanner); 01647 01648 b->yy_input_file = file; 01649 b->yy_fill_buffer = 1; 01650 01651 /* If b is the current buffer, then yy_init_buffer was _probably_ 01652 * called from yyrestart() or through yy_get_next_buffer. 01653 * In that case, we don't want to reset the lineno or column. 01654 */ 01655 if (b != YY_CURRENT_BUFFER){ 01656 b->yy_bs_lineno = 1; 01657 b->yy_bs_column = 0; 01658 } 01659 01660 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 01661 01662 errno = oerrno; 01663 } 01664 01669 void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) 01670 { 01671 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01672 if ( ! b ) 01673 return; 01674 01675 b->yy_n_chars = 0; 01676 01677 /* We always need two end-of-buffer characters. The first causes 01678 * a transition to the end-of-buffer state. The second causes 01679 * a jam in that state. 01680 */ 01681 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 01682 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 01683 01684 b->yy_buf_pos = &b->yy_ch_buf[0]; 01685 01686 b->yy_at_bol = 1; 01687 b->yy_buffer_status = YY_BUFFER_NEW; 01688 01689 if ( b == YY_CURRENT_BUFFER ) 01690 yy_load_buffer_state(yyscanner ); 01691 } 01692 01699 void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) 01700 { 01701 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01702 if (new_buffer == NULL) 01703 return; 01704 01705 yyensure_buffer_stack(yyscanner); 01706 01707 /* This block is copied from yy_switch_to_buffer. */ 01708 if ( YY_CURRENT_BUFFER ) 01709 { 01710 /* Flush out information for old buffer. */ 01711 *yyg->yy_c_buf_p = yyg->yy_hold_char; 01712 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; 01713 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; 01714 } 01715 01716 /* Only push if top exists. Otherwise, replace top. */ 01717 if (YY_CURRENT_BUFFER) 01718 yyg->yy_buffer_stack_top++; 01719 YY_CURRENT_BUFFER_LVALUE = new_buffer; 01720 01721 /* copied from yy_switch_to_buffer. */ 01722 yy_load_buffer_state(yyscanner ); 01723 yyg->yy_did_buffer_switch_on_eof = 1; 01724 } 01725 01730 void yypop_buffer_state (yyscan_t yyscanner) 01731 { 01732 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01733 if (!YY_CURRENT_BUFFER) 01734 return; 01735 01736 yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); 01737 YY_CURRENT_BUFFER_LVALUE = NULL; 01738 if (yyg->yy_buffer_stack_top > 0) 01739 --yyg->yy_buffer_stack_top; 01740 01741 if (YY_CURRENT_BUFFER) { 01742 yy_load_buffer_state(yyscanner ); 01743 yyg->yy_did_buffer_switch_on_eof = 1; 01744 } 01745 } 01746 01747 /* Allocates the stack if it does not exist. 01748 * Guarantees space for at least one push. 01749 */ 01750 static void yyensure_buffer_stack (yyscan_t yyscanner) 01751 { 01752 int num_to_alloc; 01753 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01754 01755 if (!yyg->yy_buffer_stack) { 01756 01757 /* First allocation is just for 2 elements, since we don't know if this 01758 * scanner will even need a stack. We use 2 instead of 1 to avoid an 01759 * immediate realloc on the next call. 01760 */ 01761 num_to_alloc = 1; 01762 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc 01763 (num_to_alloc * sizeof(struct yy_buffer_state*) 01764 , yyscanner); 01765 if ( ! yyg->yy_buffer_stack ) 01766 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 01767 01768 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 01769 01770 yyg->yy_buffer_stack_max = num_to_alloc; 01771 yyg->yy_buffer_stack_top = 0; 01772 return; 01773 } 01774 01775 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ 01776 01777 /* Increase the buffer to prepare for a possible push. */ 01778 int grow_size = 8 /* arbitrary grow size */; 01779 01780 num_to_alloc = yyg->yy_buffer_stack_max + grow_size; 01781 yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc 01782 (yyg->yy_buffer_stack, 01783 num_to_alloc * sizeof(struct yy_buffer_state*) 01784 , yyscanner); 01785 if ( ! yyg->yy_buffer_stack ) 01786 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); 01787 01788 /* zero only the new slots.*/ 01789 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); 01790 yyg->yy_buffer_stack_max = num_to_alloc; 01791 } 01792 } 01793 01800 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) 01801 { 01802 YY_BUFFER_STATE b; 01803 01804 if ( size < 2 || 01805 base[size-2] != YY_END_OF_BUFFER_CHAR || 01806 base[size-1] != YY_END_OF_BUFFER_CHAR ) 01807 /* They forgot to leave room for the EOB's. */ 01808 return 0; 01809 01810 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); 01811 if ( ! b ) 01812 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 01813 01814 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 01815 b->yy_buf_pos = b->yy_ch_buf = base; 01816 b->yy_is_our_buffer = 0; 01817 b->yy_input_file = 0; 01818 b->yy_n_chars = b->yy_buf_size; 01819 b->yy_is_interactive = 0; 01820 b->yy_at_bol = 1; 01821 b->yy_fill_buffer = 0; 01822 b->yy_buffer_status = YY_BUFFER_NEW; 01823 01824 yy_switch_to_buffer(b ,yyscanner ); 01825 01826 return b; 01827 } 01828 01837 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) 01838 { 01839 01840 return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); 01841 } 01842 01850 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) 01851 { 01852 YY_BUFFER_STATE b; 01853 char *buf; 01854 yy_size_t n; 01855 int i; 01856 01857 /* Get memory for full buffer, including space for trailing EOB's. */ 01858 n = _yybytes_len + 2; 01859 buf = (char *) yyalloc(n ,yyscanner ); 01860 if ( ! buf ) 01861 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 01862 01863 for ( i = 0; i < _yybytes_len; ++i ) 01864 buf[i] = yybytes[i]; 01865 01866 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; 01867 01868 b = yy_scan_buffer(buf,n ,yyscanner); 01869 if ( ! b ) 01870 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 01871 01872 /* It's okay to grow etc. this buffer, and we should throw it 01873 * away when we're done. 01874 */ 01875 b->yy_is_our_buffer = 1; 01876 01877 return b; 01878 } 01879 01880 #ifndef YY_EXIT_FAILURE 01881 #define YY_EXIT_FAILURE 2 01882 #endif 01883 01884 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) 01885 { 01886 (void) fprintf( stderr, "%s\n", msg ); 01887 exit( YY_EXIT_FAILURE ); 01888 } 01889 01890 /* Redefine yyless() so it works in section 3 code. */ 01891 01892 #undef yyless 01893 #define yyless(n) \ 01894 do \ 01895 { \ 01896 /* Undo effects of setting up yytext. */ \ 01897 int yyless_macro_arg = (n); \ 01898 YY_LESS_LINENO(yyless_macro_arg);\ 01899 yytext[yyleng] = yyg->yy_hold_char; \ 01900 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ 01901 yyg->yy_hold_char = *yyg->yy_c_buf_p; \ 01902 *yyg->yy_c_buf_p = '\0'; \ 01903 yyleng = yyless_macro_arg; \ 01904 } \ 01905 while ( 0 ) 01906 01907 /* Accessor methods (get/set functions) to struct members. */ 01908 01912 YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) 01913 { 01914 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01915 return yyextra; 01916 } 01917 01921 int yyget_lineno (yyscan_t yyscanner) 01922 { 01923 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01924 01925 if (! YY_CURRENT_BUFFER) 01926 return 0; 01927 01928 return yylineno; 01929 } 01930 01934 int yyget_column (yyscan_t yyscanner) 01935 { 01936 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01937 01938 if (! YY_CURRENT_BUFFER) 01939 return 0; 01940 01941 return yycolumn; 01942 } 01943 01947 FILE *yyget_in (yyscan_t yyscanner) 01948 { 01949 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01950 return yyin; 01951 } 01952 01956 FILE *yyget_out (yyscan_t yyscanner) 01957 { 01958 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01959 return yyout; 01960 } 01961 01965 int yyget_leng (yyscan_t yyscanner) 01966 { 01967 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01968 return yyleng; 01969 } 01970 01975 char *yyget_text (yyscan_t yyscanner) 01976 { 01977 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01978 return yytext; 01979 } 01980 01985 void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) 01986 { 01987 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01988 yyextra = user_defined ; 01989 } 01990 01995 void yyset_lineno (int line_number , yyscan_t yyscanner) 01996 { 01997 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 01998 01999 /* lineno is only valid if an input buffer exists. */ 02000 if (! YY_CURRENT_BUFFER ) 02001 yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); 02002 02003 yylineno = line_number; 02004 } 02005 02010 void yyset_column (int column_no , yyscan_t yyscanner) 02011 { 02012 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02013 02014 /* column is only valid if an input buffer exists. */ 02015 if (! YY_CURRENT_BUFFER ) 02016 yy_fatal_error( "yyset_column called with no buffer" , yyscanner); 02017 02018 yycolumn = column_no; 02019 } 02020 02027 void yyset_in (FILE * in_str , yyscan_t yyscanner) 02028 { 02029 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02030 yyin = in_str ; 02031 } 02032 02033 void yyset_out (FILE * out_str , yyscan_t yyscanner) 02034 { 02035 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02036 yyout = out_str ; 02037 } 02038 02039 int yyget_debug (yyscan_t yyscanner) 02040 { 02041 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02042 return yy_flex_debug; 02043 } 02044 02045 void yyset_debug (int bdebug , yyscan_t yyscanner) 02046 { 02047 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02048 yy_flex_debug = bdebug ; 02049 } 02050 02051 /* Accessor methods for yylval and yylloc */ 02052 02053 YYSTYPE * yyget_lval (yyscan_t yyscanner) 02054 { 02055 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02056 return yylval; 02057 } 02058 02059 void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) 02060 { 02061 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02062 yylval = yylval_param; 02063 } 02064 02065 /* User-visible API */ 02066 02067 /* yylex_init is special because it creates the scanner itself, so it is 02068 * the ONLY reentrant function that doesn't take the scanner as the last argument. 02069 * That's why we explicitly handle the declaration, instead of using our macros. 02070 */ 02071 02072 int yylex_init(yyscan_t* ptr_yy_globals) 02073 02074 { 02075 if (ptr_yy_globals == NULL){ 02076 errno = EINVAL; 02077 return 1; 02078 } 02079 02080 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); 02081 02082 if (*ptr_yy_globals == NULL){ 02083 errno = ENOMEM; 02084 return 1; 02085 } 02086 02087 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ 02088 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 02089 02090 return yy_init_globals ( *ptr_yy_globals ); 02091 } 02092 02093 /* yylex_init_extra has the same functionality as yylex_init, but follows the 02094 * convention of taking the scanner as the last argument. Note however, that 02095 * this is a *pointer* to a scanner, as it will be allocated by this call (and 02096 * is the reason, too, why this function also must handle its own declaration). 02097 * The user defined value in the first argument will be available to yyalloc in 02098 * the yyextra field. 02099 */ 02100 02101 int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) 02102 02103 { 02104 struct yyguts_t dummy_yyguts; 02105 02106 yyset_extra (yy_user_defined, &dummy_yyguts); 02107 02108 if (ptr_yy_globals == NULL){ 02109 errno = EINVAL; 02110 return 1; 02111 } 02112 02113 *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); 02114 02115 if (*ptr_yy_globals == NULL){ 02116 errno = ENOMEM; 02117 return 1; 02118 } 02119 02120 /* By setting to 0xAA, we expose bugs in 02121 yy_init_globals. Leave at 0x00 for releases. */ 02122 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); 02123 02124 yyset_extra (yy_user_defined, *ptr_yy_globals); 02125 02126 return yy_init_globals ( *ptr_yy_globals ); 02127 } 02128 02129 static int yy_init_globals (yyscan_t yyscanner) 02130 { 02131 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02132 /* Initialization is the same as for the non-reentrant scanner. 02133 * This function is called from yylex_destroy(), so don't allocate here. 02134 */ 02135 02136 yyg->yy_buffer_stack = 0; 02137 yyg->yy_buffer_stack_top = 0; 02138 yyg->yy_buffer_stack_max = 0; 02139 yyg->yy_c_buf_p = (char *) 0; 02140 yyg->yy_init = 0; 02141 yyg->yy_start = 0; 02142 02143 yyg->yy_start_stack_ptr = 0; 02144 yyg->yy_start_stack_depth = 0; 02145 yyg->yy_start_stack = NULL; 02146 02147 /* Defined in main.c */ 02148 #ifdef YY_STDINIT 02149 yyin = stdin; 02150 yyout = stdout; 02151 #else 02152 yyin = (FILE *) 0; 02153 yyout = (FILE *) 0; 02154 #endif 02155 02156 /* For future reference: Set errno on error, since we are called by 02157 * yylex_init() 02158 */ 02159 return 0; 02160 } 02161 02162 /* yylex_destroy is for both reentrant and non-reentrant scanners. */ 02163 int yylex_destroy (yyscan_t yyscanner) 02164 { 02165 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 02166 02167 /* Pop the buffer stack, destroying each element. */ 02168 while(YY_CURRENT_BUFFER){ 02169 yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); 02170 YY_CURRENT_BUFFER_LVALUE = NULL; 02171 yypop_buffer_state(yyscanner); 02172 } 02173 02174 /* Destroy the stack itself. */ 02175 yyfree(yyg->yy_buffer_stack ,yyscanner); 02176 yyg->yy_buffer_stack = NULL; 02177 02178 /* Destroy the start condition stack. */ 02179 yyfree(yyg->yy_start_stack ,yyscanner ); 02180 yyg->yy_start_stack = NULL; 02181 02182 /* Reset the globals. This is important in a non-reentrant scanner so the next time 02183 * yylex() is called, initialization will occur. */ 02184 yy_init_globals( yyscanner); 02185 02186 /* Destroy the main struct (reentrant only). */ 02187 yyfree ( yyscanner , yyscanner ); 02188 yyscanner = NULL; 02189 return 0; 02190 } 02191 02192 /* 02193 * Internal utility routines. 02194 */ 02195 02196 #ifndef yytext_ptr 02197 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) 02198 { 02199 register int i; 02200 for ( i = 0; i < n; ++i ) 02201 s1[i] = s2[i]; 02202 } 02203 #endif 02204 02205 #ifdef YY_NEED_STRLEN 02206 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) 02207 { 02208 register int n; 02209 for ( n = 0; s[n]; ++n ) 02210 ; 02211 02212 return n; 02213 } 02214 #endif 02215 02216 void *yyalloc (yy_size_t size , yyscan_t yyscanner) 02217 { 02218 return (void *) malloc( size ); 02219 } 02220 02221 void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) 02222 { 02223 /* The cast to (char *) in the following accommodates both 02224 * implementations that use char* generic pointers, and those 02225 * that use void* generic pointers. It works with the latter 02226 * because both ANSI C and C++ allow castless assignment from 02227 * any pointer type to void*, and deal with argument conversions 02228 * as though doing an assignment. 02229 */ 02230 return (void *) realloc( (char *) ptr, size ); 02231 } 02232 02233 void yyfree (void * ptr , yyscan_t yyscanner) 02234 { 02235 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ 02236 } 02237 02238 #define YYTABLES_NAME "yytables" 02239 02240 #line 87 "_jsgf_scanner.l" 02241 02242 02243