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

Generated on Fri Jan 14 2011 for SphinxBase by  doxygen 1.7.1