ANTLR Support Libraries 2.7.1+
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
Public Member Functions | Protected Attributes
CharInputBuffer Class Reference

#include <CharInputBuffer.hpp>

Inheritance diagram for CharInputBuffer:
Inheritance graph
[legend]
Collaboration diagram for CharInputBuffer:
Collaboration graph
[legend]

List of all members.

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 ( 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 ( 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

virtual int CharInputBuffer::getChar ( void  )
inlinevirtual

Override this in subclasses to get the next character

Implements InputBuffer.

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

unsigned char* CharInputBuffer::buffer
protected

the buffer with data

bool CharInputBuffer::delete_buffer
protected

flag signifying if we have to delete the buffer

unsigned char* CharInputBuffer::end
protected

end sentry for buffer

unsigned char* CharInputBuffer::ptr
protected

position ptr into the buffer


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