KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > persistence > antlr > TreeSpecifierNode


1 package persistence.antlr;
2
3 /* ANTLR Translator Generator
4  * Project led by Terence Parr at http://www.jGuru.com
5  * Software rights: http://www.antlr.org/license.html
6  *
7  */

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