2017-07-29 21:02:41 -07:00
|
|
|
package org.nwapw.abacus.parsing;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
2017-07-29 21:36:39 -07:00
|
|
|
/**
|
|
|
|
* Interface that provides the ability to convert a string into a list of tokens.
|
2017-07-30 21:11:32 -07:00
|
|
|
*
|
2017-07-29 21:36:39 -07:00
|
|
|
* @param <T> the type of the tokens produced.
|
|
|
|
*/
|
2017-07-29 21:02:41 -07:00
|
|
|
public interface Tokenizer<T> {
|
|
|
|
|
2017-07-29 21:36:39 -07:00
|
|
|
/**
|
|
|
|
* Converts a string into tokens.
|
2017-07-30 21:11:32 -07:00
|
|
|
*
|
2017-07-29 21:36:39 -07:00
|
|
|
* @param string the string to convert.
|
|
|
|
* @return the list of tokens, or null on error.
|
|
|
|
*/
|
2017-07-29 21:02:41 -07:00
|
|
|
public List<T> tokenizeString(String string);
|
|
|
|
|
|
|
|
}
|