mootPPLexer.h
Go to the documentation of this file.
1 #ifndef FLEX_HEADER_mootPPLexer_h
2 #define FLEX_HEADER_mootPPLexer_h
3 #define YY_mootPPLexer_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 33 "mootPPLexer.ll"
57 /*============================================================================
58  * Doxygen docs
59  *============================================================================*/
74 #include <mootGenericLexer.h>
75 using namespace moot;
76 #line 54 "mootPPLexer.ll"
77 #define YY_mootPPLexer_CLASS mootPPLexer
78 #line 56 "mootPPLexer.ll"
79 #define YY_mootPPLexer_INHERIT \
80  : public GenericLexer
81 #line 59 "mootPPLexer.ll"
82 #define YY_mootPPLexer_INPUT_CODE \
83  return moot::GenericLexer::yyinput(buffer,result,max_size);
84 #line 62 "mootPPLexer.ll"
85 #define YY_mootPPLexer_MEMBERS \
86  public: \
87  /* -- public typedefs */\
88 \
89  typedef enum { \
90  PPEOF, \
91  UNKNOWN, \
92  EOS, \
93  XML_START_TAG, \
94  XML_END_TAG, \
95  XML_ENTITY, \
96  WORD, \
97  INTEGER, \
98  FLOAT, \
99  PUNCT, \
100  } TokenType; \
101  \
102  public: \
103  /* -- public local data */ \
104 \
105  bool verbose; \
106 \
107  unsigned int ntokens; \
108  \
109  std::string output_sentence_separator; \
110  \
111  std::string output_token_separator; \
112  \
113 \
114  virtual ~mootPPLexer(void) {}; \
115  \
116  /*----- BEGIN moot::GenericLexer helpers -----*/ \
117  virtual void *mgl_yy_current_buffer_p(void) \
118  {return reinterpret_cast<void*>(&yy_current_buffer);};\
119  virtual void *mgl_yy_create_buffer(int size, FILE *unused=stdin) \
120  {return reinterpret_cast<void*>(yy_create_buffer(unused,size));};\
121  virtual void mgl_yy_init_buffer(void *buf, FILE *unused=stdin) \
122  {yy_init_buffer(reinterpret_cast<YY_BUFFER_STATE>(buf),unused);};\
123  virtual void mgl_yy_delete_buffer(void *buf) \
124  {yy_delete_buffer(reinterpret_cast<YY_BUFFER_STATE>(buf));};\
125  virtual void mgl_yy_switch_to_buffer(void *buf) \
126  {yy_switch_to_buffer(reinterpret_cast<YY_BUFFER_STATE>(buf));};\
127  virtual void mgl_begin(int stateno); \
128  /*----- END moot::GenericLexer helpers -----*/
129 #line 107 "mootPPLexer.ll"
130 #define YY_mootPPLexer_CONSTRUCTOR_INIT : \
131  GenericLexer("mootPPLexer"), \
132  ntokens(0), \
133  output_sentence_separator("\n\n"), \
134  output_token_separator("\n")
135 #line 132 "mootPPLexer.ll"
136 #line 52 "./flexskel.h"
137 
138 
139 
140 #ifndef YY_mootPPLexer_TEXT
141 #define YY_mootPPLexer_TEXT yytext
142 #endif
143 #ifndef YY_mootPPLexer_LENG
144 #define YY_mootPPLexer_LENG yyleng
145 #endif
146 #ifndef YY_mootPPLexer_IN
147 #define YY_mootPPLexer_IN yyin
148 #endif
149 #ifndef YY_mootPPLexer_OUT
150 #define YY_mootPPLexer_OUT yyout
151 #endif
152 #ifndef YY_mootPPLexer_LEX_RETURN
153 #define YY_mootPPLexer_LEX_RETURN int
154 #else
155 #ifndef YY_mootPPLexer_LEX_DEFINED
156 #define YY_mootPPLexer_LEX_DEFINED
157 #endif
158 #endif
159 
160 #ifndef YY_mootPPLexer_LEX
161 #define YY_mootPPLexer_LEX yylex
162 #else
163 #ifndef YY_mootPPLexer_LEX_DEFINED
164 #define YY_mootPPLexer_LEX_DEFINED
165 #endif
166 #endif
167 
168 #ifndef YY_mootPPLexer_LEX_PARAM
169 #ifndef YY_USE_PROTOS
170 #define YY_mootPPLexer_LEX_PARAM
171 #else
172 #define YY_mootPPLexer_LEX_PARAM void
173 #endif
174 #else
175 #ifndef YY_mootPPLexer_LEX_DEFINED
176 #define YY_mootPPLexer_LEX_DEFINED
177 #endif
178 #endif
179 
180 #ifndef YY_mootPPLexer_LEX_PARAM_DEF
181 #define YY_mootPPLexer_LEX_PARAM_DEF
182 #else
183 #ifndef YY_mootPPLexer_LEX_DEFINED
184 #define YY_mootPPLexer_LEX_DEFINED
185 #endif
186 #endif
187 
188 #ifndef YY_mootPPLexer_RESTART
189 #define YY_mootPPLexer_RESTART yyrestart
190 #endif
191 #ifndef YY_mootPPLexer_SWITCH_TO_BUFFER
192 #define YY_mootPPLexer_SWITCH_TO_BUFFER yy_switch_to_buffer
193 #endif
194 #ifndef YY_mootPPLexer_LOAD_BUFFER_STATE
195 #define YY_mootPPLexer_LOAD_BUFFER_STATE yy_load_buffer_state
196 #endif
197 
198 #ifndef YY_mootPPLexer_CREATE_BUFFER
199 #define YY_mootPPLexer_CREATE_BUFFER yy_create_buffer
200 #ifndef YY_USE_CLASS
201 #ifndef yy_new_buffer
202 #define yy_new_buffer yy_create_buffer
203 #endif
204 #endif
205 #endif
206 #ifndef YY_mootPPLexer_DELETE_BUFFER
207 #define YY_mootPPLexer_DELETE_BUFFER yy_delete_buffer
208 #endif
209 #ifndef YY_mootPPLexer_INIT_BUFFER
210 #define YY_mootPPLexer_INIT_BUFFER yy_init_buffer
211 #endif
212 #ifdef YY_mootPPLexer_FLEX_DEBUG
213 #ifndef YY_mootPPLexer_DEBUG
214 #define YY_mootPPLexer_DEBUG 1
215 #endif
216 #else
217 #ifndef YY_mootPPLexer_DEBUG
218 #define YY_mootPPLexer_DEBUG 0
219 #endif
220 #endif
221 
222 #if YY_mootPPLexer_DEBUG != 0
223 #ifndef YY_mootPPLexer_DEBUG_FLAG
224 #define YY_mootPPLexer_DEBUG_FLAG yy_flex_debug
225 #endif
226 #ifndef YY_mootPPLexer_DEBUG_INIT
227 #define YY_mootPPLexer_DEBUG_INIT 1
228 #endif
229 #endif
230 
231 
232 
233 
234 #ifndef YY_USE_CLASS
235 typedef struct yy_buffer_state *YY_BUFFER_STATE;
236 
237 extern void YY_mootPPLexer_RESTART YY_PROTO(( FILE *input_file ));
238 extern void YY_mootPPLexer_SWITCH_TO_BUFFER YY_PROTO(( YY_BUFFER_STATE new_buffer ));
239 extern void YY_mootPPLexer_LOAD_BUFFER_STATE YY_PROTO(( void ));
240 extern YY_BUFFER_STATE YY_mootPPLexer_CREATE_BUFFER YY_PROTO(( FILE *file, int size ));
241 extern void YY_mootPPLexer_DELETE_BUFFER YY_PROTO(( YY_BUFFER_STATE b ));
242 extern void YY_mootPPLexer_INIT_BUFFER YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
243 
244 #if YY_mootPPLexer_DEBUG != 0
245 extern int YY_mootPPLexer_DEBUG_FLAG ;
246 #endif
247 extern YY_mootPPLexer_CHAR *YY_mootPPLexer_TEXT;
248 extern int YY_mootPPLexer_LENG;
249 extern FILE *YY_mootPPLexer_IN, *YY_mootPPLexer_OUT;
250 #ifdef YY_mootPPLexer_LEX_DEFINED
251 extern YY_mootPPLexer_LEX_RETURN YY_mootPPLexer_LEX ( YY_mootPPLexer_LEX_PARAM )
252 YY_mootPPLexer_LEX_PARAM_DEF
253 #else
254 #ifndef YY_DECL
255 extern YY_mootPPLexer_LEX_RETURN YY_mootPPLexer_LEX ( YY_mootPPLexer_LEX_PARAM )
256 YY_mootPPLexer_LEX_PARAM_DEF
257 #else
258 /* no declaration if oldstyle flex */
259 #endif
260 #endif
261 #else
262 
263 #ifndef YY_mootPPLexer_CLASS
264 #define YY_mootPPLexer_CLASS mootPPLexer
265 #endif
266 #ifndef YY_mootPPLexer_ECHO
267 #define YY_mootPPLexer_ECHO yy_echo
268 #endif
269 #ifdef YY_mootPPLexer_ECHO_PURE
270 #define YY_mootPPLexer_ECHO_NOCODE
271 #endif
272 #ifndef YY_mootPPLexer_ECHO_CODE
273 #define YY_mootPPLexer_ECHO_CODE fwrite( (char *) YY_mootPPLexer_TEXT, YY_mootPPLexer_LENG, 1, YY_mootPPLexer_OUT );
274 #endif
275 #ifndef YY_mootPPLexer_INPUT
276 #define YY_mootPPLexer_INPUT yy_input
277 #endif
278 #ifdef YY_mootPPLexer_INPUT_PURE
279 #define YY_mootPPLexer_INPUT_NOCODE
280 #endif
281 #ifndef YY_mootPPLexer_INPUT_CODE
282 #define YY_mootPPLexer_INPUT_CODE return result= fread( buffer, 1,max_size,YY_mootPPLexer_IN );
283 #endif
284 #ifdef YY_mootPPLexer_FATAL_ERROR_PURE
285 #define YY_mootPPLexer_FATAL_ERRO_NOCODE
286 #endif
287 #ifndef YY_mootPPLexer_FATAL_ERROR
288 #define YY_mootPPLexer_FATAL_ERROR yy_fatal_error
289 #endif
290 #ifndef YY_mootPPLexer_FATAL_ERROR_CODE
291 #define YY_mootPPLexer_FATAL_ERROR_CODE fputs( msg, stderr );putc( '\n', stderr );exit( 1 );
292 #endif
293 #ifndef YY_mootPPLexer_WRAP
294 #define YY_mootPPLexer_WRAP yy_wrap
295 #endif
296 #ifdef YY_mootPPLexer_WRAP_PURE
297 #define YY_mootPPLexer_WRAP_NOCODE
298 #endif
299 #ifndef YY_mootPPLexer_WRAP_CODE
300 #define YY_mootPPLexer_WRAP_CODE return 1;
301 #endif
302 
303 
304 #ifndef YY_mootPPLexer_INHERIT
305 #define YY_mootPPLexer_INHERIT
306 #endif
307 #ifndef YY_mootPPLexer_MEMBERS
308 #define YY_mootPPLexer_MEMBERS
309 #endif
310 #ifndef YY_mootPPLexer_CONSTRUCTOR_PARAM
311 #define YY_mootPPLexer_CONSTRUCTOR_PARAM
312 #endif
313 #ifndef YY_mootPPLexer_CONSTRUCTOR_CODE
314 #define YY_mootPPLexer_CONSTRUCTOR_CODE
315 #endif
316 #ifndef YY_mootPPLexer_CONSTRUCTOR_INIT
317 #define YY_mootPPLexer_CONSTRUCTOR_INIT
318 #endif
319 typedef struct yy_buffer_state *YY_BUFFER_STATE;
320 
321 class YY_mootPPLexer_CLASS YY_mootPPLexer_INHERIT
322 {
323  private:/* data */
324  YY_mootPPLexer_CHAR *yy_c_buf_p;
325  YY_mootPPLexer_CHAR yy_hold_char;
326  int yy_n_chars;
327  int yy_init;
328  int yy_start;
329  int yy_did_buffer_switch_on_eof;
330  private: /* functions */
331  void yy_initialize();
332  int input();
333  int yyinput() {return input();};
334  int yy_get_next_buffer();
335  void yyunput( YY_mootPPLexer_CHAR c, YY_mootPPLexer_CHAR *buf_ptr );
336  /* use long instead of yy_state_type because it is undef */
337  long yy_get_previous_state_ ( void );
338  long yy_try_NUL_trans_ ( long current_state_ );
339  protected:/* non virtual */
340  YY_BUFFER_STATE yy_current_buffer;
341  void YY_mootPPLexer_RESTART ( FILE *input_file );
342  void YY_mootPPLexer_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer );
343  void YY_mootPPLexer_LOAD_BUFFER_STATE( void );
344  YY_BUFFER_STATE YY_mootPPLexer_CREATE_BUFFER( FILE *file, int size );
345  void YY_mootPPLexer_DELETE_BUFFER( YY_BUFFER_STATE b );
346  void YY_mootPPLexer_INIT_BUFFER( YY_BUFFER_STATE b, FILE *file );
347  protected: /* virtual */
348  virtual void YY_mootPPLexer_ECHO()
349 #ifdef YY_mootPPLexer_ECHO_PURE
350  =0
351 #endif
352  ;
353  virtual int YY_mootPPLexer_INPUT(char *buf,int &result,int max_size)
354 #ifdef YY_mootPPLexer_INPUT_PURE
355  =0
356 #endif
357  ;
358  virtual void YY_mootPPLexer_FATAL_ERROR(const char *msg)
359 #ifdef YY_mootPPLexer_FATAL_ERROR_PURE
360  =0
361 #endif
362  ;
363  virtual int YY_mootPPLexer_WRAP()
364 #ifdef YY_mootPPLexer_WRAP_PURE
365  =0
366 #endif
367  ;
368  public:
369  YY_mootPPLexer_CHAR *YY_mootPPLexer_TEXT;
370  int YY_mootPPLexer_LENG;
371  FILE *YY_mootPPLexer_IN, *YY_mootPPLexer_OUT;
372  YY_mootPPLexer_LEX_RETURN YY_mootPPLexer_LEX ( YY_mootPPLexer_LEX_PARAM);
373  YY_mootPPLexer_CLASS(YY_mootPPLexer_CONSTRUCTOR_PARAM) ;
374 #if YY_mootPPLexer_DEBUG != 0
375  int YY_mootPPLexer_DEBUG_FLAG;
376 #endif
377  public: /* added members */
378  YY_mootPPLexer_MEMBERS
379 };
380 #endif
381 
382 
383 
384 /* declaration of externs for public use of yylex scanner */
385 
386 /* % here is the declaration from section2 %header{ */
387 #line 188 "mootPPLexer.ll"
388 #endif
389 #line 302 "./flexskel.h"
390 
391 /* end of generated header */
Definition: mootAssocVector.h:39
common utilities for flex++ lexers
struct yy_buffer_state * YY_BUFFER_STATE
Definition: mootClassfreqsLexer.h:49
struct yy_buffer_state * YY_BUFFER_STATE
Definition: mootPPLexer.h:49