|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Provides a stream of lexer tokens for use by (primarily) the parsing systems.
| Method Summary | |
boolean |
atEnd()
Returns true if the stream is out of tokens. |
boolean |
atEnd(boolean ignoringWhitespace)
Returns true if the stream is out of tokens, possibly ignoring trailing whitespace. |
void |
checkpoint()
Checkpoints a point in the stream that we can go back to |
Token |
consume(int type)
Consumes the next token. |
java.lang.String |
getSourceLocator()
Returns a description of the source location (typically a file path). |
Token |
la()
Looks-ahead to the next token. |
Token |
la(int k)
Looks-ahead to the kth token. |
void |
restore()
Restores to the previous checkpoint |
| Method Detail |
public Token la()
throws ReadException,
SyntaxException
This method is equivalent to la(1).
ReadException - If an error occurs attempting to lookahead
a token.
SyntaxExceptionla(int)
public Token la(int k)
throws ReadException,
SyntaxException
kth token.
k - Number of token to look ahead.
kth token or null if no
more tokens available.
ReadException - If an error occurs attempting to lookahead
a token.
SyntaxException
public Token consume(int type)
throws ReadException,
SyntaxException
type - The token type.
ReadException - If an error occurs attempting to consume
a token.
SyntaxExceptionpublic java.lang.String getSourceLocator()
public void checkpoint()
public void restore()
public boolean atEnd(boolean ignoringWhitespace)
public boolean atEnd()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||