ANTLR Support Libraries 2.7.1+
Loading...
Searching...
No Matches
CharInputBuffer Class Reference

#include <CharInputBuffer.hpp>

Inheritance diagram for CharInputBuffer:
Collaboration diagram for CharInputBuffer:

Public Member Functions

 CharInputBuffer (unsigned char *buf, size_t size, bool owner=false)
 ~CharInputBuffer (void)
virtual void reset (void)
virtual int getChar (void)
Public Member Functions inherited from InputBuffer
 InputBuffer ()
virtual ~InputBuffer ()
void commit (void)
virtual void consume ()
virtual void fill (unsigned int amount)
virtual int LA (unsigned int i)
virtual unsigned int mark ()
virtual bool isMarked () const
 Are there any marks active in the InputBuffer.
virtual void rewind (unsigned int mark)
virtual unsigned int entries () const
std::string getLAChars () const
std::string getMarkedChars () const

Protected Attributes

unsigned char * buffer
 the buffer with data
unsigned char * ptr
 position ptr into the buffer
unsigned char * end
 end sentry for buffer
bool delete_buffer
 flag signifying if we have to delete the buffer
Protected Attributes inherited from InputBuffer
unsigned int nMarkers
unsigned int markerOffset
unsigned int numToConsume
CircularQueue< int > queue

Additional Inherited Members

Protected Member Functions inherited from InputBuffer
void syncConsume ()

Detailed Description

CharInputBuffer.hpp provides an InputBuffer for plain character arrays (buffers).

Constructor & Destructor Documentation

◆ CharInputBuffer()

CharInputBuffer::CharInputBuffer ( unsigned char * buf,
size_t size,
bool owner = false )
inline

Construct a CharInputBuffer.hpp object with a char* buffer of 'size' if 'owner' is true, then the buffer will be delete[]-ed on destruction.

Note
it is assumed the buffer was allocated with new[]!

◆ ~CharInputBuffer()

CharInputBuffer::~CharInputBuffer ( void )
inline

Destructor

Note
If you're using malloced data, then you probably need to change this destructor. Or better use this class as template for your own.

Member Function Documentation

◆ getChar()

virtual int CharInputBuffer::getChar ( void )
inlinevirtual

Override this in subclasses to get the next character

Implements InputBuffer.

◆ reset()

virtual void CharInputBuffer::reset ( void )
inlinevirtual

Reset the CharInputBuffer to initial state Called from LexerInputState::reset.

See also
LexerInputState

Reimplemented from InputBuffer.

Member Data Documentation

◆ buffer

unsigned char* CharInputBuffer::buffer
protected

the buffer with data

◆ delete_buffer

bool CharInputBuffer::delete_buffer
protected

flag signifying if we have to delete the buffer

◆ end

unsigned char* CharInputBuffer::end
protected

end sentry for buffer

◆ ptr

unsigned char* CharInputBuffer::ptr
protected

position ptr into the buffer


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