|
Send bugs or comments to Bernd Kühl (bernd@informatik.uni-osnabrueck.de) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--lolo.Scan
The abstract base class for recognizer classes.
| Inner Class Summary | |
static interface |
Scan.Action
Action code for a recognized symbols is represented by Action objects. |
static class |
Scan.State
A simple class to mark the result for nextChar(). |
| Field Summary | |
protected Scan.Action |
action
The action object; can be null for no action. |
protected boolean |
ignore
Marks if the symbol will be ignored. |
| Constructor Summary | |
Scan()
|
|
| Method Summary | |
void |
action(char[] buffer,
int off,
int len)
If action is not null, then the action method is called for this object. |
abstract boolean |
equals(java.lang.Object o)
Subclasses have to implement this method to indicate whether some other object is "equal to" this one. |
Scan.Action |
getAction()
Returns the action object. |
boolean |
getIgnore()
Returns the ignore state. |
abstract int |
hashCode()
Subclasses have to implement this method to return a hash code value for the receiver. |
abstract Scan.State |
nextChar(char ch)
Called by a Scanner for every new character. |
abstract void |
reset()
Resets this instance. |
Scan |
setAction(Scan.Action action)
Sets the action object. |
Scan |
setIgnore(boolean ignore)
Sets the ignore state. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected transient Scan.Action action
Scan.Actionprotected boolean ignore
| Constructor Detail |
public Scan()
| Method Detail |
public abstract void reset()
public Scan.Action getAction()
Scan.Actionpublic Scan setAction(Scan.Action action)
action - the new action object.Scan.Action
public void action(char[] buffer,
int off,
int len)
buffer - the character buffer holding the characters of the symbol.off - offset into the buffer.len - number of characters for the symbol.actionpublic Scan setIgnore(boolean ignore)
ignore - the new ignore state.public boolean getIgnore()
public abstract boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic abstract int hashCode()
hashCode in class java.lang.Objectpublic abstract Scan.State nextChar(char ch)
Scan.State,
Scanner
|
Send bugs or comments to Bernd Kühl (bernd@informatik.uni-osnabrueck.de) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||