|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The minimal interface provided by all Lexers.
Method Summary | |
char |
consume()
Eats a single character from the input stream. |
void |
delegate(Lexer to)
Delegates our duties to another Lexer. |
int |
getColumn()
Returns the current column on that line. |
Lexer |
getDelegate()
Gets the lexer that is actually doing the nextToken()
work, if it isn't us. |
int |
getLine()
Returns the current line number. |
Lexer |
getSource()
Gets the lexer from which this lexer is obtaining characters. |
boolean |
isDelegated()
Returns true if we are delegated. |
boolean |
isExternallySourced()
Returns true if we have an external source. |
char |
la()
Returns the next character, without consuming it. |
char |
la(int k)
Returns the next k th character, without consuming any. |
Token |
nextToken()
Finds and returns (consuming) the next token from the underlying stream. |
void |
reset()
Resets a lexer for reuse. |
void |
setSource(Lexer source)
Sets the source lexer. |
void |
undelegate()
Retakes responsibility for our duties. |
void |
unsetSource()
Unsets the source lexer. |
Method Detail |
public Lexer getDelegate()
nextToken()
work, if it isn't us.
public Lexer getSource()
public Token nextToken() throws ReadException, LexerException
ReadException
LexerException
public void reset()
public void delegate(Lexer to)
public void undelegate()
public boolean isDelegated()
public void setSource(Lexer source)
public void unsetSource()
public boolean isExternallySourced()
public int getLine()
public int getColumn()
public char la() throws LexerException, ReadException
LexerException
ReadException
public char la(int k) throws LexerException, ReadException
k
th character, without consuming any.
LexerException
ReadException
public char consume() throws LexerException, ReadException
LexerException
ReadException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |