Implements: ITokenizer
Description
The AbstractTokenizer class defines a general tokenizer.
Fields
Properties
scanner
Scanner
protected
IScanner _scanner
Instance methods
clearCharacterStates
Clears all character states.
public
void clearCharacterStates()
getCharacterState
Gest the state for a given character.
public
ITokenizerState getCharacterState(int symbol)
- symbol: int - symbol
- returns: ITokenizerState - tokenizer state
hasNextToken
Finds out if the tokenizer has a next token.
public
Boolean hasNextToken() throws Exception
- returns: Boolean - true if it has a next token, false otherwise.
nextToken
Gets the next token.
public
Token nextToken() throws Exception
- returns: Token - next token
readNextToken
Reads the next token.
protected
Token readNextToken() throws Exception
- returns: Token - next token
setCharacterState
Sets the characters' state.
public
void setCharacterState(int fromSymbol, int toSymbol, ITokenizerState state) throws Exception
- fromSymbol: int - first symbol
- toSymbol: int - last symbol
- state: ITokenizerState - tokenizer state
tokenizeBuffer
Provides a token for a string buffer.
public
List<Token[]> tokenizeBuffer(String buffer) throws Exception
- buffer: String - buffer
- returns: Token[] - token
tokenizeBufferToStrings
Creates a list of token values.
public
ListtokenizeBufferToStrings(String buffer) throws Exception
- buffer: String - buffer
- returns: List
- list of token values
tokenizeStream
Creates a list of tokens
public
List<Token[]> tokenizeStream(IScanner scanner) throws Exception
tokenizeStreamToStrings
Creates a list of token values.
public
ListtokenizeStreamToStrings(IScanner scanner) throws Exception
- scanner: IScanner - scanner
- returns: List
- list of token values