Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members
moot::GenericLexer Class Reference
Abstract base class for Flex++ lexers.
More...
#include <mootGenericLexer.h>
Inheritance diagram for moot::GenericLexer:
[legend]Collaboration diagram for moot::GenericLexer:
[legend]List of all members.Public Methods
|
- GenericLexer (const std::string &myname="moot::GenericLexer", size_t line=0, size_t column=0, size_t byte=0)
- virtual ~GenericLexer (void)
- virtual void reset (void)
- virtual void clear (bool clear_input=true, bool clear_output=true)
|
|
|
|
- int yyinput (char *buffer, int &result, int max_size)
|
|
- virtual void yycarp (const char *fmt,...)
Public Attributes
|
|
|
- std::string lexname
- symbolic name of lexer (or program)
|
Static Public Attributes
Detailed Description
Descendant lexer specifications should include the following:
header{
include <mootGenericLexer.h>
using namespace moot;
%}
define CLASS myLexer
define INHERIT \
: public GenericLexer
define INPUT_CODE \
return moot::GenericLexer::yyinput(buffer,result,max_size);
define MEMBERS \
//... \
/ *----- moot::GenericLexer helpers -----* / \
virtual void **mgl_yy_current_buffer_p(void) \
{return (void**)(&yy_current_buffer);};\
virtual void *mgl_yy_create_buffer(int size, FILE *unused=stdin) \
{return (void*)(yy_create_buffer(unused,size));};\
virtual void mgl_yy_init_buffer(void *buf, FILE *unused=stdin) \
{yy_init_buffer((YY_BUFFER_STATE)buf,unused);};\
virtual void mgl_yy_delete_buffer(void *buf) \
{yy_delete_buffer((YY_BUFFER_STATE)buf);};\
virtual void mgl_yy_switch_to_buffer(void *buf) \
{yy_switch_to_buffer((YY_BUFFER_STATE)buf);};\
virtual void mgl_begin(int stateno); \
//...
define CONSTRUCTOR_INIT : \
moot::GenericLexer("myLexer") \
// ...
%%
%{
//-- rules go here ...
%}
%%
void myLexer::mgl_begin(int stateno) {BEGIN(stateno);}
Constructor & Destructor Documentation
moot::GenericLexer::GenericLexer |
( |
const std::string & |
myname = "moot::GenericLexer", |
|
|
size_t |
line = 0, |
|
|
size_t |
column = 0, |
|
|
size_t |
byte = 0 |
|
) |
[inline] |
|
virtual moot::GenericLexer::~GenericLexer |
( |
void |
|
) |
[virtual] |
|
Member Function Documentation
virtual void moot::GenericLexer::clear |
( |
bool |
clear_input = true, |
|
|
bool |
clear_output = true |
|
) |
[virtual] |
|
|
Clear any selected streams |
virtual void moot::GenericLexer::from_buffer |
( |
const char * |
buf, |
|
|
size_t |
len |
|
) |
[virtual] |
|
virtual void moot::GenericLexer::from_file |
( |
FILE * |
in = stdin |
) |
[virtual] |
|
virtual void moot::GenericLexer::from_filename |
( |
const std::string & |
filename |
) |
[virtual] |
|
virtual void moot::GenericLexer::from_mstream |
( |
mootio::mistream * |
in = 0 |
) |
[virtual] |
|
void moot::GenericLexer::from_string |
( |
const std::string & |
s |
) |
[inline] |
|
void moot::GenericLexer::from_string |
( |
const char * |
s |
) |
[inline] |
|
virtual void moot::GenericLexer::mgl_begin |
( |
int |
stateno |
) |
[virtual] |
|
virtual void* moot::GenericLexer::mgl_yy_create_buffer |
( |
int |
size, |
|
|
FILE * |
unused = stdin |
|
) |
[pure virtual] |
|
virtual void** moot::GenericLexer::mgl_yy_current_buffer_p |
( |
void |
|
) |
[virtual] |
|
virtual void moot::GenericLexer::mgl_yy_delete_buffer |
( |
void * |
buf |
) |
[inline, virtual] |
|
virtual void moot::GenericLexer::mgl_yy_init_buffer |
( |
void * |
buf, |
|
|
FILE * |
unused = stdin |
|
) |
[pure virtual] |
|
virtual void moot::GenericLexer::mgl_yy_switch_to_buffer |
( |
void * |
buf |
) |
[pure virtual] |
|
virtual void moot::GenericLexer::reset |
( |
void |
|
) |
[virtual] |
|
void moot::GenericLexer::select_streams |
( |
FILE * |
in, |
|
|
FILE * |
out = stdout, |
|
|
const char * |
myname = 0 |
|
) |
[inline] |
|
|
Backwards-compatible alias |
void moot::GenericLexer::select_string |
( |
const char * |
in, |
|
|
FILE * |
out = stderr, |
|
|
const char * |
myname = 0 |
|
) |
[inline] |
|
|
Backwards-compatible alias |
virtual void moot::GenericLexer::to_file |
( |
FILE * |
out = stdout |
) |
[virtual] |
|
virtual void moot::GenericLexer::to_filename |
( |
const std::string & |
filename |
) |
[virtual] |
|
virtual void moot::GenericLexer::to_mstream |
( |
mootio::mostream * |
out = 0 |
) |
[virtual] |
|
void moot::GenericLexer::tokbuf_append |
( |
const char * |
text, |
|
|
size_t |
len |
|
) |
[inline] |
|
|
Add some characters to 'tokbuf' buffer |
virtual void moot::GenericLexer::yycarp |
( |
const char * |
fmt, |
|
|
... |
|
|
) |
[virtual] |
|
int moot::GenericLexer::yyinput |
( |
char * |
buffer, |
|
|
int & |
result, |
|
|
int |
max_size |
|
) |
[inline] |
|
|
yyinput() hack, for use with flex++ INPUT_CODE |
Member Data Documentation
std::string moot::GenericLexer::lexname
|
|
const int moot::GenericLexer::MGL_DEFAULT_BUFFER_SIZE = 8192 [static]
|
|
bool moot::GenericLexer::mgl_in_created
|
|
bool moot::GenericLexer::mgl_out_created
|
|
size_t moot::GenericLexer::theByte
|
|
size_t moot::GenericLexer::theColumn
|
|
size_t moot::GenericLexer::theLine
|
|
std::string moot::GenericLexer::tokbuf
|
|
bool moot::GenericLexer::tokbuf_clear
|
|
The documentation for this class was generated from the following file:
Generated on Mon Sep 11 16:10:35 2006 for libmoot by
1.2.18