lex.yy.c

Go to the documentation of this file.
00001 
00002 #line 3 "lex.yy.c"
00003 
00004 #define  YY_INT_ALIGNED short int
00005 
00006 /* A lexical scanner generated by flex */
00007 
00008 #define FLEX_SCANNER
00009 #define YY_FLEX_MAJOR_VERSION 2
00010 #define YY_FLEX_MINOR_VERSION 5
00011 #define YY_FLEX_SUBMINOR_VERSION 35
00012 #if YY_FLEX_SUBMINOR_VERSION > 0
00013 #define FLEX_BETA
00014 #endif
00015 
00016 /* First, we deal with  platform-specific or compiler-specific issues. */
00017 
00018 /* begin standard C headers. */
00019 #include <stdio.h>
00020 #include <string.h>
00021 #include <errno.h>
00022 #include <stdlib.h>
00023 
00024 /* end standard C headers. */
00025 
00026 /* flex integer type definitions */
00027 
00028 #ifndef FLEXINT_H
00029 #define FLEXINT_H
00030 
00031 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
00032 
00033 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
00034 
00035 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
00036  * if you want the limit (max/min) macros for int types. 
00037  */
00038 #ifndef __STDC_LIMIT_MACROS
00039 #define __STDC_LIMIT_MACROS 1
00040 #endif
00041 
00042 #include <inttypes.h>
00043 typedef int8_t flex_int8_t;
00044 typedef uint8_t flex_uint8_t;
00045 typedef int16_t flex_int16_t;
00046 typedef uint16_t flex_uint16_t;
00047 typedef int32_t flex_int32_t;
00048 typedef uint32_t flex_uint32_t;
00049 #else
00050 typedef signed char flex_int8_t;
00051 typedef short int flex_int16_t;
00052 typedef int flex_int32_t;
00053 typedef unsigned char flex_uint8_t; 
00054 typedef unsigned short int flex_uint16_t;
00055 typedef unsigned int flex_uint32_t;
00056 
00057 /* Limits of integral types. */
00058 #ifndef INT8_MIN
00059 #define INT8_MIN               (-128)
00060 #endif
00061 #ifndef INT16_MIN
00062 #define INT16_MIN              (-32767-1)
00063 #endif
00064 #ifndef INT32_MIN
00065 #define INT32_MIN              (-2147483647-1)
00066 #endif
00067 #ifndef INT8_MAX
00068 #define INT8_MAX               (127)
00069 #endif
00070 #ifndef INT16_MAX
00071 #define INT16_MAX              (32767)
00072 #endif
00073 #ifndef INT32_MAX
00074 #define INT32_MAX              (2147483647)
00075 #endif
00076 #ifndef UINT8_MAX
00077 #define UINT8_MAX              (255U)
00078 #endif
00079 #ifndef UINT16_MAX
00080 #define UINT16_MAX             (65535U)
00081 #endif
00082 #ifndef UINT32_MAX
00083 #define UINT32_MAX             (4294967295U)
00084 #endif
00085 
00086 #endif /* ! C99 */
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 /* Enter a start condition.  This macro really ought to take a parameter,
00122  * but we do it the disgusting crufty way forced on us by the ()-less
00123  * definition of BEGIN.
00124  */
00125 #define BEGIN (yy_start) = 1 + 2 *
00126 
00127 /* Translate the current start state into a value that can be later handed
00128  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00129  * compatibility.
00130  */
00131 #define YY_START (((yy_start) - 1) / 2)
00132 #define YYSTATE YY_START
00133 
00134 /* Action number for EOF rule of a given start state. */
00135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00136 
00137 /* Special action meaning "start processing a new file". */
00138 #define YY_NEW_FILE yyrestart(yyin  )
00139 
00140 #define YY_END_OF_BUFFER_CHAR 0
00141 
00142 /* Size of default input buffer. */
00143 #ifndef YY_BUF_SIZE
00144 #define YY_BUF_SIZE 16384
00145 #endif
00146 
00147 /* The state buf must be large enough to hold one state per character in the main buffer.
00148  */
00149 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
00150 
00151 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
00152 #define YY_TYPEDEF_YY_BUFFER_STATE
00153 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00154 #endif
00155 
00156 extern int yyleng;
00157 
00158 extern FILE *yyin, *yyout;
00159 
00160 #define EOB_ACT_CONTINUE_SCAN 0
00161 #define EOB_ACT_END_OF_FILE 1
00162 #define EOB_ACT_LAST_MATCH 2
00163 
00164     #define YY_LESS_LINENO(n)
00165     
00166 /* Return all but the first "n" matched characters back to the input stream. */
00167 #define yyless(n) \
00168         do \
00169                 { \
00170                 /* Undo effects of setting up yytext. */ \
00171         int yyless_macro_arg = (n); \
00172         YY_LESS_LINENO(yyless_macro_arg);\
00173                 *yy_cp = (yy_hold_char); \
00174                 YY_RESTORE_YY_MORE_OFFSET \
00175                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
00176                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
00177                 } \
00178         while ( 0 )
00179 
00180 #define unput(c) yyunput( c, (yytext_ptr)  )
00181 
00182 #ifndef YY_TYPEDEF_YY_SIZE_T
00183 #define YY_TYPEDEF_YY_SIZE_T
00184 typedef size_t yy_size_t;
00185 #endif
00186 
00187 #ifndef YY_STRUCT_YY_BUFFER_STATE
00188 #define YY_STRUCT_YY_BUFFER_STATE
00189 struct yy_buffer_state
00190         {
00191         FILE *yy_input_file;
00192 
00193         char *yy_ch_buf;                /* input buffer */
00194         char *yy_buf_pos;               /* current position in input buffer */
00195 
00196         /* Size of input buffer in bytes, not including room for EOB
00197          * characters.
00198          */
00199         yy_size_t yy_buf_size;
00200 
00201         /* Number of characters read into yy_ch_buf, not including EOB
00202          * characters.
00203          */
00204         int yy_n_chars;
00205 
00206         /* Whether we "own" the buffer - i.e., we know we created it,
00207          * and can realloc() it to grow it, and should free() it to
00208          * delete it.
00209          */
00210         int yy_is_our_buffer;
00211 
00212         /* Whether this is an "interactive" input source; if so, and
00213          * if we're using stdio for input, then we want to use getc()
00214          * instead of fread(), to make sure we stop fetching input after
00215          * each newline.
00216          */
00217         int yy_is_interactive;
00218 
00219         /* Whether we're considered to be at the beginning of a line.
00220          * If so, '^' rules will be active on the next match, otherwise
00221          * not.
00222          */
00223         int yy_at_bol;
00224 
00225     int yy_bs_lineno; 
00226     int yy_bs_column; 
00228         /* Whether to try to fill the input buffer when we reach the
00229          * end of it.
00230          */
00231         int yy_fill_buffer;
00232 
00233         int yy_buffer_status;
00234 
00235 #define YY_BUFFER_NEW 0
00236 #define YY_BUFFER_NORMAL 1
00237         /* When an EOF's been seen but there's still some text to process
00238          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00239          * shouldn't try reading from the input source any more.  We might
00240          * still have a bunch of tokens to match, though, because of
00241          * possible backing-up.
00242          *
00243          * When we actually see the EOF, we change the status to "new"
00244          * (via yyrestart()), so that the user can continue scanning by
00245          * just pointing yyin at a new input file.
00246          */
00247 #define YY_BUFFER_EOF_PENDING 2
00248 
00249         };
00250 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
00251 
00252 /* Stack of input buffers. */
00253 static size_t yy_buffer_stack_top = 0; 
00254 static size_t yy_buffer_stack_max = 0; 
00255 static YY_BUFFER_STATE * yy_buffer_stack = 0; 
00257 /* We provide macros for accessing buffer states in case in the
00258  * future we want to put the buffer states in a more general
00259  * "scanner state".
00260  *
00261  * Returns the top of the stack, or NULL.
00262  */
00263 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
00264                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
00265                           : NULL)
00266 
00267 /* Same as previous macro, but useful when we know that the buffer stack is not
00268  * NULL or when we need an lvalue. For internal use only.
00269  */
00270 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
00271 
00272 /* yy_hold_char holds the character lost when yytext is formed. */
00273 static char yy_hold_char;
00274 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
00275 int yyleng;
00276 
00277 /* Points to current character in buffer. */
00278 static char *yy_c_buf_p = (char *) 0;
00279 static int yy_init = 0;         /* whether we need to initialize */
00280 static int yy_start = 0;        /* start state number */
00281 
00282 /* Flag which is used to allow yywrap()'s to do buffer switches
00283  * instead of setting up a fresh yyin.  A bit of a hack ...
00284  */
00285 static int yy_did_buffer_switch_on_eof;
00286 
00287 void yyrestart (FILE *input_file  );
00288 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
00289 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
00290 void yy_delete_buffer (YY_BUFFER_STATE b  );
00291 void yy_flush_buffer (YY_BUFFER_STATE b  );
00292 void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
00293 void yypop_buffer_state (void );
00294 
00295 static void yyensure_buffer_stack (void );
00296 static void yy_load_buffer_state (void );
00297 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
00298 
00299 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
00300 
00301 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
00302 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
00303 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
00304 
00305 void *yyalloc (yy_size_t  );
00306 void *yyrealloc (void *,yy_size_t  );
00307 void yyfree (void *  );
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 (); \
00315                 YY_CURRENT_BUFFER_LVALUE =    \
00316             yy_create_buffer(yyin,YY_BUF_SIZE ); \
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 (); \
00325                 YY_CURRENT_BUFFER_LVALUE =    \
00326             yy_create_buffer(yyin,YY_BUF_SIZE ); \
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 typedef unsigned char YY_CHAR;
00336 
00337 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
00338 
00339 typedef int yy_state_type;
00340 
00341 extern int yylineno;
00342 
00343 int yylineno = 1;
00344 
00345 extern char *yytext;
00346 #define yytext_ptr yytext
00347 
00348 static yy_state_type yy_get_previous_state (void );
00349 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
00350 static int yy_get_next_buffer (void );
00351 static void yy_fatal_error (yyconst char msg[]  );
00352 
00353 /* Done after the current pattern has been matched and before the
00354  * corresponding action - sets up yytext.
00355  */
00356 #define YY_DO_BEFORE_ACTION \
00357         (yytext_ptr) = yy_bp; \
00358         (yytext_ptr) -= (yy_more_len); \
00359         yyleng = (size_t) (yy_cp - (yytext_ptr)); \
00360         (yy_hold_char) = *yy_cp; \
00361         *yy_cp = '\0'; \
00362         (yy_c_buf_p) = yy_cp;
00363 
00364 #define YY_NUM_RULES 51
00365 #define YY_END_OF_BUFFER 52
00366 /* This struct is not used in this scanner,
00367    but its presence is necessary. */
00368 struct yy_trans_info
00369         {
00370         flex_int32_t yy_verify;
00371         flex_int32_t yy_nxt;
00372         };
00373 static yyconst flex_int16_t yy_accept[160] =
00374     {   0,
00375         0,    0,   52,   51,   49,   48,   51,   38,   38,   38,
00376        40,   33,   31,   34,   39,   39,   39,   39,   39,   39,
00377        39,   39,   39,   39,   39,   39,   39,   39,   39,   39,
00378        37,   49,    0,   47,   46,    0,   41,    0,   42,   40,
00379         0,   35,   32,   36,   39,   39,   39,   39,   28,   39,
00380        39,   39,   39,   39,   39,   39,   39,   29,   39,   39,
00381        39,   25,   39,   39,   39,   39,   39,   39,   39,    0,
00382         0,   50,    0,   45,   42,    0,    0,   43,    1,   39,
00383        13,   39,   39,   39,   39,   39,   39,   39,   39,   19,
00384        39,   26,   39,   39,   39,   39,    9,   39,   39,   39,
00385 
00386        39,   39,   39,    0,   44,   39,   39,   39,   23,   39,
00387        39,   15,    5,   39,   39,    7,   30,   17,   39,   39,
00388        39,   39,   24,   39,   39,   39,   39,    2,   39,   39,
00389        39,   39,   39,   39,   27,   39,   39,   16,   39,   39,
00390        39,   12,    3,   14,    4,   21,    6,   39,   39,    8,
00391        10,   11,   39,   20,   39,   18,   39,   22,    0
00392     } ;
00393 
00394 static yyconst flex_int32_t yy_ec[256] =
00395     {   0,
00396         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00397         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
00398         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00399         1,    2,    1,    1,    1,    1,    1,    1,    4,    5,
00400         5,    5,    6,    5,    7,    8,    5,    9,    9,    9,
00401         9,    9,    9,    9,    9,    9,    9,    5,    5,   10,
00402        11,   12,    1,    1,   13,   14,   15,   16,   17,   18,
00403        19,   20,   21,   22,   23,   24,   25,   26,   27,   28,
00404        22,   29,   30,   31,   32,   33,   34,   22,   35,   22,
00405         1,    1,    1,    1,   36,    1,   13,   14,   15,   16,
00406 
00407        17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
00408        27,   28,   22,   29,   30,   31,   32,   33,   34,   22,
00409        35,   22,    1,    1,    1,   37,    1,    1,    1,    1,
00410         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00411         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00412         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00413         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00414         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00415         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00416         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00417 
00418         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00419         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00420         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00421         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00422         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00423         1,    1,    1,    1,    1
00424     } ;
00425 
00426 static yyconst flex_int32_t yy_meta[38] =
00427     {   0,
00428         1,    1,    1,    1,    1,    1,    1,    1,    2,    1,
00429         1,    1,    2,    2,    2,    2,    2,    2,    2,    2,
00430         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
00431         2,    2,    2,    2,    2,    2,    1
00432     } ;
00433 
00434 static yyconst flex_int16_t yy_base[164] =
00435     {   0,
00436         0,    0,  190,  191,  187,  191,   35,  191,  181,   31,
00437        33,   32,  191,  176,   29,  151,   20,   39,    0,  156,
00438        28,  163,   19,  154,  153,  164,   44,  152,  166,  158,
00439       191,  175,   56,  172,  191,  172,   52,   64,   55,   66,
00440        70,  191,  191,  191,    0,  158,  142,  156,    0,  147,
00441       153,  138,  144,  135,  139,  138,   32,    0,  141,  132,
00442       138,  145,  143,   54,  145,  133,  141,   57,  139,  151,
00443       151,  191,  144,  143,   71,   83,  142,  141,    0,  132,
00444         0,  116,  134,  129,  128,  130,  115,  117,  124,   67,
00445       123,    0,  115,  121,  122,  119,    0,  111,  117,  120,
00446 
00447       100,  116,  101,  120,  119,   98,  101,   94,    0,   93,
00448        99,    0,    0,   93,  102,    0,    0,    0,   91,   98,
00449       103,  100,    0,   85,   98,   94,   96,    0,   86,   94,
00450        93,   92,   77,   90,    0,   76,   74,    0,   87,   73,
00451        89,    0,    0,    0,    0,    0,    0,   72,   72,    0,
00452         0,    0,   62,    0,   60,    0,   56,    0,  191,   94,
00453        65,   96,   98
00454     } ;
00455 
00456 static yyconst flex_int16_t yy_def[164] =
00457     {   0,
00458       159,    1,  159,  159,  159,  159,  160,  159,  159,  159,
00459       159,  159,  159,  159,  161,  161,  161,  161,  161,  161,
00460       161,  161,  161,  161,  161,  161,  161,  161,  161,  161,
00461       159,  159,  160,  162,  159,  163,  159,  159,  159,  159,
00462       159,  159,  159,  159,  161,  161,  161,  161,  161,  161,
00463       161,  161,  161,  161,  161,  161,  161,  161,  161,  161,
00464       161,  161,  161,  161,  161,  161,  161,  161,  161,  162,
00465       163,  159,  159,  159,  159,  159,  159,  159,  161,  161,
00466       161,  161,  161,  161,  161,  161,  161,  161,  161,  161,
00467       161,  161,  161,  161,  161,  161,  161,  161,  161,  161,
00468 
00469       161,  161,  161,  159,  159,  161,  161,  161,  161,  161,
00470       161,  161,  161,  161,  161,  161,  161,  161,  161,  161,
00471       161,  161,  161,  161,  161,  161,  161,  161,  161,  161,
00472       161,  161,  161,  161,  161,  161,  161,  161,  161,  161,
00473       161,  161,  161,  161,  161,  161,  161,  161,  161,  161,
00474       161,  161,  161,  161,  161,  161,  161,  161,    0,  159,
00475       159,  159,  159
00476     } ;
00477 
00478 static yyconst flex_int16_t yy_nxt[229] =
00479     {   0,
00480         4,    5,    6,    7,    8,    8,    9,   10,   11,   12,
00481        13,   14,   15,   16,   17,   18,   19,   20,   19,   19,
00482        21,   19,   19,   22,   19,   23,   24,   25,   19,   26,
00483        27,   28,   29,   30,   19,    4,   31,   34,   35,   37,
00484        39,   40,   42,   43,   46,   60,   50,   38,   51,   41,
00485        61,   52,   47,   57,   48,   53,   65,   58,   34,   35,
00486        37,   89,   90,   75,   66,   54,   45,   55,   38,   73,
00487        73,   76,   74,   39,   40,   77,   77,   96,   78,   75,
00488       101,  158,   41,  115,   97,  102,  157,   76,  104,  104,
00489       156,  105,  155,  116,   33,   33,   70,   70,   71,   71,
00490 
00491       154,  153,  152,  151,  150,  149,  148,  147,  146,  145,
00492       144,  143,  142,  141,  140,  139,  138,  137,  136,  135,
00493       134,  133,  132,  131,  130,  129,  128,  105,  105,  127,
00494       126,  125,  124,  123,  122,  121,  120,  119,  118,  117,
00495       114,  113,  112,  111,  110,  109,  108,  107,  106,   78,
00496        78,   74,   74,   72,   35,  103,  100,   99,   98,   95,
00497        94,   93,   92,   91,   88,   87,   86,   85,   84,   83,
00498        82,   81,   80,   79,   72,   35,   32,   69,   68,   67,
00499        64,   63,   62,   59,   56,   49,   44,   36,   32,  159,
00500         3,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00501 
00502       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00503       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00504       159,  159,  159,  159,  159,  159,  159,  159
00505     } ;
00506 
00507 static yyconst flex_int16_t yy_chk[229] =
00508     {   0,
00509         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00510         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00511         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00512         1,    1,    1,    1,    1,    1,    1,    7,    7,   10,
00513        11,   11,   12,   12,   15,   23,   17,   10,   17,   11,
00514        23,   18,   15,   21,   15,   18,   27,   21,   33,   33,
00515        37,   57,   57,   39,   27,   18,  161,   18,   37,   38,
00516        38,   39,   38,   40,   40,   41,   41,   64,   41,   75,
00517        68,  157,   40,   90,   64,   68,  155,   75,   76,   76,
00518       153,   76,  149,   90,  160,  160,  162,  162,  163,  163,
00519 
00520       148,  141,  140,  139,  137,  136,  134,  133,  132,  131,
00521       130,  129,  127,  126,  125,  124,  122,  121,  120,  119,
00522       115,  114,  111,  110,  108,  107,  106,  105,  104,  103,
00523       102,  101,  100,   99,   98,   96,   95,   94,   93,   91,
00524        89,   88,   87,   86,   85,   84,   83,   82,   80,   78,
00525        77,   74,   73,   71,   70,   69,   67,   66,   65,   63,
00526        62,   61,   60,   59,   56,   55,   54,   53,   52,   51,
00527        50,   48,   47,   46,   36,   34,   32,   30,   29,   28,
00528        26,   25,   24,   22,   20,   16,   14,    9,    5,    3,
00529       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00530 
00531       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00532       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00533       159,  159,  159,  159,  159,  159,  159,  159
00534     } ;
00535 
00536 static yy_state_type yy_last_accepting_state;
00537 static char *yy_last_accepting_cpos;
00538 
00539 extern int yy_flex_debug;
00540 int yy_flex_debug = 0;
00541 
00542 /* The intent behind this definition is that it'll catch
00543  * any uses of REJECT which flex missed.
00544  */
00545 #define REJECT reject_used_but_not_detected
00546 static int yy_more_flag = 0;
00547 static int yy_more_len = 0;
00548 #define yymore() ((yy_more_flag) = 1)
00549 #define YY_MORE_ADJ (yy_more_len)
00550 #define YY_RESTORE_YY_MORE_OFFSET
00551 char *yytext;
00552 #line 1 "lex.l"
00553 /*****************************************************************************
00554 *
00555 * MODULE:       SQL statement parser library 
00556 *               
00557 * AUTHOR(S):    lex.l and yac.y were originaly taken from unixODBC and
00558 *               probably written by Peter Harvey <pharvey@codebydesigns.com>,
00559 *               modifications and other code by Radim Blazek
00560 *
00561 * PURPOSE:      Parse input string containing SQL statement to 
00562 *               SQLPSTMT structure.
00563 *               SQL parser may be used by simple database drivers. 
00564 *
00565 * COPYRIGHT:    (C) 2000 by the GRASS Development Team
00566 *
00567 *               This program is free software under the GNU General Public
00568 *               License (>=v2). Read the file COPYING that comes with GRASS
00569 *               for details.
00570 *
00571 *****************************************************************************/
00572 /****************     C-CODE   *****************/
00573 #line 24 "lex.l"
00574 #include <grass/sqlp.h>
00575 #include "y.tab.h"
00576 #include <string.h>
00577 
00578 #undef YY_INPUT
00579 #define YY_INPUT(b, r, ms) (r = my_yyinput(b, ms))
00580 
00581 /***************       LEX HEADER  **************/
00582 /****************      LEX BODY  ****************/
00583 #line 584 "lex.yy.c"
00584 
00585 #define INITIAL 0
00586 
00587 #ifndef YY_NO_UNISTD_H
00588 /* Special case for "unistd.h", since it is non-ANSI. We include it way
00589  * down here because we want the user's section 1 to have been scanned first.
00590  * The user has a chance to override it with an option.
00591  */
00592 #include <unistd.h>
00593 #endif
00594 
00595 #ifndef YY_EXTRA_TYPE
00596 #define YY_EXTRA_TYPE void *
00597 #endif
00598 
00599 static int yy_init_globals (void );
00600 
00601 /* Accessor methods to globals.
00602    These are made visible to non-reentrant scanners for convenience. */
00603 
00604 int yylex_destroy (void );
00605 
00606 int yyget_debug (void );
00607 
00608 void yyset_debug (int debug_flag  );
00609 
00610 YY_EXTRA_TYPE yyget_extra (void );
00611 
00612 void yyset_extra (YY_EXTRA_TYPE user_defined  );
00613 
00614 FILE *yyget_in (void );
00615 
00616 void yyset_in  (FILE * in_str  );
00617 
00618 FILE *yyget_out (void );
00619 
00620 void yyset_out  (FILE * out_str  );
00621 
00622 int yyget_leng (void );
00623 
00624 char *yyget_text (void );
00625 
00626 int yyget_lineno (void );
00627 
00628 void yyset_lineno (int line_number  );
00629 
00630 /* Macros after this point can all be overridden by user definitions in
00631  * section 1.
00632  */
00633 
00634 #ifndef YY_SKIP_YYWRAP
00635 #ifdef __cplusplus
00636 extern "C" int yywrap (void );
00637 #else
00638 extern int yywrap (void );
00639 #endif
00640 #endif
00641 
00642     static void yyunput (int c,char *buf_ptr  );
00643     
00644 #ifndef yytext_ptr
00645 static void yy_flex_strncpy (char *,yyconst char *,int );
00646 #endif
00647 
00648 #ifdef YY_NEED_STRLEN
00649 static int yy_flex_strlen (yyconst char * );
00650 #endif
00651 
00652 #ifndef YY_NO_INPUT
00653 
00654 #ifdef __cplusplus
00655 static int yyinput (void );
00656 #else
00657 static int input (void );
00658 #endif
00659 
00660 #endif
00661 
00662 /* Amount of stuff to slurp up with each read. */
00663 #ifndef YY_READ_BUF_SIZE
00664 #define YY_READ_BUF_SIZE 8192
00665 #endif
00666 
00667 /* Copy whatever the last rule matched to the standard output. */
00668 #ifndef ECHO
00669 /* This used to be an fputs(), but since the string might contain NUL's,
00670  * we now use fwrite().
00671  */
00672 #define ECHO fwrite( yytext, yyleng, 1, yyout )
00673 #endif
00674 
00675 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00676  * is returned in "result".
00677  */
00678 #ifndef YY_INPUT
00679 #define YY_INPUT(buf,result,max_size) \
00680         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
00681                 { \
00682                 int c = '*'; \
00683                 size_t n; \
00684                 for ( n = 0; n < max_size && \
00685                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00686                         buf[n] = (char) c; \
00687                 if ( c == '\n' ) \
00688                         buf[n++] = (char) c; \
00689                 if ( c == EOF && ferror( yyin ) ) \
00690                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
00691                 result = n; \
00692                 } \
00693         else \
00694                 { \
00695                 errno=0; \
00696                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
00697                         { \
00698                         if( errno != EINTR) \
00699                                 { \
00700                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
00701                                 break; \
00702                                 } \
00703                         errno=0; \
00704                         clearerr(yyin); \
00705                         } \
00706                 }\
00707 \
00708 
00709 #endif
00710 
00711 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00712  * we don't want an extra ';' after the "return" because that will cause
00713  * some compilers to complain about unreachable statements.
00714  */
00715 #ifndef yyterminate
00716 #define yyterminate() return YY_NULL
00717 #endif
00718 
00719 /* Number of entries by which start-condition stack grows. */
00720 #ifndef YY_START_STACK_INCR
00721 #define YY_START_STACK_INCR 25
00722 #endif
00723 
00724 /* Report a fatal error. */
00725 #ifndef YY_FATAL_ERROR
00726 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00727 #endif
00728 
00729 /* end tables serialization structures and prototypes */
00730 
00731 /* Default declaration of generated scanner - a define so the user can
00732  * easily add parameters.
00733  */
00734 #ifndef YY_DECL
00735 #define YY_DECL_IS_OURS 1
00736 
00737 extern int yylex (void);
00738 
00739 #define YY_DECL int yylex (void)
00740 #endif /* !YY_DECL */
00741 
00742 /* Code executed at the beginning of each rule, after yytext and yyleng
00743  * have been set up.
00744  */
00745 #ifndef YY_USER_ACTION
00746 #define YY_USER_ACTION
00747 #endif
00748 
00749 /* Code executed at the end of each rule. */
00750 #ifndef YY_BREAK
00751 #define YY_BREAK break;
00752 #endif
00753 
00754 #define YY_RULE_SETUP \
00755         YY_USER_ACTION
00756 
00759 YY_DECL
00760 {
00761         register yy_state_type yy_current_state;
00762         register char *yy_cp, *yy_bp;
00763         register int yy_act;
00764     
00765 #line 38 "lex.l"
00766 
00767 
00768  /***************************************
00769   * LITERALS KEYWORDS TOKENS
00770   ***************************************/
00771 
00772   /* following case insensitives are ugly
00773      but I do not know better at this time */
00774 
00775 #line 776 "lex.yy.c"
00776 
00777         if ( !(yy_init) )
00778                 {
00779                 (yy_init) = 1;
00780 
00781 #ifdef YY_USER_INIT
00782                 YY_USER_INIT;
00783 #endif
00784 
00785                 if ( ! (yy_start) )
00786                         (yy_start) = 1; /* first start state */
00787 
00788                 if ( ! yyin )
00789                         yyin = stdin;
00790 
00791                 if ( ! yyout )
00792                         yyout = stdout;
00793 
00794                 if ( ! YY_CURRENT_BUFFER ) {
00795                         yyensure_buffer_stack ();
00796                         YY_CURRENT_BUFFER_LVALUE =
00797                                 yy_create_buffer(yyin,YY_BUF_SIZE );
00798                 }
00799 
00800                 yy_load_buffer_state( );
00801                 }
00802 
00803         while ( 1 )             /* loops until end-of-file is reached */
00804                 {
00805                 (yy_more_len) = 0;
00806                 if ( (yy_more_flag) )
00807                         {
00808                         (yy_more_len) = (yy_c_buf_p) - (yytext_ptr);
00809                         (yy_more_flag) = 0;
00810                         }
00811                 yy_cp = (yy_c_buf_p);
00812 
00813                 /* Support of yytext. */
00814                 *yy_cp = (yy_hold_char);
00815 
00816                 /* yy_bp points to the position in yy_ch_buf of the start of
00817                  * the current run.
00818                  */
00819                 yy_bp = yy_cp;
00820 
00821                 yy_current_state = (yy_start);
00822 yy_match:
00823                 do
00824                         {
00825                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00826                         if ( yy_accept[yy_current_state] )
00827                                 {
00828                                 (yy_last_accepting_state) = yy_current_state;
00829                                 (yy_last_accepting_cpos) = yy_cp;
00830                                 }
00831                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00832                                 {
00833                                 yy_current_state = (int) yy_def[yy_current_state];
00834                                 if ( yy_current_state >= 160 )
00835                                         yy_c = yy_meta[(unsigned int) yy_c];
00836                                 }
00837                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00838                         ++yy_cp;
00839                         }
00840                 while ( yy_base[yy_current_state] != 191 );
00841 
00842 yy_find_action:
00843                 yy_act = yy_accept[yy_current_state];
00844                 if ( yy_act == 0 )
00845                         { /* have to back up */
00846                         yy_cp = (yy_last_accepting_cpos);
00847                         yy_current_state = (yy_last_accepting_state);
00848                         yy_act = yy_accept[yy_current_state];
00849                         }
00850 
00851                 YY_DO_BEFORE_ACTION;
00852 
00853 do_action:      /* This label is used only to access EOF actions. */
00854 
00855                 switch ( yy_act )
00856         { /* beginning of action switch */
00857                         case 0: /* must back up */
00858                         /* undo the effects of YY_DO_BEFORE_ACTION */
00859                         *yy_cp = (yy_hold_char);
00860                         yy_cp = (yy_last_accepting_cpos);
00861                         yy_current_state = (yy_last_accepting_state);
00862                         goto yy_find_action;
00863 
00864 case 1:
00865 YY_RULE_SETUP
00866 #line 47 "lex.l"
00867 { return ADD; }
00868         YY_BREAK
00869 case 2:
00870 YY_RULE_SETUP
00871 #line 48 "lex.l"
00872 { return ALTER; }
00873         YY_BREAK
00874 case 3:
00875 YY_RULE_SETUP
00876 #line 49 "lex.l"
00877 { return COLUMN; }
00878         YY_BREAK
00879 case 4:
00880 YY_RULE_SETUP
00881 #line 50 "lex.l"
00882 { return DELETE; }
00883         YY_BREAK
00884 case 5:
00885 YY_RULE_SETUP
00886 #line 51 "lex.l"
00887 { return FROM; }
00888         YY_BREAK
00889 case 6:
00890 YY_RULE_SETUP
00891 #line 52 "lex.l"
00892 { return INSERT; }
00893         YY_BREAK
00894 case 7:
00895 YY_RULE_SETUP
00896 #line 53 "lex.l"
00897 { return INTO; }
00898         YY_BREAK
00899 case 8:
00900 YY_RULE_SETUP
00901 #line 54 "lex.l"
00902 { return SELECT; }
00903         YY_BREAK
00904 case 9:
00905 YY_RULE_SETUP
00906 #line 55 "lex.l"
00907 { return SET; }
00908         YY_BREAK
00909 case 10:
00910 YY_RULE_SETUP
00911 #line 56 "lex.l"
00912 { return UPDATE; }
00913         YY_BREAK
00914 case 11:
00915 YY_RULE_SETUP
00916 #line 57 "lex.l"
00917 { return VALUES; }
00918         YY_BREAK
00919 case 12:
00920 YY_RULE_SETUP
00921 #line 58 "lex.l"
00922 { return WHERE; }
00923         YY_BREAK
00924 case 13:
00925 YY_RULE_SETUP
00926 #line 59 "lex.l"
00927 { return AND; } 
00928         YY_BREAK
00929 case 14:
00930 YY_RULE_SETUP
00931 #line 60 "lex.l"
00932 { return CREATE; }
00933         YY_BREAK
00934 case 15:
00935 YY_RULE_SETUP
00936 #line 61 "lex.l"
00937 { return DROP; }
00938         YY_BREAK
00939 case 16:
00940 YY_RULE_SETUP
00941 #line 62 "lex.l"
00942 { return TABLE; }
00943         YY_BREAK
00944 case 17:
00945 YY_RULE_SETUP
00946 #line 63 "lex.l"
00947 { return NULL_VALUE; }
00948         YY_BREAK
00949 case 18:
00950 YY_RULE_SETUP
00951 #line 64 "lex.l"
00952 { return VARCHAR; }
00953         YY_BREAK
00954 case 19:
00955 YY_RULE_SETUP
00956 #line 65 "lex.l"
00957 { return INT; }
00958         YY_BREAK
00959 case 20:
00960 YY_RULE_SETUP
00961 #line 66 "lex.l"
00962 { return INTEGER; }
00963         YY_BREAK
00964 case 21:
00965 YY_RULE_SETUP
00966 #line 67 "lex.l"
00967 { return DOUBLE; }
00968         YY_BREAK
00969 case 22:
00970 YY_RULE_SETUP
00971 #line 68 "lex.l"
00972 { return PRECISION; }
00973         YY_BREAK
00974 case 23:
00975 YY_RULE_SETUP
00976 #line 69 "lex.l"
00977 { return DATE; }
00978         YY_BREAK
00979 case 24:
00980 YY_RULE_SETUP
00981 #line 70 "lex.l"
00982 { return TIME; }
00983         YY_BREAK
00984 case 25:
00985 YY_RULE_SETUP
00986 #line 71 "lex.l"
00987 { return OR; }
00988         YY_BREAK
00989 case 26:
00990 YY_RULE_SETUP
00991 #line 72 "lex.l"
00992 { return NOT; }
00993         YY_BREAK
00994 case 27:
00995 YY_RULE_SETUP
00996 #line 73 "lex.l"
00997 { return ORDER; }
00998         YY_BREAK
00999 case 28:
01000 YY_RULE_SETUP
01001 #line 74 "lex.l"
01002 { return BY; }
01003         YY_BREAK
01004 case 29:
01005 YY_RULE_SETUP
01006 #line 75 "lex.l"
01007 { return IS; }
01008         YY_BREAK
01009 case 30:
01010 YY_RULE_SETUP
01011 #line 76 "lex.l"
01012 {
01013                                   yylval.strval = (char*)strdup("~");
01014                                   return COMPARISON_OPERATOR;
01015                                 }
01016         YY_BREAK
01017 
01018  /* [Dd][Ii][Ss][Tt][Ii][Nn][Cc][Tt]    { return DISTINCT; } */
01019  /***************************************
01020   * EQUAL
01021   ***************************************/
01022 
01023 case 31:
01024 YY_RULE_SETUP
01025 #line 86 "lex.l"
01026 {
01027                         return EQUAL;
01028                 }
01029         YY_BREAK
01030 
01031  /***************************************
01032   * COMPARISON OPERATOR
01033   ***************************************/
01034 
01035 case 32:
01036 #line 95 "lex.l"
01037 case 33:
01038 #line 96 "lex.l"
01039 case 34:
01040 #line 97 "lex.l"
01041 case 35:
01042 #line 98 "lex.l"
01043 case 36:
01044 #line 99 "lex.l"
01045 case 37:
01046 YY_RULE_SETUP
01047 #line 99 "lex.l"
01048 {
01049                         yylval.strval = (char*)strdup(yytext);
01050                         return COMPARISON_OPERATOR;
01051                 }
01052         YY_BREAK
01053 
01054  /***************************************
01055   * PUNCTUATION
01056   ***************************************/
01057 
01058 case 38:
01059 YY_RULE_SETUP
01060 #line 108 "lex.l"
01061 {
01062                         yylval.strval = (char*)strdup(yytext);
01063                         return yytext[0];
01064                 }
01065         YY_BREAK
01066 
01067  /***************************************
01068   * NAMES
01069   ***************************************/
01070 
01071 case 39:
01072 YY_RULE_SETUP
01073 #line 117 "lex.l"
01074 {
01075                                 yylval.strval = (char*)strdup(yytext);
01076                                 return NAME;
01077                         }
01078         YY_BREAK
01079 
01080  /***************************************
01081   * INTEGER
01082   ***************************************/
01083 
01084 case 40:
01085 YY_RULE_SETUP
01086 #line 127 "lex.l"
01087 {
01088                         yylval.intval = atoi(yytext);
01089                         /* yylval.strval = (char*)strdup(yytext); */
01090                         return INTNUM;
01091               }
01092         YY_BREAK
01093 
01094  /***************************************
01095   * FLOATING POINT NUM
01096   ***************************************/
01097 
01098 case 41:
01099 #line 138 "lex.l"
01100 case 42:
01101 #line 139 "lex.l"
01102 case 43:
01103 #line 140 "lex.l"
01104 case 44:
01105 #line 141 "lex.l"
01106 case 45:
01107 YY_RULE_SETUP
01108 #line 141 "lex.l"
01109 {
01110                                         yylval.floatval = atof(yytext);
01111                                         /* yylval.strval = (char*)strdup(yytext); */
01112                                         return FLOATNUM;
01113                                 }
01114         YY_BREAK
01115 
01116  /***************************************
01117   * STRINGS (single quotes)
01118   ***************************************/
01119 
01120 case 46:
01121 /* rule 46 can match eol */
01122 YY_RULE_SETUP
01123 #line 152 "lex.l"
01124 {
01125                         char    *Buffer, *ptra, *ptrb;
01126                         int     c = input();
01127                         int     len;
01128                         
01129                         Buffer = (char*)strdup(yytext); /* store here because we lose it when unput() */
01130                         unput( c ); /* just peeking - checking for a double quote... embedded quote */
01131 
01132                         if ( c != '\'' )
01133                         {
01134                                 len = strlen (Buffer);
01135                                 Buffer[len-1] = '\0';
01136                                 /* Hopefully replace all '' by ' */
01137                                 ptrb = Buffer + 1;
01138                                 while ( (ptra = strchr(ptrb, '\'')) != NULL ) {
01139                                     ptra++; ptrb = ptra;
01140                                     while ( ptra[1] != 0 ) { ptra[0] = ptra[1]; ptra++; } 
01141                                     ptra[0] = 0;
01142                                 }
01143                                     
01144                                 yylval.strval = (char*)strdup(Buffer+1);
01145                                 free( Buffer );
01146                                 return STRING;
01147                         }
01148                         else
01149                         {
01150                                 free( Buffer );
01151                                 yymore();
01152                         }                               
01153                 }
01154         YY_BREAK
01155                 
01156  /***************************************
01157   * STRINGS (unterminated)
01158   ***************************************/
01159 
01160 case 47:
01161 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
01162 (yy_c_buf_p) = yy_cp -= 1;
01163 YY_DO_BEFORE_ACTION; /* set up yytext again */
01164 YY_RULE_SETUP
01165 #line 187 "lex.l"
01166 { yyerror("Unterminated string"); }
01167         YY_BREAK
01168 
01169  /***************************************
01170   * NEW LINE (ignored)
01171   ***************************************/
01172 
01173 case 48:
01174 /* rule 48 can match eol */
01175 YY_RULE_SETUP
01176 #line 193 "lex.l"
01177 ;
01178         YY_BREAK
01179 
01180  /***************************************
01181   * WHITE SPACE (ignored)
01182   ***************************************/
01183 
01184 case 49:
01185 YY_RULE_SETUP
01186 #line 199 "lex.l"
01187 ;       /* white space */
01188         YY_BREAK
01189 
01190  /***************************************
01191   * COMMENTS (ignored)
01192   ***************************************/
01193 
01194 case 50:
01195 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
01196 (yy_c_buf_p) = yy_cp -= 1;
01197 YY_DO_BEFORE_ACTION; /* set up yytext again */
01198 YY_RULE_SETUP
01199 #line 205 "lex.l"
01200 ;       /* comment */
01201         YY_BREAK
01202 case 51:
01203 YY_RULE_SETUP
01204 #line 207 "lex.l"
01205 ECHO;
01206         YY_BREAK
01207 #line 1208 "lex.yy.c"
01208 case YY_STATE_EOF(INITIAL):
01209         yyterminate();
01210 
01211         case YY_END_OF_BUFFER:
01212                 {
01213                 /* Amount of text matched not including the EOB char. */
01214                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
01215 
01216                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
01217                 *yy_cp = (yy_hold_char);
01218                 YY_RESTORE_YY_MORE_OFFSET
01219 
01220                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
01221                         {
01222                         /* We're scanning a new file or input source.  It's
01223                          * possible that this happened because the user
01224                          * just pointed yyin at a new source and called
01225                          * yylex().  If so, then we have to assure
01226                          * consistency between YY_CURRENT_BUFFER and our
01227                          * globals.  Here is the right place to do so, because
01228                          * this is the first action (other than possibly a
01229                          * back-up) that will match for the new input source.
01230                          */
01231                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01232                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
01233                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
01234                         }
01235 
01236                 /* Note that here we test for yy_c_buf_p "<=" to the position
01237                  * of the first EOB in the buffer, since yy_c_buf_p will
01238                  * already have been incremented past the NUL character
01239                  * (since all states make transitions on EOB to the
01240                  * end-of-buffer state).  Contrast this with the test
01241                  * in input().
01242                  */
01243                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
01244                         { /* This was really a NUL. */
01245                         yy_state_type yy_next_state;
01246 
01247                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
01248 
01249                         yy_current_state = yy_get_previous_state(  );
01250 
01251                         /* Okay, we're now positioned to make the NUL
01252                          * transition.  We couldn't have
01253                          * yy_get_previous_state() go ahead and do it
01254                          * for us because it doesn't know how to deal
01255                          * with the possibility of jamming (and we don't
01256                          * want to build jamming into it because then it
01257                          * will run more slowly).
01258                          */
01259 
01260                         yy_next_state = yy_try_NUL_trans( yy_current_state );
01261 
01262                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01263 
01264                         if ( yy_next_state )
01265                                 {
01266                                 /* Consume the NUL. */
01267                                 yy_cp = ++(yy_c_buf_p);
01268                                 yy_current_state = yy_next_state;
01269                                 goto yy_match;
01270                                 }
01271 
01272                         else
01273                                 {
01274                                 yy_cp = (yy_c_buf_p);
01275                                 goto yy_find_action;
01276                                 }
01277                         }
01278 
01279                 else switch ( yy_get_next_buffer(  ) )
01280                         {
01281                         case EOB_ACT_END_OF_FILE:
01282                                 {
01283                                 (yy_did_buffer_switch_on_eof) = 0;
01284 
01285                                 if ( yywrap( ) )
01286                                         {
01287                                         /* Note: because we've taken care in
01288                                          * yy_get_next_buffer() to have set up
01289                                          * yytext, we can now set up
01290                                          * yy_c_buf_p so that if some total
01291                                          * hoser (like flex itself) wants to
01292                                          * call the scanner after we return the
01293                                          * YY_NULL, it'll still work - another
01294                                          * YY_NULL will get returned.
01295                                          */
01296                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
01297 
01298                                         yy_act = YY_STATE_EOF(YY_START);
01299                                         goto do_action;
01300                                         }
01301 
01302                                 else
01303                                         {
01304                                         if ( ! (yy_did_buffer_switch_on_eof) )
01305                                                 YY_NEW_FILE;
01306                                         }
01307                                 break;
01308                                 }
01309 
01310                         case EOB_ACT_CONTINUE_SCAN:
01311                                 (yy_c_buf_p) =
01312                                         (yytext_ptr) + yy_amount_of_matched_text;
01313 
01314                                 yy_current_state = yy_get_previous_state(  );
01315 
01316                                 yy_cp = (yy_c_buf_p);
01317                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01318                                 goto yy_match;
01319 
01320                         case EOB_ACT_LAST_MATCH:
01321                                 (yy_c_buf_p) =
01322                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
01323 
01324                                 yy_current_state = yy_get_previous_state(  );
01325 
01326                                 yy_cp = (yy_c_buf_p);
01327                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01328                                 goto yy_find_action;
01329                         }
01330                 break;
01331                 }
01332 
01333         default:
01334                 YY_FATAL_ERROR(
01335                         "fatal flex scanner internal error--no action found" );
01336         } /* end of action switch */
01337                 } /* end of scanning one token */
01338 } /* end of yylex */
01339 
01340 /* yy_get_next_buffer - try to read in a new buffer
01341  *
01342  * Returns a code representing an action:
01343  *      EOB_ACT_LAST_MATCH -
01344  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
01345  *      EOB_ACT_END_OF_FILE - end of file
01346  */
01347 static int yy_get_next_buffer (void)
01348 {
01349         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
01350         register char *source = (yytext_ptr);
01351         register int number_to_move, i;
01352         int ret_val;
01353 
01354         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
01355                 YY_FATAL_ERROR(
01356                 "fatal flex scanner internal error--end of buffer missed" );
01357 
01358         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
01359                 { /* Don't try to fill the buffer, so this is an EOF. */
01360                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
01361                         {
01362                         /* We matched a single character, the EOB, so
01363                          * treat this as a final EOF.
01364                          */
01365                         return EOB_ACT_END_OF_FILE;
01366                         }
01367 
01368                 else
01369                         {
01370                         /* We matched some text prior to the EOB, first
01371                          * process it.
01372                          */
01373                         return EOB_ACT_LAST_MATCH;
01374                         }
01375                 }
01376 
01377         /* Try to read more data. */
01378 
01379         /* First move last chars to start of buffer. */
01380         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
01381 
01382         for ( i = 0; i < number_to_move; ++i )
01383                 *(dest++) = *(source++);
01384 
01385         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01386                 /* don't do the read, it's not guaranteed to return an EOF,
01387                  * just force an EOF
01388                  */
01389                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
01390 
01391         else
01392                 {
01393                         int num_to_read =
01394                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
01395 
01396                 while ( num_to_read <= 0 )
01397                         { /* Not enough room in the buffer - grow it. */
01398 
01399                         /* just a shorter name for the current buffer */
01400                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
01401 
01402                         int yy_c_buf_p_offset =
01403                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
01404 
01405                         if ( b->yy_is_our_buffer )
01406                                 {
01407                                 int new_size = b->yy_buf_size * 2;
01408 
01409                                 if ( new_size <= 0 )
01410                                         b->yy_buf_size += b->yy_buf_size / 8;
01411                                 else
01412                                         b->yy_buf_size *= 2;
01413 
01414                                 b->yy_ch_buf = (char *)
01415                                         /* Include room in for 2 EOB chars. */
01416                                         yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
01417                                 }
01418                         else
01419                                 /* Can't grow it, we don't own it. */
01420                                 b->yy_ch_buf = 0;
01421 
01422                         if ( ! b->yy_ch_buf )
01423                                 YY_FATAL_ERROR(
01424                                 "fatal error - scanner input buffer overflow" );
01425 
01426                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
01427 
01428                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
01429                                                 number_to_move - 1;
01430 
01431                         }
01432 
01433                 if ( num_to_read > YY_READ_BUF_SIZE )
01434                         num_to_read = YY_READ_BUF_SIZE;
01435 
01436                 /* Read in more data. */
01437                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
01438                         (yy_n_chars), (size_t) num_to_read );
01439 
01440                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01441                 }
01442 
01443         if ( (yy_n_chars) == 0 )
01444                 {
01445                 if ( number_to_move == YY_MORE_ADJ )
01446                         {
01447                         ret_val = EOB_ACT_END_OF_FILE;
01448                         yyrestart(yyin  );
01449                         }
01450 
01451                 else
01452                         {
01453                         ret_val = EOB_ACT_LAST_MATCH;
01454                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
01455                                 YY_BUFFER_EOF_PENDING;
01456                         }
01457                 }
01458 
01459         else
01460                 ret_val = EOB_ACT_CONTINUE_SCAN;
01461 
01462         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
01463                 /* Extend the array by 50%, plus the number we really need. */
01464                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
01465                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
01466                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
01467                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
01468         }
01469 
01470         (yy_n_chars) += number_to_move;
01471         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
01472         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
01473 
01474         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
01475 
01476         return ret_val;
01477 }
01478 
01479 /* yy_get_previous_state - get the state just before the EOB char was reached */
01480 
01481     static yy_state_type yy_get_previous_state (void)
01482 {
01483         register yy_state_type yy_current_state;
01484         register char *yy_cp;
01485     
01486         yy_current_state = (yy_start);
01487 
01488         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
01489                 {
01490                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01491                 if ( yy_accept[yy_current_state] )
01492                         {
01493                         (yy_last_accepting_state) = yy_current_state;
01494                         (yy_last_accepting_cpos) = yy_cp;
01495                         }
01496                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01497                         {
01498                         yy_current_state = (int) yy_def[yy_current_state];
01499                         if ( yy_current_state >= 160 )
01500                                 yy_c = yy_meta[(unsigned int) yy_c];
01501                         }
01502                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01503                 }
01504 
01505         return yy_current_state;
01506 }
01507 
01508 /* yy_try_NUL_trans - try to make a transition on the NUL character
01509  *
01510  * synopsis
01511  *      next_state = yy_try_NUL_trans( current_state );
01512  */
01513     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
01514 {
01515         register int yy_is_jam;
01516         register char *yy_cp = (yy_c_buf_p);
01517 
01518         register YY_CHAR yy_c = 1;
01519         if ( yy_accept[yy_current_state] )
01520                 {
01521                 (yy_last_accepting_state) = yy_current_state;
01522                 (yy_last_accepting_cpos) = yy_cp;
01523                 }
01524         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01525                 {
01526                 yy_current_state = (int) yy_def[yy_current_state];
01527                 if ( yy_current_state >= 160 )
01528                         yy_c = yy_meta[(unsigned int) yy_c];
01529                 }
01530         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01531         yy_is_jam = (yy_current_state == 159);
01532 
01533         return yy_is_jam ? 0 : yy_current_state;
01534 }
01535 
01536     static void yyunput (int c, register char * yy_bp )
01537 {
01538         register char *yy_cp;
01539     
01540     yy_cp = (yy_c_buf_p);
01541 
01542         /* undo effects of setting up yytext */
01543         *yy_cp = (yy_hold_char);
01544 
01545         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
01546                 { /* need to shift things up to make room */
01547                 /* +2 for EOB chars. */
01548                 register int number_to_move = (yy_n_chars) + 2;
01549                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
01550                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
01551                 register char *source =
01552                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
01553 
01554                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
01555                         *--dest = *--source;
01556 
01557                 yy_cp += (int) (dest - source);
01558                 yy_bp += (int) (dest - source);
01559                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
01560                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
01561 
01562                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
01563                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
01564                 }
01565 
01566         *--yy_cp = (char) c;
01567 
01568         (yytext_ptr) = yy_bp;
01569         (yy_hold_char) = *yy_cp;
01570         (yy_c_buf_p) = yy_cp;
01571 }
01572 
01573 #ifndef YY_NO_INPUT
01574 #ifdef __cplusplus
01575     static int yyinput (void)
01576 #else
01577     static int input  (void)
01578 #endif
01579 
01580 {
01581         int c;
01582     
01583         *(yy_c_buf_p) = (yy_hold_char);
01584 
01585         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
01586                 {
01587                 /* yy_c_buf_p now points to the character we want to return.
01588                  * If this occurs *before* the EOB characters, then it's a
01589                  * valid NUL; if not, then we've hit the end of the buffer.
01590                  */
01591                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
01592                         /* This was really a NUL. */
01593                         *(yy_c_buf_p) = '\0';
01594 
01595                 else
01596                         { /* need more input */
01597                         int offset = (yy_c_buf_p) - (yytext_ptr);
01598                         ++(yy_c_buf_p);
01599 
01600                         switch ( yy_get_next_buffer(  ) )
01601                                 {
01602                                 case EOB_ACT_LAST_MATCH:
01603                                         /* This happens because yy_g_n_b()
01604                                          * sees that we've accumulated a
01605                                          * token and flags that we need to
01606                                          * try matching the token before
01607                                          * proceeding.  But for input(),
01608                                          * there's no matching to consider.
01609                                          * So convert the EOB_ACT_LAST_MATCH
01610                                          * to EOB_ACT_END_OF_FILE.
01611                                          */
01612 
01613                                         /* Reset buffer status. */
01614                                         yyrestart(yyin );
01615 
01616                                         /*FALLTHROUGH*/
01617 
01618                                 case EOB_ACT_END_OF_FILE:
01619                                         {
01620                                         if ( yywrap( ) )
01621                                                 return EOF;
01622 
01623                                         if ( ! (yy_did_buffer_switch_on_eof) )
01624                                                 YY_NEW_FILE;
01625 #ifdef __cplusplus
01626                                         return yyinput();
01627 #else
01628                                         return input();
01629 #endif
01630                                         }
01631 
01632                                 case EOB_ACT_CONTINUE_SCAN:
01633                                         (yy_c_buf_p) = (yytext_ptr) + offset;
01634                                         break;
01635                                 }
01636                         }
01637                 }
01638 
01639         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
01640         *(yy_c_buf_p) = '\0';   /* preserve yytext */
01641         (yy_hold_char) = *++(yy_c_buf_p);
01642 
01643         return c;
01644 }
01645 #endif  /* ifndef YY_NO_INPUT */
01646 
01652     void yyrestart  (FILE * input_file )
01653 {
01654     
01655         if ( ! YY_CURRENT_BUFFER ){
01656         yyensure_buffer_stack ();
01657                 YY_CURRENT_BUFFER_LVALUE =
01658             yy_create_buffer(yyin,YY_BUF_SIZE );
01659         }
01660 
01661         yy_init_buffer(YY_CURRENT_BUFFER,input_file );
01662         yy_load_buffer_state( );
01663 }
01664 
01669     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
01670 {
01671     
01672         /* TODO. We should be able to replace this entire function body
01673          * with
01674          *              yypop_buffer_state();
01675          *              yypush_buffer_state(new_buffer);
01676      */
01677         yyensure_buffer_stack ();
01678         if ( YY_CURRENT_BUFFER == new_buffer )
01679                 return;
01680 
01681         if ( YY_CURRENT_BUFFER )
01682                 {
01683                 /* Flush out information for old buffer. */
01684                 *(yy_c_buf_p) = (yy_hold_char);
01685                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
01686                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01687                 }
01688 
01689         YY_CURRENT_BUFFER_LVALUE = new_buffer;
01690         yy_load_buffer_state( );
01691 
01692         /* We don't actually know whether we did this switch during
01693          * EOF (yywrap()) processing, but the only time this flag
01694          * is looked at is after yywrap() is called, so it's safe
01695          * to go ahead and always set it.
01696          */
01697         (yy_did_buffer_switch_on_eof) = 1;
01698 }
01699 
01700 static void yy_load_buffer_state  (void)
01701 {
01702         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01703         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
01704         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
01705         (yy_hold_char) = *(yy_c_buf_p);
01706 }
01707 
01714     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
01715 {
01716         YY_BUFFER_STATE b;
01717     
01718         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
01719         if ( ! b )
01720                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01721 
01722         b->yy_buf_size = size;
01723 
01724         /* yy_ch_buf has to be 2 characters longer than the size given because
01725          * we need to put in 2 end-of-buffer characters.
01726          */
01727         b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
01728         if ( ! b->yy_ch_buf )
01729                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01730 
01731         b->yy_is_our_buffer = 1;
01732 
01733         yy_init_buffer(b,file );
01734 
01735         return b;
01736 }
01737 
01742     void yy_delete_buffer (YY_BUFFER_STATE  b )
01743 {
01744     
01745         if ( ! b )
01746                 return;
01747 
01748         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
01749                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
01750 
01751         if ( b->yy_is_our_buffer )
01752                 yyfree((void *) b->yy_ch_buf  );
01753 
01754         yyfree((void *) b  );
01755 }
01756 
01757 #ifndef __cplusplus
01758 extern int isatty (int );
01759 #endif /* __cplusplus */
01760     
01761 /* Initializes or reinitializes a buffer.
01762  * This function is sometimes called more than once on the same buffer,
01763  * such as during a yyrestart() or at EOF.
01764  */
01765     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
01766 
01767 {
01768         int oerrno = errno;
01769     
01770         yy_flush_buffer(b );
01771 
01772         b->yy_input_file = file;
01773         b->yy_fill_buffer = 1;
01774 
01775     /* If b is the current buffer, then yy_init_buffer was _probably_
01776      * called from yyrestart() or through yy_get_next_buffer.
01777      * In that case, we don't want to reset the lineno or column.
01778      */
01779     if (b != YY_CURRENT_BUFFER){
01780         b->yy_bs_lineno = 1;
01781         b->yy_bs_column = 0;
01782     }
01783 
01784         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01785     
01786         errno = oerrno;
01787 }
01788 
01793     void yy_flush_buffer (YY_BUFFER_STATE  b )
01794 {
01795         if ( ! b )
01796                 return;
01797 
01798         b->yy_n_chars = 0;
01799 
01800         /* We always need two end-of-buffer characters.  The first causes
01801          * a transition to the end-of-buffer state.  The second causes
01802          * a jam in that state.
01803          */
01804         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01805         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01806 
01807         b->yy_buf_pos = &b->yy_ch_buf[0];
01808 
01809         b->yy_at_bol = 1;
01810         b->yy_buffer_status = YY_BUFFER_NEW;
01811 
01812         if ( b == YY_CURRENT_BUFFER )
01813                 yy_load_buffer_state( );
01814 }
01815 
01822 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
01823 {
01824         if (new_buffer == NULL)
01825                 return;
01826 
01827         yyensure_buffer_stack();
01828 
01829         /* This block is copied from yy_switch_to_buffer. */
01830         if ( YY_CURRENT_BUFFER )
01831                 {
01832                 /* Flush out information for old buffer. */
01833                 *(yy_c_buf_p) = (yy_hold_char);
01834                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
01835                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01836                 }
01837 
01838         /* Only push if top exists. Otherwise, replace top. */
01839         if (YY_CURRENT_BUFFER)
01840                 (yy_buffer_stack_top)++;
01841         YY_CURRENT_BUFFER_LVALUE = new_buffer;
01842 
01843         /* copied from yy_switch_to_buffer. */
01844         yy_load_buffer_state( );
01845         (yy_did_buffer_switch_on_eof) = 1;
01846 }
01847 
01852 void yypop_buffer_state (void)
01853 {
01854         if (!YY_CURRENT_BUFFER)
01855                 return;
01856 
01857         yy_delete_buffer(YY_CURRENT_BUFFER );
01858         YY_CURRENT_BUFFER_LVALUE = NULL;
01859         if ((yy_buffer_stack_top) > 0)
01860                 --(yy_buffer_stack_top);
01861 
01862         if (YY_CURRENT_BUFFER) {
01863                 yy_load_buffer_state( );
01864                 (yy_did_buffer_switch_on_eof) = 1;
01865         }
01866 }
01867 
01868 /* Allocates the stack if it does not exist.
01869  *  Guarantees space for at least one push.
01870  */
01871 static void yyensure_buffer_stack (void)
01872 {
01873         int num_to_alloc;
01874     
01875         if (!(yy_buffer_stack)) {
01876 
01877                 /* First allocation is just for 2 elements, since we don't know if this
01878                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
01879                  * immediate realloc on the next call.
01880          */
01881                 num_to_alloc = 1;
01882                 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
01883                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
01884                                                                 );
01885                 if ( ! (yy_buffer_stack) )
01886                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
01887                                                                   
01888                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
01889                                 
01890                 (yy_buffer_stack_max) = num_to_alloc;
01891                 (yy_buffer_stack_top) = 0;
01892                 return;
01893         }
01894 
01895         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
01896 
01897                 /* Increase the buffer to prepare for a possible push. */
01898                 int grow_size = 8 /* arbitrary grow size */;
01899 
01900                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
01901                 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
01902                                                                 ((yy_buffer_stack),
01903                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
01904                                                                 );
01905                 if ( ! (yy_buffer_stack) )
01906                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
01907 
01908                 /* zero only the new slots.*/
01909                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
01910                 (yy_buffer_stack_max) = num_to_alloc;
01911         }
01912 }
01913 
01920 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
01921 {
01922         YY_BUFFER_STATE b;
01923     
01924         if ( size < 2 ||
01925              base[size-2] != YY_END_OF_BUFFER_CHAR ||
01926              base[size-1] != YY_END_OF_BUFFER_CHAR )
01927                 /* They forgot to leave room for the EOB's. */
01928                 return 0;
01929 
01930         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
01931         if ( ! b )
01932                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
01933 
01934         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
01935         b->yy_buf_pos = b->yy_ch_buf = base;
01936         b->yy_is_our_buffer = 0;
01937         b->yy_input_file = 0;
01938         b->yy_n_chars = b->yy_buf_size;
01939         b->yy_is_interactive = 0;
01940         b->yy_at_bol = 1;
01941         b->yy_fill_buffer = 0;
01942         b->yy_buffer_status = YY_BUFFER_NEW;
01943 
01944         yy_switch_to_buffer(b  );
01945 
01946         return b;
01947 }
01948 
01957 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
01958 {
01959     
01960         return yy_scan_bytes(yystr,strlen(yystr) );
01961 }
01962 
01970 YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
01971 {
01972         YY_BUFFER_STATE b;
01973         char *buf;
01974         yy_size_t n;
01975         int i;
01976     
01977         /* Get memory for full buffer, including space for trailing EOB's. */
01978         n = _yybytes_len + 2;
01979         buf = (char *) yyalloc(n  );
01980         if ( ! buf )
01981                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
01982 
01983         for ( i = 0; i < _yybytes_len; ++i )
01984                 buf[i] = yybytes[i];
01985 
01986         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
01987 
01988         b = yy_scan_buffer(buf,n );
01989         if ( ! b )
01990                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
01991 
01992         /* It's okay to grow etc. this buffer, and we should throw it
01993          * away when we're done.
01994          */
01995         b->yy_is_our_buffer = 1;
01996 
01997         return b;
01998 }
01999 
02000 #ifndef YY_EXIT_FAILURE
02001 #define YY_EXIT_FAILURE 2
02002 #endif
02003 
02004 static void yy_fatal_error (yyconst char* msg )
02005 {
02006         (void) fprintf( stderr, "%s\n", msg );
02007         exit( YY_EXIT_FAILURE );
02008 }
02009 
02010 /* Redefine yyless() so it works in section 3 code. */
02011 
02012 #undef yyless
02013 #define yyless(n) \
02014         do \
02015                 { \
02016                 /* Undo effects of setting up yytext. */ \
02017         int yyless_macro_arg = (n); \
02018         YY_LESS_LINENO(yyless_macro_arg);\
02019                 yytext[yyleng] = (yy_hold_char); \
02020                 (yy_c_buf_p) = yytext + yyless_macro_arg; \
02021                 (yy_hold_char) = *(yy_c_buf_p); \
02022                 *(yy_c_buf_p) = '\0'; \
02023                 yyleng = yyless_macro_arg; \
02024                 } \
02025         while ( 0 )
02026 
02027 /* Accessor  methods (get/set functions) to struct members. */
02028 
02032 int yyget_lineno  (void)
02033 {
02034         
02035     return yylineno;
02036 }
02037 
02041 FILE *yyget_in  (void)
02042 {
02043         return yyin;
02044 }
02045 
02049 FILE *yyget_out  (void)
02050 {
02051         return yyout;
02052 }
02053 
02057 int yyget_leng  (void)
02058 {
02059         return yyleng;
02060 }
02061 
02066 char *yyget_text  (void)
02067 {
02068         return yytext;
02069 }
02070 
02075 void yyset_lineno (int  line_number )
02076 {
02077     
02078     yylineno = line_number;
02079 }
02080 
02087 void yyset_in (FILE *  in_str )
02088 {
02089         yyin = in_str ;
02090 }
02091 
02092 void yyset_out (FILE *  out_str )
02093 {
02094         yyout = out_str ;
02095 }
02096 
02097 int yyget_debug  (void)
02098 {
02099         return yy_flex_debug;
02100 }
02101 
02102 void yyset_debug (int  bdebug )
02103 {
02104         yy_flex_debug = bdebug ;
02105 }
02106 
02107 static int yy_init_globals (void)
02108 {
02109         /* Initialization is the same as for the non-reentrant scanner.
02110      * This function is called from yylex_destroy(), so don't allocate here.
02111      */
02112 
02113     (yy_buffer_stack) = 0;
02114     (yy_buffer_stack_top) = 0;
02115     (yy_buffer_stack_max) = 0;
02116     (yy_c_buf_p) = (char *) 0;
02117     (yy_init) = 0;
02118     (yy_start) = 0;
02119 
02120 /* Defined in main.c */
02121 #ifdef YY_STDINIT
02122     yyin = stdin;
02123     yyout = stdout;
02124 #else
02125     yyin = (FILE *) 0;
02126     yyout = (FILE *) 0;
02127 #endif
02128 
02129     /* For future reference: Set errno on error, since we are called by
02130      * yylex_init()
02131      */
02132     return 0;
02133 }
02134 
02135 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
02136 int yylex_destroy  (void)
02137 {
02138     
02139     /* Pop the buffer stack, destroying each element. */
02140         while(YY_CURRENT_BUFFER){
02141                 yy_delete_buffer(YY_CURRENT_BUFFER  );
02142                 YY_CURRENT_BUFFER_LVALUE = NULL;
02143                 yypop_buffer_state();
02144         }
02145 
02146         /* Destroy the stack itself. */
02147         yyfree((yy_buffer_stack) );
02148         (yy_buffer_stack) = NULL;
02149 
02150     /* Reset the globals. This is important in a non-reentrant scanner so the next time
02151      * yylex() is called, initialization will occur. */
02152     yy_init_globals( );
02153 
02154     return 0;
02155 }
02156 
02157 /*
02158  * Internal utility routines.
02159  */
02160 
02161 #ifndef yytext_ptr
02162 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
02163 {
02164         register int i;
02165         for ( i = 0; i < n; ++i )
02166                 s1[i] = s2[i];
02167 }
02168 #endif
02169 
02170 #ifdef YY_NEED_STRLEN
02171 static int yy_flex_strlen (yyconst char * s )
02172 {
02173         register int n;
02174         for ( n = 0; s[n]; ++n )
02175                 ;
02176 
02177         return n;
02178 }
02179 #endif
02180 
02181 void *yyalloc (yy_size_t  size )
02182 {
02183         return (void *) malloc( size );
02184 }
02185 
02186 void *yyrealloc  (void * ptr, yy_size_t  size )
02187 {
02188         /* The cast to (char *) in the following accommodates both
02189          * implementations that use char* generic pointers, and those
02190          * that use void* generic pointers.  It works with the latter
02191          * because both ANSI C and C++ allow castless assignment from
02192          * any pointer type to void*, and deal with argument conversions
02193          * as though doing an assignment.
02194          */
02195         return (void *) realloc( (char *) ptr, size );
02196 }
02197 
02198 void yyfree (void * ptr )
02199 {
02200         free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
02201 }
02202 
02203 #define YYTABLES_NAME "yytables"
02204 
02205 #line 207 "lex.l"
02206 
02207 
02208 /**********************************************************************
02209  *
02210  *                             C-CODE
02211  *
02212  **********************************************************************/
02213 
02214 
02215 
02216 /**********************************************************************
02217  * my_yyinput
02218  *
02219  * Lexer will ask this function for input when it requires more.
02220  *
02221  **********************************************************************/
02222 int my_yyinput(char *buf, int max_size)
02223 {
02224         int rest, n;
02225 
02226         rest = sqlpStmt->stmt + strlen( sqlpStmt->stmt) - sqlpStmt->cur;
02227         n = ( max_size < rest ? max_size : rest );
02228 
02229         if ( n > 0 )
02230         {
02231                 memcpy( buf, sqlpStmt->cur, n );
02232                 sqlpStmt->cur += n;
02233         }
02234                 
02235         return n;               
02236 }
02237 
02238 /**********************************************************************
02239  * yyerror
02240  *
02241  * This should be called just before failing. It formats a meaningfull
02242  * message and deposits it in a usefull place.
02243  *
02244  **********************************************************************/
02245 void yyerror( char *s )
02246 {
02247         snprintf( sqlpStmt->errmsg, 500, "%s processing '%s'", s, yytext );
02248 
02249 #ifdef YY_CURRENT_BUFFER        
02250         yy_flush_buffer(YY_CURRENT_BUFFER);
02251 #endif
02252 
02253 }
02254 
02255 /**********************************************************************
02256  * yywrap
02257  *
02258  * We are not doing any buffer switching but lets not use the Flex version of
02259  * of this func anyway so we can avoid the link dependency.
02260  *
02261  **********************************************************************/
02262 int yywrap()
02263 {
02264         return 1;
02265 }
02266 
02267 

Generated on Sun Apr 6 17:31:38 2008 for GRASS by  doxygen 1.5.5