scanners
Class OOLexScanner
java.lang.Object
|
+--scanners.OOLexScanner
- public class OOLexScanner
- 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 oolex.Input |
input
The input instance. |
protected java.lang.Object |
node
node representing token |
protected oops.parser.Set |
NUMBER
The Set for the category NUMBER |
protected oops.parser.Parser |
parser
The parser. |
protected oolex.Scan |
scan
The scanner. |
protected oops.parser.Set |
tokenSet
null or lookahead identifying token |
Method Summary |
boolean |
advance()
move on to next token. |
boolean |
atEnd()
|
java.lang.Object |
node()
|
void |
scan(java.io.Reader in,
oops.parser.Parser parser)
initialize, read one symbol ahead. |
oops.parser.Set |
tokenSet()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
tokenSet
protected oops.parser.Set tokenSet
- null or lookahead identifying token
node
protected java.lang.Object node
- node representing token
input
protected oolex.Input input
- The input instance.
NUMBER
protected oops.parser.Set NUMBER
- The Set for the category NUMBER
scan
protected final oolex.Scan scan
- The scanner.
parser
protected oops.parser.Parser parser
- The parser. Used in action methode to set tokenSet.
OOLexScanner
public OOLexScanner()
scan
public void scan(java.io.Reader in,
oops.parser.Parser parser)
throws java.io.IOException
- initialize, read one symbol ahead.
- Specified by:
- scan in interface oops.parser.Scanner
- Parameters:
parser
- is used to screen symbols.
advance
public boolean advance()
throws java.io.IOException
- move on to next token.
- Specified by:
- advance in interface oops.parser.Scanner
- Returns:
- false if atEnd() becomes true.
atEnd
public boolean atEnd()
- Specified by:
- atEnd in interface oops.parser.Scanner
- Returns:
- true if positioned beyond tokens.
tokenSet
public oops.parser.Set tokenSet()
- Specified by:
- tokenSet in interface oops.parser.Scanner
- Returns:
- single-element lookahead set, null for unidentifiable token.
node
public java.lang.Object node()
- Specified by:
- node in interface oops.parser.Scanner
- Returns:
- node corresponding to token.
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
- Returns:
- a String representation.