Class graph.ScanString
All Packages Class Hierarchy This Package Previous Next Index
Class graph.ScanString
java.lang.Object
|
+----graph.ScanString
- public class ScanString
- extends Object
This class is similar to the ScanWord class, except it scans a string
for keywords rather than an input stream.
- Version:
- 1.5, 1996/07/12 00:35:49
- Author:
- Leigh Brookshaw
-
EOS
- flag the End of String
-
ERROR
- Flag an error
-
NUMBER
- Flag a Number
-
nval
-
-
sval
-
-
UNKNOWN
- flag an unknown token
-
ScanString()
- Instantiate the Class
-
ScanString(String)
- Instantaite the Class
-
addKeyWord(String, int)
- Add a keyword/token pair to the table of keywords to scan for.
-
getKeyValue(String)
-
-
nextWord()
- Process the string and return the next token found.
-
resetKeyWords()
- Clear the table containing the keyword/token pairs
-
setString(String)
- Set the string to be scanned
UNKNOWN
public final static int UNKNOWN
- flag an unknown token
ERROR
public final static int ERROR
- Flag an error
NUMBER
public final static int NUMBER
- Flag a Number
EOS
public final static int EOS
- flag the End of String
sval
public String sval
nval
public double nval
ScanString
public ScanString()
- Instantiate the Class
ScanString
public ScanString(String s)
- Instantaite the Class
- Parameters:
- s - String to scan for tokens
setString
public void setString(String s)
- Set the string to be scanned
- Parameters:
- s - String
addKeyWord
public void addKeyWord(String s,
int i)
- Add a keyword/token pair to the table of keywords to scan for.
- Parameters:
- s - keyword string to scan for
- i - token to return when the keyword is found
getKeyValue
public int getKeyValue(String s)
- Parameters:
- s - keyword string
- Returns:
- the token corresponding to the keyword
resetKeyWords
public void resetKeyWords()
- Clear the table containing the keyword/token pairs
nextWord
public int nextWord()
- Process the string and return the next token found.
- Returns:
- token found
All Packages Class Hierarchy This Package Previous Next Index