Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

FlexLexer Class Reference

From: Frank P.E. More...

#include <FlexLexer.hpp>

Inheritance diagram for FlexLexer:

compact_data_nodeFlexLexer funtxt_data_nodeFlexLexer funxml_data_nodeFlexLexer parens_data_nodeFlexLexer simplexml_data_nodeFlexLexer wesnoth_data_nodeFlexLexer List of all members.

Public Member Functions

virtual ~FlexLexer ()
const char * YYText ()
int YYLeng ()
virtual void yy_switch_to_buffer (struct yy_buffer_state *new_buffer)=0
virtual struct yy_buffer_state * yy_create_buffer (istream *s, int size)=0
virtual void yy_delete_buffer (struct yy_buffer_state *b)=0
virtual void yyrestart (istream *s)=0
virtual int yylex ()=0
int yylex (istream *new_in, ostream *new_out=0)
virtual void switch_streams (istream *new_in=0, ostream *new_out=0)=0
int lineno () const
int debug () const
void set_debug (int flag)

Protected Attributes

char * yytext
int yyleng
int yylineno
int yy_flex_debug

Detailed Description

From: Frank P.E.

Vanris Subject: Modification of FlexLexer.h

Date: Thu, 17 Jan 2002 14:35:26 -0600

I modified FlexLexer.h a bit.

To prevent a compiler warning (complaining that yylex() was hiding this function) I added in class yyFlexLexer the following:

int yylex( istream* new_in, ostream* new_out = 0 ) { return FlexLexer::yylex(new_in, new_out); }

Also in the class yyFlexLexer I added a protected method:

Function that can be used by subclasses during yylex() virtual int actionHook(void* data = 0) { return data == 0; }

I override this function in a subclass of yyFlexLexer and I use it in the lex file to call my subclass. Any data I have to save (e.g. character count) I can now keep in my own subclass as memberfields instead of global variables in the lex file.

I attached the FlexLexer.h file.

I don't know whether Flex is still maintained since the last tarfile is from July 27th 1997, but I thought I at least pass it on.

Frank Vanris.

Sept 2003: changes by stephan@s11n.net

Oct 2004: changed by stephan@s11n.net

Definition at line 111 of file FlexLexer.hpp.


Constructor & Destructor Documentation

virtual FlexLexer::~FlexLexer  )  [inline, virtual]
 

Definition at line 113 of file FlexLexer.hpp.


Member Function Documentation

int FlexLexer::debug  )  const [inline]
 

Definition at line 141 of file FlexLexer.hpp.

References yy_flex_debug.

int FlexLexer::lineno  )  const [inline]
 

Definition at line 139 of file FlexLexer.hpp.

References yylineno.

void FlexLexer::set_debug int  flag  )  [inline]
 

Definition at line 142 of file FlexLexer.hpp.

References yy_flex_debug.

virtual void FlexLexer::switch_streams istream *  new_in = 0,
ostream *  new_out = 0
[pure virtual]
 

Implemented in compact_data_nodeFlexLexer, funtxt_data_nodeFlexLexer, funxml_data_nodeFlexLexer, parens_data_nodeFlexLexer, simplexml_data_nodeFlexLexer, and wesnoth_data_nodeFlexLexer.

Referenced by yylex().

virtual struct yy_buffer_state* FlexLexer::yy_create_buffer istream *  s,
int  size
[pure virtual]
 

Implemented in compact_data_nodeFlexLexer, funtxt_data_nodeFlexLexer, funxml_data_nodeFlexLexer, parens_data_nodeFlexLexer, simplexml_data_nodeFlexLexer, and wesnoth_data_nodeFlexLexer.

virtual void FlexLexer::yy_delete_buffer struct yy_buffer_state *  b  )  [pure virtual]
 

Implemented in compact_data_nodeFlexLexer, funtxt_data_nodeFlexLexer, funxml_data_nodeFlexLexer, parens_data_nodeFlexLexer, simplexml_data_nodeFlexLexer, and wesnoth_data_nodeFlexLexer.

virtual void FlexLexer::yy_switch_to_buffer struct yy_buffer_state *  new_buffer  )  [pure virtual]
 

Implemented in compact_data_nodeFlexLexer, funtxt_data_nodeFlexLexer, funxml_data_nodeFlexLexer, parens_data_nodeFlexLexer, simplexml_data_nodeFlexLexer, and wesnoth_data_nodeFlexLexer.

int FlexLexer::YYLeng  )  [inline]
 

Definition at line 116 of file FlexLexer.hpp.

References yyleng.

int FlexLexer::yylex istream *  new_in,
ostream *  new_out = 0
[inline]
 

Reimplemented in compact_data_nodeFlexLexer, funtxt_data_nodeFlexLexer, funxml_data_nodeFlexLexer, parens_data_nodeFlexLexer, simplexml_data_nodeFlexLexer, and wesnoth_data_nodeFlexLexer.

Definition at line 128 of file FlexLexer.hpp.

References switch_streams(), and yylex().

virtual int FlexLexer::yylex  )  [pure virtual]
 

Implemented in compact_data_nodeFlexLexer, funtxt_data_nodeFlexLexer, funxml_data_nodeFlexLexer, parens_data_nodeFlexLexer, simplexml_data_nodeFlexLexer, and wesnoth_data_nodeFlexLexer.

Referenced by wesnoth_data_nodeFlexLexer::yylex(), simplexml_data_nodeFlexLexer::yylex(), parens_data_nodeFlexLexer::yylex(), funxml_data_nodeFlexLexer::yylex(), funtxt_data_nodeFlexLexer::yylex(), yylex(), and compact_data_nodeFlexLexer::yylex().

virtual void FlexLexer::yyrestart istream *  s  )  [pure virtual]
 

Implemented in compact_data_nodeFlexLexer, funtxt_data_nodeFlexLexer, funxml_data_nodeFlexLexer, parens_data_nodeFlexLexer, simplexml_data_nodeFlexLexer, and wesnoth_data_nodeFlexLexer.

const char* FlexLexer::YYText  )  [inline]
 

Definition at line 115 of file FlexLexer.hpp.

References yytext.


Member Data Documentation

int FlexLexer::yy_flex_debug [protected]
 

Definition at line 148 of file FlexLexer.hpp.

Referenced by debug(), and set_debug().

int FlexLexer::yyleng [protected]
 

Definition at line 146 of file FlexLexer.hpp.

Referenced by YYLeng().

int FlexLexer::yylineno [protected]
 

Definition at line 147 of file FlexLexer.hpp.

Referenced by lineno().

char* FlexLexer::yytext [protected]
 

Definition at line 145 of file FlexLexer.hpp.

Referenced by YYText().


The documentation for this class was generated from the following file:
Generated on Sat Dec 10 13:33:58 2005 for libs11n-1.2.1 by  doxygen 1.4.4