Пример #1
0
/** Ensure that the token buffer is sufficiently full */
void TokenBuffer::fill(int amount)
{
	syncConsume();
	// Fill the buffer sufficiently to hold needed tokens
	while (queue.entries() < amount + markerOffset) {
		// Append the next token
		queue.append(input.nextToken());
	}
}
Пример #2
0
/** Ensure that the token buffer is sufficiently full */
void TokenBuffer::fill(int amount)
{
	syncConsume();
	// Fill the buffer sufficiently to hold needed tokens
	while (queue.entries() < amount + markerOffset) {
		// Append the next token
    RefToken next = input.nextToken();
    if (ActiveException())
    {
      return;
    }
    else
    {
      queue.append(next);
    }
	}
}
Пример #3
0
/** Rewind the character buffer to a marker.
 * @param mark Marker returned previously from mark()
 */
void InputBuffer::rewind(unsigned int mark)
{
	syncConsume();
	markerOffset = mark;
	nMarkers--;
}
Пример #4
0
/** Return an integer marker that can be used to rewind the buffer to
 * its current state.
 */
unsigned int InputBuffer::mark()
{
	syncConsume();
	nMarkers++;
	return markerOffset;
}
Пример #5
0
/**Rewind the token buffer to a marker.
 * @param mark Marker returned previously from mark()
 */
void TokenBuffer::rewind(int mark)
{
	syncConsume();
	markerOffset=mark;
	nMarkers--;
}
Пример #6
0
/** Return an integer marker that can be used to rewind the buffer to
 * its current state.
 */
int TokenBuffer::mark()
{
	syncConsume();
	nMarkers++;
	return markerOffset;
}