follex.cpp

00001 #line 2 "../src/parser/follex.cpp"
00002 /* A lexical scanner generated by flex*/
00003 
00004 /* Scanner skeleton version:
00005  * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
00006  */
00007 
00008 #define FLEX_SCANNER
00009 #define YY_FLEX_MAJOR_VERSION 2
00010 #define YY_FLEX_MINOR_VERSION 5
00011 
00012 #include <stdio.h>
00013 #include <unistd.h>
00014 
00015 
00016 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
00017 #ifdef c_plusplus
00018 #ifndef __cplusplus
00019 #define __cplusplus
00020 #endif
00021 #endif
00022 
00023 
00024 #ifdef __cplusplus
00025 
00026 #include <stdlib.h>
00027 
00028 /* Use prototypes in function declarations. */
00029 #define YY_USE_PROTOS
00030 
00031 /* The "const" storage-class-modifier is valid. */
00032 #define YY_USE_CONST
00033 
00034 #else   /* ! __cplusplus */
00035 
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 /* Some routines like yy_flex_realloc() are emitted as static but are
00139    not called by all lexers. This generates warnings in some compilers,
00140    notably GCC. Arrange to suppress these. */
00141 #ifdef __GNUC__
00142 #define YY_MAY_BE_UNUSED __attribute__((unused))
00143 #else
00144 #define YY_MAY_BE_UNUSED
00145 #endif
00146 
00147 /* The following is because we cannot portably get our hands on size_t
00148  * (without autoconf's help, which isn't available because we want
00149  * flex-generated scanners to compile on their own).
00150  */
00151 typedef unsigned int yy_size_t;
00152 
00153 
00154 struct yy_buffer_state
00155         {
00156         FILE *yy_input_file;
00157 
00158         char *yy_ch_buf;                /* input buffer */
00159         char *yy_buf_pos;               /* current position in input buffer */
00160 
00161         /* Size of input buffer in bytes, not including room for EOB
00162          * characters.
00163          */
00164         yy_size_t yy_buf_size;
00165 
00166         /* Number of characters read into yy_ch_buf, not including EOB
00167          * characters.
00168          */
00169         int yy_n_chars;
00170 
00171         /* Whether we "own" the buffer - i.e., we know we created it,
00172          * and can realloc() it to grow it, and should free() it to
00173          * delete it.
00174          */
00175         int yy_is_our_buffer;
00176 
00177         /* Whether this is an "interactive" input source; if so, and
00178          * if we're using stdio for input, then we want to use getc()
00179          * instead of fread(), to make sure we stop fetching input after
00180          * each newline.
00181          */
00182         int yy_is_interactive;
00183 
00184         /* Whether we're considered to be at the beginning of a line.
00185          * If so, '^' rules will be active on the next match, otherwise
00186          * not.
00187          */
00188         int yy_at_bol;
00189 
00190         /* Whether to try to fill the input buffer when we reach the
00191          * end of it.
00192          */
00193         int yy_fill_buffer;
00194 
00195         int yy_buffer_status;
00196 #define YY_BUFFER_NEW 0
00197 #define YY_BUFFER_NORMAL 1
00198         /* When an EOF's been seen but there's still some text to process
00199          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00200          * shouldn't try reading from the input source any more.  We might
00201          * still have a bunch of tokens to match, though, because of
00202          * possible backing-up.
00203          *
00204          * When we actually see the EOF, we change the status to "new"
00205          * (via yyrestart()), so that the user can continue scanning by
00206          * just pointing yyin at a new input file.
00207          */
00208 #define YY_BUFFER_EOF_PENDING 2
00209         };
00210 
00211 static YY_BUFFER_STATE yy_current_buffer = 0;
00212 
00213 /* We provide macros for accessing buffer states in case in the
00214  * future we want to put the buffer states in a more general
00215  * "scanner state".
00216  */
00217 #define YY_CURRENT_BUFFER yy_current_buffer
00218 
00219 
00220 /* yy_hold_char holds the character lost when yytext is formed. */
00221 static char yy_hold_char;
00222 
00223 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
00224 
00225 
00226 int yyleng;
00227 
00228 /* Points to current character in buffer. */
00229 static char *yy_c_buf_p = (char *) 0;
00230 static int yy_init = 1;         /* whether we need to initialize */
00231 static int yy_start = 0;        /* start state number */
00232 
00233 /* Flag which is used to allow yywrap()'s to do buffer switches
00234  * instead of setting up a fresh yyin.  A bit of a hack ...
00235  */
00236 static int yy_did_buffer_switch_on_eof;
00237 
00238 void yyrestart YY_PROTO(( FILE *input_file ));
00239 
00240 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
00241 void yy_load_buffer_state YY_PROTO(( void ));
00242 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
00243 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00244 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
00245 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
00246 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
00247 
00248 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
00249 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
00250 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
00251 
00252 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
00253 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED;
00254 static void yy_flex_free YY_PROTO(( void * ));
00255 
00256 #define yy_new_buffer yy_create_buffer
00257 
00258 #define yy_set_interactive(is_interactive) \
00259         { \
00260         if ( ! yy_current_buffer ) \
00261                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00262         yy_current_buffer->yy_is_interactive = is_interactive; \
00263         }
00264 
00265 #define yy_set_bol(at_bol) \
00266         { \
00267         if ( ! yy_current_buffer ) \
00268                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
00269         yy_current_buffer->yy_at_bol = at_bol; \
00270         }
00271 
00272 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
00273 
00274 
00275 #define yywrap() 1
00276 #define YY_SKIP_YYWRAP
00277 typedef unsigned char YY_CHAR;
00278 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
00279 typedef int yy_state_type;
00280 extern char *yytext;
00281 #define yytext_ptr yytext
00282 
00283 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
00284 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
00285 static int yy_get_next_buffer YY_PROTO(( void ));
00286 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
00287 
00288 /* Done after the current pattern has been matched and before the
00289  * corresponding action - sets up yytext.
00290  */
00291 #define YY_DO_BEFORE_ACTION \
00292         yytext_ptr = yy_bp; \
00293         yyleng = (int) (yy_cp - yy_bp); \
00294         yy_hold_char = *yy_cp; \
00295         *yy_cp = '\0'; \
00296         yy_c_buf_p = yy_cp;
00297 
00298 #define YY_NUM_RULES 33
00299 #define YY_END_OF_BUFFER 34
00300 static yyconst short int yy_accept[83] =
00301     {   0,
00302         0,    0,   34,   32,   31,   22,   22,   31,    6,   32,
00303        32,   23,   24,   13,   14,   25,   15,   30,   32,   17,
00304        32,   26,   16,   29,   21,   21,   21,    1,    2,   31,
00305        31,    0,    0,    0,   20,    0,    0,   21,   17,    0,
00306         0,    3,   18,   17,    0,    0,   27,    9,   21,   21,
00307         8,    7,    0,   17,   21,   28,    0,    0,    3,   18,
00308         0,   19,   10,   21,   21,    0,   21,   19,    0,    0,
00309         4,   21,   21,    0,    0,   11,   21,    0,   12,    0,
00310         5,    0
00311     } ;
00312 
00313 static yyconst int yy_ec[256] =
00314     {   0,
00315         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00316         1,    4,    5,    1,    1,    1,    1,    1,    1,    1,
00317         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00318         1,    6,    7,    8,    9,    1,    1,    1,   10,   11,
00319        12,   13,   14,   15,   16,   17,   18,   19,   19,   19,
00320        19,   19,   19,   19,   19,   19,   19,    1,    1,   20,
00321        21,   22,   23,   24,   25,   26,   26,   26,   27,   28,
00322        26,   26,   29,   26,   26,   30,   26,   26,   31,   26,
00323        26,   32,   33,   34,   26,   26,   26,   35,   26,   26,
00324        36,   37,   36,   38,   26,   36,   25,   39,   40,   41,
00325 
00326        42,   28,   26,   26,   43,   26,   26,   44,   26,   45,
00327        31,   26,   26,   46,   33,   47,   48,   49,   26,   35,
00328        26,   26,   50,    1,   51,    1,    1,    1,    1,    1,
00329         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
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,    1,    1,    1,    1,    1,
00336 
00337         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00338         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00339         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00340         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00341         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00342         1,    1,    1,    1,    1
00343     } ;
00344 
00345 static yyconst int yy_meta[52] =
00346     {   0,
00347         1,    1,    2,    1,    2,    1,    1,    1,    1,    3,
00348         1,    1,    1,    1,    1,    3,    1,    1,    3,    1,
00349         1,    1,    1,    1,    3,    3,    3,    3,    3,    3,
00350         3,    3,    3,    3,    3,    1,    1,    1,    3,    3,
00351         3,    3,    3,    3,    3,    3,    3,    3,    3,    1,
00352         1
00353     } ;
00354 
00355 static yyconst short int yy_base[89] =
00356     {   0,
00357         0,    0,  165,  166,   50,  166,  166,   51,  166,   46,
00358       121,  166,  166,  166,  166,  166,  144,  145,   42,   42,
00359       140,   41,  166,  166,    0,  125,  128,  166,  166,   62,
00360        63,   67,   71,   50,  166,   71,  113,    0,   61,  140,
00361       143,    0,   48,   69,   77,  133,  166,  166,   42,   60,
00362        92,   99,  114,   90,  105,  166,  140,   81,    0,   89,
00363       133,  125,  166,  105,  110,   90,  114,  111,  116,  102,
00364       166,   79,   84,   79,  112,    0,   92,   82,    0,   40,
00365       166,  166,  136,   63,  139,  142,  145,  148
00366     } ;
00367 
00368 static yyconst short int yy_def[89] =
00369     {   0,
00370        82,    1,   82,   82,   82,   82,   82,   82,   82,   83,
00371        82,   82,   82,   82,   82,   82,   84,   82,   82,   82,
00372        82,   82,   82,   82,   84,   84,   84,   82,   82,   82,
00373        82,   82,   82,   83,   82,   82,   82,   84,   84,   82,
00374        85,   86,   82,   82,   82,   82,   82,   82,   84,   84,
00375        82,   82,   82,   84,   84,   82,   85,   87,   86,   82,
00376        82,   82,   82,   84,   84,   82,   84,   84,   88,   87,
00377        82,   84,   84,   82,   88,   84,   84,   82,   84,   82,
00378        82,    0,   82,   82,   82,   82,   82,   82
00379     } ;
00380 
00381 static yyconst short int yy_nxt[218] =
00382     {   0,
00383         4,    5,    6,    4,    7,    8,    9,   10,   11,    4,
00384        12,   13,   14,   15,   16,   17,   18,   19,   20,   21,
00385        22,    4,   23,   24,   25,   25,   26,   27,   25,   25,
00386        25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
00387        25,   26,   25,   25,   25,   25,   25,   25,   25,   28,
00388        29,   30,   30,   35,   41,   30,   31,   35,   43,   42,
00389        44,   47,   48,   30,   30,   38,   60,   30,   31,   51,
00390        64,   51,   51,   52,   34,   52,   52,   43,   34,   54,
00391        34,   81,   36,   45,   64,   43,   36,   44,   32,   45,
00392        61,   65,   61,   70,   51,   62,   51,   51,   71,   33,
00393 
00394        32,   52,   55,   52,   52,   65,   43,   60,   54,   34,
00395        45,   33,   76,   77,   70,   34,   34,   34,   61,   71,
00396        67,   79,   80,   68,   70,   76,   78,   77,   70,   68,
00397        45,   55,   68,   74,   73,   79,   34,   72,   34,   57,
00398        57,   57,   59,   62,   59,   69,   69,   69,   75,   75,
00399        75,   62,   58,   66,   63,   58,   56,   53,   50,   49,
00400        46,   40,   39,   37,   82,    3,   82,   82,   82,   82,
00401        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
00402        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
00403        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
00404 
00405        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
00406        82,   82,   82,   82,   82,   82,   82
00407     } ;
00408 
00409 static yyconst short int yy_chk[218] =
00410     {   0,
00411         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00412         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00413         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00414         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00415         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00416         1,    5,    8,   10,   19,    5,    8,   34,   20,   19,
00417        20,   22,   22,   30,   31,   84,   43,   30,   31,   32,
00418        49,   32,   32,   33,   36,   33,   33,   39,   36,   39,
00419        36,   80,   10,   20,   49,   44,   34,   44,    8,   43,
00420        45,   50,   45,   58,   51,   45,   51,   51,   58,    8,
00421 
00422        31,   52,   39,   52,   52,   50,   54,   60,   54,   36,
00423        44,   31,   72,   73,   70,   36,   36,   36,   55,   70,
00424        55,   77,   78,   55,   75,   72,   74,   73,   69,   68,
00425        60,   54,   67,   66,   65,   77,   83,   64,   83,   85,
00426        85,   85,   86,   62,   86,   87,   87,   87,   88,   88,
00427        88,   61,   57,   53,   46,   41,   40,   37,   27,   26,
00428        21,   18,   17,   11,    3,   82,   82,   82,   82,   82,
00429        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
00430        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
00431        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
00432 
00433        82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
00434        82,   82,   82,   82,   82,   82,   82
00435     } ;
00436 
00437 static yy_state_type yy_last_accepting_state;
00438 static char *yy_last_accepting_cpos;
00439 
00440 /* The intent behind this definition is that it'll catch
00441  * any uses of REJECT which flex missed.
00442  */
00443 #define REJECT reject_used_but_not_detected
00444 #define yymore() yymore_used_but_not_detected
00445 #define YY_MORE_ADJ 0
00446 #define YY_RESTORE_YY_MORE_OFFSET
00447 char *yytext;
00448 #line 1 "../src/parser/follex.y"
00449 #define INITIAL 0
00450 /*
00451  * All of the documentation and software included in the
00452  * Alchemy Software is copyrighted by Stanley Kok, Parag
00453  * Singla, Matthew Richardson, Pedro Domingos, Marc
00454  * Sumner and Hoifung Poon.
00455  * 
00456  * Copyright [2004-07] Stanley Kok, Parag Singla, Matthew
00457  * Richardson, Pedro Domingos, Marc Sumner and Hoifung
00458  * Poon. All rights reserved.
00459  * 
00460  * Contact: Pedro Domingos, University of Washington
00461  * (pedrod@cs.washington.edu).
00462  * 
00463  * Redistribution and use in source and binary forms, with
00464  * or without modification, are permitted provided that
00465  * the following conditions are met:
00466  * 
00467  * 1. Redistributions of source code must retain the above
00468  * copyright notice, this list of conditions and the
00469  * following disclaimer.
00470  * 
00471  * 2. Redistributions in binary form must reproduce the
00472  * above copyright notice, this list of conditions and the
00473  * following disclaimer in the documentation and/or other
00474  * materials provided with the distribution.
00475  * 
00476  * 3. All advertising materials mentioning features or use
00477  * of this software must display the following
00478  * acknowledgment: "This product includes software
00479  * developed by Stanley Kok, Parag Singla, Matthew
00480  * Richardson, Pedro Domingos, Marc Sumner and Hoifung
00481  * Poon in the Department of Computer Science and
00482  * Engineering at the University of Washington".
00483  * 
00484  * 4. Your publications acknowledge the use or
00485  * contribution made by the Software to your research
00486  * using the following citation(s): 
00487  * Stanley Kok, Parag Singla, Matthew Richardson and
00488  * Pedro Domingos (2005). "The Alchemy System for
00489  * Statistical Relational AI", Technical Report,
00490  * Department of Computer Science and Engineering,
00491  * University of Washington, Seattle, WA.
00492  * http://www.cs.washington.edu/ai/alchemy.
00493  * 
00494  * 5. Neither the name of the University of Washington nor
00495  * the names of its contributors may be used to endorse or
00496  * promote products derived from this software without
00497  * specific prior written permission.
00498  * 
00499  * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF WASHINGTON
00500  * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
00501  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00502  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00503  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
00504  * OF WASHINGTON OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
00505  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00506  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00507  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00508  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00509  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00510  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00511  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
00512  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00513  * 
00514  */
00515 /* scanner for first-order language */
00516 #line 69 "../src/parser/follex.y"
00517 
00518 #include "folhelper.h"
00519 
00520 bool follexDbg = false; 
00521 //bool follexDbg = true; 
00522 
00523 /* not scanning another file after current one */
00524 /* double ' and " to avoid string syntax highlighting in xemacs */
00525 /*ZZ_STRING  [""]([^""\\n\r] | ([\][ntbr\f''""]))*[""]*/
00526 /* double ' to avoid string syntax highlighting in xemacs */
00527 #line 528 "../src/parser/follex.cpp"
00528 
00529 /* Macros after this point can all be overridden by user definitions in
00530  * section 1.
00531  */
00532 
00533 #ifndef YY_SKIP_YYWRAP
00534 #ifdef __cplusplus
00535 extern "C" int yywrap YY_PROTO(( void ));
00536 #else
00537 extern int yywrap YY_PROTO(( void ));
00538 #endif
00539 #endif
00540 
00541 #ifndef YY_NO_UNPUT
00542 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
00543 #endif
00544 
00545 #ifndef yytext_ptr
00546 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
00547 #endif
00548 
00549 #ifdef YY_NEED_STRLEN
00550 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
00551 #endif
00552 
00553 #ifndef YY_NO_INPUT
00554 #ifdef __cplusplus
00555 static int yyinput YY_PROTO(( void ));
00556 #else
00557 static int input YY_PROTO(( void ));
00558 #endif
00559 #endif
00560 
00561 #if YY_STACK_USED
00562 static int yy_start_stack_ptr = 0;
00563 static int yy_start_stack_depth = 0;
00564 static int *yy_start_stack = 0;
00565 #ifndef YY_NO_PUSH_STATE
00566 static void yy_push_state YY_PROTO(( int new_state ));
00567 #endif
00568 #ifndef YY_NO_POP_STATE
00569 static void yy_pop_state YY_PROTO(( void ));
00570 #endif
00571 #ifndef YY_NO_TOP_STATE
00572 static int yy_top_state YY_PROTO(( void ));
00573 #endif
00574 
00575 #else
00576 #define YY_NO_PUSH_STATE 1
00577 #define YY_NO_POP_STATE 1
00578 #define YY_NO_TOP_STATE 1
00579 #endif
00580 
00581 #ifdef YY_MALLOC_DECL
00582 YY_MALLOC_DECL
00583 #else
00584 #if __STDC__
00585 #ifndef __cplusplus
00586 #include <stdlib.h>
00587 #endif
00588 #else
00589 /* Just try to get by without declaring the routines.  This will fail
00590  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
00591  * or sizeof(void*) != sizeof(int).
00592  */
00593 #endif
00594 #endif
00595 
00596 /* Amount of stuff to slurp up with each read. */
00597 #ifndef YY_READ_BUF_SIZE
00598 #define YY_READ_BUF_SIZE 8192
00599 #endif
00600 
00601 /* Copy whatever the last rule matched to the standard output. */
00602 
00603 #ifndef ECHO
00604 /* This used to be an fputs(), but since the string might contain NUL's,
00605  * we now use fwrite().
00606  */
00607 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
00608 #endif
00609 
00610 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00611  * is returned in "result".
00612  */
00613 #ifndef YY_INPUT
00614 #define YY_INPUT(buf,result,max_size) \
00615         if ( yy_current_buffer->yy_is_interactive ) \
00616                 { \
00617                 int c = '*', n; \
00618                 for ( n = 0; n < max_size && \
00619                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
00620                         buf[n] = (char) c; \
00621                 if ( c == '\n' ) \
00622                         buf[n++] = (char) c; \
00623                 if ( c == EOF && ferror( yyin ) ) \
00624                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
00625                 result = n; \
00626                 } \
00627         else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
00628                   && ferror( yyin ) ) \
00629                 YY_FATAL_ERROR( "input in flex scanner failed" );
00630 #endif
00631 
00632 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00633  * we don't want an extra ';' after the "return" because that will cause
00634  * some compilers to complain about unreachable statements.
00635  */
00636 #ifndef yyterminate
00637 #define yyterminate() return YY_NULL
00638 #endif
00639 
00640 /* Number of entries by which start-condition stack grows. */
00641 #ifndef YY_START_STACK_INCR
00642 #define YY_START_STACK_INCR 25
00643 #endif
00644 
00645 /* Report a fatal error. */
00646 #ifndef YY_FATAL_ERROR
00647 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00648 #endif
00649 
00650 /* Default declaration of generated scanner - a define so the user can
00651  * easily add parameters.
00652  */
00653 #ifndef YY_DECL
00654 #define YY_DECL int yylex YY_PROTO(( void ))
00655 #endif
00656 
00657 /* Code executed at the beginning of each rule, after yytext and yyleng
00658  * have been set up.
00659  */
00660 #ifndef YY_USER_ACTION
00661 #define YY_USER_ACTION
00662 #endif
00663 
00664 /* Code executed at the end of each rule. */
00665 #ifndef YY_BREAK
00666 #define YY_BREAK break;
00667 #endif
00668 
00669 #define YY_RULE_SETUP \
00670         YY_USER_ACTION
00671 
00672 YY_DECL
00673         {
00674         register yy_state_type yy_current_state;
00675         register char *yy_cp = NULL, *yy_bp = NULL;
00676         register int yy_act;
00677 
00678 #line 110 "../src/parser/follex.y"
00679 
00680 
00681 #line 682 "../src/parser/follex.cpp"
00682 
00683         if ( yy_init )
00684                 {
00685                 yy_init = 0;
00686 
00687 #ifdef YY_USER_INIT
00688                 YY_USER_INIT;
00689 #endif
00690 
00691                 if ( ! yy_start )
00692                         yy_start = 1;   /* first start state */
00693 
00694                 if ( ! yyin )
00695                         yyin = stdin;
00696 
00697                 if ( ! yyout )
00698                         yyout = stdout;
00699 
00700                 if ( ! yy_current_buffer )
00701                         yy_current_buffer =
00702                                 yy_create_buffer( yyin, YY_BUF_SIZE );
00703 
00704                 yy_load_buffer_state();
00705                 }
00706 
00707         while ( 1 )             /* loops until end-of-file is reached */
00708                 {
00709                 yy_cp = yy_c_buf_p;
00710 
00711                 /* Support of yytext. */
00712                 *yy_cp = yy_hold_char;
00713 
00714                 /* yy_bp points to the position in yy_ch_buf of the start of
00715                  * the current run.
00716                  */
00717                 yy_bp = yy_cp;
00718 
00719                 yy_current_state = yy_start;
00720 yy_match:
00721                 do
00722                         {
00723                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
00724                         if ( yy_accept[yy_current_state] )
00725                                 {
00726                                 yy_last_accepting_state = yy_current_state;
00727                                 yy_last_accepting_cpos = yy_cp;
00728                                 }
00729                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
00730                                 {
00731                                 yy_current_state = (int) yy_def[yy_current_state];
00732                                 if ( yy_current_state >= 83 )
00733                                         yy_c = yy_meta[(unsigned int) yy_c];
00734                                 }
00735                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
00736                         ++yy_cp;
00737                         }
00738                 while ( yy_base[yy_current_state] != 166 );
00739 
00740 yy_find_action:
00741                 yy_act = yy_accept[yy_current_state];
00742                 if ( yy_act == 0 )
00743                         { /* have to back up */
00744                         yy_cp = yy_last_accepting_cpos;
00745                         yy_current_state = yy_last_accepting_state;
00746                         yy_act = yy_accept[yy_current_state];
00747                         }
00748 
00749                 YY_DO_BEFORE_ACTION;
00750 
00751 
00752 do_action:      /* This label is used only to access EOF actions. */
00753 
00754 
00755                 switch ( yy_act )
00756         { /* beginning of action switch */
00757                         case 0: /* must back up */
00758                         /* undo the effects of YY_DO_BEFORE_ACTION */
00759                         *yy_cp = yy_hold_char;
00760                         yy_cp = yy_last_accepting_cpos;
00761                         yy_current_state = yy_last_accepting_state;
00762                         goto yy_find_action;
00763 
00764 case 1:
00765 YY_RULE_SETUP
00766 #line 112 "../src/parser/follex.y"
00767 {
00768   if (follexDbg) printf("LBRACE: %s\n", yytext);
00769   zzcolumn += strlen(yytext);
00770   zznumCharRead += strlen(yytext);
00771   zztokenList.add(yytext);
00772   return yytext[0];
00773 }
00774         YY_BREAK
00775 case 2:
00776 YY_RULE_SETUP
00777 #line 121 "../src/parser/follex.y"
00778 {
00779   if (follexDbg) printf("RBRACE: %s\n", yytext);
00780   zzcolumn += strlen(yytext);
00781   zznumCharRead += strlen(yytext);
00782   zztokenList.add(yytext);
00783   return yytext[0];
00784 }
00785         YY_BREAK
00786 case 3:
00787 YY_RULE_SETUP
00788 #line 130 "../src/parser/follex.y"
00789 { 
00790   if (follexDbg) printf("SINGLE_LINE_COMMENT: %s\n", yytext);
00791   if (yytext[strlen(yytext)-1] == '\n' || yytext[strlen(yytext)-1] == '\r') 
00792     {
00793       ++zzline;
00794       zzcolumn = -1;
00795     } 
00796     else
00797       zzcolumn += strlen(yytext);
00798   zznumCharRead += strlen(yytext);
00799 }
00800         YY_BREAK
00801 case 4:
00802 YY_RULE_SETUP
00803 #line 142 "../src/parser/follex.y"
00804 { 
00805   if (follexDbg) printf("MULTI_LINE_COMMENT: %s\n", yytext);
00806   int i=-1;
00807   while (yytext[++i] != '\0')
00808   {
00809     if (yytext[i] == '\n' || yytext[i] == '\r') 
00810     {
00811       ++zzline;
00812       zzcolumn = -1;
00813     } 
00814     else
00815       zzcolumn++;
00816   }
00817   zznumCharRead += strlen(yytext); 
00818 }
00819         YY_BREAK
00820 case 5:
00821 YY_RULE_SETUP
00822 #line 159 "../src/parser/follex.y"
00823 { 
00824   if (follexDbg) printf("INCLUDE: %s\n", yytext);
00825   zzcolumn += strlen(yytext);
00826   zznumCharRead += strlen(yytext);
00827   zztokenList.add(yytext);
00828   return ZZ_INCLUDE;
00829 }
00830         YY_BREAK
00831 case 6:
00832 YY_RULE_SETUP
00833 #line 168 "../src/parser/follex.y"
00834 {
00835   if (follexDbg) printf("NOT: %s\n", yytext);
00836   zzcolumn += strlen(yytext);
00837   zznumCharRead += strlen(yytext);
00838   zztokenList.add(yytext);
00839   return yytext[0];
00840 }
00841         YY_BREAK
00842 case 7:
00843 YY_RULE_SETUP
00844 #line 177 "../src/parser/follex.y"
00845 {
00846   if (follexDbg) printf("OR: %s\n", yytext);
00847   zzcolumn += strlen(yytext);
00848   zznumCharRead += strlen(yytext);
00849   zztokenList.add("v");
00850   return 'v';
00851 }
00852         YY_BREAK
00853 case 8:
00854 YY_RULE_SETUP
00855 #line 186 "../src/parser/follex.y"
00856 {
00857   if (follexDbg) printf("AND: %s\n", yytext);
00858   zzcolumn += strlen(yytext);
00859   zznumCharRead += strlen(yytext);
00860   zztokenList.add("^");
00861   return '^';
00862 }
00863         YY_BREAK
00864 case 9:
00865 YY_RULE_SETUP
00866 #line 195 "../src/parser/follex.y"
00867 {
00868   if (follexDbg) printf("IMPLY: %s\n", yytext);
00869   zzcolumn += strlen(yytext);
00870   zznumCharRead += strlen(yytext);
00871   zztokenList.add(yytext);
00872   return ZZ_IMPLY;
00873 }
00874         YY_BREAK
00875 case 10:
00876 YY_RULE_SETUP
00877 #line 204 "../src/parser/follex.y"
00878 {
00879   if (follexDbg) printf("EQUIV: %s\n", yytext);
00880   zzcolumn += strlen(yytext);
00881   zznumCharRead += strlen(yytext);
00882   zztokenList.add(yytext);
00883   return ZZ_EQUIV;
00884 }
00885         YY_BREAK
00886 case 11:
00887 YY_RULE_SETUP
00888 #line 213 "../src/parser/follex.y"
00889 { 
00890   if (follexDbg) printf("EXIST: %s\n", yytext);
00891   zzcolumn += strlen(yytext);
00892   zznumCharRead += strlen(yytext);
00893   zztokenList.add(yytext);
00894   return ZZ_EXIST;
00895 }
00896         YY_BREAK
00897 case 12:
00898 YY_RULE_SETUP
00899 #line 222 "../src/parser/follex.y"
00900 { 
00901   if (follexDbg) printf("FORALL: %s\n", yytext);
00902   zzcolumn += strlen(yytext);
00903   zznumCharRead += strlen(yytext);
00904   zztokenList.add(yytext);
00905   return ZZ_FORALL;
00906 }
00907         YY_BREAK
00908 case 13:
00909 YY_RULE_SETUP
00910 #line 231 "../src/parser/follex.y"
00911 {
00912   if (follexDbg) printf("ASTERISK: %s\n", yytext);
00913   zzcolumn += strlen(yytext);
00914   zznumCharRead += strlen(yytext);
00915   zztokenList.add(yytext);
00916   return yytext[0];
00917 }
00918         YY_BREAK
00919 case 14:
00920 YY_RULE_SETUP
00921 #line 240 "../src/parser/follex.y"
00922 {
00923   if (follexDbg) printf("PLUS: %s\n", yytext);
00924   zzcolumn += strlen(yytext);
00925   zznumCharRead += strlen(yytext);
00926   zztokenList.add(yytext);
00927   return yytext[0];
00928 }
00929         YY_BREAK
00930 case 15:
00931 YY_RULE_SETUP
00932 #line 249 "../src/parser/follex.y"
00933 {
00934   if (follexDbg) printf("MINUS: %s\n", yytext);
00935   zzcolumn += strlen(yytext);
00936   zznumCharRead += strlen(yytext);
00937   zztokenList.add(yytext);
00938   return yytext[0];
00939 }
00940         YY_BREAK
00941 case 16:
00942 YY_RULE_SETUP
00943 #line 257 "../src/parser/follex.y"
00944 {
00945   if (follexDbg) printf("QS: %s\n", yytext);
00946   zzcolumn += strlen(yytext);
00947   zznumCharRead += strlen(yytext);
00948   zztokenList.add(yytext);
00949   return yytext[0];
00950 }
00951         YY_BREAK
00952 case 17:
00953 YY_RULE_SETUP
00954 #line 266 "../src/parser/follex.y"
00955 {
00956   if (follexDbg) printf("INTEGER: %s (%d)\n", yytext, atoi(yytext));
00957   zzcolumn += strlen(yytext);
00958   zznumCharRead += strlen(yytext);
00959   zztokenList.add(yytext);
00960   return ZZ_NUM;  
00961 }
00962         YY_BREAK
00963 case 18:
00964 YY_RULE_SETUP
00965 #line 275 "../src/parser/follex.y"
00966 {
00967   if (follexDbg) printf("FLOAT: %s (%g)\n", yytext, atof(yytext));
00968   zzcolumn += strlen(yytext);
00969   zznumCharRead += strlen(yytext);
00970   zztokenList.add(yytext);
00971   return ZZ_NUM;
00972 }
00973         YY_BREAK
00974 case 19:
00975 YY_RULE_SETUP
00976 #line 284 "../src/parser/follex.y"
00977 {
00978   if (follexDbg) printf("EXP_FLOAT: %s (%e)\n", yytext, atof(yytext));
00979   zzcolumn += strlen(yytext);
00980   zznumCharRead += strlen(yytext);
00981   zztokenList.add(yytext);
00982   return ZZ_NUM;
00983 }
00984         YY_BREAK
00985 case 20:
00986 YY_RULE_SETUP
00987 #line 293 "../src/parser/follex.y"
00988 {
00989   if (follexDbg) printf("STRING: %s \n", yytext);
00990   zzcolumn += strlen(yytext);
00991   zznumCharRead += strlen(yytext);
00992   zztokenList.add(yytext);
00993   if (zzdomain->isConstant(yytext)) return ZZ_CONSTANT;
00994   return ZZ_STRING;
00995 }
00996         YY_BREAK
00997 case 21:
00998 YY_RULE_SETUP
00999 #line 303 "../src/parser/follex.y"
01000 {
01001   //if (follexDbg) printf("IDENTIFIER: %s\n", yytext );
01002   zzcolumn += strlen(yytext);
01003   zznumCharRead += strlen(yytext);
01004   zztokenList.add(yytext);
01005   if (zzdomain->isType(yytext))
01006   { 
01007     if (follexDbg) printf("ZZ_TYPE: %s\n", yytext ); 
01008     return ZZ_TYPE;
01009   }
01010   if (zzdomain->isPredicate(yytext)) 
01011   { 
01012     if (follexDbg) printf("ZZ_PREDICATE: %s\n", yytext ); 
01013     return ZZ_PREDICATE; 
01014   }
01015   if (zzdomain->isFunction(yytext))  
01016   {  
01017     if (follexDbg) printf("ZZ_FUNCTION: %s\n", yytext ); 
01018     return ZZ_FUNCTION;
01019   }
01020   if (zzdomain->isConstant(yytext))
01021   {
01022     if (follexDbg) printf("ZZ_CONSTANT: %s\n", yytext ); 
01023     return ZZ_CONSTANT;
01024   }
01025   if (follexDbg) printf("ZZ_VARIABLE: %s\n", yytext ); 
01026   return ZZ_VARIABLE;
01027 }
01028         YY_BREAK
01029 case 22:
01030 YY_RULE_SETUP
01031 #line 333 "../src/parser/follex.y"
01032 {
01033   if (follexDbg) 
01034   {
01035     if (zzparseGroundPred) printf("AT: %c\n", '@');
01036     else                   printf("NEWLINE: %s", yytext);
01037   }
01038   ++zzline;
01039   zznumCharRead += 1;
01040   zzcolumn = -1;
01041   if (zzparseGroundPred) { 
01042         zzafterRtParen = false;
01043         zztokenList.add("@");
01044         return '@';
01045   }
01046   zztokenList.add(yytext);
01047   return yytext[0];
01048 }
01049         YY_BREAK
01050 case 23:
01051 YY_RULE_SETUP
01052 #line 352 "../src/parser/follex.y"
01053 {
01054   if (follexDbg) printf("LEFT PAREN: %s\n", yytext);
01055   zzcolumn += strlen(yytext);
01056   zznumCharRead += strlen(yytext);
01057   zztokenList.add(yytext);
01058   if (zzparseGroundPred) zzafterRtParen = false;
01059   return yytext[0];
01060 }
01061         YY_BREAK
01062 case 24:
01063 YY_RULE_SETUP
01064 #line 362 "../src/parser/follex.y"
01065 {
01066   if (follexDbg) printf("RIGHT PAREN: %s\n", yytext);
01067   zzcolumn += strlen(yytext);
01068   zznumCharRead += strlen(yytext);
01069   zztokenList.add(yytext);
01070   if (zzparseGroundPred) zzafterRtParen = true;
01071   return yytext[0];
01072 }
01073         YY_BREAK
01074 case 25:
01075 YY_RULE_SETUP
01076 #line 372 "../src/parser/follex.y"
01077 {
01078   if (follexDbg) printf("COMMA: %s\n", yytext);
01079   zzcolumn += strlen(yytext);
01080   zznumCharRead += strlen(yytext);
01081   zztokenList.add(yytext);
01082   return yytext[0];
01083 }
01084         YY_BREAK
01085 case 26:
01086 YY_RULE_SETUP
01087 #line 381 "../src/parser/follex.y"
01088 {
01089   if (follexDbg) printf("EQUAL: %s\n", yytext);
01090   zzcolumn += strlen(yytext);
01091   zznumCharRead += strlen(yytext);
01092   zztokenList.add("=");
01093   return '=';
01094 }
01095         YY_BREAK
01096 case 27:
01097 YY_RULE_SETUP
01098 #line 390 "../src/parser/follex.y"
01099 {
01100   if (follexDbg) printf("EQUALEQUAL: %s\n", yytext);
01101   zzcolumn += strlen(yytext);
01102   zznumCharRead += strlen(yytext);
01103   zztokenList.add("==");
01104   return ZZ_EQEQ;
01105 }
01106         YY_BREAK
01107 case 28:
01108 YY_RULE_SETUP
01109 #line 399 "../src/parser/follex.y"
01110 {
01111   if (follexDbg) printf("DOTDOTDOT: %s\n", yytext);
01112   zzcolumn += strlen(yytext);
01113   zznumCharRead += strlen(yytext);
01114   zztokenList.add("...");
01115   return ZZ_DOTDOTDOT;
01116 }
01117         YY_BREAK
01118 case 29:
01119 YY_RULE_SETUP
01120 #line 408 "../src/parser/follex.y"
01121 {
01122   if (follexDbg) printf("AT: %s\n", yytext);
01123   zzcolumn += strlen(yytext);
01124   zznumCharRead += strlen(yytext);
01125   zztokenList.add(yytext);
01126   return yytext[0];
01127 }
01128         YY_BREAK
01129 case 30:
01130 YY_RULE_SETUP
01131 #line 417 "../src/parser/follex.y"
01132 {
01133   if (follexDbg) printf("FULLSTOP: %s\n", yytext);
01134   zzcolumn += strlen(yytext);
01135   zznumCharRead += strlen(yytext);
01136   zztokenList.add(yytext);
01137   return yytext[0];
01138 }
01139         YY_BREAK
01140 case 31:
01141 YY_RULE_SETUP
01142 #line 426 "../src/parser/follex.y"
01143 { /* eat up whitespace */
01144   if (follexDbg) 
01145   {
01146     if (zzparseGroundPred) printf("WS:\n");
01147   }
01148   zzcolumn += strlen(yytext);
01149   zznumCharRead += strlen(yytext);
01150 
01151   if (zzparseGroundPred && zzafterRtParen) { zztokenList.add("@"); return '@'; }
01152 }
01153         YY_BREAK
01154 case 32:
01155 YY_RULE_SETUP
01156 #line 438 "../src/parser/follex.y"
01157 {
01158     // commented out so as to allow fol.y to deal with the problem
01159   //printf("\nERROR: Unrecognized character. %s: ln %d, col %d: %s \n", 
01160   //       zzinFileName.c_str(), zzline, zzcolumn+1, yytext);
01161   //exit(-1);
01162   if (follexDbg) printf("Unrecognized character: %s\n", yytext);
01163   zzcolumn += strlen(yytext);
01164   zznumCharRead += strlen(yytext);
01165   zztokenList.add(yytext);
01166   return yytext[0];
01167 
01168 }
01169         YY_BREAK
01170 case YY_STATE_EOF(INITIAL):
01171 #line 451 "../src/parser/follex.y"
01172 {
01173 
01174   if (zzparseGroundPred) 
01175   {
01176     if (zznumEofSeen == 0) 
01177     {
01178       zznumEofSeen++;
01179       if (follexDbg) printf("EOF returned as @:\n");
01180       zztokenList.add("@"); 
01181       return '@'; 
01182     }
01183     else
01184     {
01185       zzparseGroundPred = false;
01186       zzafterRtParen = false;
01187       zznumEofSeen = 0;
01188     }
01189   }
01190 
01191   if (zznumEofSeen==0)
01192   {
01193     ungetc(EOF, yyin);
01194     zznumEofSeen = 1;
01195     if (follexDbg) printf("EOF returned as \\n:\n");    
01196     zztokenList.add("\n");  // pretend that file ends with newline
01197     return '\n';
01198   }
01199   
01200   zznumEofSeen = 0;
01201   
01202   if (follexDbg) printf("EOF %s:\n", yytext);
01203   if (false) yyunput(1,NULL); //avoid compilation warning
01204 
01205   fclose(yyin);
01206   if (zzinStack.empty()) return 0;
01207 
01208   ZZFileState fileState = zzinStack.top();
01209   zzinFileName = fileState.inFileName_;
01210   zznumCharRead = fileState.numCharRead_;
01211   zzline = fileState.line_;
01212   zzcolumn = fileState.column_;
01213   zzinStack.pop();
01214 
01215   FILE* previn = fileState.file_;
01216   if (fseek(previn, zznumCharRead-1, SEEK_SET)!=0)
01217   {
01218     printf("\nERROR: In follex.y. Failed to seek to previous position in file "
01219            "%s, ln %d, col %d\n", zzinFileName.c_str(), zzline, zzcolumn+1);
01220     exit(-1);
01221   }
01222   yyrestart(previn);
01223   
01224 }
01225         YY_BREAK
01226 case 33:
01227 YY_RULE_SETUP
01228 #line 504 "../src/parser/follex.y"
01229 ECHO;
01230         YY_BREAK
01231 #line 1232 "../src/parser/follex.cpp"
01232 
01233         case YY_END_OF_BUFFER:
01234                 {
01235                 /* Amount of text matched not including the EOB char. */
01236                 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
01237 
01238                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
01239                 *yy_cp = yy_hold_char;
01240                 YY_RESTORE_YY_MORE_OFFSET
01241 
01242                 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
01243                         {
01244                         /* We're scanning a new file or input source.  It's
01245                          * possible that this happened because the user
01246                          * just pointed yyin at a new source and called
01247                          * yylex().  If so, then we have to assure
01248                          * consistency between yy_current_buffer and our
01249                          * globals.  Here is the right place to do so, because
01250                          * this is the first action (other than possibly a
01251                          * back-up) that will match for the new input source.
01252                          */
01253                         yy_n_chars = yy_current_buffer->yy_n_chars;
01254                         yy_current_buffer->yy_input_file = yyin;
01255                         yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
01256                         }
01257 
01258                 /* Note that here we test for yy_c_buf_p "<=" to the position
01259                  * of the first EOB in the buffer, since yy_c_buf_p will
01260                  * already have been incremented past the NUL character
01261                  * (since all states make transitions on EOB to the
01262                  * end-of-buffer state).  Contrast this with the test
01263                  * in input().
01264                  */
01265                 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01266                         { /* This was really a NUL. */
01267                         yy_state_type yy_next_state;
01268 
01269                         yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
01270 
01271                         yy_current_state = yy_get_previous_state();
01272 
01273                         /* Okay, we're now positioned to make the NUL
01274                          * transition.  We couldn't have
01275                          * yy_get_previous_state() go ahead and do it
01276                          * for us because it doesn't know how to deal
01277                          * with the possibility of jamming (and we don't
01278                          * want to build jamming into it because then it
01279                          * will run more slowly).
01280                          */
01281 
01282                         yy_next_state = yy_try_NUL_trans( yy_current_state );
01283 
01284                         yy_bp = yytext_ptr + YY_MORE_ADJ;
01285 
01286                         if ( yy_next_state )
01287                                 {
01288                                 /* Consume the NUL. */
01289                                 yy_cp = ++yy_c_buf_p;
01290                                 yy_current_state = yy_next_state;
01291                                 goto yy_match;
01292                                 }
01293 
01294                         else
01295                                 {
01296                                 yy_cp = yy_c_buf_p;
01297                                 goto yy_find_action;
01298                                 }
01299                         }
01300 
01301                 else switch ( yy_get_next_buffer() )
01302                         {
01303                         case EOB_ACT_END_OF_FILE:
01304                                 {
01305                                 yy_did_buffer_switch_on_eof = 0;
01306 
01307                                 if ( yywrap() )
01308                                         {
01309                                         /* Note: because we've taken care in
01310                                          * yy_get_next_buffer() to have set up
01311                                          * yytext, we can now set up
01312                                          * yy_c_buf_p so that if some total
01313                                          * hoser (like flex itself) wants to
01314                                          * call the scanner after we return the
01315                                          * YY_NULL, it'll still work - another
01316                                          * YY_NULL will get returned.
01317                                          */
01318                                         yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
01319 
01320                                         yy_act = YY_STATE_EOF(YY_START);
01321                                         goto do_action;
01322                                         }
01323 
01324                                 else
01325                                         {
01326                                         if ( ! yy_did_buffer_switch_on_eof )
01327                                                 YY_NEW_FILE;
01328                                         }
01329                                 break;
01330                                 }
01331 
01332                         case EOB_ACT_CONTINUE_SCAN:
01333                                 yy_c_buf_p =
01334                                         yytext_ptr + yy_amount_of_matched_text;
01335 
01336                                 yy_current_state = yy_get_previous_state();
01337 
01338                                 yy_cp = yy_c_buf_p;
01339                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
01340                                 goto yy_match;
01341 
01342                         case EOB_ACT_LAST_MATCH:
01343                                 yy_c_buf_p =
01344                                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
01345 
01346                                 yy_current_state = yy_get_previous_state();
01347 
01348                                 yy_cp = yy_c_buf_p;
01349                                 yy_bp = yytext_ptr + YY_MORE_ADJ;
01350                                 goto yy_find_action;
01351                         }
01352                 break;
01353                 }
01354 
01355         default:
01356                 YY_FATAL_ERROR(
01357                         "fatal flex scanner internal error--no action found" );
01358         } /* end of action switch */
01359                 } /* end of scanning one token */
01360         } /* end of yylex */
01361 
01362 
01363 /* yy_get_next_buffer - try to read in a new buffer
01364  *
01365  * Returns a code representing an action:
01366  *      EOB_ACT_LAST_MATCH -
01367  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
01368  *      EOB_ACT_END_OF_FILE - end of file
01369  */
01370 
01371 static int yy_get_next_buffer()
01372         {
01373         register char *dest = yy_current_buffer->yy_ch_buf;
01374         register char *source = yytext_ptr;
01375         register int number_to_move, i;
01376         int ret_val;
01377 
01378         if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
01379                 YY_FATAL_ERROR(
01380                 "fatal flex scanner internal error--end of buffer missed" );
01381 
01382         if ( yy_current_buffer->yy_fill_buffer == 0 )
01383                 { /* Don't try to fill the buffer, so this is an EOF. */
01384                 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
01385                         {
01386                         /* We matched a single character, the EOB, so
01387                          * treat this as a final EOF.
01388                          */
01389                         return EOB_ACT_END_OF_FILE;
01390                         }
01391 
01392                 else
01393                         {
01394                         /* We matched some text prior to the EOB, first
01395                          * process it.
01396                          */
01397                         return EOB_ACT_LAST_MATCH;
01398                         }
01399                 }
01400 
01401         /* Try to read more data. */
01402 
01403         /* First move last chars to start of buffer. */
01404         number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
01405 
01406         for ( i = 0; i < number_to_move; ++i )
01407                 *(dest++) = *(source++);
01408 
01409         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01410                 /* don't do the read, it's not guaranteed to return an EOF,
01411                  * just force an EOF
01412                  */
01413                 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
01414 
01415         else
01416                 {
01417                 int num_to_read =
01418                         yy_current_buffer->yy_buf_size - number_to_move - 1;
01419 
01420                 while ( num_to_read <= 0 )
01421                         { /* Not enough room in the buffer - grow it. */
01422 #ifdef YY_USES_REJECT
01423                         YY_FATAL_ERROR(
01424 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
01425 #else
01426 
01427                         /* just a shorter name for the current buffer */
01428                         YY_BUFFER_STATE b = yy_current_buffer;
01429 
01430                         int yy_c_buf_p_offset =
01431                                 (int) (yy_c_buf_p - b->yy_ch_buf);
01432 
01433                         if ( b->yy_is_our_buffer )
01434                                 {
01435                                 int new_size = b->yy_buf_size * 2;
01436 
01437                                 if ( new_size <= 0 )
01438                                         b->yy_buf_size += b->yy_buf_size / 8;
01439                                 else
01440                                         b->yy_buf_size *= 2;
01441 
01442                                 b->yy_ch_buf = (char *)
01443                                         /* Include room in for 2 EOB chars. */
01444                                         yy_flex_realloc( (void *) b->yy_ch_buf,
01445                                                          b->yy_buf_size + 2 );
01446                                 }
01447                         else
01448                                 /* Can't grow it, we don't own it. */
01449                                 b->yy_ch_buf = 0;
01450 
01451                         if ( ! b->yy_ch_buf )
01452                                 YY_FATAL_ERROR(
01453                                 "fatal error - scanner input buffer overflow" );
01454 
01455                         yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
01456 
01457                         num_to_read = yy_current_buffer->yy_buf_size -
01458                                                 number_to_move - 1;
01459 #endif
01460                         }
01461 
01462                 if ( num_to_read > YY_READ_BUF_SIZE )
01463                         num_to_read = YY_READ_BUF_SIZE;
01464 
01465                 /* Read in more data. */
01466                 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
01467                         yy_n_chars, num_to_read );
01468 
01469                 yy_current_buffer->yy_n_chars = yy_n_chars;
01470                 }
01471 
01472         if ( yy_n_chars == 0 )
01473                 {
01474                 if ( number_to_move == YY_MORE_ADJ )
01475                         {
01476                         ret_val = EOB_ACT_END_OF_FILE;
01477                         yyrestart( yyin );
01478                         }
01479 
01480                 else
01481                         {
01482                         ret_val = EOB_ACT_LAST_MATCH;
01483                         yy_current_buffer->yy_buffer_status =
01484                                 YY_BUFFER_EOF_PENDING;
01485                         }
01486                 }
01487 
01488         else
01489                 ret_val = EOB_ACT_CONTINUE_SCAN;
01490 
01491         yy_n_chars += number_to_move;
01492         yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
01493         yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
01494 
01495         yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
01496 
01497         return ret_val;
01498         }
01499 
01500 
01501 /* yy_get_previous_state - get the state just before the EOB char was reached */
01502 
01503 static yy_state_type yy_get_previous_state()
01504         {
01505         register yy_state_type yy_current_state;
01506         register char *yy_cp;
01507 
01508         yy_current_state = yy_start;
01509 
01510         for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
01511                 {
01512                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01513                 if ( yy_accept[yy_current_state] )
01514                         {
01515                         yy_last_accepting_state = yy_current_state;
01516                         yy_last_accepting_cpos = yy_cp;
01517                         }
01518                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01519                         {
01520                         yy_current_state = (int) yy_def[yy_current_state];
01521                         if ( yy_current_state >= 83 )
01522                                 yy_c = yy_meta[(unsigned int) yy_c];
01523                         }
01524                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01525                 }
01526 
01527         return yy_current_state;
01528         }
01529 
01530 
01531 /* yy_try_NUL_trans - try to make a transition on the NUL character
01532  *
01533  * synopsis
01534  *      next_state = yy_try_NUL_trans( current_state );
01535  */
01536 
01537 #ifdef YY_USE_PROTOS
01538 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
01539 #else
01540 static yy_state_type yy_try_NUL_trans( yy_current_state )
01541 yy_state_type yy_current_state;
01542 #endif
01543         {
01544         register int yy_is_jam;
01545         register char *yy_cp = yy_c_buf_p;
01546 
01547         register YY_CHAR yy_c = 1;
01548         if ( yy_accept[yy_current_state] )
01549                 {
01550                 yy_last_accepting_state = yy_current_state;
01551                 yy_last_accepting_cpos = yy_cp;
01552                 }
01553         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01554                 {
01555                 yy_current_state = (int) yy_def[yy_current_state];
01556                 if ( yy_current_state >= 83 )
01557                         yy_c = yy_meta[(unsigned int) yy_c];
01558                 }
01559         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01560         yy_is_jam = (yy_current_state == 82);
01561 
01562         return yy_is_jam ? 0 : yy_current_state;
01563         }
01564 
01565 
01566 #ifndef YY_NO_UNPUT
01567 #ifdef YY_USE_PROTOS
01568 static void yyunput( int c, register char *yy_bp )
01569 #else
01570 static void yyunput( c, yy_bp )
01571 int c;
01572 register char *yy_bp;
01573 #endif
01574         {
01575         register char *yy_cp = yy_c_buf_p;
01576 
01577         /* undo effects of setting up yytext */
01578         *yy_cp = yy_hold_char;
01579 
01580         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01581                 { /* need to shift things up to make room */
01582                 /* +2 for EOB chars. */
01583                 register int number_to_move = yy_n_chars + 2;
01584                 register char *dest = &yy_current_buffer->yy_ch_buf[
01585                                         yy_current_buffer->yy_buf_size + 2];
01586                 register char *source =
01587                                 &yy_current_buffer->yy_ch_buf[number_to_move];
01588 
01589                 while ( source > yy_current_buffer->yy_ch_buf )
01590                         *--dest = *--source;
01591 
01592                 yy_cp += (int) (dest - source);
01593                 yy_bp += (int) (dest - source);
01594                 yy_current_buffer->yy_n_chars =
01595                         yy_n_chars = yy_current_buffer->yy_buf_size;
01596 
01597                 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
01598                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
01599                 }
01600 
01601         *--yy_cp = (char) c;
01602 
01603 
01604         yytext_ptr = yy_bp;
01605         yy_hold_char = *yy_cp;
01606         yy_c_buf_p = yy_cp;
01607         }
01608 #endif  /* ifndef YY_NO_UNPUT */
01609 
01610 
01611 #ifndef YY_NO_INPUT
01612 #ifdef __cplusplus
01613 static int yyinput()
01614 #else
01615 static int input()
01616 #endif
01617         {
01618         int c;
01619 
01620         *yy_c_buf_p = yy_hold_char;
01621 
01622         if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
01623                 {
01624                 /* yy_c_buf_p now points to the character we want to return.
01625                  * If this occurs *before* the EOB characters, then it's a
01626                  * valid NUL; if not, then we've hit the end of the buffer.
01627                  */
01628                 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
01629                         /* This was really a NUL. */
01630                         *yy_c_buf_p = '\0';
01631 
01632                 else
01633                         { /* need more input */
01634                         int offset = yy_c_buf_p - yytext_ptr;
01635                         ++yy_c_buf_p;
01636 
01637                         switch ( yy_get_next_buffer() )
01638                                 {
01639                                 case EOB_ACT_LAST_MATCH:
01640                                         /* This happens because yy_g_n_b()
01641                                          * sees that we've accumulated a
01642                                          * token and flags that we need to
01643                                          * try matching the token before
01644                                          * proceeding.  But for input(),
01645                                          * there's no matching to consider.
01646                                          * So convert the EOB_ACT_LAST_MATCH
01647                                          * to EOB_ACT_END_OF_FILE.
01648                                          */
01649 
01650                                         /* Reset buffer status. */
01651                                         yyrestart( yyin );
01652 
01653                                         /* fall through */
01654 
01655                                 case EOB_ACT_END_OF_FILE:
01656                                         {
01657                                         if ( yywrap() )
01658                                                 return EOF;
01659 
01660                                         if ( ! yy_did_buffer_switch_on_eof )
01661                                                 YY_NEW_FILE;
01662 #ifdef __cplusplus
01663                                         return yyinput();
01664 #else
01665                                         return input();
01666 #endif
01667                                         }
01668 
01669                                 case EOB_ACT_CONTINUE_SCAN:
01670                                         yy_c_buf_p = yytext_ptr + offset;
01671                                         break;
01672                                 }
01673                         }
01674                 }
01675 
01676         c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
01677         *yy_c_buf_p = '\0';     /* preserve yytext */
01678         yy_hold_char = *++yy_c_buf_p;
01679 
01680 
01681         return c;
01682         }
01683 #endif /* YY_NO_INPUT */
01684 
01685 #ifdef YY_USE_PROTOS
01686 void yyrestart( FILE *input_file )
01687 #else
01688 void yyrestart( input_file )
01689 FILE *input_file;
01690 #endif
01691         {
01692         if ( ! yy_current_buffer )
01693                 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
01694 
01695         yy_init_buffer( yy_current_buffer, input_file );
01696         yy_load_buffer_state();
01697         }
01698 
01699 
01700 #ifdef YY_USE_PROTOS
01701 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
01702 #else
01703 void yy_switch_to_buffer( new_buffer )
01704 YY_BUFFER_STATE new_buffer;
01705 #endif
01706         {
01707         if ( yy_current_buffer == new_buffer )
01708                 return;
01709 
01710         if ( yy_current_buffer )
01711                 {
01712                 /* Flush out information for old buffer. */
01713                 *yy_c_buf_p = yy_hold_char;
01714                 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
01715                 yy_current_buffer->yy_n_chars = yy_n_chars;
01716                 }
01717 
01718         yy_current_buffer = new_buffer;
01719         yy_load_buffer_state();
01720 
01721         /* We don't actually know whether we did this switch during
01722          * EOF (yywrap()) processing, but the only time this flag
01723          * is looked at is after yywrap() is called, so it's safe
01724          * to go ahead and always set it.
01725          */
01726         yy_did_buffer_switch_on_eof = 1;
01727         }
01728 
01729 
01730 #ifdef YY_USE_PROTOS
01731 void yy_load_buffer_state( void )
01732 #else
01733 void yy_load_buffer_state()
01734 #endif
01735         {
01736         yy_n_chars = yy_current_buffer->yy_n_chars;
01737         yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
01738         yyin = yy_current_buffer->yy_input_file;
01739         yy_hold_char = *yy_c_buf_p;
01740         }
01741 
01742 
01743 #ifdef YY_USE_PROTOS
01744 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
01745 #else
01746 YY_BUFFER_STATE yy_create_buffer( file, size )
01747 FILE *file;
01748 int size;
01749 #endif
01750         {
01751         YY_BUFFER_STATE b;
01752 
01753         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
01754         if ( ! b )
01755                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01756 
01757         b->yy_buf_size = size;
01758 
01759         /* yy_ch_buf has to be 2 characters longer than the size given because
01760          * we need to put in 2 end-of-buffer characters.
01761          */
01762         b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
01763         if ( ! b->yy_ch_buf )
01764                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
01765 
01766         b->yy_is_our_buffer = 1;
01767 
01768         yy_init_buffer( b, file );
01769 
01770         return b;
01771         }
01772 
01773 
01774 #ifdef YY_USE_PROTOS
01775 void yy_delete_buffer( YY_BUFFER_STATE b )
01776 #else
01777 void yy_delete_buffer( b )
01778 YY_BUFFER_STATE b;
01779 #endif
01780         {
01781         if ( ! b )
01782                 return;
01783 
01784         if ( b == yy_current_buffer )
01785                 yy_current_buffer = (YY_BUFFER_STATE) 0;
01786 
01787         if ( b->yy_is_our_buffer )
01788                 yy_flex_free( (void *) b->yy_ch_buf );
01789 
01790         yy_flex_free( (void *) b );
01791         }
01792 
01793 
01794 
01795 #ifdef YY_USE_PROTOS
01796 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
01797 #else
01798 void yy_init_buffer( b, file )
01799 YY_BUFFER_STATE b;
01800 FILE *file;
01801 #endif
01802 
01803 
01804         {
01805         yy_flush_buffer( b );
01806 
01807         b->yy_input_file = file;
01808         b->yy_fill_buffer = 1;
01809 
01810 #if YY_ALWAYS_INTERACTIVE
01811         b->yy_is_interactive = 1;
01812 #else
01813 #if YY_NEVER_INTERACTIVE
01814         b->yy_is_interactive = 0;
01815 #else
01816         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01817 #endif
01818 #endif
01819         }
01820 
01821 
01822 #ifdef YY_USE_PROTOS
01823 void yy_flush_buffer( YY_BUFFER_STATE b )
01824 #else
01825 void yy_flush_buffer( b )
01826 YY_BUFFER_STATE b;
01827 #endif
01828 
01829         {
01830         if ( ! b )
01831                 return;
01832 
01833         b->yy_n_chars = 0;
01834 
01835         /* We always need two end-of-buffer characters.  The first causes
01836          * a transition to the end-of-buffer state.  The second causes
01837          * a jam in that state.
01838          */
01839         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01840         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01841 
01842         b->yy_buf_pos = &b->yy_ch_buf[0];
01843 
01844         b->yy_at_bol = 1;
01845         b->yy_buffer_status = YY_BUFFER_NEW;
01846 
01847         if ( b == yy_current_buffer )
01848                 yy_load_buffer_state();
01849         }
01850 
01851 
01852 #ifndef YY_NO_SCAN_BUFFER
01853 #ifdef YY_USE_PROTOS
01854 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
01855 #else
01856 YY_BUFFER_STATE yy_scan_buffer( base, size )
01857 char *base;
01858 yy_size_t size;
01859 #endif
01860         {
01861         YY_BUFFER_STATE b;
01862 
01863         if ( size < 2 ||
01864              base[size-2] != YY_END_OF_BUFFER_CHAR ||
01865              base[size-1] != YY_END_OF_BUFFER_CHAR )
01866                 /* They forgot to leave room for the EOB's. */
01867                 return 0;
01868 
01869         b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
01870         if ( ! b )
01871                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
01872 
01873         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
01874         b->yy_buf_pos = b->yy_ch_buf = base;
01875         b->yy_is_our_buffer = 0;
01876         b->yy_input_file = 0;
01877         b->yy_n_chars = b->yy_buf_size;
01878         b->yy_is_interactive = 0;
01879         b->yy_at_bol = 1;
01880         b->yy_fill_buffer = 0;
01881         b->yy_buffer_status = YY_BUFFER_NEW;
01882 
01883         yy_switch_to_buffer( b );
01884 
01885         return b;
01886         }
01887 #endif
01888 
01889 
01890 #ifndef YY_NO_SCAN_STRING
01891 #ifdef YY_USE_PROTOS
01892 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
01893 #else
01894 YY_BUFFER_STATE yy_scan_string( yy_str )
01895 yyconst char *yy_str;
01896 #endif
01897         {
01898         int len;
01899         for ( len = 0; yy_str[len]; ++len )
01900                 ;
01901 
01902         return yy_scan_bytes( yy_str, len );
01903         }
01904 #endif
01905 
01906 
01907 #ifndef YY_NO_SCAN_BYTES
01908 #ifdef YY_USE_PROTOS
01909 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
01910 #else
01911 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
01912 yyconst char *bytes;
01913 int len;
01914 #endif
01915         {
01916         YY_BUFFER_STATE b;
01917         char *buf;
01918         yy_size_t n;
01919         int i;
01920 
01921         /* Get memory for full buffer, including space for trailing EOB's. */
01922         n = len + 2;
01923         buf = (char *) yy_flex_alloc( n );
01924         if ( ! buf )
01925                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
01926 
01927         for ( i = 0; i < len; ++i )
01928                 buf[i] = bytes[i];
01929 
01930         buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
01931 
01932         b = yy_scan_buffer( buf, n );
01933         if ( ! b )
01934                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
01935 
01936         /* It's okay to grow etc. this buffer, and we should throw it
01937          * away when we're done.
01938          */
01939         b->yy_is_our_buffer = 1;
01940 
01941         return b;
01942         }
01943 #endif
01944 
01945 
01946 #ifndef YY_NO_PUSH_STATE
01947 #ifdef YY_USE_PROTOS
01948 static void yy_push_state( int new_state )
01949 #else
01950 static void yy_push_state( new_state )
01951 int new_state;
01952 #endif
01953         {
01954         if ( yy_start_stack_ptr >= yy_start_stack_depth )
01955                 {
01956                 yy_size_t new_size;
01957 
01958                 yy_start_stack_depth += YY_START_STACK_INCR;
01959                 new_size = yy_start_stack_depth * sizeof( int );
01960 
01961                 if ( ! yy_start_stack )
01962                         yy_start_stack = (int *) yy_flex_alloc( new_size );
01963 
01964                 else
01965                         yy_start_stack = (int *) yy_flex_realloc(
01966                                         (void *) yy_start_stack, new_size );
01967 
01968                 if ( ! yy_start_stack )
01969                         YY_FATAL_ERROR(
01970                         "out of memory expanding start-condition stack" );
01971                 }
01972 
01973         yy_start_stack[yy_start_stack_ptr++] = YY_START;
01974 
01975         BEGIN(new_state);
01976         }
01977 #endif
01978 
01979 
01980 #ifndef YY_NO_POP_STATE
01981 static void yy_pop_state()
01982         {
01983         if ( --yy_start_stack_ptr < 0 )
01984                 YY_FATAL_ERROR( "start-condition stack underflow" );
01985 
01986         BEGIN(yy_start_stack[yy_start_stack_ptr]);
01987         }
01988 #endif
01989 
01990 
01991 #ifndef YY_NO_TOP_STATE
01992 static int yy_top_state()
01993         {
01994         return yy_start_stack[yy_start_stack_ptr - 1];
01995         }
01996 #endif
01997 
01998 #ifndef YY_EXIT_FAILURE
01999 #define YY_EXIT_FAILURE 2
02000 #endif
02001 
02002 #ifdef YY_USE_PROTOS
02003 static void yy_fatal_error( yyconst char msg[] )
02004 #else
02005 static void yy_fatal_error( msg )
02006 char msg[];
02007 #endif
02008         {
02009         (void) fprintf( stderr, "%s\n", msg );
02010         exit( YY_EXIT_FAILURE );
02011         }
02012 
02013 
02014 
02015 /* Redefine yyless() so it works in section 3 code. */
02016 
02017 #undef yyless
02018 #define yyless(n) \
02019         do \
02020                 { \
02021                 /* Undo effects of setting up yytext. */ \
02022                 yytext[yyleng] = yy_hold_char; \
02023                 yy_c_buf_p = yytext + n; \
02024                 yy_hold_char = *yy_c_buf_p; \
02025                 *yy_c_buf_p = '\0'; \
02026                 yyleng = n; \
02027                 } \
02028         while ( 0 )
02029 
02030 
02031 /* Internal utility routines. */
02032 
02033 #ifndef yytext_ptr
02034 #ifdef YY_USE_PROTOS
02035 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
02036 #else
02037 static void yy_flex_strncpy( s1, s2, n )
02038 char *s1;
02039 yyconst char *s2;
02040 int n;
02041 #endif
02042         {
02043         register int i;
02044         for ( i = 0; i < n; ++i )
02045                 s1[i] = s2[i];
02046         }
02047 #endif
02048 
02049 #ifdef YY_NEED_STRLEN
02050 #ifdef YY_USE_PROTOS
02051 static int yy_flex_strlen( yyconst char *s )
02052 #else
02053 static int yy_flex_strlen( s )
02054 yyconst char *s;
02055 #endif
02056         {
02057         register int n;
02058         for ( n = 0; s[n]; ++n )
02059                 ;
02060 
02061         return n;
02062         }
02063 #endif
02064 
02065 
02066 #ifdef YY_USE_PROTOS
02067 static void *yy_flex_alloc( yy_size_t size )
02068 #else
02069 static void *yy_flex_alloc( size )
02070 yy_size_t size;
02071 #endif
02072         {
02073         return (void *) malloc( size );
02074         }
02075 
02076 #ifdef YY_USE_PROTOS
02077 static void *yy_flex_realloc( void *ptr, yy_size_t size )
02078 #else
02079 static void *yy_flex_realloc( ptr, size )
02080 void *ptr;
02081 yy_size_t size;
02082 #endif
02083         {
02084         /* The cast to (char *) in the following accommodates both
02085          * implementations that use char* generic pointers, and those
02086          * that use void* generic pointers.  It works with the latter
02087          * because both ANSI C and C++ allow castless assignment from
02088          * any pointer type to void*, and deal with argument conversions
02089          * as though doing an assignment.
02090          */
02091         return (void *) realloc( (char *) ptr, size );
02092         }
02093 
02094 #ifdef YY_USE_PROTOS
02095 static void yy_flex_free( void *ptr )
02096 #else
02097 static void yy_flex_free( ptr )
02098 void *ptr;
02099 #endif
02100         {
02101         free( ptr );
02102         }
02103 
02104 #if YY_MAIN
02105 int main()
02106         {
02107         yylex();
02108         return 0;
02109         }
02110 #endif
02111 #line 504 "../src/parser/follex.y"
02112 

Generated on Tue Jan 16 05:30:05 2007 for Alchemy by  doxygen 1.5.1