List of all members
moot::wasteScanner Class Reference

Low-level class for raw text scanning. More...

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

Public Member Functions

Constructors etc.
 wasteScanner (const std::string &myname="wasteScanner", size_t line=0, size_t column=0, mootio::ByteOffset byte=0, size_t init_bufsize=GenericLexer::MGL_DEFAULT_BUFFER_SIZE)
 
virtual ~wasteScanner ()
 
Required Wrapper Methods (from GenericLexer)
virtual void * mgl_yy_create_buffer (int size, FILE *unused=stdin)
 
virtual void mgl_yy_switch_to_buffer (void *buf)
 
virtual void mgl_yy_init_buffer (void *buf, FILE *unused=stdin)
 
mootWasteScanner's real funcionalities
int yylex ()
 
std::string yytext ()
 
int yyleng ()
 
bool fill (size_t n)
 
virtual void reset ()
 
virtual void from_mstream (mootio::mistream *in)
 
- Public Member Functions inherited from moot::GenericLexer
 GenericLexer (const std::string &myname="moot::GenericLexer", size_t line=0, size_t column=0, mootio::ByteOffset byte=0)
 
virtual ~GenericLexer (void)
 
virtual void clear (bool clear_input=true, bool clear_output=true)
 
virtual void * mgl_yy_current_buffer_p (void)
 
virtual void mgl_begin (int stateno)
 
virtual void mgl_yy_delete_buffer (void *buf)
 
virtual void from_filename (const std::string &filename)
 
virtual void from_file (FILE *in=stdin)
 
virtual void from_buffer (const char *buf, size_t len)
 
void from_string (const char *s)
 
void from_string (const std::string &s)
 
void select_streams (FILE *in, FILE *out=stdout, const char *myname=__null)
 
void select_string (const char *in, FILE *out=stderr, const char *myname=__null)
 
virtual void to_mstream (mootio::mostream *out=__null)
 
virtual void to_filename (const std::string &filename)
 
virtual void to_file (FILE *out=stdout)
 
int yyinput (char *buffer, int &result, int max_size)
 
void tokbuf_append (const char *text, size_t len)
 
void add_columns (ByteOffset len)
 
void add_lines (ByteOffset len=1)
 
virtual void yycarp (const char *fmt,...)
 

Public Attributes

Low-level data
char * yybuffer
 
char * yycursor
 
char * yylimit
 
char * yytoken
 
char * yymarker
 
size_t buffer_size
 
- Public Attributes inherited from moot::GenericLexer
mootio::mistreammglin
 
mootio::mostreammglout
 
bool mgl_in_created
 
bool mgl_out_created
 
size_t theLine
 
size_t theColumn
 
mootio::ByteOffset theByte
 
std::string lexname
 
std::string tokbuf
 
bool tokbuf_clear
 

Additional Inherited Members

- Static Public Attributes inherited from moot::GenericLexer
static const int MGL_DEFAULT_BUFFER_SIZE = 16384
 

Detailed Description

Todo:
fix column counting

Constructor & Destructor Documentation

◆ wasteScanner()

moot::wasteScanner::wasteScanner ( const std::string &  myname = "wasteScanner",
size_t  line = 0,
size_t  column = 0,
mootio::ByteOffset  byte = 0,
size_t  init_bufsize = GenericLexer::MGL_DEFAULT_BUFFER_SIZE 
)

Default constructor

◆ ~wasteScanner()

virtual moot::wasteScanner::~wasteScanner ( )
virtual

Destructor

Member Function Documentation

◆ mgl_yy_create_buffer()

virtual void* moot::wasteScanner::mgl_yy_create_buffer ( int  size,
FILE *  unused = stdin 
)
inlinevirtual

All other moot lexers are based on flex. Dummy implementation.

Implements moot::GenericLexer.

References moot::GenericLexer::yycarp().

◆ mgl_yy_switch_to_buffer()

virtual void moot::wasteScanner::mgl_yy_switch_to_buffer ( void *  buf)
inlinevirtual

All other moot lexers are based on flex. Dummy implementation.

Implements moot::GenericLexer.

References moot::GenericLexer::yycarp().

◆ mgl_yy_init_buffer()

virtual void moot::wasteScanner::mgl_yy_init_buffer ( void *  buf,
FILE *  unused = stdin 
)
inlinevirtual

All other moot lexers are based on flex. Dummy implementation.

Implements moot::GenericLexer.

References moot::GenericLexer::yycarp(), and yylex().

◆ yylex()

int moot::wasteScanner::yylex ( )

yylex () (from wasteScannerScan.re.skel)

Referenced by mgl_yy_init_buffer().

◆ yytext()

std::string moot::wasteScanner::yytext ( )
inline

Returns contents of the current segment.

References yyleng().

◆ yyleng()

int moot::wasteScanner::yyleng ( )
inline

Returns length of the current segment.

References fill(), from_mstream(), and reset().

Referenced by yytext().

◆ fill()

bool moot::wasteScanner::fill ( size_t  n)

Grabs new characters from input stream, called by yylex.

Referenced by yyleng().

◆ reset()

virtual void moot::wasteScanner::reset ( )
virtual

Resets scanner to initial state

Reimplemented from moot::GenericLexer.

Referenced by yyleng().

◆ from_mstream()

virtual void moot::wasteScanner::from_mstream ( mootio::mistream in)
virtual

Switches input source

Reimplemented from moot::GenericLexer.

Referenced by yyleng().

Member Data Documentation

◆ yybuffer

char* moot::wasteScanner::yybuffer

used for token-buffering

◆ yycursor

char* moot::wasteScanner::yycursor

current position in buffer

◆ yylimit

char* moot::wasteScanner::yylimit

end of buffer content

◆ yytoken

char* moot::wasteScanner::yytoken

beginning of current token

◆ yymarker

char* moot::wasteScanner::yymarker

last matching position

◆ buffer_size

size_t moot::wasteScanner::buffer_size

current allocated length of yybuffer


The documentation for this class was generated from the following file: