|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.umlv.tatoo.runtime.buffer.impl.ReaderWrapper
public class ReaderWrapper
A ReadWrapper wraps a Reader in order to allow
a lexer to process it and a developper to extract tokens recognized.
Lexer| Constructor Summary | |
|---|---|
protected |
ReaderWrapper(int capacity,
int increment,
Reader reader)
|
|
ReaderWrapper(Reader reader)
Constructs a reader wrapper used by the lexer to process the reader. |
| Method Summary | |
|---|---|
char |
charAt(int index)
|
void |
discard()
Discards all characters already recognized by the lexer. |
int |
getErrorChar()
|
LocationErrorContext |
getErrorContext()
Returns the context of an error that occurred in the lexer. |
boolean |
hasRemaining()
|
int |
length()
|
char |
next()
Reads the next character from the buffer. |
boolean |
notEof()
|
boolean |
previousWasNewLine()
Determines if the last unwinded character was an end of line. |
CharSequence |
subSequence(int start,
int end)
|
String |
toString()
|
void |
unwind(int l)
Unwinds l characters from the buffer. |
CharSequence |
view()
Provides a view of all available tokens. |
CharSequence |
viewCharacters(int nb)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ReaderWrapper(Reader reader)
reader - the reader to wrap
protected ReaderWrapper(int capacity,
int increment,
Reader reader)
| Method Detail |
|---|
public void unwind(int l)
CharacterBufferl characters from the buffer.
unwind in interface CharacterBufferl - the number of characters to unwindpublic boolean previousWasNewLine()
CharacterBuffer
previousWasNewLine in interface CharacterBuffertrue if the last unwinded character was an end of line;
false otherwisepublic boolean notEof()
public boolean hasRemaining()
public char next()
CharacterBuffer
next in interface CharacterBufferpublic void discard()
TokenBuffer
discard in interface TokenBufferpublic CharSequence viewCharacters(int nb)
public CharSequence view()
TokenBuffer
view in interface TokenBufferpublic LocationErrorContext getErrorContext()
ErrorContextBuffer
getErrorContext in interface ErrorContextBuffer<LocationErrorContext>public int getErrorChar()
getErrorChar in interface ErrorContextBuffer<LocationErrorContext>public int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequence
public CharSequence subSequence(int start,
int end)
subSequence in interface CharSequencepublic String toString()
toString in interface CharSequencetoString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||