public class Tokenizer extends Object
| Constructor and Description |
|---|
Tokenizer()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(String regex,
int token)
Add a regular expression and a token id to the internal list of recognized tokens
|
static Tokenizer |
getExpressionTokenizer()
A static method that returns a tokenizer for mathematical expressions
|
LinkedList<Token> |
getTokens()
Get the tokens generated in the last call to tokenize.
|
void |
tokenize(String string)
Tokenize an input string.
|
public static Tokenizer getExpressionTokenizer()
public void add(String regex, int token)
regex - the regular expression to match againsttoken - the token id that the regular expression is linked topublic void tokenize(String string)
string - the string to tokenizepublic LinkedList<Token> getTokens()
Copyright © 2017. All rights reserved.