peek_next_token
Description:
Parses the next token, without removing it from the input stream.
The token data is placed in the next_token
, next_value
, next_line
, and next_position
fields of the Scanner structure.
Note that, while the token is not removed from the input stream (i.e. the next call to get_next_token will return the same token), it will not be reevaluated. This can lead to surprising results when changing scope or the scanner configuration after peeking the next token. Getting the next token after switching the scope or configuration will return whatever was peeked before, regardless of any symbols that may have been added or removed in the new scope.
Parameters:
this |
a Scanner |
Returns:
the type of the token |