/** 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()); } }
/** 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); } } }
/** Rewind the character buffer to a marker. * @param mark Marker returned previously from mark() */ void InputBuffer::rewind(unsigned int mark) { syncConsume(); markerOffset = mark; nMarkers--; }
/** Return an integer marker that can be used to rewind the buffer to * its current state. */ unsigned int InputBuffer::mark() { syncConsume(); nMarkers++; return markerOffset; }
/**Rewind the token buffer to a marker. * @param mark Marker returned previously from mark() */ void TokenBuffer::rewind(int mark) { syncConsume(); markerOffset=mark; nMarkers--; }
/** Return an integer marker that can be used to rewind the buffer to * its current state. */ int TokenBuffer::mark() { syncConsume(); nMarkers++; return markerOffset; }