mootTokenLexer.h
Go to the documentation of this file.
1 #ifndef FLEX_HEADER_mootTokenLexer_h
2 #define FLEX_HEADER_mootTokenLexer_h
3 #define YY_mootTokenLexer_CHAR unsigned char
4 #line 1 "./flexskel.h"
5 /* A lexical scanner header generated by flex */
6 /* MODIFIED FOR C++ CLASS BY Alain Coetmeur: coetmeur(at)icdc.fr */
7 /* Note that (at) mean the 'at' symbol that I cannot write */
8 /* because it is expanded to the class name */
9 /* made at Informatique-CDC, Research&development department */
10 /* company from the Caisse Des Depots et Consignations */
11 
12 
13 /*********************************************/
14 /* SYSTEM dependent declaration, includes... */
15 /*********************************************/
16 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
17 #ifdef c_plusplus
18 #ifndef __cplusplus
19 #define __cplusplus
20 #endif
21 #endif
22 #ifdef __cplusplus
23 #ifndef YY_USE_PROTOS
24 #define YY_USE_PROTOS
25 #endif
26 #ifndef YY_USE_CLASS
27 #define YY_USE_CLASS
28 #endif
29 #else /* ! __cplusplus */
30 #ifdef __STDC__
31 #ifdef __GNUC__
32 #else
33 #endif /* __GNUC__ */
34 #ifndef YY_USE_PROTOS
35 #define YY_USE_PROTOS
36 #endif
37 #endif /* __STDC__ */
38 #endif /* ! __cplusplus */
39 /*********************************************/
40 /* COMPILER DEPENDENT MACROS */
41 /*********************************************/
42 /* use prototypes in function declarations */
43 #ifndef YY_PROTO
44 #ifdef YY_USE_PROTOS
45 #define YY_PROTO(proto) proto
46 #else
47 #define YY_PROTO(proto) ()
48 #endif
49 #endif
50 #include <stdio.h>
51 
52 
53 
54 
55 /* % here is the declaration from section1 %header{ */
56 #line 50 "mootTokenLexer.ll"
57 /*============================================================================
58  * Doxygen docs
59  *============================================================================*/
93 #include <mootToken.h>
94 #include <mootGenericLexer.h>
95 
96 using namespace moot;
97 #line 94 "mootTokenLexer.ll"
98 #define YY_mootTokenLexer_CLASS mootTokenLexer
99 #line 96 "mootTokenLexer.ll"
100 #define YY_mootTokenLexer_INHERIT \
101  : public moot::GenericLexer
102 #line 99 "mootTokenLexer.ll"
103 #define YY_mootTokenLexer_INPUT_CODE \
104  return moot::GenericLexer::yyinput(buffer,result,max_size);
105 #line 102 "mootTokenLexer.ll"
106 #define YY_mootTokenLexer_MEMBERS \
107  public: \
108  /* -- public typedefs */\
109  typedef moot::mootTokenType TokenType; \
110  /* extra token types */ \
111  static const int LexTypeText = moot::NTokTypes+1; /* literal token text */ \
112  static const int LexTypeTag = moot::NTokTypes+2; /* analysis tag */ \
113  static const int LexTypeDetails = moot::NTokTypes+3; /* analysis details */ \
114  static const int LexTypeEOA = moot::NTokTypes+4; /* end-of-analysis (separator) */ \
115  static const int LexTypeEOT = moot::NTokTypes+5; /* end-of-token */ \
116  static const int LexTypeIgnore = moot::NTokTypes+6; /* ignored data (unused) */ \
117  \
118  public: \
119  \
120  int lasttyp; \
121  \
122  int nextstate; \
123  \
124  /* -- pre-allocated construction buffers */ \
125  /* current token (default) */ \
126  moot::mootToken mtoken_default; \
127  /* current token (real) */ \
128  moot::mootToken *mtoken; \
129  \
130  \
131  moot::mootToken::Analysis *manalysis;\
132  \
133  \
134  bool ignore_comments; \
135  \
136  bool first_analysis_is_best; \
137 \
138  bool current_analysis_is_best; \
139  \
140  bool ignore_first_analysis; \
141 \
142  bool ignore_current_analysis; \
143  \
144  bool parse_location; \
145  \
146  bool parse_analysis_cost; \
147  \
148  bool analysis_cost_details; \
149  \
150  public: \
151  /* -- local methods */ \
152 \
153  virtual ~mootTokenLexer(void) {};\
154  \
155  virtual void reset(void); \
156  \
157  void on_EOA(void); \
158  \
159  inline void loc_set(moot::OffsetT off, int len) \
160  { mtoken->location(off,len); } \
161  \
162  inline void loc_add(int len) \
163  { if (!parse_location) mtoken->loc_length(mtoken->loc_length()+yyleng); } \
164  \
165  /*-- moot::GenericLexer helpers */ \
166  virtual void *mgl_yy_current_buffer_p(void) \
167  {return reinterpret_cast<void*>(&yy_current_buffer);}; \
168  virtual void *mgl_yy_create_buffer(int size, FILE *unused=stdin) \
169  {return reinterpret_cast<void*>(yy_create_buffer(unused,size));};\
170  virtual void mgl_yy_init_buffer(void *buf, FILE *unused=stdin) \
171  {yy_init_buffer(reinterpret_cast<YY_BUFFER_STATE>(buf),unused);};\
172  virtual void mgl_yy_delete_buffer(void *buf) \
173  {yy_delete_buffer(reinterpret_cast<YY_BUFFER_STATE>(buf));};\
174  virtual void mgl_yy_switch_to_buffer(void *buf) \
175  {yy_switch_to_buffer(reinterpret_cast<YY_BUFFER_STATE>(buf));};\
176  virtual void mgl_begin(int stateno);
177 #line 175 "mootTokenLexer.ll"
178 #define YY_mootTokenLexer_CONSTRUCTOR_INIT :\
179  GenericLexer("mootTokenLexer"), \
180  yyin(NULL), \
181  lasttyp(moot::TokTypeEOS), \
182  nextstate(-1), \
183  manalysis(NULL), \
184  ignore_comments(false), \
185  first_analysis_is_best(true), \
186  current_analysis_is_best(false), \
187  ignore_first_analysis(false), \
188  ignore_current_analysis(false), \
189  parse_location(false), \
190  parse_analysis_cost(true), \
191  analysis_cost_details(false)
192 #line 191 "mootTokenLexer.ll"
193 #define YY_mootTokenLexer_CONSTRUCTOR_CODE \
194  mtoken = &mtoken_default;
195 #line 226 "mootTokenLexer.ll"
196 #line 52 "./flexskel.h"
197 
198 
199 
200 #ifndef YY_mootTokenLexer_TEXT
201 #define YY_mootTokenLexer_TEXT yytext
202 #endif
203 #ifndef YY_mootTokenLexer_LENG
204 #define YY_mootTokenLexer_LENG yyleng
205 #endif
206 #ifndef YY_mootTokenLexer_IN
207 #define YY_mootTokenLexer_IN yyin
208 #endif
209 #ifndef YY_mootTokenLexer_OUT
210 #define YY_mootTokenLexer_OUT yyout
211 #endif
212 #ifndef YY_mootTokenLexer_LEX_RETURN
213 #define YY_mootTokenLexer_LEX_RETURN int
214 #else
215 #ifndef YY_mootTokenLexer_LEX_DEFINED
216 #define YY_mootTokenLexer_LEX_DEFINED
217 #endif
218 #endif
219 
220 #ifndef YY_mootTokenLexer_LEX
221 #define YY_mootTokenLexer_LEX yylex
222 #else
223 #ifndef YY_mootTokenLexer_LEX_DEFINED
224 #define YY_mootTokenLexer_LEX_DEFINED
225 #endif
226 #endif
227 
228 #ifndef YY_mootTokenLexer_LEX_PARAM
229 #ifndef YY_USE_PROTOS
230 #define YY_mootTokenLexer_LEX_PARAM
231 #else
232 #define YY_mootTokenLexer_LEX_PARAM void
233 #endif
234 #else
235 #ifndef YY_mootTokenLexer_LEX_DEFINED
236 #define YY_mootTokenLexer_LEX_DEFINED
237 #endif
238 #endif
239 
240 #ifndef YY_mootTokenLexer_LEX_PARAM_DEF
241 #define YY_mootTokenLexer_LEX_PARAM_DEF
242 #else
243 #ifndef YY_mootTokenLexer_LEX_DEFINED
244 #define YY_mootTokenLexer_LEX_DEFINED
245 #endif
246 #endif
247 
248 #ifndef YY_mootTokenLexer_RESTART
249 #define YY_mootTokenLexer_RESTART yyrestart
250 #endif
251 #ifndef YY_mootTokenLexer_SWITCH_TO_BUFFER
252 #define YY_mootTokenLexer_SWITCH_TO_BUFFER yy_switch_to_buffer
253 #endif
254 #ifndef YY_mootTokenLexer_LOAD_BUFFER_STATE
255 #define YY_mootTokenLexer_LOAD_BUFFER_STATE yy_load_buffer_state
256 #endif
257 
258 #ifndef YY_mootTokenLexer_CREATE_BUFFER
259 #define YY_mootTokenLexer_CREATE_BUFFER yy_create_buffer
260 #ifndef YY_USE_CLASS
261 #ifndef yy_new_buffer
262 #define yy_new_buffer yy_create_buffer
263 #endif
264 #endif
265 #endif
266 #ifndef YY_mootTokenLexer_DELETE_BUFFER
267 #define YY_mootTokenLexer_DELETE_BUFFER yy_delete_buffer
268 #endif
269 #ifndef YY_mootTokenLexer_INIT_BUFFER
270 #define YY_mootTokenLexer_INIT_BUFFER yy_init_buffer
271 #endif
272 #ifdef YY_mootTokenLexer_FLEX_DEBUG
273 #ifndef YY_mootTokenLexer_DEBUG
274 #define YY_mootTokenLexer_DEBUG 1
275 #endif
276 #else
277 #ifndef YY_mootTokenLexer_DEBUG
278 #define YY_mootTokenLexer_DEBUG 0
279 #endif
280 #endif
281 
282 #if YY_mootTokenLexer_DEBUG != 0
283 #ifndef YY_mootTokenLexer_DEBUG_FLAG
284 #define YY_mootTokenLexer_DEBUG_FLAG yy_flex_debug
285 #endif
286 #ifndef YY_mootTokenLexer_DEBUG_INIT
287 #define YY_mootTokenLexer_DEBUG_INIT 1
288 #endif
289 #endif
290 
291 
292 
293 
294 #ifndef YY_USE_CLASS
295 typedef struct yy_buffer_state *YY_BUFFER_STATE;
296 
297 extern void YY_mootTokenLexer_RESTART YY_PROTO(( FILE *input_file ));
298 extern void YY_mootTokenLexer_SWITCH_TO_BUFFER YY_PROTO(( YY_BUFFER_STATE new_buffer ));
299 extern void YY_mootTokenLexer_LOAD_BUFFER_STATE YY_PROTO(( void ));
300 extern YY_BUFFER_STATE YY_mootTokenLexer_CREATE_BUFFER YY_PROTO(( FILE *file, int size ));
301 extern void YY_mootTokenLexer_DELETE_BUFFER YY_PROTO(( YY_BUFFER_STATE b ));
302 extern void YY_mootTokenLexer_INIT_BUFFER YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
303 
304 #if YY_mootTokenLexer_DEBUG != 0
305 extern int YY_mootTokenLexer_DEBUG_FLAG ;
306 #endif
307 extern YY_mootTokenLexer_CHAR *YY_mootTokenLexer_TEXT;
308 extern int YY_mootTokenLexer_LENG;
309 extern FILE *YY_mootTokenLexer_IN, *YY_mootTokenLexer_OUT;
310 #ifdef YY_mootTokenLexer_LEX_DEFINED
311 extern YY_mootTokenLexer_LEX_RETURN YY_mootTokenLexer_LEX ( YY_mootTokenLexer_LEX_PARAM )
312 YY_mootTokenLexer_LEX_PARAM_DEF
313 #else
314 #ifndef YY_DECL
315 extern YY_mootTokenLexer_LEX_RETURN YY_mootTokenLexer_LEX ( YY_mootTokenLexer_LEX_PARAM )
316 YY_mootTokenLexer_LEX_PARAM_DEF
317 #else
318 /* no declaration if oldstyle flex */
319 #endif
320 #endif
321 #else
322 
323 #ifndef YY_mootTokenLexer_CLASS
324 #define YY_mootTokenLexer_CLASS mootTokenLexer
325 #endif
326 #ifndef YY_mootTokenLexer_ECHO
327 #define YY_mootTokenLexer_ECHO yy_echo
328 #endif
329 #ifdef YY_mootTokenLexer_ECHO_PURE
330 #define YY_mootTokenLexer_ECHO_NOCODE
331 #endif
332 #ifndef YY_mootTokenLexer_ECHO_CODE
333 #define YY_mootTokenLexer_ECHO_CODE fwrite( (char *) YY_mootTokenLexer_TEXT, YY_mootTokenLexer_LENG, 1, YY_mootTokenLexer_OUT );
334 #endif
335 #ifndef YY_mootTokenLexer_INPUT
336 #define YY_mootTokenLexer_INPUT yy_input
337 #endif
338 #ifdef YY_mootTokenLexer_INPUT_PURE
339 #define YY_mootTokenLexer_INPUT_NOCODE
340 #endif
341 #ifndef YY_mootTokenLexer_INPUT_CODE
342 #define YY_mootTokenLexer_INPUT_CODE return result= fread( buffer, 1,max_size,YY_mootTokenLexer_IN );
343 #endif
344 #ifdef YY_mootTokenLexer_FATAL_ERROR_PURE
345 #define YY_mootTokenLexer_FATAL_ERRO_NOCODE
346 #endif
347 #ifndef YY_mootTokenLexer_FATAL_ERROR
348 #define YY_mootTokenLexer_FATAL_ERROR yy_fatal_error
349 #endif
350 #ifndef YY_mootTokenLexer_FATAL_ERROR_CODE
351 #define YY_mootTokenLexer_FATAL_ERROR_CODE fputs( msg, stderr );putc( '\n', stderr );exit( 1 );
352 #endif
353 #ifndef YY_mootTokenLexer_WRAP
354 #define YY_mootTokenLexer_WRAP yy_wrap
355 #endif
356 #ifdef YY_mootTokenLexer_WRAP_PURE
357 #define YY_mootTokenLexer_WRAP_NOCODE
358 #endif
359 #ifndef YY_mootTokenLexer_WRAP_CODE
360 #define YY_mootTokenLexer_WRAP_CODE return 1;
361 #endif
362 
363 
364 #ifndef YY_mootTokenLexer_INHERIT
365 #define YY_mootTokenLexer_INHERIT
366 #endif
367 #ifndef YY_mootTokenLexer_MEMBERS
368 #define YY_mootTokenLexer_MEMBERS
369 #endif
370 #ifndef YY_mootTokenLexer_CONSTRUCTOR_PARAM
371 #define YY_mootTokenLexer_CONSTRUCTOR_PARAM
372 #endif
373 #ifndef YY_mootTokenLexer_CONSTRUCTOR_CODE
374 #define YY_mootTokenLexer_CONSTRUCTOR_CODE
375 #endif
376 #ifndef YY_mootTokenLexer_CONSTRUCTOR_INIT
377 #define YY_mootTokenLexer_CONSTRUCTOR_INIT
378 #endif
379 typedef struct yy_buffer_state *YY_BUFFER_STATE;
380 
381 class YY_mootTokenLexer_CLASS YY_mootTokenLexer_INHERIT
382 {
383  private:/* data */
384  YY_mootTokenLexer_CHAR *yy_c_buf_p;
385  YY_mootTokenLexer_CHAR yy_hold_char;
386  int yy_n_chars;
387  int yy_init;
388  int yy_start;
389  int yy_did_buffer_switch_on_eof;
390  private: /* functions */
391  void yy_initialize();
392  int input();
393  int yyinput() {return input();};
394  int yy_get_next_buffer();
395  void yyunput( YY_mootTokenLexer_CHAR c, YY_mootTokenLexer_CHAR *buf_ptr );
396  /* use long instead of yy_state_type because it is undef */
397  long yy_get_previous_state_ ( void );
398  long yy_try_NUL_trans_ ( long current_state_ );
399  protected:/* non virtual */
400  YY_BUFFER_STATE yy_current_buffer;
401  void YY_mootTokenLexer_RESTART ( FILE *input_file );
402  void YY_mootTokenLexer_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer );
403  void YY_mootTokenLexer_LOAD_BUFFER_STATE( void );
404  YY_BUFFER_STATE YY_mootTokenLexer_CREATE_BUFFER( FILE *file, int size );
405  void YY_mootTokenLexer_DELETE_BUFFER( YY_BUFFER_STATE b );
406  void YY_mootTokenLexer_INIT_BUFFER( YY_BUFFER_STATE b, FILE *file );
407  protected: /* virtual */
408  virtual void YY_mootTokenLexer_ECHO()
409 #ifdef YY_mootTokenLexer_ECHO_PURE
410  =0
411 #endif
412  ;
413  virtual int YY_mootTokenLexer_INPUT(char *buf,int &result,int max_size)
414 #ifdef YY_mootTokenLexer_INPUT_PURE
415  =0
416 #endif
417  ;
418  virtual void YY_mootTokenLexer_FATAL_ERROR(const char *msg)
419 #ifdef YY_mootTokenLexer_FATAL_ERROR_PURE
420  =0
421 #endif
422  ;
423  virtual int YY_mootTokenLexer_WRAP()
424 #ifdef YY_mootTokenLexer_WRAP_PURE
425  =0
426 #endif
427  ;
428  public:
429  YY_mootTokenLexer_CHAR *YY_mootTokenLexer_TEXT;
430  int YY_mootTokenLexer_LENG;
431  FILE *YY_mootTokenLexer_IN, *YY_mootTokenLexer_OUT;
432  YY_mootTokenLexer_LEX_RETURN YY_mootTokenLexer_LEX ( YY_mootTokenLexer_LEX_PARAM);
433  YY_mootTokenLexer_CLASS(YY_mootTokenLexer_CONSTRUCTOR_PARAM) ;
434 #if YY_mootTokenLexer_DEBUG != 0
435  int YY_mootTokenLexer_DEBUG_FLAG;
436 #endif
437  public: /* added members */
438  YY_mootTokenLexer_MEMBERS
439 };
440 #endif
441 
442 
443 
444 /* declaration of externs for public use of yylex scanner */
445 
446 /* % here is the declaration from section2 %header{ */
447 #line 520 "mootTokenLexer.ll"
448 #endif
449 #line 302 "./flexskel.h"
450 
451 /* end of generated header */
Definition: mootAssocVector.h:39
classes and utilities for tokens and associated analyses
common utilities for flex++ lexers
struct yy_buffer_state * YY_BUFFER_STATE
Definition: mootClassfreqsLexer.h:49
struct yy_buffer_state * YY_BUFFER_STATE
Definition: mootTokenLexer.h:69