|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.umlv.tatoo.runtime.buffer.impl.AbstractBufferWrapper fr.umlv.tatoo.runtime.buffer.impl.CharSequenceWrapper
public class CharSequenceWrapper
A CharSequenceWrapper
wraps a CharSequence
in order to allow
a lexer to process its content in order to have its tokens extracted.
Lexer
Constructor Summary | |
---|---|
CharSequenceWrapper(CharSequence seq,
LocationTracker tracker)
Constructs a CharSequenceWrapper which wraps specified CharSequence . |
Method Summary | |
---|---|
char |
charAt(int position)
|
protected void |
discardImpl()
|
int |
getPosition()
|
CharSequence |
getSequence()
|
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. |
int |
length()
|
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()
|
CharSequence |
subSequence(int start,
int end)
|
protected void |
unwindImpl(int l)
Performs unwind operation on buffer without taking care of locations |
CharSequence |
view()
Provides a view of all available tokens. |
Methods inherited from class fr.umlv.tatoo.runtime.buffer.impl.AbstractBufferWrapper |
---|
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 |
Methods inherited from interface java.lang.CharSequence |
---|
toString |
Constructor Detail |
---|
public CharSequenceWrapper(CharSequence seq, LocationTracker tracker)
CharSequenceWrapper
which wraps specified CharSequence
.
seq
- the CharSequence
to wraptracker
- the location trackerMethod Detail |
---|
public int getPosition()
public CharSequence getSequence()
public int getTokenStart()
public int getTokenEnd()
protected void unwindImpl(int l)
AbstractBufferWrapper
unwindImpl
in class AbstractBufferWrapper
l
- the number of characters to unwindLexerBuffer.unwind(int)
protected void resetImpl()
AbstractBufferWrapper
resetImpl
in class AbstractBufferWrapper
LexerBuffer.reset()
public boolean previousWasNewLine()
LexerBuffer
previousWasNewLine
in interface LexerBuffer
true
if the last unwinded character was an end of line;
false
otherwisepublic boolean hasRemaining()
LexerBuffer
hasRemaining
in interface LexerBuffer
public boolean read()
LexerBuffer
SimpleLexer.run()
.
read
in interface LexerBuffer
false
at end of streamprotected int nextImpl()
AbstractBufferWrapper
nextImpl
in class AbstractBufferWrapper
LexerBuffer.next()
protected void discardImpl()
discardImpl
in class AbstractBufferWrapper
public CharSequence view()
TokenBuffer
view
in interface TokenBuffer<CharSequence>
public char charAt(int position)
charAt
in interface CharSequence
public int length()
length
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public int lastChar()
LexerBuffer
lastChar
in interface LexerBuffer
protected void restartImpl()
restartImpl
in class AbstractBufferWrapper
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |