OpenMD 3.1
Molecular Dynamics in the Open
|
CharInputBuffer.hpp provides an InputBuffer for plain character arrays (buffers). More...
#include <CharInputBuffer.hpp>
Public Member Functions | |
CharInputBuffer (unsigned char *buf, size_t size, bool owner=false) | |
Construct a CharInputBuffer.hpp object with a char* buffer of 'size' if 'owner' is true, then the buffer will be delete[]-ed on destruction. | |
~CharInputBuffer (void) | |
Destructor. | |
virtual void | reset (void) |
Reset the CharInputBuffer to initial state Called from LexerInputState::reset. | |
virtual int | getChar (void) |
Override this in subclasses to get the next character. | |
Public Member Functions inherited from antlr::InputBuffer | |
InputBuffer () | |
Create a character buffer. | |
void | commit (void) |
This method updates the state of the input buffer so that the text matched since the most recent mark() is no longer held by the buffer. | |
virtual void | consume () |
Mark another character for deferred consumption. | |
virtual void | fill (unsigned int amount) |
Ensure that the character buffer is sufficiently full. | |
virtual int | LA (unsigned int i) |
Get a lookahead character. | |
virtual unsigned int | mark () |
Return an integer marker that can be used to rewind the buffer to its current state. | |
virtual bool | isMarked () const |
Are there any marks active in the InputBuffer. | |
virtual void | rewind (unsigned int mark) |
Rewind the character buffer to a marker. | |
virtual unsigned int | entries () const |
Get the number of non-consumed characters. | |
std::string | getLAChars () const |
get the current lookahead characters as a string | |
std::string | getMarkedChars () const |
get the current marked characters as a string | |
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 antlr::InputBuffer | |
unsigned int | nMarkers |
unsigned int | markerOffset |
unsigned int | numToConsume |
CircularQueue< int > | queue |
Additional Inherited Members | |
Protected Member Functions inherited from antlr::InputBuffer | |
void | syncConsume () |
Sync up deferred consumption. | |
CharInputBuffer.hpp provides an InputBuffer for plain character arrays (buffers).
Definition at line 26 of file CharInputBuffer.hpp.
|
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.
Definition at line 33 of file CharInputBuffer.hpp.
|
inline |
Destructor.
Definition at line 45 of file CharInputBuffer.hpp.
References buffer, and delete_buffer.
|
inlinevirtual |
Override this in subclasses to get the next character.
Implements antlr::InputBuffer.
Definition at line 61 of file CharInputBuffer.hpp.
|
inlinevirtual |
Reset the CharInputBuffer to initial state Called from LexerInputState::reset.
Reimplemented from antlr::InputBuffer.
Definition at line 55 of file CharInputBuffer.hpp.
References buffer, ptr, and antlr::InputBuffer::reset().
|
protected |
the buffer with data
Definition at line 67 of file CharInputBuffer.hpp.
Referenced by reset(), and ~CharInputBuffer().
|
protected |
flag signifying if we have to delete the buffer
Definition at line 70 of file CharInputBuffer.hpp.
Referenced by ~CharInputBuffer().
|
protected |
|
protected |
position ptr into the buffer
Definition at line 68 of file CharInputBuffer.hpp.