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

moot::GenericLexer Class Reference

Abstract base class for Flex++ lexers. More...

#include <mootGenericLexer.h>

Inheritance diagram for moot::GenericLexer:

Inheritance graph
[legend]
Collaboration diagram for moot::GenericLexer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Constructors etc.
Required Wrapper Methods
Input selection
Output selection
Input Reverse-Override Hacks
Token Buffering
Diagnostics

Public Attributes

Stream Parameters
Positional Parameters
Diagnostic Data
Low-level data

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]
 

Default constructor

virtual moot::GenericLexer::~GenericLexer void   )  [virtual]
 

Destructor


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]
 

Select C-buffer input

virtual void moot::GenericLexer::from_file FILE *  in = stdin  )  [virtual]
 

Select C-stream input

virtual void moot::GenericLexer::from_filename const std::string &  filename  )  [virtual]
 

Select named file input

virtual void moot::GenericLexer::from_mstream mootio::mistream in = 0  )  [virtual]
 

Select mootio::mstream input

void moot::GenericLexer::from_string const std::string &  s  )  [inline]
 

Select C++ string input

void moot::GenericLexer::from_string const char *  s  )  [inline]
 

Select C-string input

virtual void moot::GenericLexer::mgl_begin int  stateno  )  [inline, virtual]
 

Set current start-state. Descendants must override this method (section 3 only!)

Reimplemented in mootClassfreqsLexer, mootLexfreqsLexer, mootNgramsLexer, mootPPLexer, and mootTokenLexer.

virtual void* moot::GenericLexer::mgl_yy_create_buffer int  size,
FILE *  unused = stdin
[pure virtual]
 

Flex++ should define this (backwards), but it doesn't get through to us

Implemented in mootClassfreqsLexer, mootLexfreqsLexer, mootNgramsLexer, mootPPLexer, and mootTokenLexer.

virtual void** moot::GenericLexer::mgl_yy_current_buffer_p void   )  [inline, virtual]
 

Reimplemented in mootClassfreqsLexer, mootLexfreqsLexer, mootNgramsLexer, mootPPLexer, and mootTokenLexer.

virtual void moot::GenericLexer::mgl_yy_delete_buffer void *  buf  )  [inline, virtual]
 

Flex++ should define this, but it doesn't get through to us

Reimplemented in mootClassfreqsLexer, mootLexfreqsLexer, mootNgramsLexer, mootPPLexer, and mootTokenLexer.

virtual void moot::GenericLexer::mgl_yy_init_buffer void *  buf,
FILE *  unused = stdin
[pure virtual]
 

Flex++ should define this, but it doesn't get through to us

Implemented in mootClassfreqsLexer, mootLexfreqsLexer, mootNgramsLexer, mootPPLexer, and mootTokenLexer.

virtual void moot::GenericLexer::mgl_yy_switch_to_buffer void *  buf  )  [pure virtual]
 

Flex++ should define this, but it doesn't get through to us

Implemented in mootClassfreqsLexer, mootLexfreqsLexer, mootNgramsLexer, mootPPLexer, and mootTokenLexer.

virtual void moot::GenericLexer::reset void   )  [virtual]
 

Reset lexer state

Reimplemented in mootTokenLexer.

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]
 

Select C-stream output

virtual void moot::GenericLexer::to_filename const std::string &  filename  )  [virtual]
 

Select named file output

virtual void moot::GenericLexer::to_mstream mootio::mostream out = 0  )  [virtual]
 

Select mootio::mstream output

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]
 

Complain

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
 

mootio::mistream* moot::GenericLexer::mglin
 

mootio::mostream* moot::GenericLexer::mglout
 

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 Jun 27 13:05:27 2005 for libmoot by  doxygen 1.3.8-20040913