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

mootTokenLexer.h

Go to the documentation of this file.
00001 #ifndef FLEX_HEADER_mootTokenLexer_h
00002 #define FLEX_HEADER_mootTokenLexer_h
00003 #define YY_mootTokenLexer_CHAR unsigned char
00004 #line 1 "/usr/local/share/flex++bison++/flexskel.h"
00005 /* A lexical scanner header generated by flex */
00006 /* MODIFIED FOR C++ CLASS BY Alain Coetmeur: coetmeur(at)icdc.fr */
00007 /* Note that (at) mean the 'at' symbol that I cannot write */
00008 /* because it is expanded to the class name */
00009 /* made at Informatique-CDC, Research&development department */
00010 /* company from the Caisse Des Depots et Consignations */
00011 
00012 
00013 /*********************************************/
00014 /* SYSTEM dependent declaration, includes... */
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 #ifdef __cplusplus
00023 #ifndef YY_USE_PROTOS
00024 #define YY_USE_PROTOS
00025 #endif
00026 #ifndef YY_USE_CLASS
00027 #define YY_USE_CLASS
00028 #endif
00029 #else   /* ! __cplusplus */
00030 #ifdef __STDC__
00031 #ifdef __GNUC__
00032 #else
00033 #endif  /* __GNUC__ */
00034 #ifndef YY_USE_PROTOS
00035 #define YY_USE_PROTOS
00036 #endif
00037 #endif  /* __STDC__ */
00038 #endif  /* ! __cplusplus */
00039 /*********************************************/
00040 /* COMPILER DEPENDENT   MACROS               */
00041 /*********************************************/
00042 /* use prototypes in function declarations */
00043 #ifndef YY_PROTO
00044 #ifdef YY_USE_PROTOS
00045 #define YY_PROTO(proto) proto
00046 #else
00047 #define YY_PROTO(proto) ()
00048 #endif
00049 #endif
00050 #include <stdio.h>
00051 
00052 
00053 
00054 
00055 /* % here is the declaration from section1 %header{  */ 
00056 #line 47 "mootTokenLexer.ll"
00057 /*============================================================================
00058  * Doxygen docs
00059  *============================================================================*/
00083 #include <mootToken.h>
00084 #include <mootGenericLexer.h>
00085 
00086 using namespace moot;
00087 #line 81 "mootTokenLexer.ll"
00088 #define YY_mootTokenLexer_CLASS  mootTokenLexer
00089 #line 83 "mootTokenLexer.ll"
00090 #define YY_mootTokenLexer_INHERIT  \
00091   : public moot::GenericLexer
00092 #line 86 "mootTokenLexer.ll"
00093 #define YY_mootTokenLexer_INPUT_CODE  \
00094   return moot::GenericLexer::yyinput(buffer,result,max_size);
00095 #line 89 "mootTokenLexer.ll"
00096 #define YY_mootTokenLexer_MEMBERS  \
00097   public: \
00098   /* -- public typedefs */\
00099   typedef moot::mootTokenType TokenType; \
00100   /* extra token types */ \
00101   static const int LexTypeText = moot::NTokTypes+1;    /* literal token text */ \
00102   static const int LexTypeTag = moot::NTokTypes+2;     /* analysis tag */ \
00103   static const int LexTypeDetails = moot::NTokTypes+3; /* analysis details */ \
00104   static const int LexTypeEOA = moot::NTokTypes+4;     /* end-of-analysis (separator) */ \
00105   static const int LexTypeEOT = moot::NTokTypes+5;     /* end-of-token */ \
00106   static const int LexTypeIgnore = moot::NTokTypes+6;  /* ignored data (unused) */ \
00107   \
00108   public: \
00109  \
00110    int lasttyp; \
00111    \
00112    /* -- pre-allocated construction buffers */ \
00113    /* current token (default) */ \
00114    moot::mootToken mtoken_default; \
00115    /* current token (real) */ \
00116    moot::mootToken *mtoken; \
00117    \
00118  \
00119    moot::mootToken::Analysis *manalysis;\
00120    \
00121  \
00122    bool ignore_comments; \
00123  \
00124    bool first_analysis_is_best; \
00125 \
00126    bool current_analysis_is_best; \
00127  \
00128    bool ignore_first_analysis; \
00129 \
00130    bool ignore_current_analysis; \
00131    \
00132   public: \
00133     /* -- local methods */ \
00134 \
00135     virtual ~mootTokenLexer(void) {};\
00136  \
00137     virtual void reset(void); \
00138  \
00139     inline void on_EOA(void) \
00140     { \
00141       /*-- EOA: add & clear current analysis, if any */ \
00142       /*-- add & clear current analysis, if any */ \
00143       if (lasttyp != LexTypeEOA) { \
00144         /*-- set default tag */\
00145         if (manalysis->tag.empty()) { \
00146           manalysis->tag.swap(manalysis->details); \
00147         }  \
00148         /* set best tag if applicable */\
00149         if (current_analysis_is_best) { \
00150           mtoken->besttag(manalysis->tag); \
00151           current_analysis_is_best = false; \
00152         } \
00153         if (ignore_current_analysis) { \
00154           ignore_current_analysis=false; \
00155           mtoken->tok_analyses.pop_back(); \
00156         } \
00157       } \
00158     }; \
00159   /*-- moot::GenericLexer helpers */ \
00160   virtual void **mgl_yy_current_buffer_p(void) \
00161                  {return (void**)(&yy_current_buffer);};\
00162   virtual void  *mgl_yy_create_buffer(int size, FILE *unused=stdin) \
00163                  {return (void*)(yy_create_buffer(unused,size));};\
00164   virtual void   mgl_yy_init_buffer(void *buf, FILE *unused=stdin) \
00165                  {yy_init_buffer((YY_BUFFER_STATE)buf,unused);};\
00166   virtual void   mgl_yy_delete_buffer(void *buf) \
00167                  {yy_delete_buffer((YY_BUFFER_STATE)buf);};\
00168   virtual void   mgl_yy_switch_to_buffer(void *buf) \
00169                  {yy_switch_to_buffer((YY_BUFFER_STATE)buf);};\
00170   virtual void   mgl_begin(int stateno);
00171 #line 166 "mootTokenLexer.ll"
00172 #define YY_mootTokenLexer_CONSTRUCTOR_INIT  :\
00173   GenericLexer("mootTokenLexer"), \
00174   yyin(NULL), \
00175   lasttyp(moot::TokTypeEOS), \
00176   manalysis(NULL), \
00177   ignore_comments(false), \
00178   first_analysis_is_best(true), \
00179   current_analysis_is_best(false), \
00180   ignore_first_analysis(false), \
00181   ignore_current_analysis(false)
00182 #line 177 "mootTokenLexer.ll"
00183 #define YY_mootTokenLexer_CONSTRUCTOR_CODE  \
00184   mtoken = &mtoken_default;
00185 #line 208 "mootTokenLexer.ll"
00186 #line 52 "/usr/local/share/flex++bison++/flexskel.h"
00187 
00188 
00189 
00190 #ifndef YY_mootTokenLexer_TEXT
00191 #define YY_mootTokenLexer_TEXT yytext
00192 #endif
00193 #ifndef YY_mootTokenLexer_LENG
00194 #define YY_mootTokenLexer_LENG yyleng
00195 #endif
00196 #ifndef YY_mootTokenLexer_IN
00197 #define YY_mootTokenLexer_IN yyin
00198 #endif
00199 #ifndef YY_mootTokenLexer_OUT
00200 #define YY_mootTokenLexer_OUT yyout
00201 #endif
00202 #ifndef YY_mootTokenLexer_LEX_RETURN
00203 #define YY_mootTokenLexer_LEX_RETURN int
00204 #else
00205 #ifndef YY_mootTokenLexer_LEX_DEFINED
00206 #define YY_mootTokenLexer_LEX_DEFINED 
00207 #endif
00208 #endif
00209 
00210 #ifndef YY_mootTokenLexer_LEX
00211 #define YY_mootTokenLexer_LEX yylex
00212 #else
00213 #ifndef YY_mootTokenLexer_LEX_DEFINED
00214 #define YY_mootTokenLexer_LEX_DEFINED 
00215 #endif
00216 #endif
00217 
00218 #ifndef YY_mootTokenLexer_LEX_PARAM
00219 #ifndef YY_USE_PROTOS
00220 #define YY_mootTokenLexer_LEX_PARAM 
00221 #else
00222 #define YY_mootTokenLexer_LEX_PARAM void
00223 #endif
00224 #else
00225 #ifndef YY_mootTokenLexer_LEX_DEFINED
00226 #define YY_mootTokenLexer_LEX_DEFINED 
00227 #endif
00228 #endif
00229 
00230 #ifndef YY_mootTokenLexer_LEX_PARAM_DEF
00231 #define YY_mootTokenLexer_LEX_PARAM_DEF
00232 #else
00233 #ifndef YY_mootTokenLexer_LEX_DEFINED
00234 #define YY_mootTokenLexer_LEX_DEFINED 
00235 #endif
00236 #endif
00237 
00238 #ifndef YY_mootTokenLexer_RESTART
00239 #define YY_mootTokenLexer_RESTART yyrestart
00240 #endif
00241 #ifndef YY_mootTokenLexer_SWITCH_TO_BUFFER
00242 #define YY_mootTokenLexer_SWITCH_TO_BUFFER yy_switch_to_buffer
00243 #endif
00244 #ifndef YY_mootTokenLexer_LOAD_BUFFER_STATE
00245 #define YY_mootTokenLexer_LOAD_BUFFER_STATE yy_load_buffer_state
00246 #endif
00247 
00248 #ifndef YY_mootTokenLexer_CREATE_BUFFER
00249 #define YY_mootTokenLexer_CREATE_BUFFER yy_create_buffer
00250 #ifndef YY_USE_CLASS
00251 #ifndef yy_new_buffer
00252 #define yy_new_buffer yy_create_buffer
00253 #endif
00254 #endif
00255 #endif
00256 #ifndef YY_mootTokenLexer_DELETE_BUFFER
00257 #define YY_mootTokenLexer_DELETE_BUFFER yy_delete_buffer
00258 #endif
00259 #ifndef YY_mootTokenLexer_INIT_BUFFER
00260 #define YY_mootTokenLexer_INIT_BUFFER yy_init_buffer
00261 #endif
00262 #ifdef YY_mootTokenLexer_FLEX_DEBUG
00263 #ifndef YY_mootTokenLexer_DEBUG
00264 #define YY_mootTokenLexer_DEBUG 1
00265 #endif
00266 #else
00267 #ifndef YY_mootTokenLexer_DEBUG
00268 #define YY_mootTokenLexer_DEBUG 0
00269 #endif
00270 #endif
00271 
00272 #if YY_mootTokenLexer_DEBUG != 0
00273 #ifndef YY_mootTokenLexer_DEBUG_FLAG
00274 #define YY_mootTokenLexer_DEBUG_FLAG yy_flex_debug
00275 #endif
00276 #ifndef YY_mootTokenLexer_DEBUG_INIT
00277 #define YY_mootTokenLexer_DEBUG_INIT 1
00278 #endif
00279 #endif
00280 
00281 
00282 
00283 
00284 #ifndef YY_USE_CLASS
00285 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00286 
00287 extern void YY_mootTokenLexer_RESTART YY_PROTO(( FILE *input_file ));
00288 extern void YY_mootTokenLexer_SWITCH_TO_BUFFER YY_PROTO(( YY_BUFFER_STATE new_buffer ));
00289 extern void YY_mootTokenLexer_LOAD_BUFFER_STATE YY_PROTO(( void ));
00290 extern YY_BUFFER_STATE YY_mootTokenLexer_CREATE_BUFFER YY_PROTO(( FILE *file, int size ));
00291 extern void YY_mootTokenLexer_DELETE_BUFFER YY_PROTO(( YY_BUFFER_STATE b ));
00292 extern void YY_mootTokenLexer_INIT_BUFFER YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
00293 
00294 #if YY_mootTokenLexer_DEBUG != 0
00295 extern int YY_mootTokenLexer_DEBUG_FLAG ;
00296 #endif
00297 extern YY_mootTokenLexer_CHAR  *YY_mootTokenLexer_TEXT;
00298 extern int YY_mootTokenLexer_LENG;
00299 extern FILE *YY_mootTokenLexer_IN, *YY_mootTokenLexer_OUT;
00300 #ifdef YY_mootTokenLexer_LEX_DEFINED
00301 extern YY_mootTokenLexer_LEX_RETURN YY_mootTokenLexer_LEX ( YY_mootTokenLexer_LEX_PARAM )
00302 YY_mootTokenLexer_LEX_PARAM_DEF
00303 #else
00304 #ifndef YY_DECL
00305 extern YY_mootTokenLexer_LEX_RETURN YY_mootTokenLexer_LEX ( YY_mootTokenLexer_LEX_PARAM )
00306 YY_mootTokenLexer_LEX_PARAM_DEF
00307 #else
00308 /* no declaration if oldstyle flex */
00309 #endif
00310 #endif
00311 #else
00312 
00313 #ifndef YY_mootTokenLexer_CLASS
00314 #define YY_mootTokenLexer_CLASS mootTokenLexer
00315 #endif
00316 #ifndef YY_mootTokenLexer_ECHO
00317 #define YY_mootTokenLexer_ECHO yy_echo
00318 #endif
00319 #ifdef YY_mootTokenLexer_ECHO_PURE
00320 #define YY_mootTokenLexer_ECHO_NOCODE
00321 #endif
00322 #ifndef YY_mootTokenLexer_ECHO_CODE
00323 #define YY_mootTokenLexer_ECHO_CODE fwrite( (char *) YY_mootTokenLexer_TEXT, YY_mootTokenLexer_LENG, 1, YY_mootTokenLexer_OUT );
00324 #endif
00325 #ifndef YY_mootTokenLexer_INPUT
00326 #define YY_mootTokenLexer_INPUT yy_input
00327 #endif
00328 #ifdef YY_mootTokenLexer_INPUT_PURE
00329 #define YY_mootTokenLexer_INPUT_NOCODE
00330 #endif
00331 #ifndef YY_mootTokenLexer_INPUT_CODE
00332 #define YY_mootTokenLexer_INPUT_CODE return result= fread(  buffer, 1,max_size,YY_mootTokenLexer_IN );
00333 #endif
00334 #ifdef YY_mootTokenLexer_FATAL_ERROR_PURE
00335 #define YY_mootTokenLexer_FATAL_ERRO_NOCODE
00336 #endif
00337 #ifndef YY_mootTokenLexer_FATAL_ERROR
00338 #define YY_mootTokenLexer_FATAL_ERROR yy_fatal_error
00339 #endif
00340 #ifndef YY_mootTokenLexer_FATAL_ERROR_CODE
00341 #define YY_mootTokenLexer_FATAL_ERROR_CODE fputs( msg, stderr );putc( '\n', stderr );exit( 1 );
00342 #endif
00343 #ifndef YY_mootTokenLexer_WRAP
00344 #define YY_mootTokenLexer_WRAP yy_wrap
00345 #endif
00346 #ifdef YY_mootTokenLexer_WRAP_PURE
00347 #define YY_mootTokenLexer_WRAP_NOCODE
00348 #endif
00349 #ifndef YY_mootTokenLexer_WRAP_CODE
00350 #define YY_mootTokenLexer_WRAP_CODE return 1;
00351 #endif
00352 
00353 
00354 #ifndef YY_mootTokenLexer_INHERIT
00355 #define YY_mootTokenLexer_INHERIT
00356 #endif
00357 #ifndef YY_mootTokenLexer_MEMBERS
00358 #define YY_mootTokenLexer_MEMBERS 
00359 #endif
00360 #ifndef YY_mootTokenLexer_CONSTRUCTOR_PARAM
00361 #define YY_mootTokenLexer_CONSTRUCTOR_PARAM
00362 #endif
00363 #ifndef YY_mootTokenLexer_CONSTRUCTOR_CODE
00364 #define YY_mootTokenLexer_CONSTRUCTOR_CODE
00365 #endif
00366 #ifndef YY_mootTokenLexer_CONSTRUCTOR_INIT
00367 #define YY_mootTokenLexer_CONSTRUCTOR_INIT
00368 #endif
00369 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00370 
00371 class YY_mootTokenLexer_CLASS YY_mootTokenLexer_INHERIT
00372 {
00373  private:/* data */
00374  YY_mootTokenLexer_CHAR  *yy_c_buf_p;
00375  YY_mootTokenLexer_CHAR  yy_hold_char;
00376  int yy_n_chars;
00377  int yy_init;
00378  int yy_start;
00379  int yy_did_buffer_switch_on_eof;
00380  private: /* functions */
00381  void yy_initialize();
00382  int input();
00383  int yyinput() {return input();};
00384  int yy_get_next_buffer();
00385  void yyunput( YY_mootTokenLexer_CHAR  c, YY_mootTokenLexer_CHAR  *buf_ptr );
00386  /* use long instead of yy_state_type because it is undef */
00387  long yy_get_previous_state_ ( void );
00388  long yy_try_NUL_trans_  ( long current_state_ );
00389  protected:/* non virtual */
00390  YY_BUFFER_STATE yy_current_buffer;
00391  void YY_mootTokenLexer_RESTART ( FILE *input_file );
00392  void YY_mootTokenLexer_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer );
00393  void YY_mootTokenLexer_LOAD_BUFFER_STATE( void );
00394  YY_BUFFER_STATE YY_mootTokenLexer_CREATE_BUFFER( FILE *file, int size );
00395  void YY_mootTokenLexer_DELETE_BUFFER( YY_BUFFER_STATE b );
00396  void YY_mootTokenLexer_INIT_BUFFER( YY_BUFFER_STATE b, FILE *file );
00397  protected: /* virtual */
00398  virtual void YY_mootTokenLexer_ECHO()
00399 #ifdef YY_mootTokenLexer_ECHO_PURE
00400   =0
00401 #endif
00402   ;
00403  virtual int  YY_mootTokenLexer_INPUT(char  *buf,int &result,int max_size)
00404 #ifdef YY_mootTokenLexer_INPUT_PURE
00405   =0
00406 #endif
00407   ;
00408  virtual void  YY_mootTokenLexer_FATAL_ERROR(char *msg)
00409 #ifdef YY_mootTokenLexer_FATAL_ERROR_PURE
00410   =0
00411 #endif
00412   ;
00413  virtual int  YY_mootTokenLexer_WRAP()
00414 #ifdef YY_mootTokenLexer_WRAP_PURE
00415   =0
00416 #endif
00417   ;
00418  public:
00419  YY_mootTokenLexer_CHAR  *YY_mootTokenLexer_TEXT;
00420  int YY_mootTokenLexer_LENG;
00421  FILE *YY_mootTokenLexer_IN, *YY_mootTokenLexer_OUT;
00422  YY_mootTokenLexer_LEX_RETURN YY_mootTokenLexer_LEX ( YY_mootTokenLexer_LEX_PARAM);
00423  YY_mootTokenLexer_CLASS(YY_mootTokenLexer_CONSTRUCTOR_PARAM) ;
00424 #if YY_mootTokenLexer_DEBUG != 0
00425  int YY_mootTokenLexer_DEBUG_FLAG;
00426 #endif
00427  public: /* added members */
00428  YY_mootTokenLexer_MEMBERS 
00429 };
00430 #endif
00431 
00432 
00433 
00434 /* declaration of externs for public use of yylex scanner */
00435 
00436 /* % here is the declaration from section2 %header{ */ 
00437 #line 409 "mootTokenLexer.ll"
00438 #endif
00439 #line 302 "/usr/local/share/flex++bison++/flexskel.h"
00440 
00441 /* end of generated header */

Generated on Wed Jul 28 15:48:03 2004 for libmoot by doxygen1.2.15