|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.umlv.tatoo.runtime.buffer.impl.AbstractLexerBuffer
fr.umlv.tatoo.runtime.buffer.impl.CharBufferWrapper
public class CharBufferWrapper
A CharBufferWrapper wraps a CharBuffer in order to allow
a lexer to process its content in order to have its tokens extracted.
Lexer| Constructor Summary | |
|---|---|
CharBufferWrapper(CharBuffer buffer,
LocationTracker tracker)
Constructs a CharBufferWrapper which wraps specified CharBuffer. |
|
| Method Summary | |
|---|---|
void |
compact()
|
protected void |
discardImpl()
|
void |
flip()
|
int |
getTokenEnd()
|
int |
getTokenStart()
|
boolean |
hasRemaining()
Returns true if more characters are availables in the buffer. |
int |
lastChar()
Returns last read char or -1 if not available. |
protected int |
nextImpl()
Returns next character in buffer without taking care of locations |
boolean |
previousWasNewLine()
Determines if the last unwinded character was an end of line. |
boolean |
read()
Reads at some bytes from the stream. |
protected void |
resetImpl()
Moves current position back to first non unwinded character without taking care of locations |
protected void |
restartImpl()
|
protected void |
unwindImpl(int l)
Performs unwind operation on buffer without taking care of locations |
CharBuffer |
view()
Provides a view of all available tokens. |
| Methods inherited from class fr.umlv.tatoo.runtime.buffer.impl.AbstractLexerBuffer |
|---|
discard, getLocationProvider, locationClear, next, reset, restart, unwind |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface fr.umlv.tatoo.runtime.buffer.TokenBuffer |
|---|
discard |
| Constructor Detail |
|---|
public CharBufferWrapper(CharBuffer buffer,
LocationTracker tracker)
CharBufferWrapper which wraps specified CharBuffer.
buffer - the CharBuffer to wraptracker - the location tracker| Method Detail |
|---|
protected void unwindImpl(int l)
AbstractLexerBuffer
unwindImpl in class AbstractLexerBufferl - the number of characters to unwindLexerBuffer.unwind(int)protected void resetImpl()
AbstractLexerBuffer
resetImpl in class AbstractLexerBufferLexerBuffer.reset()public boolean previousWasNewLine()
LexerBuffer
previousWasNewLine in interface LexerBuffertrue if the last unwinded character was an end of line;
false otherwisepublic boolean hasRemaining()
LexerBuffer
hasRemaining in interface LexerBufferpublic boolean read()
LexerBufferSimpleLexer.run().
read in interface LexerBufferfalse at end of streamprotected int nextImpl()
AbstractLexerBuffer
nextImpl in class AbstractLexerBufferLexerBuffer.next()public void compact()
public void flip()
protected void discardImpl()
discardImpl in class AbstractLexerBufferpublic CharBuffer view()
TokenBuffer
view in interface TokenBuffer<CharBuffer>public int getTokenStart()
public int getTokenEnd()
public int lastChar()
LexerBuffer
lastChar in interface LexerBufferprotected void restartImpl()
restartImpl in class AbstractLexerBuffer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||