Send bugs or comments to Bernd Kühl (bernd@informatik.uni-osnabrueck.de)

lolo.scans
Class SimpleIdentifier

java.lang.Object
  |
  +--lolo.Scan
        |
        +--lolo.scans.Scan
              |
              +--lolo.scans.SimpleIdentifier
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
JavaIdentifier

public class SimpleIdentifier
extends Scan

Instances of this class scan for [_a-zA-Z][_a-zA-Z0-9]*.

Author:
Bernd Kühl (bernd@informatik.uni-osnabrueck.de)
See Also:
Serialized Form

Inner classes inherited from class lolo.Scan
Scan.Action, Scan.State
 
Field Summary
protected  boolean start
          Marks if the first character is checked.
 
Fields inherited from class lolo.scans.Scan
reset, stateObject
 
Fields inherited from class lolo.Scan
action, ignore
 
Constructor Summary
SimpleIdentifier()
           
 
Method Summary
 Scan.State nextChar(char ch)
          Called by a Scanner for every new character.
 void reset()
          Resets this instance.
protected  boolean testPart(char ch)
          Tests the characters.
protected  boolean testStart(char ch)
          Tests the first character.
 
Methods inherited from class lolo.scans.Scan
equals, hashCode, toString
 
Methods inherited from class lolo.Scan
action, getAction, getIgnore, setAction, setIgnore
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

start

protected transient boolean start
Marks if the first character is checked.
Constructor Detail

SimpleIdentifier

public SimpleIdentifier()
Method Detail

reset

public void reset()
Description copied from class: Scan
Resets this instance.
Overrides:
reset in class Scan

testStart

protected boolean testStart(char ch)
Tests the first character.
Parameters:
ch - the first charatcer of the symbol.
Returns:
true if the character is a legal first character.

testPart

protected boolean testPart(char ch)
Tests the characters.
Parameters:
ch - the next charatcer of the symbol.
Returns:
true if the characters are a legal characters.

nextChar

public Scan.State nextChar(char ch)
Description copied from class: Scan
Called by a Scanner for every new character.
Overrides:
nextChar in class Scan
Following copied from class: lolo.Scan
Returns:
a State object to signal whether more characters are wanted and whether a symbol is found.
See Also:
Scan.State, Scanner

Send bugs or comments to Bernd Kühl (bernd@informatik.uni-osnabrueck.de)