KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > antlr > collections > AST


1 package antlr.collections;
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/collections/AST.java#4 $
8  */

9
10 import antlr.Token;
11
12 /** Minimal AST node interface used by ANTLR AST generation
13  * and tree-walker.
14  */

15 public interface AST {
16     /** Add a (rightmost) child to this node */
17     public void addChild(AST c);
18
19     public boolean equals(AST t);
20
21     public boolean equalsList(AST t);
22
23     public boolean equalsListPartial(AST t);
24
25     public boolean equalsTree(AST t);
26
27     public boolean equalsTreePartial(AST t);
28
29     public ASTEnumeration findAll(AST tree);
30
31     public ASTEnumeration findAllPartial(AST subtree);
32
33     /** Get the first child of this node; null if no children */
34     public AST getFirstChild();
35
36     /** Get the next sibling in line after this one */
37     public AST getNextSibling();
38
39     /** Get the token text for this node */
40     public String JavaDoc getText();
41
42     /** Get the token type for this node */
43     public int getType();
44
45     public void initialize(int t, String JavaDoc txt);
46
47     public void initialize(AST t);
48
49     public void initialize(Token t);
50
51     /** Set the first child of a node. */
52     public void setFirstChild(AST c);
53
54     /** Set the next sibling after this one. */
55     public void setNextSibling(AST n);
56
57     /** Set the token text for this node */
58     public void setText(String JavaDoc text);
59
60     /** Set the token type for this node */
61     public void setType(int ttype);
62
63     public String JavaDoc toString();
64
65     public String JavaDoc toStringList();
66
67     public String JavaDoc toStringTree();
68 }
69
Popular Tags