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

Generated on Fri Nov 21 11:01:50 2008 for GRASS by  doxygen 1.5.1