|
|||||||||||
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 k th 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.
SyntaxException
la(int)
public Token la(int k) throws ReadException, SyntaxException
k
th token.
k
- Number of token to look ahead.
k
th 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.
SyntaxException
public 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 |