ANTLR Support Libraries 2.7.1+
|
#include <CharBuffer.hpp>
Public Member Functions | |
CharBuffer (std ::istream &input) | |
Create a character buffer. More... | |
int | getChar () |
Get the next character from the stream. More... | |
![]() | |
InputBuffer () | |
virtual | ~InputBuffer () |
virtual void | reset (void) |
Reset the input buffer to empty state. More... | |
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. More... | |
virtual void | rewind (unsigned int mark) |
virtual unsigned int | entries () const |
std ::string | getLAChars () const |
std ::string | getMarkedChars () const |
Protected Attributes | |
std ::istream & | input |
![]() | |
unsigned int | nMarkers |
unsigned int | markerOffset |
unsigned int | numToConsume |
CircularQueue< int > | queue |
Private Member Functions | |
CharBuffer (const CharBuffer &other) | |
CharBuffer & | operator= (const CharBuffer &other) |
Additional Inherited Members | |
![]() | |
void | syncConsume () |
A Stream of characters fed to the lexer from a InputStream that can be rewound via mark()/rewind() methods.
A dynamic array is used to buffer up all the input characters. Normally, "k" characters are stored in the buffer. More characters may be stored during guess mode (testing syntactic predicate), or when LT(i>k) is referenced. Consumption of characters is deferred. In other words, reading the next character is not done by consume(), but deferred until needed by LA or LT.
CharBuffer::CharBuffer | ( | std ::istream & | input_ | ) |
Create a character buffer.
Create a character buffer. Enable fail and bad exceptions, if supported by platform.
|
private |
|
virtual |
Get the next character from the stream.
Get the next character from the stream. May throw CharStreamIOException when something bad happens (not EOF) (if supported by platform).
Implements InputBuffer.
|
private |
|
protected |