Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages
InputBuffer Class Reference
#include <InputBuffer.hpp>
Inheritance diagram for InputBuffer:
List of all members.
Detailed Description
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 conume(), but deferred until needed by LA or LT.
- See also:
-
antlr.CharQueue
Constructor & Destructor Documentation
InputBuffer::InputBuffer |
( |
|
) |
[inline] |
|
|
Create a character buffer |
virtual InputBuffer::~InputBuffer |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
InputBuffer::ANTLR_USE_NAMESPACE |
( |
std |
|
) |
const |
|
InputBuffer::ANTLR_USE_NAMESPACE |
( |
std |
|
) |
const |
|
void InputBuffer::commit |
( |
void |
|
) |
[inline] |
|
|
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. So, you either do a mark/rewind for failed predicate or mark/commit to keep on parsing without rewinding the input. |
virtual void InputBuffer::consume |
( |
|
) |
[inline, virtual] |
|
|
Mark another character for deferred consumption |
unsigned int InputBuffer::entries |
( |
|
) |
[virtual] |
|
|
Get the number of non-consumed characters |
void InputBuffer::fill |
( |
unsigned int |
amount |
) |
[virtual] |
|
|
Ensure that the character buffer is sufficiently full |
virtual int InputBuffer::getChar |
( |
|
) |
[pure virtual] |
|
virtual bool InputBuffer::isMarked |
( |
|
) |
const [inline, virtual] |
|
|
Are there any marks active in the InputBuffer.
|
virtual int InputBuffer::LA |
( |
unsigned int |
i |
) |
[inline, virtual] |
|
|
Get a lookahead character |
unsigned int InputBuffer::mark |
( |
|
) |
[virtual] |
|
|
Return an integer marker that can be used to rewind the buffer to its current state. |
virtual void InputBuffer::reset |
( |
void |
|
) |
[inline, virtual] |
|
void InputBuffer::rewind |
( |
unsigned int |
mark |
) |
[virtual] |
|
|
Rewind the character buffer to a marker. - Parameters:
-
mark |
Marker returned previously from mark() |
|
void InputBuffer::syncConsume |
( |
|
) |
[inline, protected] |
|
|
Sync up deferred consumption |
Member Data Documentation
unsigned int InputBuffer::markerOffset [protected]
|
|
unsigned int InputBuffer::nMarkers [protected]
|
|
unsigned int InputBuffer::numToConsume [protected]
|
|
The documentation for this class was generated from the following files:
Generated on Wed Nov 3 12:59:40 2004 for Lemur Toolkit by
1.2.18