com.springsource.util.parser.manifest.internal
Interface TokenStream
- All Known Implementing Classes:
- SimpleTokenStream
public interface TokenStream
Provides a stream of tokens for parsing.
Concurrent Semantics
This class is thread safe.
- Author:
- Andy Clement
next
Token next()
- Returns:
- the next token and consume it
peek
Token peek()
- Returns:
- the next token but do not consume it
peek
Token peek(int offset)
- Parameters:
offset
- the offset from the current TokenStream position, can be
negative.
- Returns:
- the token at that particular offset from the current position.
getPosition
int getPosition()
- Returns:
- position within the token stream
setPosition
void setPosition(int newPosition)
- Parameters:
newPosition
- the new position to move to in the token stream
getCount
int getCount()
- Returns:
- number of tokens in the stream
containsProblems
boolean containsProblems()
- Returns:
- true if problems were found whilst processing the input data
getProblems
java.util.List<ManifestProblem> getProblems()
- Returns:
- all the problems that occurred whilst processing the input data
getSourceContext
SourceContext getSourceContext()
- Returns:
- the source context which can be used to create improved messages
toFormattedString
java.lang.String toFormattedString(boolean b)
toFormattedString
java.lang.String toFormattedString()
hasMore
boolean hasMore()
- Returns:
- true if there are still more tokens to process (ie. the position
is not yet at the end)
peekLast
Token peekLast()
recordProblem
void recordProblem(ManifestProblem manifestProblem)