Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

AtomLexer.C

Go to the documentation of this file.
00001 /* A lexical scanner generated by flex */
00002 
00003 /* Scanner skeleton version:
00004  * $Header: /home/cvs/vmd/cvsroot/vmd/src/AtomLexer.C,v 1.13 2008/03/27 19:36:34 johns Exp $
00005  */
00006 
00007 #define FLEX_SCANNER
00008 #define YY_FLEX_MAJOR_VERSION 2
00009 #define YY_FLEX_MINOR_VERSION 5
00010 
00011 #include <stdio.h>
00012 
00013 
00014 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
00015 #ifdef c_plusplus
00016 #ifndef __cplusplus
00017 #define __cplusplus
00018 #endif
00019 #endif
00020 
00021 
00022 #ifdef __cplusplus
00023 
00024 #include <stdlib.h>
00025 // #include <unistd.h>
00026 
00027 /* Use prototypes in function declarations. */
00028 #define YY_USE_PROTOS
00029 
00030 /* The "const" storage-class-modifier is valid. */
00031 #define YY_USE_CONST
00032 
00033 #else   /* ! __cplusplus */
00034 
00035 #if 1
00036 // #if __STDC__
00037 
00038 #define YY_USE_PROTOS
00039 #define YY_USE_CONST
00040 
00041 #endif  /* __STDC__ */
00042 #endif  /* ! __cplusplus */
00043 
00044 #ifdef __TURBOC__
00045  #pragma warn -rch
00046  #pragma warn -use
00047 #include <io.h>
00048 #include <stdlib.h>
00049 #define YY_USE_CONST
00050 #define YY_USE_PROTOS
00051 #endif
00052 
00053 #ifdef YY_USE_CONST
00054 #define yyconst const
00055 #else
00056 #define yyconst
00057 #endif
00058 
00059 
00060 #ifdef YY_USE_PROTOS
00061 #define YY_PROTO(proto) proto
00062 #else
00063 #define YY_PROTO(proto) ()
00064 #endif
00065 
00066 /* Returned upon end-of-file. */
00067 #define YY_NULL 0
00068 
00069 /* Promotes a possibly negative, possibly signed char to an unsigned
00070  * integer for use as an array index.  If the signed char is negative,
00071  * we want to instead treat it as an 8-bit unsigned char, hence the
00072  * double cast.
00073  */
00074 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00075 
00076 /* Enter a start condition.  This macro really ought to take a parameter,
00077  * but we do it the disgusting crufty way forced on us by the ()-less
00078  * definition of BEGIN.
00079  */
00080 #define BEGIN yy_start = 1 + 2 *
00081 
00082 /* Translate the current start state into a value that can be later handed
00083  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00084  * compatibility.
00085  */
00086 #define YY_START ((yy_start - 1) / 2)
00087 #define YYSTATE YY_START
00088 
00089 /* Action number for EOF rule of a given start state. */
00090 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00091 
00092 /* Special action meaning "start processing a new file". */
00093 #define YY_NEW_FILE yyrestart( yyin )
00094 
00095 #define YY_END_OF_BUFFER_CHAR 0
00096 
00097 /* Size of default input buffer. */
00098 #define YY_BUF_SIZE 16384
00099 
00100 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00101 
00102 extern int yyleng;
00103 extern FILE *yyin, *yyout;
00104 
00105 #define EOB_ACT_CONTINUE_SCAN 0
00106 #define EOB_ACT_END_OF_FILE 1
00107 #define EOB_ACT_LAST_MATCH 2
00108 
00109 /* The funky do-while in the following #define is used to turn the definition
00110  * int a single C statement (which needs a semi-colon terminator).  This
00111  * avoids problems with code like:
00112  *
00113  *      if ( condition_holds )
00114  *              yyless( 5 );
00115  *      else
00116  *              do_something_else();
00117  *
00118  * Prior to using the do-while the compiler would get upset at the
00119  * "else" because it interpreted the "if" statement as being all
00120  * done when it reached the ';' after the yyless() call.
00121  */
00122 
00123 /* Return all but the first 'n' matched characters back to the input stream. */
00124 
00125 #define yyless(n) \
00126         do \
00127                 { \
00128                 /* Undo effects of setting up yytext. */ \
00129                 *yy_cp = yy_hold_char; \
00130                 YY_RESTORE_YY_MORE_OFFSET \
00131                 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
00132                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
00133                 } \
00134         while ( 0 )
00135 
00136 #define unput(c) yyunput( c, yytext_ptr )
00137 
00138 /* The following is because we cannot portably get our hands on size_t
00139  * (without autoconf's help, which isn't available because we want
00140  * flex-generated scanners to compile on their own).
00141  */
00142 typedef unsigned int yy_size_t;
00143 
00144 
00145 struct yy_buffer_state
00146         {
00147         FILE *yy_input_file;
00148 
00149         char *yy_ch_buf;                /* input buffer */
00150         char *yy_buf_pos;               /* current position in input buffer */
00151 
00152         /* Size of input buffer in bytes, not including room for EOB
00153          * characters.
00154          */
00155         yy_size_t yy_buf_size;
00156 
00157         /* Number of characters read into yy_ch_buf, not including EOB
00158          * characters.
00159          */
00160         int yy_n_chars;
00161 
00162         /* Whether we "own" the buffer - i.e., we know we created it,
00163          * and can realloc() it to grow it, and should free() it to
00164          * delete it.
00165          */
00166         int yy_is_our_buffer;
00167 
00168         /* Whether this is an "interactive" input source; if so, and
00169          * if we're using stdio for input, then we want to use getc()
00170          * instead of fread(), to make sure we stop fetching input after
00171          * each newline.
00172          */
00173         int yy_is_interactive;
00174 
00175         /* Whether we're considered to be at the beginning of a line.
00176          * If so, '^' rules will be active on the next match, otherwise
00177          * not.
00178          */
00179         int yy_at_bol;
00180 
00181         /* Whether to try to fill the input buffer when we reach the
00182          * end of it.
00183          */
00184         int yy_fill_buffer;
00185 
00186         int yy_buffer_status;
00187 #define YY_BUFFER_NEW 0
00188 #define YY_BUFFER_NORMAL 1
00189         /* When an EOF's been seen but there's still some text to process
00190          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00191          * shouldn't try reading from the input source any more.  We might
00192          * still have a bunch of tokens to match, though, because of
00193          * possible backing-up.
00194          *
00195          * When we actually see the EOF, we change the status to "new"
00196          * (via yyrestart()), so that the user can continue scanning by
00197          * just pointing yyin at a new input file.
00198          */
00199 #define YY_BUFFER_EOF_PENDING 2
00200         };
00201 
00202 static YY_BUFFER_STATE yy_current_buffer = 0;
00203 
00204 /* We provide macros for accessing buffer states in case in the
00205  * future we want to put the buffer states in a more general
00206  * "scanner state".
00207  */
00208 #define YY_CURRENT_BUFFER yy_current_buffer
00209 
00210 
00211 /* yy_hold_char holds the character lost when yytext is formed. */
00212 static char yy_hold_char;
00213 
00214 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
00215 
00216 
00217 int yyleng;
00218 
00219 /* Points to current character in buffer. */
00220 static char *yy_c_buf_p = (char *) 0;
00221 static int yy_init = 1;         /* whether we need to initialize */
00222 static int yy_start = 0;        /* start state number */
00223 
00224 /* Flag which is used to allow yywrap()'s to do buffer switches
00225  * instead of setting up a fresh yyin.  A bit of a hack ...
00226  */
00227 static int yy_did_buffer_switch_on_eof;
00228 
00229 void yyrestart YY_PROTO(( FILE *input_file ));
00230 
00231 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
00232 void yy_load_buffer_state YY_PROTO(( void ));
00233 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
00234 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00235 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
00236 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00237 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
00238 
00239 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
00240 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
00241 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
00242 
00243 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
00244 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
00245 static void yy_flex_free YY_PROTO(( void * ));
00246 
00247 #define yy_new_buffer yy_create_buffer
00248 
00249 #define yy_set_interactive(is_interactive) \
00250         { \
00251         if ( ! yy_current_buffer ) \
00252                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00253         yy_current_buffer->yy_is_interactive = is_interactive; \
00254         }
00255 
00256 #define yy_set_bol(at_bol) \
00257         { \
00258         if ( ! yy_current_buffer ) \
00259                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00260         yy_current_buffer->yy_at_bol = at_bol; \
00261         }
00262 
00263 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
00264 
00265 typedef unsigned char YY_CHAR;
00266 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
00267 typedef int yy_state_type;
00268 extern char *yytext;
00269 #define yytext_ptr yytext
00270 
00271 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
00272 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
00273 static int yy_get_next_buffer YY_PROTO(( void ));
00274 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
00275 
00276 /* Done after the current pattern has been matched and before the
00277  * corresponding action - sets up yytext.
00278  */
00279 #define YY_DO_BEFORE_ACTION \
00280         yytext_ptr = yy_bp; \
00281         yyleng = (int) (yy_cp - yy_bp); \
00282         yy_hold_char = *yy_cp; \
00283         *yy_cp = '\0'; \
00284         yy_c_buf_p = yy_cp;
00285 
00286 #define YY_NUM_RULES 46
00287 #define YY_END_OF_BUFFER 47
00288 static yyconst short int yy_accept[122] =
00289     {   0,
00290         0,    0,   47,   45,   41,   41,   45,   18,   44,   38,
00291        45,   19,    2,    3,   37,   34,   35,   45,   36,   43,
00292        15,   20,   23,   25,   44,   44,   39,   44,   44,   44,
00293        44,   44,   44,   44,   44,   44,   44,   45,   26,   18,
00294        16,   18,   44,    4,   19,   17,   19,   40,    0,    1,
00295        42,    1,   43,   21,   22,   33,   24,   44,   42,   44,
00296        44,   44,   12,   29,   44,   30,   31,   28,   27,   32,
00297        44,   10,    5,   44,   44,   13,   44,   44,    5,   16,
00298        18,   17,   19,   13,    0,   42,   42,   42,   42,    4,
00299        44,    6,   44,   44,   44,   44,    0,    0,    0,    0,
00300 
00301         0,    1,   44,   44,   11,   44,   44,    0,    0,   44,
00302        44,   14,   44,   44,   44,    7,   44,   44,    8,    9,
00303         0
00304     } ;
00305 
00306 static yyconst int yy_ec[256] =
00307     {   0,
00308         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00309         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00310         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00311         1,    2,    4,    5,    1,    6,    7,    8,    9,   10,
00312        11,   12,   13,    1,   14,   15,   16,   17,   17,   17,
00313        17,   17,   17,   17,   17,   17,   17,   18,    1,   19,
00314        20,   21,    1,   22,   23,   23,   23,   23,   24,   23,
00315        23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
00316        23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
00317         1,   25,    1,   26,   23,    1,   27,   28,   23,   29,
00318 
00319        30,   31,   32,   33,   34,   23,   23,   35,   36,   37,
00320        38,   39,   40,   41,   42,   43,   23,   23,   44,   45,
00321        23,   23,   46,   47,   48,   49,    1,    1,    1,    1,
00322         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00323         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00324         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00325         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00326         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00327         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00328         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00329 
00330         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00331         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00332         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00333         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00334         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00335         1,    1,    1,    1,    1
00336     } ;
00337 
00338 static yyconst int yy_meta[50] =
00339     {   0,
00340         1,    1,    1,    1,    2,    1,    1,    1,    2,    1,
00341         1,    1,    1,    1,    3,    1,    4,    1,    1,    1,
00342         1,    1,    4,    4,    1,    1,    4,    4,    4,    4,
00343         4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
00344         4,    4,    4,    4,    4,    1,    1,    1,    1
00345     } ;
00346 
00347 static yyconst short int yy_base[134] =
00348     {   0,
00349         0,    0,  275,  291,  291,  291,  252,   45,    0,  291,
00350       261,   42,  291,  291,  242,  291,  291,   37,  291,   38,
00351       291,  233,   36,  232,    0,   52,  291,   54,   35,   36,
00352        44,   46,   58,   64,   66,   60,   76,  183,  291,   57,
00353       291,   89,    0,  291,   95,  291,   96,  291,  207,   95,
00354       187,  160,   43,  291,  291,  291,  291,    0,   59,  102,
00355        80,   86,   87,   89,   90,   93,   96,   99,  100,  102,
00356       103,  106,  110,  112,  121,  113,  123,  124,  291,  146,
00357       154,  153,  155,  291,  155,  158,    0,  165,    0,  139,
00358       148,  146,  150,  156,  154,  164,  184,  189,  190,  191,
00359 
00360       156,   99,  165,  168,  175,  183,  184,  198,  210,  191,
00361       194,  192,  195,  204,  205,  203,  206,  207,  213,  214,
00362       291,  256,   86,  260,  263,   61,  266,  269,  272,  275,
00363       279,  283,  286
00364     } ;
00365 
00366 static yyconst short int yy_def[134] =
00367     {   0,
00368       121,    1,  121,  121,  121,  121,  121,  122,  123,  121,
00369       121,  124,  121,  121,  121,  121,  121,  121,  121,  125,
00370       121,  121,  121,  121,  126,  127,  121,  127,   28,   28,
00371        28,   28,   28,   28,   28,   28,   28,  121,  121,  122,
00372       121,  122,  123,  121,  124,  121,  124,  121,  121,  121,
00373       128,  121,  125,  121,  121,  121,  121,  126,  129,  130,
00374        28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
00375        28,   28,   28,   28,   28,   28,   28,   28,  121,  131,
00376       122,  132,  124,  121,  121,  128,  133,  129,  129,   28,
00377        28,   28,   28,   28,   28,   28,  131,  131,  132,  132,
00378 
00379       121,  121,   28,   28,   28,   28,   28,  131,  132,   28,
00380        28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
00381         0,  121,  121,  121,  121,  121,  121,  121,  121,  121,
00382       121,  121,  121
00383     } ;
00384 
00385 static yyconst short int yy_nxt[341] =
00386     {   0,
00387         4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
00388        14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
00389        24,   25,   26,   26,    4,   27,   28,   26,   26,   29,
00390        26,   30,   26,   26,   31,   26,   32,   33,   34,   26,
00391        26,   35,   36,   37,   26,   13,   38,   14,    4,   41,
00392        46,   49,   52,   50,   53,   55,   59,   52,   59,   53,
00393        59,   41,   59,   88,   58,   66,   47,   88,   60,   42,
00394        60,   61,   61,   68,   64,   70,   61,   61,   67,   65,
00395        61,   42,   61,   71,   56,   61,   69,   61,   72,   43,
00396        62,   74,   75,   80,   61,   63,   61,   76,   73,   61,
00397 
00398        61,   61,   61,   46,   82,   61,   59,   61,   77,   78,
00399        59,   50,   61,   81,   90,  102,   61,   61,   85,   47,
00400        83,   61,   61,   61,   85,   61,   61,   61,   61,   61,
00401        61,   61,   61,   91,   61,   61,   61,   61,   61,   61,
00402        61,   61,   61,   61,   61,   92,   61,   61,   61,   61,
00403        41,   61,   95,   61,   61,   93,   94,   61,   80,   61,
00404        61,   46,   61,   82,   61,   61,   96,  101,  101,   88,
00405        98,  102,  102,   88,   87,   61,   50,  100,   81,   83,
00406        61,  103,   61,  104,   61,  105,   61,   61,   41,   61,
00407        61,   61,   61,   80,  106,   61,  107,   61,   46,   82,
00408 
00409        61,   61,   80,   87,   61,   61,   61,  110,   98,   61,
00410       111,   61,  112,  108,  100,  109,   61,  113,   82,   61,
00411        61,   84,  108,  114,   61,   61,  115,   61,   61,   79,
00412        61,  116,   61,   61,  109,   61,   61,  117,  118,   61,
00413        61,   61,  119,  120,   61,   61,   61,   61,   61,   61,
00414        61,   57,   54,   48,   61,   61,   40,   40,   40,   40,
00415        45,   45,   45,   45,   51,   51,   51,   61,   44,   61,
00416        86,   39,   86,   89,  121,   89,   60,  121,   60,   97,
00417        97,   97,   97,   99,   99,   99,   99,   87,  121,   87,
00418         3,  121,  121,  121,  121,  121,  121,  121,  121,  121,
00419 
00420       121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
00421       121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
00422       121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
00423       121,  121,  121,  121,  121,  121,  121,  121,  121,  121
00424     } ;
00425 
00426 static yyconst short int yy_chk[341] =
00427     {   0,
00428         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00429         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00430         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00431         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00432         1,    1,    1,    1,    1,    1,    1,    1,    1,    8,
00433        12,   18,   20,   18,   20,   23,   26,   53,   28,   53,
00434        26,   40,   28,   59,  126,   30,   12,   59,   26,    8,
00435        28,   29,   30,   31,   29,   32,   29,   30,   30,   29,
00436        31,   40,   32,   32,   23,   31,   31,   32,   33,  123,
00437        28,   34,   35,   42,   33,   28,   36,   36,   33,   33,
00438 
00439        34,   36,   35,   45,   47,   34,   60,   35,   37,   37,
00440        60,   50,   37,   42,   62,  102,   61,   37,   50,   45,
00441        47,   61,   62,   63,   50,   64,   65,   62,   63,   66,
00442        64,   65,   67,   65,   66,   68,   69,   67,   70,   71,
00443        68,   69,   72,   70,   71,   71,   73,   72,   74,   76,
00444        80,   73,   77,   74,   76,   74,   75,   75,   81,   77,
00445        78,   82,   75,   83,   77,   78,   78,   85,   85,   88,
00446        80,   85,  101,   88,   86,   90,   52,   82,   81,   83,
00447        90,   91,   92,   93,   91,   94,   93,   92,   97,   91,
00448        95,   93,   94,   98,   95,   95,   96,   94,   99,  100,
00449 
00450        96,  103,  108,   51,  104,   96,  103,  103,   97,  104,
00451       104,  105,  106,   98,   99,  100,  105,  107,  109,  106,
00452       107,   49,  108,  110,  106,  107,  111,  110,  112,   38,
00453       111,  113,  110,  112,  109,  111,  113,  114,  115,  116,
00454       114,  115,  117,  118,  116,  114,  115,  117,  118,  119,
00455       120,   24,   22,   15,  119,  120,  122,  122,  122,  122,
00456       124,  124,  124,  124,  125,  125,  125,  127,   11,  127,
00457       128,    7,  128,  129,    3,  129,  130,    0,  130,  131,
00458       131,  131,  131,  132,  132,  132,  132,  133,    0,  133,
00459       121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
00460 
00461       121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
00462       121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
00463       121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
00464       121,  121,  121,  121,  121,  121,  121,  121,  121,  121
00465     } ;
00466 
00467 static yy_state_type yy_last_accepting_state;
00468 static char *yy_last_accepting_cpos;
00469 
00470 /* The intent behind this definition is that it'll catch
00471  * any uses of REJECT which flex missed.
00472  */
00473 #define REJECT reject_used_but_not_detected
00474 #define yymore() yymore_used_but_not_detected
00475 #define YY_MORE_ADJ 0
00476 #define YY_RESTORE_YY_MORE_OFFSET
00477 char *yytext;
00478 #line 1 "AtomLexer.l"
00479 #define INITIAL 0
00480 #line 3 "AtomLexer.l"
00481 
00482 
00483 /***************************************************************************
00484  *cr                                                                       
00485  *cr            (C) Copyright 1995-2008 The Board of Trustees of the           
00486  *cr                        University of Illinois                       
00487  *cr                         All Rights Reserved                        
00488  *cr                                                                   
00489  ***************************************************************************/
00490 
00491 /***************************************************************************
00492  * RCS INFORMATION:
00493  *
00494  *      $RCSfile: AtomLexer.C,v $
00495  *      $Author: johns $        $Locker:  $             $State: Exp $
00496  *      $Revision: 1.13 $       $Date: 2008/03/27 19:36:34 $
00497  *
00498  ***************************************************************************
00499  * DESCRIPTION:
00500  *
00501  * break atom selection information into its tokens
00502  *
00503  ***************************************************************************/
00504 
00505 
00506 // Avoid compilation problems on Redhat Linux 7.x and Windows.
00507 #define YY_ALWAYS_INTERACTIVE 1
00508 
00509 #include <stdlib.h>
00510 
00511 #if defined(ARCH_AIX4) || defined(ARCH_AIX3)
00512 #include <strings.h>
00513 #else
00514 #include <string.h>
00515 #endif
00516 
00517 #include "AtomParser.h"
00518 #include "y.tab.h"
00519 #include "Inform.h"
00520 #include "SymbolTable.h"
00521 
00522 /* redefine the input to come from a string */
00523 #undef input
00524 #undef unput
00525 #if 1
00526 #define YY_DECL extern "C" int yylex YY_PROTO(( void ))
00527 
00528 // this was compiled with flex, so I need a different input mechanism
00529 #undef YY_INPUT
00530 #define YY_INPUT(buf,result,max) { \
00531         int c = *atomparser_yystring; \
00532         result = (c == 0) ? YY_NULL : \
00533         (buf[0] = c, atomparser_yystring++, 1); \
00534 }
00535 #else
00536 // XXX Alternate input/unput routines, no longer used.
00537 #define input() (*atomparser_yystring++)
00538 #define unput(c) (*--atomparser_yystring = c)
00539 #endif
00540 
00541 /* Native Solaris lex has its own way of getting input when */
00542 /* using C++; lex_input() */
00543 #if 0
00544 //#if defined(ARCH_SOLARIS2) || defined(ARCH_SOLARIS2_64) || defined(ARCH_SOLARISX86)
00545 #undef lex_input
00546 #define lex_input() input()
00547 #endif
00548 
00549 /* Also, GCC on Solaris, and Sun C++ 5.x put "all" in read-only memory */
00550 /* which causes unput to core dump without this special case.          */
00551 /* This may also be a problem for other platforms, don't know yet      */
00552 #if defined(ARCH_SOLARIS2) || defined(ARCH_SOLARIS2_64) || defined(ARCH_SOLARISX86)
00553 #undef unput
00554 #define unput lex_unput_only_if_needed
00555 
00556 int lex_unput_only_if_needed(int c) {
00557   atomparser_yystring--;
00558   if (c != *atomparser_yystring) {
00559     *atomparser_yystring = c;
00560   }
00561   return c;
00562 }
00563 #endif
00564 
00565 #line 95 "AtomLexer.l"
00566  /* like_1A  catches raw words like 1A, 3', 5*A
00567                 (start with a number and contain an alpha or ', ", or *)
00568     like_C5' catches ones like C5' O*, O5*
00569                 (starts with an alpha and has a ', ", or *)
00570   */
00571  /*  Problem is that * is too easy to confuse, eg, "x* x"
00572    I won't worry about this until the next rewrite and only allow
00573    primes
00574 wierd           [\'\"\*]
00575   */
00576 
00577 #line 577 "lex.yy.c"
00578 
00579 /* Macros after this point can all be overridden by user definitions in
00580  * section 1.
00581  */
00582 
00583 #ifndef YY_SKIP_YYWRAP
00584 #ifdef __cplusplus
00585 extern "C" int yywrap YY_PROTO(( void ));
00586 #else
00587 extern int yywrap YY_PROTO(( void ));
00588 #endif
00589 #endif
00590 
00591 #ifndef YY_NO_UNPUT
00592 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
00593 #endif
00594 
00595 #ifndef yytext_ptr
00596 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
00597 #endif
00598 
00599 #ifdef YY_NEED_STRLEN
00600 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
00601 #endif
00602 
00603 #ifndef YY_NO_INPUT
00604 #ifdef __cplusplus
00605 static int yyinput YY_PROTO(( void ));
00606 #else
00607 static int input YY_PROTO(( void ));
00608 #endif
00609 #endif
00610 
00611 #if YY_STACK_USED
00612 static int yy_start_stack_ptr = 0;
00613 static int yy_start_stack_depth = 0;
00614 static int *yy_start_stack = 0;
00615 #ifndef YY_NO_PUSH_STATE
00616 static void yy_push_state YY_PROTO(( int new_state ));
00617 #endif
00618 #ifndef YY_NO_POP_STATE
00619 static void yy_pop_state YY_PROTO(( void ));
00620 #endif
00621 #ifndef YY_NO_TOP_STATE
00622 static int yy_top_state YY_PROTO(( void ));
00623 #endif
00624 
00625 #else
00626 #define YY_NO_PUSH_STATE 1
00627 #define YY_NO_POP_STATE 1
00628 #define YY_NO_TOP_STATE 1
00629 #endif
00630 
00631 #ifdef YY_MALLOC_DECL
00632 YY_MALLOC_DECL
00633 #else
00634 #if __STDC__
00635 #ifndef __cplusplus
00636 #include <stdlib.h>
00637 #endif
00638 #else
00639 /* Just try to get by without declaring the routines.  This will fail
00640  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
00641  * or sizeof(void*) != sizeof(int).
00642  */
00643 #endif
00644 #endif
00645 
00646 /* Amount of stuff to slurp up with each read. */
00647 #ifndef YY_READ_BUF_SIZE
00648 #define YY_READ_BUF_SIZE 8192
00649 #endif
00650 
00651 /* Copy whatever the last rule matched to the standard output. */
00652 
00653 #ifndef ECHO
00654 /* This used to be an fputs(), but since the string might contain NUL's,
00655  * we now use fwrite().
00656  */
00657 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
00658 #endif
00659 
00660 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00661  * is returned in "result".
00662  */
00663 #ifndef YY_INPUT
00664 #define YY_INPUT(buf,result,max_size) \
00665         if ( yy_current_buffer->yy_is_interactive ) \
00666                 { \
00667                 int c = '*', n; \
00668                 for ( n = 0; n < max_size && \
00669                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00670                         buf[n] = (char) c; \
00671                 if ( c == '\n' ) \
00672                         buf[n++] = (char) c; \
00673                 if ( c == EOF && ferror( yyin ) ) \
00674                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
00675                 result = n; \
00676                 } \
00677         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
00678                   && ferror( yyin ) ) \
00679                 YY_FATAL_ERROR( "input in flex scanner failed" );
00680 #endif
00681 
00682 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00683  * we don't want an extra ';' after the "return" because that will cause
00684  * some compilers to complain about unreachable statements.
00685  */
00686 #ifndef yyterminate
00687 #define yyterminate() return YY_NULL
00688 #endif
00689 
00690 /* Number of entries by which start-condition stack grows. */
00691 #ifndef YY_START_STACK_INCR
00692 #define YY_START_STACK_INCR 25
00693 #endif
00694 
00695 /* Report a fatal error. */
00696 #ifndef YY_FATAL_ERROR
00697 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00698 #endif
00699 
00700 /* Default declaration of generated scanner - a define so the user can
00701  * easily add parameters.
00702  */
00703 #ifndef YY_DECL
00704 #define YY_DECL int yylex YY_PROTO(( void ))
00705 #endif
00706 
00707 /* Code executed at the beginning of each rule, after yytext and yyleng
00708  * have been set up.
00709  */
00710 #ifndef YY_USER_ACTION
00711 #define YY_USER_ACTION
00712 #endif
00713 
00714 /* Code executed at the end of each rule. */
00715 #ifndef YY_BREAK
00716 #define YY_BREAK break;
00717 #endif
00718 
00719 #define YY_RULE_SETUP \
00720         YY_USER_ACTION
00721 
00722 YY_DECL
00723         {
00724         register yy_state_type yy_current_state;
00725         register char *yy_cp, *yy_bp;
00726         register int yy_act;
00727 
00728 #line 112 "AtomLexer.l"
00729 
00730 #line 730 "lex.yy.c"
00731 
00732         if ( yy_init )
00733                 {
00734                 yy_init = 0;
00735 
00736 #ifdef YY_USER_INIT
00737                 YY_USER_INIT;
00738 #endif
00739 
00740                 if ( ! yy_start )
00741                         yy_start = 1;   /* first start state */
00742 
00743                 if ( ! yyin )
00744                         yyin = stdin;
00745 
00746                 if ( ! yyout )
00747                         yyout = stdout;
00748 
00749                 if ( ! yy_current_buffer )
00750                         yy_current_buffer =
00751                                 yy_create_buffer( yyin, YY_BUF_SIZE );
00752 
00753                 yy_load_buffer_state();
00754                 }
00755 
00756         while ( 1 )             /* loops until end-of-file is reached */
00757                 {
00758                 yy_cp = yy_c_buf_p;
00759 
00760                 /* Support of yytext. */
00761                 *yy_cp = yy_hold_char;
00762 
00763                 /* yy_bp points to the position in yy_ch_buf of the start of
00764                  * the current run.
00765                  */
00766                 yy_bp = yy_cp;
00767 
00768                 yy_current_state = yy_start;
00769 yy_match:
00770                 do
00771                         {
00772                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00773                         if ( yy_accept[yy_current_state] )
00774                                 {
00775                                 yy_last_accepting_state = yy_current_state;
00776                                 yy_last_accepting_cpos = yy_cp;
00777                                 }
00778                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00779                                 {
00780                                 yy_current_state = (int) yy_def[yy_current_state];
00781                                 if ( yy_current_state >= 122 )
00782                                         yy_c = yy_meta[(unsigned int) yy_c];
00783                                 }
00784                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00785                         ++yy_cp;
00786                         }
00787                 while ( yy_base[yy_current_state] != 291 );
00788 
00789 yy_find_action:
00790                 yy_act = yy_accept[yy_current_state];
00791                 if ( yy_act == 0 )
00792                         { /* have to back up */
00793                         yy_cp = yy_last_accepting_cpos;
00794                         yy_current_state = yy_last_accepting_state;
00795                         yy_act = yy_accept[yy_current_state];
00796                         }
00797 
00798                 YY_DO_BEFORE_ACTION;
00799 
00800 
00801 do_action:      /* This label is used only to access EOF actions. */
00802 
00803 
00804                 switch ( yy_act )
00805         { /* beginning of action switch */
00806                         case 0: /* must back up */
00807                         /* undo the effects of YY_DO_BEFORE_ACTION */
00808                         *yy_cp = yy_hold_char;
00809                         yy_cp = yy_last_accepting_cpos;
00810                         yy_current_state = yy_last_accepting_state;
00811                         goto yy_find_action;
00812 
00813 case 1:
00814 YY_RULE_SETUP
00815 #line 113 "AtomLexer.l"
00816 {
00817                   yylval.dval = atof((char *) yytext);
00818                   return(FLOAT);
00819                 }
00820         YY_BREAK
00821 case 2:
00822 YY_RULE_SETUP
00823 #line 117 "AtomLexer.l"
00824 { return('('); /* allow '(' and '{' */ }
00825         YY_BREAK
00826 case 3:
00827 YY_RULE_SETUP
00828 #line 118 "AtomLexer.l"
00829 { return(')'); /* allow ')' and '}' */ }
00830         YY_BREAK
00831 case 4:
00832 YY_RULE_SETUP
00833 #line 119 "AtomLexer.l"
00834 { return(AND);}
00835         YY_BREAK
00836 case 5:
00837 YY_RULE_SETUP
00838 #line 120 "AtomLexer.l"
00839 { return(OR);}
00840         YY_BREAK
00841 case 6:
00842 YY_RULE_SETUP
00843 #line 121 "AtomLexer.l"
00844 { return(NOT);}
00845         YY_BREAK
00846 case 7:
00847 YY_RULE_SETUP
00848 #line 122 "AtomLexer.l"
00849 { return(WITHIN);}
00850         YY_BREAK
00851 case 8:
00852 YY_RULE_SETUP
00853 #line 123 "AtomLexer.l"
00854 { return(EXWITHIN);}
00855         YY_BREAK
00856 case 9:
00857 YY_RULE_SETUP
00858 #line 124 "AtomLexer.l"
00859 { return(PBWITHIN);}
00860         YY_BREAK
00861 case 10:
00862 YY_RULE_SETUP
00863 #line 125 "AtomLexer.l"
00864 { return(OF);}
00865         YY_BREAK
00866 case 11:
00867 YY_RULE_SETUP
00868 #line 126 "AtomLexer.l"
00869 { return(SAME);}
00870         YY_BREAK
00871 case 12:
00872 YY_RULE_SETUP
00873 #line 127 "AtomLexer.l"
00874 { return(AS);}
00875         YY_BREAK
00876 case 13:
00877 YY_RULE_SETUP
00878 #line 128 "AtomLexer.l"
00879 { return(THROUGH);}
00880         YY_BREAK
00881 case 14:
00882 YY_RULE_SETUP
00883 #line 129 "AtomLexer.l"
00884 { return(WHERE);}
00885         YY_BREAK
00886 case 15:
00887 YY_RULE_SETUP
00888 #line 131 "AtomLexer.l"
00889 { return(RANGE);}
00890         YY_BREAK
00891 case 16:
00892 YY_RULE_SETUP
00893 #line 132 "AtomLexer.l"
00894 { /* escapes \ and " in a "string"  */
00895                   yylval.node = new atomparser_node(WORD);
00896                   yylval.node->sele.s = ((char *) yytext)+1;
00897                   /* GNU needs a "chop" */
00898                   yylval.node->sele.s.chop(1);
00899                   /* replace \\ with \ */
00900                   yylval.node->sele.s.gsub("\\\"", "\"");
00901                   /* replace \" with " */
00902                   yylval.node->sele.s.gsub("\\\\", "\\");
00903                   yylval.node->sele.st = DQ_STRING;
00904                   return WORD;
00905                 }
00906         YY_BREAK
00907 case 17:
00908 YY_RULE_SETUP
00909 #line 144 "AtomLexer.l"
00910 { /* escapes \ and ' in a 'string', */
00911                   /* for instance, this lets you do 'C5\''  */
00912                   yylval.node = new atomparser_node(WORD);
00913                   yylval.node->sele.s = ((char *) yytext)+1;
00914                   /* GNU needs a "chop" */
00915                   yylval.node->sele.s.chop(1);
00916                   /* replace \' with ' */
00917                   yylval.node->sele.s.gsub("\\'", "'");
00918                   /* replace \\ with \ */
00919                   yylval.node->sele.s.gsub("\\\\", "\\");
00920                   yylval.node->sele.st = SQ_STRING;
00921                   return WORD;
00922                 }
00923         YY_BREAK
00924 case 18:
00925 YY_RULE_SETUP
00926 #line 157 "AtomLexer.l"
00927 {
00928                   msgErr << "Unterminated double quoted string: "
00929                            << (char *) yytext << sendmsg;
00930                   return ERROR;
00931                 }
00932         YY_BREAK
00933 case 19:
00934 YY_RULE_SETUP
00935 #line 162 "AtomLexer.l"
00936 {
00937                   msgErr << "Unterminated single quoted string: "
00938                            << (char *) yytext << sendmsg;
00939                   return ERROR;
00940                 }
00941         YY_BREAK
00942 case 20:
00943 YY_RULE_SETUP
00944 #line 168 "AtomLexer.l"
00945 { return(NLT); /* these are for numeric comparisons */}
00946         YY_BREAK
00947 case 21:
00948 YY_RULE_SETUP
00949 #line 169 "AtomLexer.l"
00950 { return(NLE);}
00951         YY_BREAK
00952 case 22:
00953 YY_RULE_SETUP
00954 #line 170 "AtomLexer.l"
00955 { return(NEQ);}
00956         YY_BREAK
00957 case 23:
00958 YY_RULE_SETUP
00959 #line 171 "AtomLexer.l"
00960 { return(NEQ); /* many people use it */}
00961         YY_BREAK
00962 case 24:
00963 YY_RULE_SETUP
00964 #line 172 "AtomLexer.l"
00965 { return(NGE);}
00966         YY_BREAK
00967 case 25:
00968 YY_RULE_SETUP
00969 #line 173 "AtomLexer.l"
00970 { return(NGT);}
00971         YY_BREAK
00972 case 26:
00973 YY_RULE_SETUP
00974 #line 174 "AtomLexer.l"
00975 { return(NNE);}
00976         YY_BREAK
00977 case 27:
00978 YY_RULE_SETUP
00979 #line 176 "AtomLexer.l"
00980 { return(SLT); /* these are for string comparisons */}
00981         YY_BREAK
00982 case 28:
00983 YY_RULE_SETUP
00984 #line 177 "AtomLexer.l"
00985 { return(SLE);}
00986         YY_BREAK
00987 case 29:
00988 YY_RULE_SETUP
00989 #line 178 "AtomLexer.l"
00990 { return(SEQ);}
00991         YY_BREAK
00992 case 30:
00993 YY_RULE_SETUP
00994 #line 179 "AtomLexer.l"
00995 { return(SGE);}
00996         YY_BREAK
00997 case 31:
00998 YY_RULE_SETUP
00999 #line 180 "AtomLexer.l"
01000 { return(SGT);}
01001         YY_BREAK
01002 case 32:
01003 YY_RULE_SETUP
01004 #line 181 "AtomLexer.l"
01005 { return(SNE);}
01006         YY_BREAK
01007 case 33:
01008 YY_RULE_SETUP
01009 #line 182 "AtomLexer.l"
01010 { return(MATCH);}
01011         YY_BREAK
01012 case 34:
01013 YY_RULE_SETUP
01014 #line 184 "AtomLexer.l"
01015 { return(ADD);}
01016         YY_BREAK
01017 case 35:
01018 YY_RULE_SETUP
01019 #line 185 "AtomLexer.l"
01020 { return(SUB);}
01021         YY_BREAK
01022 case 36:
01023 YY_RULE_SETUP
01024 #line 186 "AtomLexer.l"
01025 { return(DIV);}
01026         YY_BREAK
01027 case 37:
01028 YY_RULE_SETUP
01029 #line 187 "AtomLexer.l"
01030 { return(MULT);}
01031         YY_BREAK
01032 case 38:
01033 YY_RULE_SETUP
01034 #line 188 "AtomLexer.l"
01035 { return(MOD);}
01036         YY_BREAK
01037 case 39:
01038 YY_RULE_SETUP
01039 #line 189 "AtomLexer.l"
01040 { return(EXP);}
01041         YY_BREAK
01042 case 40:
01043 YY_RULE_SETUP
01044 #line 190 "AtomLexer.l"
01045 { return(EXP);}
01046         YY_BREAK
01047 case 41:
01048 YY_RULE_SETUP
01049 #line 192 "AtomLexer.l"
01050 ;
01051         YY_BREAK
01052 case 42:
01053 YY_RULE_SETUP
01054 #line 194 "AtomLexer.l"
01055 { /* catch raw names like: */
01056                   /* 5' 1A C4' 3'A           */
01057                   yylval.node = new atomparser_node(WORD);
01058                   yylval.node->sele.s = (char *) yytext;
01059                   yylval.node->sele.st = RAW_STRING;
01060                   return WORD;
01061                 }
01062         YY_BREAK
01063 case 43:
01064 YY_RULE_SETUP
01065 #line 201 "AtomLexer.l"
01066 { yylval.ival = atoi((char *) yytext); 
01067                   return(INT); 
01068                 }
01069         YY_BREAK
01070 case 44:
01071 YY_RULE_SETUP
01072 #line 204 "AtomLexer.l"
01073 {  
01074                        /* standard variable names */
01075                   yylval.node = new atomparser_node(WORD);
01076                   yylval.node->sele.s = (char *) yytext;
01077                   yylval.node->sele.st = RAW_STRING;
01078                   int len = strlen((char *) yytext);
01079                   int i;
01080                   if ((i= atomparser_yylookup((char *) yytext, len)) >= 0) {
01081                      yylval.node->extra_type = i;
01082                      if (atomparser_symbols->fctns.data(i)->is_a ==
01083                          SymbolTableElement::FUNCTION) {
01084                         yylval.node->node_type = FUNC;
01085                         return FUNC;
01086                      } else if (atomparser_symbols->fctns.data(i)->is_a ==
01087                                 SymbolTableElement::KEYWORD) {
01088                         yylval.node->node_type = KEY;
01089                         return KEY;
01090                      } else if (atomparser_symbols->fctns.data(i)->is_a ==
01091                                 SymbolTableElement::SINGLEWORD) {
01092                         yylval.node->node_type = SINGLE;
01093                         return SINGLE;
01094                      } else if (atomparser_symbols->fctns.data(i)->is_a ==
01095                                 SymbolTableElement::STRINGFCTN) {
01096                         yylval.node->node_type = STRFCTN;
01097                         return STRFCTN;
01098                      }
01099                   }
01100                   return WORD;
01101                 }
01102         YY_BREAK
01103 case 45:
01104 YY_RULE_SETUP
01105 #line 233 "AtomLexer.l"
01106 { msgErr << "Bad character:"
01107                          << int(*yytext) << ':'
01108                          << *yytext << sendmsg; 
01109                   return ERROR; 
01110                 }
01111         YY_BREAK
01112 case 46:
01113 YY_RULE_SETUP
01114 #line 238 "AtomLexer.l"
01115 ECHO;
01116         YY_BREAK
01117 #line 1117 "lex.yy.c"
01118 case YY_STATE_EOF(INITIAL):
01119         yyterminate();
01120 
01121         case YY_END_OF_BUFFER:
01122                 {
01123                 /* Amount of text matched not including the EOB char. */
01124                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
01125 
01126                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
01127                 *yy_cp = yy_hold_char;
01128                 YY_RESTORE_YY_MORE_OFFSET
01129 
01130                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
01131                         {
01132                         /* We're scanning a new file or input source.  It's
01133                          * possible that this happened because the user
01134                          * just pointed yyin at a new source and called
01135                          * yylex().  If so, then we have to assure
01136                          * consistency between yy_current_buffer and our
01137                          * globals.  Here is the right place to do so, because
01138                          * this is the first action (other than possibly a
01139                          * back-up) that will match for the new input source.
01140                          */
01141                         yy_n_chars = yy_current_buffer->yy_n_chars;
01142                         yy_current_buffer->yy_input_file = yyin;
01143                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
01144                         }
01145 
01146                 /* Note that here we test for yy_c_buf_p "<=" to the position
01147                  * of the first EOB in the buffer, since yy_c_buf_p will
01148                  * already have been incremented past the NUL character
01149                  * (since all states make transitions on EOB to the
01150                  * end-of-buffer state).  Contrast this with the test
01151                  * in input().
01152                  */
01153                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01154                         { /* This was really a NUL. */
01155                         yy_state_type yy_next_state;
01156 
01157                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
01158 
01159                         yy_current_state = yy_get_previous_state();
01160 
01161                         /* Okay, we're now positioned to make the NUL
01162                          * transition.  We couldn't have
01163                          * yy_get_previous_state() go ahead and do it
01164                          * for us because it doesn't know how to deal
01165                          * with the possibility of jamming (and we don't
01166                          * want to build jamming into it because then it
01167                          * will run more slowly).
01168                          */
01169 
01170                         yy_next_state = yy_try_NUL_trans( yy_current_state );
01171 
01172                         yy_bp = yytext_ptr + YY_MORE_ADJ;
01173 
01174                         if ( yy_next_state )
01175                                 {
01176                                 /* Consume the NUL. */
01177                                 yy_cp = ++yy_c_buf_p;
01178                                 yy_current_state = yy_next_state;
01179                                 goto yy_match;
01180                                 }
01181 
01182                         else
01183                                 {
01184                                 yy_cp = yy_c_buf_p;
01185                                 goto yy_find_action;
01186                                 }
01187                         }
01188 
01189                 else switch ( yy_get_next_buffer() )
01190                         {
01191                         case EOB_ACT_END_OF_FILE:
01192                                 {
01193                                 yy_did_buffer_switch_on_eof = 0;
01194 
01195                                 if ( yywrap() )
01196                                         {
01197                                         /* Note: because we've taken care in
01198                                          * yy_get_next_buffer() to have set up
01199                                          * yytext, we can now set up
01200                                          * yy_c_buf_p so that if some total
01201                                          * hoser (like flex itself) wants to
01202                                          * call the scanner after we return the
01203                                          * YY_NULL, it'll still work - another
01204                                          * YY_NULL will get returned.
01205                                          */
01206                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
01207 
01208                                         yy_act = YY_STATE_EOF(YY_START);
01209                                         goto do_action;
01210                                         }
01211 
01212                                 else
01213                                         {
01214                                         if ( ! yy_did_buffer_switch_on_eof )
01215                                                 YY_NEW_FILE;
01216                                         }
01217                                 break;
01218                                 }
01219 
01220                         case EOB_ACT_CONTINUE_SCAN:
01221                                 yy_c_buf_p =
01222                                         yytext_ptr + yy_amount_of_matched_text;
01223 
01224                                 yy_current_state = yy_get_previous_state();
01225 
01226                                 yy_cp = yy_c_buf_p;
01227                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
01228                                 goto yy_match;
01229 
01230                         case EOB_ACT_LAST_MATCH:
01231                                 yy_c_buf_p =
01232                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
01233 
01234                                 yy_current_state = yy_get_previous_state();
01235 
01236                                 yy_cp = yy_c_buf_p;
01237                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
01238                                 goto yy_find_action;
01239                         }
01240                 break;
01241                 }
01242 
01243         default:
01244                 YY_FATAL_ERROR(
01245                         "fatal flex scanner internal error--no action found" );
01246         } /* end of action switch */
01247                 } /* end of scanning one token */
01248         } /* end of yylex */
01249 
01250 
01251 /* yy_get_next_buffer - try to read in a new buffer
01252  *
01253  * Returns a code representing an action:
01254  *      EOB_ACT_LAST_MATCH -
01255  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
01256  *      EOB_ACT_END_OF_FILE - end of file
01257  */
01258 
01259 static int yy_get_next_buffer()
01260         {
01261         register char *dest = yy_current_buffer->yy_ch_buf;
01262         register char *source = yytext_ptr;
01263         register int number_to_move, i;
01264         int ret_val;
01265 
01266         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
01267                 YY_FATAL_ERROR(
01268                 "fatal flex scanner internal error--end of buffer missed" );
01269 
01270         if ( yy_current_buffer->yy_fill_buffer == 0 )
01271                 { /* Don't try to fill the buffer, so this is an EOF. */
01272                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
01273                         {
01274                         /* We matched a single character, the EOB, so
01275                          * treat this as a final EOF.
01276                          */
01277                         return EOB_ACT_END_OF_FILE;
01278                         }
01279 
01280                 else
01281                         {
01282                         /* We matched some text prior to the EOB, first
01283                          * process it.
01284                          */
01285                         return EOB_ACT_LAST_MATCH;
01286                         }
01287                 }
01288 
01289         /* Try to read more data. */
01290 
01291         /* First move last chars to start of buffer. */
01292         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
01293 
01294         for ( i = 0; i < number_to_move; ++i )
01295                 *(dest++) = *(source++);
01296 
01297         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01298                 /* don't do the read, it's not guaranteed to return an EOF,
01299                  * just force an EOF
01300                  */
01301                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
01302 
01303         else
01304                 {
01305                 int num_to_read =
01306                         yy_current_buffer->yy_buf_size - number_to_move - 1;
01307 
01308                 while ( num_to_read <= 0 )
01309                         { /* Not enough room in the buffer - grow it. */
01310 #ifdef YY_USES_REJECT
01311                         YY_FATAL_ERROR(
01312 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
01313 #else
01314 
01315                         /* just a shorter name for the current buffer */
01316                         YY_BUFFER_STATE b = yy_current_buffer;
01317 
01318                         int yy_c_buf_p_offset =
01319                                 (int) (yy_c_buf_p - b->yy_ch_buf);
01320 
01321                         if ( b->yy_is_our_buffer )
01322                                 {
01323                                 int new_size = b->yy_buf_size * 2;
01324 
01325                                 if ( new_size <= 0 )
01326                                         b->yy_buf_size += b->yy_buf_size / 8;
01327                                 else
01328                                         b->yy_buf_size *= 2;
01329 
01330                                 b->yy_ch_buf = (char *)
01331                                         /* Include room in for 2 EOB chars. */
01332                                         yy_flex_realloc( (void *) b->yy_ch_buf,
01333                                                          b->yy_buf_size + 2 );
01334                                 }
01335                         else
01336                                 /* Can't grow it, we don't own it. */
01337                                 b->yy_ch_buf = 0;
01338 
01339                         if ( ! b->yy_ch_buf )
01340                                 YY_FATAL_ERROR(
01341                                 "fatal error - scanner input buffer overflow" );
01342 
01343                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
01344 
01345                         num_to_read = yy_current_buffer->yy_buf_size -
01346                                                 number_to_move - 1;
01347 #endif
01348                         }
01349 
01350                 if ( num_to_read > YY_READ_BUF_SIZE )
01351                         num_to_read = YY_READ_BUF_SIZE;
01352 
01353                 /* Read in more data. */
01354                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
01355                         yy_n_chars, num_to_read );
01356 
01357                 yy_current_buffer->yy_n_chars = yy_n_chars;
01358                 }
01359 
01360         if ( yy_n_chars == 0 )
01361                 {
01362                 if ( number_to_move == YY_MORE_ADJ )
01363                         {
01364                         ret_val = EOB_ACT_END_OF_FILE;
01365                         yyrestart( yyin );
01366                         }
01367 
01368                 else
01369                         {
01370                         ret_val = EOB_ACT_LAST_MATCH;
01371                         yy_current_buffer->yy_buffer_status =
01372                                 YY_BUFFER_EOF_PENDING;
01373                         }
01374                 }
01375 
01376         else
01377                 ret_val = EOB_ACT_CONTINUE_SCAN;
01378 
01379         yy_n_chars += number_to_move;
01380         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
01381         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
01382 
01383         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
01384 
01385         return ret_val;
01386         }
01387 
01388 
01389 /* yy_get_previous_state - get the state just before the EOB char was reached */
01390 
01391 static yy_state_type yy_get_previous_state()
01392         {
01393         register yy_state_type yy_current_state;
01394         register char *yy_cp;
01395 
01396         yy_current_state = yy_start;
01397 
01398         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
01399                 {
01400                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01401                 if ( yy_accept[yy_current_state] )
01402                         {
01403                         yy_last_accepting_state = yy_current_state;
01404                         yy_last_accepting_cpos = yy_cp;
01405                         }
01406                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01407                         {
01408                         yy_current_state = (int) yy_def[yy_current_state];
01409                         if ( yy_current_state >= 122 )
01410                                 yy_c = yy_meta[(unsigned int) yy_c];
01411                         }
01412                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01413                 }
01414 
01415         return yy_current_state;
01416         }
01417 
01418 
01419 /* yy_try_NUL_trans - try to make a transition on the NUL character
01420  *
01421  * synopsis
01422  *      next_state = yy_try_NUL_trans( current_state );
01423  */
01424 
01425 #ifdef YY_USE_PROTOS
01426 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
01427 #else
01428 static yy_state_type yy_try_NUL_trans( yy_current_state )
01429 yy_state_type yy_current_state;
01430 #endif
01431         {
01432         register int yy_is_jam;
01433         register char *yy_cp = yy_c_buf_p;
01434 
01435         register YY_CHAR yy_c = 1;
01436         if ( yy_accept[yy_current_state] )
01437                 {
01438                 yy_last_accepting_state = yy_current_state;
01439                 yy_last_accepting_cpos = yy_cp;
01440                 }
01441         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01442                 {
01443                 yy_current_state = (int) yy_def[yy_current_state];
01444                 if ( yy_current_state >= 122 )
01445                         yy_c = yy_meta[(unsigned int) yy_c];
01446                 }
01447         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01448         yy_is_jam = (yy_current_state == 121);
01449 
01450         return yy_is_jam ? 0 : yy_current_state;
01451         }
01452 
01453 
01454 #ifndef YY_NO_UNPUT
01455 #ifdef YY_USE_PROTOS
01456 static void yyunput( int c, register char *yy_bp )
01457 #else
01458 static void yyunput( c, yy_bp )
01459 int c;
01460 register char *yy_bp;
01461 #endif
01462         {
01463         register char *yy_cp = yy_c_buf_p;
01464 
01465         /* undo effects of setting up yytext */
01466         *yy_cp = yy_hold_char;
01467 
01468         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01469                 { /* need to shift things up to make room */
01470                 /* +2 for EOB chars. */
01471                 register int number_to_move = yy_n_chars + 2;
01472                 register char *dest = &yy_current_buffer->yy_ch_buf[
01473                                         yy_current_buffer->yy_buf_size + 2];
01474                 register char *source =
01475                                 &yy_current_buffer->yy_ch_buf[number_to_move];
01476 
01477                 while ( source > yy_current_buffer->yy_ch_buf )
01478                         *--dest = *--source;
01479 
01480                 yy_cp += (int) (dest - source);
01481                 yy_bp += (int) (dest - source);
01482                 yy_current_buffer->yy_n_chars =
01483                         yy_n_chars = yy_current_buffer->yy_buf_size;
01484 
01485                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01486                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
01487                 }
01488 
01489         *--yy_cp = (char) c;
01490 
01491 
01492         yytext_ptr = yy_bp;
01493         yy_hold_char = *yy_cp;
01494         yy_c_buf_p = yy_cp;
01495         }
01496 #endif  /* ifndef YY_NO_UNPUT */
01497 
01498 
01499 #ifdef __cplusplus
01500 static int yyinput()
01501 #else
01502 static int input()
01503 #endif
01504         {
01505         int c;
01506 
01507         *yy_c_buf_p = yy_hold_char;
01508 
01509         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
01510                 {
01511                 /* yy_c_buf_p now points to the character we want to return.
01512                  * If this occurs *before* the EOB characters, then it's a
01513                  * valid NUL; if not, then we've hit the end of the buffer.
01514                  */
01515                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01516                         /* This was really a NUL. */
01517                         *yy_c_buf_p = '\0';
01518 
01519                 else
01520                         { /* need more input */
01521                         int offset = yy_c_buf_p - yytext_ptr;
01522                         ++yy_c_buf_p;
01523 
01524                         switch ( yy_get_next_buffer() )
01525                                 {
01526                                 case EOB_ACT_LAST_MATCH:
01527                                         /* This happens because yy_g_n_b()
01528                                          * sees that we've accumulated a
01529                                          * token and flags that we need to
01530                                          * try matching the token before
01531                                          * proceeding.  But for input(),
01532                                          * there's no matching to consider.
01533                                          * So convert the EOB_ACT_LAST_MATCH
01534                                          * to EOB_ACT_END_OF_FILE.
01535                                          */
01536 
01537                                         /* Reset buffer status. */
01538                                         yyrestart( yyin );
01539 
01540                                         /* fall through */
01541 
01542                                 case EOB_ACT_END_OF_FILE:
01543                                         {
01544                                         if ( yywrap() )
01545                                                 return EOF;
01546 
01547                                         if ( ! yy_did_buffer_switch_on_eof )
01548                                                 YY_NEW_FILE;
01549 #ifdef __cplusplus
01550                                         return yyinput();
01551 #else
01552                                         return input();
01553 #endif
01554                                         }
01555 
01556                                 case EOB_ACT_CONTINUE_SCAN:
01557                                         yy_c_buf_p = yytext_ptr + offset;
01558                                         break;
01559                                 }
01560