FlexLexer Class Reference

From: Frank P.E. More...

#include <FlexLexer.hpp>

Inheritance diagram for FlexLexer:

Inheritance graph
[legend]

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

const char* FlexLexer::YYText (  )  [inline]

Definition at line 115 of file FlexLexer.hpp.

References yytext.

int FlexLexer::YYLeng (  )  [inline]

Definition at line 116 of file FlexLexer.hpp.

References yyleng.

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.

virtual struct yy_buffer_state* FlexLexer::yy_create_buffer ( istream *  s,
int  size 
) [read, 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::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.

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().

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 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().

int FlexLexer::lineno (  )  const [inline]

Definition at line 139 of file FlexLexer.hpp.

References yylineno.

int FlexLexer::debug (  )  const [inline]

Definition at line 141 of file FlexLexer.hpp.

References yy_flex_debug.

void FlexLexer::set_debug ( int  flag  )  [inline]

Definition at line 142 of file FlexLexer.hpp.

References yy_flex_debug.


Member Data Documentation

char* FlexLexer::yytext [protected]

Definition at line 145 of file FlexLexer.hpp.

Referenced by YYText().

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().

int FlexLexer::yy_flex_debug [protected]

Definition at line 148 of file FlexLexer.hpp.

Referenced by debug(), and set_debug().


The documentation for this class was generated from the following file:
Generated on Wed Jun 4 21:42:45 2008 for libs11n-1.2.7 by  doxygen 1.5.3