KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > antlr > TreeSpecifierNode


1 package antlr;
2
3 /* ANTLR Translator Generator
4  * Project led by Terence Parr at http://www.jGuru.com
5  * Software rights: http://www.antlr.org/RIGHTS.html
6  *
7  * $Id: //depot/code/org.antlr/main/main/antlr/TreeSpecifierNode.java#4 $
8  */

9
10 class TreeSpecifierNode {
11     private TreeSpecifierNode parent = null;
12     private TreeSpecifierNode firstChild = null;
13     private TreeSpecifierNode nextSibling = null;
14     private Token tok;
15
16
17     TreeSpecifierNode(Token tok_) {
18         tok = tok_;
19     }
20
21     public TreeSpecifierNode getFirstChild() {
22         return firstChild;
23     }
24
25     public TreeSpecifierNode getNextSibling() {
26         return nextSibling;
27     }
28
29     // Accessors
30
public TreeSpecifierNode getParent() {
31         return parent;
32     }
33
34     public Token getToken() {
35         return tok;
36     }
37
38     public void setFirstChild(TreeSpecifierNode child) {
39         firstChild = child;
40         child.parent = this;
41     }
42
43     // Structure-building
44
public void setNextSibling(TreeSpecifierNode sibling) {
45         nextSibling = sibling;
46         sibling.parent = parent;
47     }
48 }
49
Popular Tags