#include <FlexLexer.hpp>

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 |
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.
| virtual FlexLexer::~FlexLexer | ( | ) | [inline, virtual] |
Definition at line 113 of file FlexLexer.hpp.
| const char* FlexLexer::YYText | ( | ) | [inline] |
| int FlexLexer::YYLeng | ( | ) | [inline] |
| virtual void FlexLexer::yy_switch_to_buffer | ( | struct yy_buffer_state * | new_buffer | ) | [pure virtual] |
| virtual struct yy_buffer_state* FlexLexer::yy_create_buffer | ( | istream * | s, | |
| int | size | |||
| ) | [read, pure virtual] |
| virtual void FlexLexer::yy_delete_buffer | ( | struct yy_buffer_state * | b | ) | [pure virtual] |
| virtual void FlexLexer::yyrestart | ( | istream * | s | ) | [pure virtual] |
| 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] |
| int FlexLexer::debug | ( | ) | const [inline] |
| void FlexLexer::set_debug | ( | int | flag | ) | [inline] |
char* FlexLexer::yytext [protected] |
int FlexLexer::yyleng [protected] |
int FlexLexer::yylineno [protected] |
int FlexLexer::yy_flex_debug [protected] |
1.5.3