Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

scanner.c

Go to the documentation of this file.
00001 /* A lexical scanner generated by flex */
00002 
00003 /* Scanner skeleton version:
00004  * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern 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 #include <unistd.h>
00013 
00014 
00015 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
00016 #ifdef c_plusplus
00017 #ifndef __cplusplus
00018 #define __cplusplus
00019 #endif
00020 #endif
00021 
00022 
00023 #ifdef __cplusplus
00024 
00025 #include <stdlib.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 __STDC__
00036 
00037 #define YY_USE_PROTOS
00038 #define YY_USE_CONST
00039 
00040 #endif  /* __STDC__ */
00041 #endif  /* ! __cplusplus */
00042 
00043 #ifdef __TURBOC__
00044  #pragma warn -rch
00045  #pragma warn -use
00046 #include <io.h>
00047 #include <stdlib.h>
00048 #define YY_USE_CONST
00049 #define YY_USE_PROTOS
00050 #endif
00051 
00052 #ifdef YY_USE_CONST
00053 #define yyconst const
00054 #else
00055 #define yyconst
00056 #endif
00057 
00058 
00059 #ifdef YY_USE_PROTOS
00060 #define YY_PROTO(proto) proto
00061 #else
00062 #define YY_PROTO(proto) ()
00063 #endif
00064 
00065 /* Returned upon end-of-file. */
00066 #define YY_NULL 0
00067 
00068 /* Promotes a possibly negative, possibly signed char to an unsigned
00069  * integer for use as an array index.  If the signed char is negative,
00070  * we want to instead treat it as an 8-bit unsigned char, hence the
00071  * double cast.
00072  */
00073 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00074 
00075 /* Enter a start condition.  This macro really ought to take a parameter,
00076  * but we do it the disgusting crufty way forced on us by the ()-less
00077  * definition of BEGIN.
00078  */
00079 #define BEGIN yy_start = 1 + 2 *
00080 
00081 /* Translate the current start state into a value that can be later handed
00082  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00083  * compatibility.
00084  */
00085 #define YY_START ((yy_start - 1) / 2)
00086 #define YYSTATE YY_START
00087 
00088 /* Action number for EOF rule of a given start state. */
00089 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00090 
00091 /* Special action meaning "start processing a new file". */
00092 #define YY_NEW_FILE yyrestart( yyin )
00093 
00094 #define YY_END_OF_BUFFER_CHAR 0
00095 
00096 /* Size of default input buffer. */
00097 #define YY_BUF_SIZE 16384
00098 
00099 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00100 
00101 extern int yyleng;
00102 extern FILE *yyin, *yyout;
00103 
00104 #define EOB_ACT_CONTINUE_SCAN 0
00105 #define EOB_ACT_END_OF_FILE 1
00106 #define EOB_ACT_LAST_MATCH 2
00107 
00108 /* The funky do-while in the following #define is used to turn the definition
00109  * int a single C statement (which needs a semi-colon terminator).  This
00110  * avoids problems with code like:
00111  *
00112  *  if ( condition_holds )
00113  *    yyless( 5 );
00114  *  else
00115  *    do_something_else();
00116  *
00117  * Prior to using the do-while the compiler would get upset at the
00118  * "else" because it interpreted the "if" statement as being all
00119  * done when it reached the ';' after the yyless() call.
00120  */
00121 
00122 /* Return all but the first 'n' matched characters back to the input stream. */
00123 
00124 #define yyless(n) \
00125   do \
00126     { \
00127     /* Undo effects of setting up yytext. */ \
00128     *yy_cp = yy_hold_char; \
00129     YY_RESTORE_YY_MORE_OFFSET \
00130     yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
00131     YY_DO_BEFORE_ACTION; /* set up yytext again */ \
00132     } \
00133   while ( 0 )
00134 
00135 #define unput(c) yyunput( c, yytext_ptr )
00136 
00137 /* The following is because we cannot portably get our hands on size_t
00138  * (without autoconf's help, which isn't available because we want
00139  * flex-generated scanners to compile on their own).
00140  */
00141 typedef unsigned int yy_size_t;
00142 
00143 
00144 struct yy_buffer_state
00145   {
00146   FILE *yy_input_file;
00147 
00148   char *yy_ch_buf;    /* input buffer */
00149   char *yy_buf_pos;   /* current position in input buffer */
00150 
00151   /* Size of input buffer in bytes, not including room for EOB
00152    * characters.
00153    */
00154   yy_size_t yy_buf_size;
00155 
00156   /* Number of characters read into yy_ch_buf, not including EOB
00157    * characters.
00158    */
00159   int yy_n_chars;
00160 
00161   /* Whether we "own" the buffer - i.e., we know we created it,
00162    * and can realloc() it to grow it, and should free() it to
00163    * delete it.
00164    */
00165   int yy_is_our_buffer;
00166 
00167   /* Whether this is an "interactive" input source; if so, and
00168    * if we're using stdio for input, then we want to use getc()
00169    * instead of fread(), to make sure we stop fetching input after
00170    * each newline.
00171    */
00172   int yy_is_interactive;
00173 
00174   /* Whether we're considered to be at the beginning of a line.
00175    * If so, '^' rules will be active on the next match, otherwise
00176    * not.
00177    */
00178   int yy_at_bol;
00179 
00180   /* Whether to try to fill the input buffer when we reach the
00181    * end of it.
00182    */
00183   int yy_fill_buffer;
00184 
00185   int yy_buffer_status;
00186 #define YY_BUFFER_NEW 0
00187 #define YY_BUFFER_NORMAL 1
00188   /* When an EOF's been seen but there's still some text to process
00189    * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00190    * shouldn't try reading from the input source any more.  We might
00191    * still have a bunch of tokens to match, though, because of
00192    * possible backing-up.
00193    *
00194    * When we actually see the EOF, we change the status to "new"
00195    * (via yyrestart()), so that the user can continue scanning by
00196    * just pointing yyin at a new input file.
00197    */
00198 #define YY_BUFFER_EOF_PENDING 2
00199   };
00200 
00201 static YY_BUFFER_STATE yy_current_buffer = 0;
00202 
00203 /* We provide macros for accessing buffer states in case in the
00204  * future we want to put the buffer states in a more general
00205  * "scanner state".
00206  */
00207 #define YY_CURRENT_BUFFER yy_current_buffer
00208 
00209 
00210 /* yy_hold_char holds the character lost when yytext is formed. */
00211 static char yy_hold_char;
00212 
00213 static int yy_n_chars;    /* number of characters read into yy_ch_buf */
00214 
00215 
00216 int yyleng;
00217 
00218 /* Points to current character in buffer. */
00219 static char *yy_c_buf_p = (char *) 0;
00220 static int yy_init = 1;   /* whether we need to initialize */
00221 static int yy_start = 0;  /* start state number */
00222 
00223 /* Flag which is used to allow yywrap()'s to do buffer switches
00224  * instead of setting up a fresh yyin.  A bit of a hack ...
00225  */
00226 static int yy_did_buffer_switch_on_eof;
00227 
00228 void yyrestart YY_PROTO(( FILE *input_file ));
00229 
00230 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
00231 void yy_load_buffer_state YY_PROTO(( void ));
00232 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
00233 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00234 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
00235 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
00237 
00238 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
00239 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
00240 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
00241 
00242 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
00243 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
00244 static void yy_flex_free YY_PROTO(( void * ));
00245 
00246 #define yy_new_buffer yy_create_buffer
00247 
00248 #define yy_set_interactive(is_interactive) \
00249   { \
00250   if ( ! yy_current_buffer ) \
00251     yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00252   yy_current_buffer->yy_is_interactive = is_interactive; \
00253   }
00254 
00255 #define yy_set_bol(at_bol) \
00256   { \
00257   if ( ! yy_current_buffer ) \
00258     yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00259   yy_current_buffer->yy_at_bol = at_bol; \
00260   }
00261 
00262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
00263 
00264 
00265 #define YY_USES_REJECT
00266 
00267 #define yywrap() 1
00268 #define YY_SKIP_YYWRAP
00269 
00270 #define FLEX_DEBUG
00271 typedef unsigned char YY_CHAR;
00272 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
00273 typedef int yy_state_type;
00274 
00275 #define FLEX_DEBUG
00276 extern int yylineno;
00277 int yylineno = 1;
00278 extern char *yytext;
00279 #define yytext_ptr yytext
00280 
00281 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
00282 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
00283 static int yy_get_next_buffer YY_PROTO(( void ));
00284 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
00285 
00286 /* Done after the current pattern has been matched and before the
00287  * corresponding action - sets up yytext.
00288  */
00289 #define YY_DO_BEFORE_ACTION \
00290   yytext_ptr = yy_bp; \
00291   yyleng = (int) (yy_cp - yy_bp); \
00292   yy_hold_char = *yy_cp; \
00293   *yy_cp = '\0'; \
00294   yy_c_buf_p = yy_cp;
00295 
00296 #define YY_NUM_RULES 48
00297 #define YY_END_OF_BUFFER 49
00298 static yyconst short int yy_acclist[222] =
00299     {   0,
00300        49,   41,   48,    1,   41,   48,    1,   48,   35,   41,
00301        48,   41,   48,   31,   41,   48,   41,   48,   18,   41,
00302        48,   19,   41,   48,   27,   41,   48,   29,   41,   48,
00303        33,   41,   48,   30,   41,   48,   41,   48,   36,   41,
00304        48,   26,   41,   48,   25,   41,   48,   20,   41,   48,
00305        24,   41,   48,   21,   41,   48,   28,   41,   48,   40,
00306        41,   48,   40,   41,   48,   40,   41,   48,   40,   41,
00307        48,   40,   41,   48,   40,   41,   48,   40,   41,   48,
00308        40,   41,   48,   40,   41,   48,   22,   41,   48,   23,
00309        41,   48,   40,   41,   48,   40,   41,   48,   40,   41,
00310 
00311        48,   16,   41,   48,   34,   41,   48,   17,   41,   48,
00312        32,   41,   48,   47,   48,   42,   47,   48,   42,   48,
00313        47,   48,   47,   48,   47,   48,    1,   38,    3,   36,
00314        40,   40,   40,   40,   40,   40,   40,   40,   40,   40,
00315        40,   40,   40,   40,   40,   42,   45,   44,   37,   37,
00316         2,    3,   40,   40,   40,   40,   40,   40,   40,   40,
00317        40,   40,   40,   40,   40,   40,   46,   46,   43,   44,
00318         2,    7,   40,   40,   40,   10,   40,   40,   40,   40,
00319         9,   40,   40,   40,   40,   40,   40,   39,   40,   43,
00320        40,   40,   40,   40,   40,   40,    5,   40,   15,   40,
00321 
00322        14,   40,   40,   40,   40,   12,   40,   40,   40,   11,
00323        40,   40,    4,   40,    6,   40,    8,   40,   40,   13,
00324        40
00325     } ;
00326 
00327 static yyconst short int yy_accept[161] =
00328     {   0,
00329         1,    1,    1,    1,    1,    2,    4,    7,    9,   12,
00330        14,   17,   19,   22,   25,   28,   31,   34,   37,   39,
00331        42,   45,   48,   51,   54,   57,   60,   63,   66,   69,
00332        72,   75,   78,   81,   84,   87,   90,   93,   96,   99,
00333       102,  105,  108,  111,  114,  116,  119,  121,  123,  125,
00334       127,  128,  128,  129,  129,  129,  129,  129,  130,  131,
00335       132,  133,  134,  135,  136,  137,  138,  139,  140,  141,
00336       142,  143,  144,  145,  146,  147,  147,  148,  148,  148,
00337       148,  148,  149,  149,  150,  151,  151,  151,  151,  152,
00338       153,  154,  155,  156,  157,  158,  159,  160,  161,  162,
00339 
00340       163,  164,  165,  166,  167,  167,  168,  169,  169,  169,
00341       169,  170,  171,  171,  171,  171,  172,  174,  175,  176,
00342       178,  179,  180,  181,  183,  184,  185,  186,  187,  188,
00343       190,  190,  190,  190,  191,  191,  192,  193,  194,  195,
00344       196,  197,  199,  201,  203,  203,  204,  205,  206,  208,
00345       209,  210,  212,  213,  215,  217,  219,  220,  222,  222
00346     } ;
00347 
00348 static yyconst int yy_ec[256] =
00349     {   0,
00350         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00351         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00352         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00353         1,    2,    4,    5,    6,    1,    1,    1,    7,    8,
00354         9,   10,   11,   12,   13,    1,   14,   15,   15,   15,
00355        15,   15,   15,   15,   15,   16,   16,   17,   18,   19,
00356        20,   21,   22,    1,   23,   24,   25,   26,   27,   24,
00357        24,   28,   29,   24,   30,   31,   32,   33,   34,   35,
00358        24,   36,   37,   38,   24,   24,   39,   24,   40,   24,
00359        41,   42,   43,    1,   44,    1,   45,   24,   46,   24,
00360 
00361        47,   48,   24,   49,   24,   24,   24,   50,   24,   24,
00362        51,   24,   24,   52,   53,   54,   55,   24,   56,   24,
00363        24,   24,   57,   58,   59,   60,    1,    1,    1,    1,
00364         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00365         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00366         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00367         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00368         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00369         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00370         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00371 
00372         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00373         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00374         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00375         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00376         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00377         1,    1,    1,    1,    1
00378     } ;
00379 
00380 static yyconst int yy_meta[61] =
00381     {   0,
00382         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
00383         1,    1,    1,    1,    3,    3,    1,    1,    1,    1,
00384         1,    1,    3,    3,    3,    3,    3,    3,    3,    3,
00385         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
00386         1,    1,    1,    3,    3,    3,    3,    3,    3,    3,
00387         3,    3,    3,    3,    3,    3,    1,    1,    1,    1
00388     } ;
00389 
00390 static yyconst short int yy_base[172] =
00391     {   0,
00392         0,    0,   59,   65,  248,  249,   72,   74,  249,   58,
00393       249,  205,  249,  249,  249,  249,  249,  249,   55,   65,
00394       249,  249,  249,  249,  249,  249,    0,  212,  218,  210,
00395       209,  207,  218,   53,  206,  249,  249,  194,  193,   33,
00396       249,  249,  249,  249,  249,   84,   87,   66,  195,   81,
00397        90,   79,  249,  221,  228,   87,   87,    0,   83,    0,
00398       208,  193,  198,  195,  192,  193,  205,  198,  199,  195,
00399       170,  173,  170,  166,  101,   91,  249,  205,  212,   98,
00400        96,    0,  102,  249,  211,  104,  102,  104,  110,    0,
00401       190,  177,  185,  187,  184,  168,  166,  158,  165,  160,
00402 
00403       138,  125,  126,  128,  110,  249,  167,  115,  113,  118,
00404       121,    0,  121,  122,  124,  249,    0,  139,  149,    0,
00405       137,  143,  136,    0,  139,  134,  117,  118,  108,    0,
00406       134,  133,  131,  249,  104,  126,  133,  127,  123,  131,
00407       134,    0,    0,    0,  137,  130,  128,  117,    0,  117,
00408       120,    0,  127,    0,    0,    0,  121,    0,  249,  179,
00409       182,  185,  140,  188,  191,  194,  197,  200,  203,  206,
00410       209
00411     } ;
00412 
00413 static yyconst short int yy_def[172] =
00414     {   0,
00415       159,    1,  160,  160,  159,  159,  159,  159,  159,  161,
00416       159,  162,  159,  159,  159,  159,  159,  159,  159,  159,
00417       159,  159,  159,  159,  159,  159,  163,  163,  163,  163,
00418       163,  163,  163,  163,  163,  159,  159,  163,  163,  163,
00419       159,  159,  159,  159,  159,  159,  159,  164,  165,  159,
00420       159,  161,  159,  161,  159,  162,  166,  167,  159,  163,
00421       163,  163,  163,  163,  163,  163,  163,  163,  163,  163,
00422       163,  163,  163,  163,  159,  164,  159,  164,  159,  165,
00423       168,  169,  161,  159,  159,  159,  166,  170,  166,  167,
00424       163,  163,  163,  163,  163,  163,  163,  163,  163,  163,
00425 
00426       163,  163,  163,  163,  164,  159,  159,  159,  168,  171,
00427       168,  169,  161,  159,  166,  159,  163,  163,  163,  163,
00428       163,  163,  163,  163,  163,  163,  163,  163,  163,  163,
00429       164,  159,  168,  159,  161,  163,  163,  163,  163,  163,
00430       163,  163,  163,  163,  164,  163,  163,  163,  163,  163,
00431       163,  163,  163,  163,  163,  163,  163,  163,    0,  159,
00432       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00433       159
00434     } ;
00435 
00436 static yyconst short int yy_nxt[310] =
00437     {   0,
00438         6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
00439        16,   17,   18,   19,   20,   20,   21,   22,   23,   24,
00440        25,   26,   27,   27,   28,   27,   27,   27,   27,   29,
00441        30,   31,   27,   32,   33,   27,   34,   35,   27,   27,
00442        36,    6,   37,   27,   27,   38,   27,   39,   27,   27,
00443        27,   27,   27,   40,   27,   27,   41,   42,   43,   44,
00444        46,   47,   53,   48,   57,   49,   46,   47,   58,   48,
00445        77,   49,   50,   51,   51,   51,   51,   67,   50,   59,
00446        59,   73,   68,   53,   74,   75,   75,   69,   75,   75,
00447        81,   51,   51,   85,   82,   77,   88,   59,   59,   54,
00448 
00449        89,   86,   75,   75,  107,  110,   53,   78,   53,  111,
00450        84,   88,  108,   88,   77,   89,  113,  116,  114,   88,
00451        54,  106,  110,   89,  131,   53,  111,  110,   84,  132,
00452       110,  134,   78,   88,  111,  135,   55,   89,   77,  106,
00453       110,   77,   60,   54,  111,   54,  158,   79,  145,  157,
00454       156,   78,  155,  154,  153,  152,  151,  150,  149,  148,
00455       147,  146,   54,  144,  130,  143,  142,  141,  140,  139,
00456       138,  137,  136,  106,  130,   78,  129,  128,   78,   45,
00457        45,   45,   52,  127,   52,   55,  126,   55,   76,  125,
00458        76,   79,  124,   79,   87,   87,   87,   90,  123,   90,
00459 
00460       109,  109,  109,  112,  122,  112,  115,  115,  115,  133,
00461       133,  133,  121,  120,  119,  118,  117,   84,  106,  105,
00462       104,  103,  102,  101,  100,   99,   98,   97,   96,   95,
00463        94,   93,   92,   91,   84,   83,   80,   72,   71,   70,
00464        66,   65,   64,   63,   62,   61,   56,  159,    5,  159,
00465       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00466       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00467       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00468       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00469       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00470 
00471       159,  159,  159,  159,  159,  159,  159,  159,  159
00472     } ;
00473 
00474 static yyconst short int yy_chk[310] =
00475     {   0,
00476         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00477         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00478         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00479         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00480         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00481         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00482         3,    3,   10,    3,   19,    3,    4,    4,   19,    4,
00483        48,    4,    3,    7,    7,    8,    8,   34,    4,   20,
00484        20,   40,   34,   52,   40,   46,   46,   34,   47,   47,
00485        50,   51,   51,   56,   50,   76,   57,   59,   59,   10,
00486 
00487        57,   56,   75,   75,   80,   81,   83,   48,  135,   81,
00488        86,   87,   80,   88,  105,   87,   83,   88,   86,   89,
00489        52,  108,  109,   89,  105,  113,  109,  110,  114,  108,
00490       111,  110,   76,  115,  111,  113,  114,  115,  131,  132,
00491       133,  145,  163,   83,  133,  135,  157,  132,  131,  153,
00492       151,  105,  150,  148,  147,  146,  141,  140,  139,  138,
00493       137,  136,  113,  129,  128,  127,  126,  125,  123,  122,
00494       121,  119,  118,  107,  104,  131,  103,  102,  145,  160,
00495       160,  160,  161,  101,  161,  162,  100,  162,  164,   99,
00496       164,  165,   98,  165,  166,  166,  166,  167,   97,  167,
00497 
00498       168,  168,  168,  169,   96,  169,  170,  170,  170,  171,
00499       171,  171,   95,   94,   93,   92,   91,   85,   79,   78,
00500        74,   73,   72,   71,   70,   69,   68,   67,   66,   65,
00501        64,   63,   62,   61,   55,   54,   49,   39,   38,   35,
00502        33,   32,   31,   30,   29,   28,   12,    5,  159,  159,
00503       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
00504       159,  159,  159,  159,  159,  159,  159,  159,  159,  159,
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,  159,  159,
00508 
00509       159,  159,  159,  159,  159,  159,  159,  159,  159
00510     } ;
00511 
00512 extern int yy_flex_debug;
00513 int yy_flex_debug = 1;
00514 
00515 static yyconst short int yy_rule_linenum[48] =
00516     {   0,
00517       135,  136,  137,  138,  139,  140,  141,  142,  143,  144,
00518       145,  146,  147,  148,  149,  151,  152,  153,  154,  155,
00519       156,  157,  158,  159,  160,  161,  162,  163,  164,  165,
00520       166,  167,  168,  169,  170,  172,  173,  175,  177,  179,
00521       181,  196,  197,  198,  199,  200,  213
00522     } ;
00523 
00524 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
00525 static char *yy_full_match;
00526 static int yy_lp;
00527 #define REJECT \
00528 { \
00529 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
00530 yy_cp = yy_full_match; /* restore poss. backed-over text */ \
00531 ++yy_lp; \
00532 goto find_rule; \
00533 }
00534 #define yymore() yymore_used_but_not_detected
00535 #define YY_MORE_ADJ 0
00536 #define YY_RESTORE_YY_MORE_OFFSET
00537 char *yytext;
00538 #line 1 "scanner.l"
00539 #define INITIAL 0
00540 #line 2 "scanner.l"
00541 /*
00542  *  File:       scanner.l
00543  *              $Id: scanner.l,v 1.9 2002/07/09 03:04:58 alec Exp $
00544  *
00545  *  Author:     Alec Panoviciu (alecu@email.com)
00546  *
00547  *  Comments: the CppCC's scanner (LEX implementation)
00548  *
00549  *  $Log: scanner.l,v $
00550  *  Revision 1.9  2002/07/09 03:04:58  alec
00551  *  OWN_STRINGS bu*beep*it finally vanished
00552  *  gcc 3.1&mingw - related cleanups
00553  *
00554  *  Revision 1.8  2002/06/23 23:33:25  alec
00555  *  la-time usercode (force)
00556  *
00557  *  Revision 1.7  2002/06/13 11:42:07  alec
00558  *  added #line stuff
00559  *
00560  *  Revision 1.6  2002/05/08 10:36:37  alec
00561  *  added keyword tokens support
00562  *
00563  *  Revision 1.5  2002/05/04 18:51:16  alec
00564  *  sync
00565  *
00566  *  Revision 1.4  2002/04/30 16:24:38  alec
00567  *  tested the scanner ptree & vBitVector implementation -> ok
00568  *
00569  *  Revision 1.3  2002/04/29 09:34:10  alec
00570  *  scanner ptree building compiles
00571  *
00572  */
00573 
00574 /*
00575   Copyright (C) 2002 Alexandru Panoviciu (alecu@email.com)
00576 
00577   This program is free software; you can redistribute it and/or modify
00578   it under the terms of the GNU General Public License as published by
00579   the Free Software Foundation; either version 2 of the License, or
00580   (at your option) any later version.
00581 
00582   This program is distributed in the hope that it will be useful,
00583   but WITHOUT ANY WARRANTY; without even the implied warranty of
00584   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00585   GNU General Public License for more details.
00586 
00587   You should have received a copy of the GNU General Public License
00588   along with this program; if not, write to the Free Software
00589   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00590 
00591 */
00592 
00593 #line 57 "scanner.l"
00594 #include <stdio.h>
00595 #include <stdlib.h>
00596 #include <string.h>
00597 #include "cw_misc.h"
00598 #include "parser.h"
00599 #include "xalloc.h"
00600 
00601 extern void yyerror(char *message);
00602 
00603 /* see about these two at the end of file: */ 
00604 char dmbNest; 
00605 char dmbUnnest;
00606 int dmbNestLevel;
00607 int dmbUnput; 
00608 char *dmbModeBuffer = NULL;
00609 void appendToDmBuffer (void);
00610 
00611  char* getUnescapedString (char *literal);
00612 char getUnescapedChar (char *literal, int *incr);
00613 #define DUMBO 1
00614 
00615 #line 616 "lex.yy.c"
00616 
00617 /* Macros after this point can all be overridden by user definitions in
00618  * section 1.
00619  */
00620 
00621 #ifndef YY_SKIP_YYWRAP
00622 #ifdef __cplusplus
00623 extern "C" int yywrap YY_PROTO(( void ));
00624 #else
00625 extern int yywrap YY_PROTO(( void ));
00626 #endif
00627 #endif
00628 
00629 #ifndef YY_NO_UNPUT
00630 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
00631 #endif
00632 
00633 #ifndef yytext_ptr
00634 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
00635 #endif
00636 
00637 #ifdef YY_NEED_STRLEN
00638 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
00639 #endif
00640 
00641 #ifndef YY_NO_INPUT
00642 #ifdef __cplusplus
00643 static int yyinput YY_PROTO(( void ));
00644 #else
00645 static int input YY_PROTO(( void ));
00646 #endif
00647 #endif
00648 
00649 #if YY_STACK_USED
00650 static int yy_start_stack_ptr = 0;
00651 static int yy_start_stack_depth = 0;
00652 static int *yy_start_stack = 0;
00653 #ifndef YY_NO_PUSH_STATE
00654 static void yy_push_state YY_PROTO(( int new_state ));
00655 #endif
00656 #ifndef YY_NO_POP_STATE
00657 static void yy_pop_state YY_PROTO(( void ));
00658 #endif
00659 #ifndef YY_NO_TOP_STATE
00660 static int yy_top_state YY_PROTO(( void ));
00661 #endif
00662 
00663 #else
00664 #define YY_NO_PUSH_STATE 1
00665 #define YY_NO_POP_STATE 1
00666 #define YY_NO_TOP_STATE 1
00667 #endif
00668 
00669 #ifdef YY_MALLOC_DECL
00670 YY_MALLOC_DECL
00671 #else
00672 #if __STDC__
00673 #ifndef __cplusplus
00674 #include <stdlib.h>
00675 #endif
00676 #else
00677 /* Just try to get by without declaring the routines.  This will fail
00678  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
00679  * or sizeof(void*) != sizeof(int).
00680  */
00681 #endif
00682 #endif
00683 
00684 /* Amount of stuff to slurp up with each read. */
00685 #ifndef YY_READ_BUF_SIZE
00686 #define YY_READ_BUF_SIZE 8192
00687 #endif
00688 
00689 /* Copy whatever the last rule matched to the standard output. */
00690 
00691 #ifndef ECHO
00692 /* This used to be an fputs(), but since the string might contain NUL's,
00693  * we now use fwrite().
00694  */
00695 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
00696 #endif
00697 
00698 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00699  * is returned in "result".
00700  */
00701 #ifndef YY_INPUT
00702 #define YY_INPUT(buf,result,max_size) \
00703   if ( yy_current_buffer->yy_is_interactive ) \
00704     { \
00705     int c = '*', n; \
00706     for ( n = 0; n < max_size && \
00707            (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00708       buf[n] = (char) c; \
00709     if ( c == '\n' ) \
00710       buf[n++] = (char) c; \
00711     if ( c == EOF && ferror( yyin ) ) \
00712       YY_FATAL_ERROR( "input in flex scanner failed" ); \
00713     result = n; \
00714     } \
00715   else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
00716       && ferror( yyin ) ) \
00717     YY_FATAL_ERROR( "input in flex scanner failed" );
00718 #endif
00719 
00720 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00721  * we don't want an extra ';' after the "return" because that will cause
00722  * some compilers to complain about unreachable statements.
00723  */
00724 #ifndef yyterminate
00725 #define yyterminate() return YY_NULL
00726 #endif
00727 
00728 /* Number of entries by which start-condition stack grows. */
00729 #ifndef YY_START_STACK_INCR
00730 #define YY_START_STACK_INCR 25
00731 #endif
00732 
00733 /* Report a fatal error. */
00734 #ifndef YY_FATAL_ERROR
00735 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00736 #endif
00737 
00738 /* Default declaration of generated scanner - a define so the user can
00739  * easily add parameters.
00740  */
00741 #ifndef YY_DECL
00742 #define YY_DECL int yylex YY_PROTO(( void ))
00743 #endif
00744 
00745 /* Code executed at the beginning of each rule, after yytext and yyleng
00746  * have been set up.
00747  */
00748 #ifndef YY_USER_ACTION
00749 #define YY_USER_ACTION
00750 #endif
00751 
00752 /* Code executed at the end of each rule. */
00753 #ifndef YY_BREAK
00754 #define YY_BREAK break;
00755 #endif
00756 
00757 #define YY_RULE_SETUP \
00758   YY_USER_ACTION
00759 
00760 YY_DECL
00761   {
00762   register yy_state_type yy_current_state;
00763   register char *yy_cp = NULL, *yy_bp = NULL;
00764   register int yy_act;
00765 
00766 #line 133 "scanner.l"
00767 
00768 
00769 #line 770 "lex.yy.c"
00770 
00771   if ( yy_init )
00772     {
00773     yy_init = 0;
00774 
00775 #ifdef YY_USER_INIT
00776     YY_USER_INIT;
00777 #endif
00778 
00779     if ( ! yy_start )
00780       yy_start = 1; /* first start state */
00781 
00782     if ( ! yyin )
00783       yyin = stdin;
00784 
00785     if ( ! yyout )
00786       yyout = stdout;
00787 
00788     if ( ! yy_current_buffer )
00789       yy_current_buffer =
00790         yy_create_buffer( yyin, YY_BUF_SIZE );
00791 
00792     yy_load_buffer_state();
00793     }
00794 
00795   while ( 1 )   /* loops until end-of-file is reached */
00796     {
00797     yy_cp = yy_c_buf_p;
00798 
00799     /* Support of yytext. */
00800     *yy_cp = yy_hold_char;
00801 
00802     /* yy_bp points to the position in yy_ch_buf of the start of
00803      * the current run.
00804      */
00805     yy_bp = yy_cp;
00806 
00807     yy_current_state = yy_start;
00808     yy_state_ptr = yy_state_buf;
00809     *yy_state_ptr++ = yy_current_state;
00810 yy_match:
00811     do
00812       {
00813       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00814       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00815         {
00816         yy_current_state = (int) yy_def[yy_current_state];
00817         if ( yy_current_state >= 160 )
00818           yy_c = yy_meta[(unsigned int) yy_c];
00819         }
00820       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00821       *yy_state_ptr++ = yy_current_state;
00822       ++yy_cp;
00823       }
00824     while ( yy_base[yy_current_state] != 249 );
00825 
00826 yy_find_action:
00827     yy_current_state = *--yy_state_ptr;
00828     yy_lp = yy_accept[yy_current_state];
00829 find_rule: /* we branch to this label when backing up */
00830     for ( ; ; ) /* until we find what rule we matched */
00831       {
00832       if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
00833         {
00834         yy_act = yy_acclist[yy_lp];
00835           {
00836           yy_full_match = yy_cp;
00837           break;
00838           }
00839         }
00840       --yy_cp;
00841       yy_current_state = *--yy_state_ptr;
00842       yy_lp = yy_accept[yy_current_state];
00843       }
00844 
00845     YY_DO_BEFORE_ACTION;
00846 
00847     if ( yy_act != YY_END_OF_BUFFER )
00848       {
00849       int yyl;
00850       for ( yyl = 0; yyl < yyleng; ++yyl )
00851         if ( yytext[yyl] == '\n' )
00852           ++yylineno;
00853       }
00854 
00855 do_action:  /* This label is used only to access EOF actions. */
00856 
00857     if ( yy_flex_debug )
00858       {
00859       if ( yy_act == 0 )
00860         fprintf( stderr, "--scanner backing up\n" );
00861       else if ( yy_act < 48 )
00862         fprintf( stderr, "--accepting rule at line %d (\"%s\")\n",
00863                  yy_rule_linenum[yy_act], yytext );
00864       else if ( yy_act == 48 )
00865         fprintf( stderr, "--accepting default rule (\"%s\")\n",
00866                  yytext );
00867       else if ( yy_act == 49 )
00868         fprintf( stderr, "--(end of buffer or a NUL)\n" );
00869       else
00870         fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
00871       }
00872 
00873     switch ( yy_act )
00874   { /* beginning of action switch */
00875 case 1:
00876 YY_RULE_SETUP
00877 #line 135 "scanner.l"
00878 
00879   YY_BREAK
00880 case 2:
00881 YY_RULE_SETUP
00882 #line 136 "scanner.l"
00883 
00884   YY_BREAK
00885 case 3:
00886 YY_RULE_SETUP
00887 #line 137 "scanner.l"
00888 
00889   YY_BREAK
00890 case 4:
00891 YY_RULE_SETUP
00892 #line 138 "scanner.l"
00893 { return TOK_OPTIONS; }
00894   YY_BREAK
00895 case 5:
00896 YY_RULE_SETUP
00897 #line 139 "scanner.l"
00898 { return TOK_TOKEN; }
00899   YY_BREAK
00900 case 6:
00901 YY_RULE_SETUP
00902 #line 140 "scanner.l"
00903 { return TOK_SCANNER; }
00904   YY_BREAK
00905 case 7:
00906 YY_RULE_SETUP
00907 #line 141 "scanner.l"
00908 { return TOK_CODE; }
00909   YY_BREAK
00910 case 8:
00911 YY_RULE_SETUP
00912 #line 142 "scanner.l"
00913 { return TOK_SPECIAL; }
00914   YY_BREAK
00915 case 9:
00916 YY_RULE_SETUP
00917 #line 143 "scanner.l"
00918 { return TOK_SKIP; }
00919   YY_BREAK
00920 case 10:
00921 YY_RULE_SETUP
00922 #line 144 "scanner.l"
00923 { return TOK_MORE; }
00924   YY_BREAK
00925 case 11:
00926 YY_RULE_SETUP
00927 #line 145 "scanner.l"
00928 { return TOK_KEYWORD; }
00929   YY_BREAK
00930 case 12:
00931 YY_RULE_SETUP
00932 #line 146 "scanner.l"
00933 { return TOK_PARSER; }
00934   YY_BREAK
00935 case 13:
00936 YY_RULE_SETUP
00937 #line 147 "scanner.l"
00938 { return TOK_LOOKAHEAD; }
00939   YY_BREAK
00940 case 14:
00941 YY_RULE_SETUP
00942 #line 148 "scanner.l"
00943 { return TOK_THROW; }
00944   YY_BREAK
00945 case 15:
00946 YY_RULE_SETUP
00947 #line 149 "scanner.l"
00948 { return TOK_CATCH; }
00949   YY_BREAK
00950 case 16:
00951 YY_RULE_SETUP
00952 #line 151 "scanner.l"
00953 { return TOK_LBRACE; }
00954   YY_BREAK
00955 case 17:
00956 YY_RULE_SETUP
00957 #line 152 "scanner.l"
00958 { return TOK_RBRACE; }
00959   YY_BREAK
00960 case 18:
00961 YY_RULE_SETUP
00962 #line 153 "scanner.l"
00963 { return TOK_LPAREN; }
00964   YY_BREAK
00965 case 19:
00966 YY_RULE_SETUP
00967 #line 154 "scanner.l"
00968 { return TOK_RPAREN; }
00969   YY_BREAK
00970 case 20:
00971 YY_RULE_SETUP
00972 #line 155 "scanner.l"
00973 { return TOK_LBRACKET; }
00974   YY_BREAK
00975 case 21:
00976 YY_RULE_SETUP
00977 #line 156 "scanner.l"
00978 { return TOK_RBRACKET; }
00979   YY_BREAK
00980 case 22:
00981 YY_RULE_SETUP
00982 #line 157 "scanner.l"
00983 { return TOK_LSQUARE; }
00984   YY_BREAK
00985 case 23:
00986 YY_RULE_SETUP
00987 #line 158 "scanner.l"
00988 { return TOK_RSQUARE; }
00989   YY_BREAK
00990 case 24:
00991 YY_RULE_SETUP
00992 #line 159 "scanner.l"
00993 { return TOK_EQUAL; }
00994   YY_BREAK
00995 case 25:
00996 YY_RULE_SETUP
00997 #line 160 "scanner.l"
00998 { return TOK_SEMICOLON; }
00999   YY_BREAK
01000 case 26:
01001 YY_RULE_SETUP
01002 #line 161 "scanner.l"
01003 { return TOK_TWODOTS; }
01004   YY_BREAK
01005 case 27:
01006 YY_RULE_SETUP
01007 #line 162 "scanner.l"
01008 { return TOK_STAR; }
01009   YY_BREAK
01010 case 28:
01011 YY_RULE_SETUP
01012 #line 163 "scanner.l"
01013 { return TOK_QMARK; }
01014   YY_BREAK
01015 case 29:
01016 YY_RULE_SETUP
01017 #line 164 "scanner.l"
01018 { return TOK_PLUS; }
01019   YY_BREAK
01020 case 30:
01021 YY_RULE_SETUP
01022 #line 165 "scanner.l"
01023 { return TOK_DASH; }
01024   YY_BREAK
01025 case 31:
01026 YY_RULE_SETUP
01027 #line 166 "scanner.l"
01028 { return TOK_HASH; }
01029   YY_BREAK
01030 case 32:
01031 YY_RULE_SETUP
01032 #line 167 "scanner.l"
01033 { return TOK_TILDE; }
01034   YY_BREAK
01035 case 33:
01036 YY_RULE_SETUP
01037 #line 168 "scanner.l"
01038 { return TOK_COMMA; }
01039   YY_BREAK
01040 case 34:
01041 YY_RULE_SETUP
01042 #line 169 "scanner.l"
01043 { return TOK_OR; }
01044   YY_BREAK
01045 case 35:
01046 YY_RULE_SETUP
01047 #line 170 "scanner.l"
01048 { return TOK_FORCE; }
01049   YY_BREAK
01050 case 36:
01051 YY_RULE_SETUP
01052 #line 172 "scanner.l"
01053 { yylval.intVal = atoi(yytext); return TOK_NUMBER; }
01054   YY_BREAK
01055 case 37:
01056 YY_RULE_SETUP
01057 #line 173 "scanner.l"
01058 { yylval.chrVal = getUnescapedChar(yytext + 1, NULL);
01059                        return TOK_CHAR; }
01060   YY_BREAK
01061 case 38:
01062 YY_RULE_SETUP
01063 #line 175 "scanner.l"
01064 { yylval.strVal = getUnescapedString(yytext);
01065                        return TOK_STRING; }
01066   YY_BREAK
01067 case 39:
01068 YY_RULE_SETUP
01069 #line 177 "scanner.l"
01070 { yylval.intVal = !strcmp(yytext, "true");
01071                                                         return TOK_BOOL; }
01072   YY_BREAK
01073 case 40:
01074 YY_RULE_SETUP
01075 #line 179 "scanner.l"
01076 { yylval.strVal = xstrdup(yytext); return TOK_NAME; }
01077   YY_BREAK
01078 case 41:
01079 YY_RULE_SETUP
01080 #line 181 "scanner.l"
01081 {
01082                        char buffer[100];
01083 #ifdef HAVE_SNPRINTF
01084                        snprintf(buffer, 100,
01085                                 "Unexpected character \'%c\' encoutered",
01086                                 yytext[0]);
01087 #else
01088                        sprintf(buffer,
01089                                "Unexpected character \'%c\' encoutered",
01090                                yytext[0]);
01091 #endif
01092                        yyerror(buffer);
01093                      }
01094   YY_BREAK
01095 
01096 case 42:
01097 YY_RULE_SETUP
01098 #line 196 "scanner.l"
01099 { appendToDmBuffer(); }
01100   YY_BREAK
01101 case 43:
01102 YY_RULE_SETUP
01103 #line 197 "scanner.l"
01104 { appendToDmBuffer(); }
01105   YY_BREAK
01106 case 44:
01107 YY_RULE_SETUP
01108 #line 198 "scanner.l"
01109 { appendToDmBuffer(); }
01110   YY_BREAK
01111 case 45:
01112 YY_RULE_SETUP
01113 #line 199 "scanner.l"
01114 { appendToDmBuffer(); }
01115   YY_BREAK
01116 case 46:
01117 YY_RULE_SETUP
01118 #line 200 "scanner.l"
01119 { appendToDmBuffer(); }
01120   YY_BREAK
01121 case YY_STATE_EOF(DUMBO):
01122 #line 201 "scanner.l"
01123 { char buffer[100];
01124 #ifdef HAVE_SNPRINTF
01125                    snprintf(buffer,100,
01126                             "Unexpected end of file encoutered",
01127                             yytext[0]);
01128 #else
01129                    sprintf(buffer,
01130                            "Unexpected end of file encoutered",
01131                            yytext[0]);
01132 #endif
01133                    yyerror(buffer);
01134                   }
01135   YY_BREAK
01136 case 47:
01137 YY_RULE_SETUP
01138 #line 213 "scanner.l"
01139 { if (yytext[0] == dmbNest) { dmbNestLevel++;
01140                                                appendToDmBuffer(); }
01141                    else {
01142                      if (yytext[0] == dmbUnnest)
01143                        if (dmbNestLevel == 1) {
01144                          BEGIN(INITIAL);
01145                          yylval.strVal = xstrdup(dmbModeBuffer);
01146                          if (dmbUnput) unput(dmbUnnest);
01147                          return TOK_DUMB;
01148                        } else 
01149                          dmbNestLevel--;
01150                      appendToDmBuffer();
01151                    }
01152                  } 
01153   YY_BREAK
01154 
01155 case 48:
01156 YY_RULE_SETUP
01157 #line 228 "scanner.l"
01158 YY_FATAL_ERROR( "flex scanner jammed" );
01159   YY_BREAK
01160 #line 1161 "lex.yy.c"
01161       case YY_STATE_EOF(INITIAL):
01162         yyterminate();
01163 
01164   case YY_END_OF_BUFFER:
01165     {
01166     /* Amount of text matched not including the EOB char. */
01167     int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
01168 
01169     /* Undo the effects of YY_DO_BEFORE_ACTION. */
01170     *yy_cp = yy_hold_char;
01171     YY_RESTORE_YY_MORE_OFFSET
01172 
01173     if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
01174       {
01175       /* We're scanning a new file or input source.  It's
01176        * possible that this happened because the user
01177        * just pointed yyin at a new source and called
01178        * yylex().  If so, then we have to assure
01179        * consistency between yy_current_buffer and our
01180        * globals.  Here is the right place to do so, because
01181        * this is the first action (other than possibly a
01182        * back-up) that will match for the new input source.
01183        */
01184       yy_n_chars = yy_current_buffer->yy_n_chars;
01185       yy_current_buffer->yy_input_file = yyin;
01186       yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
01187       }
01188 
01189     /* Note that here we test for yy_c_buf_p "<=" to the position
01190      * of the first EOB in the buffer, since yy_c_buf_p will
01191      * already have been incremented past the NUL character
01192      * (since all states make transitions on EOB to the
01193      * end-of-buffer state).  Contrast this with the test
01194      * in input().
01195      */
01196     if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01197       { /* This was really a NUL. */
01198       yy_state_type yy_next_state;
01199 
01200       yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
01201 
01202       yy_current_state = yy_get_previous_state();
01203 
01204       /* Okay, we're now positioned to make the NUL
01205        * transition.  We couldn't have
01206        * yy_get_previous_state() go ahead and do it
01207        * for us because it doesn't know how to deal
01208        * with the possibility of jamming (and we don't
01209        * want to build jamming into it because then it
01210        * will run more slowly).
01211        */
01212 
01213       yy_next_state = yy_try_NUL_trans( yy_current_state );
01214 
01215       yy_bp = yytext_ptr + YY_MORE_ADJ;
01216 
01217       if ( yy_next_state )
01218         {
01219         /* Consume the NUL. */
01220         yy_cp = ++yy_c_buf_p;
01221         yy_current_state = yy_next_state;
01222         goto yy_match;
01223         }
01224 
01225       else
01226         {
01227         yy_cp = yy_c_buf_p;
01228         goto yy_find_action;
01229         }
01230       }
01231 
01232     else switch ( yy_get_next_buffer() )
01233       {
01234       case EOB_ACT_END_OF_FILE:
01235         {
01236         yy_did_buffer_switch_on_eof = 0;
01237 
01238         if ( yywrap() )
01239           {
01240           /* Note: because we've taken care in
01241            * yy_get_next_buffer() to have set up
01242            * yytext, we can now set up
01243            * yy_c_buf_p so that if some total
01244            * hoser (like flex itself) wants to
01245            * call the scanner after we return the
01246            * YY_NULL, it'll still work - another
01247            * YY_NULL will get returned.
01248            */
01249           yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
01250 
01251           yy_act = YY_STATE_EOF(YY_START);
01252           goto do_action;
01253           }
01254 
01255         else
01256           {
01257           if ( ! yy_did_buffer_switch_on_eof )
01258             YY_NEW_FILE;
01259           }
01260         break;
01261         }
01262 
01263       case EOB_ACT_CONTINUE_SCAN:
01264         yy_c_buf_p =
01265           yytext_ptr + yy_amount_of_matched_text;
01266 
01267         yy_current_state = yy_get_previous_state();
01268 
01269         yy_cp = yy_c_buf_p;
01270         yy_bp = yytext_ptr + YY_MORE_ADJ;
01271         goto yy_match;
01272 
01273       case EOB_ACT_LAST_MATCH:
01274         yy_c_buf_p =
01275         &yy_current_buffer->yy_ch_buf[yy_n_chars];
01276 
01277         yy_current_state = yy_get_previous_state();
01278 
01279         yy_cp = yy_c_buf_p;
01280         yy_bp = yytext_ptr + YY_MORE_ADJ;
01281         goto yy_find_action;
01282       }
01283     break;
01284     }
01285 
01286   default:
01287     YY_FATAL_ERROR(
01288       "fatal flex scanner internal error--no action found" );
01289   } /* end of action switch */
01290     } /* end of scanning one token */
01291   } /* end of yylex */
01292 
01293 
01294 /* yy_get_next_buffer - try to read in a new buffer
01295  *
01296  * Returns a code representing an action:
01297  *  EOB_ACT_LAST_MATCH -
01298  *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
01299  *  EOB_ACT_END_OF_FILE - end of file
01300  */
01301 
01302 static int yy_get_next_buffer()
01303   {
01304   register char *dest = yy_current_buffer->yy_ch_buf;
01305   register char *source = yytext_ptr;
01306   register int number_to_move, i;
01307   int ret_val;
01308 
01309   if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
01310     YY_FATAL_ERROR(
01311     "fatal flex scanner internal error--end of buffer missed" );
01312 
01313   if ( yy_current_buffer->yy_fill_buffer == 0 )
01314     { /* Don't try to fill the buffer, so this is an EOF. */
01315     if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
01316       {
01317       /* We matched a single character, the EOB, so
01318        * treat this as a final EOF.
01319        */
01320       return EOB_ACT_END_OF_FILE;
01321       }
01322 
01323     else
01324       {
01325       /* We matched some text prior to the EOB, first
01326        * process it.
01327        */
01328       return EOB_ACT_LAST_MATCH;
01329       }
01330     }
01331 
01332   /* Try to read more data. */
01333 
01334   /* First move last chars to start of buffer. */
01335   number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
01336 
01337   for ( i = 0; i < number_to_move; ++i )
01338     *(dest++) = *(source++);
01339 
01340   if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01341     /* don't do the read, it's not guaranteed to return an EOF,
01342      * just force an EOF
01343      */
01344     yy_current_buffer->yy_n_chars = yy_n_chars = 0;
01345 
01346   else
01347     {
01348     int num_to_read =
01349       yy_current_buffer->yy_buf_size - number_to_move - 1;
01350 
01351     while ( num_to_read <= 0 )
01352       { /* Not enough room in the buffer - grow it. */
01353 #ifdef YY_USES_REJECT
01354       YY_FATAL_ERROR(
01355 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
01356 #else
01357 
01358       /* just a shorter name for the current buffer */
01359       YY_BUFFER_STATE b = yy_current_buffer;
01360 
01361       int yy_c_buf_p_offset =
01362         (int) (yy_c_buf_p - b->yy_ch_buf);
01363 
01364       if ( b->yy_is_our_buffer )
01365         {
01366         int new_size = b->yy_buf_size * 2;
01367 
01368         if ( new_size <= 0 )
01369           b->yy_buf_size += b->yy_buf_size / 8;
01370         else
01371           b->yy_buf_size *= 2;
01372 
01373         b->yy_ch_buf = (char *)
01374           /* Include room in for 2 EOB chars. */
01375           yy_flex_realloc( (void *) b->yy_ch_buf,
01376                b->yy_buf_size + 2 );
01377         }
01378       else
01379         /* Can't grow it, we don't own it. */
01380         b->yy_ch_buf = 0;
01381 
01382       if ( ! b->yy_ch_buf )
01383         YY_FATAL_ERROR(
01384         "fatal error - scanner input buffer overflow" );
01385 
01386       yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
01387 
01388       num_to_read = yy_current_buffer->yy_buf_size -
01389             number_to_move - 1;
01390 #endif
01391       }
01392 
01393     if ( num_to_read > YY_READ_BUF_SIZE )
01394       num_to_read = YY_READ_BUF_SIZE;
01395 
01396     /* Read in more data. */
01397     YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
01398       yy_n_chars, num_to_read );
01399 
01400     yy_current_buffer->yy_n_chars = yy_n_chars;
01401     }
01402 
01403   if ( yy_n_chars == 0 )
01404     {
01405     if ( number_to_move == YY_MORE_ADJ )
01406       {
01407       ret_val = EOB_ACT_END_OF_FILE;
01408       yyrestart( yyin );
01409       }
01410 
01411     else
01412       {
01413       ret_val = EOB_ACT_LAST_MATCH;
01414       yy_current_buffer->yy_buffer_status =
01415         YY_BUFFER_EOF_PENDING;
01416       }
01417     }
01418 
01419   else
01420     ret_val = EOB_ACT_CONTINUE_SCAN;
01421 
01422   yy_n_chars += number_to_move;
01423   yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
01424   yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
01425 
01426   yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
01427 
01428   return ret_val;
01429   }
01430 
01431 
01432 /* yy_get_previous_state - get the state just before the EOB char was reached */
01433 
01434 static yy_state_type yy_get_previous_state()
01435   {
01436   register yy_state_type yy_current_state;
01437   register char *yy_cp;
01438 
01439   yy_current_state = yy_start;
01440   yy_state_ptr = yy_state_buf;
01441   *yy_state_ptr++ = yy_current_state;
01442 
01443   for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
01444     {
01445     register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01446     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01447       {
01448       yy_current_state = (int) yy_def[yy_current_state];
01449       if ( yy_current_state >= 160 )
01450         yy_c = yy_meta[(unsigned int) yy_c];
01451       }
01452     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01453     *yy_state_ptr++ = yy_current_state;
01454     }
01455 
01456   return yy_current_state;
01457   }
01458 
01459 
01460 /* yy_try_NUL_trans - try to make a transition on the NUL character
01461  *
01462  * synopsis
01463  *  next_state = yy_try_NUL_trans( current_state );
01464  */
01465 
01466 #ifdef YY_USE_PROTOS
01467 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
01468 #else
01469 static yy_state_type yy_try_NUL_trans( yy_current_state )
01470 yy_state_type yy_current_state;
01471 #endif
01472   {
01473   register int yy_is_jam;
01474 
01475   register YY_CHAR yy_c = 1;
01476   while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01477     {
01478     yy_current_state = (int) yy_def[yy_current_state];
01479     if ( yy_current_state >= 160 )
01480       yy_c = yy_meta[(unsigned int) yy_c];
01481     }
01482   yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01483   yy_is_jam = (yy_current_state == 159);
01484   if ( ! yy_is_jam )
01485     *yy_state_ptr++ = yy_current_state;
01486 
01487   return yy_is_jam ? 0 : yy_current_state;
01488   }
01489 
01490 
01491 #ifndef YY_NO_UNPUT
01492 #ifdef YY_USE_PROTOS
01493 static void yyunput( int c, register char *yy_bp )
01494 #else
01495 static void yyunput( c, yy_bp )
01496 int c;
01497 register char *yy_bp;
01498 #endif
01499   {
01500   register char *yy_cp = yy_c_buf_p;
01501 
01502   /* undo effects of setting up yytext */
01503   *yy_cp = yy_hold_char;
01504 
01505   if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01506     { /* need to shift things up to make room */
01507     /* +2 for EOB chars. */
01508     register int number_to_move = yy_n_chars + 2;
01509     register char *dest = &yy_current_buffer->yy_ch_buf[
01510           yy_current_buffer->yy_buf_size + 2];
01511     register char *source =
01512         &yy_current_buffer->yy_ch_buf[number_to_move];
01513 
01514     while ( source > yy_current_buffer->yy_ch_buf )
01515       *--dest = *--source;
01516 
01517     yy_cp += (int) (dest - source);
01518     yy_bp += (int) (dest - source);
01519     yy_current_buffer->yy_n_chars =
01520       yy_n_chars = yy_current_buffer->yy_buf_size;
01521 
01522     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01523       YY_FATAL_ERROR( "flex scanner push-back overflow" );
01524     }
01525 
01526   *--yy_cp = (char) c;
01527 
01528   if ( c == '\n' )
01529     --yylineno;
01530 
01531   yytext_ptr = yy_bp;
01532   yy_hold_char = *yy_cp;
01533   yy_c_buf_p = yy_cp;
01534   }
01535 #endif  /* ifndef YY_NO_UNPUT */
01536 
01537 
01538 #ifdef __cplusplus
01539 static int yyinput()
01540 #else
01541 static int input()
01542 #endif
01543   {
01544   int c;
01545 
01546   *yy_c_buf_p = yy_hold_char;
01547 
01548   if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
01549     {
01550     /* yy_c_buf_p now points to the character we want to return.
01551      * If this occurs *before* the EOB characters, then it's a
01552      * valid NUL; if not, then we've hit the end of the buffer.
01553      */
01554     if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01555       /* This was really a NUL. */
01556       *yy_c_buf_p = '\0';
01557 
01558     else
01559       { /* need more input */
01560       int offset = yy_c_buf_p - yytext_ptr;
01561       ++yy_c_buf_p;
01562 
01563       switch ( yy_get_next_buffer() )
01564         {
01565         case EOB_ACT_LAST_MATCH:
01566           /* This happens because yy_g_n_b()
01567            * sees that we've accumulated a
01568            * token and flags that we need to
01569            * try matching the token before
01570            * proceeding.  But for input(),
01571            * there's no matching to consider.
01572            * So convert the EOB_ACT_LAST_MATCH
01573            * to EOB_ACT_END_OF_FILE.
01574            */
01575 
01576           /* Reset buffer status. */
01577           yyrestart( yyin );
01578 
01579           /* fall through */
01580 
01581         case EOB_ACT_END_OF_FILE:
01582           {
01583           if ( yywrap() )
01584             return EOF;
01585 
01586           if ( ! yy_did_buffer_switch_on_eof )
01587             YY_NEW_FILE;
01588 #ifdef __cplusplus
01589           return yyinput();
01590 #else
01591           return input();
01592 #endif
01593           }
01594 
01595         case EOB_ACT_CONTINUE_SCAN:
01596           yy_c_buf_p = yytext_ptr + offset;
01597           break;
01598         }
01599       }
01600     }
01601 
01602   c = *(unsigned char *) yy_c_buf_p;  /* cast for 8-bit char's */
01603   *yy_c_buf_p = '\0'; /* preserve yytext */
01604   yy_hold_char = *++yy_c_buf_p;
01605 
01606   if ( c == '\n' )
01607     ++yylineno;
01608 
01609   return c;
01610   }
01611 
01612 
01613 #ifdef YY_USE_PROTOS
01614 void yyrestart( FILE *input_file )
01615 #else
01616 void yyrestart( input_file )
01617 FILE *input_file;
01618 #endif
01619   {
01620   if ( ! yy_current_buffer )
01621     yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
01622 
01623   yy_init_buffer( yy_current_buffer, input_file );
01624   yy_load_buffer_state();
01625   }
01626 
01627 
01628 #ifdef YY_USE_PROTOS
01629 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
01630 #else
01631 void yy_switch_to_buffer( new_buffer )
01632 YY_BUFFER_STATE new_buffer;
01633 #endif
01634   {
01635   if ( yy_current_buffer == new_buffer )
01636     return;
01637 
01638   if ( yy_current_buffer )
01639     {
01640     /* Flush out information for old buffer. */
01641     *yy_c_buf_p = yy_hold_char;
01642     yy_current_buffer->yy_buf_pos = yy_c_buf_p;
01643     yy_current_buffer->yy_n_chars = yy_n_chars;
01644     }
01645 
01646   yy_current_buffer = new_buffer;
01647   yy_load_buffer_state();
01648 
01649   /* We don't actually know whether we did this switch during
01650    * EOF (yywrap()) processing, but the only time this flag
01651    * is looked at is after yywrap() is called, so it's safe
01652    * to go ahead and always set it.
01653    */
01654   yy_did_buffer_switch_on_eof = 1;
01655   }
01656 
01657 
01658 #ifdef YY_USE_PROTOS
01659 void yy_load_buffer_state( void )
01660 #else
01661 void yy_load_buffer_state()
01662 #endif
01663   {
01664   yy_n_chars = yy_current_buffer->yy_n_chars;
01665   yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
01666   yyin = yy_current_buffer->yy_input_file;
01667   yy_hold_char = *yy_c_buf_p;
01668   }
01669 
01670 
01671 #ifdef YY_USE_PROTOS
01672 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
01673 #else
01674 YY_BUFFER_STATE yy_create_buffer( file, size )
01675 FILE *file;
01676 int size;
01677 #endif
01678   {
01679   YY_BUFFER_STATE b;
01680 
01681   b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
01682   if ( ! b )
01683     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01684 
01685   b->yy_buf_size = size;
01686 
01687   /* yy_ch_buf has to be 2 characters longer than the size given because
01688    * we need to put in 2 end-of-buffer characters.
01689    */
01690   b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
01691   if ( ! b->yy_ch_buf )
01692     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01693 
01694   b->yy_is_our_buffer = 1;
01695 
01696   yy_init_buffer( b, file );
01697 
01698   return b;
01699   }
01700 
01701 
01702 #ifdef YY_USE_PROTOS
01703 void yy_delete_buffer( YY_BUFFER_STATE b )
01704 #else
01705 void yy_delete_buffer( b )
01706 YY_BUFFER_STATE b;
01707 #endif
01708   {
01709   if ( ! b )
01710     return;
01711 
01712   if ( b == yy_current_buffer )
01713     yy_current_buffer = (YY_BUFFER_STATE) 0;
01714 
01715   if ( b->yy_is_our_buffer )
01716     yy_flex_free( (void *) b->yy_ch_buf );
01717 
01718   yy_flex_free( (void *) b );
01719   }
01720 
01721 
01722 
01723 #ifdef YY_USE_PROTOS
01724 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
01725 #else
01726 void yy_init_buffer( b, file )
01727 YY_BUFFER_STATE b;
01728 FILE *file;
01729 #endif
01730 
01731 
01732   {
01733   yy_flush_buffer( b );
01734 
01735   b->yy_input_file = file;
01736   b->yy_fill_buffer = 1;
01737 
01738 #if YY_ALWAYS_INTERACTIVE
01739   b->yy_is_interactive = 1;
01740 #else
01741 #if YY_NEVER_INTERACTIVE
01742   b->yy_is_interactive = 0;
01743 #else
01744   b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01745 #endif
01746 #endif
01747   }
01748 
01749 
01750 #ifdef YY_USE_PROTOS
01751 void yy_flush_buffer( YY_BUFFER_STATE b )
01752 #else
01753 void yy_flush_buffer( b )
01754 YY_BUFFER_STATE b;
01755 #endif
01756 
01757   {
01758   if ( ! b )
01759     return;
01760 
01761   b->yy_n_chars = 0;
01762 
01763   /* We always need two end-of-buffer characters.  The first causes
01764    * a transition to the end-of-buffer state.  The second causes
01765    * a jam in that state.
01766    */
01767   b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01768   b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01769 
01770   b->yy_buf_pos = &b->yy_ch_buf[0];
01771 
01772   b->yy_at_bol = 1;
01773   b->yy_buffer_status = YY_BUFFER_NEW;
01774 
01775   if ( b == yy_current_buffer )
01776     yy_load_buffer_state();
01777   }
01778 
01779 
01780 #ifndef YY_NO_SCAN_BUFFER
01781 #ifdef YY_USE_PROTOS
01782 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
01783 #else
01784 YY_BUFFER_STATE yy_scan_buffer( base, size )
01785 char *base;
01786 yy_size_t size;
01787 #endif
01788   {
01789   YY_BUFFER_STATE b;
01790 
01791   if ( size < 2 ||
01792        base[size-2] != YY_END_OF_BUFFER_CHAR ||
01793        base[size-1] != YY_END_OF_BUFFER_CHAR )
01794     /* They forgot to leave room for the EOB's. */
01795     return 0;
01796 
01797   b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
01798   if ( ! b )
01799     YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
01800 
01801   b->yy_buf_size = size - 2;  /* "- 2" to take care of EOB's */
01802   b->yy_buf_pos = b->yy_ch_buf = base;
01803   b->yy_is_our_buffer = 0;
01804   b->yy_input_file = 0;
01805   b->yy_n_chars = b->yy_buf_size;
01806   b->yy_is_interactive = 0;
01807   b->yy_at_bol = 1;
01808   b->yy_fill_buffer = 0;
01809   b->yy_buffer_status = YY_BUFFER_NEW;
01810 
01811   yy_switch_to_buffer( b );
01812 
01813   return b;
01814   }
01815 #endif
01816 
01817 
01818 #ifndef YY_NO_SCAN_STRING
01819 #ifdef YY_USE_PROTOS
01820 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
01821 #else
01822 YY_BUFFER_STATE yy_scan_string( yy_str )
01823 yyconst char *yy_str;
01824 #endif
01825   {
01826   int len;
01827   for ( len = 0; yy_str[len]; ++len )
01828     ;
01829 
01830   return yy_scan_bytes( yy_str, len );
01831   }
01832 #endif
01833 
01834 
01835 #ifndef YY_NO_SCAN_BYTES
01836 #ifdef YY_USE_PROTOS
01837 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
01838 #else
01839 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
01840 yyconst char *bytes;
01841 int len;
01842 #endif
01843   {
01844   YY_BUFFER_STATE b;
01845   char *buf;
01846   yy_size_t n;
01847   int i;
01848 
01849   /* Get memory for full buffer, including space for trailing EOB's. */
01850   n = len + 2;
01851   buf = (char *) yy_flex_alloc( n );
01852   if ( ! buf )
01853     YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
01854 
01855   for ( i = 0; i < len; ++i )
01856     buf[i] = bytes[i];
01857 
01858   buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
01859 
01860   b = yy_scan_buffer( buf, n );
01861   if ( ! b )
01862     YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
01863 
01864   /* It's okay to grow etc. this buffer, and we should throw it
01865    * away when we're done.
01866    */
01867   b->yy_is_our_buffer = 1;
01868 
01869   return b;
01870   }
01871 #endif
01872 
01873 
01874 #ifndef YY_NO_PUSH_STATE
01875 #ifdef YY_USE_PROTOS
01876 static void yy_push_state( int new_state )
01877 #else
01878 static void yy_push_state( new_state )
01879 int new_state;
01880 #endif
01881   {
01882   if ( yy_start_stack_ptr >= yy_start_stack_depth )
01883     {
01884     yy_size_t new_size;
01885 
01886     yy_start_stack_depth += YY_START_STACK_INCR;
01887     new_size = yy_start_stack_depth * sizeof( int );
01888 
01889     if ( ! yy_start_stack )
01890       yy_start_stack = (int *) yy_flex_alloc( new_size );
01891 
01892     else
01893       yy_start_stack = (int *) yy_flex_realloc(
01894           (void *) yy_start_stack, new_size );
01895 
01896     if ( ! yy_start_stack )
01897       YY_FATAL_ERROR(
01898       "out of memory expanding start-condition stack" );
01899     }
01900 
01901   yy_start_stack[yy_start_stack_ptr++] = YY_START;
01902 
01903   BEGIN(new_state);
01904   }
01905 #endif
01906 
01907 
01908 #ifndef YY_NO_POP_STATE
01909 static void yy_pop_state()
01910   {
01911   if ( --yy_start_stack_ptr < 0 )
01912     YY_FATAL_ERROR( "start-condition stack underflow" );
01913 
01914   BEGIN(yy_start_stack[yy_start_stack_ptr]);
01915   }
01916 #endif
01917 
01918 
01919 #ifndef YY_NO_TOP_STATE
01920 static int yy_top_state()
01921   {
01922   return yy_start_stack[yy_start_stack_ptr - 1];
01923   }
01924 #endif
01925 
01926 #ifndef YY_EXIT_FAILURE
01927 #define YY_EXIT_FAILURE 2
01928 #endif
01929 
01930 #ifdef YY_USE_PROTOS
01931 static void yy_fatal_error( yyconst char msg[] )
01932 #else
01933 static void yy_fatal_error( msg )
01934 char msg[];
01935 #endif
01936   {
01937   (void) fprintf( stderr, "%s\n", msg );
01938   exit( YY_EXIT_FAILURE );
01939   }
01940 
01941 
01942 
01943 /* Redefine yyless() so it works in section 3 code. */
01944 
01945 #undef yyless
01946 #define yyless(n) \
01947   do \
01948     { \
01949     /* Undo effects of setting up yytext. */ \
01950     yytext[yyleng] = yy_hold_char; \
01951     yy_c_buf_p = yytext + n; \
01952     yy_hold_char = *yy_c_buf_p; \
01953     *yy_c_buf_p = '\0'; \
01954     yyleng = n; \
01955     } \
01956   while ( 0 )
01957 
01958 
01959 /* Internal utility routines. */
01960 
01961 #ifndef yytext_ptr
01962 #ifdef YY_USE_PROTOS
01963 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
01964 #else
01965 static void yy_flex_strncpy( s1, s2, n )
01966 char *s1;
01967 yyconst char *s2;
01968 int n;
01969 #endif
01970   {
01971   register int i;
01972   for ( i = 0; i < n; ++i )
01973     s1[i] = s2[i];
01974   }
01975 #endif
01976 
01977 #ifdef YY_NEED_STRLEN
01978 #ifdef YY_USE_PROTOS
01979 static int yy_flex_strlen( yyconst char *s )
01980 #else
01981 static int yy_flex_strlen( s )
01982 yyconst char *s;
01983 #endif
01984   {
01985   register int n;
01986   for ( n = 0; s[n]; ++n )
01987     ;
01988 
01989   return n;
01990   }
01991 #endif
01992 
01993 
01994 #ifdef YY_USE_PROTOS
01995 static void *yy_flex_alloc( yy_size_t size )
01996 #else
01997 static void *yy_flex_alloc( size )
01998 yy_size_t size;
01999 #endif
02000   {
02001   return (void *) malloc( size );
02002   }
02003 
02004 #ifdef YY_USE_PROTOS
02005 static void *yy_flex_realloc( void *ptr, yy_size_t size )
02006 #else
02007 static void *yy_flex_realloc( ptr, size )
02008 void *ptr;
02009 yy_size_t size;
02010 #endif
02011   {
02012   /* The cast to (char *) in the following accommodates both
02013    * implementations that use char* generic pointers, and those
02014    * that use void* generic pointers.  It works with the latter
02015    * because both ANSI C and C++ allow castless assignment from
02016    * any pointer type to void*, and deal with argument conversions
02017    * as though doing an assignment.
02018    */
02019   return (void *) realloc( (char *) ptr, size );
02020   }
02021 
02022 #ifdef YY_USE_PROTOS
02023 static void yy_flex_free( void *ptr )
02024 #else
02025 static void yy_flex_free( ptr )
02026 void *ptr;
02027 #endif
02028   {
02029   free( ptr );
02030   }
02031 
02032 #if YY_MAIN
02033 int main()
02034   {
02035   yylex();
02036   return 0;
02037   }
02038 #endif
02039 #line 228 "scanner.l"
02040 
02041 
02042 
02043 /*
02044   When in "dumb mode" the scanner just searches for a matching terminator
02045   characetr. Everything it sees up to that is stored (via yymore) into a big
02046   token. This is useful when scanning blocks of C++ code, lists of parameters,
02047   etc that we don't really want to break up into components.
02048   Actually, this mode is not as "dumb" as it seems, because it handles
02049   balanced parenteses (this is what it actually does) - so its smarter than
02050   the "smart" rest of the scanner ;-)
02051 */
02052 
02053 int dmbModeBufLen = 0;
02054 int dmbModeBufSize = 50;
02055 
02056 void enterDumbMode (char nest, char unnest, int unput)
02057 {
02058   BEGIN(DUMBO);
02059   dmbNest = nest;
02060   dmbUnnest = unnest;
02061   dmbUnput = unput;
02062   dmbNestLevel = 1;
02063 
02064   if (dmbModeBuffer == NULL)
02065     dmbModeBuffer = xmalloc(dmbModeBufSize);
02066 
02067   dmbModeBufLen = 0;
02068   dmbModeBuffer[0] = '\0';
02069 }
02070 
02071 void appendToDmBuffer (void)
02072 {
02073   if (yyleng + dmbModeBufLen >= dmbModeBufSize) {
02074     while (yyleng + dmbModeBufLen >= dmbModeBufSize)
02075       dmbModeBufSize *= 2;
02076     dmbModeBuffer = xrealloc(dmbModeBuffer, dmbModeBufSize);
02077   }
02078   
02079   strcat(dmbModeBuffer, yytext);
02080   dmbModeBufLen += yyleng;
02081 }
02082 
02083 
02084 char getUnescapedChar (char *literal, int *len)
02085 {
02086   int dummy;
02087   if (len == NULL) len = &dummy;
02088   
02089   if (*literal != '\\') { /* not an escape sequence */
02090     *len = 1;
02091     return *literal;
02092   }
02093   literal++;
02094   switch (*literal)
02095   {
02096   case 'n': *len = 2; return '\n';
02097   case 't': *len = 2; return '\t';
02098   case 'v': *len = 2; return '\v';
02099   case 'b': *len = 2; return '\b';
02100   case 'r': *len = 2; return '\r';    
02101   case 'f': *len = 2; return '\f';
02102   case '\\': *len = 2; return '\\';
02103   case '\"': *len = 2; return '\"';
02104   case '\'': *len = 2; return '\'';    
02105   case '\n': /* this is actually an escaped newline in the input text*/
02106     {
02107       int len1;
02108       char ch = getUnescapedChar(literal + 1, &len1);
02109       *len = len1 + 2;
02110       return ch;
02111     }
02112   case '0':
02113   case '1':
02114   case '2':
02115   case '3':
02116   case '4':
02117   case '5':
02118   case '6':
02119   case '7':
02120     {
02121       int octal = 0;
02122       int i;
02123 
02124       for (i = 0; i < 3; i++)
02125         if ((literal[i] >= '0') && (literal[i] <= '7'))
02126           octal = octal * 8 + literal[i] - '0';
02127         else break;
02128       *len = i + 1;
02129       if ((octal < 0) || (octal > 255)) {
02130         char buffer[50];
02131         sprintf(buffer, "Unknown escape sequence \'\\%03o\'.\n", octal);
02132         yyerror(buffer);
02133       }
02134       return octal;
02135     }
02136   default:
02137     {
02138       char buffer[50];
02139       sprintf(buffer, "Unknown escape sequence \'\\%c\'.\n", *literal);
02140       yyerror(buffer);
02141     }
02142   }
02143 }
02144 
02145 char* getUnescapedString (char *literal)
02146 {
02147   char *res = xstrdup(literal);
02148   char *ires = res;
02149   int incr;
02150   
02151   while(*literal != 0) {
02152     *ires++ = getUnescapedChar(literal, &incr);
02153     literal += incr;
02154   }
02155   *ires = '\0';
02156   return res;
02157 }

Generated at Tue Jul 9 21:05:45 2002 for CppCC by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001