public class ScanString extends Object
Modifier and Type | Field and Description |
---|---|
static int |
EOS
flag the End of String
|
static int |
ERROR
Flag an error
|
static int |
NUMBER
Flag a Number
|
double |
nval |
String |
sval |
static int |
UNKNOWN
flag an unknown token
|
Constructor and Description |
---|
ScanString()
Instantiate the Class
|
ScanString(String s)
Instantaite the Class
|
Modifier and Type | Method and Description |
---|---|
void |
addKeyWord(String s,
int i)
Add a keyword/token pair to the table of keywords to scan for.
|
int |
getKeyValue(String s) |
int |
nextWord()
Process the string and return the next token found.
|
void |
resetKeyWords()
Clear the table containing the keyword/token pairs
|
void |
setString(String s)
Set the string to be scanned
|
public static final int UNKNOWN
public static final int ERROR
public static final int NUMBER
public static final int EOS
public String sval
public double nval
public ScanString()
public ScanString(String s)
s
- String to scan for tokenspublic void setString(String s)
s
- Stringpublic void addKeyWord(String s, int i)
s
- keyword string to scan fori
- token to return when the keyword is foundpublic int getKeyValue(String s)
s
- keyword stringpublic void resetKeyWords()
public int nextWord()
Jas4pp 1.5 © Java Analysis Studio for Particle Physics