sjm.parse.tokens
Class SymbolRootNode
java.lang.Object
|
+--sjm.parse.tokens.SymbolNode
|
+--sjm.parse.tokens.SymbolRootNode
- public class SymbolRootNode
- extends SymbolNode
This class is a special case of a SymbolNode
. A
SymbolRootNode
object has no symbol of its
own, but has children that represent all possible symbols.
- Version:
- 1.0
- Author:
- Steven J. Metsker
Constructor Summary |
SymbolRootNode()
Create and initialize a root node. |
Method Summary |
void |
add(java.lang.String s)
Add the given string as a symbol. |
java.lang.String |
ancestry()
A root node has no parent and no character of its own, so
its ancestry is "". |
protected SymbolNode |
findChildWithChar(char c)
|
protected void |
init()
|
java.lang.String |
nextSymbol(java.io.PushbackReader r,
int first)
Return a symbol string from a reader. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
children
protected SymbolNode[] children
SymbolRootNode
public SymbolRootNode()
- Create and initialize a root node.
add
public void add(java.lang.String s)
- Add the given string as a symbol.
- Parameters:
String
- the character sequence to add
ancestry
public java.lang.String ancestry()
- A root node has no parent and no character of its own, so
its ancestry is "".
- Overrides:
ancestry
in class SymbolNode
- Returns:
- an empty string
findChildWithChar
protected SymbolNode findChildWithChar(char c)
- Overrides:
findChildWithChar
in class SymbolNode
init
protected void init()
nextSymbol
public java.lang.String nextSymbol(java.io.PushbackReader r,
int first)
throws java.io.IOException
- Return a symbol string from a reader.
- Parameters:
PushbackReader
- a reader to read fromint
- the first character of this symbol, already
read from the reader- Returns:
- a symbol string from a reader