• Main Page
  • Related Pages
  • Data Structures
  • Files
  • File List
  • Globals

src/libsphinxbase/lm/jsgf_scanner.c

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

Generated on Mon Aug 29 2011 for SphinxBase by  doxygen 1.7.1