oops.parser
Interface Scanner
- public interface Scanner
describes what a scanner for an oops-generated parser must do.
Method Summary |
boolean |
advance()
move on to next token. |
boolean |
atEnd()
|
java.lang.Object |
node()
|
void |
scan(java.io.Reader in,
Parser parser)
initialize, read one symbol ahead. |
Set |
tokenSet()
|
scan
public void scan(java.io.Reader in,
Parser parser)
throws java.io.IOException
- initialize, read one symbol ahead.
- Parameters:
parser
- is used to screen symbols.
advance
public boolean advance()
throws java.io.IOException
- move on to next token.
- Returns:
- false if atEnd() becomes true.
atEnd
public boolean atEnd()
- Returns:
- true if positioned beyond tokens.
tokenSet
public Set tokenSet()
- Returns:
- single-element lookahead set, null for unidentifiable token.
node
public java.lang.Object node()
- Returns:
- node corresponding to token.