|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.g11ntoolkit.parser.java.SimpleNode
An implementation of the JavaCC generated Node interface.
This contains code needed for the G11NToolKit Tokenizer.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
See License Agreement.
| Field Summary | |
protected Node[] |
children
The children nodes of the current node. |
protected Token |
first
The first token for the node. |
protected int |
id
The node identifier. |
protected Token |
last
The last token for the node. |
private static java.util.logging.Logger |
log
The log used for all messages from this class. |
protected Node |
parent
The parent of the current node. |
protected JavaParser |
parser
The parser class. |
| Constructor Summary | |
SimpleNode(int i)
Constructor for a node given a node id. |
|
SimpleNode(JavaParser p,
int i)
Constructor for a given node id from a particular parser. |
|
| Method Summary | |
java.lang.Object |
acceptChildren(JavaParserVisitor visitor,
java.lang.Object data)
Accepts the children nodes contained by the visitor node. |
void |
dump(java.lang.String prefix)
Display all the nodes beginning at the current node and descending through all the children nodes. |
Token |
getFirstToken()
Returns the first token for the current node. |
Token |
getLastToken()
Returns the last token for the current node. |
java.lang.Object |
jjtAccept(JavaParserVisitor visitor,
java.lang.Object data)
Accepts the visitor node. |
void |
jjtAddChild(Node n,
int i)
Adds a child node to the current node. |
void |
jjtClose()
Close the current node. |
static Node |
jjtCreate(JavaParser p,
int id)
Creates a node given the parser and a node id. |
Node |
jjtGetChild(int i)
Returns the specified child node of the current node. |
int |
jjtGetNumChildren()
Returns the number of children nodes for the current node. |
Node |
jjtGetParent()
Returns the parent node for the current node. |
void |
jjtOpen()
Opens the current node. |
void |
jjtSetParent(Node n)
Sets the parent node to the specified node. |
java.lang.String |
toString()
Returns the string representation of the name of the current node. |
java.lang.String |
toString(java.lang.String prefix)
Returns the string representation of the name of the current node plus the specified prefix string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static java.util.logging.Logger log
protected Node parent
protected Node[] children
protected int id
protected JavaParser parser
protected Token first
protected Token last
| Constructor Detail |
public SimpleNode(int i)
i - an int specifying the node id
public SimpleNode(JavaParser p,
int i)
p - a JavaParser specifying the parser to usei - an int specifying the node id| Method Detail |
public static Node jjtCreate(JavaParser p,
int id)
p - a JavaParser specifying the parser to use
public void jjtOpen()
jjtOpen in interface Nodepublic void jjtClose()
jjtClose in interface Nodepublic Token getFirstToken()
public Token getLastToken()
public void jjtSetParent(Node n)
jjtSetParent in interface Noden - a Node specifying the new parent nodejjtGetParent()public Node jjtGetParent()
jjtGetParent in interface NodejjtSetParent(com.g11ntoolkit.parser.java.Node)
public void jjtAddChild(Node n,
int i)
jjtAddChild in interface Noden - a Node specifying the node to add as a child of the current nodei - an int specifying the node identifier of the node to be added as a child of the current nodejjtGetChild(int)public Node jjtGetChild(int i)
jjtGetChild in interface Nodei - an int specifying the node identifier of the requested child node
exceptionname - descriptionjjtGetChild(int)public int jjtGetNumChildren()
jjtGetNumChildren in interface Node
public java.lang.Object jjtAccept(JavaParserVisitor visitor,
java.lang.Object data)
jjtAccept in interface Nodevisitor - a JavaParserVisitor specifying the visitor node to acceptdata - an Object specifying ???
public java.lang.Object acceptChildren(JavaParserVisitor visitor,
java.lang.Object data)
visitor - a JavaParserVisitor specifying the visitor node that contains the children nodes to acceptdata - an Object specifying ???
public java.lang.String toString()
This method can be overriden in a subclasse of SimpleNode to customize the way the node appears when the tree is dumped. If the output uses more than one line, override the toString(String) method, otherwise overriding this method is probably adequate.
toString in class java.lang.ObjecttoString(String prefix)public java.lang.String toString(java.lang.String prefix)
This method can be overriden in a subclasse of SimpleNode to customize the way the node appears when the tree is dumped. If the output uses more than one line, override this method, otherwise overriding the toString() method is probably adequate.
prefix - a String specifying the prefix string to add to the name of the current node
toString()public void dump(java.lang.String prefix)
Override this method to customize how the node dumps out its children.
prefix - a String specifying the prefix string to add to the name of each node
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||