scanners
Class StreamTokenizerScanner
java.lang.Object
|
+--scanners.StreamTokenizerScanner
- public class StreamTokenizerScanner
- extends java.lang.Object
- implements oops.parser.Scanner
Lexical analyzer for arithmetic examples.
- Author:
- Bernd Kuehl, Bernd.Kuehl@informatik.uni-osnabrueck.de, Axel-Tobias Schreiner, axel@informatik.uni-osnabrueck.de, Jan Kraneis, jkraneis@informatik.uni-osnabrueck.de
Field Summary |
protected oops.parser.Set |
NL
|
protected java.lang.Object |
node
A java.lang.Object. |
protected oops.parser.Set |
NUMBER
|
protected oops.parser.Parser |
parser
|
protected java.io.StreamTokenizer |
st
|
protected oops.parser.Set |
tokenSet
An oops.parser.Set. |
Method Summary |
boolean |
advance()
The advance() method needed by the oops.parser.Scanner interface. |
boolean |
atEnd()
The atEnd() method needed by the oops.parser.Scanner interface. |
java.lang.Object |
node()
The node() method needed by the oops.parser.Scanner interface. |
void |
scan(java.io.Reader r,
oops.parser.Parser parser)
The scan() method needed by the oops.parser.Scanner interface. |
oops.parser.Set |
tokenSet()
The tokenSet() method needed by the oops.parser.Scanner interface. |
java.lang.String |
toString()
Returns a String representation containing the current position. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
st
protected java.io.StreamTokenizer st
parser
protected oops.parser.Parser parser
NUMBER
protected oops.parser.Set NUMBER
NL
protected oops.parser.Set NL
tokenSet
protected oops.parser.Set tokenSet
- An oops.parser.Set. Should be null or lookahead identifying token.
node
protected java.lang.Object node
- A java.lang.Object.
StreamTokenizerScanner
public StreamTokenizerScanner()
scan
public void scan(java.io.Reader r,
oops.parser.Parser parser)
throws java.io.IOException
- The scan() method needed by the oops.parser.Scanner interface.
- Specified by:
- scan in interface oops.parser.Scanner
- Throws:
- java.io.IOException -
atEnd
public boolean atEnd()
- The atEnd() method needed by the oops.parser.Scanner interface.
- Specified by:
- atEnd in interface oops.parser.Scanner
- Returns:
- true at the end of the input file, else false.
advance
public boolean advance()
throws java.io.IOException
- The advance() method needed by the oops.parser.Scanner interface.
- Specified by:
- advance in interface oops.parser.Scanner
- Returns:
- true on advance, false at the end of the input file.
tokenSet
public oops.parser.Set tokenSet()
- The tokenSet() method needed by the oops.parser.Scanner interface.
- Specified by:
- tokenSet in interface oops.parser.Scanner
- Returns:
- single element lookahead set, null for unidentifiable token.
node
public java.lang.Object node()
- The node() method needed by the oops.parser.Scanner interface.
- Specified by:
- node in interface oops.parser.Scanner
- Returns:
- associated value for current input symbol.
toString
public java.lang.String toString()
- Returns a String representation containing the current position.
- Overrides:
- toString in class java.lang.Object