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 EOS
-  flag the End of String
  
-   ERROR ERROR
-  Flag an error
  
-   NUMBER NUMBER
-  Flag a Number
  
-   nval nval
-  
  
-   sval sval
-  
  
-   UNKNOWN UNKNOWN
-  flag an unknown token
   
  -   ScanString() ScanString()
-  Instantiate the Class
  
-   ScanString(String) ScanString(String)
-  Instantaite the Class
   
  -   addKeyWord(String, int) addKeyWord(String, int)
-   Add a keyword/token pair to the table of keywords to scan for.
  
-   getKeyValue(String) getKeyValue(String)
-  
  
-   nextWord() nextWord()
-   Process the string and return the next token found.
  
-   resetKeyWords() resetKeyWords()
-    Clear the table containing the keyword/token pairs
  
-   setString(String) setString(String)
-  Set the string to be scanned
   
 UNKNOWN
UNKNOWN
  public final static int UNKNOWN
  -  flag an unknown token
 ERROR
ERROR
  public final static int ERROR
  -  Flag an error
 NUMBER
NUMBER
  public final static int NUMBER
  -  Flag a Number
 EOS
EOS
  public final static int EOS
  -  flag the End of String
 sval
sval
  public String sval
 nval
nval
  public double nval
   
 ScanString
ScanString
  public ScanString()
  -  Instantiate the Class
 ScanString
ScanString
  public ScanString(String s)
  -  Instantaite the Class
  
    -  Parameters:
    
-  s - String to scan for tokens
  
 
   
 setString
setString
  public void setString(String s)
  -  Set the string to be scanned
  
    -  Parameters:
    
-  s - String
  
 
 addKeyWord
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
getKeyValue
  public int getKeyValue(String s)
  
    -  Parameters:
    
-  s - keyword string
    
-  Returns:
    
-  the token corresponding to the keyword
  
 resetKeyWords
resetKeyWords
  public void resetKeyWords()
  -  Clear the table containing the keyword/token pairs
 nextWord
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