public class ScanWord extends StreamTokenizer
Modifier and Type | Field and Description |
---|---|
static int |
ERROR
Token returned when an error is encountered
|
static int |
STRING
Token returned when a string has been found.
|
static int |
UNKNOWN
Token returned when an unknown characters match nothing
|
Constructor and Description |
---|
ScanWord(InputStream in)
Instantiate the class with the parsed input stream.
|
Modifier and Type | Method and Description |
---|---|
void |
addKeyWord(String s,
int i)
Add a keyword/token pair.
|
int |
getKeyValue(String s)
return the matching token given the keyword
|
int |
nextWord()
Read the input stream and return the next token found.
|
void |
resetKeyWords()
Clear the internal table containing the keyword/token pairs
|
void |
setStringChar(char c)
Set the character that delimeters a string.
|
commentChar, eolIsSignificant, lineno, lowerCaseMode, nextToken, ordinaryChar, ordinaryChars, parseNumbers, pushBack, quoteChar, resetSyntax, slashSlashComments, slashStarComments, toString, whitespaceChars, wordChars
public static final int UNKNOWN
public static final int ERROR
public static final int STRING
public ScanWord(InputStream in)
in
- Input stream to read frompublic void addKeyWord(String s, int i)
s
- String contining the keywordi
- Token to return when the keyword is encountered.public int getKeyValue(String s)
s
- Keyword.public void resetKeyWords()
public int nextWord()
public void setStringChar(char c)
c
- character to delimeter strings. Default is ".Jas4pp 1.5 © Java Analysis Studio for Particle Physics